Java 类org.apache.hadoop.hdfs.test.system.NNClient 实例源码

项目:hadoop-2.6.0-cdh5.4.3    文件:TestHL040.java   
@Test
public void testConnect() throws IOException {
  LOG.info("Staring TestHL040: connecting to the HDFSCluster ");
  LOG.info("================ Getting namenode info ================");
  NNClient dfsMaster = cluster.getNNClient();
  LOG.info("Process info of namenode " + dfsMaster.getHostName() + " is: " +
      dfsMaster.getProcessInfo());
  LOG.info("================ Getting datanode info ================");
  Collection<DNClient> clients = cluster.getDNClients();
  for (DNClient dnC : clients) {
    LOG.info("Process info of datanode " + dnC.getHostName() + " is: " +
        dnC.getProcessInfo());
    Assert.assertNotNull("Datanode process info isn't suppose to be null",
        dnC.getProcessInfo());
  }
}
项目:hadoop-on-lustre    文件:TestHL040.java   
@Test
public void testConnect() throws IOException {
  LOG.info("Staring TestHL040: connecting to the HDFSCluster ");
  LOG.info("================ Getting namenode info ================");
  NNClient dfsMaster = cluster.getNNClient();
  LOG.info("Process info of namenode " + dfsMaster.getHostName() + " is: " +
      dfsMaster.getProcessInfo());
  LOG.info("================ Getting datanode info ================");
  Collection<DNClient> clients = cluster.getDNClients();
  for (DNClient dnC : clients) {
    LOG.info("Process info of datanode " + dnC.getHostName() + " is: " +
        dnC.getProcessInfo());
    Assert.assertNotNull("Datanode process info isn't suppose to be null",
        dnC.getProcessInfo());
    LOG.info("Free space " + readAttr(dnC));
  }
}
项目:cumulus    文件:TestHL040.java   
@Test
public void testConnect() throws IOException {
  LOG.info("Staring TestHL040: connecting to the HDFSCluster ");
  LOG.info("================ Getting namenode info ================");
  NNClient dfsMaster = cluster.getNNClient();
  LOG.info("Process info of namenode " + dfsMaster.getHostName() + " is: " +
      dfsMaster.getProcessInfo());
  LOG.info("================ Getting datanode info ================");
  Collection<DNClient> clients = cluster.getDNClients();
  for (DNClient dnC : clients) {
    LOG.info("Process info of datanode " + dnC.getHostName() + " is: " +
        dnC.getProcessInfo());
    Assert.assertNotNull("Datanode process info isn't suppose to be null",
        dnC.getProcessInfo());
    LOG.info("Free space " + getFreeSpace(dnC));
  }
}
项目:hanoi-hadoop-2.0.0-cdh    文件:TestHL040.java   
@Test
public void testConnect() throws IOException {
  LOG.info("Staring TestHL040: connecting to the HDFSCluster ");
  LOG.info("================ Getting namenode info ================");
  NNClient dfsMaster = cluster.getNNClient();
  LOG.info("Process info of namenode " + dfsMaster.getHostName() + " is: " +
      dfsMaster.getProcessInfo());
  LOG.info("================ Getting datanode info ================");
  Collection<DNClient> clients = cluster.getDNClients();
  for (DNClient dnC : clients) {
    LOG.info("Process info of datanode " + dnC.getHostName() + " is: " +
        dnC.getProcessInfo());
    Assert.assertNotNull("Datanode process info isn't suppose to be null",
        dnC.getProcessInfo());
  }
}
项目:hortonworks-extension    文件:TestHL040.java   
@Test
public void testConnect() throws IOException {
  LOG.info("Staring TestHL040: connecting to the HDFSCluster ");
  LOG.info("================ Getting namenode info ================");
  NNClient dfsMaster = cluster.getNNClient();
  LOG.info("Process info of namenode " + dfsMaster.getHostName() + " is: " +
      dfsMaster.getProcessInfo());
  LOG.info("================ Getting datanode info ================");
  Collection<DNClient> clients = cluster.getDNClients();
  for (DNClient dnC : clients) {
    LOG.info("Process info of datanode " + dnC.getHostName() + " is: " +
        dnC.getProcessInfo());
    Assert.assertNotNull("Datanode process info isn't suppose to be null",
        dnC.getProcessInfo());
    LOG.info("Free space " + readAttr(dnC));
  }
}
项目:hortonworks-extension    文件:TestHL040.java   
@Test
public void testConnect() throws IOException {
  LOG.info("Staring TestHL040: connecting to the HDFSCluster ");
  LOG.info("================ Getting namenode info ================");
  NNClient dfsMaster = cluster.getNNClient();
  LOG.info("Process info of namenode " + dfsMaster.getHostName() + " is: " +
      dfsMaster.getProcessInfo());
  LOG.info("================ Getting datanode info ================");
  Collection<DNClient> clients = cluster.getDNClients();
  for (DNClient dnC : clients) {
    LOG.info("Process info of datanode " + dnC.getHostName() + " is: " +
        dnC.getProcessInfo());
    Assert.assertNotNull("Datanode process info isn't suppose to be null",
        dnC.getProcessInfo());
    LOG.info("Free space " + readAttr(dnC));
  }
}
项目:hadoop-on-lustre    文件:TestBalancer.java   
public void testNamenodeConnectDisconnect() throws IOException {
    LOG.info("connecting to namenode");
    NNClient namenode = dfsCluster.getNNClient();
    namenode.connect();
    LOG.info("done.");
    LOG.info("disconnecting from namenode");
    namenode.disconnect();
}
项目:hadoop-on-lustre    文件:TestBalancer.java   
/**
 * NamenodeProtocolTest_05
 * Get blocks from a non-existent datanode.
 */
