tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jh...@apache.org
Subject tajo git commit: TAJO-1779: Remove "DFSInputStream has been closed already" messages in DelimitedLineReader
Date Mon, 17 Aug 2015 10:12:33 GMT
Repository: tajo
Updated Branches:
  refs/heads/branch-0.11.0 7c765e8d1 -> 9aefc9f01


TAJO-1779: Remove "DFSInputStream has been closed already" messages in DelimitedLineReader


Project: http://git-wip-us.apache.org/repos/asf/tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/9aefc9f0
Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/9aefc9f0
Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/9aefc9f0

Branch: refs/heads/branch-0.11.0
Commit: 9aefc9f01237fd1e7540a0e91086b0f460bd5057
Parents: 7c765e8
Author: Jinho Kim <jhkim@apache.org>
Authored: Mon Aug 17 19:11:10 2015 +0900
Committer: Jinho Kim <jhkim@apache.org>
Committed: Mon Aug 17 19:11:10 2015 +0900

----------------------------------------------------------------------
 CHANGES                                                      | 3 +++
 .../java/org/apache/tajo/storage/ByteBufInputChannel.java    | 2 +-
 .../java/org/apache/tajo/storage/FSDataInputChannel.java     | 6 +++++-
 .../org/apache/tajo/storage/text/DelimitedLineReader.java    | 2 +-
 .../test/java/org/apache/tajo/storage/TestLineReader.java    | 8 ++++++--
 5 files changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/9aefc9f0/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 39908e0..f6c5461 100644
--- a/CHANGES
+++ b/CHANGES
@@ -221,6 +221,9 @@ Release 0.11.0 - unreleased
 
   BUG FIXES
 
+    TAJO-1779: Remove "DFSInputStream has been closed already" messages 
+    in DelimitedLineReader. (jinho)
+
     TAJO-1763: tpch/*.tbl files cannot be founded in maven modules except for 
     core-tests. (hyunsik)
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/9aefc9f0/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/ByteBufInputChannel.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/ByteBufInputChannel.java
b/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/ByteBufInputChannel.java
index bdfec91..0c289c3 100644
--- a/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/ByteBufInputChannel.java
+++ b/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/ByteBufInputChannel.java
@@ -45,6 +45,6 @@ public class ByteBufInputChannel extends InputChannel {
 
   @Override
   protected void implCloseChannel() throws IOException {
-    IOUtils.cleanup(null, channel, inputStream);
+    IOUtils.cleanup(null, channel);
   }
 }

http://git-wip-us.apache.org/repos/asf/tajo/blob/9aefc9f0/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/FSDataInputChannel.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/FSDataInputChannel.java
b/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/FSDataInputChannel.java
index 3f638c0..605516d 100644
--- a/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/FSDataInputChannel.java
+++ b/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/FSDataInputChannel.java
@@ -74,6 +74,10 @@ public final class FSDataInputChannel extends SeekableInputChannel {
 
   @Override
   protected void implCloseChannel() throws IOException {
-    IOUtils.cleanup(null, channel, inputStream);
+    if (isDirectRead) {
+      IOUtils.cleanup(null, inputStream);
+    } else {
+      IOUtils.cleanup(null, channel);
+    }
   }
 }

http://git-wip-us.apache.org/repos/asf/tajo/blob/9aefc9f0/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/text/DelimitedLineReader.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/text/DelimitedLineReader.java
b/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/text/DelimitedLineReader.java
index 5b93c5c..6d6cf72 100644
--- a/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/text/DelimitedLineReader.java
+++ b/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/text/DelimitedLineReader.java
@@ -179,7 +179,7 @@ public class DelimitedLineReader implements Closeable {
   @Override
   public void close() throws IOException {
     try {
-      IOUtils.cleanup(LOG, lineReader, is, fis);
+      IOUtils.cleanup(LOG, lineReader);
       fs = null;
       is = null;
       fis = null;

http://git-wip-us.apache.org/repos/asf/tajo/blob/9aefc9f0/tajo-storage/tajo-storage-hdfs/src/test/java/org/apache/tajo/storage/TestLineReader.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-hdfs/src/test/java/org/apache/tajo/storage/TestLineReader.java
b/tajo-storage/tajo-storage-hdfs/src/test/java/org/apache/tajo/storage/TestLineReader.java
index 7410778..21fff58 100644
--- a/tajo-storage/tajo-storage-hdfs/src/test/java/org/apache/tajo/storage/TestLineReader.java
+++ b/tajo-storage/tajo-storage-hdfs/src/test/java/org/apache/tajo/storage/TestLineReader.java
@@ -96,7 +96,8 @@ public class TestLineReader {
       if(buf == null) break;
       i++;
     }
-    IOUtils.cleanup(null, reader, channel, fs);
+    IOUtils.cleanup(null, reader, fs);
+    assertFalse(channel.isOpen());
     assertEquals(tupleNum, i);
     assertEquals(status.getLen(), totalRead);
     assertEquals(status.getLen(), reader.readBytes());
@@ -229,6 +230,7 @@ public class TestLineReader {
       i++;
     }
     IOUtils.cleanup(null, reader);
+    assertFalse(channel.isOpen());
     assertEquals(file.length(), totalRead);
     assertEquals(file.length(), reader.readBytes());
     assertEquals(data.split("\n").length, i);
@@ -261,6 +263,7 @@ public class TestLineReader {
       i++;
     }
     IOUtils.cleanup(null, reader);
+    assertFalse(channel.isOpen());
     assertEquals(status.getLen(), totalRead);
     assertEquals(status.getLen(), reader.readBytes());
   }
@@ -319,7 +322,8 @@ public class TestLineReader {
       i++;
     }
 
-    IOUtils.cleanup(null, reader, channel, fs);
+    IOUtils.cleanup(null, reader, fs);
+    assertFalse(channel.isOpen());
 
     assertEquals(tupleNum, i);
     assertEquals(status.getLen(), totalRead);


Mime
View raw message