Пример #1
0
 @Test
 public void testNameNode() throws IOException {
   Configuration conf = MyConf.getConfiguration();
   new File("D:\\home\\hdfs\\tmp\\dfs\\name").mkdirs();
   NameNode namenode = new NameNode(conf);
   System.out.println(namenode.getFsImageName().getName());
 }
Пример #2
0
  @Test
  public void testDfsClient() throws IOException {
    Configuration conf = MyConf.getConfiguration();
    DFSClient client = new DFSClient(conf);
    if (logger.isInfoEnabled()) {
      logger.info("testDfsClient() - DFSClient client=" + client.toString()); // $NON-NLS-1$
    }

    ClientProtocol protocol = DFSClient.createNamenode(conf);
    System.out.println(protocol.getClass().toString());
    ContentSummary summary = protocol.getContentSummary("/penglin");
    System.out.println(summary.getFileCount());
    System.out.println(summary.toString());
    System.out.println(summary.getSpaceConsumed());
  }
Пример #3
0
 @Test
 public void testDataeNode() throws IOException {
   Configuration conf = MyConf.getConfiguration();
 }