return dataFiles;
}
public void flush() throws IOException {
synchronized (persistedHead) {
RecordId before = persistedHead.get();
RecordId after = head.get();
boolean cleanup = cleanupNeeded.getAndSet(false);
if (cleanup || !after.equals(before)) {
// needs to happen outside the synchronization block below to
// avoid a deadlock with another thread flushing the writer
tracker.getWriter().flush();
// needs to happen outside the synchronization block below to
// prevent the flush from stopping concurrent reads and writes
writer.flush();
synchronized (this) {
log.debug("TarMK journal update {} -> {}", before, after);
journalFile.writeBytes(after.toString10() + " root\n");
journalFile.getChannel().force(false);
persistedHead.set(after);
if (cleanup) {
long start = System.nanoTime();