use of org.apache.jena.tdb.setup.StoreParams in project jena by apache.
the class TestStoreParams method store_params_20.
// Check that setting gets recorded and propagated.
@Test
public void store_params_20() {
StoreParams params = StoreParams.builder().blockReadCacheSize(0).build();
assertTrue(params.isSetBlockReadCacheSize());
assertFalse(params.isSetBlockWriteCacheSize());
}
use of org.apache.jena.tdb.setup.StoreParams in project jena by apache.
the class TestStoreParamsCreate method params_reconnect_02.
// Defaults, then reconnect with app modified.
@Test
public void params_reconnect_02() {
// Create.
StoreConnection.make(loc, null);
// Drop.
StoreConnection.expel(loc, true);
// Reconnect
StoreConnection.make(loc, pSpecial);
//StoreParams pLoc = StoreParamsCodec.read(loc) ;
//assertNotNull(pLoc) ;
StoreParams pDB = StoreConnection.getExisting(loc).getBaseDataset().getConfig().params;
assertNotNull(pDB);
// Should be the default setup, modified by pApp for cache sizes.
assertFalse(StoreParams.sameValues(pDft, pDB));
assertFalse(StoreParams.sameValues(pSpecial, pDB));
// Check it's default-modified-by-special.
assertEquals(pSpecial.getBlockReadCacheSize(), pDB.getBlockReadCacheSize());
assertNotEquals(pDft.getBlockReadCacheSize(), pDB.getBlockReadCacheSize());
assertNotEquals(pSpecial.getBlockSize(), pDB.getBlockSize());
assertEquals(pDft.getBlockSize(), pDB.getBlockSize());
}
use of org.apache.jena.tdb.setup.StoreParams in project jena by apache.
the class TestStoreParamsCreate method params_reconnect_03.
// Custom, then reconnect with some special settings.
@Test
public void params_reconnect_03() {
// Create.
StoreConnection.make(loc, pApp);
// Drop.
StoreConnection.expel(loc, true);
// Reconnect
StoreConnection.make(loc, pSpecial);
//StoreParams pLoc = StoreParamsCodec.read(loc) ;
//assertNotNull(pLoc) ;
StoreParams pDB = StoreConnection.getExisting(loc).getBaseDataset().getConfig().params;
assertNotNull(pDB);
// Should be the default setup, modified by pApp for cache sizes.
assertFalse(StoreParams.sameValues(pApp, pDB));
assertFalse(StoreParams.sameValues(pSpecial, pDB));
// Check it's default-modified-by-special.
assertEquals(pSpecial.getBlockReadCacheSize(), pDB.getBlockReadCacheSize());
assertNotEquals(pApp.getBlockReadCacheSize(), pDB.getBlockReadCacheSize());
assertNotEquals(pSpecial.getBlockSize(), pDB.getBlockSize());
assertEquals(pApp.getBlockSize(), pDB.getBlockSize());
}
use of org.apache.jena.tdb.setup.StoreParams in project jena by apache.
the class TestStoreParams method store_params_11.
@Test
public void store_params_11() {
String xs = "{ \"tdb.block_size\": 2048 }";
JsonObject x = JSON.parse(xs);
StoreParams paramsExpected = StoreParams.builder().blockSize(2048).build();
StoreParams paramsActual = StoreParamsCodec.decode(x);
assertEqualsStoreParams(paramsExpected, paramsActual);
}
use of org.apache.jena.tdb.setup.StoreParams in project jena by apache.
the class TestStoreParamsChoose method params_choose_existing_2.
@Test
public void params_choose_existing_2() {
StoreParams p = Build.decideStoreParams(Location.mem(), false, pApp, null, pDft);
// p is pLoc modified by pApp
assertFalse(StoreParams.sameValues(p, pApp));
assertFalse(StoreParams.sameValues(p, pDft));
// Existing store, no pLoc, so pDft is implicit pLoc and fixed the block size.
assertEquals(pDft.getBlockSize(), p.getBlockSize());
assertEquals(12, p.getNodeMissCacheSize().intValue());
}
Aggregations