| Apache Ignite C++

Public Member Functions | Friends | List of all members
ignite::cluster::ClusterGroup Class Reference

Defines a cluster group which contains all or a subset of cluster nodes. More...

`#include <cluster_group.h>`

## Public Member Functions
| ClusterGroup (impl::cluster::SP_ClusterGroupImpl impl)
| Constructor. More...
ClusterGroup | ForAttribute (std::string name, std::string val)
| Get cluster group for nodes containing given name and value specified in user attributes. More...
ClusterGroup | ForCacheNodes (std::string cacheName)
| Get cluster group for all nodes that have cache with specified name, either in client or server modes. More...
ClusterGroup | ForClientNodes (std::string cacheName)
| Get cluster group for all client nodes that access cache with the specified name. More...
ClusterGroup | ForClients ()
| Get a cluster group of nodes started in client mode. More...
ClusterGroup | ForDataNodes (std::string cacheName)
| Get ClusterGroup for all data nodes that have the cache with the specified name running. More...
ClusterGroup | ForHost (ClusterNode node)
| Get cluster group consisting from the nodes in this cluster group residing on the same host as the given node. More...
ClusterGroup | ForHost (std::string hostName)
| Get cluster group consisting from the nodes running on the host specified. More...
ClusterGroup | ForHosts (std::vector< std::string > hostNames)
| Get cluster group consisting from the nodes running on the hosts specified. More...
ClusterGroup | ForNode (ClusterNode node)
| Get cluster group for the given node. More...
ClusterGroup | ForNodeId (Guid id)
| Get cluster group for a node with the specified ID. More...
ClusterGroup | ForNodeIds (std::vector< Guid > ids)
| Get cluster group over nodes with specified node IDs. More...
ClusterGroup | ForNodes (std::vector< ClusterNode > nodes)
| Get cluster group over a given set of nodes. More...
ClusterGroup | ForOldest ()
| Get cluster group with one oldest node from the current cluster group. More...
ClusterGroup | ForPredicate (IgnitePredicate< ClusterNode > *pred)
| Create a new cluster group which includes all nodes that pass the given predicate filter. More...
ClusterGroup | ForRandom ()
| Get cluster group with one random node from the current cluster group. More...
ClusterGroup | ForRemotes ()
| Get cluster group consisting from the nodes in this cluster group excluding the local node. More...
ClusterGroup | ForServers ()
| Creates a cluster group of nodes started in server mode. More...
ClusterGroup | ForYoungest ()
| Get cluster group with one youngest node in the current cluster group. More...
ClusterGroup | ForCpp ()
| Creates a cluster group of cpp nodes. More...
ClusterNode | GetNode ()
| Get first node from the list of nodes in this cluster group. More...
ClusterNode | GetNode (Guid nid)
| Get node for given ID from this cluster group. More...
std::vector< ClusterNode > | GetNodes ()
| Get the vector of nodes in this cluster group. More...
IgnitePredicate< ClusterNode > * | GetPredicate ()
| Get predicate that defines a subset of nodes for this cluster group. More...

## Friends
class | impl::cluster::ClusterGroupImpl
class | impl::IgniteImpl

## Detailed Description

Defines a cluster group which contains all or a subset of cluster nodes.

Cluster group allows to group cluster nodes into various subgroups to perform distributed operations on them. The IgniteCluster interface itself also contains the ClusterGroup which makes an instance of IgniteCluster into a cluster group containing all cluster nodes. Use IgniteCluster::AsClusterGroup() to get the cluster group in this case.

## Constructor & Destructor Documentation

## ◆ ClusterGroup()

ignite::cluster::ClusterGroup::ClusterGroup | ( | impl::cluster::SP_ClusterGroupImpl | impl | ) |

Constructor.

Parameters

  pointer | to cluster group implementation.

## Member Function Documentation

## ◆ ForAttribute()

ClusterGroup ignite::cluster::ClusterGroup::ForAttribute | ( | std::string | name,
|  | std::string | val
| ) |  |

Get cluster group for nodes containing given name and value specified in user attributes.

Parameters

  name | Name of the attribute.
  val | Optional attribute value to match.

Returns
  Cluster group for nodes containing specified attribute.

## ◆ ForCacheNodes()

ClusterGroup ignite::cluster::ClusterGroup::ForCacheNodes | ( | std::string | cacheName | ) |

Get cluster group for all nodes that have cache with specified name, either in client or server modes.

Parameters

  cacheName | Cache name.

Returns
  Cluster group over nodes that have the cache with the specified name running.

## ◆ ForClientNodes()

ClusterGroup ignite::cluster::ClusterGroup::ForClientNodes | ( | std::string | cacheName | ) |

Get cluster group for all client nodes that access cache with the specified name.

Parameters

  cacheName | Cache name.

Returns
  Cluster group over nodes that have the cache with the specified name running.

## ◆ ForClients()

ClusterGroup ignite::cluster::ClusterGroup::ForClients | ( |  | ) |

Get a cluster group of nodes started in client mode.

Returns
  Cluster group over nodes that started in client mode.

## ◆ ForCpp()

ClusterGroup ignite::cluster::ClusterGroup::ForCpp | ( |  | ) |

Creates a cluster group of cpp nodes.

