Skip to content

Commit

Permalink
[hotfix][checkpointing] Add VisibleForTesting annotation for related …
Browse files Browse the repository at this point in the history
…methods
  • Loading branch information
zhijiangW committed Jun 9, 2020
1 parent 44acd50 commit bb0ebca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,6 @@ public synchronized void close() throws IOException {
allBarriersReceivedFuture.cancel(false);
}

boolean isCheckpointPending() {
return numBarriersReceived > 0;
}

private synchronized void handleNewCheckpoint(CheckpointBarrier barrier) throws IOException {
long barrierId = barrier.getId();
if (!allBarriersReceivedFuture.isDone() && isCheckpointPending()) {
Expand Down Expand Up @@ -410,8 +406,14 @@ synchronized int getNumOpenChannels() {
return numOpenChannels;
}

@VisibleForTesting
synchronized long getCurrentCheckpointId() {
return currentReceivedCheckpointId;
}

@VisibleForTesting
boolean isCheckpointPending() {
return numBarriersReceived > 0;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ public void close() throws IOException {
*
* @return The ID of the pending of completed checkpoint.
*/
public long getLatestCheckpointId() {
@VisibleForTesting
long getLatestCheckpointId() {
return barrierHandler.getLatestCheckpointId();
}

Expand Down

0 comments on commit bb0ebca

Please sign in to comment.