Search in sources :

Example 16 with StoreParams

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

the class TestStoreParamsChoose method params_choose_new_persist_3.

@Test
public void params_choose_new_persist_3() {
    // new database, location defined, application modified.
    Location loc = Location.create(DIR);
    FileOps.clearAll(loc.getDirectoryPath());
    StoreParamsCodec.write(loc, pLoc);
    // Clear.
    StoreParams p = StoreParamsFactory.decideStoreParams(loc, true, pApp, 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);
    assertFalse(StoreParams.sameValues(pLoc, p));
    // Location
    assertEquals(0, p.getBlockSize().intValue());
    // Application
    assertEquals(12, p.getNodeMissCacheSize().intValue());
}
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 17 with StoreParams

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

the class BuildTestLib method makeNodeTableBase.

public static NodeTable makeNodeTableBase(Location location, String basename, StoreParams params) {
    RecordFactory recordFactory = new RecordFactory(SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId);
    FileSet fs = new FileSet(location, basename);
    Index index = buildRangeIndex(fs, recordFactory, params);
    BinaryDataFile bdf = createBinaryDataFile(location, basename + "-data");
    NodeTable nt = new NodeTableTRDF(index, bdf);
    return nt;
}
Also used : NodeTableTRDF(org.apache.jena.tdb2.store.nodetable.NodeTableTRDF) RecordFactory(org.apache.jena.dboe.base.record.RecordFactory) RangeIndex(org.apache.jena.dboe.index.RangeIndex) Index(org.apache.jena.dboe.index.Index) NodeTable(org.apache.jena.tdb2.store.nodetable.NodeTable)

Example 18 with StoreParams

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

the class BuildTestLib method makeNodeTable.

public static NodeTable makeNodeTable(Location location, String basename, StoreParams params) {
    NodeTable nt = makeNodeTableBase(location, basename, params);
    nt = NodeTableCache.create(nt, params);
    nt = NodeTableInline.create(nt);
    return nt;
}
Also used : NodeTable(org.apache.jena.tdb2.store.nodetable.NodeTable)

Example 19 with StoreParams

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

the class TestNodeTableStoredBase method createEmptyNodeTable.

@Override
protected NodeTable createEmptyNodeTable() {
    FileOps.ensureDir(location.getDirectoryPath());
    FileOps.clearDirectory(location.getDirectoryPath());
    StoreParams params = StoreParamsBuilder.create().nodeId2NodeCacheSize(-1).node2NodeIdCacheSize(-1).nodeMissCacheSize(-1).build();
    return BuildTestLib.makeNodeTableBase(location, "test", params);
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams)

Example 20 with StoreParams

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

the class TestNodeTableStored method createEmptyNodeTable.

@Override
protected NodeTable createEmptyNodeTable() {
    FileOps.ensureDir(location.getDirectoryPath());
    FileOps.clearDirectory(location.getDirectoryPath());
    StoreParams params = StoreParamsBuilder.create().nodeId2NodeCacheSize(10).node2NodeIdCacheSize(10).nodeMissCacheSize(10).build();
    return BuildTestLib.makeNodeTable(location, "test", params);
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams)

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