use of org.sirix.io.file.FileWriter in project sirix by sirixdb.
the class PageWriteTrxImpl method createTrxIntentLog.
private TransactionIntentLog createTrxIntentLog(final XdmResourceManager resourceManager) {
final Path logFile = resourceManager.getResourceConfig().mPath.resolve("log").resolve("intent-log");
try {
if (Files.exists(logFile)) {
Files.delete(logFile);
Files.createFile(logFile);
}
final RandomAccessFile file = new RandomAccessFile(logFile.toFile(), "rw");
final FileWriter fileWriter = new FileWriter(file, new ByteHandlePipeline(resourceManager.getResourceConfig().mByteHandler), SerializationType.TRANSACTION_INTENT_LOG);
final PersistentFileCache persistentFileCache = new PersistentFileCache(fileWriter, this);
return new TransactionIntentLog(persistentFileCache);
} catch (final IOException e) {
throw new UncheckedIOException(e);
}
}
Aggregations