Class EtagChecksum

java.lang.Object
org.apache.hadoop.fs.FileChecksum
org.apache.hadoop.fs.store.EtagChecksum
All Implemented Interfaces:
Writable

public class EtagChecksum extends FileChecksum
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 Details

    • EtagChecksum

      public EtagChecksum()
      Create with an empty etag.
    • EtagChecksum

      public EtagChecksum(String eTag)
      Create with a string etag.
      Parameters:
      eTag - etag
  • Method Details

    • getAlgorithmName

      public String getAlgorithmName()
      Description copied from class: FileChecksum
      The checksum algorithm name.
      Specified by:
      getAlgorithmName in class FileChecksum
      Returns:
      algorithm name.
    • getLength

      public int getLength()
      Description copied from class: FileChecksum
      The length of the checksum in bytes.
      Specified by:
      getLength in class FileChecksum
      Returns:
      length.
    • getBytes

      public byte[] getBytes()
      Description copied from class: FileChecksum
      The value of the checksum in bytes.
      Specified by:
      getBytes in class FileChecksum
      Returns:
      byte array.
    • write

      public void write(DataOutput out) throws IOException
      Description copied from interface: Writable
      Serialize the fields of this object to out.
      Parameters:
      out - DataOuput to serialize this object into.
      Throws:
      IOException - any other problem for write.
    • readFields

      public void readFields(DataInput in) throws IOException
      Description copied from interface: Writable
      Deserialize the fields of this object from in.

      For efficiency, implementations should attempt to re-use storage in the existing object where possible.

      Parameters:
      in - DataInput to deseriablize this object from.
      Throws:
      IOException - any other problem for readFields.
    • toString

      public String toString()
      Overrides:
      toString in class Object