public interface MapCodecTemplate
| Modifier and Type | Method and Description |
|---|---|
Object |
addEntryListener(String name,
boolean includeValue,
int listenerFlags,
boolean localOnly)
Adds a MapListener for this map.
|
Object |
addEntryListenerToKey(String name,
Data key,
boolean includeValue,
int listenerFlags,
boolean localOnly)
Adds a MapListener for this map.
|
Object |
addEntryListenerToKeyWithPredicate(String name,
Data key,
Data predicate,
boolean includeValue,
int listenerFlags,
boolean localOnly)
Adds a MapListener for this map.
|
Object |
addEntryListenerWithPredicate(String name,
Data predicate,
boolean includeValue,
int listenerFlags,
boolean localOnly)
Adds an continuous entry listener for this map.
|
void |
addIndex(String name,
String attribute,
boolean ordered)
Adds an index to this map for the specified entries so that queries can run faster.If you are querying your values
mostly based on age and active then you should consider indexing these fields.
|
Object |
addInterceptor(String name,
Data interceptor)
Adds an interceptor for this map.
|
Object |
addNearCacheEntryListener(String name,
int listenerFlags,
boolean localOnly)
Adds an entry listener for this map.
|
Object |
addNearCacheInvalidationListener(String name,
int listenerFlags,
boolean localOnly)
Adds listener to map.
|
Object |
addPartitionLostListener(String name,
boolean localOnly)
Adds a MapPartitionLostListener.
|
Object |
aggregate(String name,
Data aggregator)
Applies the aggregation logic on all map entries and returns the result
|
Object |
aggregateWithPredicate(String name,
Data aggregator,
Data predicate)
Applies the aggregation logic on map entries filtered with the Predicate and returns the result
|
Object |
assignAndGetUuids()
Assigns a new UUID to each partitions or gets existing ones.
|
void |
clear(String name)
This method clears the map and invokes MapStore#deleteAll deleteAll on MapStore which, if connected to a database,
will delete the records from that database.
|
void |
clearNearCache(String name,
Address target) |
Object |
containsKey(String name,
Data key,
long threadId)
Returns true if this map contains a mapping for the specified key.
|
Object |
containsValue(String name,
Data value)
Returns true if this map maps one or more keys to the specified value.This operation will probably require time
linear in the map size for most implementations of the Map interface.
|
void |
delete(String name,
Data key,
long threadId)
Removes the mapping for a key from this map if it is present.Unlike remove(Object), this operation does not return
the removed value, which avoids the serialization cost of the returned value.If the removed value will not be used,
a delete operation is preferred over a remove operation for better performance.
|
Object |
entriesWithPagingPredicate(String name,
Data predicate) |
Object |
entriesWithPredicate(String name,
Data predicate)
Queries the map based on the specified predicate and returns the matching entries.Specified predicate
runs on all members in parallel.
|
Object |
entrySet(String name)
Returns a Set clone of the mappings contained in this map.
|
Object |
eventJournalRead(String name,
long startSequence,
int minSize,
int maxSize,
Data predicate,
Data projection)
Reads from the map event journal in batches.
|
Object |
eventJournalSubscribe(String name)
Performs the initial subscription to the map event journal.
|
Object |
evict(String name,
Data key,
long threadId)
Evicts the specified key from this map.
|
void |
evictAll(String name)
Evicts all keys from this map except the locked ones.
|
Object |
executeOnAllKeys(String name,
Data entryProcessor)
Applies the user defined EntryProcessor to the all entries in the map.Returns the results mapped by each key in the map.
|
Object |
executeOnKey(String name,
Data entryProcessor,
Data key,
long threadId)
Applies the user defined EntryProcessor to the entry mapped by the key.
|
Object |
executeOnKeys(String name,
Data entryProcessor,
List<Data> keys)
Applies the user defined EntryProcessor to the entries mapped by the collection of keys.The results mapped by
each key in the collection.
|
Object |
executeWithPredicate(String name,
Data entryProcessor,
Data predicate)
Applies the user defined EntryProcessor to the entries in the map which satisfies provided predicate.
|
Object |
fetchEntries(String name,
int partitionId,
int tableIndex,
int batch)
Fetches specified number of entries from the specified partition starting from specified table index.
|
Object |
fetchKeys(String name,
int partitionId,
int tableIndex,
int batch)
Fetches specified number of keys from the specified partition starting from specified table index.
|
Object |
fetchNearCacheInvalidationMetadata(List<String> names,
Address address)
Fetches invalidation metadata from partitions of map.
|
Object |
fetchWithQuery(String name,
int tableIndex,
int batch,
Data projection,
Data predicate)
Fetches the specified number of entries from the specified partition starting from specified table index
that match the predicate and applies the projection logic on them.
|
void |
flush(String name)
If this map has a MapStore, this method flushes all the local dirty entries by calling MapStore.storeAll()
and/or MapStore.deleteAll().
|
void |
forceUnlock(String name,
Data key,
long referenceId)
Releases the lock for the specified key regardless of the lock owner.It always successfully unlocks the key,
never blocks,and returns immediately.
|
Object |
get(String name,
Data key,
long threadId)
This method returns a clone of the original value, so modifying the returned value does not change the actual
value in the map.
|
Object |
getAll(String name,
List<Data> keys)
Returns the entries for the given keys.
|
Object |
getEntryView(String name,
Data key,
long threadId)
Returns the EntryView for the specified key.
|
Object |
isEmpty(String name)
Returns true if this map contains no key-value mappings.
|
Object |
isLocked(String name,
Data key)
Checks the lock for the specified key.If the lock is acquired then returns true, else returns false.
|
Object |
keySet(String name)
Returns a set clone of the keys contained in this map.
|
Object |
keySetWithPagingPredicate(String name,
Data predicate) |
Object |
keySetWithPredicate(String name,
Data predicate)
Queries the map based on the specified predicate and returns the keys of matching entries.
|
void |
loadAll(String name,
boolean replaceExistingValues)
Loads all keys into the store.
|
void |
loadGivenKeys(String name,
List<Data> keys,
boolean replaceExistingValues)
Loads the given keys.
|
void |
lock(String name,
Data key,
long threadId,
long ttl,
long referenceId)
Acquires the lock for the specified lease time.After lease time, lock will be released.If the lock is not
available then the current thread becomes disabled for thread scheduling purposes and lies dormant until the lock
has been acquired.
|
Object |
project(String name,
Data projection)
Applies the projection logic on all map entries and returns the result
|
Object |
projectWithPredicate(String name,
Data projection,
Data predicate)
Applies the projection logic on map entries filtered with the Predicate and returns the result
|
Object |
put(String name,
Data key,
Data value,
long threadId,
long ttl)
Puts an entry into this map with a given ttl (time to live) value.Entry will expire and get evicted after the ttl
If ttl is 0, then the entry lives forever.This method returns a clone of the previous value, not the original
(identically equal) value previously put into the map.Time resolution for TTL is seconds.
|
void |
putAll(String name,
List<Map.Entry<Data,Data>> entries)
Copies all of the mappings from the specified map to this map (optional operation).The effect of this call is
equivalent to that of calling put(Object,Object) put(k, v) on this map once for each mapping from key k to value
v in the specified map.The behavior of this operation is undefined if the specified map is modified while the
operation is in progress.
|
Object |
putIfAbsent(String name,
Data key,
Data value,
long threadId,
long ttl)
Puts an entry into this map with a given ttl (time to live) value if the specified key is not already associated
with a value.
|
void |
putTransient(String name,
Data key,
Data value,
long threadId,
long ttl)
Same as put except that MapStore, if defined, will not be called to store/persist the entry.
|
Object |
remove(String name,
Data key,
long threadId)
Removes the mapping for a key from this map if it is present (optional operation).
|
void |
removeAll(String name,
Data predicate)
Removes all entries which match with the supplied predicate
|
Object |
removeEntryListener(String name,
String registrationId)
Removes the specified entry listener.
|
Object |
removeIfSame(String name,
Data key,
Data value,
long threadId)
Removes the mapping for a key from this map if existing value equal to the this value
|
Object |
removeInterceptor(String name,
String id)
Removes the given interceptor for this map so it will not intercept operations anymore.
|
Object |
removePartitionLostListener(String name,
String registrationId)
Removes the specified map partition lost listener.
|
Object |
replace(String name,
Data key,
Data value,
long threadId)
Replaces the entry for a key only if currently mapped to a given value.
|
Object |
replaceIfSame(String name,
Data key,
Data testValue,
Data value,
long threadId)
Replaces the the entry for a key only if existing values equal to the testValue
|
void |
set(String name,
Data key,
Data value,
long threadId,
long ttl)
Puts an entry into this map with a given ttl (time to live) value.Entry will expire and get evicted after the ttl
If ttl is 0, then the entry lives forever.
|
Object |
size(String name)
Returns the number of key-value mappings in this map.
|
Object |
submitToKey(String name,
Data entryProcessor,
Data key,
long threadId)
Applies the user defined EntryProcessor to the entry mapped by the key.
|
Object |
tryLock(String name,
Data key,
long threadId,
long lease,
long timeout,
long referenceId)
Tries to acquire the lock for the specified key for the specified lease time.After lease time, the lock will be
released.If the lock is not available, then the current thread becomes disabled for thread scheduling
purposes and lies dormant until one of two things happens the lock is acquired by the current thread, or
the specified waiting time elapses.
|
Object |
tryPut(String name,
Data key,
Data value,
long threadId,
long timeout)
Tries to put the given key and value into this map within a specified timeout value.
|
Object |
tryRemove(String name,
Data key,
long threadId,
long timeout)
Tries to remove the entry with the given key from this map within the specified timeout value.
|
void |
unlock(String name,
Data key,
long threadId,
long referenceId)
Releases the lock for the specified key.
|
Object |
values(String name)
Returns a collection clone of the values contained in this map.
|
Object |
valuesWithPagingPredicate(String name,
Data predicate)
Queries the map based on the specified predicate and returns the values of matching entries.
|
Object |
valuesWithPredicate(String name,
Data predicate)
Queries the map based on the specified predicate and returns the values of matching entries.Specified predicate
runs on all members in parallel.
|
Object put(String name, Data key, Data value, long threadId, long ttl)
name - Name of the map.key - Key for the map entry.value - Value for the map entry.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.ttl - The duration in milliseconds after which this entry shall be deleted. O means infinite.Object get(String name, Data key, long threadId)
name - Name of the map.key - Key for the map entry.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.Object remove(String name, Data key, long threadId)
name - Name of the map.key - Key for the map entry.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.Object replace(String name, Data key, Data value, long threadId)
name - Name of the map.key - Key for the map entry.value - New value for the map entry.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.Object replaceIfSame(String name, Data key, Data testValue, Data value, long threadId)
name - Name of the map.key - Key for the map entry.testValue - Test the existing value against this value to find if equal to this value.value - New value for the map entry. Only replace with this value if existing value is equal to the testValue.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.Object containsKey(String name, Data key, long threadId)
name - Name of the map.key - Key for the map entry.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.Object containsValue(String name, Data value)
name - Name of the map.value - Value to check if exists in the map.Object removeIfSame(String name, Data key, Data value, long threadId)
name - Name of the map.key - Key for the map entry.value - Test the existing value against this value to find if equal to this value. Only remove the entry from the map if the value is equal to this value.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.void delete(String name, Data key, long threadId)
name - Name of the map.key - Key for the map entry.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.void flush(String name)
name - Name of the map.Object tryRemove(String name, Data key, long threadId, long timeout)
name - Name of the map.key - Key for the map entry.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.timeout - maximum time in milliseconds to wait for acquiring the lock for the key.Object tryPut(String name, Data key, Data value, long threadId, long timeout)
name - Name of the map.key - Key for the map entry.value - New value for the map entry.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.timeout - maximum time in milliseconds to wait for acquiring the lock for the key.void putTransient(String name, Data key, Data value, long threadId, long ttl)
name - Name of the map.key - Key for the map entry.value - New value for the map entry.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.ttl - The duration in milliseconds after which this entry shall be deleted. O means infinite.Object putIfAbsent(String name, Data key, Data value, long threadId, long ttl)
name - Name of the map.key - Key for the map entry.value - New value for the map entry.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.ttl - The duration in milliseconds after which this entry shall be deleted. O means infinite.void set(String name, Data key, Data value, long threadId, long ttl)
name - Name of the map.key - Key for the map entry.value - New value for the map entry.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.ttl - The duration in milliseconds after which this entry shall be deleted. O means infinite.void lock(String name, Data key, long threadId, long ttl, @Since(value="1.2") long referenceId)
name - Name of the map.key - Key for the map entry.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.ttl - The duration in milliseconds after which this entry shall be deleted. O means infinite.referenceId - The client-wide unique id for this request. It is used to make the request idempotent by sending the same reference id during retries.Object tryLock(String name, Data key, long threadId, long lease, long timeout, @Since(value="1.2") long referenceId)
name - Name of the map.key - Key for the map entry.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.lease - time in milliseconds to wait before releasing the lock.timeout - maximum time to wait for getting the lock.referenceId - The client-wide unique id for this request. It is used to make the request idempotent by sending the same reference id during retries.Object isLocked(String name, Data key)
name - name of mapkey - Key for the map entry to check if it is locked.void unlock(String name, Data key, long threadId, @Since(value="1.2") long referenceId)
name - name of mapkey - Key for the map entry to unlockthreadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.referenceId - The client-wide unique id for this request. It is used to make the request idempotent by sending the same reference id during retries.Object addInterceptor(String name, Data interceptor)
name - name of mapinterceptor - interceptor to addObject removeInterceptor(String name, String id)
name - name of mapid - of interceptorObject addEntryListenerToKeyWithPredicate(String name, Data key, Data predicate, boolean includeValue, int listenerFlags, boolean localOnly)
name - name of mapkey - Key for the map entry.predicate - predicate for filtering entries.includeValue - true if EntryEvent should
contain the value.listenerFlags - flags of enabled listeners.localOnly - if true fires events that originated from this node only, otherwise fires all eventsObject addEntryListenerWithPredicate(String name, Data predicate, boolean includeValue, int listenerFlags, boolean localOnly)
name - name of mappredicate - predicate for filtering entries.includeValue - true if EntryEvent should
contain the value.listenerFlags - flags of enabled listeners.localOnly - if true fires events that originated from this node only, otherwise fires all eventsObject addEntryListenerToKey(String name, Data key, boolean includeValue, int listenerFlags, boolean localOnly)
name - name of mapkey - Key for the map entry.includeValue - true if EntryEvent should contain the value.listenerFlags - flags of enabled listeners.localOnly - if true fires events that originated from this node only, otherwise fires all eventsObject addEntryListener(String name, boolean includeValue, int listenerFlags, boolean localOnly)
name - name of mapincludeValue - true if EntryEvent should contain the value.listenerFlags - flags of enabled listeners.localOnly - if true fires events that originated from this node only, otherwise fires all eventsObject addNearCacheEntryListener(String name, int listenerFlags, boolean localOnly)
name - name of maplistenerFlags - flags of enabled listeners.localOnly - if true fires events that originated from this node only, otherwise fires all eventsObject removeEntryListener(String name, String registrationId)
name - name of mapregistrationId - id of registered listener.Object addPartitionLostListener(String name, boolean localOnly)
name - name of maplocalOnly - if true fires events that originated from this node only, otherwise fires all eventsObject removePartitionLostListener(String name, String registrationId)
name - name of mapregistrationId - id of registerObject getEntryView(String name, Data key, long threadId)
name - name of mapkey - the key of the entry.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.Object evict(String name, Data key, long threadId)
name - name of mapkey - the specified key to evict from this map.threadId - The id of the user thread performing the operation. It is used to guarantee that only the lock holder thread (if a lock exists on the entry) can perform the requested operation.void evictAll(String name)
name - name of mapvoid loadAll(String name, boolean replaceExistingValues)
name - name of mapreplaceExistingValues - when true, existing values in the Map will
be replaced by those loaded from the MapLoadervoid loadGivenKeys(String name, List<Data> keys, boolean replaceExistingValues)
name - name of mapkeys - keys to loadreplaceExistingValues - when true, existing values in the Map will be replaced by those loaded from the MapLoaderObject keySet(String name)
name - name of the mapcom.hazelcast.instance.GroupProperty#QUERY_RESULT_SIZE_LIMITObject getAll(String name, List<Data> keys)
name - name of mapkeys - keys to getObject values(String name)
name - name of mapcom.hazelcast.instance.GroupProperty#QUERY_RESULT_SIZE_LIMITObject entrySet(String name)
name - name of mapcom.hazelcast.instance.GroupProperty#QUERY_RESULT_SIZE_LIMITObject keySetWithPredicate(String name, Data predicate)
name - name of map.predicate - specified query criteria.com.hazelcast.instance.GroupProperty#QUERY_RESULT_SIZE_LIMITObject valuesWithPredicate(String name, Data predicate)
name - name of mappredicate - specified query criteria.com.hazelcast.instance.GroupProperty#QUERY_RESULT_SIZE_LIMITObject entriesWithPredicate(String name, Data predicate)
name - name of mappredicate - specified query criteria.com.hazelcast.instance.GroupProperty#QUERY_RESULT_SIZE_LIMITvoid addIndex(String name, String attribute, boolean ordered)
name - name of mapattribute - index attribute of valueordered - true if index should be ordered, false otherwise.Object size(String name)
name - of mapObject isEmpty(String name)
name - name of mapvoid putAll(String name, List<Map.Entry<Data,Data>> entries)
name - name of mapentries - mappings to be stored in this mapvoid clear(String name)
name - of mapObject executeOnKey(String name, Data entryProcessor, Data key, long threadId)
name - name of mapentryProcessor - processor to execute on the map entrykey - the key of the map entry.Object submitToKey(String name, Data entryProcessor, Data key, long threadId)
name - name of mapentryProcessor - entry processor to be executed on the entry.key - the key of the map entry.Object executeOnAllKeys(String name, Data entryProcessor)
name - name of mapentryProcessor - entry processor to be executed.Object executeWithPredicate(String name, Data entryProcessor, Data predicate)
name - name of mapentryProcessor - entry processor to be executed.predicate - specified query criteria.Object executeOnKeys(String name, Data entryProcessor, List<Data> keys)
name - name of mapentryProcessor - entry processor to be executed.keys - The keys for the entries for which the entry processor shall be executed on.void forceUnlock(String name, Data key, @Since(value="1.2") long referenceId)
name - name of mapkey - the key of the map entry.referenceId - The client-wide unique id for this request. It is used to make the request idempotent by sending the same reference id during retries.Object keySetWithPagingPredicate(String name, Data predicate)
name - name of mappredicate - specified query criteria.Object valuesWithPagingPredicate(String name, Data predicate)
name - name of mappredicate - specified query criteria.com.hazelcast.instance.GroupProperty#QUERY_RESULT_SIZE_LIMITObject entriesWithPagingPredicate(String name, Data predicate)
name - name of mappredicate - specified query criteria.@Since(value="1.1") Object fetchKeys(String name, int partitionId, int tableIndex, int batch)
name - Name of the map.partitionId - The partition id which owns this record store.tableIndex - The slot number (or index) to start the iteratorbatch - The number of items to be batched@Since(value="1.1") Object fetchEntries(String name, int partitionId, int tableIndex, int batch)
name - Name of the map.partitionId - The partition id which owns this record store.tableIndex - The slot number (or index) to start the iteratorbatch - The number of items to be batched@Since(value="1.4") Object aggregate(String name, Data aggregator)
name - Name of the map.aggregator - aggregator to aggregate the entries with@Since(value="1.4") Object aggregateWithPredicate(String name, Data aggregator, Data predicate)
name - Name of the map.aggregator - aggregator to aggregate the entries withpredicate - predicate to filter the entries with@Since(value="1.4") Object project(String name, Data projection)
name - Name of the map.projection - projection to transform the entries with. May return null.@Since(value="1.4") Object projectWithPredicate(String name, Data projection, Data predicate)
name - Name of the map.projection - projection to transform the entries with. May return null.predicate - predicate to filter the entries with@Since(value="1.4") Object fetchNearCacheInvalidationMetadata(List<String> names, Address address)
names - names of the maps@Since(value="1.4") Object assignAndGetUuids()
@Since(value="1.4") void removeAll(String name, Data predicate)
name - map name.predicate - used to select entries to be removed from map.@Since(value="1.4") Object addNearCacheInvalidationListener(String name, int listenerFlags, boolean localOnly)
addNearCacheEntryListener(String, int, boolean)name - name of the maplistenerFlags - flags of enabled listeners.localOnly - if true fires events that originated from this node only, otherwise fires all events@Since(value="1.5") Object fetchWithQuery(String name, int tableIndex, int batch, Data projection, Data predicate)
name - Name of the maptableIndex - The slot number (or index) to start the iteratorbatch - The number of items to be batchedprojection - projection to transform the entries withpredicate - predicate to filter the entries with@Since(value="1.5") Object eventJournalSubscribe(String name)
name - name of the map@Since(value="1.5") Object eventJournalRead(String name, long startSequence, int minSize, int maxSize, @Nullable Data predicate, @Nullable Data projection)
minSize, the
call will wait until it has sufficient items.
The predicate, filter and projection may be null in which case all elements are returned
and no projection is applied.name - name of the mapstartSequence - the startSequence of the first item to readminSize - the minimum number of items to read.maxSize - the maximum number of items to read.predicate - the predicate to apply before processing eventsprojection - the projection to apply to journal eventsCopyright © 2018. All Rights Reserved.