Search in sources :

Example 1 with CHECK_INDEX_INLINE_SIZES

use of org.apache.ignite.internal.IgniteFeatures.CHECK_INDEX_INLINE_SIZES in project gridgain by gridgain.

the class CheckIndexInlineSizes method execute.

/**
 * {@inheritDoc}
 */
@Override
public Object execute(GridClientConfiguration clientCfg, Logger log) throws Exception {
    try (GridClient client = Command.startClient(clientCfg)) {
        Set<GridClientNode> serverNodes = client.compute().nodes().stream().filter(SRV_NODES).collect(toSet());
        Set<GridClientNode> supportedServerNodes = serverNodes.stream().filter(n -> n.supports(CHECK_INDEX_INLINE_SIZES)).collect(toSet());
        Collection<UUID> serverNodeIds = F.transform(serverNodes, GridClientNode::nodeId);
        Collection<UUID> supportedServerNodeIds = F.transform(supportedServerNodes, GridClientNode::nodeId);
        CheckIndexInlineSizesResult res = client.compute().projection(supportedServerNodes).execute(CheckIndexInlineSizesTask.class.getName(), new VisorTaskArgument<>(supportedServerNodeIds, false));
        Set<UUID> unsupportedNodes = serverNodeIds.stream().filter(n -> !supportedServerNodeIds.contains(n)).collect(toSet());
        analyzeResults(log, unsupportedNodes, res);
    }
    return null;
}
Also used : GridClientNode(org.apache.ignite.internal.client.GridClientNode) F(org.apache.ignite.internal.util.typedef.F) GridClient(org.apache.ignite.internal.client.GridClient) GridClientConfiguration(org.apache.ignite.internal.client.GridClientConfiguration) Predicate(java.util.function.Predicate) INDENT(org.apache.ignite.internal.commandline.CommandLogger.INDENT) Collection(java.util.Collection) Set(java.util.Set) HashMap(java.util.HashMap) UUID(java.util.UUID) VisorTaskArgument(org.apache.ignite.internal.visor.VisorTaskArgument) Logger(java.util.logging.Logger) Collectors(java.util.stream.Collectors) IgniteSystemProperties(org.apache.ignite.IgniteSystemProperties) HashSet(java.util.HashSet) Command(org.apache.ignite.internal.commandline.Command) CacheCommands.usageCache(org.apache.ignite.internal.commandline.cache.CacheCommands.usageCache) SB(org.apache.ignite.internal.util.typedef.internal.SB) Map(java.util.Map) AbstractCommand(org.apache.ignite.internal.commandline.AbstractCommand) CHECK_INDEX_INLINE_SIZES(org.apache.ignite.internal.IgniteFeatures.CHECK_INDEX_INLINE_SIZES) CheckIndexInlineSizesResult(org.apache.ignite.internal.commandline.cache.check_indexes_inline_size.CheckIndexInlineSizesResult) CheckIndexInlineSizesTask(org.apache.ignite.internal.commandline.cache.check_indexes_inline_size.CheckIndexInlineSizesTask) GridClientNode(org.apache.ignite.internal.client.GridClientNode) Collectors.toSet(java.util.stream.Collectors.toSet) CheckIndexInlineSizesTask(org.apache.ignite.internal.commandline.cache.check_indexes_inline_size.CheckIndexInlineSizesTask) CheckIndexInlineSizesResult(org.apache.ignite.internal.commandline.cache.check_indexes_inline_size.CheckIndexInlineSizesResult) GridClient(org.apache.ignite.internal.client.GridClient) UUID(java.util.UUID)

Aggregations

Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Set (java.util.Set)1 UUID (java.util.UUID)1 Predicate (java.util.function.Predicate)1 Logger (java.util.logging.Logger)1 Collectors (java.util.stream.Collectors)1 Collectors.toSet (java.util.stream.Collectors.toSet)1 IgniteSystemProperties (org.apache.ignite.IgniteSystemProperties)1 CHECK_INDEX_INLINE_SIZES (org.apache.ignite.internal.IgniteFeatures.CHECK_INDEX_INLINE_SIZES)1 GridClient (org.apache.ignite.internal.client.GridClient)1 GridClientConfiguration (org.apache.ignite.internal.client.GridClientConfiguration)1 GridClientNode (org.apache.ignite.internal.client.GridClientNode)1 AbstractCommand (org.apache.ignite.internal.commandline.AbstractCommand)1 Command (org.apache.ignite.internal.commandline.Command)1 INDENT (org.apache.ignite.internal.commandline.CommandLogger.INDENT)1 CacheCommands.usageCache (org.apache.ignite.internal.commandline.cache.CacheCommands.usageCache)1 CheckIndexInlineSizesResult (org.apache.ignite.internal.commandline.cache.check_indexes_inline_size.CheckIndexInlineSizesResult)1