RSUtil (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.io.erasurecode.rawcoder.util, class: RSUtil

Package org.apache.hadoop.io.erasurecode.rawcoder.util

# Class RSUtil

java.lang.Object
org.apache.hadoop.io.erasurecode.rawcoder.util.RSUtil

@Private public final class RSUtil extends Object
Utilities for implementing Reed-Solomon code, used by RS coder. Some of the codes are borrowed from ISA-L implementation (C or ASM codes).

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static GaloisField`
  `GF`
  `static final int`
  `PRIMITIVE_ROOT`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `encodeData(byte[] gfTables, int dataLen, byte[][] inputs, int[] inputOffsets, byte[][] outputs, int[] outputOffsets)`
  Encode a group of inputs data and generate the outputs.
  `static void`
  `encodeData(byte[] gfTables, ByteBuffer[] inputs, ByteBuffer[] outputs)`
  See above.
  `static void`
  `genCauchyMatrix(byte[] a, int m, int k)`
  Ported from Intel ISA-L library.
  `static int[]`
  `getPrimitivePower(int numDataUnits, int numParityUnits)`
  `static void`
  `initTables(int k, int rows, byte[] codingMatrix, int matrixOffset, byte[] gfTables)`

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

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

- ## Field Details

  - ### GF

    public static GaloisField GF

  - ### PRIMITIVE_ROOT

    public static final int PRIMITIVE_ROOT
    See Also:
      - Constant Field Values

- ## Method Details

  - ### getPrimitivePower

    public static int[] getPrimitivePower(int numDataUnits, int numParityUnits)

  - ### initTables

    public static void initTables(int k, int rows, byte[] codingMatrix, int matrixOffset, byte[] gfTables)

  - ### genCauchyMatrix

    public static void genCauchyMatrix(byte[] a, int m, int k)
    Ported from Intel ISA-L library.
    Parameters:
      `k` - k.
      `a` - a.
      `m` - m.

  - ### encodeData

    public static void encodeData(byte[] gfTables, int dataLen, byte[][] inputs, int[] inputOffsets, byte[][] outputs, int[] outputOffsets)
    Encode a group of inputs data and generate the outputs. It's also used for decoding because, in this implementation, encoding and decoding are unified. The algorithm is ported from Intel ISA-L library for compatible. It leverages Java auto-vectorization support for performance.
    Parameters:
      `gfTables` - gfTables.
      `dataLen` - dataLen.
      `inputs` - inputs.
      `inputOffsets` - inputOffsets.
      `outputs` - outputs.
      `outputOffsets` - outputOffsets.

  - ### encodeData

    public static void encodeData(byte[] gfTables, ByteBuffer[] inputs, ByteBuffer[] outputs)
    See above. Try to use the byte[] version when possible.
    Parameters:
      `gfTables` - gfTables.
      `inputs` - inputs.
      `outputs` - outputs.