Codota Logo
ClusterGroup.forPredicate
Code IndexAdd Codota to your IDE (free)

How to use
forPredicate
method
in
org.apache.ignite.cluster.ClusterGroup

Best Java code snippets using org.apache.ignite.cluster.ClusterGroup.forPredicate (Showing top 6 results out of 315)

  • Common ways to obtain ClusterGroup
private void myMethod () {
ClusterGroup c =
  • Codota IconIgnite ignite;ignite.cluster().forRemotes()
  • Codota IconIgnite ignite;ignite.cluster().forServers()
  • Smart code suggestions by Codota
}
origin: apache/ignite

/**
 * @param idx Node index.
 * @param job Runnable job.
 * @param p Optional node predicate.
 * @return Future object.
 */
private IgniteFuture<?> broadcast(int idx, IgniteRunnable job, @Nullable IgnitePredicate<ClusterNode> p) {
  assert idx >= 0 && idx < NODES_CNT;
  assert job != null;
  execCntr.set(0);
  ClusterGroup prj = grid(idx).cluster();
  if (p != null)
    prj = prj.forPredicate(p);
  return compute(prj).broadcastAsync(job);
}
origin: apache/ignite

/** {@inheritDoc} */
@Override public IgniteInternalFuture<Long> sizeLongAsync(final int part, final CachePeekMode[] peekModes) {
  assert peekModes != null;
  final PeekModes modes = parsePeekModes(peekModes, true);
  IgniteClusterEx cluster = ctx.grid().cluster();
  final GridCacheAffinityManager aff = ctx.affinity();
  final AffinityTopologyVersion topVer = aff.affinityTopologyVersion();
  ClusterGroup grp = cluster.forDataNodes(name());
  Collection<ClusterNode> nodes = new ArrayList<>(grp.forPredicate(new IgnitePredicate<ClusterNode>() {
    /** {@inheritDoc} */
    @Override public boolean apply(ClusterNode clusterNode) {
      return ((modes.primary && aff.primaryByPartition(clusterNode, part, topVer)) ||
          (modes.backup && aff.backupByPartition(clusterNode, part, topVer)));
    }
  }).nodes());
  if (nodes.isEmpty())
    return new GridFinishedFuture<>(0L);
  ctx.kernalContext().task().setThreadContext(TC_SUBGRID, nodes);
  return ctx.kernalContext().task().execute(
    new PartitionSizeLongTask(ctx.name(), ctx.affinity().affinityTopologyVersion(), peekModes, part), null);
}
origin: apache/ignite

Integer res = (Integer)compute(nodes.forPredicate(p)).withTimeout(10000).
  execute(JobFailTask.class.getName(), "1");
origin: apache/ignite

ClusterGroup evenYoungest = remotes.forPredicate(evenP).forYoungest();
ClusterGroup evenOldest = remotes.forPredicate(evenP).forOldest();
ClusterGroup oddYoungest = remotes.forPredicate(oddP).forYoungest();
ClusterGroup oddOldest = remotes.forPredicate(oddP).forOldest();
origin: it.unibo.alchemist/alchemist-grid

@Override
public WorkerSet getWorkersSet(final Complexity complexity) {
  final ClusterGroup grp = ignite.cluster()
      .forServers()
      .forPredicate((node) 
          -> node.metrics().getHeapMemoryTotal() >= complexity.getRamUsage() * IGNITE_RAM_MULT_FACTOR);
  return new WorkerSetImpl(ignite, grp);
}
origin: org.apache.ignite/ignite-core

/** {@inheritDoc} */
@Override public IgniteInternalFuture<Long> sizeLongAsync(final int part, final CachePeekMode[] peekModes) {
  assert peekModes != null;
  final PeekModes modes = parsePeekModes(peekModes, true);
  IgniteClusterEx cluster = ctx.grid().cluster();
  final GridCacheAffinityManager aff = ctx.affinity();
  final AffinityTopologyVersion topVer = aff.affinityTopologyVersion();
  ClusterGroup grp = cluster.forDataNodes(name());
  Collection<ClusterNode> nodes = new ArrayList<>(grp.forPredicate(new IgnitePredicate<ClusterNode>() {
    /** {@inheritDoc} */
    @Override public boolean apply(ClusterNode clusterNode) {
      return ((modes.primary && aff.primaryByPartition(clusterNode, part, topVer)) ||
          (modes.backup && aff.backupByPartition(clusterNode, part, topVer)));
    }
  }).nodes());
  if (nodes.isEmpty())
    return new GridFinishedFuture<>(0L);
  ctx.kernalContext().task().setThreadContext(TC_SUBGRID, nodes);
  return ctx.kernalContext().task().execute(
    new PartitionSizeLongTask(ctx.name(), ctx.affinity().affinityTopologyVersion(), peekModes, part), null);
}
org.apache.ignite.clusterClusterGroupforPredicate

Javadoc

Creates a new cluster group which includes all nodes that pass the given predicate filter.

Popular methods of ClusterGroup

  • nodes
    Gets the read-only collection of nodes in this cluster group.
  • node
    Gets a node for given ID from this cluster group.
  • forAttribute
    Creates a new cluster group for nodes containing given name and value specified in user attributes.
  • forClients
    Creates a cluster group of nodes started in client mode.
  • forDataNodes
    Creates a cluster group for all data nodes that have the cache with the specified name running.
  • forNodeIds
    Creates a cluster group over nodes with specified node IDs.
  • forRandom
    Creates a cluster group with one random node from the current cluster group.
  • forRemotes
    Gets cluster group consisting from the nodes in this cluster group excluding the local node.
  • forServers
    Creates a cluster group of nodes started in server mode.
  • hostNames
    Gets the read-only collection of hostnames in this cluster group.
  • ignite
    Gets instance of grid.
  • metrics
    Gets a metrics snapshot for this cluster group.
  • ignite,
  • metrics,
  • predicate,
  • forCacheNodes,
  • forClientNodes,
  • forDaemons,
  • forHost,
  • forNodeId,
  • forOldest

Popular in Java

  • Reading from database using SQL prepared statement
  • compareTo (BigDecimal)
  • getSystemService (Context)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • JCheckBox (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now