Tabnine Logo
Host2NodesMap.getDataNodeByHostName
Code IndexAdd Tabnine to your IDE (free)

How to use
getDataNodeByHostName
method
in
org.apache.hadoop.hdfs.server.blockmanagement.Host2NodesMap

Best Java code snippets using org.apache.hadoop.hdfs.server.blockmanagement.Host2NodesMap.getDataNodeByHostName (Showing top 3 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

/**
 * Add all nodes from a dependent nodes list to excludedNodes.
 * @return number of new excluded nodes
 */
private int addDependentNodesToExcludedNodes(DatanodeDescriptor chosenNode,
  Set<Node> excludedNodes) {
 if (this.host2datanodeMap == null) {
  return 0;
 }
 int countOfExcludedNodes = 0;
 for(String hostname : chosenNode.getDependentHostNames()) {
  DatanodeDescriptor node =
    this.host2datanodeMap.getDataNodeByHostName(hostname);
  if(node!=null) {
   if (excludedNodes.add(node)) {
    countOfExcludedNodes++;
   }
  } else {
   LOG.warn("Not able to find datanode " + hostname
     + " which has dependency with datanode "
     + chosenNode.getHostName());
  }
 }
 
 return countOfExcludedNodes;
}
origin: ch.cern.hadoop/hadoop-hdfs

/**
 * Add all nodes from a dependent nodes list to excludedNodes.
 * @return number of new excluded nodes
 */
private int addDependentNodesToExcludedNodes(DatanodeDescriptor chosenNode,
  Set<Node> excludedNodes) {
 if (this.host2datanodeMap == null) {
  return 0;
 }
 int countOfExcludedNodes = 0;
 for(String hostname : chosenNode.getDependentHostNames()) {
  DatanodeDescriptor node =
    this.host2datanodeMap.getDataNodeByHostName(hostname);
  if(node!=null) {
   if (excludedNodes.add(node)) {
    countOfExcludedNodes++;
   }
  } else {
   LOG.warn("Not able to find datanode " + hostname
     + " which has dependency with datanode "
     + chosenNode.getHostName());
  }
 }
 
 return countOfExcludedNodes;
}
origin: io.prestosql.hadoop/hadoop-apache

/**
 * Add all nodes from a dependent nodes list to excludedNodes.
 * @return number of new excluded nodes
 */
private int addDependentNodesToExcludedNodes(DatanodeDescriptor chosenNode,
  Set<Node> excludedNodes) {
 if (this.host2datanodeMap == null) {
  return 0;
 }
 int countOfExcludedNodes = 0;
 for(String hostname : chosenNode.getDependentHostNames()) {
  DatanodeDescriptor node =
    this.host2datanodeMap.getDataNodeByHostName(hostname);
  if(node!=null) {
   if (excludedNodes.add(node)) {
    countOfExcludedNodes++;
   }
  } else {
   LOG.warn("Not able to find datanode " + hostname
     + " which has dependency with datanode "
     + chosenNode.getHostName());
  }
 }
 
 return countOfExcludedNodes;
}
org.apache.hadoop.hdfs.server.blockmanagementHost2NodesMapgetDataNodeByHostName

Javadoc

get a data node by its hostname. This should be used if only one datanode service is running on a hostname. If multiple datanodes are running on a hostname then use methods getDataNodeByXferAddr and getDataNodeByHostNameAndPort.

Popular methods of Host2NodesMap

  • add
    add node to the map return true if the node is added; false otherwise.
  • contains
    Check if node is already in the map.
  • getDatanodeByHost
    Get a data node by its IP address.
  • remove
    remove node from the map return true if the node is removed; false otherwise.
  • getDatanodeByXferAddr
    Find data node by its transfer address

Popular in Java

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • setScale (BigDecimal)
  • getApplicationContext (Context)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • JTextField (javax.swing)
  • 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