use of org.apache.jena.tdb.base.objectfile.ObjectFile in project jena by apache.
the class dumpnodes method exec.
@Override
protected void exec() {
Location loc = modLocation.getLocation();
ObjectFile objFile = determineNodeTable(loc);
dump(System.out, objFile);
}
use of org.apache.jena.tdb.base.objectfile.ObjectFile in project jena by apache.
the class TestTransRestart method countRDFNodes.
// Only call when the dataset is not in TDBMaker or in StoreConnection
private int countRDFNodes() {
ObjectFile objects = FileFactory.createObjectFileDisk(location.getPath(Names.indexId2Node, Names.extNodeData));
int count = 0;
Iterator<Pair<Long, ByteBuffer>> iter = objects.all();
while (iter.hasNext()) {
iter.next();
count++;
}
objects.close();
return count;
}
use of org.apache.jena.tdb.base.objectfile.ObjectFile in project jena by apache.
the class TestObjectFileBuffering method writePrealloc.
private void writePrealloc(int sizeOfBuffer, int... sizes) {
ObjectFile file = make(sizeOfBuffer);
int N = sizes.length;
Block[] blocks = new Block[N];
ByteBuffer[] read = new ByteBuffer[N];
for (int i = 0; i < N; i++) {
blocks[i] = file.allocWrite(sizes[i]);
fill(blocks[i].getByteBuffer());
file.completeWrite(blocks[i]);
}
for (int i = 0; i < N; i++) {
read[i] = file.read(blocks[i].getId());
assertNotSame(blocks[i].getByteBuffer(), read[i]);
sameValue(blocks[i].getByteBuffer(), read[i]);
}
}
use of org.apache.jena.tdb.base.objectfile.ObjectFile in project jena by apache.
the class TestObjectFileBuffering method write.
private void write(int sizeOfBuffer, int... sizes) {
ObjectFile file = make(sizeOfBuffer);
int N = sizes.length;
ByteBuffer[] bb = new ByteBuffer[N];
long[] loc = new long[N];
ByteBuffer[] read = new ByteBuffer[N];
for (int i = 0; i < N; i++) {
bb[i] = ByteBuffer.allocate(sizes[i]);
fill(bb[i]);
loc[i] = file.write(bb[i]);
}
//file.sync() ;
for (int i = 0; i < N; i++) {
read[i] = file.read(loc[i]);
assertNotSame(bb[i], read[i]);
sameValue(bb[i], read[i]);
}
}
use of org.apache.jena.tdb.base.objectfile.ObjectFile in project jena by apache.
the class AbstractTestNodeTableTrans method create.
private NodeTableTrans create(Transaction txn, NodeTable base) {
RecordFactory recordFactory = new RecordFactory(SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId);
Index idx = new IndexMap(recordFactory);
ObjectFile objectFile = createObjectFile();
NodeTableTrans ntt = new NodeTableTrans(txn, "test", base, idx, objectFile);
return ntt;
}
Aggregations