20,808
社区成员
发帖
与我相关
我的任务
分享
int result = job.waitForCompletion(true) ? 0 : 1;
System.out.println(new String[] { outputPath });
DistributedLzoIndexer.main(new String[] { outputPath });
System.exit(result);
return 0;
14/11/08 15:44:48 INFO lzo.DistributedLzoIndexer: Adding LZO file hdfs://hdpnn:9000/group/dataproducts/zhubao/resys/proj/resys_log_2_test_temp/step_0_merge_data/part-r-00499.lzo to indexing list (no index currently exists)
CONSOLE# 14/11/08 15:44:49 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Applications should implement Tool for the same.
CONSOLE# 14/11/08 15:45:01 INFO input.FileInputFormat: Total input paths to process : 500
CONSOLE# 14/11/08 15:45:01 INFO mapred.JobClient: Running job: job_201401091245_100017381
CONSOLE# 14/11/08 15:45:03 INFO mapred.JobClient: map 0% reduce 0%
CONSOLE# 14/11/08 15:45:28 INFO mapred.JobClient: Task Id : attempt_201401091245_100017381_m_000209_0, Status : FAILED
CONSOLE# java.lang.NullPointerException
CONSOLE# at com.hadoop.mapreduce.LzoSplitRecordReader.initialize(LzoSplitRecordReader.java:49)
CONSOLE# at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.initialize(MapTask.java:464)
CONSOLE# at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:669)
CONSOLE# at org.apache.hadoop.mapred.MapTask.run(MapTask.java:322)
CONSOLE# at org.apache.hadoop.mapred.Child.main(Child.java:165)
CONSOLE#
CONSOLE# 14/11/08 15:45:28 INFO mapred.JobClient: Task Id : attempt_201401091245_100017381_m_000387_0, Status : FAILED
CONSOLE# java.lang.NullPointerException
CONSOLE# at com.hadoop.mapreduce.LzoSplitRecordReader.initialize(LzoSplitRecordReader.java:49)
CONSOLE# at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.initialize(MapTask.java:464)
CONSOLE# at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:669)
CONSOLE# at org.apache.hadoop.mapred.MapTask.run(MapTask.java:322)
CONSOLE# at org.apache.hadoop.mapred.Child.main(Child.java:165)
public void initialize(InputSplit genericSplit, TaskAttemptContext taskAttemptContext) throws IOException {
context = taskAttemptContext;
FileSplit fileSplit = (FileSplit)genericSplit;
lzoFile = fileSplit.getPath();
// The LzoSplitInputFormat is not splittable, so the split length is the whole file.
totalFileSize = fileSplit.getLength();
// Jump through some hoops to create the lzo codec.
Configuration conf = context.getConfiguration();
CompressionCodecFactory factory = new CompressionCodecFactory(conf);
CompressionCodec codec = factory.getCodec(lzoFile);
((Configurable)codec).setConf(conf);
LzopDecompressor lzopDecompressor = (LzopDecompressor)codec.createDecompressor();
FileSystem fs = lzoFile.getFileSystem(conf);
rawInputStream = fs.open(lzoFile);
// Creating the LzopInputStream here just reads the lzo header for us, nothing more.
// We do the rest of our input off of the raw stream is.
codec.createInputStream(rawInputStream, lzopDecompressor);
// This must be called AFTER createInputStream is called, because createInputStream
// is what reads the header, which has the checksum information. Otherwise getChecksumsCount
// erroneously returns zero, and all block offsets will be wrong.
numChecksums = lzopDecompressor.getChecksumsCount();
}
int result = job.waitForCompletion(true) ? 0 : 1;
DistributedLzoIndexer lzoIndexer = new DistributedLzoIndexer();
Configuration indexConf = new Configuration();
indexConf.set("io.compression.codecs",
"com.hadoop.compression.lzo.LzopCodec");
lzoIndexer.setConf(indexConf);
lzoIndexer.run(new String[] { outputPath });
System.exit(result);
return 0;