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

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

Best Java code snippets using org.apache.ignite.cluster.ClusterGroup.forServers (Showing top 7 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

/** {@inheritDoc} */
@Override public int getTotalServerNodes() {
  return cluster.forServers().nodes().size();
}
origin: apache/ignite

/**
 * Get list with the specified node types.
 *
 * @param srv {@code True} to include server nodes.
 * @param client {@code True} to include client nodes.
 * @return List with the specified node types.
 */
private List<ClusterNode> nodesList(boolean srv, boolean client) {
  List<ClusterNode> nodes = new ArrayList<>();
  if (srv)
    nodes.addAll(cluster.forServers().nodes());
  if (client)
    nodes.addAll(cluster.forClients().nodes());
  return nodes;
}
origin: apache/ignite

/** {@inheritDoc} */
@Override public int getActiveBaselineNodes() {
  Collection<BaselineNode> baselineNodes = cluster.ignite().cluster().currentBaselineTopology();
  if (baselineNodes != null && !baselineNodes.isEmpty()) {
    Set<Object> bltIds = new HashSet<>(baselineNodes.size());
    for (BaselineNode baselineNode : baselineNodes)
      bltIds.add(baselineNode.consistentId());
    int count = 0;
    for (ClusterNode node : cluster.forServers().nodes())
      if (bltIds.contains(node.consistentId()))
        count++;
    return count;
  }
  return 0;
}
origin: apache/ignite

/**
 * @throws Exception If failed.
 */
@Test
public void testEmptyGroup() throws Exception {
  ClusterGroup emptyGrp = ignite.cluster().forAttribute("nonExistent", "val");
  assertEquals(0, emptyGrp.forOldest().nodes().size());
  assertEquals(0, emptyGrp.forYoungest().nodes().size());
  assertEquals(0, emptyGrp.forAttribute("nonExistent2", "val").nodes().size());
  assertEquals(0, emptyGrp.forCacheNodes("cacheName").nodes().size());
  assertEquals(0, emptyGrp.forClientNodes("cacheName").nodes().size());
  assertEquals(0, emptyGrp.forClients().nodes().size());
  assertEquals(0, emptyGrp.forDaemons().nodes().size());
  assertEquals(0, emptyGrp.forDataNodes("cacheName").nodes().size());
  assertEquals(0, emptyGrp.forRandom().nodes().size());
  assertEquals(0, emptyGrp.forRemotes().nodes().size());
  assertEquals(0, emptyGrp.forServers().nodes().size());
  assertEquals(0, emptyGrp.forHost(ignite.cluster().localNode()).nodes().size());
  assertEquals(0, emptyGrp.forHost("127.0.0.1").nodes().size());
}
origin: org.apache.ignite/ignite-core

/** {@inheritDoc} */
@Override public int getTotalServerNodes() {
  return cluster.forServers().nodes().size();
}
origin: org.apache.ignite/ignite-core

/**
 * Get list with the specified node types.
 *
 * @param srv {@code True} to include server nodes.
 * @param client {@code True} to include client nodes.
 * @return List with the specified node types.
 */
private List<ClusterNode> nodesList(boolean srv, boolean client) {
  List<ClusterNode> nodes = new ArrayList<>();
  if (srv)
    nodes.addAll(cluster.forServers().nodes());
  if (client)
    nodes.addAll(cluster.forClients().nodes());
  return nodes;
}
origin: org.apache.ignite/ignite-core

/** {@inheritDoc} */
@Override public int getActiveBaselineNodes() {
  Collection<BaselineNode> baselineNodes = cluster.ignite().cluster().currentBaselineTopology();
  if (baselineNodes != null && !baselineNodes.isEmpty()) {
    Set<Object> bltIds = new HashSet<>(baselineNodes.size());
    for (BaselineNode baselineNode : baselineNodes)
      bltIds.add(baselineNode.consistentId());
    int count = 0;
    for (ClusterNode node : cluster.forServers().nodes())
      if (bltIds.contains(node.consistentId()))
        count++;
    return count;
  }
  return 0;
}
org.apache.ignite.clusterClusterGroupforServers

Javadoc

Creates a cluster group of nodes started in server mode.

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.
  • forPredicate
    Creates a new cluster group which includes all nodes that pass the given predicate filter.
  • 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.
  • 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

  • Updating database using SQL prepared statement
  • getSharedPreferences (Context)
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
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