diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/cluster/ProxyModeInfo.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/cluster/ProxyModeInfo.java index 0fc4f240eb8ef..79758ec709c63 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/cluster/ProxyModeInfo.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/cluster/ProxyModeInfo.java @@ -23,9 +23,9 @@ public class ProxyModeInfo implements RemoteConnectionInfo.ModeInfo { static final String NAME = "proxy"; - static final String ADDRESS = "address"; - static final String NUM_SOCKETS_CONNECTED = "num_sockets_connected"; - static final String MAX_SOCKET_CONNECTIONS = "max_socket_connections"; + static final String PROXY_ADDRESS = "proxy_address"; + static final String NUM_PROXY_SOCKETS_CONNECTED = "num_proxy_sockets_connected"; + static final String MAX_PROXY_SOCKET_CONNECTIONS = "max_proxy_socket_connections"; private final String address; private final int maxSocketConnections; private final int numSocketsConnected; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/cluster/RemoteConnectionInfo.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/cluster/RemoteConnectionInfo.java index 2bf99c61085c4..474b991cd434a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/cluster/RemoteConnectionInfo.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/cluster/RemoteConnectionInfo.java @@ -66,9 +66,9 @@ public final class RemoteConnectionInfo { PARSER.declareString(constructorArg(), new ParseField(INITIAL_CONNECT_TIMEOUT)); PARSER.declareBoolean(constructorArg(), new ParseField(SKIP_UNAVAILABLE)); - PARSER.declareString(optionalConstructorArg(), new ParseField(ProxyModeInfo.ADDRESS)); - PARSER.declareInt(optionalConstructorArg(), new ParseField(ProxyModeInfo.MAX_SOCKET_CONNECTIONS)); - PARSER.declareInt(optionalConstructorArg(), new ParseField(ProxyModeInfo.NUM_SOCKETS_CONNECTED)); + PARSER.declareString(optionalConstructorArg(), new ParseField(ProxyModeInfo.PROXY_ADDRESS)); + PARSER.declareInt(optionalConstructorArg(), new ParseField(ProxyModeInfo.MAX_PROXY_SOCKET_CONNECTIONS)); + PARSER.declareInt(optionalConstructorArg(), new ParseField(ProxyModeInfo.NUM_PROXY_SOCKETS_CONNECTED)); PARSER.declareStringArray(optionalConstructorArg(), new ParseField(SniffModeInfo.SEEDS)); PARSER.declareInt(optionalConstructorArg(), new ParseField(SniffModeInfo.MAX_CONNECTIONS_PER_CLUSTER)); diff --git a/docs/reference/cluster/remote-info.asciidoc b/docs/reference/cluster/remote-info.asciidoc index 8e81a0444886c..05931ea2d6a16 100644 --- a/docs/reference/cluster/remote-info.asciidoc +++ b/docs/reference/cluster/remote-info.asciidoc @@ -51,13 +51,13 @@ by the configured remote cluster alias. Maximum number of connections maintained for the remote cluster when sniff mode is configured. -`address`:: +`proxy_address`:: Address for remote connections when proxy mode is configured. -`num_sockets_connected`:: +`num_proxy_sockets_connected`:: Number of open socket connections to the remote cluster when proxy mode is configured. -`max_socket_connections`:: +`max_proxy_socket_connections`:: The maximum number of socket connections to the remote cluster when proxy mode is configured. diff --git a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/20_info.yml b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/20_info.yml index 0e5236f9b1171..f8a31c5ec9214 100644 --- a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/20_info.yml +++ b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/20_info.yml @@ -80,9 +80,9 @@ cluster.remote_info: {} - match: { test_remote_cluster.connected: true } - - match: { test_remote_cluster.address: $remote_ip } - - gt: { test_remote_cluster.num_sockets_connected: 0} - - match: { test_remote_cluster.max_socket_connections: 10} + - match: { test_remote_cluster.proxy_address: $remote_ip } + - gt: { test_remote_cluster.num_proxy_sockets_connected: 0} + - match: { test_remote_cluster.max_proxy_socket_connections: 10} - match: { test_remote_cluster.initial_connect_timeout: "30s" } - match: { test_remote_cluster.mode: "proxy" } diff --git a/server/src/main/java/org/elasticsearch/transport/ProxyConnectionStrategy.java b/server/src/main/java/org/elasticsearch/transport/ProxyConnectionStrategy.java index 5ce6de7998801..2d314a591b57a 100644 --- a/server/src/main/java/org/elasticsearch/transport/ProxyConnectionStrategy.java +++ b/server/src/main/java/org/elasticsearch/transport/ProxyConnectionStrategy.java @@ -272,9 +272,9 @@ private ProxyModeInfo(StreamInput input) throws IOException { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { - builder.field("address", address); - builder.field("num_sockets_connected", numSocketsConnected); - builder.field("max_socket_connections", maxSocketConnections); + builder.field("proxy_address", address); + builder.field("num_proxy_sockets_connected", numSocketsConnected); + builder.field("max_proxy_socket_connections", maxSocketConnections); return builder; } diff --git a/server/src/test/java/org/elasticsearch/transport/RemoteClusterConnectionTests.java b/server/src/test/java/org/elasticsearch/transport/RemoteClusterConnectionTests.java index f8a4fe4b9429b..2e3102cb7e926 100644 --- a/server/src/test/java/org/elasticsearch/transport/RemoteClusterConnectionTests.java +++ b/server/src/test/java/org/elasticsearch/transport/RemoteClusterConnectionTests.java @@ -417,8 +417,8 @@ public void testRenderConnectionInfoXContent() throws IOException { "\"num_nodes_connected\":2,\"max_connections_per_cluster\":3,\"initial_connect_timeout\":\"30m\"," + "\"skip_unavailable\":true}}", Strings.toString(builder)); } else { - assertEquals("{\"test_cluster\":{\"connected\":true,\"mode\":\"proxy\",\"address\":\"seed:1\"," + - "\"num_sockets_connected\":16,\"max_socket_connections\":18,\"initial_connect_timeout\":\"30m\"," + + assertEquals("{\"test_cluster\":{\"connected\":true,\"mode\":\"proxy\",\"proxy_address\":\"seed:1\"," + + "\"num_proxy_sockets_connected\":16,\"max_proxy_socket_connections\":18,\"initial_connect_timeout\":\"30m\"," + "\"skip_unavailable\":true}}", Strings.toString(builder)); } }