cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1085372 - in /cassandra/branches/cassandra-0.7: CHANGES.txt src/java/org/apache/cassandra/io/sstable/SSTableWriter.java src/java/org/apache/cassandra/utils/EstimatedHistogram.java test/unit/org/apache/cassandra/io/CompactSerializerTest.java
Date Fri, 25 Mar 2011 13:59:46 GMT
Author: jbellis
Date: Fri Mar 25 13:59:45 2011
New Revision: 1085372

URL: http://svn.apache.org/viewvc?rev=1085372&view=rev
Log:
fsync statistics component on write
patch by jbellis; reviewed by brandonwilliams for CASSANDRA-2382

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/utils/EstimatedHistogram.java
    cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/io/CompactSerializerTest.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1085372&r1=1085371&r2=1085372&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Fri Mar 25 13:59:45 2011
@@ -18,6 +18,7 @@
  * fix encoding bugs in HintedHandoffManager, SystemTable when default
    charset is not UTF8 (CASSANDRA-2367)
  * allow negative numbers in the cli (CASSANDRA-2358)
+ * fsync statistics component on write (CASSANDRA-2382)
 
 
 0.7.4

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java?rev=1085372&r1=1085371&r2=1085372&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
Fri Mar 25 13:59:45 2011
@@ -198,7 +198,10 @@ public class SSTableWriter extends SSTab
 
     private static void writeStatistics(Descriptor desc, EstimatedHistogram rowSizes, EstimatedHistogram
columnnCounts) throws IOException
     {
-        DataOutputStream out = new DataOutputStream(new FileOutputStream(desc.filenameFor(SSTable.COMPONENT_STATS)));
+        BufferedRandomAccessFile out = new BufferedRandomAccessFile(new File(desc.filenameFor(SSTable.COMPONENT_STATS)),
+                                                                     "rw",
+                                                                     BufferedRandomAccessFile.DEFAULT_BUFFER_SIZE,
+                                                                     true);
         EstimatedHistogram.serializer.serialize(rowSizes, out);
         EstimatedHistogram.serializer.serialize(columnnCounts, out);
         out.close();

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/utils/EstimatedHistogram.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/utils/EstimatedHistogram.java?rev=1085372&r1=1085371&r2=1085372&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/utils/EstimatedHistogram.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/utils/EstimatedHistogram.java
Fri Mar 25 13:59:45 2011
@@ -18,13 +18,13 @@
 */
 package org.apache.cassandra.utils;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.concurrent.atomic.AtomicLongArray;
 
-import org.apache.cassandra.io.ICompactSerializer;
+import org.apache.cassandra.io.ICompactSerializer2;
 
 public class EstimatedHistogram
 {
@@ -188,9 +188,9 @@ public class EstimatedHistogram
         return buckets.get(buckets.length() - 1) > 0;
     }
 
-    public static class EstimatedHistogramSerializer implements ICompactSerializer<EstimatedHistogram>
+    public static class EstimatedHistogramSerializer implements ICompactSerializer2<EstimatedHistogram>
     {
-        public void serialize(EstimatedHistogram eh, DataOutputStream dos) throws IOException
+        public void serialize(EstimatedHistogram eh, DataOutput dos) throws IOException
         {
             long[] offsets = eh.getBucketOffsets();
             long[] buckets = eh.getBuckets(false);
@@ -202,7 +202,7 @@ public class EstimatedHistogram
             }
         }
 
-        public EstimatedHistogram deserialize(DataInputStream dis) throws IOException
+        public EstimatedHistogram deserialize(DataInput dis) throws IOException
         {
             int size = dis.readInt();
             long[] offsets = new long[size - 1];

Modified: cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/io/CompactSerializerTest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/io/CompactSerializerTest.java?rev=1085372&r1=1085371&r2=1085372&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/io/CompactSerializerTest.java
(original)
+++ cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/io/CompactSerializerTest.java
Fri Mar 25 13:59:45 2011
@@ -68,7 +68,6 @@ public class CompactSerializerTest exten
         expectedClassNames.add("FileStatusSerializer");
         expectedClassNames.add("StreamRequestMessageSerializer");
         expectedClassNames.add("BloomFilterSerializer");
-        expectedClassNames.add("EstimatedHistogramSerializer");
         expectedClassNames.add("LegacyBloomFilterSerializer");
         
         discoveredClassNames = new ArrayList<String>();



Mime
View raw message