flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hshreedha...@apache.org
Subject git commit: FLUME-1664. Logutils.getLogs remove unneeded directory check.
Date Fri, 26 Oct 2012 03:33:20 GMT
Updated Branches:
  refs/heads/trunk 8f6d1a1df -> af34b7bf3


FLUME-1664. Logutils.getLogs remove unneeded directory check.

(Brock Noland via Hari Shreedharan)


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

Branch: refs/heads/trunk
Commit: af34b7bf308779640b60a3508d9fb667f19c751c
Parents: 8f6d1a1
Author: Hari Shreedharan <hshreedharan@apache.org>
Authored: Thu Oct 25 23:26:44 2012 -0400
Committer: Hari Shreedharan <hshreedharan@apache.org>
Committed: Thu Oct 25 23:26:44 2012 -0400

----------------------------------------------------------------------
 .../org/apache/flume/channel/file/LogUtils.java    |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/af34b7bf/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/LogUtils.java
----------------------------------------------------------------------
diff --git a/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/LogUtils.java
b/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/LogUtils.java
index 4f5d3cc..d1498c2 100644
--- a/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/LogUtils.java
+++ b/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/LogUtils.java
@@ -65,14 +65,11 @@ public class LogUtils {
     List<File> result = Lists.newArrayList();
     File[] files = logDir.listFiles();
     if(files == null) {
-      if(!logDir.isDirectory()) {
-        String msg = "Path " + logDir + " is not a directory: ";
-        msg += "File = " + logDir.isFile() + ", ";
-        msg += "Exists = " + logDir.exists() + ", ";
-        msg += "Writable = " + logDir.canWrite();
-        throw new IllegalStateException(msg);
-      }
-      return result;
+      String msg = logDir + ".listFiles() returned null: ";
+      msg += "File = " + logDir.isFile() + ", ";
+      msg += "Exists = " + logDir.exists() + ", ";
+      msg += "Writable = " + logDir.canWrite();
+      throw new IllegalStateException(msg);
     }
     for (File file : files) {
       String name = file.getName();


Mime
View raw message