/** * @return true if both block and datanode threshold are met else false. */ private boolean areThresholdsMet() { assert namesystem.hasWriteLock(); int datanodeNum = blockManager.getDatanodeManager().getNumLiveDataNodes(); synchronized (this) { return blockSafe >= blockThreshold && datanodeNum >= datanodeThreshold; } }
/** * Check if a block is replicated to at least the minimum replication. */ public boolean isSufficientlyReplicated(BlockInfo b) { // Compare against the lesser of the minReplication and number of live DNs. final int replication = Math.min(minReplication, getDatanodeManager().getNumLiveDataNodes()); return countNodes(b).liveReplicas() >= replication; }
@Override // FSNamesystemMBean @Metric({"NumLiveDataNodes", "Number of datanodes which are currently live"}) public int getNumLiveDataNodes() { return getBlockManager().getDatanodeManager().getNumLiveDataNodes(); }
int numLive = blockManager.getDatanodeManager().getNumLiveDataNodes(); if (numLive < datanodeThreshold) { msg += String.format(
@Override // FSNamesystemMBean public int getNumLiveDataNodes() { return getBlockManager().getDatanodeManager().getNumLiveDataNodes(); }
/** * Check if a block is replicated to at least the minimum replication. */ public boolean isSufficientlyReplicated(BlockInfoContiguous b) { // Compare against the lesser of the minReplication and number of live DNs. final int replication = Math.min(minReplication, getDatanodeManager().getNumLiveDataNodes()); return countNodes(b).liveReplicas() >= replication; }
/** * Check if a block is replicated to at least the minimum replication. */ public boolean isSufficientlyReplicated(BlockInfoContiguous b) { // Compare against the lesser of the minReplication and number of live DNs. final int replication = Math.min(minReplication, getDatanodeManager().getNumLiveDataNodes()); return countNodes(b).liveReplicas() >= replication; }
@Override // FSNamesystemMBean @Metric({"NumLiveDataNodes", "Number of datanodes which are currently live"}) public int getNumLiveDataNodes() { return getBlockManager().getDatanodeManager().getNumLiveDataNodes(); }
while (fsn.getBlockManager().getDatanodeManager().getNumLiveDataNodes() != 2 ) { Uninterruptibles.sleepUninterruptibly(1, TimeUnit.SECONDS);