Examples of MiniDFSNNTopology


Examples of org.apache.hadoop.hdfs.MiniDFSNNTopology

    // Roll every 1s
    conf.setInt(DFSConfigKeys.DFS_HA_LOGROLL_PERIOD_KEY, 1);
    conf.setInt(DFSConfigKeys.DFS_HA_TAILEDITS_PERIOD_KEY, 1);
   
    // Have to specify IPC ports so the NNs can talk to each other.
    MiniDFSNNTopology topology = new MiniDFSNNTopology()
      .addNameservice(new MiniDFSNNTopology.NSConf("ns1")
        .addNN(new MiniDFSNNTopology.NNConf("nn1").setIpcPort(10031))
        .addNN(new MiniDFSNNTopology.NNConf("nn2").setIpcPort(10032)));

    MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf)
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSNNTopology

  @Test
  public void testHaFsck() throws Exception {
    Configuration conf = new Configuration();
   
    // need some HTTP ports
    MiniDFSNNTopology topology = new MiniDFSNNTopology()
      .addNameservice(new MiniDFSNNTopology.NSConf("ha-nn-uri-0")
        .addNN(new MiniDFSNNTopology.NNConf("nn1").setHttpPort(10051))
        .addNN(new MiniDFSNNTopology.NNConf("nn2").setHttpPort(10052)));
   
    MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf)
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSNNTopology

    conf.setInt(DFSConfigKeys.DFS_NAMENODE_NUM_CHECKPOINTS_RETAINED_KEY, 10);
    conf.setInt(DFSConfigKeys.DFS_HA_TAILEDITS_PERIOD_KEY, 1);
    HAUtil.setAllowStandbyReads(conf, true);
   
    if (clusterType == TestType.SHARED_DIR_HA) {
      MiniDFSNNTopology topology = MiniQJMHACluster.createDefaultTopology();
      cluster = new MiniDFSCluster.Builder(conf)
        .nnTopology(topology)
        .numDataNodes(0)
        .checkExitOnShutdown(false)
        .build();
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSNNTopology

 
  @Before
  public void setupCluster() throws IOException {
    Configuration conf = new Configuration();

    MiniDFSNNTopology topology = new MiniDFSNNTopology()
      .addNameservice(new MiniDFSNNTopology.NSConf("ns1")
        .addNN(new MiniDFSNNTopology.NNConf("nn1").setHttpPort(20001))
        .addNN(new MiniDFSNNTopology.NNConf("nn2").setHttpPort(20002)));
   
    cluster = new MiniDFSCluster.Builder(conf)
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSNNTopology

  public void testRefreshNamenodes() throws IOException {
    // Start cluster with a single NN and DN
    Configuration conf = new Configuration();
    MiniDFSCluster cluster = null;
    try {
      MiniDFSNNTopology topology = new MiniDFSNNTopology()
        .addNameservice(new NSConf("ns1").addNN(
            new NNConf(null).setIpcPort(nnPort1)))
        .setFederation(true);
      cluster = new MiniDFSCluster.Builder(conf)
        .nnTopology(topology)
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSNNTopology

    conf.setBoolean(DFSConfigKeys.DFS_IMAGE_COMPRESS_KEY, true);
    conf.set(DFSConfigKeys.DFS_IMAGE_COMPRESSION_CODEC_KEY, SlowCodec.class
        .getCanonicalName());
    CompressionCodecFactory.setCodecClasses(conf, ImmutableList
        .<Class> of(SlowCodec.class));
    MiniDFSNNTopology topology = new MiniDFSNNTopology()
      .addNameservice(new MiniDFSNNTopology.NSConf("ns1")
        .addNN(new MiniDFSNNTopology.NNConf("nn1").setHttpPort(10001))
        .addNN(new MiniDFSNNTopology.NNConf("nn2").setHttpPort(10002)));

    cluster = new MiniDFSCluster.Builder(conf)
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSNNTopology

    try {
      Configuration conf = new Configuration();
      HAUtil.setAllowStandbyReads(conf, true);
      conf.setInt(DFSConfigKeys.DFS_HA_TAILEDITS_PERIOD_KEY, 1);

      MiniDFSNNTopology topology = MiniDFSNNTopology.simpleHATopology();
      cluster = new MiniDFSCluster.Builder(conf).nnTopology(topology)
          .numDataNodes(0).build();
      cluster.waitActive();
      // Shutdown and clear the current filebased shared dir.
      cluster.shutdownNameNodes();
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSNNTopology

      this.startOpt = startOpt;
    }
  }
 
  public static MiniDFSNNTopology createDefaultTopology() {
    return new MiniDFSNNTopology()
      .addNameservice(new MiniDFSNNTopology.NSConf(NAMESERVICE).addNN(
        new MiniDFSNNTopology.NNConf("nn1").setIpcPort(NN1_IPC_PORT)
            .setHttpPort(NN1_INFO_PORT)).addNN(
        new MiniDFSNNTopology.NNConf("nn2").setIpcPort(NN2_IPC_PORT)
            .setHttpPort(NN2_INFO_PORT)));
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSNNTopology

    journalCluster = new MiniJournalCluster.Builder(conf).format(true)
        .build();
    URI journalURI = journalCluster.getQuorumJournalURI(NAMESERVICE);
   
    // start cluster with 2 NameNodes
    MiniDFSNNTopology topology = createDefaultTopology();
   
    initHAConf(journalURI, builder.conf);
   
    // First start up the NNs just to format the namespace. The MinIDFSCluster
    // has no way to just format the NameNodes without also starting them.
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSNNTopology

  public void testRefreshNamenodes() throws IOException {
    // Start cluster with a single NN and DN
    Configuration conf = new Configuration();
    MiniDFSCluster cluster = null;
    try {
      MiniDFSNNTopology topology = new MiniDFSNNTopology()
        .addNameservice(new NSConf("ns1").addNN(
            new NNConf(null).setIpcPort(nnPort1)))
        .setFederation(true);
      cluster = new MiniDFSCluster.Builder(conf)
        .nnTopology(topology)
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.