cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1080716 - in /cassandra/branches/cassandra-0.7: ./ src/java/org/apache/cassandra/io/util/ test/unit/org/apache/cassandra/io/util/
Date Fri, 11 Mar 2011 18:32:16 GMT
Author: jbellis
Date: Fri Mar 11 18:32:16 2011
New Revision: 1080716

URL: http://svn.apache.org/viewvc?rev=1080716&view=rev
Log:
fix HH delivery when column index is larger than 2GB
patch by jbellis; reviewed by slebresne for CASSANDRA-2297

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/BufferedRandomAccessFile.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/FileDataInput.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/MappedFileDataInput.java
    cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/io/util/BufferedRandomAccessFileTest.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1080716&r1=1080715&r2=1080716&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Fri Mar 11 18:32:16 2011
@@ -23,6 +23,7 @@
  * purge tombstoned rows from cache after GCGraceSeconds (CASSANDRA-2305)
  * allow zero replicas in a NTS datacenter (CASSANDRA-1924)
  * make range queries respect snitch for local replicas (CASSANDRA-2286)
+ * fix HH delivery when column index is larger than 2GB (CASSANDRA-2297)
 
 
 0.7.3

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/BufferedRandomAccessFile.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/BufferedRandomAccessFile.java?rev=1080716&r1=1080715&r2=1080716&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/BufferedRandomAccessFile.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/BufferedRandomAccessFile.java
Fri Mar 11 18:32:16 2011
@@ -408,14 +408,11 @@ public class BufferedRandomAccessFile ex
         seek(markedPointer);
     }
 
-    public int bytesPastMark()
+    public long bytesPastMark()
     {
         long bytes = getFilePointer() - markedPointer;
-
         assert bytes >= 0;
-        if (bytes > Integer.MAX_VALUE)
-            throw new UnsupportedOperationException("Overflow: " + bytes);
-        return (int) bytes;
+        return bytes;
     }
 
     public FileMark mark()
@@ -430,15 +427,12 @@ public class BufferedRandomAccessFile ex
         seek(((BufferedRandomAccessFileMark) mark).pointer);
     }
 
-    public int bytesPastMark(FileMark mark)
+    public long bytesPastMark(FileMark mark)
     {
         assert mark instanceof BufferedRandomAccessFileMark;
         long bytes = getFilePointer() - ((BufferedRandomAccessFileMark) mark).pointer;
-
         assert bytes >= 0;
-        if (bytes > Integer.MAX_VALUE)
-            throw new UnsupportedOperationException("Overflow: " + bytes);
-        return (int) bytes;
+        return bytes;
     }
 
     public static BufferedRandomAccessFile getUncachingReader(String filename) throws IOException

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/FileDataInput.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/FileDataInput.java?rev=1080716&r1=1080715&r2=1080716&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/FileDataInput.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/FileDataInput.java
Fri Mar 11 18:32:16 2011
@@ -38,7 +38,7 @@ public interface FileDataInput extends D
 
     public void reset(FileMark mark) throws IOException;
 
-    public int bytesPastMark(FileMark mark);
+    public long bytesPastMark(FileMark mark);
 
     /**
      * Read length bytes from current file position

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/MappedFileDataInput.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/MappedFileDataInput.java?rev=1080716&r1=1080715&r2=1080716&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/MappedFileDataInput.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/MappedFileDataInput.java
Fri Mar 11 18:32:16 2011
@@ -76,7 +76,7 @@ public class MappedFileDataInput extends
         return new MappedFileDataInputMark(position);
     }
 
-    public int bytesPastMark(FileMark mark)
+    public long bytesPastMark(FileMark mark)
     {
         assert mark instanceof MappedFileDataInputMark;
         assert position >= ((MappedFileDataInputMark) mark).position;

Modified: cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/io/util/BufferedRandomAccessFileTest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/io/util/BufferedRandomAccessFileTest.java?rev=1080716&r1=1080715&r2=1080716&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/io/util/BufferedRandomAccessFileTest.java
(original)
+++ cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/io/util/BufferedRandomAccessFileTest.java
Fri Mar 11 18:32:16 2011
@@ -425,18 +425,6 @@ public class BufferedRandomAccessFileTes
 
         // Expect this call to succeed.
         rw.bytesPastMark(mark);
-
-        // Seek 4gb
-        rw.seek(4L*1024L*1024L*1024L*1024L);
-
-        // Expect this call to fail -- the distance from mark to current file pointer >
2gb.
-        expectException(new Callable<Object>()
-        {
-            public Object call() throws IOException
-            {
-                return rw.bytesPastMark(mark);
-            }
-        }, UnsupportedOperationException.class);
     }
 
     @Test



Mime
View raw message