Search in sources :

Example 31 with StoreParams

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

the class TestStoreParams method store_params_04.

@Test
public void store_params_04() {
    StoreParams params = StoreParams.builder().build();
    StoreParams params2 = roundTrip(params);
    assertEqualsStoreParams(params, params2);
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) Test(org.junit.Test)

Example 32 with StoreParams

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

the class TestStoreParamsCreate method params_reconnect_01.

// Defaults
@Test
public void params_reconnect_01() {
    // Create.
    StoreConnection.connectCreate(loc);
    // Drop.
    expel();
    // Reconnect
    StoreConnection.connectCreate(loc, null);
    StoreParams pLoc = StoreParamsCodec.read(loc);
    assertNull(pLoc);
    StoreParams pDB = StoreConnection.connectExisting(loc).getDatasetGraphTDB().getStoreParams();
    assertNotNull(pDB);
    // Should be the default setup.
    assertTrue(StoreParams.sameValues(pDft, pDB));
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) Test(org.junit.Test) ConfigTest(org.apache.jena.tdb2.ConfigTest)

Example 33 with StoreParams

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

the class TestStoreParamsCreate method params_reconnect_03.

// Custom, then reconnect with some special settings.
@Test
public void params_reconnect_03() {
    // Create.
    StoreConnection.connectCreate(loc, pApp);
    // 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(pApp, pDB));
    assertFalse(StoreParams.sameValues(pSpecial, pDB));
    // Check it's default-modified-by-special.
    assertEquals(pSpecial.getBlockReadCacheSize(), pDB.getBlockReadCacheSize());
    assertNotEquals(pApp.getBlockReadCacheSize(), pDB.getBlockReadCacheSize());
    assertNotEquals(pSpecial.getBlockSize(), pDB.getBlockSize());
    assertEquals(pApp.getBlockSize(), pDB.getBlockSize());
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) Test(org.junit.Test) ConfigTest(org.apache.jena.tdb2.ConfigTest)

Example 34 with StoreParams

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

the class TestStoreParamsChoose method params_choose_new_2.

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

Example 35 with StoreParams

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

the class TestStoreParamsChoose method params_choose_new_3.

@Test
public void params_choose_new_3() {
    StoreParams p = StoreParamsFactory.decideStoreParams(Location.mem(), true, null, pLoc, pDft);
    // New store, pLoc, no pApp, so pLoc is the entire settings.
    assertEquals(0, p.getBlockSize().intValue());
    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