Package org.apache.hadoop.hdfs.server.datanode

Examples of org.apache.hadoop.hdfs.server.datanode.DataNode.shutdown()


    DataNode dn = dnprop.datanode;
    LOG.info("MiniDFSCluster Stopping DataNode " +
                       dn.getMachineName() +
                       " from a total of " + (dataNodes.size() + 1) +
                       " datanodes.");
    dn.shutdown();
    numDataNodes--;
    return dnprop;
  }

  /*
 
View Full Code Here


    } catch(IOException e) {
      if (e instanceof java.net.BindException)
        return false;
      throw e;
    } finally {
      if(dn != null) dn.shutdown();
    }
    return true;
  }

  /**
 
View Full Code Here

   */
  public void shutdownDataNodes() {
    for (int i = dataNodes.size()-1; i >= 0; i--) {
      LOG.info("Shutting down DataNode " + i);
      DataNode dn = dataNodes.remove(i).datanode;
      dn.shutdown();
      numDataNodes--;
    }
  }

  /**
 
View Full Code Here

    DataNode dn = dnprop.datanode;
    LOG.info("MiniDFSCluster Stopping DataNode " +
                       dn.getDisplayName() +
                       " from a total of " + (dataNodes.size() + 1) +
                       " datanodes.");
    dn.shutdown();
    numDataNodes--;
    return dnprop;
  }

  /*
 
View Full Code Here

      List<LocatedBlock> locatedBlocks = DFSTestUtil.getAllBlocks(in);
      in.close();
      assertEquals(1, locatedBlocks.size());
      assertEquals(3, locatedBlocks.get(0).getLocations().length);
      DataNode dn = cluster.getDataNode(locatedBlocks.get(0).getLocations()[0].getIpcPort());
      dn.shutdown();
     
      // Reopen the file for append, which will need to add another DN to the
      // pipeline and in doing so trigger a block transfer.
      writeTestDataToFile(fs);
      assertEquals(PLAIN_TEXT + PLAIN_TEXT, DFSTestUtil.readFile(fs, TEST_PATH));
View Full Code Here

 
  public void shutdownDataNode(int index, boolean remove) {
    System.out.println("Shutting down DataNode " + index);
    DataNode dn = remove ? dataNodes.remove(index).datanode : dataNodes
        .get(index).datanode;
    dn.shutdown();
    numDataNodes--;
  }

  public synchronized void shutdownNameNode() {
    checkSingleNameNode();
View Full Code Here

    DataNode dn = dnprop.datanode;
    System.out.println("MiniDFSCluster Stopping DataNode " +
                       dn.getDatanodeInfo() +
                       " from a total of " + (dataNodes.size() + 1) +
                       " datanodes.");
    dn.shutdown();
    numDataNodes--;
    return dnprop;
  }

  /**
 
View Full Code Here

          locatedblock.getBlockSize(), true, false, new DatanodeID[0]);
     
      // Force block recovery from the ongoing stream
      for(DatanodeInfo datanodeinfo: locatedblock.getLocations()) {
        DataNode datanode = cluster.getDataNode(datanodeinfo.ipcPort);       
        datanode.shutdown();
        break;
      }
      // Close the file and make sure the failure thrown is BlockAlreadyCommittedException
      try {
        out.close();
View Full Code Here

                  cluster.getNameNode().getNamespaceID()));
            namesystem.getAdditionalBlock(
              FILE1, holder, Arrays.<Node>asList(excludedNode)
            );

            dataNode.shutdown();
          }
          catch (IOException e) {
            fail("exception: " + StringUtils.stringifyException(e));
        }
      }
View Full Code Here

    DataNode dn = cluster.getDataNodes().get(0);
    DatanodeRegistration reg = cluster.getDataNodes().get(0).getDNRegistrationForNS(cluster.getNameNode().getNamespaceID());
    waitForDatanodeState(reg, true, 20000);

    // Shutdown and wait for datanode to be marked dead
    dn.shutdown();
    waitForDatanodeState(reg, false, 20000);

    DatanodeProtocol dnp = cluster.getNameNode();
    Block bia[] = new Block[]{new Block(0)};
    // Ensure blockReceived call from dead datanode is rejected with IOException
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.