package pl.rtshadow.lem.benchmarks.hdfs;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.hdfs.MiniDFSCluster;

import java.io.IOException;

import static com.google.common.base.Preconditions.checkState;

public class TestHdfsCluster {
  private static final int NUM_DATA_NODES = 3;
  private MiniDFSCluster miniDFSCluster;

  public void start() throws IOException {
    Configuration configuration = new Configuration();
    configuration.set("dfs.blockreport.initialDelay", "0");
    configuration.setBoolean("dfs.support.broken.append", true);
    configuration.setInt("dfs.datanode.data.dir.perm", 775);
    configuration.setInt("dfs.datanode.scan.period.hours", -1); // disable block scanner

    miniDFSCluster = new MiniDFSCluster(configuration, NUM_DATA_NODES, true, null);
    miniDFSCluster.waitActive();
  }

  public FileSystem getFileSystem() throws IOException {
    return miniDFSCluster.getFileSystem();
  }

  public void stop() {
    miniDFSCluster.shutdown();
  }
}

@@ -482,68 +482,8 @@
 ();%0A
-    configuration.set(%22dfs.blockreport.initialDelay%22, %220%22);%0A
     
@@ -607,97 +607,8 @@
 75);
-%0A    configuration.setInt(%22dfs.datanode.scan.period.hours%22, -1); // disable block scanner
 %0A%0A  

remove unnecessary properties