Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
foreverneverer committed Sep 4, 2020
1 parent a098625 commit 2a09369
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
import java.util.concurrent.TimeUnit;

public class BackupRequestInterceptor implements TableInterceptor {
private final long backupRequestDelayMs;

public BackupRequestInterceptor(long backupRequestDelayMs) {
this.backupRequestDelayMs = backupRequestDelayMs;
}

@Override
public void before(ClientRequestRound clientRequestRound, TableHandler tableHandler) {
Expand Down Expand Up @@ -53,7 +58,7 @@ private void backupCall(ClientRequestRound clientRequestRound, TableHandler tabl
clientRequestRound.timeoutMs(),
true);
},
tableHandler.backupRequestDelayMs(),
backupRequestDelayMs,
TimeUnit.MILLISECONDS));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ public class InterceptorManger {
private List<TableInterceptor> interceptors = new ArrayList<>();

public InterceptorManger(TableOptions options) {
this.register(new BackupRequestInterceptor(), options.enableBackupRequest())
.register(new CompressionInterceptor(), options.enableCompression());
}
if (options.enableBackupRequest()) {
interceptors.add(new BackupRequestInterceptor(options.backupRequestDelayMs()));
}

private InterceptorManger register(TableInterceptor interceptor, boolean enable) {
if (enable) {
interceptors.add(interceptor);
if (options.enableCompression()) {
interceptors.add(new CompressionInterceptor());
}
return this;
}

public void before(ClientRequestRound clientRequestRound, TableHandler tableHandler) {
Expand Down

0 comments on commit 2a09369

Please sign in to comment.