EtagChecksum (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.fs.store, class: EtagChecksum

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`

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 Summary

  Constructors
  Constructor
  Description
  `EtagChecksum()`
  Create with an empty etag.
  `EtagChecksum(String eTag)`
  Create with a string etag.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getAlgorithmName()`
  The checksum algorithm name.
  `byte[]`
  `getBytes()`
  The value of the checksum in bytes.
  `int`
  `getLength()`
  The length of the checksum in bytes.
  `void`
  `readFields(DataInput in)`
  Deserialize the fields of this object from `in`.
  `String`
  `toString()`
  `void`
  `write(DataOutput out)`
  Serialize the fields of this object to `out`.

  ### Methods inherited from class org.apache.hadoop.fs.FileChecksum

  `equals, getChecksumOpt, hashCode`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## 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`