Package org.apache.cassandra.io.util
Class DataIntegrityMetadata.ChecksumValidator
- java.lang.Object
-
- org.apache.cassandra.io.util.DataIntegrityMetadata.ChecksumValidator
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Enclosing class:
- DataIntegrityMetadata
public static class DataIntegrityMetadata.ChecksumValidator extends java.lang.Object implements java.io.Closeable
-
-
Field Summary
Fields Modifier and Type Field Description intchunkSize
-
Constructor Summary
Constructors Modifier Constructor Description ChecksumValidator(Descriptor descriptor)protectedChecksumValidator(ChecksumType checksumType, RandomAccessReader reader, int chunkSize)ChecksumValidator(ChecksumType checksumType, RandomAccessReader reader, java.lang.String dataFilename)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longchunkStart(long offset)voidclose()voidseek(long offset)voidvalidate(byte[] bytes, int start, int end)voidvalidate(java.nio.ByteBuffer buffer)validates the checksum with the bytes from the specified buffer.
-
-
-
Constructor Detail
-
ChecksumValidator
public ChecksumValidator(Descriptor descriptor) throws java.io.IOException
- Throws:
java.io.IOException
-
ChecksumValidator
public ChecksumValidator(ChecksumType checksumType, RandomAccessReader reader, java.lang.String dataFilename) throws java.io.IOException
- Throws:
java.io.IOException
-
ChecksumValidator
protected ChecksumValidator(ChecksumType checksumType, RandomAccessReader reader, int chunkSize)
-
-
Method Detail
-
seek
public void seek(long offset)
-
chunkStart
public long chunkStart(long offset)
-
validate
public void validate(byte[] bytes, int start, int end) throws java.io.IOException- Throws:
java.io.IOException
-
validate
public void validate(java.nio.ByteBuffer buffer) throws java.io.IOExceptionvalidates the checksum with the bytes from the specified buffer. Upon return, the buffer's position will be updated to its limit; its limit will not have been changed.- Throws:
java.io.IOException
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-