com.hazelcast.cache.impl
public class CacheService extends AbstractCacheService
This service is responsible for:
CacheRecordStore
.ICache
.MigrationAwareService
.WARNING:This service is an optionally registered service which is enabled when Caching
class is found on the classpath.
If registered, it will provide all the above cache operations for all partitions of the node which it is registered on.
Distributed Cache Name is used for providing a unique name to a cache object to overcome cache manager
scoping which depends on URI and class loader parameters. It's a simple concatenation of CacheNamePrefix and
cache name where CacheNamePrefix is calculated by each cache manager
using AbstractHazelcastCacheManager.cacheNamePrefix()
.
Modifier and Type | Class and Description |
---|---|
protected class |
CacheService.CacheBatchInvalidationMessageSender |
Modifier and Type | Field and Description |
---|---|
protected AtomicBoolean |
cacheBatchInvalidationMessageSenderInProgress |
protected ScheduledFuture |
cacheBatchInvalidationMessageSenderScheduler |
protected boolean |
invalidationMessageBatchEnabled |
protected int |
invalidationMessageBatchSize |
protected ConcurrentMap<String,Queue<CacheSingleInvalidationMessage>> |
invalidationMessageMap |
cacheStatisticsConstructorFunction, closeableListeners, configs, nodeEngine, operationProviderCache, resources, segments, statistics
SERVICE_NAME
Constructor and Description |
---|
CacheService() |
Modifier and Type | Method and Description |
---|---|
String |
addInvalidationListener(String name,
CacheEventListener listener)
Registers and
CacheInvalidationListener for specified cacheName . |
protected ICacheRecordStore |
createNewRecordStore(String name,
int partitionId) |
protected void |
flushInvalidationMessages(String cacheName,
Queue<CacheSingleInvalidationMessage> invalidationMessageQueue) |
protected void |
postInit(NodeEngine nodeEngine,
Properties properties) |
Operation |
prepareReplicationOperation(PartitionReplicationEvent event) |
void |
reset()
reset this ManagedService back to initial state.
|
protected void |
sendBatchInvalidationEvent(String name,
Data key,
String sourceUuid) |
void |
sendInvalidationEvent(String name,
Data key,
String sourceUuid)
Sends an invalidation event for given
cacheName with specified key
from mentioned source with sourceUuid . |
protected void |
sendSingleInvalidationEvent(String name,
Data key,
String sourceUuid) |
void |
shutdown(boolean terminate)
Shuts down this ManagedService.
|
addCacheResource, beforeMigration, clearPartitionReplica, commitMigration, createCacheConfigIfAbsent, createCacheStatIfAbsent, createDistributedObject, deleteCacheConfig, deleteCacheStat, deregisterAllListener, deregisterListener, destroyCache, destroyCacheOnAllMembers, destroyDistributedObject, destroySegments, dispatchEvent, findCacheConfig, getCacheConfig, getCacheConfigFromPartition, getCacheConfigs, getCacheOperationProvider, getCacheRecordStore, getNodeEngine, getOrCreateCache, getPostJoinOperation, getSegment, getStatistics, init, publishEvent, publishEvent, registerListener, rollbackMigration, setManagementEnabled, setStatisticsEnabled, toData, toObject
protected boolean invalidationMessageBatchEnabled
protected int invalidationMessageBatchSize
protected final ConcurrentMap<String,Queue<CacheSingleInvalidationMessage>> invalidationMessageMap
protected ScheduledFuture cacheBatchInvalidationMessageSenderScheduler
protected final AtomicBoolean cacheBatchInvalidationMessageSenderInProgress
protected ICacheRecordStore createNewRecordStore(String name, int partitionId)
createNewRecordStore
in class AbstractCacheService
protected void postInit(NodeEngine nodeEngine, Properties properties)
postInit
in class AbstractCacheService
public void reset()
ManagedService
public void shutdown(boolean terminate)
ManagedService
terminate
- true to shut down the ManagedServicepublic Operation prepareReplicationOperation(PartitionReplicationEvent event)
public String addInvalidationListener(String name, CacheEventListener listener)
CacheInvalidationListener
for specified cacheName
.name
- the name of the cache that CacheEventListener
will be registered forlistener
- the CacheEventListener
to be registered for specified cache
public void sendInvalidationEvent(String name, Data key, String sourceUuid)
cacheName
with specified key
from mentioned source with sourceUuid
.name
- the name of the cache that invalidation event is sent forkey
- the Data
represents the invalidation eventsourceUuid
- an id that represents the source for invalidation eventprotected void sendSingleInvalidationEvent(String name, Data key, String sourceUuid)
protected void sendBatchInvalidationEvent(String name, Data key, String sourceUuid)
protected void flushInvalidationMessages(String cacheName, Queue<CacheSingleInvalidationMessage> invalidationMessageQueue)
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.