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 int
chunkSize
-
Constructor Summary
Constructors Constructor Description ChecksumValidator(File dataFile, File crcFile)
ChecksumValidator(ChecksumType checksumType, RandomAccessReader reader, java.lang.String dataFilename)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
chunkStart(long offset)
void
close()
void
seek(long offset)
void
validate(byte[] bytes, int start, int end)
void
validate(java.nio.ByteBuffer buffer)
validates the checksum with the bytes from the specified buffer.
-
-
-
Constructor Detail
-
ChecksumValidator
public ChecksumValidator(File dataFile, File crcFile) 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
-
-
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.IOException
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:
java.io.IOException
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-