use of org.apache.jena.tdb.index.IndexMap in project jena by apache.
the class JournalControl method recoverNodeDat.
/** Recover a node data file (".dat").
* Node data files are append-only so recovering, then not using the data is safe.
* Node data file is a precursor for full recovery that works from the master journal.
*/
private static void recoverNodeDat(DatasetGraphTDB dsg, FileRef fileRef) {
// See DatasetBuilderTxn - same name generation code.
RecordFactory recordFactory = new RecordFactory(SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId);
NodeTable baseNodeTable = dsg.getConfig().nodeTables.get(fileRef);
String objFilename = fileRef.getFilename() + "-" + Names.extJournal;
objFilename = dsg.getLocation().absolute(objFilename);
File jrnlFile = new File(objFilename);
if (jrnlFile.exists() && jrnlFile.length() > 0) {
syslog.info("Recovering node data: " + fileRef.getFilename());
ObjectFile dataJrnl = FileFactory.createObjectFileDisk(objFilename);
NodeTableTrans ntt = new NodeTableTrans(null, objFilename, baseNodeTable, new IndexMap(recordFactory), dataJrnl);
ntt.append();
ntt.close();
dataJrnl.close();
baseNodeTable.sync();
}
if (jrnlFile.exists())
FileOps.delete(objFilename);
}
use of org.apache.jena.tdb.index.IndexMap 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