Examples of AvatarDataNode


Examples of org.apache.hadoop.hdfs.server.datanode.AvatarDataNode

      }
      Configuration newconf = new Configuration(dnConf); // save config
      if (hosts != null) {
        NetUtils.addStaticResolution(hosts[i], "localhost");
      }
      AvatarDataNode dn = AvatarDataNode.instantiateDataNode(dnArgs, dnConf);
      //since the HDFS does things based on IP:port, we need to add the mapping
      //for IP:port to rackId
     
      String ipAddr = dn.getSelfAddr().getAddress().getHostAddress();
      if (racks != null) {
        int port = dn.getSelfAddr().getPort();
        System.out.println("Adding node with IP:port : " + ipAddr + ":" + port+
                            " to rack " + racks[i]);
        StaticMapping.addNodeToRack(ipAddr + ":" + port,
                                  racks[i]);
      }
      dn.runDatanodeDaemon();
      dataNodes.add(new DataNodeProperties(dn, newconf, dnArgs));

    }

  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.AvatarDataNode

   * Gets a list of the started DataNodes.  May be empty.
   */
  public ArrayList<AvatarDataNode> getDataNodes() {
    ArrayList<AvatarDataNode> list = new ArrayList<AvatarDataNode>();
    for (int i = 0; i < dataNodes.size(); i++) {
      AvatarDataNode node = dataNodes.get(i).datanode;
      list.add(node);
    }
    return list;
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.AvatarDataNode

    writeWrongIncludeFile(nni.conf);
    LOG.info("RefreshNodes with include file without datanode's hostname.");
    nni.avatars.get(0).avatar.namesystem.refreshNodes(nni.conf);
    nni.avatars.get(1).avatar.namesystem.refreshNodes(nni.conf);
    DataNodeProperties dnProp = cluster.getDataNodeProperties().get(0);
    AvatarDataNode dn = dnProp.datanode;
    dn.waitAndShutdown();
    cluster.shutDownAvatarNodes();
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.AvatarDataNode

    try {
      cluster.restartDataNodes();
    } catch (Exception e) {
      LOG.warn("Expected exception", e);
    }
    AvatarDataNode dn = cluster.getDataNodes().get(0);
    dn.waitAndShutdown();
    cluster.shutDownAvatarNodes();
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.AvatarDataNode

   * Gets a list of the started DataNodes.  May be empty.
   */
  public ArrayList<AvatarDataNode> getDataNodes() {
    ArrayList<AvatarDataNode> list = new ArrayList<AvatarDataNode>();
    for (int i = 0; i < dataNodes.size(); i++) {
      AvatarDataNode node = dataNodes.get(i).datanode;
      list.add(node);
    }
    return list;
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.AvatarDataNode

          LOG.info("Adding node with hostname : " + name + " to rack "
              + racks[i]);
          StaticMapping.addNodeToRack(name, racks[i]);
        }
        Configuration newconf = new Configuration(dnConf); // save config
        AvatarDataNode dn = instantiateDataNode(dnArgs, dnConf);
        // since the HDFS does things based on IP:port, we need to add the
        // mapping
        // for IP:port to rackId

        String ipAddr = dn.getSelfAddr().getAddress().getHostAddress();
        if (racks != null) {
          int port = dn.getSelfAddr().getPort();
          System.out.println("Adding node with IP:port : " + ipAddr + ":"
              + port + " to rack " + racks[i]);
          StaticMapping.addNodeToRack(ipAddr + ":" + port, racks[i]);
        }
        dn.runDatanodeDaemon();
        synchronized (dataNodes) {
          dataNodes.add(new DataNodeProperties(dn, newconf, dnArgs));
        }
      } catch (IOException e) {
        LOG.error("Exception when creating datanode", e);
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.AvatarDataNode

    writeWrongIncludeFile(nni.conf);
    LOG.info("RefreshNodes with include file without datanode's hostname.");
    nni.avatars.get(0).avatar.namesystem.refreshNodes(nni.conf);
    nni.avatars.get(1).avatar.namesystem.refreshNodes(nni.conf);
    DataNodeProperties dnProp = cluster.getDataNodeProperties().get(0);
    AvatarDataNode dn = dnProp.datanode;
    dn.waitAndShutdown();
    cluster.shutDownAvatarNodes();
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.AvatarDataNode

    try {
      cluster.restartDataNodes();
    } catch (Exception e) {
      LOG.warn("Expected exception", e);
    }
    AvatarDataNode dn = cluster.getDataNodes().get(0);
    dn.waitAndShutdown();
    cluster.shutDownAvatarNodes();
  }
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.