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 and Description
    `ChecksumOpt()` Create a uninitialized one
    `ChecksumOpt(DataChecksum.Type type, int size)` Normal ctor

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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 Detail

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

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

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

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

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.