Checks all replicas for all partitions. If the cluster service does not contain the member for any
address in the partition table, it will remove the address from the partition.

@see ClusterService#getMember(com.hazelcast.nio.Address, String)
350935
void removeUnknownMembers() {
        ClusterServiceImpl clusterService = node.getClusterService();

        for (InternalPartitionImpl partition : partitions) {
            for (int i = 0; i < InternalPartition.MAX_REPLICA_COUNT; i++) {
                PartitionReplica replica = partition.getReplica(i);
                if (replica == null) {
                    continue;
                }

                if (clusterService.getMember(replica.address(), replica.uuid()) == null) {
                    partition.setReplica(i, null);
                    if (logger.isFinestEnabled()) {
                        logger.finest("PartitionId=" + partition.getPartitionId() + " " + replica
                                + " is removed from replica index: " + i + ", partition: " + partition);
                    }
                }
            }
        }
    }
1329836
public Address[] getNonSetMembers() {
        Address[] retval=new Address[countNonSetMembers()];
        if(retval.length == 0)
            return retval;
        int index=0;
        for(int i=0; i < members.length; i++)
            if(seqnos[i*2] == -1)
                retval[index++]=members[i];
        return retval;
    }
391347
def member_info(self, cluster_id, member_id):
        """"""
        cluster = self._storage[cluster_id]
        return cluster.member_info(member_id)
736028
protected synchronized Member getExecutionMember() {
        Iterator<Member> it = memberIterator;
        if (it == null || !it.hasNext()) {
            memberIterator = it = serviceMembers.iterator();
        }
        return it.next();
    }
848900
@Override
    public Object getMember(String name) {
        switch (name) {
            case "description":
                return F_description;
            case "offsetDesc":
                return F_offsetDesc;
        }
        return super.getMember(name);
    }
1338371
public List<String> getMembers() {
    List<String> allList = new ArrayList<String>();
    allList.addAll(members);

    return Collections.unmodifiableList(allList);
  }
899050
static InetSocketAddress getRemoteNamenodeAddress(Configuration conf, 
      InstanceId instance) 
    throws IOException {
    String fs = null;
    if (instance == InstanceId.NODEZERO) {
      fs = conf.get(DFS_NAMENODE_RPC_ADDRESS1_KEY);
      if (fs == null)
        fs = conf.get("fs.default.name1");
    } else if (instance == InstanceId.NODEONE) {
      fs = conf.get(DFS_NAMENODE_RPC_ADDRESS0_KEY);
      if (fs == null)
        fs = conf.get("fs.default.name0");
    } else {
      throw new IOException("Unknown instance " + instance);
    }
    if(fs != null) {
      Configuration newConf = new Configuration(conf);
      newConf.set(FSConstants.DFS_NAMENODE_RPC_ADDRESS_KEY, fs);
      conf = newConf;
    }
    return NameNode.getClientProtocolAddress(conf);
  }
98813
@SuppressWarnings("unchecked")
    private final int checkNodeDirectory() throws ClusterInfoException {
        try {

            // get all of the nodes in the nodeDir and set one for this node if it's not already set.
            final Collection<String> nodeDirs;
            if (nodeDirectory == null) {
                nodeDirectory = utils.session.recursiveMkdir(utils.nodesDir + "/node_", thisNode, DirMode.PERSISTENT,
                        DirMode.EPHEMERAL_SEQUENTIAL);
                nodeDirs = session.getSubdirs(utils.nodesDir, this);
            } else
                nodeDirs = utils.persistentGetSubdir(utils.nodesDir, null);

            // what node am I?
            int nodeRank = -1;
            int index = 0;
            final String nodeSubdir = new File(nodeDirectory).getName();
            for (final String cur : nodeDirs) {
                if (nodeSubdir.equals(cur)) {
                    nodeRank = index;
                    break;
                }
                index++;
            }

            // If I couldn't find me, there's a problem.
            if (nodeRank == -1) {
                // drop the node directory since it clearly doesn't exist anymore
                nodeDirectory = null;
                throw new ClusterInfoException(
                        "Node " + thisNode + " was registered at " + nodeSubdir + " but it wasn't found as a subdirectory.");
            }

            // verify the container address is correct.
            C curDest = (C) session.getData(nodeDirectory, null);
            if (curDest == null) // this really can't be null
                session.setData(nodeDirectory, thisNode);
            else if (!thisNode.equals(curDest)) { // wth?
                final String tmp = nodeDirectory;
                nodeDirectory = null;
                throw new ClusterInfoException("Impossible! The Node directory " + tmp + " contains the destination for " + curDest
                        + " but should have " + thisNode);
            }

            // Check to make sure that THIS node is only in one place. If we find it in a node directory
            // that's not THIS node directory then this is something we should clean up.
            for (final String subdir : nodeDirs) {
                final String fullPathToSubdir = utils.nodesDir + "/" + subdir;
                curDest = (C) session.getData(fullPathToSubdir, null);
                if (thisNode.equals(curDest) && !fullPathToSubdir.equals(nodeDirectory)) // this is bad .. clean up
                    session.rmdir(fullPathToSubdir);
            }

            return nodeRank;
        } catch (final ClusterInfoException cie) {
            cleanupAfterExceptionDuringNodeDirCheck();
            throw cie;
        } catch (final RuntimeException re) {
            cleanupAfterExceptionDuringNodeDirCheck();
            throw re;
        } catch (final Throwable th) {
            cleanupAfterExceptionDuringNodeDirCheck();
            throw new RuntimeException("Unknown exception!", th);
        }
    }
