use of org.apache.ignite.internal.processors.cache.persistence.GridCacheOffheapManager in project ignite by apache.
the class ReleaseSegmentOnHistoricalRebalanceTest method testReleaseDuringRebalanceIterator.
/**
* Checks that if release the segment during {@link IgniteCacheOffheapManagerImpl#rebalanceIterator},
* there will be no errors and the rebalance will be completed.
*
* @throws Exception If failed.
*/
@Test
public void testReleaseDuringRebalanceIterator() throws Exception {
checkHistoricalRebalance(n -> {
IgniteInternalCache<?, ?> cachex = n.cachex(DEFAULT_CACHE_NAME);
GridCacheOffheapManager spy = spy(offheapManager(cachex));
doAnswer(m -> {
WALPointer reserved = dbMgr(n).latestWalPointerReservedForPreloading();
assertNotNull(reserved);
Object o = m.callRealMethod();
release(n, reserved);
assertTrue(segmentAware(n).minReserveIndex(Long.MAX_VALUE));
return o;
}).when(spy).rebalanceIterator(any(), any());
offheapManager(cachex, spy);
});
}
use of org.apache.ignite.internal.processors.cache.persistence.GridCacheOffheapManager in project ignite by apache.
the class IgniteSequentialNodeCrashRecoveryTest method captureDirtyPages.
/**
* @param g Ignite instance.
* @throws IgniteCheckedException If failed.
*/
private Collection<FullPageId> captureDirtyPages(IgniteEx g) throws IgniteCheckedException {
GridCacheDatabaseSharedManager dbMgr = (GridCacheDatabaseSharedManager) g.context().cache().context().database();
dbMgr.checkpointReadLock();
try {
// Moving free list pages to offheap.
for (CacheGroupContext group : g.context().cache().cacheGroups()) {
((GridCacheOffheapManager) group.offheap()).onMarkCheckpointBegin(new DummyCheckpointContext());
}
} finally {
dbMgr.checkpointReadUnlock();
}
// Capture a set of dirty pages.
PageMemoryImpl pageMem = (PageMemoryImpl) dbMgr.dataRegion("default").pageMemory();
return pageMem.dirtyPages();
}
use of org.apache.ignite.internal.processors.cache.persistence.GridCacheOffheapManager in project ignite by apache.
the class CheckpointFreeListTest method cacheOffheapManager.
/**
* Extract GridCacheOffheapManager for default cache.
*
* @return GridCacheOffheapManager.
*/
private GridCacheOffheapManager cacheOffheapManager() {
GridCacheAdapter<Object, Object> cacheInternal = ((IgniteKernal) ignite(0)).internalCache(CACHE_NAME);
GridCacheAdapter cache0 = (GridCacheAdapter) cacheInternal.cache();
return (GridCacheOffheapManager) cache0.context().group().offheap();
}
Aggregations