Package org.apache.hadoop.fs.store
Class EtagChecksum
java.lang.Object
org.apache.hadoop.fs.FileChecksum
org.apache.hadoop.fs.store.EtagChecksum
- All Implemented Interfaces:
Writable
An etag as a checksum.
Consider these suitable for checking if an object has changed, but
not suitable for comparing two different objects for equivalence,
especially between object stores.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate with an empty etag.EtagChecksum(String eTag) Create with a string etag. -
Method Summary
Modifier and TypeMethodDescriptionThe checksum algorithm name.byte[]getBytes()The value of the checksum in bytes.intThe length of the checksum in bytes.voidreadFields(DataInput in) Deserialize the fields of this object fromin.toString()voidwrite(DataOutput out) Serialize the fields of this object toout.Methods inherited from class org.apache.hadoop.fs.FileChecksum
equals, getChecksumOpt, hashCode
-
Constructor Details
-
EtagChecksum
public EtagChecksum()Create with an empty etag. -
EtagChecksum
Create with a string etag.- Parameters:
eTag- etag
-
-
Method Details
-
getAlgorithmName
Description copied from class:FileChecksumThe checksum algorithm name.- Specified by:
getAlgorithmNamein classFileChecksum- Returns:
- algorithm name.
-
getLength
public int getLength()Description copied from class:FileChecksumThe length of the checksum in bytes.- Specified by:
getLengthin classFileChecksum- Returns:
- length.
-
getBytes
public byte[] getBytes()Description copied from class:FileChecksumThe value of the checksum in bytes.- Specified by:
getBytesin classFileChecksum- Returns:
- byte array.
-
write
Description copied from interface:WritableSerialize the fields of this object toout.- Parameters:
out-DataOuputto serialize this object into.- Throws:
IOException- any other problem for write.
-
readFields
Description copied from interface:WritableDeserialize the fields of this object fromin.For efficiency, implementations should attempt to re-use storage in the existing object where possible.
- Parameters:
in-DataInputto deseriablize this object from.- Throws:
IOException- any other problem for readFields.
-
toString
-