332633
def get_remote_member(self, member=None):
        
        cluster_params = self.get_standby_cluster_config()

        if cluster_params:
            name = member.name if member else 'remote_master:{}'.format(uuid.uuid1())

            data = {k: v for k, v in cluster_params.items() if k in RemoteMember.allowed_keys()}
            data['no_replication_slot'] = 'primary_slot_name' not in cluster_params
            conn_kwargs = member.conn_kwargs() if member else \
                {k: cluster_params[k] for k in ('host', 'port') if k in cluster_params}
            if conn_kwargs:
                data['conn_kwargs'] = conn_kwargs

            return RemoteMember(name, data)
978162
def check_member_pool(self, member, pool_name):
        '''
        
        '''
        members = self.bigIP.LocalLB.Pool.get_member(pool_names=[pool_name])[0]
        for mem in members:
            if member == mem.address:
                return True
        return False
829133
Instance marshall(ServiceInstance serviceInstance) {
		String hostname = serviceInstance.getHost();
		String managementPort = serviceInstance.getMetadata().get("management.port");
		String port = managementPort == null ? String.valueOf(serviceInstance.getPort())
				: managementPort;
		String cluster = getClusterName(serviceInstance);
		Boolean status = Boolean.TRUE; // TODO: where to get?
		if (hostname != null && cluster != null && status != null) {
			Instance instance = getInstance(hostname, port, cluster, status);

			Map<String, String> metadata = serviceInstance.getMetadata();
			boolean securePortEnabled = serviceInstance.isSecure();

			addMetadata(instance, hostname, port, securePortEnabled, port, metadata);

			return instance;
		}
		else {
			return null;
		}
	}
477579
def terminateMember(self, clusterId, memberId):
        
        self.send_terminateMember(clusterId, memberId)
        return self.recv_terminateMember()
935748
private void verifyPartitionStateVersion() {
        InternalPartitionService partitionService = getService();
        int localPartitionStateVersion = partitionService.getPartitionStateVersion();
        if (partitionStateVersion != localPartitionStateVersion) {
            if (getNodeEngine().getThisAddress().equals(migrationInfo.getMaster())) {
                return;
            }

            // this is expected when cluster member list changes during migration
            throw new PartitionStateVersionMismatchException(partitionStateVersion, localPartitionStateVersion);
        }
    }
317208
static List<PartitionDefinition> findSlicePartitions(RestClient client, Settings settings, MappingSet mappingSet,
                                                         Map<String, NodeInfo> nodes, List<List<Map<String, Object>>> shards, Log log) {
        QueryBuilder query = QueryUtils.parseQueryAndFilters(settings);
        Integer maxDocsPerPartition = settings.getMaxDocsPerPartition();
        Assert.notNull(maxDocsPerPartition, "Attempting to find slice partitions but maximum documents per partition is not set.");
        Resource readResource = new Resource(settings, true);
        Mapping resolvedMapping = mappingSet == null ? null : mappingSet.getResolvedView();

        List<PartitionDefinition> partitions = new ArrayList<PartitionDefinition>(shards.size());
        for (List<Map<String, Object>> group : shards) {
            String index = null;
            int shardId = -1;
            List<String> locationList = new ArrayList<String> ();
            for (Map<String, Object> replica : group) {
                ShardInfo shard = new ShardInfo(replica);
                index = shard.getIndex();
                shardId = shard.getName();
                if (nodes.containsKey(shard.getNode())) {
                    locationList.add(nodes.get(shard.getNode()).getPublishAddress());
                }
            }
            String[] locations = locationList.toArray(new String[0]);
            if (index == null) {
                // Could not find shards for this partition. Continue anyway?
                if (settings.getIndexReadAllowRedStatus()) {
                    log.warn("Shard information is missing from an index and will not be reached during job execution. " +
                            "Assuming shard is unavailable and cluster is red! Continuing with read operation by " +
                            "skipping this shard! This may result in incomplete data retrieval!");
                } else {
                    throw new IllegalStateException("Could not locate shard information for one of the read indices. " +
                            "Check your cluster status to see if it is unstable!");
                }
            } else {
                // TODO applyAliasMetaData should be called in order to ensure that the count are exact (alias filters and routing may change the number of documents)
                long numDocs;
                if (readResource.isTyped()) {
                    numDocs = client.count(index, readResource.type(), Integer.toString(shardId), query);
                } else {
                    numDocs = client.countIndexShard(index, Integer.toString(shardId), query);
                }
                int numPartitions = (int) Math.max(1, numDocs / maxDocsPerPartition);
                for (int i = 0; i < numPartitions; i++) {
                    PartitionDefinition.Slice slice = new PartitionDefinition.Slice(i, numPartitions);
                    partitions.add(new PartitionDefinition(settings, resolvedMapping, index, shardId, slice, locations));
                }
            }
        }
        return partitions;
    }
749535
@Override
    public long getAllocatedHostObjects(Long bucketId) {
        if (zeroAllocations.containsKey(bucketId))
            return zeroAllocations.get(bucketId).size();
        else
            return 0L;
    }
1049156
public java.util.List<String> getMemberClusters() {
        if (memberClusters == null) {
            memberClusters = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return memberClusters;
    }
631076
public Member getMember(String name) {
        if (null == keyValStore) throw new RuntimeException("No key value store was found.  You must first call Chain.setKeyValStore");
        if (null == memberServices) throw new RuntimeException("No member services was found.  You must first call Chain.setMemberServices or Chain.setMemberServicesUrl");

        // Try to get the member state from the cache
        Member member = (Member) members.get(name);
        if (null != member) return member;

        // Create the member and try to restore it's state from the key value store (if found).
        member = new Member(name, this);
        member.restoreState();
        return member;

    }