org.apache.ignite.internal.visor.util

## Class VisorTaskUtils

- java.lang.Object
- - org.apache.ignite.internal.visor.util.VisorTaskUtils

    public class VisorTaskUtils
    extends Object

Contains utility methods for Visor tasks and jobs.

### Nested Class Summary

Nested Classes
`static class` `VisorTaskUtils.SortableAddress` Special wrapper over address that can be sorted in following order: IPv4, private IPv4, IPv4 local host, IPv6.

### Constructor Summary

Constructors
Constructor and Description
`VisorTaskUtils()`

### Method Summary

All Methods Static Methods Concrete Methods
`static @Nullable String` `compactClass(Class cls)` Compact class names.
`static @Nullable String` `compactClass(@Nullable Object obj)` Compact class names.
`static @Nullable List<String>` `compactClasses(Class<?>[] clss)` Compact classes names.
`static @Nullable String` `compactIterable(Iterable col)` Joins iterable collection elements to string.
`static Integer` `evictionPolicyMaxSize(@Nullable javax.cache.configuration.Factory plc)` Extract max size from eviction policy if available.
`static boolean` `isRestartingCache(IgniteEx ignite, String cacheName)` Check whether cache restarting in progress.
`static long` `log(@Nullable IgniteLogger log, String msg, Class<?> clazz, long start)` Log message.
`static void` `logFinish(@Nullable IgniteLogger log, Class<?> clazz, long start)` Log finished.
`static void` `logMapped(@Nullable IgniteLogger log, Class<?> clazz, Collection<ClusterNode> nodes)` Log task mapped.
`static void` `logStart(@Nullable IgniteLogger log, Class<?> clazz, long start)` Log start.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### VisorTaskUtils

    public VisorTaskUtils()

### Method Detail

#### compactClass

    @Nullable
    public static @Nullable String compactClass(Class cls)

Compact class names.

Parameters:
  `cls` - Class object for compact.
Returns:
  Compacted string.

#### compactClass

    @Nullable
    public static @Nullable String compactClass(@Nullable
                                                          @Nullable Object obj)

Compact class names.

Parameters:
  `obj` - Object for compact.
Returns:
  Compacted string.

#### compactClasses

    @Nullable
    public static @Nullable List<String> compactClasses(Class<?>[] clss)

Compact classes names.

Parameters:
  `clss` - Classes to compact.
Returns:
  Compacted string.

#### compactIterable

    @Nullable
    public static @Nullable String compactIterable(Iterable col)

Joins iterable collection elements to string.

Parameters:
  `col` - Iterable collection.
Returns:
  String.

#### evictionPolicyMaxSize

    public static Integer evictionPolicyMaxSize(@Nullable
                                                @Nullable javax.cache.configuration.Factory plc)

Extract max size from eviction policy if available.

Parameters:
  `plc` - Eviction policy.
Returns:
  Extracted max size.

#### logStart

    public static void logStart(@Nullable
                                @Nullable IgniteLogger log,
                                Class<?> clazz,
                                long start)

Log start.

Parameters:
  `log` - Logger.
  `clazz` - Class.
  `start` - Start time.

#### logFinish

    public static void logFinish(@Nullable
                                 @Nullable IgniteLogger log,
                                 Class<?> clazz,
                                 long start)

Log finished.

Parameters:
  `log` - Logger.
  `clazz` - Class.
  `start` - Start time.

#### logMapped

    public static void logMapped(@Nullable
                                 @Nullable IgniteLogger log,
                                 Class<?> clazz,
                                 Collection<ClusterNode> nodes)

Log task mapped.

Parameters:
  `log` - Logger.
  `clazz` - Task class.
  `nodes` - Mapped nodes.

#### log

    public static long log(@Nullable
                           @Nullable IgniteLogger log,
                           String msg,
                           Class<?> clazz,
                           long start)

Log message.

Parameters:
  `log` - Logger.
  `msg` - Message to log.
  `clazz` - class.
  `start` - start time.
Returns:
  Time when message was logged.

#### isRestartingCache

    public static boolean isRestartingCache(IgniteEx ignite,
                                            String cacheName)

Check whether cache restarting in progress.

Parameters:
  `ignite` - Grid.
  `cacheName` - Cache name to check.
Returns:
  `true` when cache restarting in progress.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.15.0
Release Date | : April 25 2023