cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r819126 - in /incubator/cassandra/trunk/src/java/org/apache/cassandra/io: IndexHelper.java IteratingRow.java
Date Sat, 26 Sep 2009 12:54:18 GMT
Author: jbellis
Date: Sat Sep 26 12:54:17 2009
New Revision: 819126

URL: http://svn.apache.org/viewvc?rev=819126&view=rev
Log:
r/m unused byte-tracking code
patch by jbellis; tested for CASSANDRA-458 by Teodor Sigaev

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/io/IndexHelper.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/io/IteratingRow.java

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/io/IndexHelper.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/io/IndexHelper.java?rev=819126&r1=819125&r2=819126&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/io/IndexHelper.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/io/IndexHelper.java Sat Sep 26
12:54:17 2009
@@ -35,57 +35,33 @@
 {
 
     /**
-     * Skip the bloom filter and the index and return the bytes read.
-     * @param in the data input from which the bloom filter and index 
-     *           should be skipped
-     * @return number of bytes read.
+     * Skip the bloom filter
+     * @param in the data input from which the bloom filter should be skipped
      * @throws IOException
      */
-    public static int skipBloomFilterAndIndex(DataInput in) throws IOException
+    public static void skipBloomFilter(DataInput in) throws IOException
     {
-        return skipBloomFilter(in) + skipIndex(in);
-    }
-    
-    /**
-     * Skip the bloom filter and return the bytes read.
-     * @param in the data input from which the bloom filter 
-     *           should be skipped
-     * @return number of bytes read.
-     * @throws IOException
-     */
-    public static int skipBloomFilter(DataInput in) throws IOException
-    {
-        int totalBytesRead = 0;
         /* size of the bloom filter */
         int size = in.readInt();
-        totalBytesRead += 4;
         /* skip the serialized bloom filter */
         in.skipBytes(size);
-        totalBytesRead += size;
-        return totalBytesRead;
     }
 
 	/**
-	 * Skip the index and return the number of bytes read.
+	 * Skip the index
 	 * @param file the data input from which the index should be skipped
-	 * @return number of bytes read from the data input
 	 * @throws IOException
 	 */
-	private static int skipIndex(DataInput file) throws IOException
+	public static void skipIndex(DataInput file) throws IOException
 	{
         /* read only the column index list */
         int columnIndexSize = file.readInt();
-        int totalBytesRead = 4;
-
         /* skip the column index data */
         file.skipBytes(columnIndexSize);
-        totalBytesRead += columnIndexSize;
-
-        return totalBytesRead;
 	}
     
     /**
-     * Deserialize the index into a structure and return the number of bytes read.
+     * Deserialize the index into a structure and return it
      * @throws IOException
      */
 	public static ArrayList<IndexInfo> deserializeIndex(RandomAccessFile in) throws IOException
@@ -176,5 +152,4 @@
             return new IndexInfo(ColumnSerializer.readName(dis), ColumnSerializer.readName(dis),
dis.readLong(), dis.readLong());
         }
     }
-
 }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/io/IteratingRow.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/io/IteratingRow.java?rev=819126&r1=819125&r2=819126&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/io/IteratingRow.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/io/IteratingRow.java Sat Sep 26
12:54:17 2009
@@ -21,15 +21,10 @@
  */
 
 
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.DataOutputStream;
-import java.io.DataOutput;
+import java.io.*;
 
 import org.apache.cassandra.db.ColumnFamily;
 import org.apache.cassandra.db.IColumn;
-import org.apache.cassandra.db.marshal.AbstractType;
-import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.service.StorageService;
 import com.google.common.collect.AbstractIterator;
 
@@ -70,7 +65,8 @@
     public ColumnFamily getColumnFamily() throws IOException
     {
         file.seek(dataStart);
-        IndexHelper.skipBloomFilterAndIndex(file);
+        IndexHelper.skipBloomFilter(file);
+        IndexHelper.skipIndex(file);
         return ColumnFamily.serializer().deserializeFromSSTable(sstable, file);
     }
 



Mime
View raw message