use of org.apache.jena.tdb2.params.StoreParams in project jena by apache.
the class TestStoreParams method store_params_22.
// Modify
@Test
public void store_params_22() {
StoreParams params1 = StoreParams.builder().blockReadCacheSize(0).blockWriteCacheSize(1).build();
StoreParams params2 = StoreParams.builder().blockReadCacheSize(5).build();
StoreParams params3 = StoreParamsBuilder.modify(params1, params2);
assertFalse(params2.isSetBlockWriteCacheSize());
assertTrue(params3.isSetBlockReadCacheSize());
assertTrue(params3.isSetBlockWriteCacheSize());
// From params2
assertEquals(5, params3.getBlockReadCacheSize().intValue());
// From params1, not params2(unset)
assertEquals(1, params3.getBlockWriteCacheSize().intValue());
}
use of org.apache.jena.tdb2.params.StoreParams in project jena by apache.
the class TestStoreParams method store_params_13.
@Test
public void store_params_13() {
String xs = "{ \"tdb.triple_indexes\" : [ \"POS\" , \"PSO\"] } ";
JsonObject x = JSON.parse(xs);
StoreParams params = StoreParamsCodec.decode(x);
String[] expected = { "POS", "PSO" };
assertArrayEquals(expected, params.getTripleIndexes());
}
use of org.apache.jena.tdb2.params.StoreParams in project jena by apache.
the class TestStoreParams method store_params_21.
@Test
public void store_params_21() {
StoreParams params1 = StoreParams.builder().blockReadCacheSize(0).build();
assertTrue(params1.isSetBlockReadCacheSize());
assertFalse(params1.isSetBlockWriteCacheSize());
StoreParams params2 = StoreParams.builder(params1).blockWriteCacheSize(0).build();
assertTrue(params2.isSetBlockReadCacheSize());
assertTrue(params2.isSetBlockWriteCacheSize());
assertFalse(params2.isSetNodeMissCacheSize());
}
use of org.apache.jena.tdb2.params.StoreParams in project jena by apache.
the class TestStoreParams method store_params_02.
@Test
public void store_params_02() {
StoreParams input = StoreParams.getDftStoreParams();
StoreParams sp = StoreParams.builder(input).build();
assertEqualsStoreParams(StoreParams.getDftStoreParams(), sp);
}
use of org.apache.jena.tdb2.params.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.connectCreate(loc, null);
// Drop.
expel();
// Reconnect
StoreConnection.connectCreate(loc, pSpecial);
// StoreParams pLoc = StoreParamsCodec.read(loc);
// assertNotNull(pLoc);
StoreParams pDB = StoreConnection.connectExisting(loc).getDatasetGraphTDB().getStoreParams();
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());
}
Aggregations