HADOOP-14891. Remove references to Guava Objects.toStringHelper. Contributed by Jonathan Eagles
(cherry picked from commit 0aac5af6e1
)
This commit is contained in:
parent
f794adde3b
commit
86e092029d
|
@ -84,9 +84,12 @@ public abstract class AbstractMetric implements MetricsInfo {
|
|||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return Objects.toStringHelper(this)
|
||||
.add("info", info)
|
||||
.add("value", value())
|
||||
.toString();
|
||||
StringBuilder sb = new StringBuilder(32);
|
||||
sb.append(this.getClass().getSimpleName());
|
||||
sb.append("{info=");
|
||||
sb.append(info);
|
||||
sb.append(", value=");
|
||||
sb.append(value());
|
||||
return sb.append('}').toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,9 +80,12 @@ public class MetricsTag implements MetricsInfo {
|
|||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return Objects.toStringHelper(this)
|
||||
.add("info", info)
|
||||
.add("value", value())
|
||||
.toString();
|
||||
StringBuilder sb = new StringBuilder(32);
|
||||
sb.append(this.getClass().getSimpleName());
|
||||
sb.append("{info=");
|
||||
sb.append(info);
|
||||
sb.append(", value=");
|
||||
sb.append(value());
|
||||
return sb.append('}').toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,12 +43,18 @@ abstract class AbstractMetricsRecord implements MetricsRecord {
|
|||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return Objects.toStringHelper(this)
|
||||
.add("timestamp", timestamp())
|
||||
.add("name", name())
|
||||
.add("description", description())
|
||||
.add("tags", tags())
|
||||
.add("metrics", Iterables.toString(metrics()))
|
||||
.toString();
|
||||
StringBuilder sb = new StringBuilder(32);
|
||||
sb.append(this.getClass().getSimpleName());
|
||||
sb.append("{timestamp=");
|
||||
sb.append(timestamp());
|
||||
sb.append(", name=");
|
||||
sb.append(name());
|
||||
sb.append(", description=");
|
||||
sb.append(description());
|
||||
sb.append(", tags=");
|
||||
sb.append(tags());
|
||||
sb.append(", metrics=");
|
||||
sb.append(Iterables.toString(metrics()));
|
||||
return sb.append('}').toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
|
||||
package org.apache.hadoop.metrics2.impl;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
import org.apache.hadoop.classification.InterfaceAudience;
|
||||
import org.apache.hadoop.metrics2.MetricsInfo;
|
||||
|
||||
|
@ -48,8 +46,12 @@ public enum MsInfo implements MetricsInfo {
|
|||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return Objects.toStringHelper(this)
|
||||
.add("name", name()).add("description", desc)
|
||||
.toString();
|
||||
StringBuilder sb = new StringBuilder(32);
|
||||
sb.append(this.getClass().getSimpleName());
|
||||
sb.append("{name=");
|
||||
sb.append(name());
|
||||
sb.append(", description=");
|
||||
sb.append(desc);
|
||||
return sb.append('}').toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,8 +55,12 @@ class MetricsInfoImpl implements MetricsInfo {
|
|||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return Objects.toStringHelper(this)
|
||||
.add("name", name).add("description", description)
|
||||
.toString();
|
||||
StringBuilder sb = new StringBuilder(32);
|
||||
sb.append(this.getClass().getSimpleName());
|
||||
sb.append("{name=");
|
||||
sb.append(name);
|
||||
sb.append(", description=");
|
||||
sb.append(description);
|
||||
return sb.append('}').toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.Collection;
|
|||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
import org.apache.hadoop.classification.InterfaceAudience;
|
||||
import org.apache.hadoop.classification.InterfaceStability;
|
||||
|
@ -416,8 +415,14 @@ public class MetricsRegistry {
|
|||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return Objects.toStringHelper(this)
|
||||
.add("info", metricsInfo).add("tags", tags()).add("metrics", metrics())
|
||||
.toString();
|
||||
StringBuilder sb = new StringBuilder(32);
|
||||
sb.append(this.getClass().getSimpleName());
|
||||
sb.append("{info=");
|
||||
sb.append(metricsInfo);
|
||||
sb.append(", tags=");
|
||||
sb.append(tags());
|
||||
sb.append(", metrics=");
|
||||
sb.append(metrics());
|
||||
return sb.append('}').toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
|
||||
package org.apache.hadoop.metrics2.source;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
import org.apache.hadoop.classification.InterfaceAudience;
|
||||
import org.apache.hadoop.metrics2.MetricsInfo;
|
||||
|
||||
|
@ -60,8 +58,12 @@ public enum JvmMetricsInfo implements MetricsInfo {
|
|||
@Override public String description() { return desc; }
|
||||
|
||||
@Override public String toString() {
|
||||
return Objects.toStringHelper(this)
|
||||
.add("name", name()).add("description", desc)
|
||||
.toString();
|
||||
StringBuilder sb = new StringBuilder(32);
|
||||
sb.append(this.getClass().getSimpleName());
|
||||
sb.append("{name=");
|
||||
sb.append(name());
|
||||
sb.append(", description=");
|
||||
sb.append(desc);
|
||||
return sb.append('}').toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@ import org.apache.hadoop.metrics2.AbstractMetric;
|
|||
import org.apache.hadoop.metrics2.MetricsRecord;
|
||||
import org.apache.hadoop.metrics2.MetricsTag;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
/**
|
||||
|
@ -127,9 +126,13 @@ public class MetricsCache {
|
|||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return Objects.toStringHelper(this)
|
||||
.add("tags", tags).add("metrics", metrics)
|
||||
.toString();
|
||||
StringBuilder sb = new StringBuilder(32);
|
||||
sb.append(this.getClass().getSimpleName());
|
||||
sb.append("{tags=");
|
||||
sb.append(tags);
|
||||
sb.append(", metrics=");
|
||||
sb.append(metrics);
|
||||
return sb.append('}').toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue