public class IgniteCacheDatabaseSharedManager extends GridCacheSharedManagerAdapter implements IgniteChangeGlobalStateSupport, CheckpointLockStateChecker
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,DataRegion> |
dataRegionMap |
protected DataRegion |
dfltDataRegion |
protected Map<String,CacheFreeListImpl> |
freeListMap |
protected Map<String,DataRegionMetrics> |
memMetricsMap |
static String |
SYSTEM_DATA_REGION_NAME
DataRegionConfiguration name reserved for internal caches.
|
cctx, diagnosticLog, log| Constructor and Description |
|---|
IgniteCacheDatabaseSharedManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDataRegion(DataStorageConfiguration dataStorageCfg,
DataRegionConfiguration dataRegionCfg,
boolean trackable) |
boolean |
beforeExchange(GridDhtPartitionsExchangeFuture discoEvt) |
protected File |
buildAllocPath(DataRegionConfiguration plc)
Builds allocation path for memory mapped file to be used with PageMemory.
|
protected File |
buildPath(String path,
String consId) |
protected void |
checkPageSize(DataStorageConfiguration memCfg) |
boolean |
checkpointLockIsHeldByThread() |
void |
checkpointReadLock()
No-op for non-persistent storage.
|
long |
checkpointReadLockTimeout() |
void |
checkpointReadLockTimeout(long val)
No-op for non-persistent storage.
|
void |
checkpointReadUnlock()
No-op for non-persistent storage.
|
protected void |
checkRegionEvictionProperties(DataRegionConfiguration regCfg,
DataStorageConfiguration dbCfg) |
void |
cleanupCheckpointDirectory()
No-op for non-persistent storage.
|
void |
cleanupTempCheckpointDirectory()
No-op for non-persistent storage.
|
protected PageEvictionTracker |
createPageEvictionTracker(DataRegionConfiguration plc,
PageMemory pageMem) |
protected PageMemory |
createPageMemory(DirectMemoryProvider memProvider,
DataStorageConfiguration memCfg,
DataRegionConfiguration memPlcCfg,
DataRegionMetricsImpl memMetrics,
boolean trackable)
Creates PageMemory with given size and memory provider.
|
DataRegion |
dataRegion(String memPlcName) |
Collection<DataRegion> |
dataRegions() |
void |
dumpStatistics(IgniteLogger log) |
void |
ensureFreeSpace(DataRegion memPlc)
|
CheckpointFuture |
forceCheckpoint(String reason)
Allows to wait checkpoint finished.
|
FreeList |
freeList(String memPlcName) |
protected IgniteOutClosure<Long> |
freeSpaceProvider(DataRegionConfiguration dataRegCfg)
Closure that can be used to compute fill factor for provided data region.
|
protected List<DatabaseLifecycleListener> |
getDatabaseListeners(GridKernalContext kctx) |
IgniteInternalFuture |
indexRebuildFuture(int cacheId) |
protected void |
initDataRegions(DataStorageConfiguration memCfg) |
protected void |
initDataRegions0(DataStorageConfiguration memCfg) |
protected void |
initPageMemoryDataStructures(DataStorageConfiguration dbCfg) |
void |
lastCheckpointInapplicableForWalRebalance(int grpId)
Marks last checkpoint as inapplicable for WAL rebalance for given group
grpId. |
WALPointer |
lastCheckpointMarkWalPointer() |
Collection<DataRegionMetrics> |
memoryMetrics() |
DataRegionMetrics |
memoryMetrics(String memPlcName) |
MetaStorage |
metaStorage() |
void |
notifyMetaStorageSubscribersOnReadyForRead()
Notifies
MetastorageLifecycleListener that MetaStorage is ready for read. |
void |
onActivate(GridKernalContext kctx)
Called when cluster performing activation.
|
void |
onCacheGroupsStopped(Collection<IgniteBiTuple<CacheGroupContext,Boolean>> stoppedGrps) |
void |
onDeActivate(GridKernalContext kctx)
Called when cluster performing deactivation.
|
void |
onStateRestored()
Called when all partitions have been fully restored and pre-created on node start.
|
int |
pageSize() |
DataStorageMetrics |
persistentStoreMetrics() |
void |
prepareCachesStop()
Needed action before any cache will stop
|
void |
readCheckpointAndRestoreMemory(List<DynamicCacheDescriptor> cachesToStart) |
void |
rebuildIndexesIfNeeded(GridDhtPartitionsExchangeFuture fut) |
void |
releaseHistoryForExchange()
Release reserved update history.
|
void |
releaseHistoryForPreloading()
Release reserved update history.
|
Map<Integer,Map<Integer,Long>> |
reserveHistoryForExchange()
Reserve update history for exchange.
|
boolean |
reserveHistoryForPreloading(int grpId,
int partId,
long cntr)
Reserve update history for preloading.
|
ReuseList |
reuseList(String memPlcName) |
protected void |
setPageSize(int pageSize)
Method for fake (standalone) context initialization.
|
protected void |
start0() |
protected void |
stop0(boolean cancel) |
String |
systemDateRegionName() |
void |
waitForCheckpoint(String reason)
Waits until current state is checkpointed.
|
IgniteInternalFuture |
wakeupForCheckpoint(String reason) |
boolean |
walEnabled(int grpId,
boolean local) |
void |
walEnabled(int grpId,
boolean enabled,
boolean local)
Marks cache group as with disabled WAL.
|
protected DirectMemoryProvider |
wrapMetricsMemoryProvider(DirectMemoryProvider memoryProvider0,
DataRegionMetricsImpl memMetrics) |
context, isStopping, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStop, onKernalStop0, onReconnected, printMemoryStats, start, startInfo, stop, stopInfo, toStringpublic static final String SYSTEM_DATA_REGION_NAME
protected volatile Map<String,DataRegion> dataRegionMap
protected Map<String,DataRegionMetrics> memMetricsMap
protected DataRegion dfltDataRegion
protected Map<String,CacheFreeListImpl> freeListMap
protected void start0()
throws IgniteCheckedException
start0 in class GridCacheSharedManagerAdapterIgniteCheckedException - If failed.protected void initPageMemoryDataStructures(DataStorageConfiguration dbCfg) throws IgniteCheckedException
dbCfg - Database config.IgniteCheckedException - If failed.public int pageSize()
protected void initDataRegions(DataStorageConfiguration memCfg) throws IgniteCheckedException
memCfg - Database config.IgniteCheckedException - If failed to initialize swap path.protected void initDataRegions0(DataStorageConfiguration memCfg) throws IgniteCheckedException
memCfg - Database config.IgniteCheckedException - If failed to initialize swap path.protected List<DatabaseLifecycleListener> getDatabaseListeners(GridKernalContext kctx)
kctx - Kernal context.public void addDataRegion(DataStorageConfiguration dataStorageCfg, DataRegionConfiguration dataRegionCfg, boolean trackable) throws IgniteCheckedException
dataStorageCfg - Database config.dataRegionCfg - Data region config.IgniteCheckedException - If failed to initialize swap path.protected IgniteOutClosure<Long> freeSpaceProvider(DataRegionConfiguration dataRegCfg)
dataRegCfg - Data region configuration.protected void checkPageSize(DataStorageConfiguration memCfg)
memCfg - Memory config.protected void checkRegionEvictionProperties(DataRegionConfiguration regCfg, DataStorageConfiguration dbCfg) throws IgniteCheckedException
regCfg - DataRegionConfiguration to validate.dbCfg - Memory configuration.IgniteCheckedException - If config is invalid.public void dumpStatistics(IgniteLogger log)
log - Logger.public Collection<DataRegion> dataRegions()
policies.public Collection<DataRegionMetrics> memoryMetrics()
public DataStorageMetrics persistentStoreMetrics()
null otherwise.public void readCheckpointAndRestoreMemory(List<DynamicCacheDescriptor> cachesToStart) throws IgniteCheckedException
cachesToStart - Started caches.IgniteCheckedException - If failed.@Nullable public DataRegionMetrics memoryMetrics(String memPlcName)
memPlcName - Name of DataRegion to obtain DataRegionMetrics for.DataRegionMetrics snapshot for specified DataRegion or null if
no DataRegion is configured for specified name.public DataRegion dataRegion(String memPlcName) throws IgniteCheckedException
memPlcName - data region name.DataRegion instance associated with a given DataRegionConfiguration.IgniteCheckedException - in case of request for unknown DataRegion.public FreeList freeList(String memPlcName)
memPlcName - DataRegionConfiguration name.FreeList instance associated with a given DataRegionConfiguration.public ReuseList reuseList(String memPlcName)
memPlcName - DataRegionConfiguration name.ReuseList instance associated with a given DataRegionConfiguration.protected void stop0(boolean cancel)
stop0 in class GridCacheSharedManagerAdaptercancel - Cancel flag.public boolean checkpointLockIsHeldByThread()
checkpointLockIsHeldByThread in interface CheckpointLockStateCheckerpublic void checkpointReadLock()
public void checkpointReadUnlock()
public long checkpointReadLockTimeout()
0 for non-persistent storage.public void checkpointReadLockTimeout(long val)
public void cleanupCheckpointDirectory()
throws IgniteCheckedException
IgniteCheckedExceptionpublic void cleanupTempCheckpointDirectory()
throws IgniteCheckedException
IgniteCheckedException@Nullable public IgniteInternalFuture wakeupForCheckpoint(String reason)
public WALPointer lastCheckpointMarkWalPointer()
@Nullable public CheckpointFuture forceCheckpoint(String reason)
reason - Reason.public void waitForCheckpoint(String reason) throws IgniteCheckedException
IgniteCheckedException - If failed.public boolean beforeExchange(GridDhtPartitionsExchangeFuture discoEvt) throws IgniteCheckedException
discoEvt - Before exchange for the given discovery event.True if partitions have been restored from persistent storage.IgniteCheckedExceptionpublic void onStateRestored()
throws IgniteCheckedException
IgniteCheckedException - If failed.public void rebuildIndexesIfNeeded(GridDhtPartitionsExchangeFuture fut)
fut - Partition exchange future.public void prepareCachesStop()
public void onCacheGroupsStopped(Collection<IgniteBiTuple<CacheGroupContext,Boolean>> stoppedGrps)
stoppedGrps - A collection of tuples (cache group, destroy flag).@Nullable public IgniteInternalFuture indexRebuildFuture(int cacheId)
public Map<Integer,Map<Integer,Long>> reserveHistoryForExchange()
public void releaseHistoryForExchange()
public boolean reserveHistoryForPreloading(int grpId,
int partId,
long cntr)
grpId - Cache group ID.partId - Partition Id.cntr - Update counter.public void releaseHistoryForPreloading()
public void ensureFreeSpace(DataRegion memPlc) throws IgniteCheckedException
memPlc - data region.IgniteCheckedExceptionprotected PageEvictionTracker createPageEvictionTracker(DataRegionConfiguration plc, PageMemory pageMem)
plc - data region Configuration.pageMem - Page memory.@Nullable protected File buildAllocPath(DataRegionConfiguration plc) throws IgniteCheckedException
plc - DataRegionConfiguration.IgniteCheckedException - If resolving swap directory fails.protected PageMemory createPageMemory(DirectMemoryProvider memProvider, DataStorageConfiguration memCfg, DataRegionConfiguration memPlcCfg, DataRegionMetricsImpl memMetrics, boolean trackable)
memProvider - Memory provider.memCfg - Memory configuartion.memPlcCfg - data region configuration.memMetrics - DataRegionMetrics to collect memory usage metrics.protected DirectMemoryProvider wrapMetricsMemoryProvider(DirectMemoryProvider memoryProvider0, DataRegionMetricsImpl memMetrics)
memoryProvider0 - Memory provider.memMetrics - Memory metrics.protected File buildPath(String path, String consId) throws IgniteCheckedException
path - Path to the working directory.consId - Consistent ID of the local node.IgniteCheckedException - If resolving swap directory fails.public void onActivate(GridKernalContext kctx) throws IgniteCheckedException
onActivate in interface IgniteChangeGlobalStateSupportkctx - Kernal context.IgniteCheckedException - If failed.public void onDeActivate(GridKernalContext kctx)
onDeActivate in interface IgniteChangeGlobalStateSupportkctx - Kernal context.public String systemDateRegionName()
protected void setPageSize(int pageSize)
pageSize - configured page sizepublic MetaStorage metaStorage()
public void notifyMetaStorageSubscribersOnReadyForRead()
throws IgniteCheckedException
MetastorageLifecycleListener that MetaStorage is ready for read.
This method is called when all processors and managers have already started and right before discovery manager.IgniteCheckedException - If failed.public boolean walEnabled(int grpId,
boolean local)
grpId - Group ID.public void walEnabled(int grpId,
boolean enabled,
boolean local)
grpId - Group id.enabled - flag.public void lastCheckpointInapplicableForWalRebalance(int grpId)
grpId.grpId - Group id.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.5 Release Date : June 4 2019