cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [3/5] cassandra git commit: Correctly identify 2i datadir from older versions
Date Fri, 10 Apr 2015 03:16:12 GMT
Correctly identify 2i datadir from older versions

patch by Sam Tunnicliffe; reviewed by yukim for CASSANDRA-9116


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

Branch: refs/heads/trunk
Commit: 7323f51e8e1bebc1abeb96141f350721033e4c96
Parents: 28865c2
Author: Sam Tunnicliffe <sam@beobal.com>
Authored: Tue Apr 7 16:48:56 2015 +0100
Committer: Yuki Morishita <yukim@apache.org>
Committed: Thu Apr 9 22:00:42 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                                       | 1 +
 src/java/org/apache/cassandra/db/Directories.java | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7323f51e/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 41118b5..5427ce5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -72,6 +72,7 @@
  * Fix Adler32 digest for compressed sstables (CASSANDRA-8778)
  * Add nodetool statushandoff/statusbackup (CASSANDRA-8912)
  * Use stdout for progress and stats in sstableloader (CASSANDRA-8982)
+ * Correctly identify 2i datadir from older versions (CASSANDRA-9116)
 Merged from 2.0:
  * Flush system.IndexInfo after marking index built (CASSANDRA-9128)
  * Fix updates to min/max_compaction_threshold through cassandra-cli

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7323f51e/src/java/org/apache/cassandra/db/Directories.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/Directories.java b/src/java/org/apache/cassandra/db/Directories.java
index 7bb7e2e..2e0b60c 100644
--- a/src/java/org/apache/cassandra/db/Directories.java
+++ b/src/java/org/apache/cassandra/db/Directories.java
@@ -194,7 +194,9 @@ public class Directories
         for (int i = 0; i < dataDirectories.length; ++i)
         {
             // check if old SSTable directory exists
-            dataPaths[i] = new File(dataDirectories[i].location, join(metadata.ksName, metadata.cfName));
+            dataPaths[i] = new File(dataDirectories[i].location,
+                                    join(metadata.ksName,
+                                         idx > 0 ? metadata.cfName.substring(0, idx) :
metadata.cfName));
         }
         boolean olderDirectoryExists = Iterables.any(Arrays.asList(dataPaths), new Predicate<File>()
         {


Mime
View raw message