From 791c3487471031ba443df2c5cb0c82bdac73d2f9 Mon Sep 17 00:00:00 2001 From: aarshi Date: Thu, 14 Nov 2024 12:55:28 +0530 Subject: [PATCH] Minor inprovement --- .../repository/graphdb/janus/AtlasElasticsearchQuery.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasElasticsearchQuery.java b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasElasticsearchQuery.java index c699363107..b8a210ded6 100644 --- a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasElasticsearchQuery.java +++ b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasElasticsearchQuery.java @@ -190,7 +190,7 @@ private DirectIndexQueryResult performAsyncDirectIndexQuery(SearchParams searchP if (searchParams.getRequestTimeoutInSecs() != null) { KeepAliveTime = searchParams.getRequestTimeoutInSecs() +"s"; } - AsyncQueryResult response = submitAsyncSearch(searchParams, false).get(); + AsyncQueryResult response = submitAsyncSearch(searchParams, KeepAliveTime, false).get(); if(response.isRunning()) { /* * If the response is still running, then we need to wait for the response @@ -358,14 +358,10 @@ public void onFailure(Exception exception) { lowLevelRestClient.performRequestAsync(request, responseListener); } - private Future submitAsyncSearch(SearchParams searchParams, boolean source) { + private Future submitAsyncSearch(SearchParams searchParams, String KeepAliveTime, boolean source) { CompletableFuture future = new CompletableFuture<>(); HttpEntity entity = new NStringEntity(searchParams.getQuery(), ContentType.APPLICATION_JSON); String endPoint; - String KeepAliveTime = AtlasConfiguration.INDEXSEARCH_ASYNC_SEARCH_KEEP_ALIVE_TIME_IN_SECONDS.getLong() +"s"; - if (searchParams.getRequestTimeoutInSecs() != null) { - KeepAliveTime = searchParams.getRequestTimeoutInSecs() +"s"; - } if (source) { endPoint = index + "/_async_search";