Remove tagline from sever and RHLC (#427)
Signed-off-by: Tianli Feng <ftianli@amazon.com>
This commit is contained in:
parent
a7776b7546
commit
672d975f43
|
@ -30,7 +30,7 @@ public class MainResponse {
|
||||||
private static final ConstructingObjectParser<MainResponse, Void> PARSER =
|
private static final ConstructingObjectParser<MainResponse, Void> PARSER =
|
||||||
new ConstructingObjectParser<>(MainResponse.class.getName(), true,
|
new ConstructingObjectParser<>(MainResponse.class.getName(), true,
|
||||||
args -> {
|
args -> {
|
||||||
return new MainResponse((String) args[0], (Version) args[1], (String) args[2], (String) args[3], (String) args[4]);
|
return new MainResponse((String) args[0], (Version) args[1], (String) args[2], (String) args[3]);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -39,7 +39,6 @@ public class MainResponse {
|
||||||
PARSER.declareObject(ConstructingObjectParser.constructorArg(), Version.PARSER, new ParseField("version"));
|
PARSER.declareObject(ConstructingObjectParser.constructorArg(), Version.PARSER, new ParseField("version"));
|
||||||
PARSER.declareString(ConstructingObjectParser.constructorArg(), new ParseField("cluster_name"));
|
PARSER.declareString(ConstructingObjectParser.constructorArg(), new ParseField("cluster_name"));
|
||||||
PARSER.declareString(ConstructingObjectParser.constructorArg(), new ParseField("cluster_uuid"));
|
PARSER.declareString(ConstructingObjectParser.constructorArg(), new ParseField("cluster_uuid"));
|
||||||
PARSER.declareString(ConstructingObjectParser.constructorArg(), new ParseField("tagline"));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,14 +46,12 @@ public class MainResponse {
|
||||||
private final Version version;
|
private final Version version;
|
||||||
private final String clusterName;
|
private final String clusterName;
|
||||||
private final String clusterUuid;
|
private final String clusterUuid;
|
||||||
private final String tagline;
|
|
||||||
|
|
||||||
public MainResponse(String nodeName, Version version, String clusterName, String clusterUuid, String tagline) {
|
public MainResponse(String nodeName, Version version, String clusterName, String clusterUuid) {
|
||||||
this.nodeName = nodeName;
|
this.nodeName = nodeName;
|
||||||
this.version = version;
|
this.version = version;
|
||||||
this.clusterName = clusterName;
|
this.clusterName = clusterName;
|
||||||
this.clusterUuid = clusterUuid;
|
this.clusterUuid = clusterUuid;
|
||||||
this.tagline = tagline;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getNodeName() {
|
public String getNodeName() {
|
||||||
|
@ -73,10 +70,6 @@ public class MainResponse {
|
||||||
return clusterUuid;
|
return clusterUuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTagline() {
|
|
||||||
return tagline;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MainResponse fromXContent(XContentParser parser) {
|
public static MainResponse fromXContent(XContentParser parser) {
|
||||||
return PARSER.apply(parser, null);
|
return PARSER.apply(parser, null);
|
||||||
}
|
}
|
||||||
|
@ -89,13 +82,12 @@ public class MainResponse {
|
||||||
return nodeName.equals(that.nodeName) &&
|
return nodeName.equals(that.nodeName) &&
|
||||||
version.equals(that.version) &&
|
version.equals(that.version) &&
|
||||||
clusterName.equals(that.clusterName) &&
|
clusterName.equals(that.clusterName) &&
|
||||||
clusterUuid.equals(that.clusterUuid) &&
|
clusterUuid.equals(that.clusterUuid);
|
||||||
tagline.equals(that.tagline);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(nodeName, version, clusterName, clusterUuid, tagline);
|
return Objects.hash(nodeName, version, clusterName, clusterUuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Version {
|
public static class Version {
|
||||||
|
|
|
@ -167,7 +167,7 @@ public class RestHighLevelClientTests extends ESTestCase {
|
||||||
public void testInfo() throws IOException {
|
public void testInfo() throws IOException {
|
||||||
MainResponse testInfo = new MainResponse("nodeName", new MainResponse.Version("number", "buildType", "buildHash",
|
MainResponse testInfo = new MainResponse("nodeName", new MainResponse.Version("number", "buildType", "buildHash",
|
||||||
"buildDate", true, "luceneVersion", "minimumWireCompatibilityVersion", "minimumIndexCompatibilityVersion"),
|
"buildDate", true, "luceneVersion", "minimumWireCompatibilityVersion", "minimumIndexCompatibilityVersion"),
|
||||||
"clusterName", "clusterUuid", "You Know, for Search");
|
"clusterName", "clusterUuid");
|
||||||
mockResponse((ToXContentFragment) (builder, params) -> {
|
mockResponse((ToXContentFragment) (builder, params) -> {
|
||||||
// taken from the server side MainResponse
|
// taken from the server side MainResponse
|
||||||
builder.field("name", testInfo.getNodeName());
|
builder.field("name", testInfo.getNodeName());
|
||||||
|
@ -183,7 +183,6 @@ public class RestHighLevelClientTests extends ESTestCase {
|
||||||
.field("minimum_wire_compatibility_version", testInfo.getVersion().getMinimumWireCompatibilityVersion())
|
.field("minimum_wire_compatibility_version", testInfo.getVersion().getMinimumWireCompatibilityVersion())
|
||||||
.field("minimum_index_compatibility_version", testInfo.getVersion().getMinimumIndexCompatibilityVersion())
|
.field("minimum_index_compatibility_version", testInfo.getVersion().getMinimumIndexCompatibilityVersion())
|
||||||
.endObject();
|
.endObject();
|
||||||
builder.field("tagline", testInfo.getTagline());
|
|
||||||
return builder;
|
return builder;
|
||||||
});
|
});
|
||||||
MainResponse receivedInfo = restHighLevelClient.info(RequestOptions.DEFAULT);
|
MainResponse receivedInfo = restHighLevelClient.info(RequestOptions.DEFAULT);
|
||||||
|
|
|
@ -57,7 +57,6 @@ public class MainResponseTests extends AbstractResponseTestCase<org.elasticsearc
|
||||||
assertThat(serverTestInstance.getClusterName().value(), equalTo(clientInstance.getClusterName()));
|
assertThat(serverTestInstance.getClusterName().value(), equalTo(clientInstance.getClusterName()));
|
||||||
assertThat(serverTestInstance.getClusterUuid(), equalTo(clientInstance.getClusterUuid()));
|
assertThat(serverTestInstance.getClusterUuid(), equalTo(clientInstance.getClusterUuid()));
|
||||||
assertThat(serverTestInstance.getNodeName(), equalTo(clientInstance.getNodeName()));
|
assertThat(serverTestInstance.getNodeName(), equalTo(clientInstance.getNodeName()));
|
||||||
assertThat("You Know, for Search", equalTo(clientInstance.getTagline()));
|
|
||||||
|
|
||||||
assertThat(serverTestInstance.getBuild().hash(), equalTo(clientInstance.getVersion().getBuildHash()));
|
assertThat(serverTestInstance.getBuild().hash(), equalTo(clientInstance.getVersion().getBuildHash()));
|
||||||
assertThat(serverTestInstance.getVersion().toString(), equalTo(clientInstance.getVersion().getNumber()));
|
assertThat(serverTestInstance.getVersion().toString(), equalTo(clientInstance.getVersion().getNumber()));
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
- is_true: name
|
- is_true: name
|
||||||
- is_true: cluster_name
|
- is_true: cluster_name
|
||||||
- is_true: cluster_uuid
|
- is_true: cluster_uuid
|
||||||
- is_true: tagline
|
|
||||||
- is_true: version
|
- is_true: version
|
||||||
- is_true: version.number
|
- is_true: version.number
|
||||||
- match: { version.build_type: "docker" }
|
- match: { version.build_type: "docker" }
|
||||||
|
|
|
@ -4,6 +4,5 @@
|
||||||
- is_true: name
|
- is_true: name
|
||||||
- is_true: cluster_name
|
- is_true: cluster_name
|
||||||
- is_true: cluster_uuid
|
- is_true: cluster_uuid
|
||||||
- is_true: tagline
|
|
||||||
- is_true: version
|
- is_true: version
|
||||||
- is_true: version.number
|
- is_true: version.number
|
||||||
|
|
|
@ -113,7 +113,6 @@ public class MainResponse extends ActionResponse implements ToXContentObject {
|
||||||
.field("minimum_wire_compatibility_version", version.minimumCompatibilityVersion().toString())
|
.field("minimum_wire_compatibility_version", version.minimumCompatibilityVersion().toString())
|
||||||
.field("minimum_index_compatibility_version", version.minimumIndexCompatibilityVersion().toString())
|
.field("minimum_index_compatibility_version", version.minimumIndexCompatibilityVersion().toString())
|
||||||
.endObject();
|
.endObject();
|
||||||
builder.field("tagline", "You Know, for Search");
|
|
||||||
builder.endObject();
|
builder.endObject();
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
@ -125,7 +124,6 @@ public class MainResponse extends ActionResponse implements ToXContentObject {
|
||||||
PARSER.declareString((response, value) -> response.nodeName = value, new ParseField("name"));
|
PARSER.declareString((response, value) -> response.nodeName = value, new ParseField("name"));
|
||||||
PARSER.declareString((response, value) -> response.clusterName = new ClusterName(value), new ParseField("cluster_name"));
|
PARSER.declareString((response, value) -> response.clusterName = new ClusterName(value), new ParseField("cluster_name"));
|
||||||
PARSER.declareString((response, value) -> response.clusterUuid = value, new ParseField("cluster_uuid"));
|
PARSER.declareString((response, value) -> response.clusterUuid = value, new ParseField("cluster_uuid"));
|
||||||
PARSER.declareString((response, value) -> {}, new ParseField("tagline"));
|
|
||||||
PARSER.declareObject((response, value) -> {
|
PARSER.declareObject((response, value) -> {
|
||||||
final String buildType = (String) value.get("build_type");
|
final String buildType = (String) value.get("build_type");
|
||||||
response.build =
|
response.build =
|
||||||
|
|
|
@ -83,8 +83,7 @@ public class MainResponseTests extends AbstractSerializingTestCase<MainResponse>
|
||||||
+ "\"build_snapshot\":" + current.isSnapshot() + ","
|
+ "\"build_snapshot\":" + current.isSnapshot() + ","
|
||||||
+ "\"lucene_version\":\"" + version.luceneVersion.toString() + "\","
|
+ "\"lucene_version\":\"" + version.luceneVersion.toString() + "\","
|
||||||
+ "\"minimum_wire_compatibility_version\":\"" + version.minimumCompatibilityVersion().toString() + "\","
|
+ "\"minimum_wire_compatibility_version\":\"" + version.minimumCompatibilityVersion().toString() + "\","
|
||||||
+ "\"minimum_index_compatibility_version\":\"" + version.minimumIndexCompatibilityVersion().toString() + "\"},"
|
+ "\"minimum_index_compatibility_version\":\"" + version.minimumIndexCompatibilityVersion().toString() + "\"}"
|
||||||
+ "\"tagline\":\"You Know, for Search\""
|
|
||||||
+ "}", Strings.toString(builder));
|
+ "}", Strings.toString(builder));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue