public class CachePartitionSegment extends Object implements ConstructorFunction<String,ICacheRecordStore>
Responsible for all cache data of a partition. Creates and
looks up CacheRecordStore
s by name.
CacheService
manages all CachePartitionSegment
s.Modifier and Type | Field and Description |
---|---|
protected AbstractCacheService |
cacheService |
protected Object |
mutex |
protected int |
partitionId |
protected ConcurrentMap<String,ICacheRecordStore> |
recordStores |
Constructor and Description |
---|
CachePartitionSegment(AbstractCacheService cacheService,
int partitionId) |
Modifier and Type | Method and Description |
---|---|
ICacheRecordStore |
createNew(String cacheNameWithPrefix)
Creates a new instance of an object given the construction argument
|
void |
deleteRecordStore(String name,
boolean destroy) |
Collection<ServiceNamespace> |
getAllNamespaces(int replicaIndex) |
Collection<CacheConfig> |
getCacheConfigs() |
ICacheService |
getCacheService() |
long |
getLastCleanupTime() |
long |
getLastCleanupTimeBeforeSorting() |
ICacheRecordStore |
getOrCreateRecordStore(String cacheNameWithPrefix)
Gets or creates a cache record store with the prefixed
cacheNameWithPrefix . |
int |
getPartitionId() |
ICacheRecordStore |
getRecordStore(String cacheNameWithPrefix)
Returns a cache record store with the prefixed
cacheNameWithPrefix or null if one doesn't exist. |
boolean |
hasAnyRecordStore() |
boolean |
hasRecordStore(String name) |
boolean |
hasRunningCleanupOperation() |
void |
init() |
Iterator<ICacheRecordStore> |
recordStoreIterator() |
void |
reset() |
void |
setLastCleanupTime(long time) |
void |
setRunningCleanupOperation(boolean status) |
void |
shutdown() |
void |
storeLastCleanupTime() |
protected final int partitionId
protected final Object mutex
protected final AbstractCacheService cacheService
protected final ConcurrentMap<String,ICacheRecordStore> recordStores
public CachePartitionSegment(AbstractCacheService cacheService, int partitionId)
public ICacheRecordStore createNew(String cacheNameWithPrefix)
ConstructorFunction
createNew
in interface ConstructorFunction<String,ICacheRecordStore>
cacheNameWithPrefix
- construction argumentpublic Iterator<ICacheRecordStore> recordStoreIterator()
public boolean hasRunningCleanupOperation()
public void setRunningCleanupOperation(boolean status)
public long getLastCleanupTime()
public void setLastCleanupTime(long time)
public long getLastCleanupTimeBeforeSorting()
public void storeLastCleanupTime()
public Collection<CacheConfig> getCacheConfigs()
public int getPartitionId()
public ICacheRecordStore getOrCreateRecordStore(String cacheNameWithPrefix)
cacheNameWithPrefix
.cacheNameWithPrefix
- the full name of the ICache
, including the manager scope prefixpublic ICacheRecordStore getRecordStore(String cacheNameWithPrefix)
cacheNameWithPrefix
or null
if one doesn't exist.cacheNameWithPrefix
- the full name of the ICache
,
including the manager scope prefixnull
if it doesn't existpublic ICacheService getCacheService()
public void deleteRecordStore(String name, boolean destroy)
public boolean hasAnyRecordStore()
public boolean hasRecordStore(String name)
public void init()
public void reset()
public void shutdown()
public Collection<ServiceNamespace> getAllNamespaces(int replicaIndex)
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.