@Test
public void testNamenodeProtocolGetBlocksFromNonexistentDatanode()
        throws IOException {
    final short replication = 1;
    Path balancerTempDir = null;
    try {
    // reserve 2 nodes for test
    List<DNClient> testnodes = reserveDatanodesForTest(2);
    shutdownNonTestNodes(testnodes);

    DNClient testnode1 = testnodes.get(0);
    DNClient testnode2 = testnodes.get(1);

    // write some blocks with replication factor of 1
    balancerTempDir = makeTempDir();
    generateFileSystemLoad(20, replication);

    // get block locations from NN
    NNClient namenode = dfsCluster.getNNClient();
    // TODO extend namenode to get block locations
    //namenode.get

    // shutdown 1 node
    stopDatanode(testnode1);

    // attempt to retrieve blocks from the dead node
    // we should fail
    } finally {
        // cleanup
                    // finally block to run cleanup
        LOG.info("clean off test data from DFS [rmr ~/balancer-temp]");
        try {
            deleteTempDir(balancerTempDir);
        } catch (Exception e) {
            LOG.warn("problem cleaning up temp dir", e);
        }
    }
}
项目:hortonworks-extension    文件:TestBalancer.java   
public void testNamenodeConnectDisconnect() throws IOException {
    LOG.info("connecting to namenode");
    NNClient namenode = dfsCluster.getNNClient();
    namenode.connect();
    LOG.info("done.");
    LOG.info("disconnecting from namenode");
    namenode.disconnect();
}
项目:hortonworks-extension    文件:TestBalancer.java   
/**
 * NamenodeProtocolTest_05
 * Get blocks from a non-existent datanode.
 */
@Test
public void testNamenodeProtocolGetBlocksFromNonexistentDatanode()
        throws IOException {
    final short replication = 1;
    Path balancerTempDir = null;
    try {
    // reserve 2 nodes for test
    List<DNClient> testnodes = reserveDatanodesForTest(2);
    shutdownNonTestNodes(testnodes);

    DNClient testnode1 = testnodes.get(0);
    DNClient testnode2 = testnodes.get(1);

    // write some blocks with replication factor of 1
    balancerTempDir = makeTempDir();
    generateFileSystemLoad(20, replication);

    // get block locations from NN
    NNClient namenode = dfsCluster.getNNClient();
    // TODO extend namenode to get block locations
    //namenode.get

    // shutdown 1 node
    stopDatanode(testnode1);

    // attempt to retrieve blocks from the dead node
    // we should fail
    } finally {
        // cleanup
                    // finally block to run cleanup
        LOG.info("clean off test data from DFS [rmr ~/balancer-temp]");
        try {
            deleteTempDir(balancerTempDir);
        } catch (Exception e) {
            LOG.warn("problem cleaning up temp dir", e);
        }
    }
}
项目:hortonworks-extension    文件:TestBalancer.java   
public void testNamenodeConnectDisconnect() throws IOException {
    LOG.info("connecting to namenode");
    NNClient namenode = dfsCluster.getNNClient();
    namenode.connect();
    LOG.info("done.");
    LOG.info("disconnecting from namenode");
    namenode.disconnect();
}
项目:hortonworks-extension    文件:TestBalancer.java   
/**
 * NamenodeProtocolTest_05
 * Get blocks from a non-existent datanode.
 */
@Test
public void testNamenodeProtocolGetBlocksFromNonexistentDatanode()
        throws IOException {
    final short replication = 1;
    Path balancerTempDir = null;
    try {
    // reserve 2 nodes for test
    List<DNClient> testnodes = reserveDatanodesForTest(2);
    shutdownNonTestNodes(testnodes);

    DNClient testnode1 = testnodes.get(0);
    DNClient testnode2 = testnodes.get(1);

    // write some blocks with replication factor of 1
    balancerTempDir = makeTempDir();
    generateFileSystemLoad(20, replication);

    // get block locations from NN
    NNClient namenode = dfsCluster.getNNClient();
    // TODO extend namenode to get block locations
    //namenode.get

    // shutdown 1 node
    stopDatanode(testnode1);

    // attempt to retrieve blocks from the dead node
    // we should fail
    } finally {
        // cleanup
                    // finally block to run cleanup
        LOG.info("clean off test data from DFS [rmr ~/balancer-temp]");
        try {
            deleteTempDir(balancerTempDir);
        } catch (Exception e) {
            LOG.warn("problem cleaning up temp dir", e);
        }
    }
}
项目:hadoop-on-lustre    文件:TestBalancer.java   
public void testNamenodePing() throws IOException {
    LOG.info("testing filesystem ping");
    NNClient namenode = dfsCluster.getNNClient();
    namenode.ping();
    LOG.info("done.");
}
项目:hortonworks-extension    文件:TestBalancer.java   
public void testNamenodePing() throws IOException {
    LOG.info("testing filesystem ping");
    NNClient namenode = dfsCluster.getNNClient();
    namenode.ping();
    LOG.info("done.");
}
项目:hortonworks-extension    文件:TestBalancer.java   
public void testNamenodePing() throws IOException {
    LOG.info("testing filesystem ping");
    NNClient namenode = dfsCluster.getNNClient();
    namenode.ping();
    LOG.info("done.");
}