congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Host2NodesMap.remove
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.apache.hadoop/hadoop-hdfs

/** Physically remove node from datanodeMap. */
private void wipeDatanode(final DatanodeID node) {
 final String key = node.getDatanodeUuid();
 synchronized (this) {
  host2DatanodeMap.remove(datanodeMap.remove(key));
 }
 if (LOG.isDebugEnabled()) {
  LOG.debug(getClass().getSimpleName() + ".wipeDatanode("
    + node + "): storage " + key 
    + " is removed from datanodeMap.");
 }
}
origin: org.apache.hadoop/hadoop-hdfs

/** Add a datanode. */
void addDatanode(final DatanodeDescriptor node) {
 // To keep host2DatanodeMap consistent with datanodeMap,
 // remove  from host2DatanodeMap the datanodeDescriptor removed
 // from datanodeMap before adding node to host2DatanodeMap.
 synchronized(this) {
  host2DatanodeMap.remove(datanodeMap.put(node.getDatanodeUuid(), node));
 }
 networktopology.add(node); // may throw InvalidTopologyException
 host2DatanodeMap.add(node);
 checkIfClusterIsNowMultiRack(node);
 resolveUpgradeDomain(node);
 if (LOG.isDebugEnabled()) {
  LOG.debug(getClass().getSimpleName() + ".addDatanode: "
    + "node " + node + " is added to datanodeMap.");
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

/** Physically remove node from datanodeMap. */
private void wipeDatanode(final DatanodeID node) {
 final String key = node.getDatanodeUuid();
 synchronized (datanodeMap) {
  host2DatanodeMap.remove(datanodeMap.remove(key));
 }
 // Also remove all block invalidation tasks under this node
 blockManager.removeFromInvalidates(new DatanodeInfo(node));
 if (LOG.isDebugEnabled()) {
  LOG.debug(getClass().getSimpleName() + ".wipeDatanode("
    + node + "): storage " + key 
    + " is removed from datanodeMap.");
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

/** Add a datanode. */
void addDatanode(final DatanodeDescriptor node) {
 // To keep host2DatanodeMap consistent with datanodeMap,
 // remove  from host2DatanodeMap the datanodeDescriptor removed
 // from datanodeMap before adding node to host2DatanodeMap.
 synchronized(datanodeMap) {
  host2DatanodeMap.remove(datanodeMap.put(node.getDatanodeUuid(), node));
 }
 networktopology.add(node); // may throw InvalidTopologyException
 host2DatanodeMap.add(node);
 checkIfClusterIsNowMultiRack(node);
 if (LOG.isDebugEnabled()) {
  LOG.debug(getClass().getSimpleName() + ".addDatanode: "
    + "node " + node + " is added to datanodeMap.");
 }
}
origin: io.prestosql.hadoop/hadoop-apache

/** Physically remove node from datanodeMap. */
private void wipeDatanode(final DatanodeID node) {
 final String key = node.getDatanodeUuid();
 synchronized (datanodeMap) {
  host2DatanodeMap.remove(datanodeMap.remove(key));
 }
 // Also remove all block invalidation tasks under this node
 blockManager.removeFromInvalidates(new DatanodeInfo(node));
 if (LOG.isDebugEnabled()) {
  LOG.debug(getClass().getSimpleName() + ".wipeDatanode("
    + node + "): storage " + key 
    + " is removed from datanodeMap.");
 }
}
origin: io.prestosql.hadoop/hadoop-apache

/** Add a datanode. */
void addDatanode(final DatanodeDescriptor node) {
 // To keep host2DatanodeMap consistent with datanodeMap,
 // remove  from host2DatanodeMap the datanodeDescriptor removed
 // from datanodeMap before adding node to host2DatanodeMap.
 synchronized(datanodeMap) {
  host2DatanodeMap.remove(datanodeMap.put(node.getDatanodeUuid(), node));
 }
 networktopology.add(node); // may throw InvalidTopologyException
 host2DatanodeMap.add(node);
 checkIfClusterIsNowMultiRack(node);
 if (LOG.isDebugEnabled()) {
  LOG.debug(getClass().getSimpleName() + ".addDatanode: "
    + "node " + node + " is added to datanodeMap.");
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

@Test
public void testRemove() throws Exception {
 DatanodeDescriptor nodeNotInMap =
  DFSTestUtil.getDatanodeDescriptor("3.3.3.3", "/d1/r4");
 assertFalse(map.remove(nodeNotInMap));
 
 assertTrue(map.remove(dataNodes[0]));
 assertTrue(map.getDatanodeByHost("1.1.1.1.")==null);
 assertTrue(map.getDatanodeByHost("2.2.2.2")==dataNodes[1]);
 DatanodeDescriptor node = map.getDatanodeByHost("3.3.3.3");
 assertTrue(node==dataNodes[2] || node==dataNodes[3]);
 assertNull(map.getDatanodeByHost("4.4.4.4"));
 
 assertTrue(map.remove(dataNodes[2]));
 assertNull(map.getDatanodeByHost("1.1.1.1"));
 assertEquals(map.getDatanodeByHost("2.2.2.2"), dataNodes[1]);
 assertEquals(map.getDatanodeByHost("3.3.3.3"), dataNodes[3]);
 
 assertTrue(map.remove(dataNodes[3]));
 assertNull(map.getDatanodeByHost("1.1.1.1"));
 assertEquals(map.getDatanodeByHost("2.2.2.2"), dataNodes[1]);
 assertNull(map.getDatanodeByHost("3.3.3.3"));
 
 assertFalse(map.remove(null));
 assertTrue(map.remove(dataNodes[1]));
 assertFalse(map.remove(dataNodes[1]));
}
org.apache.hadoop.hdfs.server.blockmanagementHost2NodesMapremove

Javadoc

remove node from the map return true if the node is removed; false otherwise.

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.
  • getDataNodeByHostName
    get a data node by its hostname. This should be used if only one datanode service is running on a ho
  • 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 PhpStorm 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