/// <summary>Create a record reader for the given split</summary>
 /// <param name="split">file split</param>
 /// <param name="context">the task-attempt context</param>
 /// <returns>RecordReader</returns>
 /// <exception cref="System.IO.IOException"/>
 public override RecordReader <K, V> CreateRecordReader(InputSplit split, TaskAttemptContext
                                                        context)
 {
     context.SetStatus(split.ToString());
     return(new SequenceFileInputFilter.FilterRecordReader <K, V>(context.GetConfiguration
                                                                      ()));
 }
Beispiel #2
0
 /// <summary>Create a record reader for the given split</summary>
 /// <param name="split">file split</param>
 /// <param name="job">job configuration</param>
 /// <param name="reporter">reporter who sends report to task tracker</param>
 /// <returns>RecordReader</returns>
 /// <exception cref="System.IO.IOException"/>
 public override RecordReader <K, V> GetRecordReader(InputSplit split, JobConf job,
                                                     Reporter reporter)
 {
     reporter.SetStatus(split.ToString());
     return(new SequenceFileInputFilter.FilterRecordReader <K, V>(job, (FileSplit)split
                                                                  ));
 }
        /// <exception cref="System.IO.IOException"/>
        public override RecordReader <LongWritable, BytesWritable> GetRecordReader(InputSplit
                                                                                   genericSplit, JobConf job, Reporter reporter)
        {
            reporter.SetStatus(genericSplit.ToString());
            int recordLength = GetRecordLength(job);

            if (recordLength <= 0)
            {
                throw new IOException("Fixed record length " + recordLength + " is invalid.  It should be set to a value greater than zero"
                                      );
            }
            return(new FixedLengthRecordReader(job, (FileSplit)genericSplit, recordLength));
        }
Beispiel #4
0
        /// <exception cref="System.IO.IOException"/>
        public override RecordReader <LongWritable, Text> GetRecordReader(InputSplit genericSplit
                                                                          , JobConf job, Reporter reporter)
        {
            reporter.SetStatus(genericSplit.ToString());
            string delimiter = job.Get("textinputformat.record.delimiter");

            byte[] recordDelimiterBytes = null;
            if (null != delimiter)
            {
                recordDelimiterBytes = Sharpen.Runtime.GetBytesForString(delimiter, Charsets.Utf8
                                                                         );
            }
            return(new LineRecordReader(job, (FileSplit)genericSplit, recordDelimiterBytes));
        }
Beispiel #5
0
 /// <exception cref="System.IO.IOException"/>
 public override RecordReader <Text, Text> CreateRecordReader(InputSplit split, TaskAttemptContext
                                                              context)
 {
     context.SetStatus(split.ToString());
     return(new SequenceFileAsTextRecordReader());
 }
 public override string ToString()
 {
     return(inputSplit.ToString());
 }
Beispiel #7
0
 /// <exception cref="System.IO.IOException"/>
 public override RecordReader <LongWritable, Text> CreateRecordReader(InputSplit genericSplit
                                                                      , TaskAttemptContext context)
 {
     context.SetStatus(genericSplit.ToString());
     return(new LineRecordReader());
 }
 /// <exception cref="System.IO.IOException"/>
 public override RecordReader <LongWritable, Text> GetRecordReader(InputSplit genericSplit
                                                                   , JobConf job, Reporter reporter)
 {
     reporter.SetStatus(genericSplit.ToString());
     return(new LineRecordReader(job, (FileSplit)genericSplit));
 }
 /// <exception cref="System.IO.IOException"/>
 public override RecordReader <Text, Text> CreateRecordReader(InputSplit genericSplit
                                                              , TaskAttemptContext context)
 {
     context.SetStatus(genericSplit.ToString());
     return(new KeyValueLineRecordReader(context.GetConfiguration()));
 }