.add("withoutReplicas", resultsWithoutReplicas) .add("withReplicas", resultsWithReplicas) .add("withoutReplicasStdevMean", withoutReplicasStdevMean) .add("withoutReplicas99.99Mean", withoutReplicas9999Mean) .add("withReplicasStdevMean", withReplicasStdevMean) .add("withReplicas99.99Mean", withReplicas9999Mean) .toString());
.add("withoutReplicas", resultsWithoutReplicas) .add("withReplicas", resultsWithReplicas) .add("withoutReplicasStdevMean", withoutReplicasStdevMean) .add("withoutReplicas99.99Mean", withoutReplicas9999Mean) .add("withReplicasStdevMean", withReplicasStdevMean) .add("withReplicas99.99Mean", withReplicas9999Mean) .toString());
return new ToStringHelper(self.getClass().getSimpleName());
MoreObjects.ToStringHelper s = MoreObjects.toStringHelper(this); if (initialCapacity != UNSET_INT) { s.add("initialCapacity", initialCapacity); s.add("concurrencyLevel", concurrencyLevel); s.add("maximumSize", maximumSize); s.add("maximumWeight", maximumWeight); s.add("expireAfterWrite", expireAfterWriteNanos + "ns"); s.add("expireAfterAccess", expireAfterAccessNanos + "ns"); s.add("keyStrength", Ascii.toLowerCase(keyStrength.toString())); s.add("valueStrength", Ascii.toLowerCase(valueStrength.toString())); s.addValue("keyEquivalence"); s.addValue("valueEquivalence"); s.addValue("removalListener"); return s.toString();
/** * Returns a string representation for this MapMaker instance. The exact form of the returned * string is not specified. */ @Override public String toString() { MoreObjects.ToStringHelper s = MoreObjects.toStringHelper(this); if (initialCapacity != UNSET_INT) { s.add("initialCapacity", initialCapacity); } if (concurrencyLevel != UNSET_INT) { s.add("concurrencyLevel", concurrencyLevel); } if (keyStrength != null) { s.add("keyStrength", Ascii.toLowerCase(keyStrength.toString())); } if (valueStrength != null) { s.add("valueStrength", Ascii.toLowerCase(valueStrength.toString())); } if (keyEquivalence != null) { s.addValue("keyEquivalence"); } return s.toString(); } }
protected HStoreFile createMockStoreFile(final long sizeInBytes, final long seqId) { HStoreFile mockSf = mock(HStoreFile.class); StoreFileReader reader = mock(StoreFileReader.class); String stringPath = "/hbase/testTable/regionA/" + RandomStringUtils.random(FILENAME_LENGTH, 0, 0, true, true, null, random); Path path = new Path(stringPath); when(reader.getSequenceID()).thenReturn(seqId); when(reader.getTotalUncompressedBytes()).thenReturn(sizeInBytes); when(reader.length()).thenReturn(sizeInBytes); when(mockSf.getPath()).thenReturn(path); when(mockSf.excludeFromMinorCompaction()).thenReturn(false); when(mockSf.isReference()).thenReturn(false); // TODO come back to // this when selection takes this into account when(mockSf.getReader()).thenReturn(reader); String toString = MoreObjects.toStringHelper("MockStoreFile") .add("isReference", false) .add("fileSize", StringUtils.humanReadableInt(sizeInBytes)) .add("seqId", seqId) .add("path", stringPath).toString(); when(mockSf.toString()).thenReturn(toString); return mockSf; } }
@Override public String toString() { MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(this) .add("numResults", stats.getN()) .add("minTime", stats.getMin()) .add("meanTime", stats.getMean()) .add("maxTime", stats.getMax()) .add("25th", stats.getPercentile(25)) .add("50th", stats.getPercentile(50)) .add("75th", stats.getPercentile(75)) .add("90th", stats.getPercentile(90)) .add("95th", stats.getPercentile(95)) .add("99th", stats.getPercentile(99)) .add("99.9th", stats.getPercentile(99.9)) .add("99.99th", stats.getPercentile(99.99)) .add("traces", traces); return helper.toString(); } }
@Override protected void processOptions(CommandLine cmd) { tableName = TableName.valueOf(cmd.getOptionValue(TABLE_NAME_KEY, TABLE_NAME_DEFAULT)); sleepTime = Long.parseLong(cmd.getOptionValue(SLEEP_TIME_KEY, SLEEP_TIME_DEFAULT)); replicaCount = Integer.parseInt(cmd.getOptionValue(REPLICA_COUNT_KEY, REPLICA_COUNT_DEFAULT)); primaryTimeout = Integer.parseInt(cmd.getOptionValue(PRIMARY_TIMEOUT_KEY, PRIMARY_TIMEOUT_DEFAULT)); clusterSize = Integer.parseInt(cmd.getOptionValue(NUM_RS_KEY, NUM_RS_DEFAULT)); LOG.debug(MoreObjects.toStringHelper("Parsed Options") .add(TABLE_NAME_KEY, tableName) .add(SLEEP_TIME_KEY, sleepTime) .add(REPLICA_COUNT_KEY, replicaCount) .add(PRIMARY_TIMEOUT_KEY, primaryTimeout) .add(NUM_RS_KEY, clusterSize) .toString()); }
@Override public String toString() { if (count() > 0) { return MoreObjects.toStringHelper(this) .add("xStats", xStats) .add("yStats", yStats) .add("populationCovariance", populationCovariance()) .toString(); } else { return MoreObjects.toStringHelper(this) .add("xStats", xStats) .add("yStats", yStats) .toString(); } }
@Override public String toString() { if (count() > 0) { return MoreObjects.toStringHelper(this) .add("count", count) .add("mean", mean) .add("populationStandardDeviation", populationStandardDeviation()) .add("min", min) .add("max", max) .toString(); } else { return MoreObjects.toStringHelper(this).add("count", count).toString(); } }
private ToStringHelper addHolder(@Nullable Object value) { ValueHolder valueHolder = addHolder(); valueHolder.value = value; return this; }
/** * Adds an unnamed value to the formatted output. * * <p>It is strongly encouraged to use {@link #add(String, int)} instead and give value a * readable name. * * @since 18.0 (since 11.0 as {@code Objects.ToStringHelper.addValue()}). */ @CanIgnoreReturnValue public ToStringHelper addValue(int value) { return addHolder(String.valueOf(value)); }
/** * Adds an unnamed value to the formatted output. * * <p>It is strongly encouraged to use {@link #add(String, boolean)} instead and give value a * readable name. * * @since 18.0 (since 11.0 as {@code Objects.ToStringHelper.addValue()}). */ @CanIgnoreReturnValue public ToStringHelper addValue(boolean value) { return addHolder(String.valueOf(value)); }
/** * Adds an unnamed value to the formatted output. * * <p>It is strongly encouraged to use {@link #add(String, Object)} instead and give value a * readable name. */ @CanIgnoreReturnValue public ToStringHelper addValue(@Nullable Object value) { return addHolder(value); }
/** * Adds a name/value pair to the formatted output in {@code name=value} format. * * @since 18.0 (since 11.0 as {@code Objects.ToStringHelper.add()}). */ @CanIgnoreReturnValue public ToStringHelper add(String name, boolean value) { return addHolder(name, String.valueOf(value)); }
/** * Creates an instance of {@link ToStringHelper} in the same manner as * {@link #toStringHelper(Object)}, but using the simple name of {@code clazz} instead of using an * instance's {@link Object#getClass()}. * * <p>Note that in GWT, class names are often obfuscated. * * @param clazz the {@link Class} of the instance * @since 18.0 (since 7.0 as {@code Objects.toStringHelper()}). */ public static ToStringHelper toStringHelper(Class<?> clazz) { return new ToStringHelper(clazz.getSimpleName()); }