Examples of DatanodeID


Examples of org.apache.hadoop.hdfs.protocol.DatanodeID

    public void doGet(HttpServletRequest request, HttpServletResponse response
        ) throws ServletException, IOException {
      final UserGroupInformation ugi = getUGI(request);
      final ServletContext context = getServletContext();
      final NameNode namenode = (NameNode)context.getAttribute("name.node");
      final DatanodeID datanode = namenode.namesystem.getRandomDatanode();
      try {
        final URI uri = createRedirectUri("/getFileChecksum", ugi, datanode, request, namenode);
        response.sendRedirect(uri.toURL().toString());
      } catch(URISyntaxException e) {
        throw new ServletException(e);
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.DatanodeID

    this.minReadSpeedBps = conf.getLong("dfs.min.read.speed.bps", -1);
    this.maxBlockAcquireFailures = getMaxBlockAcquireFailures(conf);
    this.localHost = InetAddress.getLocalHost();
   
    // fetch network location of localhost
    this.pseuDatanodeInfoForLocalhost = new DatanodeInfo(new DatanodeID(
        this.localHost.getHostAddress()));
    this.dnsToSwitchMapping = ReflectionUtils.newInstance(
        conf.getClass("topology.node.switch.mapping.impl", ScriptBasedMapping.class,
          DNSToSwitchMapping.class), conf);
    ArrayList<String> tempList = new ArrayList<String>();
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.DatanodeID

      // address and port of that node.
      DatanodeInfo[] favoredNodeInfos = null;
      if (favoredNodes != null) {
        favoredNodeInfos = new DatanodeInfo[favoredNodes.length];
        for (int i = 0; i < favoredNodes.length; i++) {
          favoredNodeInfos[i] = new DatanodeInfo(new DatanodeID(
              favoredNodes[i].getAddress().getHostAddress() + ":" +
              favoredNodes[i].getPort()));
        }
      }
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.DatanodeID

      final ServletContext context = getServletContext();
      final Configuration conf = NameNodeHttpServer.getConfFromContext(context);
      final UserGroupInformation ugi = getUGI(request, conf);
      final NameNode namenode = NameNodeHttpServer.getNameNodeFromContext(
          context);
      final DatanodeID datanode = NamenodeJspHelper.getRandomDatanode(namenode);
      try {
        response.sendRedirect(
            createRedirectURL(ugi, datanode, request, namenode).toString());
      } catch (IOException e) {
        response.sendError(400, e.getMessage());
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.DatanodeID

    void register() throws IOException {
      // get versions from the namenode
      nsInfo = nameNodeProto.versionRequest();
      dnRegistration = new DatanodeRegistration(
          new DatanodeID(DNS.getDefaultIP("default"),
              DNS.getDefaultHost("default", "default"),
              DataNode.generateUuid(), getNodePort(dnIdx),
              DFSConfigKeys.DFS_DATANODE_HTTP_DEFAULT_PORT,
              DFSConfigKeys.DFS_DATANODE_HTTPS_DEFAULT_PORT,
              DFSConfigKeys.DFS_DATANODE_IPC_DEFAULT_PORT),
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.DatanodeID

    String scheme = request.getScheme();
    final LocatedBlocks blks = nnproxy.getBlockLocations(
        status.getFullPath(new Path(path)).toUri().getPath(), 0, 1);
    final Configuration conf = NameNodeHttpServer.getConfFromContext(
        getServletContext());
    final DatanodeID host = pickSrcDatanode(blks, status, conf);
    final String hostname;
    if (host instanceof DatanodeInfo) {
      hostname = host.getHostName();
    } else {
      hostname = host.getIpAddr();
    }

    int port = "https".equals(scheme) ? host.getInfoSecurePort() : host
        .getInfoPort();

    String dtParam = "";
    if (dt != null) {
      dtParam = JspHelper.getDelegationTokenUrlParam(dt);
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.DatanodeID

      // now considered dead because it is no longer allowed to connect
      // and (2) the bogus entry in the hosts file (these entries are
      // always added last)
      info = client.datanodeReport(DatanodeReportType.DEAD);
      assertEquals("There should be 2 dead nodes", 2, info.length);
      DatanodeID id = cluster.getDataNodes().get(0).getDatanodeId();
      assertEquals(id.getHostName(), info[0].getHostName());
      assertEquals(bogusIp, info[1].getHostName());
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.DatanodeID

    FileSystem fileSys = cluster.getFileSystem();
    writeFile(fileSys, file1, replicas);
       
    DFSClient client = getDfsClient(cluster.getNameNode(), conf);
    DatanodeInfo[] info = client.datanodeReport(DatanodeReportType.LIVE);
    DatanodeID excludedDatanodeID = info[0];
    String excludedDatanodeName = info[0].getXferAddr();

    writeConfigFile(excludeFile, new ArrayList<String>(Arrays.asList(excludedDatanodeName)));
   
    //Add a new datanode to cluster
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.DatanodeID

      return;
    }
    boolean allAlive = false;
    while (!allAlive) {
      // locate the first dead node.
      DatanodeID dead = null;
      // check the number of stale nodes
      int numOfStaleNodes = 0;
      synchronized(this) {
        for (DatanodeDescriptor d : datanodes) {
          if (dead == null && dm.isDatanodeDead(d)) {
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.DatanodeID

      setLength(amtToRead).
      setVerifyChecksum(true).
      setClientName("JspHelper").
      setClientCacheContext(ClientContext.getFromConf(conf)).
      setDatanodeInfo(new DatanodeInfo(
          new DatanodeID(addr.getAddress().getHostAddress(),
              addr.getHostName(), poolId, addr.getPort(), 0, 0, 0))).
      setCachingStrategy(CachingStrategy.newDefaultStrategy()).
      setConfiguration(conf).
      setRemotePeerFactory(new RemotePeerFactory() {
        @Override
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.