Updated Branches:
  refs/heads/trunk 047106291 -> 5fd586424

test-failure-fix-SSTableReader loadNewSSTable


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

Branch: refs/heads/trunk
Commit: 5fd5864249707e2a88bf27641d40ed675c8c9e14
Parents: 0471062
Author: Vijay Parthasarathy <vijay2...@gmail.com>
Authored: Fri Apr 27 14:16:41 2012 -0700
Committer: Vijay Parthasarathy <vijay2...@gmail.com>
Committed: Fri Apr 27 14:16:41 2012 -0700

----------------------------------------------------------------------
 .../apache/cassandra/io/sstable/SSTableWriter.java |    3 ++-
 .../org/apache/cassandra/utils/FBUtilities.java    |    5 +++++
 2 files changed, 7 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5fd58642/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java 
b/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
index 1a225e4..d505151 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
@@ -349,10 +349,11 @@ public class SSTableWriter extends SSTable
         try
         {
             // do -Data last because -Data present should mean the sstable was 
completely renamed before crash
-            // don't rename -Summary component as it is not created yet and 
created when SSTable is loaded.
             for (Component component : Sets.difference(components, 
Sets.newHashSet(Component.DATA, Component.SUMMARY)))
                 FBUtilities.renameWithConfirm(tmpdesc.filenameFor(component), 
newdesc.filenameFor(component));
             FBUtilities.renameWithConfirm(tmpdesc.filenameFor(Component.DATA), 
newdesc.filenameFor(Component.DATA));
+            // rename it without confirmation because summary can be available 
for loadNewSSTables but not for closeAndOpenReader
+            
FBUtilities.renameWithOutConfirm(tmpdesc.filenameFor(Component.SUMMARY), 
newdesc.filenameFor(Component.SUMMARY));
         }
         catch (IOException e)
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5fd58642/src/java/org/apache/cassandra/utils/FBUtilities.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/FBUtilities.java 
b/src/java/org/apache/cassandra/utils/FBUtilities.java
index 16eda56..ac55d08 100644
--- a/src/java/org/apache/cassandra/utils/FBUtilities.java
+++ b/src/java/org/apache/cassandra/utils/FBUtilities.java
@@ -236,6 +236,11 @@ public class FBUtilities
         }
     }
 
+    public static void renameWithOutConfirm(String tmpFilename, String 
filename) throws IOException
+    {
+        new File(tmpFilename).renameTo(new File(filename));
+    }
+
     public static void serialize(TSerializer serializer, TBase struct, 
DataOutput out)
     throws IOException
     {

Reply via email to