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 |
---|---|
void |
clear() |
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() |
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) |
void |
init() |
Iterator<ICacheRecordStore> |
recordStoreIterator() |
void |
shutdown() |
protected final AbstractCacheService cacheService
protected final int partitionId
protected final ConcurrentMap<String,ICacheRecordStore> recordStores
protected final Object mutex
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 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 clear()
public void shutdown()
public Collection<ServiceNamespace> getAllNamespaces(int replicaIndex)
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.