File inputFile = new File(args[0]);
Path outputFile = new Path(args[1]);
String clusterName = "testClusterName";
String dataType = "testDataType";
String streamName = "testStreamName";
MapProcessor processor = new TsProcessor();
Path confFile = null;
if (args.length > 2) clusterName = args[2];
if (args.length > 3) dataType = args[3];
if (args.length > 4) streamName = args[4];
if (args.length > 5) {
Class clazz = null;
try {
clazz = Class.forName(args[5]);
}
catch (ClassNotFoundException e) {
try {
clazz = Class.forName(
"org.apache.hadoop.chukwa.extraction.demux.processor.mapper." + args[5]);
}
catch (Exception e2) {
throw e;
}
}
processor = (MapProcessor)clazz.newInstance();
}
if (args.length > 6) {
confFile = new Path(args[6]);
Demux.jobConf = new JobConf(confFile);
}
System.out.println("Creating sequence file using the following input:");
System.out.println("inputFile : " + inputFile);
System.out.println("outputFile : " + outputFile);
System.out.println("clusterName: " + clusterName);
System.out.println("dataType : " + dataType);
System.out.println("streamName : " + streamName);
System.out.println("processor : " + processor.getClass().getName());
System.out.println("confFile : " + confFile);
makeTestSequenceFile(inputFile, outputFile, clusterName, dataType, streamName, processor);
System.out.println("Done");