String srcDir = System.getenv("CHUKWA_DATA_DIR");
try {
ChukwaConfiguration conf = new ChukwaConfiguration();
FileSystem fs = FileSystem.get(conf);
FileStatus[] sources = fs.listStatus(new Path(srcDir));
MetricDataLoader mdl = new MetricDataLoader(cluster);
for (FileStatus sequenceFile : sources) {
mdl.process(sequenceFile.getPath());
}
} catch (Throwable ex) {
fail("SQL Exception: "+ExceptionUtil.getStackTrace(ex));
}
DatabaseWriter db = new DatabaseWriter(cluster);