Add up-to-date javadocs on Translog#syncNeeded

This commit is contained in:
Simon Willnauer 2017-05-11 15:28:39 +02:00
parent 64d0d9184d
commit 8f798f1231
2 changed files with 5 additions and 1 deletions

View File

@ -541,6 +541,9 @@ public class Translog extends AbstractIndexShardComponent implements IndexShardC
} }
} }
/**
* Returns <code>true</code> if an fsync is required to ensure durability of the translogs operations or it's metadata.
*/
public boolean syncNeeded() { public boolean syncNeeded() {
try (ReleasableLock lock = readLock.acquire()) { try (ReleasableLock lock = readLock.acquire()) {
return current.syncNeeded(); return current.syncNeeded();

View File

@ -209,7 +209,8 @@ public class TranslogWriter extends BaseTranslogReader implements Closeable {
} }
/** /**
* returns true if there are buffered ops * Returns <code>true</code> if there are buffered operations that have not been flushed and fsynced to disk or if the latest global
* checkpoint has not yet been fsynced
*/ */
public boolean syncNeeded() { public boolean syncNeeded() {
return totalOffset != lastSyncedCheckpoint.offset || globalCheckpointSupplier.getAsLong() != lastSyncedCheckpoint.globalCheckpoint; return totalOffset != lastSyncedCheckpoint.offset || globalCheckpointSupplier.getAsLong() != lastSyncedCheckpoint.globalCheckpoint;