Examples of MiniAvatarCluster


Examples of org.apache.hadoop.hdfs.MiniAvatarCluster

  public void testAvatarDatanodeRetryRegister() throws Exception {
    Configuration conf = new Configuration();
    conf.setLong("dfs.heartbeat.interval", 1);
    InjectionHandler.set(new TestAvatarDatanodeRetryRegisterHandler());
    MiniAvatarCluster.createAndStartZooKeeper();
    MiniAvatarCluster cluster = new MiniAvatarCluster(conf, 1, true, null, null);
    try {
      FSNamesystem ns = cluster.getPrimaryAvatar(0).avatar.namesystem;
      // These two lines make sure the datanode is marked as dead and is no longer registered.
      ns.setDatanodeDead(ns.getDatanode(cluster.getDataNodes().get(0)
            .getDNRegistrationForNS(cluster.getNamespaceId(0))));
      ns.removeDatanode(cluster.getDataNodes().get(0)
          .getDNRegistrationForNS(cluster.getNamespaceId(0)));
      assertEquals(0,
          ns.getNameNode().getDatanodeReport(DatanodeReportType.LIVE).length);
      int livenodes = ns.getNameNode().getDatanodeReport(DatanodeReportType.LIVE).length;
      // Wait for the datanode to register successfully.
      while (registrations != 1 || livenodes != 1) {
        System.out.println("Waiting for registrations : " + registrations);
        Thread.sleep(1000);
        livenodes = ns.getNameNode().getDatanodeReport(DatanodeReportType.LIVE).length;
      }
      assertEquals(1,
          ns.getNameNode().getDatanodeReport(DatanodeReportType.LIVE).length);
      assertEquals(1, registrations);
    } finally {
      cluster.shutDown();
      MiniAvatarCluster.shutDownZooKeeper();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniAvatarCluster

    Configuration conf = new Configuration();
    // populate repl queues on standby (in safe mode)
    conf.setFloat("dfs.namenode.replqueue.threshold-pct", 0f);
    conf.setLong("fs.avatar.standbyfs.initinterval", 1000);
    conf.setLong("fs.avatar.standbyfs.checkinterval", 1000);
    MiniAvatarCluster cluster = null;
    try {
      cluster = new MiniAvatarCluster(conf, 1, true, null, null, 2, true);
      List<AvatarDataNode> datanodes = cluster.getDataNodes();
      Assert.assertEquals(datanodes.size(), 1);
      checkMXBean(datanodes.get(0));
    } finally {
      if (cluster != null) {
        cluster.shutDown();
      }
      MiniAvatarCluster.shutDownZooKeeper();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniAvatarCluster

  public void setup() throws Exception {
    pass = true;
    conf = new Configuration();
    conf.setLong("dfs.heartbeat.interval", interval / 1000);
    conf.setInt("heartbeat.recheck.interval", recheck);
    cluster = new MiniAvatarCluster(conf, 3, true, null, null);
    new DFSTestUtil("/test", 1, 1, 1024).createFiles(cluster.getFileSystem(),
        "/test");
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniAvatarCluster

    MiniAvatarCluster.createAndStartZooKeeper();
  }

  @Before
  public void setUp() throws Exception {
    cluster = new MiniAvatarCluster(new Configuration(), 1, true, null, null);
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniAvatarCluster

  @Before
  public void setUp() throws Exception {
    MiniAvatarCluster.createAndStartZooKeeper();
    conf = new Configuration();
    done = false;
    cluster = new MiniAvatarCluster(conf, 0, true, null, null);
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniAvatarCluster

    LOG.info("------------------- test: " + name + " START ----------------");
    conf = new Configuration();
    conf.setInt("dfs.block.size", BLOCK_SIZE);
    conf.setInt("dfs.replication.min", 3);
    conf.setBoolean("dfs.support.append", true);
    cluster = new MiniAvatarCluster(conf, 3, true, null, null);
    dafs = cluster.getFileSystem();
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniAvatarCluster

      Configuration conf = new Configuration();
      // Bind ports automatically
      conf.setInt(StorageServiceConfigKeys.PROXY_THRIFT_PORT_KEY, 0);
      conf.setInt(StorageServiceConfigKeys.PROXY_RPC_PORT_KEY, 0);

      cluster = new MiniAvatarCluster(conf, 2, true, null, null, 1, true);
      fs = cluster.getFileSystem(0);

      metaInfo = new RequestMetaInfo(conf.getInt(FSConstants.DFS_CLUSTER_ID,
          RequestMetaInfo.NO_CLUSTER_ID), cluster.getNameNode(0).getNameserviceId(),
          RequestMetaInfo.NO_NAMESPACE_ID, RequestMetaInfo.NO_APPLICATION_ID,
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniAvatarCluster

      Configuration conf = new Configuration();
      // Bind port automatically
      conf.setInt(StorageServiceConfigKeys.PROXY_THRIFT_PORT_KEY, 0);
      conf.setInt(StorageServiceConfigKeys.PROXY_RPC_PORT_KEY, 0);

      cluster = new MiniAvatarCluster(conf, 2, true, null, null, 1, true);

      proxyService = new ClientProxyService(new ClientProxyCommons(conf, conf.get(
          FSConstants.DFS_CLUSTER_NAME)));

      benchmark = new NNLatencyBenchmark();
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.