use of org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager in project ignite by apache.
the class PageMemoryLazyAllocationTest method testLazyMemoryAllocationOnServer.
/**
* @throws Exception If failed.
*/
@Test
public void testLazyMemoryAllocationOnServer() throws Exception {
lazyAllocation = true;
IgniteEx srv = startSrv()[0];
IgniteCacheDatabaseSharedManager db = srv.context().cache().context().database();
checkMemoryAllocated(db.dataRegion(EAGER_REGION).pageMemory());
checkMemoryNotAllocated(db.dataRegion(LAZY_REGION).pageMemory());
createCacheAndPut(srv);
checkMemoryAllocated(db.dataRegion(LAZY_REGION).pageMemory());
}
use of org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager in project ignite by apache.
the class PageMemoryLazyAllocationTest method testEagerMemoryAllocationOnClient.
/**
* @throws Exception If failed.
*/
@Test
public void testEagerMemoryAllocationOnClient() throws Exception {
lazyAllocation = false;
IgniteEx srv = startSrv()[0];
IgniteCacheDatabaseSharedManager srvDb = srv.context().cache().context().database();
checkMemoryAllocated(srvDb.dataRegion(EAGER_REGION).pageMemory());
checkMemoryAllocated(srvDb.dataRegion(LAZY_REGION).pageMemory());
IgniteEx clnt = startClientGrid(2);
IgniteCacheDatabaseSharedManager clntDb = clnt.context().cache().context().database();
checkMemoryNotAllocated(clntDb.dataRegion(EAGER_REGION).pageMemory());
checkMemoryNotAllocated(clntDb.dataRegion(LAZY_REGION).pageMemory());
createCacheAndPut(clnt);
checkMemoryNotAllocated(clntDb.dataRegion(EAGER_REGION).pageMemory());
checkMemoryNotAllocated(clntDb.dataRegion(LAZY_REGION).pageMemory());
}
use of org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager in project ignite by apache.
the class ClusterReadOnlyModeSelfTest method testMetaStorageAvailableForUpdatesOnReadOnlyCluster.
/**
*/
@Test
public void testMetaStorageAvailableForUpdatesOnReadOnlyCluster() throws Exception {
IgniteEx node = startGrid(0);
node.cluster().state(ACTIVE);
IgniteCacheDatabaseSharedManager db = node.context().cache().context().database();
MetaStorage metaStorage = db.metaStorage();
db.checkpointReadLock();
try {
metaStorage.write("key", "val");
} finally {
db.checkpointReadUnlock();
}
node.cluster().state(ACTIVE_READ_ONLY);
db.checkpointReadLock();
try {
assertEquals("val", metaStorage.read("key"));
metaStorage.write("key", "new_val");
assertEquals("new_val", metaStorage.read("key"));
metaStorage.remove("key");
assertNull(metaStorage.read("key"));
} finally {
db.checkpointReadUnlock();
}
}
Aggregations