mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
Remove cluster state size (#40109)
This commit removes the cluster state size field from the cluster state response, and drops the backwards compatibility layer added in 6.7.0 to continue to support this field. As calculation of this field was expensive and had dubious value, we have elected to remove this field.
This commit is contained in:
parent
a019af7690
commit
86d1d03c37
@ -161,8 +161,9 @@ task verifyVersions {
|
||||
* the enabled state of every bwc task. It should be set back to true
|
||||
* after the backport of the backcompat code is complete.
|
||||
*/
|
||||
boolean bwc_tests_enabled = true
|
||||
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
|
||||
|
||||
boolean bwc_tests_enabled = false
|
||||
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/40061" /* place a PR link here when committing bwc changes */
|
||||
if (bwc_tests_enabled == false) {
|
||||
if (bwc_tests_disabled_issue.isEmpty()) {
|
||||
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")
|
||||
|
@ -127,7 +127,7 @@ public class CrossClusterSearchUnavailableClusterIT extends ESRestTestCase {
|
||||
builder.add(node);
|
||||
}
|
||||
ClusterState build = ClusterState.builder(clusterName).nodes(builder.build()).build();
|
||||
channel.sendResponse(new ClusterStateResponse(clusterName, build, 0L, false));
|
||||
channel.sendResponse(new ClusterStateResponse(clusterName, build, false));
|
||||
});
|
||||
newService.start();
|
||||
newService.acceptIncomingRequests();
|
||||
|
@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import org.elasticsearch.gradle.test.RestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
|
||||
task integTest(type: RestIntegTestTask) {
|
||||
mustRunAfter(precommit)
|
||||
}
|
||||
|
||||
integTestCluster {
|
||||
systemProperty 'es.cluster_state.size', 'true'
|
||||
}
|
||||
|
||||
unitTest.enabled = false
|
||||
check.dependsOn integTest
|
@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.cluster_state_size;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.client.RequestOptions;
|
||||
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
|
||||
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class ClusterStateSizeRestIT extends ESClientYamlSuiteTestCase {
|
||||
|
||||
public ClusterStateSizeRestIT(final ClientYamlTestCandidate candidate) {
|
||||
super(candidate);
|
||||
}
|
||||
|
||||
@ParametersFactory
|
||||
public static Iterable<Object[]> parameters() throws Exception {
|
||||
return ESClientYamlSuiteTestCase.createParameters();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RequestOptions getCatNodesVersionMasterRequestOptions() {
|
||||
final RequestOptions.Builder builder = RequestOptions.DEFAULT.toBuilder();
|
||||
final VersionSensitiveWarningsHandler handler = new VersionSensitiveWarningsHandler(Collections.singleton(Version.CURRENT));
|
||||
handler.current("es.cluster_state.size is deprecated and will be removed in 7.0.0");
|
||||
builder.setWarningsHandler(handler);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean preserveClusterSettings() {
|
||||
// we did not add any cluster settings, we are the only test using this cluster, and trying to clean these will trigger a warning
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean preserveTemplatesUponCompletion() {
|
||||
// we did not add any templates, we are the only test using this cluster, and trying to clean these will trigger a warning
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
---
|
||||
"get cluster state returns cluster state size with human readable format":
|
||||
- skip:
|
||||
reason: deprecation was added in 6.7.0
|
||||
features: "warnings"
|
||||
|
||||
- do:
|
||||
warnings:
|
||||
- 'es.cluster_state.size is deprecated and will be removed in 7.0.0'
|
||||
cluster.state:
|
||||
human: true
|
||||
|
||||
- is_true: master_node
|
||||
- gte: { compressed_size_in_bytes: 50 }
|
||||
- is_true: compressed_size
|
@ -5,19 +5,6 @@
|
||||
|
||||
- is_true: master_node
|
||||
|
||||
---
|
||||
"get cluster state does not return cluster state size by default":
|
||||
- skip:
|
||||
version: " - 6.6.99"
|
||||
reason: "backwards compatibility break in 6.7.0 removes compressed_size* from the response"
|
||||
- do:
|
||||
cluster.state:
|
||||
human: true
|
||||
|
||||
- is_true: master_node
|
||||
- is_false: compressed_size_in_bytes
|
||||
- is_false: compressed_size
|
||||
|
||||
---
|
||||
"get cluster state returns cluster_uuid at the top level":
|
||||
- skip:
|
||||
|
@ -39,18 +39,14 @@ public class ClusterStateResponse extends ActionResponse {
|
||||
|
||||
private ClusterName clusterName;
|
||||
private ClusterState clusterState;
|
||||
// the total compressed size of the full cluster state, not just
|
||||
// the parts included in this response
|
||||
private ByteSizeValue totalCompressedSize;
|
||||
private boolean waitForTimedOut = false;
|
||||
|
||||
public ClusterStateResponse() {
|
||||
}
|
||||
|
||||
public ClusterStateResponse(ClusterName clusterName, ClusterState clusterState, long sizeInBytes, boolean waitForTimedOut) {
|
||||
public ClusterStateResponse(ClusterName clusterName, ClusterState clusterState, boolean waitForTimedOut) {
|
||||
this.clusterName = clusterName;
|
||||
this.clusterState = clusterState;
|
||||
this.totalCompressedSize = new ByteSizeValue(sizeInBytes);
|
||||
this.waitForTimedOut = waitForTimedOut;
|
||||
}
|
||||
|
||||
@ -69,17 +65,6 @@ public class ClusterStateResponse extends ActionResponse {
|
||||
return this.clusterName;
|
||||
}
|
||||
|
||||
/**
|
||||
* The total compressed size of the full cluster state, not just the parts
|
||||
* returned by {@link #getState()}. The total compressed size is the size
|
||||
* of the cluster state as it would be transmitted over the network during
|
||||
* intra-node communication.
|
||||
*/
|
||||
@Deprecated
|
||||
public ByteSizeValue getTotalCompressedSize() {
|
||||
return totalCompressedSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the request timed out waiting for a cluster state with a metadata version equal or
|
||||
* higher than the specified metadata.
|
||||
@ -97,14 +82,8 @@ public class ClusterStateResponse extends ActionResponse {
|
||||
} else {
|
||||
clusterState = ClusterState.readFrom(in, null);
|
||||
}
|
||||
if (in.getVersion().onOrAfter(Version.V_6_0_0_alpha1)) {
|
||||
totalCompressedSize = new ByteSizeValue(in);
|
||||
} else {
|
||||
// in a mixed cluster, if a pre 6.0 node processes the get cluster state
|
||||
// request, then a compressed size won't be returned, so just return 0;
|
||||
// its a temporary situation until all nodes in the cluster have been upgraded,
|
||||
// at which point the correct cluster state size will always be reported
|
||||
totalCompressedSize = new ByteSizeValue(0L);
|
||||
if (in.getVersion().before(Version.V_7_0_0)) {
|
||||
new ByteSizeValue(in);
|
||||
}
|
||||
if (in.getVersion().onOrAfter(Version.V_6_6_0)) {
|
||||
waitForTimedOut = in.readBoolean();
|
||||
@ -124,8 +103,8 @@ public class ClusterStateResponse extends ActionResponse {
|
||||
ClusterModule.filterCustomsForPre63Clients(clusterState).writeTo(out);
|
||||
}
|
||||
}
|
||||
if (out.getVersion().onOrAfter(Version.V_6_0_0_alpha1)) {
|
||||
totalCompressedSize.writeTo(out);
|
||||
if (out.getVersion().before(Version.V_7_0_0)) {
|
||||
ByteSizeValue.ZERO.writeTo(out);
|
||||
}
|
||||
if (out.getVersion().onOrAfter(Version.V_6_6_0)) {
|
||||
out.writeBoolean(waitForTimedOut);
|
||||
@ -142,8 +121,7 @@ public class ClusterStateResponse extends ActionResponse {
|
||||
// Best effort. Only compare cluster state version and master node id,
|
||||
// because cluster state doesn't implement equals()
|
||||
Objects.equals(getVersion(clusterState), getVersion(response.clusterState)) &&
|
||||
Objects.equals(getMasterNodeId(clusterState), getMasterNodeId(response.clusterState)) &&
|
||||
Objects.equals(totalCompressedSize, response.totalCompressedSize);
|
||||
Objects.equals(getMasterNodeId(clusterState), getMasterNodeId(response.clusterState));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -154,7 +132,6 @@ public class ClusterStateResponse extends ActionResponse {
|
||||
clusterName,
|
||||
getVersion(clusterState),
|
||||
getMasterNodeId(clusterState),
|
||||
totalCompressedSize,
|
||||
waitForTimedOut
|
||||
);
|
||||
}
|
||||
|
@ -22,14 +22,12 @@ package org.elasticsearch.action.admin.cluster.state;
|
||||
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.master.TransportMasterNodeReadAction;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.ClusterStateObserver;
|
||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||
import org.elasticsearch.cluster.coordination.PublicationTransportHandler;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.metadata.MetaData;
|
||||
@ -37,7 +35,6 @@ import org.elasticsearch.cluster.metadata.MetaData.Custom;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.node.NodeClosedException;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
@ -49,21 +46,11 @@ import java.util.function.Predicate;
|
||||
public class TransportClusterStateAction extends TransportMasterNodeReadAction<ClusterStateRequest, ClusterStateResponse> {
|
||||
|
||||
private final Logger logger = LogManager.getLogger(getClass());
|
||||
private final DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
|
||||
|
||||
public static final boolean CLUSTER_STATE_SIZE;
|
||||
|
||||
static {
|
||||
final String property = System.getProperty("es.cluster_state.size");
|
||||
if (property == null) {
|
||||
CLUSTER_STATE_SIZE = false;
|
||||
} else {
|
||||
final boolean clusterStateSize = Boolean.parseBoolean(property);
|
||||
if (clusterStateSize) {
|
||||
CLUSTER_STATE_SIZE = true;
|
||||
} else {
|
||||
throw new IllegalArgumentException("es.cluster_state.size can only be unset or [true] but was [" + property + "]");
|
||||
}
|
||||
if (property != null) {
|
||||
throw new IllegalArgumentException("es.cluster_state.size is no longer respected but was [" + property + "]");
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,7 +114,7 @@ public class TransportClusterStateAction extends TransportMasterNodeReadAction<C
|
||||
@Override
|
||||
public void onTimeout(TimeValue timeout) {
|
||||
try {
|
||||
listener.onResponse(new ClusterStateResponse(clusterState.getClusterName(), null, 0L, true));
|
||||
listener.onResponse(new ClusterStateResponse(clusterState.getClusterName(), null, true));
|
||||
} catch (Exception e) {
|
||||
listener.onFailure(e);
|
||||
}
|
||||
@ -205,15 +192,7 @@ public class TransportClusterStateAction extends TransportMasterNodeReadAction<C
|
||||
}
|
||||
}
|
||||
|
||||
final long sizeInBytes;
|
||||
if (CLUSTER_STATE_SIZE) {
|
||||
deprecationLogger.deprecated("es.cluster_state.size is deprecated and will be removed in 7.0.0");
|
||||
sizeInBytes = PublicationTransportHandler.serializeFullClusterState(currentState, Version.CURRENT).length();
|
||||
} else {
|
||||
sizeInBytes = 0;
|
||||
}
|
||||
|
||||
listener.onResponse(new ClusterStateResponse(currentState.getClusterName(), builder.build(), sizeInBytes, false));
|
||||
listener.onResponse(new ClusterStateResponse(currentState.getClusterName(), builder.build(), false));
|
||||
}
|
||||
|
||||
|
||||
|
@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
|
||||
|
||||
import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest;
|
||||
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
|
||||
import org.elasticsearch.action.admin.cluster.state.TransportClusterStateAction;
|
||||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.Requests;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
@ -103,12 +102,6 @@ public class RestClusterStateAction extends BaseRestHandler {
|
||||
builder.field(Fields.WAIT_FOR_TIMED_OUT, response.isWaitForTimedOut());
|
||||
}
|
||||
builder.field(Fields.CLUSTER_NAME, response.getClusterName().value());
|
||||
if (TransportClusterStateAction.CLUSTER_STATE_SIZE) {
|
||||
builder.humanReadableField(
|
||||
Fields.CLUSTER_STATE_SIZE_IN_BYTES,
|
||||
Fields.CLUSTER_STATE_SIZE,
|
||||
response.getTotalCompressedSize());
|
||||
}
|
||||
response.getState().toXContent(builder, request);
|
||||
builder.endObject();
|
||||
return new BytesRestResponse(RestStatus.OK, builder);
|
||||
@ -138,7 +131,6 @@ public class RestClusterStateAction extends BaseRestHandler {
|
||||
static final class Fields {
|
||||
static final String WAIT_FOR_TIMED_OUT = "wait_for_timed_out";
|
||||
static final String CLUSTER_NAME = "cluster_name";
|
||||
static final String CLUSTER_STATE_SIZE = "compressed_size";
|
||||
static final String CLUSTER_STATE_SIZE_IN_BYTES = "compressed_size_in_bytes";
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class ClusterStateResponseTests extends AbstractStreamableTestCase<Cluste
|
||||
}
|
||||
clusterState = clusterStateBuilder.build();
|
||||
}
|
||||
return new ClusterStateResponse(clusterName, clusterState, randomNonNegativeLong(), randomBoolean());
|
||||
return new ClusterStateResponse(clusterName, clusterState, randomBoolean());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -101,7 +101,7 @@ abstract class FailAndRetryMockTransport<Response extends TransportResponse> imp
|
||||
} else if (ClusterStateAction.NAME.equals(action)) {
|
||||
TransportResponseHandler transportResponseHandler = responseHandlers.onResponseReceived(requestId, listener);
|
||||
ClusterState clusterState = getMockClusterState(node);
|
||||
transportResponseHandler.handleResponse(new ClusterStateResponse(clusterName, clusterState, 0L, false));
|
||||
transportResponseHandler.handleResponse(new ClusterStateResponse(clusterName, clusterState, false));
|
||||
} else if (TransportService.HANDSHAKE_ACTION_NAME.equals(action)) {
|
||||
TransportResponseHandler transportResponseHandler = responseHandlers.onResponseReceived(requestId, listener);
|
||||
Version version = node.getVersion();
|
||||
|
@ -175,7 +175,7 @@ public class TransportClientHeadersTests extends AbstractClientHeadersTestCase {
|
||||
address.address().getHostString(), address.getAddress(), address, Collections.emptyMap(),
|
||||
Collections.singleton(DiscoveryNode.Role.DATA), Version.CURRENT)));
|
||||
((TransportResponseHandler<ClusterStateResponse>) handler)
|
||||
.handleResponse(new ClusterStateResponse(cluster1, builder.build(), 0L, false));
|
||||
.handleResponse(new ClusterStateResponse(cluster1, builder.build(), false));
|
||||
clusterStateLatch.countDown();
|
||||
} else if (TransportService.HANDSHAKE_ACTION_NAME .equals(action)) {
|
||||
((TransportResponseHandler<TransportService.HandshakeResponse>) handler).handleResponse(
|
||||
|
@ -427,7 +427,7 @@ public class TransportClientNodesServiceTests extends ESTestCase {
|
||||
|
||||
DiscoveryNodes discoveryNodes = DiscoveryNodes.builder().add(transportService.getLocalDiscoNode()).build();
|
||||
ClusterState build = ClusterState.builder(ClusterName.DEFAULT).nodes(discoveryNodes).build();
|
||||
channel.sendResponse(new ClusterStateResponse(ClusterName.DEFAULT, build, 0L, false));
|
||||
channel.sendResponse(new ClusterStateResponse(ClusterName.DEFAULT, build, false));
|
||||
}
|
||||
|
||||
void failToRespond() {
|
||||
|
@ -1,54 +0,0 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.cluster;
|
||||
|
||||
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
|
||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
/**
|
||||
* Tests for the get cluster state API.
|
||||
*
|
||||
* See: {@link org.elasticsearch.action.admin.cluster.state.TransportClusterStateAction}
|
||||
* {@link org.elasticsearch.rest.action.admin.cluster.RestClusterStateAction}
|
||||
*/
|
||||
public class GetClusterStateTests extends ESSingleNodeTestCase {
|
||||
|
||||
public void testGetClusterState() {
|
||||
ClusterStateResponse response = client().admin().cluster().prepareState().get();
|
||||
assertNotNull(response.getState());
|
||||
assertNotNull(response.getClusterName());
|
||||
// the cluster state size is no longer computed by default
|
||||
assertThat(response.getTotalCompressedSize().getBytes(), equalTo(0L));
|
||||
}
|
||||
|
||||
public void testSizeDerivedFromFullClusterState() {
|
||||
ClusterStateResponse response = client().admin().cluster().prepareState().get();
|
||||
final ClusterState clusterState = response.getState();
|
||||
final long totalCompressedSize = response.getTotalCompressedSize().getBytes();
|
||||
// exclude the nodes from being returned, the total size returned should still be
|
||||
// the same as when no filtering was applied to the cluster state retrieved
|
||||
response = client().admin().cluster().prepareState().setNodes(false).get();
|
||||
assertEquals(totalCompressedSize, response.getTotalCompressedSize().getBytes());
|
||||
assertNotEquals(clusterState, response.getState());
|
||||
assertEquals(0, response.getState().nodes().getSize());
|
||||
}
|
||||
}
|
@ -60,7 +60,7 @@ public class RestNodesActionTests extends ESTestCase {
|
||||
ClusterState clusterState = mock(ClusterState.class);
|
||||
when(clusterState.nodes()).thenReturn(discoveryNodes);
|
||||
|
||||
ClusterStateResponse clusterStateResponse = new ClusterStateResponse(clusterName, clusterState, randomNonNegativeLong(), false);
|
||||
ClusterStateResponse clusterStateResponse = new ClusterStateResponse(clusterName, clusterState, false);
|
||||
NodesInfoResponse nodesInfoResponse = new NodesInfoResponse(clusterName, Collections.emptyList(), Collections.emptyList());
|
||||
NodesStatsResponse nodesStatsResponse = new NodesStatsResponse(clusterName, Collections.emptyList(), Collections.emptyList());
|
||||
|
||||
|
@ -165,7 +165,7 @@ public class RemoteClusterConnectionTests extends ESTestCase {
|
||||
builder.add(node);
|
||||
}
|
||||
ClusterState build = ClusterState.builder(clusterName).nodes(builder.build()).build();
|
||||
channel.sendResponse(new ClusterStateResponse(clusterName, build, 0L, false));
|
||||
channel.sendResponse(new ClusterStateResponse(clusterName, build, false));
|
||||
});
|
||||
newService.start();
|
||||
newService.acceptIncomingRequests();
|
||||
|
@ -98,7 +98,7 @@ public class AutoFollowCoordinatorTests extends ESTestCase {
|
||||
long metadataVersion,
|
||||
BiConsumer<ClusterStateResponse, Exception> handler) {
|
||||
assertThat(remoteCluster, equalTo("remote"));
|
||||
handler.accept(new ClusterStateResponse(new ClusterName("name"), remoteState, 1L, false), null);
|
||||
handler.accept(new ClusterStateResponse(new ClusterName("name"), remoteState, false), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -217,7 +217,7 @@ public class AutoFollowCoordinatorTests extends ESTestCase {
|
||||
void getRemoteClusterState(String remoteCluster,
|
||||
long metadataVersion,
|
||||
BiConsumer<ClusterStateResponse, Exception> handler) {
|
||||
handler.accept(new ClusterStateResponse(new ClusterName("name"), remoteState, 1L, false), null);
|
||||
handler.accept(new ClusterStateResponse(new ClusterName("name"), remoteState, false), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -274,7 +274,7 @@ public class AutoFollowCoordinatorTests extends ESTestCase {
|
||||
void getRemoteClusterState(String remoteCluster,
|
||||
long metadataVersion,
|
||||
BiConsumer<ClusterStateResponse, Exception> handler) {
|
||||
handler.accept(new ClusterStateResponse(new ClusterName("name"), remoteState, 1L, false), null);
|
||||
handler.accept(new ClusterStateResponse(new ClusterName("name"), remoteState, false), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -729,7 +729,7 @@ public class AutoFollowCoordinatorTests extends ESTestCase {
|
||||
BiConsumer<ClusterStateResponse, Exception> handler) {
|
||||
assertThat(remoteCluster, equalTo("remote"));
|
||||
assertThat(metadataVersion, greaterThan(previousRequestedMetadataVersion));
|
||||
handler.accept(new ClusterStateResponse(new ClusterName("name"), leaderStates.poll(), 1L, false), null);
|
||||
handler.accept(new ClusterStateResponse(new ClusterName("name"), leaderStates.poll(), false), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -788,7 +788,7 @@ public class AutoFollowCoordinatorTests extends ESTestCase {
|
||||
counter.incrementAndGet();
|
||||
assertThat(remoteCluster, equalTo("remote"));
|
||||
assertThat(metadataVersion, greaterThan(previousRequestedMetadataVersion));
|
||||
handler.accept(new ClusterStateResponse(new ClusterName("name"), null, 1L, true), null);
|
||||
handler.accept(new ClusterStateResponse(new ClusterName("name"), null, true), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -838,7 +838,7 @@ public class AutoFollowCoordinatorTests extends ESTestCase {
|
||||
long metadataVersion,
|
||||
BiConsumer<ClusterStateResponse, Exception> handler) {
|
||||
assertThat(remoteCluster, equalTo("remote"));
|
||||
handler.accept(new ClusterStateResponse(new ClusterName("name"), remoteState, 1L, false), null);
|
||||
handler.accept(new ClusterStateResponse(new ClusterName("name"), remoteState, false), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -914,7 +914,7 @@ public class AutoFollowCoordinatorTests extends ESTestCase {
|
||||
long metadataVersion,
|
||||
BiConsumer<ClusterStateResponse, Exception> handler) {
|
||||
assertThat(remoteCluster, equalTo("remote"));
|
||||
handler.accept(new ClusterStateResponse(new ClusterName("name"), remoteState, 1L, false), null);
|
||||
handler.accept(new ClusterStateResponse(new ClusterName("name"), remoteState, false), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user