cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject cassandra git commit: Follow-up to CASSANDRA-9265
Date Wed, 12 Aug 2015 22:48:08 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.2 5c88651a4 -> 85d550f94


Follow-up to CASSANDRA-9265

patch by Aleksey Yeschenko


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

Branch: refs/heads/cassandra-2.2
Commit: 85d550f9460ce763acb97ad0740f6ea495f911d3
Parents: 5c88651
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Thu Aug 13 01:48:01 2015 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Thu Aug 13 01:48:07 2015 +0300

----------------------------------------------------------------------
 .../io/util/ChecksummedRandomAccessReader.java     | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/85d550f9/src/java/org/apache/cassandra/io/util/ChecksummedRandomAccessReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/util/ChecksummedRandomAccessReader.java b/src/java/org/apache/cassandra/io/util/ChecksummedRandomAccessReader.java
index 60b193a..442236d 100644
--- a/src/java/org/apache/cassandra/io/util/ChecksummedRandomAccessReader.java
+++ b/src/java/org/apache/cassandra/io/util/ChecksummedRandomAccessReader.java
@@ -15,7 +15,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.cassandra.io.util;
 
 import java.io.File;
@@ -32,7 +31,9 @@ public class ChecksummedRandomAccessReader extends RandomAccessReader
     {
         public final File file;
 
-        public CorruptFileException(Exception cause, File file) {
+        public CorruptFileException(Exception cause, File file)
+        {
+            super(cause);
             this.file = file;
         }
     }
@@ -40,7 +41,8 @@ public class ChecksummedRandomAccessReader extends RandomAccessReader
     private final DataIntegrityMetadata.ChecksumValidator validator;
     private final File file;
 
-    protected ChecksummedRandomAccessReader(File file, ChannelProxy channel, DataIntegrityMetadata.ChecksumValidator
validator) throws IOException {
+    protected ChecksummedRandomAccessReader(File file, ChannelProxy channel, DataIntegrityMetadata.ChecksumValidator
validator)
+    {
         super(channel, validator.chunkSize, -1, BufferType.ON_HEAP, null);
         this.validator = validator;
         this.file = file;
@@ -51,13 +53,14 @@ public class ChecksummedRandomAccessReader extends RandomAccessReader
         try (ChannelProxy channel = new ChannelProxy(file))
         {
             RandomAccessReader crcReader = RandomAccessReader.open(crcFile);
-            DataIntegrityMetadata.ChecksumValidator validator = new DataIntegrityMetadata.ChecksumValidator(new
Adler32(),
-                                                                                        
                   crcReader,
-                                                                                        
                   file.getPath());
+            @SuppressWarnings("resource")
+            DataIntegrityMetadata.ChecksumValidator validator =
+                new DataIntegrityMetadata.ChecksumValidator(new Adler32(), crcReader, file.getPath());
             return new ChecksummedRandomAccessReader(file, channel, validator);
         }
     }
 
+    @Override
     protected void reBuffer()
     {
         long desiredPosition = current();
@@ -89,12 +92,14 @@ public class ChecksummedRandomAccessReader extends RandomAccessReader
         buffer.position((int) (desiredPosition - bufferOffset));
     }
 
+    @Override
     public void seek(long newPosition)
     {
         validator.seek(newPosition);
         super.seek(newPosition);
     }
 
+    @Override
     public void close()
     {
         super.close();


Mime
View raw message