@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()); } }
@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)); } }
@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)); } }
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(); }
/** * 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); } } }
public void testNamenodePing() throws IOException { LOG.info("testing filesystem ping"); NNClient namenode = dfsCluster.getNNClient(); namenode.ping(); LOG.info("done."); }