Search in sources :

Example 36 with StoreParams

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

the class TestStoreParamsChoose method params_choose_new_4.

@Test
public void params_choose_new_4() {
    StoreParams p = StoreParamsFactory.decideStoreParams(Location.mem(), true, pApp, pLoc, pDft);
    // New store, pLoc, no pApp, so pLoc is the entire settings.
    assertFalse(StoreParams.sameValues(p, pApp));
    assertFalse(StoreParams.sameValues(p, pLoc));
    assertFalse(StoreParams.sameValues(p, pDft));
    assertEquals(0, p.getBlockSize().intValue());
    assertEquals(12, p.getNodeMissCacheSize().intValue());
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) ConfigTest(org.apache.jena.tdb2.ConfigTest) Test(org.junit.Test)

Example 37 with StoreParams

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

the class TestStoreParamsChoose method params_choose_existing_1.

@Test
public void params_choose_existing_1() {
    StoreParams p = StoreParamsFactory.decideStoreParams(Location.mem(), false, null, null, pDft);
    // p is pDft.
    assertTrue(StoreParams.sameValues(p, pDft));
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) ConfigTest(org.apache.jena.tdb2.ConfigTest) Test(org.junit.Test)

Example 38 with StoreParams

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

the class TestStoreParamsChoose method params_choose_new_1.

@Test
public void params_choose_new_1() {
    StoreParams p = StoreParamsFactory.decideStoreParams(Location.mem(), true, null, null, pDft);
    // New store, no pLoc, no pApp so pDft.
    assertTrue(StoreParams.sameValues(p, pDft));
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) ConfigTest(org.apache.jena.tdb2.ConfigTest) Test(org.junit.Test)

Example 39 with StoreParams

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

the class TestStoreParamsChoose method params_choose_new_persist_1.

@Test
public void params_choose_new_persist_1() {
    // new database, app defined.
    Location loc = Location.create(DIR);
    FileOps.clearAll(loc.getDirectoryPath());
    // Clear.
    StoreParams p = StoreParamsFactory.decideStoreParams(loc, true, pApp, null, pDft);
    // Check location now has a pLoc.
    String fn = loc.getPath(Names.TDB_CONFIG_FILE);
    assertTrue(FileOps.exists(fn));
    StoreParams pLoc2 = StoreParamsCodec.read(loc);
    assertTrue(StoreParams.sameValues(pLoc2, p));
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) Location(org.apache.jena.dboe.base.file.Location) ConfigTest(org.apache.jena.tdb2.ConfigTest) 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