You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "nizhikov (via GitHub)" <gi...@apache.org> on 2023/05/31 16:29:31 UTC

[GitHub] [ignite] nizhikov commented on a diff in pull request #10741: IGNITE-15629 Cache index list command implemented

nizhikov commented on code in PR #10741:
URL: https://github.com/apache/ignite/pull/10741#discussion_r1211994480


##########
modules/core/src/main/java/org/apache/ignite/internal/management/api/CommandUtils.java:
##########
@@ -284,6 +287,65 @@ public static <T> T parseVal(String val, Class<T> type) {
             .orElse(null);
     }
 
+    /**
+     * Join input parameters with specified {@code delimeter} between them.
+     *
+     * @param delimeter Specified delimeter.
+     * @param params Other input parameter.
+     * @return Joined paramaters with specified {@code delimeter}.
+     */
+    public static String join(String delimeter, Object... params) {
+        return join(new SB(), "", delimeter, params).toString();
+    }
+
+    /**
+     * 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}.
+     */
+    public static SB join(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 exception messages to log
+     *
+     * @param exceptions map containing node ids and exceptions.
+     * @param infoMsg single message to log.
+     * @param printer Printer to use.
+     * @return true if errors were printed.
+     */
+    public static boolean printErrors(Map<UUID, Exception> exceptions, String infoMsg, Consumer<String> printer) {
+        if (!F.isEmpty(exceptions)) {

Review Comment:
   Yes. Fixed.



##########
modules/core/src/main/java/org/apache/ignite/internal/visor/verify/VisorValidateIndexesTask.java:
##########
@@ -106,19 +108,19 @@ private static class VisorValidateIndexesJob extends VisorJob<VisorValidateIndex
          * @param arg Argument.
          * @param debug Debug.
          */
-        protected VisorValidateIndexesJob(@Nullable VisorValidateIndexesTaskArg arg, boolean debug) {
+        protected VisorValidateIndexesJob(@Nullable CacheValidateIndexesCommandArg arg, boolean debug) {
             super(arg, debug);
         }
 
         /** {@inheritDoc} */
-        @Override protected VisorValidateIndexesJobResult run(@Nullable VisorValidateIndexesTaskArg arg) throws IgniteException {
+        @Override protected VisorValidateIndexesJobResult run(@Nullable CacheValidateIndexesCommandArg arg) throws IgniteException {

Review Comment:
   assert added.



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org