Skip to content

Commit

Permalink
addressing comments
Browse files Browse the repository at this point in the history
Signed-off-by: Bharathwaj G <bharath78910@gmail.com>
  • Loading branch information
bharath-techie committed May 17, 2022
1 parent 11c5195 commit 471a64a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private StepListener<BiFunction<String, String, DiscoveryNode>> getConnectionLoo
.filter(ctx -> Strings.isEmpty(ctx.getClusterAlias()) == false)
.map(SearchContextIdForNode::getClusterAlias)
.collect(Collectors.toSet());
return SearchUtils.getConnectionLookupListener(searchTransportService, state, clusters);
return SearchUtils.getConnectionLookupListener(searchTransportService.getRemoteClusterService(), state, clusters);
}

private ActionListener<UpdatePitContextResponse> getGroupedListener(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.opensearch.action.StepListener;
import org.opensearch.cluster.ClusterState;
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.transport.RemoteClusterService;

import java.util.Set;
import java.util.function.BiFunction;
Expand All @@ -26,7 +27,7 @@ public SearchUtils() {}
* Get connection lookup listener for list of clusters passed
*/
public static StepListener<BiFunction<String, String, DiscoveryNode>> getConnectionLookupListener(
SearchTransportService searchTransportService,
RemoteClusterService remoteClusterService,
ClusterState state,
Set<String> clusters
) {
Expand All @@ -35,7 +36,7 @@ public static StepListener<BiFunction<String, String, DiscoveryNode>> getConnect
if (clusters.isEmpty()) {
lookupListener.onResponse((cluster, nodeId) -> state.getNodes().get(nodeId));
} else {
searchTransportService.getRemoteClusterService().collectNodes(clusters, lookupListener);
remoteClusterService.collectNodes(clusters, lookupListener);
}
return lookupListener;
}
Expand Down

0 comments on commit 471a64a

Please sign in to comment.