Class RSUtil
java.lang.Object
org.apache.hadoop.io.erasurecode.rawcoder.util.RSUtil
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic voidencodeData(byte[] gfTables, int dataLen, byte[][] inputs, int[] inputOffsets, byte[][] outputs, int[] outputOffsets) Encode a group of inputs data and generate the outputs.static voidencodeData(byte[] gfTables, ByteBuffer[] inputs, ByteBuffer[] outputs) See above.static voidgenCauchyMatrix(byte[] a, int m, int k) Ported from Intel ISA-L library.static int[]getPrimitivePower(int numDataUnits, int numParityUnits) static voidinitTables(int k, int rows, byte[] codingMatrix, int matrixOffset, byte[] gfTables)
-
Field Details
-
GF
-
PRIMITIVE_ROOT
public static final int PRIMITIVE_ROOT- See Also:
-
-
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
See above. Try to use the byte[] version when possible.- Parameters:
gfTables- gfTables.inputs- inputs.outputs- outputs.
-