Example usage for org.apache.hadoop.mapred RawKeyValueIterator next

List of usage examples for org.apache.hadoop.mapred RawKeyValueIterator next

Introduction

In this page you can find the example usage for org.apache.hadoop.mapred RawKeyValueIterator next.

Prototype

boolean next() throws IOException;

Source Link

Document

Sets up the current key and value (for getKey and getValue).

Usage

From source file:org.apache.tez.mapreduce.hadoop.mapreduce.ReduceContextImpl.java

License:Apache License

public ReduceContextImpl(Configuration conf, TaskAttemptID taskid, RawKeyValueIterator input,
        Counter inputKeyCounter, Counter inputValueCounter, RecordWriter<KEYOUT, VALUEOUT> output,
        OutputCommitter committer, MRTaskReporter reporter, RawComparator<KEYIN> comparator,
        Class<KEYIN> keyClass, Class<VALUEIN> valueClass) throws InterruptedException, IOException {
    super(conf, taskid, output, committer, reporter);
    this.input = input;
    this.inputKeyCounter = inputKeyCounter;
    this.inputValueCounter = inputValueCounter;
    this.comparator = comparator;
    this.serializationFactory = new SerializationFactory(conf);
    this.keyDeserializer = serializationFactory.getDeserializer(keyClass);
    this.keyDeserializer.open(buffer);
    this.valueDeserializer = serializationFactory.getDeserializer(valueClass);
    this.valueDeserializer.open(buffer);
    hasMore = input.next();
    this.keyClass = keyClass;
    this.valueClass = valueClass;
    this.conf = conf;
    this.taskid = taskid;
}