Search in sources :

Example 21 with TDBException

use of org.apache.jena.tdb2.TDBException in project jena by apache.

the class SpotTDB2 method checkStorageArea.

/**
 * Check all files exist for a TDB2 database, or the area is empty (and so a new
 * database can be created in the location). Throw {@link TDBException} is a file
 * is missing.
 */
private static void checkStorageArea(Location location) {
    if (location.isMem())
        return;
    if (isEmpty(location))
        return;
    // Journal, fixed name.
    validate(location, Names.journalFileBase, Names.extJournal);
    // Places for StoreParams: location or default
    StoreParams params = getStoreParams(location);
    // Check for indexes
    containsIndex(params.getPrimaryIndexTriples(), params.getTripleIndexes());
    validateBPT(location, params.getTripleIndexes());
    containsIndex(params.getPrimaryIndexQuads(), params.getTripleIndexes());
    validateBPT(location, params.getQuadIndexes());
    // prefixes. GPU
    containsIndex(params.getPrimaryIndexPrefix(), params.getPrefixIndexes());
    // GPU is not in files "GPU"
    // Filename of GPU.
    validateBPT(location, params.getPrefixIndexes());
    // ---- Node tables.
    /*
         * nodes.bpt
         * nodes.dat
         * nodes-data.bdf
         * nodes-data.obj
         */
    validateBPT(location, params.getNodeTableBaseName());
    validateDAT(location, params.getNodeTableBaseName() + "-data");
    /*
         * prefixes...
         */
    // XXX validateBPT(location, params.getPrefixTableBaseName());
    validateBPT(location, params.getPrefixTableBaseName());
    validateDAT(location, params.getPrefixTableBaseName() + "-data");
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams)

Aggregations

TDBException (org.apache.jena.tdb2.TDBException)20 NodeId (org.apache.jena.tdb2.store.NodeId)6 Node (org.apache.jena.graph.Node)4 DatasetGraphTDB (org.apache.jena.tdb2.store.DatasetGraphTDB)4 Location (org.apache.jena.dboe.base.file.Location)3 Record (org.apache.jena.dboe.base.record.Record)3 RiotThriftException (org.apache.jena.riot.thrift.RiotThriftException)2 RDF_Term (org.apache.jena.riot.thrift.wire.RDF_Term)2 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)2 TException (org.apache.thrift.TException)2 ArrayList (java.util.ArrayList)1 RuntimeIOException (org.apache.jena.atlas.RuntimeIOException)1 Tuple (org.apache.jena.atlas.lib.tuple.Tuple)1 TupleMap (org.apache.jena.atlas.lib.tuple.TupleMap)1 BlockMgr (org.apache.jena.dboe.base.block.BlockMgr)1 BufferChannel (org.apache.jena.dboe.base.file.BufferChannel)1 FileSet (org.apache.jena.dboe.base.file.FileSet)1 ProcessFileLock (org.apache.jena.dboe.base.file.ProcessFileLock)1 RecordFactory (org.apache.jena.dboe.base.record.RecordFactory)1 BPlusTree (org.apache.jena.dboe.trans.bplustree.BPlusTree)1