Search in sources :

Example 6 with StoreParams

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());
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) Test(org.junit.Test)

Example 7 with StoreParams

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());
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) JsonObject(org.apache.jena.atlas.json.JsonObject) Test(org.junit.Test)

Example 8 with StoreParams

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());
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) Test(org.junit.Test)

Example 9 with StoreParams

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);
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) Test(org.junit.Test)

Example 10 with StoreParams

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());
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) Test(org.junit.Test) ConfigTest(org.apache.jena.tdb2.ConfigTest)

Aggregations

StoreParams (org.apache.jena.tdb2.params.StoreParams)33 Test (org.junit.Test)26 ConfigTest (org.apache.jena.tdb2.ConfigTest)15 JsonObject (org.apache.jena.atlas.json.JsonObject)5 Location (org.apache.jena.dboe.base.file.Location)5 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)3 NodeTable (org.apache.jena.tdb2.store.nodetable.NodeTable)3 ProcessFileLock (org.apache.jena.dboe.base.file.ProcessFileLock)2 TDBException (org.apache.jena.tdb2.TDBException)2 DatasetGraphTDB (org.apache.jena.tdb2.store.DatasetGraphTDB)2 RecordFactory (org.apache.jena.dboe.base.record.RecordFactory)1 Index (org.apache.jena.dboe.index.Index)1 RangeIndex (org.apache.jena.dboe.index.RangeIndex)1 StoragePrefixes (org.apache.jena.dboe.storage.StoragePrefixes)1 ReorderTransformation (org.apache.jena.sparql.engine.optimizer.reorder.ReorderTransformation)1 DatasetGraphSwitchable (org.apache.jena.tdb2.store.DatasetGraphSwitchable)1 NodeTableTRDF (org.apache.jena.tdb2.store.nodetable.NodeTableTRDF)1 ComponentIdMgr (org.apache.jena.tdb2.sys.ComponentIdMgr)1