Search in sources :

Example 11 with StoreParams

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

the class TestStoreParamsCreate method params_create_02.

@Test
public void params_create_02() {
    StoreConnection.connectCreate(loc, pApp);
    // Check.  Custom setup.
    assertTrue("DB directory", Files.exists(db));
    assertTrue("Config file not found", Files.exists(cfg));
    StoreParams pLoc = StoreParamsCodec.read(loc);
    assertTrue(StoreParams.sameValues(pLoc, pApp));
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) Test(org.junit.Test) ConfigTest(org.apache.jena.tdb2.ConfigTest)

Example 12 with StoreParams

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

the class TestStoreParamsChoose method params_choose_existing_2.

@Test
public void params_choose_existing_2() {
    StoreParams p = StoreParamsFactory.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());
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) ConfigTest(org.apache.jena.tdb2.ConfigTest) Test(org.junit.Test)

Example 13 with StoreParams

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

the class TestStoreParamsChoose method params_choose_existing_4.

@Test
public void params_choose_existing_4() {
    StoreParams p = StoreParamsFactory.decideStoreParams(Location.mem(), false, pApp, pLoc, pDft);
    // p is pLoc modifed by pApp.
    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 14 with StoreParams

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

the class TestStoreParamsChoose method params_choose_new_persist_2.

@Test
public void params_choose_new_persist_2() {
    // new database, location defined.
    Location loc = Location.create(DIR);
    FileOps.clearAll(loc.getDirectoryPath());
    StoreParamsCodec.write(loc, pLoc);
    // Clear.
    StoreParams p = StoreParamsFactory.decideStoreParams(loc, true, null, pLoc, pDft);
    // Check location still has a pLoc.
    String fn = loc.getPath(Names.TDB_CONFIG_FILE);
    assertTrue(FileOps.exists(fn));
    StoreParams pLoc2 = StoreParamsCodec.read(loc);
    assertTrue(StoreParams.sameValues(pLoc, 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)

Example 15 with StoreParams

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

the class TestStoreParamsChoose method params_choose_existing_3.

@Test
public void params_choose_existing_3() {
    StoreParams p = StoreParamsFactory.decideStoreParams(Location.mem(), false, null, pLoc, pDft);
    // p is pLoc
    assertTrue(StoreParams.sameValues(p, pLoc));
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) 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