Skip to content

Commit

Permalink
Recategorized the logs to info, debug & trace
Browse files Browse the repository at this point in the history
Signed-off-by: Ankit Kala <[email protected]>
  • Loading branch information
ankitkala committed Mar 13, 2024
1 parent 9e2fc06 commit e954ff3
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public RemoteScrollableHitSource(

@Override
protected void doStart(RejectAwareActionListener<Response> searchListener) {
logger.trace("Starting remote reindex for {}", Arrays.toString(searchRequest.indices()));
logger.info("Starting remote reindex for {}", Arrays.toString(searchRequest.indices()));
lookupRemoteVersion(RejectAwareActionListener.wrap(version -> {
remoteVersion = version;
logger.trace("Starting initial search");
Expand All @@ -126,7 +126,7 @@ void lookupRemoteVersion(RejectAwareActionListener<Version> listener) {
private void onStartResponse(RejectAwareActionListener<Response> searchListener, Response response) {
logger.trace("On initial search response");
if (Strings.hasLength(response.getScrollId()) && response.getHits().isEmpty()) {
logger.trace("First response looks like a scan response. Jumping right to the second. scroll=[{}]", response.getScrollId());
logger.debug("First response looks like a scan response. Jumping right to the second. scroll=[{}]", response.getScrollId());
doStartNextScroll(response.getScrollId(), timeValueMillis(0), searchListener);
} else {
searchListener.onResponse(response);
Expand All @@ -142,11 +142,11 @@ protected void doStartNextScroll(String scrollId, TimeValue extraKeepAlive, Reje

@Override
protected void clearScroll(String scrollId, Runnable onCompletion) {
logger.trace("Clearing the scrollID {}", scrollId);
logger.debug("Clearing the scrollID {}", scrollId);
client.performRequestAsync(RemoteRequestBuilders.clearScroll(scrollId, remoteVersion), new ResponseListener() {
@Override
public void onSuccess(org.opensearch.client.Response response) {
logger.trace("Successfully cleared [{}]", scrollId);
logger.debug("Successfully cleared [{}]", scrollId);
onCompletion.run();
}

Expand Down Expand Up @@ -184,7 +184,7 @@ protected void cleanup(Runnable onCompletion) {
threadPool.generic().submit(() -> {
try {
client.close();
logger.trace("Shut down remote connection");
logger.debug("Shut down remote connection");
} catch (IOException e) {
logger.error("Failed to shutdown the remote connection", e);
} finally {
Expand All @@ -199,7 +199,7 @@ private void executeWithRetries(
RejectAwareActionListener<Response> childListener
) {
execute(request, parser, new RetryListener(logger, threadPool, backoffPolicy, r -> {
logger.trace("Retrying execute request {}", request.getEndpoint());
logger.debug("Retrying execute request {}", request.getEndpoint());
countSearchRetry.run();
execute(request, parser, r);
}, childListener));
Expand All @@ -210,7 +210,7 @@ private <T> void execute(
BiFunction<XContentParser, MediaType, T> parser,
RejectAwareActionListener<? super T> listener
) {
logger.trace("Executing http request to remote cluster");
logger.trace("Executing http request to remote cluster {}", request.getEndpoint());
// Preserve the thread context so headers survive after the call
java.util.function.Supplier<ThreadContext.StoredContext> contextSupplier = threadPool.getThreadContext().newRestorableContext(true);
try {
Expand Down Expand Up @@ -264,7 +264,7 @@ public void onSuccess(org.opensearch.client.Response response) {
public void onFailure(Exception e) {
try (ThreadContext.StoredContext ctx = contextSupplier.get()) {
assert ctx != null; // eliminates compiler warning
logger.trace("Received response failure {}", e.getMessage());
logger.debug("Received response failure {}", e.getMessage());
if (e instanceof ResponseException) {
ResponseException re = (ResponseException) e;
int statusCode = re.getResponse().getStatusLine().getStatusCode();
Expand Down

0 comments on commit e954ff3

Please sign in to comment.