当前位置: 首页>>代码示例>>Java>>正文


Java LightWeightLinkedSet.contains方法代码示例

本文整理汇总了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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:33,代码来源:BlockManager.java

示例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;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:UnderReplicatedBlocks.java

示例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;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:10,代码来源:UnderReplicatedBlocks.java

示例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);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:34,代码来源:BlockManager.java

示例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;
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:7,代码来源:UnderReplicatedBlocks.java

示例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;
}
 
开发者ID:iVCE,项目名称:RDFS,代码行数:7,代码来源:UnderReplicatedBlocks.java


注:本文中的org.apache.hadoop.hdfs.util.LightWeightLinkedSet.contains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。