MAPREDUCE-6972. Enable try-with-resources for RecordReader. Contributed by Zoltan Haindrich.

This commit is contained in:
Akira Ajisaka 2017-10-18 11:18:03 +09:00
parent 86ee0c5e4e
commit 2523e1cce5
No known key found for this signature in database
GPG Key ID: C1EDBB9CA400FD50
1 changed files with 4 additions and 2 deletions

View File

@ -18,6 +18,7 @@
package org.apache.hadoop.mapred; package org.apache.hadoop.mapred;
import java.io.Closeable;
import java.io.IOException; import java.io.IOException;
import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceAudience;
@ -38,7 +39,7 @@ import org.apache.hadoop.classification.InterfaceStability;
*/ */
@InterfaceAudience.Public @InterfaceAudience.Public
@InterfaceStability.Stable @InterfaceStability.Stable
public interface RecordReader<K, V> { public interface RecordReader<K, V> extends Closeable{
/** /**
* Reads the next key/value pair from the input for processing. * Reads the next key/value pair from the input for processing.
* *
@ -75,6 +76,7 @@ public interface RecordReader<K, V> {
* *
* @throws IOException * @throws IOException
*/ */
@Override
public void close() throws IOException; public void close() throws IOException;
/** /**