cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasobr...@apache.org
Subject git commit: ninja fix to add null check on CommitLogArchiver startup
Date Tue, 14 Oct 2014 13:58:36 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 d828643f5 -> cc8eeefe8


ninja fix to add null check on CommitLogArchiver startup


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

Branch: refs/heads/cassandra-2.0
Commit: cc8eeefe8895e01a2a5f387788bb3772b4dabbc9
Parents: d828643
Author: Jason Brown <jasedbrown@gmail.com>
Authored: Tue Oct 14 06:57:52 2014 -0700
Committer: Jason Brown <jasedbrown@gmail.com>
Committed: Tue Oct 14 06:57:52 2014 -0700

----------------------------------------------------------------------
 .../cassandra/db/commitlog/CommitLogArchiver.java      | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cc8eeefe/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java
index e30443e..8957643 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java
@@ -82,14 +82,17 @@ public class CommitLogArchiver
                 archiveCommand = commitlog_commands.getProperty("archive_command");
                 restoreCommand = commitlog_commands.getProperty("restore_command");
                 restoreDirectories = commitlog_commands.getProperty("restore_directories");
-                for (String dir : restoreDirectories.split(DELIMITER))
+                if (restoreDirectories != null && !restoreDirectories.isEmpty())
                 {
-                    File directory = new File(dir);
-                    if (!directory.exists())
+                    for (String dir : restoreDirectories.split(DELIMITER))
                     {
-                        if (!directory.mkdir())
+                        File directory = new File(dir);
+                        if (!directory.exists())
                         {
-                            throw new RuntimeException("Unable to create directory " + dir);
+                            if (!directory.mkdir())
+                            {
+                                throw new RuntimeException("Unable to create directory: "
+ dir);
+                            }
                         }
                     }
                 }


Mime
View raw message