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 JCache
is located on the classpath, as determined by JCacheDetector.isJcacheAvailable(ClassLoader)
.
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()
.
cacheContexesConstructorFunction, cacheContexts, cacheEventHandler, cacheSplitBrainHandler, cacheStatisticsConstructorFunction, closeableListeners, configs, logger, nodeEngine, operationProviderCache, resources, segments, statistics
CACHE_SUPPORT_NOT_AVAILABLE_ERROR_MESSAGE, SERVICE_NAME
Constructor and Description |
---|
CacheService() |
Modifier and Type | Method and Description |
---|---|
protected ICacheRecordStore |
createNewRecordStore(String name,
int partitionId) |
protected CacheOperationProvider |
createOperationProvider(String nameWithPrefix,
InMemoryFormat inMemoryFormat) |
CacheWanEventPublisher |
getCacheWanEventPublisher() |
boolean |
isWanReplicationEnabled(String cacheName) |
protected CachePartitionSegment |
newPartitionSegment(int partitionId) |
Operation |
prepareReplicationOperation(PartitionReplicationEvent event)
Returns an operation to replicate service data and/or state for a specific partition replica
on another cluster member.
|
String |
toString() |
addCacheResource, addInvalidationListener, beforeMigration, cacheEntryListenerDeregistered, cacheEntryListenerRegistered, checkCacheConfig, checkCacheSimpleConfig, closeSegments, commitMigration, createCacheStatIfAbsent, createDistributedObject, deleteCache, deleteCacheConfig, deleteCacheStat, deregisterAllListener, deregisterListener, destroyDistributedObject, destroySegments, dispatchEvent, findCacheConfig, getCacheConfig, getCacheConfigs, getCacheContext, getCacheOperationProvider, getNodeEngine, getOrCreateCacheContext, getOrCreateRecordStore, getPostJoinOperation, getQuorumName, getRecordStore, getSegment, getStatistics, init, isNativeInMemoryFormatSupported, onPartitionLost, postInit, prepareMergeRunnable, publishCachePartitionLostEvent, publishEvent, publishEvent, putCacheConfigIfAbsent, registerListener, registerListener, registerListenerInternal, reset, rollbackMigration, sendInvalidationEvent, setManagementEnabled, setStatisticsEnabled, shutdown, toData, toObject
protected CachePartitionSegment newPartitionSegment(int partitionId)
newPartitionSegment
in class AbstractCacheService
protected ICacheRecordStore createNewRecordStore(String name, int partitionId)
createNewRecordStore
in class AbstractCacheService
protected CacheOperationProvider createOperationProvider(String nameWithPrefix, InMemoryFormat inMemoryFormat)
createOperationProvider
in class AbstractCacheService
public Operation prepareReplicationOperation(PartitionReplicationEvent event)
MigrationAwareService
This method will be called on source member whenever partitioning system requires to copy/replicate a partition replica. Returned operation will be executed on destination member. If operation fails by throwing exception, migration process will fail and will be rolled back.
Returning null is allowed and means service does not have anything to replicate.
event
- replicationpublic boolean isWanReplicationEnabled(String cacheName)
public CacheWanEventPublisher getCacheWanEventPublisher()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.