本文整理汇总了Java中org.apache.hadoop.hdfs.util.LightWeightLinkedSet.contains方法的典型用法代码示例。如果您正苦于以下问题:Java LightWeightLinkedSet.contains方法的具体用法?Java LightWeightLinkedSet.contains怎么用?Java LightWeightLinkedSet.contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hdfs.util.LightWeightLinkedSet
的用法示例。
在下文中一共展示了LightWeightLinkedSet.contains方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: countNodes
import org.apache.hadoop.hdfs.util.LightWeightLinkedSet; //导入方法依赖的package包/类
/**
* Return the number of nodes hosting a given block, grouped
* by the state of those replicas.
*/
public NumberReplicas countNodes(Block b) {
int decommissioned = 0;
int live = 0;
int corrupt = 0;
int excess = 0;
int stale = 0;
Collection<DatanodeDescriptor> nodesCorrupt = corruptReplicas.getNodes(b);
for(DatanodeStorageInfo storage : blocksMap.getStorages(b, State.NORMAL)) {
final DatanodeDescriptor node = storage.getDatanodeDescriptor();
if ((nodesCorrupt != null) && (nodesCorrupt.contains(node))) {
corrupt++;
} else if (node.isDecommissionInProgress() || node.isDecommissioned()) {
decommissioned++;
} else {
LightWeightLinkedSet<Block> blocksExcess = excessReplicateMap.get(node
.getDatanodeUuid());
if (blocksExcess != null && blocksExcess.contains(b)) {
excess++;
} else {
live++;
}
}
if (storage.areBlockContentsStale()) {
stale++;
}
}
return new NumberReplicas(live, decommissioned, corrupt, excess, stale);
}
示例2: contains
import org.apache.hadoop.hdfs.util.LightWeightLinkedSet; //导入方法依赖的package包/类
/** Check if a block is in the neededReplication queue */
synchronized boolean contains(Block block) {
for(LightWeightLinkedSet<Block> set : priorityQueues) {
if (set.contains(block)) {
return true;
}
}
return false;
}
示例3: contains
import org.apache.hadoop.hdfs.util.LightWeightLinkedSet; //导入方法依赖的package包/类
/** Check if a block is in the neededReplication queue */
synchronized boolean contains(BlockInfo block) {
for(LightWeightLinkedSet<BlockInfo> set : priorityQueues) {
if (set.contains(block)) {
return true;
}
}
return false;
}
示例4: countNodes
import org.apache.hadoop.hdfs.util.LightWeightLinkedSet; //导入方法依赖的package包/类
/**
* Return the number of nodes hosting a given block, grouped
* by the state of those replicas.
*/
public NumberReplicas countNodes(Block b) {
int decommissioned = 0;
int live = 0;
int corrupt = 0;
int excess = 0;
int stale = 0;
Iterator<DatanodeDescriptor> nodeIter = blocksMap.nodeIterator(b);
Collection<DatanodeDescriptor> nodesCorrupt = corruptReplicas.getNodes(b);
while (nodeIter.hasNext()) {
DatanodeDescriptor node = nodeIter.next();
if ((nodesCorrupt != null) && (nodesCorrupt.contains(node))) {
corrupt++;
} else if (node.isDecommissionInProgress() || node.isDecommissioned()) {
decommissioned++;
} else {
LightWeightLinkedSet<Block> blocksExcess = excessReplicateMap.get(node
.getStorageID());
if (blocksExcess != null && blocksExcess.contains(b)) {
excess++;
} else {
live++;
}
}
if (node.areBlockContentsStale()) {
stale++;
}
}
return new NumberReplicas(live, decommissioned, corrupt, excess, stale);
}
示例5: contains
import org.apache.hadoop.hdfs.util.LightWeightLinkedSet; //导入方法依赖的package包/类
synchronized boolean contains(BlockInfo block) {
for(LightWeightLinkedSet<BlockInfo> set:priorityQueues) {
if(set.contains(block)) { return true; }
}
return false;
}
示例6: contains
import org.apache.hadoop.hdfs.util.LightWeightLinkedSet; //导入方法依赖的package包/类
synchronized boolean contains(Block block) {
for(LightWeightLinkedSet<Block> set:priorityQueues) {
if(set.contains(block)) { return true; }
}
return false;
}