diff --git a/client/rest-high-level/src/main/java/org/opensearch/client/tasks/NodeData.java b/client/rest-high-level/src/main/java/org/opensearch/client/tasks/NodeData.java index 9d752da1ef9f8..c45685094c60d 100644 --- a/client/rest-high-level/src/main/java/org/opensearch/client/tasks/NodeData.java +++ b/client/rest-high-level/src/main/java/org/opensearch/client/tasks/NodeData.java @@ -47,6 +47,7 @@ class NodeData { private String transportAddress; private String host; private String ip; + private String remark; private final List roles = new ArrayList<>(); private final Map attributes = new HashMap<>(); private final List tasks = new ArrayList<>(); @@ -82,7 +83,13 @@ void setRoles(List roles) { this.roles.addAll(roles); } } + public String getRemark() { + return remark; + } + public void setRemark(String remark) { + this.remark = remark; + } public String getNodeId() { return nodeId; } @@ -136,6 +143,9 @@ public String toString() { + ", host='" + host + '\'' + + ", remark='" + + remark + + '\'' + ", ip='" + ip + '\'' @@ -156,6 +166,7 @@ public boolean equals(Object o) { && Objects.equals(getTransportAddress(), nodeData.getTransportAddress()) && Objects.equals(getHost(), nodeData.getHost()) && Objects.equals(getIp(), nodeData.getIp()) + && Objects.equals(getRemark(), nodeData.getRemark()) && Objects.equals(getRoles(), nodeData.getRoles()) && Objects.equals(getAttributes(), nodeData.getAttributes()) && Objects.equals(getTasks(), nodeData.getTasks()); @@ -163,7 +174,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(getNodeId(), getName(), getTransportAddress(), getHost(), getIp(), getRoles(), getAttributes(), getTasks()); + return Objects.hash(getNodeId(), getName(),getRemark(), getTransportAddress(), getHost(), getIp(), getRoles(), getAttributes(), getTasks()); } public static final ObjectParser.NamedObjectParser PARSER; @@ -173,6 +184,7 @@ public int hashCode() { parser.declareString(NodeData::setName, new ParseField("name")); parser.declareString(NodeData::setTransportAddress, new ParseField("transport_address")); parser.declareString(NodeData::setHost, new ParseField("host")); + parser.declareString(NodeData::setRemark, new ParseField("remark")); parser.declareString(NodeData::setIp, new ParseField("ip")); parser.declareStringArray(NodeData::setRoles, new ParseField("roles")); parser.declareField(NodeData::setAttributes, (p, c) -> p.mapStrings(), new ParseField("attributes"), ObjectParser.ValueType.OBJECT); diff --git a/client/rest-high-level/src/main/java/org/opensearch/client/tasks/TaskInfo.java b/client/rest-high-level/src/main/java/org/opensearch/client/tasks/TaskInfo.java index 51ac62830446f..9e359950dd40e 100644 --- a/client/rest-high-level/src/main/java/org/opensearch/client/tasks/TaskInfo.java +++ b/client/rest-high-level/src/main/java/org/opensearch/client/tasks/TaskInfo.java @@ -55,6 +55,7 @@ public class TaskInfo { private boolean cancellable; private boolean cancelled; private TaskId parentTaskId; + private String remark; private final Map status = new HashMap<>(); private final Map headers = new HashMap<>(); private final Map resourceStats = new HashMap<>(); @@ -135,6 +136,14 @@ void setParentTaskId(String parentTaskId) { this.parentTaskId = new TaskId(parentTaskId); } + public String getRemark() { + return remark; + } + + void setRemark(String remark) { + this.remark = remark; + } + public Map getHeaders() { return headers; } @@ -170,6 +179,7 @@ private void noOpParse(Object s) {} // already provided in constructor: triggering a no-op parser.declareLong(TaskInfo::noOpParse, new ParseField("id")); parser.declareString(TaskInfo::setType, new ParseField("type")); + parser.declareString(TaskInfo::setRemark, new ParseField("remark")); parser.declareString(TaskInfo::setAction, new ParseField("action")); parser.declareObject(TaskInfo::setStatus, (p, c) -> p.map(), new ParseField("status")); parser.declareString(TaskInfo::setDescription, new ParseField("description")); @@ -196,6 +206,7 @@ && isCancelled() == taskInfo.isCancelled() && Objects.equals(getType(), taskInfo.getType()) && Objects.equals(getAction(), taskInfo.getAction()) && Objects.equals(getDescription(), taskInfo.getDescription()) + && Objects.equals(getRemark(), taskInfo.getRemark()) && Objects.equals(getParentTaskId(), taskInfo.getParentTaskId()) && Objects.equals(status, taskInfo.status) && Objects.equals(getHeaders(), taskInfo.getHeaders()) @@ -213,6 +224,7 @@ public int hashCode() { getRunningTimeNanos(), isCancellable(), isCancelled(), + getRemark(), getParentTaskId(), status, getHeaders(), @@ -231,6 +243,8 @@ public String toString() { + ", action='" + action + '\'' + + ", remark='" + + remark + ", description='" + description + '\''