示例#1
0
 /// <summary>
 /// Set up federated cluster with the given number of nameservices, each
 /// of which has two NameNodes.
 /// </summary>
 public static Org.Apache.Hadoop.Hdfs.MiniDFSNNTopology SimpleHAFederatedTopology(
     int numNameservices)
 {
     Org.Apache.Hadoop.Hdfs.MiniDFSNNTopology topology = new Org.Apache.Hadoop.Hdfs.MiniDFSNNTopology
                                                             ();
     for (int i = 0; i < numNameservices; i++)
     {
         topology.AddNameservice(new MiniDFSNNTopology.NSConf("ns" + i).AddNN(new MiniDFSNNTopology.NNConf
                                                                                  ("nn0")).AddNN(new MiniDFSNNTopology.NNConf("nn1")));
     }
     topology.SetFederation(true);
     return(topology);
 }
示例#2
0
 /// <summary>
 /// Set up federated cluster with the given nameservices, each
 /// of which has only a single NameNode.
 /// </summary>
 public static Org.Apache.Hadoop.Hdfs.MiniDFSNNTopology SimpleFederatedTopology(string
                                                                                nameservicesIds)
 {
     Org.Apache.Hadoop.Hdfs.MiniDFSNNTopology topology = new Org.Apache.Hadoop.Hdfs.MiniDFSNNTopology
                                                             ();
     string[] nsIds = nameservicesIds.Split(",");
     foreach (string nsId in nsIds)
     {
         topology.AddNameservice(new MiniDFSNNTopology.NSConf(nsId).AddNN(new MiniDFSNNTopology.NNConf
                                                                              (null)));
     }
     topology.SetFederation(true);
     return(topology);
 }