@Test public void testHdfs() throws Exception { Configuration conf = HadoopConfigurationBuilder.buildHdfsConfiguration( clusterSpec, cluster, defaults, Sets.newLinkedHashSet(Lists.newArrayList("/data0", "/data1"))); assertThat(Iterators.size(conf.getKeys()), is(4)); assertThat(conf.getString("p1"), is("hdfs1")); assertThat(conf.getString("dfs.data.dir"), is("/data0/hadoop/hdfs/data,/data1/hadoop/hdfs/data")); }
@VisibleForTesting static Configuration buildHdfsConfiguration(ClusterSpec clusterSpec, Cluster cluster, Configuration defaults, Set<String> dataDirectories) throws ConfigurationException { Configuration config = build(clusterSpec, cluster, defaults, "hadoop-hdfs"); setIfAbsent(config, "dfs.data.dir", appendToDataDirectories(dataDirectories, "/hadoop/hdfs/data")); setIfAbsent(config, "dfs.name.dir", appendToDataDirectories(dataDirectories, "/hadoop/hdfs/name")); setIfAbsent(config, "fs.checkpoint.dir", appendToDataDirectories(dataDirectories, "/hadoop/hdfs/secondary")); return config; }
HadoopConfigurationBuilder { @VisibleForTesting static Configuration buildHdfsConfiguration(ClusterSpec clusterSpec, Cluster cluster, Configuration defaults, Set<String> dataDirectories) throws ConfigurationException { Configuration config = build(clusterSpec, cluster, defaults, "hadoop-hdfs"); setIfAbsent(config, "dfs.data.dir", appendToDataDirectories(dataDirectories, "/hadoop/hdfs/data")); setIfAbsent(config, "dfs.name.dir", appendToDataDirectories(dataDirectories, "/hadoop/hdfs/name")); setIfAbsent(config, "fs.checkpoint.dir", appendToDataDirectories(dataDirectories, "/hadoop/hdfs/secondary")); return config; } }
HadoopConfigurationBuilder { @VisibleForTesting static Configuration buildHdfsConfiguration(ClusterSpec clusterSpec, Cluster cluster, Configuration defaults, Set<String> dataDirectories) throws ConfigurationException { Configuration config = build(clusterSpec, cluster, defaults, "hadoop-hdfs"); setIfAbsent(config, "dfs.data.dir", appendToDataDirectories(dataDirectories, "/hadoop/hdfs/data")); setIfAbsent(config, "dfs.name.dir", appendToDataDirectories(dataDirectories, "/hadoop/hdfs/name")); setIfAbsent(config, "fs.checkpoint.dir", appendToDataDirectories(dataDirectories, "/hadoop/hdfs/secondary")); return config; }  }
HadoopConfigurationBuilder { @VisibleForTesting static Configuration buildHdfsConfiguration(ClusterSpec clusterSpec, Cluster cluster, Configuration defaults, Set<String> dataDirectories) throws ConfigurationException { Configuration config = build(clusterSpec, cluster, defaults, "hadoop-hdfs"); setIfAbsent(config, "dfs.data.dir", appendToDataDirectories(dataDirectories, "/hadoop/hdfs/data")); setIfAbsent(config, "dfs.name.dir", appendToDataDirectories(dataDirectories, "/hadoop/hdfs/name")); setIfAbsent(config, "fs.checkpoint.dir", appendToDataDirectories(dataDirectories, "/hadoop/hdfs/secondary")); return config; }  static Statement buildCommon(String path, ClusterSpec clusterSpec,
      Cluster cluster); static Statement buildHdfs(String path, ClusterSpec clusterSpec,
      Cluster cluster, Set<String> dataDirectories); static Statement buildMapReduce(String path, ClusterSpec clusterSpec,
      Cluster cluster, Set<String> dataDirectories); static Statement buildHadoopEnv(String path, ClusterSpec clusterSpec,
      Cluster cluster); }
HadoopConfigurationBuilder { @VisibleForTesting static Configuration buildHdfsConfiguration(ClusterSpec clusterSpec, Cluster cluster, Configuration defaults, Set<String> dataDirectories) throws ConfigurationException { Configuration config = build(clusterSpec, cluster, defaults, "hadoop-hdfs"); setIfAbsent(config, "dfs.data.dir", appendToDataDirectories(dataDirectories, "/hadoop/hdfs/data")); setIfAbsent(config, "dfs.name.dir", appendToDataDirectories(dataDirectories, "/hadoop/hdfs/name")); setIfAbsent(config, "fs.checkpoint.dir", appendToDataDirectories(dataDirectories, "/hadoop/hdfs/secondary")); return config; }  static Statement buildCommon(String path, ClusterSpec clusterSpec,
      Cluster cluster); static Statement buildHdfs(String path, ClusterSpec clusterSpec,
      Cluster cluster, Set<String> dataDirectories); static Statement buildMapReduce(String path, ClusterSpec clusterSpec,
      Cluster cluster, Set<String> dataDirectories); static Statement buildHadoopEnv(String path, ClusterSpec clusterSpec,
      Cluster cluster);  }