congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
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
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getResourceAsStream (ClassLoader)
  • addToBackStack (FragmentTransaction)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • ImageIO (javax.imageio)
  • JOptionPane (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