arina-ielchiieva commented on a change in pull request #1886: DRILL-7273: 
Introduce operators for handling metadata
URL: https://github.com/apache/drill/pull/1886#discussion_r344780598
 
 

 ##########
 File path: 
metastore/metastore-api/src/main/java/org/apache/drill/metastore/statistics/StatisticsHolder.java
 ##########
 @@ -65,19 +67,45 @@ public StatisticsKind getStatisticsKind() {
     return statisticsKind;
   }
 
-  public static StatisticsHolder of(String serialized) {
-    try {
-      return OBJECT_READER.readValue(serialized);
-    } catch (IOException e) {
-      throw new IllegalArgumentException("Unable to convert statistics holder 
from json string" + serialized, e);
-    }
-  }
-
   public String jsonString() {
     try {
       return OBJECT_WRITER.writeValueAsString(this);
     } catch (JsonProcessingException e) {
       throw new IllegalStateException("Unable to convert statistics holder to 
json string", e);
     }
   }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    StatisticsHolder<?> that = (StatisticsHolder<?>) o;
+    return Objects.equals(statisticsValue, that.statisticsValue)
+        && Objects.equals(statisticsKind, that.statisticsKind);
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(statisticsValue, statisticsKind);
+  }
+
+  @Override
+  public String toString() {
+    return new StringJoiner(",\n", StatisticsHolder.class.getSimpleName() + 
"[\n", "]")
+        .add("statisticsValue=" + statisticsValue)
+        .add("statisticsKind=" + statisticsKind)
+        .toString();
+  }
+
+  public static StatisticsHolder of(String serialized) {
+    try {
+      return OBJECT_READER.readValue(serialized);
+    } catch (IOException e) {
+      throw new IllegalArgumentException("Unable to convert statistics holder 
from json string" + serialized, e);
 
 Review comment:
   ... string: " + serialized

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to