Caideyipi commented on code in PR #12018:
URL: https://github.com/apache/iotdb/pull/12018#discussion_r1477158712


##########
iotdb-api/pipe-api/src/main/java/org/apache/iotdb/pipe/api/customizer/parameter/PipeParameters.java:
##########
@@ -281,30 +283,15 @@ public String toString() {
   }
 
   /**
-   * This method uses {@link KeyReducer} to reduce keys and then sorts them to 
determine if two
-   * PipeParameters are equivalent.
+   * This method adds (non-existed) or replaces (existed) attributes in this 
PipeParameters with
+   * those from another PipeParameters.
+   *
+   * @param that provide the key that needs to be updated along with the value
+   * @return this pipe parameters
    */
-  public boolean isEquivalent(Object obj) {
-    if (this == obj) {
-      return true;
-    }
-    if (obj == null || getClass() != obj.getClass()) {
-      return false;
-    }
-    PipeParameters that = (PipeParameters) obj;
-    return Objects.equals(
-        this.attributes.entrySet().stream()
-            .collect(
-                Collectors.toMap(
-                    entry -> KeyReducer.reduce(entry.getKey()), 
Entry::getValue,
-                    (oldValue, newValue) -> oldValue, TreeMap::new))
-            .toString(),
-        that.attributes.entrySet().stream()
-            .collect(
-                Collectors.toMap(
-                    entry -> KeyReducer.reduce(entry.getKey()), 
Entry::getValue,
-                    (oldValue, newValue) -> oldValue, TreeMap::new))
-            .toString());
+  public PipeParameters addOrReplaceAttributes(PipeParameters that) {
+    that.attributes.forEach((k, v) -> 
this.attributes.put(KeyReducer.reduce(k), v));

Review Comment:
   How to tackle node-urls is tricky and may need some discussion.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to