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

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

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

origin: org.apache.hadoop/hadoop-hdfs

private enum NodeNotChosenReason {
 NOT_IN_SERVICE("the node is not in service"),
 NODE_STALE("the node is stale"),
 NODE_TOO_BUSY("the node is too busy"),
 TOO_MANY_NODES_ON_RACK("the rack has too many chosen nodes"),
 NOT_ENOUGH_STORAGE_SPACE("not enough storage space to place the block");
 private final String text;
 NodeNotChosenReason(final String logText) {
  text = logText;
 }
 private String getText() {
  return text;
 }
}
origin: org.apache.hadoop/hadoop-hdfs

if (favoredNodes == null || favoredNodes.size() == 0) {
 return chooseTarget(src, numOfReplicas, writer,
   new ArrayList<DatanodeStorageInfo>(numOfReplicas), false, 
   excludedNodes, blocksize, storagePolicy, flags);
   chooseTarget(src, numOfReplicas, writer,
     new ArrayList<DatanodeStorageInfo>(numOfReplicas), false,
     favoriteAndExcludedNodes, blocksize, storagePolicy, flags);
return chooseTarget(src, numOfReplicas, writer, 
  new ArrayList<DatanodeStorageInfo>(numOfReplicas), false, 
  excludedNodes, blocksize, storagePolicy, flags);
origin: org.apache.hadoop/hadoop-hdfs

 excludedNodeCopy.add(writer);
localNode = chooseTarget(numOfReplicas, writer,
  excludedNodeCopy, blocksize, maxNodesPerRack, results,
  avoidStaleNodes, storagePolicy,
localNode = chooseTarget(numOfReplicas, writer, excludedNodes,
  blocksize, maxNodesPerRack, results, avoidStaleNodes,
  storagePolicy, EnumSet.noneOf(StorageType.class), results.isEmpty());
origin: ch.cern.hadoop/hadoop-hdfs

 @Override
 public DatanodeStorageInfo[] chooseTarget(String srcPath,
                  int numOfReplicas,
                  Node writer,
                  List<DatanodeStorageInfo> chosenNodes,
                  boolean returnChosenNodes,
                  Set<Node> excludedNodes,
                  long blocksize,
                  final BlockStoragePolicy storagePolicy) {
  DatanodeStorageInfo[] results = super.chooseTarget(srcPath,
    numOfReplicas, writer, chosenNodes, returnChosenNodes, excludedNodes,
    blocksize, storagePolicy);
  try {
   Thread.sleep(3000);
  } catch (InterruptedException e) {}
  return results;
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

if (favoredNodes == null || favoredNodes.size() == 0) {
 return chooseTarget(src, numOfReplicas, writer,
   new ArrayList<DatanodeStorageInfo>(numOfReplicas), false, 
   excludedNodes, blocksize, storagePolicy);
   chooseTarget(src, numOfReplicas, writer, results,
     false, favoriteAndExcludedNodes, blocksize, storagePolicy);
 for (int i = 0; i < remainingTargets.length; i++) {
return chooseTarget(src, numOfReplicas, writer, 
  new ArrayList<DatanodeStorageInfo>(numOfReplicas), false, 
  excludedNodes, blocksize, storagePolicy);
origin: io.prestosql.hadoop/hadoop-apache

final Node localNode = chooseTarget(numOfReplicas, writer, excludedNodes,
  blocksize, maxNodesPerRack, results, avoidStaleNodes, storagePolicy,
  EnumSet.noneOf(StorageType.class), results.isEmpty());
origin: io.prestosql.hadoop/hadoop-apache

if (favoredNodes == null || favoredNodes.size() == 0) {
 return chooseTarget(src, numOfReplicas, writer,
   new ArrayList<DatanodeStorageInfo>(numOfReplicas), false, 
   excludedNodes, blocksize, storagePolicy);
   chooseTarget(src, numOfReplicas, writer, results,
     false, favoriteAndExcludedNodes, blocksize, storagePolicy);
 for (int i = 0; i < remainingTargets.length; i++) {
return chooseTarget(src, numOfReplicas, writer, 
  new ArrayList<DatanodeStorageInfo>(numOfReplicas), false, 
  excludedNodes, blocksize, storagePolicy);
origin: ch.cern.hadoop/hadoop-hdfs

final Node localNode = chooseTarget(numOfReplicas, writer, excludedNodes,
  blocksize, maxNodesPerRack, results, avoidStaleNodes, storagePolicy,
  EnumSet.noneOf(StorageType.class), results.isEmpty());
origin: ch.cern.hadoop/hadoop-hdfs

return chooseTarget(numOfReplicas, writer, oldExcludedNodes, blocksize,
  maxNodesPerRack, results, false, storagePolicy, unavailableStorages,
  newBlock);
return chooseTarget(numOfReplicas, writer, oldExcludedNodes, blocksize,
  maxNodesPerRack, results, false, storagePolicy, unavailableStorages,
  newBlock);
origin: ch.cern.hadoop/hadoop-hdfs

targets = repl.chooseTarget(filename, 4, dataNodes[0], chosenNodes, false, 
  excludedNodes, BLOCK_SIZE, TestBlockStoragePolicy.DEFAULT_STORAGE_POLICY);
assertEquals(targets.length, 4);
excludedNodes.add(dataNodes[1]); 
chosenNodes.add(storages[2]);
targets = repl.chooseTarget(filename, 1, dataNodes[0], chosenNodes, true,
  excludedNodes, BLOCK_SIZE, TestBlockStoragePolicy.DEFAULT_STORAGE_POLICY);
System.out.println("targets=" + Arrays.asList(targets));
origin: io.prestosql.hadoop/hadoop-apache

return chooseTarget(numOfReplicas, writer, oldExcludedNodes, blocksize,
  maxNodesPerRack, results, false, storagePolicy, unavailableStorages,
  newBlock);
return chooseTarget(numOfReplicas, writer, oldExcludedNodes, blocksize,
  maxNodesPerRack, results, false, storagePolicy, unavailableStorages,
  newBlock);
org.apache.hadoop.hdfs.server.blockmanagementBlockPlacementPolicyDefaultchooseTarget

Javadoc

This is the implementation.

Popular methods of BlockPlacementPolicyDefault

  • chooseReplicaToDelete
    Decide whether deleting the specified replica of the block still makes the block conform to the conf
  • 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
  • getPipeline
    Return a pipeline of nodes. The pipeline is formed finding a shortest path that starts from the writ
  • getMaxNodesPerRack,
  • getPipeline,
  • getRequiredStorageTypes,
  • initialize,
  • logNodeIsNotChosen,
  • pickupReplicaSet,
  • splitNodesWithRack,
  • addIfIsGoodTarget,
  • isGoodTarget

Popular in Java

  • Parsing JSON documents to java classes using gson
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • getResourceAsStream (ClassLoader)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Top plugins for WebStorm
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