Returns
  Cluster group of cpp nodes.

## ◆ ForDataNodes()

ClusterGroup ignite::cluster::ClusterGroup::ForDataNodes | ( | std::string | cacheName | ) |

Get ClusterGroup for all data nodes that have the cache with the specified name running.

Parameters

  cacheName | Cache name.

Returns
  Cluster group over nodes that have the cache with the specified name running.

## ◆ ForHost() [1/2]

ClusterGroup ignite::cluster::ClusterGroup::ForHost | ( | ClusterNode | node | ) |

Get cluster group consisting from the nodes in this cluster group residing on the same host as the given node.

Parameters

  node | Cluster node.

Returns
  Cluster group residing on the same host as the given node.

## ◆ ForHost() [2/2]

ClusterGroup ignite::cluster::ClusterGroup::ForHost | ( | std::string | hostName | ) |

Get cluster group consisting from the nodes running on the host specified.

Parameters

  hostName | Host name.

Returns
  Cluster group over nodes that have requested host name.

## ◆ ForHosts()

ClusterGroup ignite::cluster::ClusterGroup::ForHosts | ( | std::vector< std::string > | hostNames | ) |

Get cluster group consisting from the nodes running on the hosts specified.

Parameters

  hostNames | Container of host names.

Returns
  Cluster group over nodes that have requested host names.

## ◆ ForNode()

ClusterGroup ignite::cluster::ClusterGroup::ForNode | ( | ClusterNode | node | ) |

Get cluster group for the given node.

Parameters

  node | Cluster node.

Returns
  Cluster group for the given node.

## ◆ ForNodeId()

ClusterGroup ignite::cluster::ClusterGroup::ForNodeId | ( | Guid | id | ) |

Get cluster group for a node with the specified ID.

Parameters

  id | Cluster node ID.

Returns
  Cluster group for a node with the specified ID.

## ◆ ForNodeIds()

ClusterGroup ignite::cluster::ClusterGroup::ForNodeIds | ( | std::vector< Guid > | ids | ) |

Get cluster group over nodes with specified node IDs.

Parameters

  ids | Cluster node IDs.

Returns
  Cluster group over nodes with specified node IDs.

## ◆ ForNodes()

ClusterGroup ignite::cluster::ClusterGroup::ForNodes | ( | std::vector< ClusterNode > | nodes | ) |

Get cluster group over a given set of nodes.

Parameters

  nodes | Cluster nodes.

Returns
  Cluster group over a given set of nodes.

## ◆ ForOldest()

ClusterGroup ignite::cluster::ClusterGroup::ForOldest | ( |  | ) |

Get cluster group with one oldest node from the current cluster group.

Returns
  Cluster group with one oldest node from the current cluster group.

## ◆ ForPredicate()

ClusterGroup ignite::cluster::ClusterGroup::ForPredicate | ( | IgnitePredicate< ClusterNode > * | pred | ) |

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

Parameters

  pred | Pointer to predicate heap object. User should NOT free the memory used by object.

Returns
  Newly created cluster group.

Exceptions

  IgniteError | if there are no nodes in the cluster group.

## ◆ ForRandom()

ClusterGroup ignite::cluster::ClusterGroup::ForRandom | ( |  | ) |

Get cluster group with one random node from the current cluster group.

Returns
  Cluster group with one random node from the current cluster group.

## ◆ ForRemotes()

ClusterGroup ignite::cluster::ClusterGroup::ForRemotes | ( |  | ) |

Get cluster group consisting from the nodes in this cluster group excluding the local node.

Returns
  Cluster group consisting from the nodes in this cluster group excluding the local node.

## ◆ ForServers()

ClusterGroup ignite::cluster::ClusterGroup::ForServers | ( |  | ) |

Creates a cluster group of nodes started in server mode.

Returns
  Cluster group of nodes started in server mode.

## ◆ ForYoungest()

ClusterGroup ignite::cluster::ClusterGroup::ForYoungest | ( |  | ) |

Get cluster group with one youngest node in the current cluster group.

Returns
  Cluster group with one youngest node in the current cluster group.

## ◆ GetNode() [1/2]

ClusterNode ignite::cluster::ClusterGroup::GetNode | ( |  | ) |

Get first node from the list of nodes in this cluster group.

Returns
  Cluster node in this cluster group.

Exceptions

  IgniteError | if there are no nodes in the cluster group.

## ◆ GetNode() [2/2]

ClusterNode ignite::cluster::ClusterGroup::GetNode | ( | Guid | nid | ) |

Get node for given ID from this cluster group.

Parameters

  nid | Cluster node ID.

Returns
  Cluster node in this cluster group.

Exceptions

  IgniteError | if there is no node with specified ID.

## ◆ GetNodes()

std::vector< ClusterNode > ignite::cluster::ClusterGroup::GetNodes | ( |  | ) |

Get the vector of nodes in this cluster group.

Returns
  All nodes in this cluster group.

## ◆ GetPredicate()

IgnitePredicate< ClusterNode > * ignite::cluster::ClusterGroup::GetPredicate | ( |  | ) |

Get predicate that defines a subset of nodes for this cluster group.

Returns
  Pointer to predicate.

The documentation for this class was generated from the following files:

- cluster_group.h
- cluster_group.cpp