Ejemplo n.º 1
0
  /**
   * @param keys keys.
   * @param topVer Topology version.
   * @return Nodes for the keys.
   */
  public Collection<GridNode> remoteNodes(Iterable<? extends K> keys, long topVer) {
    Collection<Collection<GridNode>> colcol = new GridLeanSet<>();

    for (K key : keys) colcol.add(nodes(key, topVer));

    return F.view(F.flatCollections(colcol), F.remoteNodes(cctx.localNodeId()));
  }
Ejemplo n.º 2
0
  /**
   * @param part Partition.
   * @param topVer Topology version.
   * @return Backup nodes.
   */
  public Collection<GridNode> backups(int part, long topVer) {
    Collection<GridNode> nodes = nodes(part, topVer);

    assert !F.isEmpty(nodes);

    if (nodes.size() <= 1) return Collections.emptyList();

    return F.view(nodes, F.notEqualTo(nodes.iterator().next()));
  }