Search in sources :

Example 1 with StoreParams

use of org.apache.jena.tdb2.params.StoreParams in project jena by apache.

the class TestStoreParams method store_params_10.

// ----
@Test
public void store_params_10() {
    StoreParams params = StoreParams.builder().fileMode(FileMode.direct).blockSize(1024).build();
    StoreParams params2 = roundTrip(params);
    assertEqualsStoreParams(params, params2);
    assertEquals(params.getFileMode(), params2.getFileMode());
    assertEquals(params.getBlockSize(), params2.getBlockSize());
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) Test(org.junit.Test)

Example 2 with StoreParams

use of org.apache.jena.tdb2.params.StoreParams in project jena by apache.

the class TestStoreParams method roundTrip.

// --------
private static StoreParams roundTrip(StoreParams params) {
    JsonObject obj = StoreParamsCodec.encodeToJson(params);
    StoreParams params2 = StoreParamsCodec.decode(obj);
    return params2;
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) JsonObject(org.apache.jena.atlas.json.JsonObject)

Example 3 with StoreParams

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

Example 4 with StoreParams

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

Example 5 with StoreParams

use of org.apache.jena.tdb2.params.StoreParams in project jena by apache.

the class TestStoreParams method store_params_14.

@Test(expected = TDBException.class)
public void store_params_14() {
    // Misspelt.
    String xs = "{ \"tdb.triples_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)

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