Skip to content

Commit

Permalink
Build fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Bukhtawar Khan <[email protected]>
  • Loading branch information
Bukhtawar committed Jun 21, 2022
1 parent 9bd9d3e commit e90dfa5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.util.stream.Stream;

/**
* The {@link TranslogManager} implementation capable of orchestrating all {@link Translog} operations while
* The {@link TranslogManager} implementation capable of orchestrating all read/write {@link Translog} operations while
* interfacing with the {@link org.opensearch.index.engine.InternalEngine}
*/
public class InternalTranslogManager implements TranslogManager {
Expand Down Expand Up @@ -117,7 +117,7 @@ public void rollTranslogGeneration() throws TranslogException {
* This operation will close the engine if the recovery fails.
* @param translogRecoveryRunner the translog recovery runner
* @param recoverUpToSeqNo the upper bound, inclusive, of sequence number to be recovered
* @return
* @return the total number of operations recovered
*/
@Override
public int recoverFromTranslog(TranslogRecoveryRunner translogRecoveryRunner, long localCheckpoint, long recoverUpToSeqNo)
Expand Down Expand Up @@ -190,6 +190,10 @@ public boolean ensureTranslogSynced(Stream<Translog.Location> locations) throws
return synced;
}

/**
* Syncs the translog and invokes the listener
* @throws IOException the exception on sync failure
*/
@Override
public void syncTranslog() throws IOException {
translog.sync();
Expand Down Expand Up @@ -280,6 +284,9 @@ public int restoreLocalHistoryFromTranslog(long processedCheckpoint, TranslogRec
}
}

/**
* Ensures that the flushes can succeed if there are no pending translog recovery
*/
@Override
public void ensureCanFlush() {
// translog recovery happens after the engine is fully constructed.
Expand Down Expand Up @@ -320,6 +327,11 @@ private Translog openTranslog(
);
}

/**
* Returns the the translog instance
* @param ensureOpen check if the engine is open
* @return the {@link Translog} instance
*/
@Override
public Translog getTranslog(boolean ensureOpen) {
if (ensureOpen) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.util.stream.Stream;

/**
* The no-op implementation of {@link TranslogManager} that doesn't perform any action
* The no-op implementation of {@link TranslogManager} that doesn't perform any operation
*/
public class NoOpTranslogManager implements TranslogManager {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.util.function.Supplier;

/***
* The implementation of {@link TranslogManager} that only performs writes to the Translog
* The implementation of {@link TranslogManager} that only orchestrates writes to the underlying {@link Translog}
*/
public class WriteOnlyTranslogManager extends InternalTranslogManager {

Expand Down

0 comments on commit e90dfa5

Please sign in to comment.