/** * Join input parameters with specified {@code delimeter} between them and append to the end {@code delimeter}. * * @param sb Specified string builder. * @param sbDelimeter Delimeter between {@code sb} and appended {@code param}. * @param delimeter Specified delimeter. * @param params Other input parameter. * @return SB with appended to the end joined paramaters with specified {@code delimeter}. */ private static SB j(SB sb, String sbDelimeter, String delimeter, Object... params) { if (!F.isEmpty(params)) { sb.a(sbDelimeter); for (Object par : params) sb.a(par).a(delimeter); sb.setLength(sb.length() - delimeter.length()); } return sb; }
/** * Prints caches info. * * @param infos Caches info. * @param cmd Command. */ private void printCacheInfos(Collection<CacheInfo> infos, VisorViewCacheCmd cmd) { for (CacheInfo info : infos) { Map<String, Object> map = info.toMap(cmd); SB sb = new SB("["); for (Map.Entry<String, Object> e : map.entrySet()) sb.a(e.getKey()).a("=").a(e.getValue()).a(", "); sb.setLength(sb.length() - 2); sb.a("]"); log(sb.toString()); } }
/** * Checks and throw exception if caches was missed. * * @param missingCaches Missing caches. */ private void handlingMissedCaches(Set<String> missingCaches) { if (missingCaches.isEmpty()) return; SB strBuilder = new SB("The following caches do not exist"); if (onlySpecificCaches()) { VisorIdleVerifyDumpTaskArg vdta = (VisorIdleVerifyDumpTaskArg)arg; strBuilder.a(" or do not match to the given filter [").a(vdta.getCacheFilterEnum()).a("]: "); } else strBuilder.a(": "); for (String name : missingCaches) strBuilder.a(name).a(", "); strBuilder.d(strBuilder.length() - 2, strBuilder.length()); throw new IgniteException(strBuilder.toString()); }
/** * Verifies all nodes in current cluster topology support BaselineTopology feature so compatibilityMode flag is * enabled to reset. * * @param discoCache */ private void verifyBaselineTopologySupport(DiscoCache discoCache) { if (discoCache.minimumServerNodeVersion().compareTo(MIN_BLT_SUPPORTING_VER) < 0) { SB sb = new SB("Cluster contains nodes that don't support BaselineTopology: ["); for (ClusterNode cn : discoCache.serverNodes()) { if (cn.version().compareTo(MIN_BLT_SUPPORTING_VER) < 0) sb .a("[") .a(cn.consistentId()) .a(":") .a(cn.version()) .a("], "); } sb.d(sb.length() - 2, sb.length()); throw new IgniteException(sb.a("]").toString()); } }
if (sb.length() > 0) { String msg;
/** * Verifies all nodes in current cluster topology support BaselineTopology feature * so compatibilityMode flag is enabled to reset. * * @param discoCache */ private void verifyBaselineTopologySupport(DiscoCache discoCache) { if (discoCache.minimumServerNodeVersion().compareTo(MIN_BLT_SUPPORTING_VER) < 0) { SB sb = new SB("Cluster contains nodes that don't support BaselineTopology: ["); for (ClusterNode cn : discoCache.serverNodes()) { if (cn.version().compareTo(MIN_BLT_SUPPORTING_VER) < 0) sb .a("[") .a(cn.consistentId()) .a(":") .a(cn.version()) .a("], "); } sb.d(sb.length() - 2, sb.length()); throw new IgniteException(sb.a("]").toString()); } }
if (sb.length() > 0) { String msg;