Skip to content

Commit

Permalink
IGNITE-14823 Database abbrevation (#11105)
Browse files Browse the repository at this point in the history
  • Loading branch information
nizhikov authored Dec 18, 2023
1 parent d2d9c3d commit 8a15d20
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion modules/checkstyle/src/main/resources/abbrevations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ context,ctx
contexts,ctxs
count,cnt
current,cur
#database,db
database,db
#default,dflt
#destination,dest
#directory,dir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ public CheckCpHistClosureJob(Map<Integer, Set<Integer>> grpIds) {

if (igniteEx.context().cache().context().database() instanceof GridCacheDatabaseSharedManager) {
GridCacheSharedContext cctx = igniteEx.context().cache().context();
GridCacheDatabaseSharedManager databaseMng = (GridCacheDatabaseSharedManager)cctx.database();
CheckpointHistory cpHist = databaseMng.checkpointHistory();
GridCacheDatabaseSharedManager dbMng = (GridCacheDatabaseSharedManager)cctx.database();
CheckpointHistory cpHist = dbMng.checkpointHistory();

CheckpointEntry lastCp = cpHist.lastCheckpoint();

Expand All @@ -145,7 +145,7 @@ public CheckCpHistClosureJob(Map<Integer, Set<Integer>> grpIds) {
return false;

if (!cpHist.isCheckpointApplicableForGroup(grpId, lastCp)) {
databaseMng.forceCheckpoint(CP_REASON);
dbMng.forceCheckpoint(CP_REASON);

break;
}
Expand All @@ -154,7 +154,7 @@ public CheckCpHistClosureJob(Map<Integer, Set<Integer>> grpIds) {

for (int p : grpIds.get(grpId)) {
if (groupState.indexByPartition(p) < 0) {
databaseMng.forceCheckpoint(CP_REASON);
dbMng.forceCheckpoint(CP_REASON);

break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ public class GridCacheOffheapManager extends IgniteCacheOffheapManagerImpl imple

RootPage reuseListRoot = metas.reuseListRoot;

GridCacheDatabaseSharedManager databaseSharedManager = (GridCacheDatabaseSharedManager)ctx.database();
GridCacheDatabaseSharedManager dbSharedManager = (GridCacheDatabaseSharedManager)ctx.database();

pageListCacheLimit = databaseSharedManager.pageListCacheLimitHolder(grp.dataRegion());
pageListCacheLimit = dbSharedManager.pageListCacheLimitHolder(grp.dataRegion());

reuseList = new ReuseListImpl(
grp.groupId(),
Expand Down Expand Up @@ -224,7 +224,7 @@ public class GridCacheOffheapManager extends IgniteCacheOffheapManagerImpl imple
ctx.diagnostic().pageLockTracker()
);

databaseSharedManager.addCheckpointListener(this, grp.dataRegion());
dbSharedManager.addCheckpointListener(this, grp.dataRegion());
}

/**
Expand Down Expand Up @@ -1057,7 +1057,7 @@ private Metas getOrAllocateCacheMetas() throws IgniteCheckedException {
if (partCntrs == null || partCntrs.isEmpty())
return null;

GridCacheDatabaseSharedManager database = (GridCacheDatabaseSharedManager)grp.shared().database();
GridCacheDatabaseSharedManager db = (GridCacheDatabaseSharedManager)grp.shared().database();

Map<Integer, Long> partsCounters = new HashMap<>();

Expand All @@ -1069,10 +1069,10 @@ private Metas getOrAllocateCacheMetas() throws IgniteCheckedException {
}

try {
WALPointer minPtr = database.checkpointHistory().searchEarliestWalPointer(grp.groupId(),
WALPointer minPtr = db.checkpointHistory().searchEarliestWalPointer(grp.groupId(),
partsCounters, grp.hasAtomicCaches() ? walAtomicCacheMargin : 0L);

WALPointer latestReservedPointer = database.latestWalPointerReservedForPreloading();
WALPointer latestReservedPointer = db.latestWalPointerReservedForPreloading();

assert latestReservedPointer == null || latestReservedPointer.compareTo(minPtr) <= 0
: "Historical iterator tries to iterate WAL out of reservation [cache=" + grp.cacheOrGroupName()
Expand Down

0 comments on commit 8a15d20

Please sign in to comment.