ml.shifu.guagua.io
接口 GuaguaRecordReader<KEY extends Bytable,VALUE extends Bytable>

类型参数:
KEY - key type for each record
VALUE - value type for each record

public interface GuaguaRecordReader<KEY extends Bytable,VALUE extends Bytable>

GuaguaRecordReader is used for consistent interface to iterate data through FileSplit provided. The typical implementation is HDFS implementation in guagua-mapreduce.

To use it, one should set implementation in AbstractWorkerComputable.


方法摘要
 void close()
          Close resources at last, for example file descriptors.
 KEY getCurrentKey()
          Tmp we only support LongWritable key for byte offset in each line, follow LineRecordReader in hadoop.
 VALUE getCurrentValue()
          Tmp we only support Text value for whole content in each line, follow LineRecordReader in hadoop.
 void initialize(GuaguaFileSplit genericSplit)
          Initialize file split for user to create relative reader instance.
 boolean nextKeyValue()
          Cursor shift to next and set current key value.
 

方法详细信息

initialize

void initialize(GuaguaFileSplit genericSplit)
                throws IOException
Initialize file split for user to create relative reader instance.

抛出:
IOException

nextKeyValue

boolean nextKeyValue()
                     throws IOException
Cursor shift to next and set current key value.

抛出:
IOException

getCurrentKey

KEY getCurrentKey()
Tmp we only support LongWritable key for byte offset in each line, follow LineRecordReader in hadoop.


getCurrentValue

VALUE getCurrentValue()
Tmp we only support Text value for whole content in each line, follow LineRecordReader in hadoop.


close

void close()
           throws IOException
Close resources at last, for example file descriptors. Should be called in finally segment.

抛出:
IOException


Copyright © 2014. All Rights Reserved.