Modifier and Type | Method and Description |
---|---|
void |
clear(boolean isDuringShutdown) |
boolean |
containsKey(Data key) |
void |
destroy(boolean isDuringShutdown) |
void |
disposeDeferredBlocks() |
MapEntriesWithCursor |
fetchEntries(int tableIndex,
int size,
SerializationService serializationService)
Fetch minimally
size items from the tableIndex position. |
MapKeysWithCursor |
fetchKeys(int tableIndex,
int size)
Fetch minimally
size keys from the tableIndex position. |
R |
get(Data key) |
EntryCostEstimator |
getEntryCostEstimator() |
R |
getIfSameKey(Data key)
Gives the same result as
Storage.get(Object) , but with the additional constraint
that the supplied key must not just be equal to, but be exactly the same key blob (at the
same memory address) as the one stored. |
Iterable<LazyEntryViewFromRecord> |
getRandomSamples(int sampleCount)
Used for sampling based eviction, returns sampled entries.
|
boolean |
isEmpty() |
Iterator<R> |
mutationTolerantIterator()
Returned iterator from this method doesn't throw
ConcurrentModificationException to fail fast. |
void |
put(Data key,
R record) |
void |
removeRecord(R record) |
void |
setEntryCostEstimator(EntryCostEstimator entryCostEstimator) |
int |
size() |
protected void |
updateCostEstimate(long entrySize) |
void |
updateRecordValue(Data key,
R record,
Object value) |
Collection<R> |
values() |
public void clear(boolean isDuringShutdown)
public Collection<R> values()
public Iterator<R> mutationTolerantIterator()
Storage
ConcurrentModificationException
to fail fast.
Because fail fast may not be the desired behaviour always. For example if you are caching an iterator as in
AbstractEvictableRecordStore.expirationIterator
and you know that in next rounds you will
eventually visit all entries, you don't need fail fast behaviour.
Note that returned iterator is not thread-safe !!!mutationTolerantIterator
in interface Storage<Data,R extends Record>
public void updateRecordValue(Data key, R record, Object value)
updateRecordValue
in interface Storage<Data,R extends Record>
public R getIfSameKey(Data key)
Storage
Storage.get(Object)
, but with the additional constraint
that the supplied key must not just be equal to, but be exactly the same key blob (at the
same memory address) as the one stored. The implementation of this method is only needed
for the HD memory-based implementations.getIfSameKey
in interface Storage<Data,R extends Record>
public void destroy(boolean isDuringShutdown)
public EntryCostEstimator getEntryCostEstimator()
getEntryCostEstimator
in interface Storage<Data,R extends Record>
public boolean containsKey(Data key)
containsKey
in interface Storage<Data,R extends Record>
public void removeRecord(R record)
removeRecord
in interface Storage<Data,R extends Record>
protected void updateCostEstimate(long entrySize)
public void setEntryCostEstimator(EntryCostEstimator entryCostEstimator)
setEntryCostEstimator
in interface Storage<Data,R extends Record>
public void disposeDeferredBlocks()
disposeDeferredBlocks
in interface Storage<Data,R extends Record>
public Iterable<LazyEntryViewFromRecord> getRandomSamples(int sampleCount)
Storage
getRandomSamples
in interface Storage<Data,R extends Record>
sampleCount
- sample count.public MapKeysWithCursor fetchKeys(int tableIndex, int size)
Storage
size
keys from the tableIndex
position. The key is fetched on-heap.
NOTE: The implementation is free to return more than size
items. This can happen if we cannot easily resume
from the last returned item by receiving the tableIndex
of the last item. The index can represent a bucket
with multiple items and in this case the returned object will contain all items in that bucket, regardless if we exceed
the requested size
.
public MapEntriesWithCursor fetchEntries(int tableIndex, int size, SerializationService serializationService)
Storage
size
items from the tableIndex
position. Both the key and value are fetched on-heap.
NOTE: The implementation is free to return more than size
items. This can happen if we cannot easily resume
from the last returned item by receiving the tableIndex
of the last item. The index can represent a bucket
with multiple items and in this case the returned object will contain all items in that bucket, regardless if we exceed
the requested size
.
fetchEntries
in interface Storage<Data,R extends Record>
tableIndex
- the index (position) from which to resumesize
- the minimal count of returned itemsCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.