sanjeet006py commented on code in PR #6868:
URL: https://github.com/apache/hbase/pull/6868#discussion_r2058059941
##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ServerSideScanMetrics.java:
##########
@@ -117,4 +121,64 @@ public Map<String, Long> getMetricsMap(boolean reset) {
// Build the immutable map so that people can't mess around with it.
return builder.build();
}
+
+ public ServerName getServerName() {
+ return this.serverName;
+ }
+
+ public void setServerName(ServerName serverName) {
+ if (this.serverName == null) {
+ this.serverName = serverName;
+ }
+ }
+
+ public void setEncodedRegionName(String encodedRegionName) {
+ if (this.encodedRegionName == null) {
+ this.encodedRegionName = encodedRegionName;
+ }
+ }
+
+ public String getEncodedRegionName() {
+ return this.encodedRegionName;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("ServerName:");
+ sb.append(this.serverName);
+ sb.append(",EncodedRegion:");
+ sb.append(this.encodedRegionName);
+ sb.append(",[");
+ boolean isFirstMetric = true;
+ for (Map.Entry<String, AtomicLong> e : this.counters.entrySet()) {
+ if (isFirstMetric) {
+ isFirstMetric = false;
+ } else {
+ sb.append(",");
+ }
+ sb.append(e.getKey());
+ sb.append(":");
+ sb.append(e.getValue().get());
+ }
+ sb.append("]");
+ return sb.toString();
+ }
Review Comment:
Yeah, I added this `toString()` mainly to use in testing and debugging and
saw that in general a `toString` was missing with nice formatted output so
included it in the PR.
--
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]