Skip to content

Commit

Permalink
Refactor buffer interval code for remote-backed indexes (#6063)
Browse files Browse the repository at this point in the history
Signed-off-by: Ashish Singh <[email protected]>
(cherry picked from commit 2618142)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Jan 30, 2023
1 parent 79dbd2b commit d4aa090
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void put(Item item, Consumer<Exception> listener) {
private void scheduleProcess() {
if (getQueue().isEmpty() == false && getPromiseSemaphore().tryAcquire()) {
try {
threadpool.schedule(this::process, getBufferInterval(), getBufferRefreshThreadPoolName());
threadpool.schedule(this::process, getBufferInterval(), getBufferProcessThreadPoolName());
} catch (Exception e) {
getLogger().error("failed to schedule process");
processSchedulingFailure(e);
Expand Down Expand Up @@ -88,6 +88,6 @@ private TimeValue getBufferInterval() {
return TimeValue.timeValueNanos(bufferInterval.getNanos() - timeSinceLastRunStartInNS);
}

protected abstract String getBufferRefreshThreadPoolName();
protected abstract String getBufferProcessThreadPoolName();

}
Original file line number Diff line number Diff line change
Expand Up @@ -3855,7 +3855,7 @@ protected void write(List<Tuple<Translog.Location, Consumer<Exception>>> candida
}

@Override
protected String getBufferRefreshThreadPoolName() {
protected String getBufferProcessThreadPoolName() {
return ThreadPool.Names.TRANSLOG_SYNC;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected void write(List<Tuple<Object, Consumer<Exception>>> candidates) throws
}

@Override
protected String getBufferRefreshThreadPoolName() {
protected String getBufferProcessThreadPoolName() {
return ThreadPool.Names.TRANSLOG_SYNC;
}
};
Expand Down Expand Up @@ -108,7 +108,7 @@ protected void write(List<Tuple<Object, Consumer<Exception>>> candidates) throws
}

@Override
protected String getBufferRefreshThreadPoolName() {
protected String getBufferProcessThreadPoolName() {
return ThreadPool.Names.TRANSLOG_SYNC;
}
};
Expand Down Expand Up @@ -164,7 +164,7 @@ protected void write(List<Tuple<Object, Consumer<Exception>>> candidates) throws
}

@Override
protected String getBufferRefreshThreadPoolName() {
protected String getBufferProcessThreadPoolName() {
return ThreadPool.Names.TRANSLOG_SYNC;
}
};
Expand Down Expand Up @@ -229,7 +229,7 @@ protected void write(List<Tuple<Object, Consumer<Exception>>> candidates) throws
}

@Override
protected String getBufferRefreshThreadPoolName() {
protected String getBufferProcessThreadPoolName() {
return ThreadPool.Names.TRANSLOG_SYNC;
}
};
Expand Down

0 comments on commit d4aa090

Please sign in to comment.