use of org.apache.ignite.internal.processors.cache.persistence.diagnostic.pagelocktracker.PageLockTrackerManager in project ignite by apache.
the class BPlusTreeSelfTest method beforeTest.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTest() throws Exception {
stop.set(false);
long seed = System.nanoTime();
X.println("Test seed: " + seed + "L; // ");
rnd = new Random(seed);
pageMem = createPageMemory();
reuseList = createReuseList(CACHE_ID, pageMem, 0, true);
lockTrackerManager = new PageLockTrackerManager(log, "testTreeManager") {
@Override
public PageLockListener createPageLockTracker(String name) {
return new TestPageLockListener(super.createPageLockTracker(name));
}
};
lockTrackerManager.start();
}
use of org.apache.ignite.internal.processors.cache.persistence.diagnostic.pagelocktracker.PageLockTrackerManager in project ignite by apache.
the class LinkMapTest method test.
/**
* Test that LinkMap works.
* @throws Exception
*/
@Test
public void test() throws Exception {
int cacheGroupId = 1;
String groupName = "test";
FullPageId pageId = new FullPageId(pageMem.allocatePage(cacheGroupId, 0, PageIdAllocator.FLAG_DATA), cacheGroupId);
PageLockTrackerManager pageLockTrackerManager = mock(PageLockTrackerManager.class);
when(pageLockTrackerManager.createPageLockTracker(anyString())).thenReturn(PageLockTrackerManager.NOOP_LSNR);
LinkMap map = new LinkMap(cacheGroupId, groupName, pageMem, pageId.pageId(), true, pageLockTrackerManager);
for (int i = 0; i < 10_000; i++) map.put(i, i + 1);
for (int i = 0; i < 10_000; i++) assertEquals(i + 1, map.get(i));
}
Aggregations