private String formatMessage(long extraSleepTime, List<String> gcDiffs) { String ret = "Detected pause in JVM or host machine (eg GC): " + "pause of approximately " + extraSleepTime + "ms\n"; if (gcDiffs.isEmpty()) { ret += "No GCs detected"; } else { ret += Joiner.on("\n").join(gcDiffs); } return ret; }
@Override public String toString() { Joiner.MapJoiner mapJoiner = Joiner.on(',').withKeyValueSeparator("="); return "NamespaceTableAndRegionInfo [name=" + name + ", tableAndRegionInfo=" + mapJoiner.join(tableAndRegionInfo) + "]"; } }
@Override public String toString() { String familiesString = toFamiliesString(families, family, qualifier); String[] params = new String[] { namespace != null ? "namespace=" + namespace : null, tableName != null ? "table=" + tableName.getNameWithNamespaceInclAsString() : null, familiesString.length() > 0 ? "family=" + familiesString : null, extraParams.isEmpty() ? null : concatenateExtraParams() }; return Joiner.on(",").skipNulls().join(params); }
@Override public String toString() { return "Predicates.and(" + COMMA_JOINER.join(components) + ")"; }
/** * Returns a {@code MapJoiner} using the given key-value separator, and the same configuration as * this {@code Joiner} otherwise. * * @since 20.0 */ public MapJoiner withKeyValueSeparator(char keyValueSeparator) { return withKeyValueSeparator(String.valueOf(keyValueSeparator)); }
/** * Returns a joiner which automatically places {@code separator} between consecutive elements. */ public static Joiner on(String separator) { return new Joiner(separator); }
@Override public String toString() { return "Predicates.or(" + COMMA_JOINER.join(components) + ")"; }
/** * Returns a joiner which automatically places {@code separator} between consecutive elements. */ public static Joiner on(char separator) { return new Joiner(String.valueOf(separator)); }
public void shutdown() throws Exception { executor.shutdown(); executor.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS); if (!ERRORS.isEmpty()) { StringBuilder builder = new StringBuilder().append("Major compaction failed, there were: ").append(ERRORS.size()) .append(" regions / stores that failed compacting\n") .append("Failed compaction requests\n").append("--------------------------\n") .append(Joiner.on("\n").join(ERRORS)); LOG.error(builder.toString()); } if (connection != null) { connection.close(); } LOG.info("All regions major compacted successfully"); }
/** * Returns a string containing the string representation of each of {@code parts}, using the * previously configured separator between each. */ public final String join(Object[] parts) { return join(Arrays.asList(parts)); }
@Override public synchronized String toString() { StringBuilder sb = new StringBuilder(); sb.append("{ meta => "); sb.append((metaEntry != null)? metaEntry.getRegionNameAsString() : "null"); sb.append( ", hdfs => " + getHdfsRegionDir()); sb.append( ", deployed => " + Joiner.on(", ").join(deployedEntries)); sb.append( ", replicaId => " + getReplicaId()); sb.append(" }"); return sb.toString(); }
/** * Returns a string containing the string representation of each of {@code parts}, using the * previously configured separator between each. */ public final String join(Iterable<?> parts) { return join(parts.iterator()); }
/** * Returns a {@link String} containing all of the elements of this fluent iterable joined with * {@code joiner}. * * <p><b>{@code Stream} equivalent:</b> {@code joiner.join(stream.iterator())}, or, if you are not * using any optional {@code Joiner} features, * {@code stream.collect(Collectors.joining(delimiter)}. * * @since 18.0 */ @Beta public final String join(Joiner joiner) { return joiner.join(this); }
private void startHttpServerThread(final String[] args) { LOG.info("Starting HBase Thrift server with HTTP server: " + Joiner.on(" ").join(args)); httpServerException = null; httpServerThread = new Thread(() -> { try { thriftServer.run(args); } catch (Exception e) { httpServerException = e; } }); httpServerThread.setName(ThriftServer.class.getSimpleName() + "-httpServer"); httpServerThread.start(); }
@Override public String toString() { StringBuilder builder = new StringBuilder(); if (ownerType != null) { builder.append(JavaVersion.CURRENT.typeName(ownerType)).append('.'); } return builder .append(rawType.getName()) .append('<') .append(COMMA_JOINER.join(transform(argumentsList, TYPE_NAME))) .append('>') .toString(); }
private void startCmdLineThread(final String[] args) { LOG.info("Starting HBase Thrift server with command line: " + Joiner.on(" ").join(args)); cmdLineException = null; cmdLineThread = new Thread(new Runnable() { @Override public void run() { try { thriftServer.run(args); } catch (Exception e) { LOG.error("Error when start thrift server", e); cmdLineException = e; } } }); cmdLineThread.setName(ThriftServer.class.getSimpleName() + "-cmdline"); cmdLineThread.start(); }
/** * Returns the ancestor of the current domain at the given number of levels "higher" (rightward) * in the subdomain list. The number of levels must be non-negative, and less than {@code N-1}, * where {@code N} is the number of parts in the domain. * * <p>TODO: Reasonable candidate for addition to public API. */ private InternetDomainName ancestor(int levels) { return from(DOT_JOINER.join(parts.subList(levels, parts.size()))); }