use of org.apache.jena.tdb.store.DatasetGraphTDB in project jena by apache.
the class OpExecutorTDB1 method execute.
@Override
protected QueryIterator execute(OpQuadPattern quadPattern, QueryIterator input) {
if (!isForTDB)
return super.execute(quadPattern, input);
// DatasetGraph dg = execCxt.getDataset() ;
// if ( ! ( dg instanceof DatasetGraphTDB ) )
// throw new InternalErrorException("Not a TDB backed dataset in quad pattern execution") ;
DatasetGraphTDB ds = (DatasetGraphTDB) execCxt.getDataset();
BasicPattern bgp = quadPattern.getBasicPattern();
Node gn = quadPattern.getGraphNode();
return optimizeExecuteQuads(ds, input, gn, bgp, null, execCxt);
}
use of org.apache.jena.tdb.store.DatasetGraphTDB in project jena by apache.
the class tdbstats method exec.
@Override
protected void exec() {
DatasetGraphTDB dsg = getDatasetGraphTDB();
Node gn = getGraphName();
StatsResults results = stats(dsg, gn);
Stats.write(System.out, results);
}
use of org.apache.jena.tdb.store.DatasetGraphTDB in project jena by apache.
the class dumpnodetable method exec.
@Override
protected void exec() {
List<String> tripleIndexes = Arrays.asList(Names.tripleIndexes);
List<String> quadIndexes = Arrays.asList(Names.quadIndexes);
Location loc = modLocation.getLocation();
StoreConnection sConn = StoreConnection.make(loc);
DatasetGraphTDB dsg = sConn.getBaseDataset();
NodeTable nodeTable = dsg.getQuadTable().getNodeTupleTable().getNodeTable();
dump(System.out, nodeTable);
}
use of org.apache.jena.tdb.store.DatasetGraphTDB in project jena by apache.
the class tdbnode method exec.
@Override
protected void exec() {
DatasetGraphTDB dsg = getDatasetGraphTDB();
NodeTable nodeTable = dsg.getTripleTable().getNodeTupleTable().getNodeTable();
Iterator<String> iter = super.getPositional().iterator();
if (!iter.hasNext()) {
System.err.println("No node ids");
return;
}
for (; iter.hasNext(); ) {
String id = iter.next();
try {
long x = Long.parseLong(id);
NodeId nodeId = new NodeId(x);
Node n = nodeTable.getNodeForNodeId(nodeId);
//System.out.printf("%s [%d] => %s\n", id, x, n) ;
Hash h = new Hash(SystemTDB.LenNodeHash);
NodeLib.setHash(h, n);
String str = Bytes.asHex(h.getBytes());
System.out.printf("%s %08d 0x%s # %s\n", id, x, str, n);
} catch (Exception ex) {
System.out.println("Failed to decode: " + id);
}
}
}
use of org.apache.jena.tdb.store.DatasetGraphTDB in project jena by apache.
the class tdbrecovery method exec.
@Override
protected void exec() {
DatasetGraphTDB dsg = super.getDatasetGraphTDB();
// Just creating the DSG does a recovery so this is not (currently) necessary:
// This may change (not immediately recovering on start up).
JournalControl.recovery(dsg);
}
Aggregations