Package org.apache.cassandra.io.util
Class DataIntegrityMetadata.ChecksumValidator
java.lang.Object
org.apache.cassandra.io.util.DataIntegrityMetadata.ChecksumValidator
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
- DataIntegrityMetadata
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionChecksumValidator(File dataFile, File crcFile) ChecksumValidator(ChecksumType checksumType, RandomAccessReader reader, String dataFilename) -
Method Summary
Modifier and TypeMethodDescriptionlongchunkStart(long offset) voidclose()voidseek(long offset) voidvalidate(byte[] bytes, int start, int end) voidvalidate(ByteBuffer buffer) validates the checksum with the bytes from the specified buffer.
-
Field Details
-
chunkSize
public final int chunkSize
-
-
Constructor Details
-
ChecksumValidator
- Throws:
IOException
-
ChecksumValidator
public ChecksumValidator(ChecksumType checksumType, RandomAccessReader reader, String dataFilename) throws IOException - Throws:
IOException
-
-
Method Details
-
seek
public void seek(long offset) -
chunkStart
public long chunkStart(long offset) -
validate
- Throws:
IOException
-
validate
validates 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:
IOException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-