Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
2804860
Relocate RemoteClusterService methods only used in tests.
JeremyDahlgren Jul 28, 2025
1b82079
Merge branch 'main' into tasks/rcs-rm-isCrossClusterSearchEnabled
JeremyDahlgren Jul 28, 2025
458cbb4
Reorder params, make isRemoteNodeConnected() public
JeremyDahlgren Jul 29, 2025
0b7e266
Merge branch 'main' into tasks/rcs-rm-isCrossClusterSearchEnabled
JeremyDahlgren Jul 29, 2025
0b51a12
Merge branch 'main' into tasks/rcs-rm-isCrossClusterSearchEnabled
JeremyDahlgren Jul 29, 2025
780639b
Merge branch 'main' into tasks/rcs-rm-isCrossClusterSearchEnabled
JeremyDahlgren Jul 29, 2025
82f59e2
Merge branch 'main' into tasks/rcs-rm-isCrossClusterSearchEnabled
JeremyDahlgren Jul 29, 2025
b5b92db
Merge branch 'main' into tasks/rcs-rm-isCrossClusterSearchEnabled
JeremyDahlgren Jul 29, 2025
955c658
Merge branch 'main' into tasks/rcs-rm-isCrossClusterSearchEnabled
JeremyDahlgren Jul 29, 2025
e960ca0
Merge branch 'main' into tasks/rcs-rm-isCrossClusterSearchEnabled
JeremyDahlgren Jul 30, 2025
ce28781
Merge branch 'main' into tasks/rcs-rm-isCrossClusterSearchEnabled
JeremyDahlgren Jul 30, 2025
8c50abf
Merge branch 'main' into tasks/rcs-rm-isCrossClusterSearchEnabled
JeremyDahlgren Jul 30, 2025
4af3beb
Replace isCrossClusterSearchEnabled() usage in merged test
JeremyDahlgren Jul 30, 2025
9f629f4
Merge branch 'main' into tasks/rcs-rm-isCrossClusterSearchEnabled
JeremyDahlgren Jul 30, 2025
8146dfc
Merge branch 'main' into tasks/rcs-rm-isCrossClusterSearchEnabled
JeremyDahlgren Jul 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,6 @@ public DiscoveryNode getLocalNode() {
return transportService.getLocalNode();
}

/**
* Returns <code>true</code> if at least one remote cluster is configured
*/
public boolean isCrossClusterSearchEnabled() {
return remoteClusters.isEmpty() == false;
}

boolean isRemoteNodeConnected(final String remoteCluster, final DiscoveryNode node) {
return remoteClusters.get(remoteCluster).isNodeConnected(node);
}

/**
* Group indices by cluster alias mapped to OriginalIndices for that cluster.
* @param remoteClusterNames Set of configured remote cluster names.
Expand Down Expand Up @@ -258,13 +247,6 @@ public Set<String> getConfiguredClusters() {
return getRegisteredRemoteClusterNames();
}

/**
* Returns <code>true</code> iff the given cluster is configured as a remote cluster. Otherwise <code>false</code>
*/
boolean isRemoteClusterRegistered(String clusterName) {
return remoteClusters.containsKey(clusterName);
}

/**
* Returns the registered remote cluster names.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import static org.elasticsearch.test.NodeRoles.removeRoles;
import static org.elasticsearch.transport.AbstractSimpleTransportTestCase.IGNORE_DESERIALIZATION_ERRORS_SETTING;
import static org.elasticsearch.transport.RemoteClusterConnectionTests.startTransport;
import static org.elasticsearch.transport.RemoteClusterServiceTests.isRemoteNodeConnected;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;

Expand Down Expand Up @@ -95,7 +96,7 @@ public void testConnectAndExecuteRequest() throws Exception {
service.acceptIncomingRequests();
logger.info("now accepting incoming requests on local transport");
RemoteClusterService remoteClusterService = service.getRemoteClusterService();
assertTrue(remoteClusterService.isRemoteNodeConnected("test", remoteNode));
assertTrue(isRemoteNodeConnected(remoteClusterService, "test", remoteNode));
var client = remoteClusterService.getRemoteClusterClient(
"test",
threadPool.executor(TEST_THREAD_POOL_NAME),
Expand Down Expand Up @@ -172,7 +173,7 @@ public void testEnsureWeReconnect() throws Exception {
// the right calls in place in the RemoteAwareClient
service.acceptIncomingRequests();
RemoteClusterService remoteClusterService = service.getRemoteClusterService();
assertBusy(() -> assertTrue(remoteClusterService.isRemoteNodeConnected("test", remoteNode)));
assertBusy(() -> assertTrue(isRemoteNodeConnected(remoteClusterService, "test", remoteNode)));
for (int i = 0; i < 10; i++) {
RemoteClusterConnection remoteClusterConnection = remoteClusterService.getRemoteClusterConnection("test");
assertBusy(remoteClusterConnection::assertNoRunningConnections);
Expand Down Expand Up @@ -286,7 +287,7 @@ public void testQuicklySkipUnavailableClusters() throws Exception {
);

try {
assertFalse(remoteClusterService.isRemoteNodeConnected("test", remoteNode));
assertFalse(isRemoteNodeConnected(remoteClusterService, "test", remoteNode));

// check that we quickly fail
if (randomBoolean()) {
Expand Down Expand Up @@ -325,7 +326,7 @@ public void testQuicklySkipUnavailableClusters() throws Exception {
() -> safeAwait(listener -> client.getConnection(null, listener.map(v -> v)))
)
);
assertTrue(remoteClusterService.isRemoteNodeConnected("test", remoteNode));
assertTrue(isRemoteNodeConnected(remoteClusterService, "test", remoteNode));
}
}
}
Expand Down
Loading