You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by jl...@apache.org on 2021/03/09 22:46:27 UTC

[incubator-pinot] 01/01: Add toString method in PinotMetricName interface

This is an automated email from the ASF dual-hosted git repository.

jlli pushed a commit to branch add-toString-method-for-YammerMetricName-class
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit e6501d93048f8d56ae401efc485ddafe5cccba41
Author: Jack Li(Analytics Engineering) <jl...@jlli-mn1.linkedin.biz>
AuthorDate: Tue Mar 9 14:44:55 2021 -0800

    Add toString method in PinotMetricName interface
---
 .../org/apache/pinot/plugin/metrics/yammer/YammerMetricName.java    | 5 +++++
 .../src/main/java/org/apache/pinot/spi/metrics/PinotMetricName.java | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/pinot-plugins/pinot-metrics/pinot-yammer/src/main/java/org/apache/pinot/plugin/metrics/yammer/YammerMetricName.java b/pinot-plugins/pinot-metrics/pinot-yammer/src/main/java/org/apache/pinot/plugin/metrics/yammer/YammerMetricName.java
index d461fdc..0eab237 100644
--- a/pinot-plugins/pinot-metrics/pinot-yammer/src/main/java/org/apache/pinot/plugin/metrics/yammer/YammerMetricName.java
+++ b/pinot-plugins/pinot-metrics/pinot-yammer/src/main/java/org/apache/pinot/plugin/metrics/yammer/YammerMetricName.java
@@ -60,4 +60,9 @@ public class YammerMetricName implements PinotMetricName {
   public int hashCode() {
     return _metricName.hashCode();
   }
+
+  @Override
+  public String toString() {
+    return _metricName.toString();
+  }
 }
diff --git a/pinot-spi/src/main/java/org/apache/pinot/spi/metrics/PinotMetricName.java b/pinot-spi/src/main/java/org/apache/pinot/spi/metrics/PinotMetricName.java
index e4de876..8d327ea 100644
--- a/pinot-spi/src/main/java/org/apache/pinot/spi/metrics/PinotMetricName.java
+++ b/pinot-spi/src/main/java/org/apache/pinot/spi/metrics/PinotMetricName.java
@@ -39,4 +39,10 @@ public interface PinotMetricName {
    * Overrides the hashCode method. This method's contract is the same as equals() method.
    */
   int hashCode();
+
+  /**
+   * Overrides the toString method.
+   * This could be used to print out the actual metrics name instead of the memory address under this wrapper.
+   */
+  String toString();
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org