From 2523e1cce5f6d6c3762c958c7f3138ab486c8497 Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Wed, 18 Oct 2017 11:18:03 +0900 Subject: [PATCH] MAPREDUCE-6972. Enable try-with-resources for RecordReader. Contributed by Zoltan Haindrich. --- .../main/java/org/apache/hadoop/mapred/RecordReader.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/RecordReader.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/RecordReader.java index 6e2c89fd8ca..0a996dcc033 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/RecordReader.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/RecordReader.java @@ -18,6 +18,7 @@ package org.apache.hadoop.mapred; +import java.io.Closeable; import java.io.IOException; import org.apache.hadoop.classification.InterfaceAudience; @@ -38,7 +39,7 @@ import org.apache.hadoop.classification.InterfaceStability; */ @InterfaceAudience.Public @InterfaceStability.Stable -public interface RecordReader { +public interface RecordReader extends Closeable{ /** * Reads the next key/value pair from the input for processing. * @@ -74,7 +75,8 @@ public interface RecordReader { * Close this {@link InputSplit} to future operations. * * @throws IOException - */ + */ + @Override public void close() throws IOException; /**