Tabnine Logo
BlockPlacementPolicyDefault.pickupReplicaSet
Code IndexAdd Tabnine to your IDE (free)

How to use
pickupReplicaSet
method
in
org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicyDefault

Best Java code snippets using org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicyDefault.pickupReplicaSet (Showing top 4 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

@Override
protected Collection<DatanodeStorageInfo> pickupReplicaSet(
  Collection<DatanodeStorageInfo> moreThanOne,
  Collection<DatanodeStorageInfo> exactlyOne,
  Map<String, List<DatanodeStorageInfo>> rackMap) {
 // shareUDSet includes DatanodeStorageInfo that share same upgrade
 // domain with another DatanodeStorageInfo.
 Collection<DatanodeStorageInfo> all = combine(moreThanOne, exactlyOne);
 List<DatanodeStorageInfo> shareUDSet = getShareUDSet(
   getUpgradeDomainMap(all));
 // shareRackAndUDSet contains those DatanodeStorageInfo that
 // share rack and upgrade domain with another DatanodeStorageInfo.
 List<DatanodeStorageInfo> shareRackAndUDSet = new ArrayList<>();
 if (shareUDSet.size() == 0) {
  // All upgrade domains are unique, use the parent set.
  return super.pickupReplicaSet(moreThanOne, exactlyOne, rackMap);
 } else if (moreThanOne != null) {
  for (DatanodeStorageInfo storage : shareUDSet) {
   if (moreThanOne.contains(storage)) {
    shareRackAndUDSet.add(storage);
   }
  }
 }
 return (shareRackAndUDSet.size() > 0) ? shareRackAndUDSet : shareUDSet;
}
origin: org.apache.hadoop/hadoop-hdfs

for(DatanodeStorageInfo storage : pickupReplicaSet(moreThanOne,
  exactlyOne, rackMap)) {
 if (!excessTypes.contains(storage.getStorageType())) {
origin: ch.cern.hadoop/hadoop-hdfs

for(DatanodeStorageInfo storage : pickupReplicaSet(moreThanOne,
  exactlyOne, rackMap)) {
 if (!excessTypes.contains(storage.getStorageType())) {
origin: io.prestosql.hadoop/hadoop-apache

for(DatanodeStorageInfo storage : pickupReplicaSet(moreThanOne,
  exactlyOne, rackMap)) {
 if (!excessTypes.contains(storage.getStorageType())) {
org.apache.hadoop.hdfs.server.blockmanagementBlockPlacementPolicyDefaultpickupReplicaSet

Javadoc

Pick up replica node set for deleting replica as over-replicated. First set contains replica nodes on rack with more than one replica while second set contains remaining replica nodes. If only 1 rack, pick all. If 2 racks, pick all that have more than 1 replicas on the same rack; if no such replicas, pick all. If 3 or more racks, pick all.

Popular methods of BlockPlacementPolicyDefault

  • chooseReplicaToDelete
    Decide whether deleting the specified replica of the block still makes the block conform to the conf
  • chooseTarget
  • useDelHint
    Check if we can use delHint.
  • addToExcludedNodes
    Add localMachine and related nodes to excludedNodes for next replica choosing. In sub class, we can
  • adjustSetsWithChosenReplica
  • chooseDataNode
    Choose a datanode from the given scope with specified storage type.
  • chooseFromNextRack
  • chooseLocalRack
    Choose one node from the rack that localMachine is on. if no such node is available, choose one node
  • chooseLocalStorage
    Choose localMachine as the target. if localMachine is not available, choose a node on the same rack
  • chooseRandom
    Randomly choose numOfReplicas targets from the given scope.
  • chooseRemoteRack
    Choose numOfReplicas nodes from the racks that localMachine is NOT on. if not enough nodes are avail
  • getMaxNodesPerRack
    Calculate the maximum number of replicas to allocate per rack. It also limits the total number of re
  • chooseRemoteRack,
  • getMaxNodesPerRack,
  • getPipeline,
  • getRequiredStorageTypes,
  • initialize,
  • logNodeIsNotChosen,
  • splitNodesWithRack,
  • addIfIsGoodTarget,
  • isGoodTarget

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (Timer)
  • Kernel (java.awt.image)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now