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

Package org.apache.hadoop.fs

# Class Options.ChecksumOpt

java.lang.Object
org.apache.hadoop.fs.Options.ChecksumOpt

Enclosing class:
  Options

public static class Options.ChecksumOpt extends Object
This is used in FileSystem and FileContext to specify checksum options.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ChecksumOpt()`
  Create a uninitialized one
  `ChecksumOpt(DataChecksum.Type type, int size)`
  Normal ctor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Options.ChecksumOpt`
  `createDisabled()`
  Create a ChecksumOpts that disables checksum.
  `int`
  `getBytesPerChecksum()`
  `DataChecksum.Type`
  `getChecksumType()`
  `static Options.ChecksumOpt`
  `processChecksumOpt(Options.ChecksumOpt defaultOpt, Options.ChecksumOpt userOpt)`
  A helper method for processing user input and default value to create a combined checksum option.
  `static Options.ChecksumOpt`
  `processChecksumOpt(Options.ChecksumOpt defaultOpt, Options.ChecksumOpt userOpt, int userBytesPerChecksum)`
  A helper method for processing user input and default value to create a combined checksum option.
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### ChecksumOpt

    public ChecksumOpt()
    Create a uninitialized one

  - ### ChecksumOpt

    public ChecksumOpt(DataChecksum.Type type, int size)
    Normal ctor
    Parameters:
      `type` - checksum type
      `size` - bytes per checksum

- ## Method Details

  - ### getBytesPerChecksum

    public int getBytesPerChecksum()

  - ### getChecksumType

    public DataChecksum.Type getChecksumType()

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### createDisabled

    public static Options.ChecksumOpt createDisabled()
    Create a ChecksumOpts that disables checksum.
    Returns:
      ChecksumOpt.

  - ### processChecksumOpt

    public static Options.ChecksumOpt processChecksumOpt(Options.ChecksumOpt defaultOpt, Options.ChecksumOpt userOpt, int userBytesPerChecksum)
    A helper method for processing user input and default value to create a combined checksum option. This is a bit complicated because bytesPerChecksum is kept for backward compatibility.
    Parameters:
      `defaultOpt` - Default checksum option
      `userOpt` - User-specified checksum option. Ignored if null.
      `userBytesPerChecksum` - User-specified bytesPerChecksum Ignored if < 0.
    Returns:
      ChecksumOpt.

  - ### processChecksumOpt

    public static Options.ChecksumOpt processChecksumOpt(Options.ChecksumOpt defaultOpt, Options.ChecksumOpt userOpt)
    A helper method for processing user input and default value to create a combined checksum option.
    Parameters:
      `defaultOpt` - Default checksum option
      `userOpt` - User-specified checksum option
    Returns:
      ChecksumOpt.