public class MapStoreWrapper extends Object implements MapStore, MapLoaderLifecycleSupport
Constructor and Description |
---|
MapStoreWrapper(String mapName,
Object impl) |
Modifier and Type | Method and Description |
---|---|
void |
delete(Object key)
Deletes the entry with a given key from the store.
|
void |
deleteAll(Collection keys)
Deletes multiple entries from the store.
|
void |
destroy()
Hazelcast will call this method before shutting down.
|
Object |
getImpl() |
MapStore |
getMapStore() |
void |
init(HazelcastInstance hazelcastInstance,
Properties properties,
String mapName)
Initializes this MapLoader implementation.
|
void |
instrument(NodeEngine nodeEngine) |
boolean |
isMapLoader() |
boolean |
isPostProcessingMapStore() |
Object |
load(Object key)
Loads the value of a given key.
|
Map |
loadAll(Collection keys)
Loads given keys.
|
Iterable<Object> |
loadAllKeys()
Returns an
Iterable of all keys or null
if a map loader is not configured for this map. |
void |
store(Object key,
Object value)
Stores the key-value pair.
|
void |
storeAll(Map map)
Stores multiple entries.
|
String |
toString() |
public MapStore getMapStore()
public void destroy()
MapLoaderLifecycleSupport
destroy
in interface MapLoaderLifecycleSupport
public void init(HazelcastInstance hazelcastInstance, Properties properties, String mapName)
MapLoaderLifecycleSupport
MapLoader
is configured, can be obtained from the
hazelcastInstance
in this method's implementation.
On members joining a cluster, this method is executed during finalization
of the join operation, therefore care should be taken to adhere to the
rules for PostJoinAwareService.getPostJoinOperation()
.
If the implementation executes operations which may wait on locks or otherwise
block (e.g. waiting for network operations), this may result in a time-out and
obstruct the new member from joining the cluster. If blocking operations are
required for initialization of the MapLoader
, consider deferring them
with a lazy initialization scheme.
init
in interface MapLoaderLifecycleSupport
hazelcastInstance
- HazelcastInstance of this mapLoader.properties
- Properties set for this mapStore. see MapStoreConfigmapName
- name of the map.public boolean isMapLoader()
true
if a MapLoader
is configured for this mappublic void instrument(NodeEngine nodeEngine)
public void delete(Object key)
MapStore
public void store(Object key, Object value)
MapStore
public void storeAll(Map map)
MapStore
public void deleteAll(Collection keys)
MapStore
public Iterable<Object> loadAllKeys()
Iterable
of all keys or null
if a map loader is not configured for this map.
Loads all of the keys from the store. The returned Iterable
may return the keys lazily
by loading them in batches. The Iterator
of this Iterable
may implement the
Closeable
interface in which case it will be closed once iteration is over.
This is intended for releasing resources such as closing a JDBC result set.
The returned Iterable should not contain any null
keys.loadAllKeys
in interface MapLoader
public Object load(Object key)
MapLoader
public Map loadAll(Collection keys)
MapLoader
null
keys.
The returned Map should not contain any null
keys or values.
Loading other items than what provided in keys
prevents the map from being filled from the map store.
public Object getImpl()
public boolean isPostProcessingMapStore()
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.