Class NativeRSRawEncoder
java.lang.Object
org.apache.hadoop.io.erasurecode.rawcoder.RawErasureEncoder
org.apache.hadoop.io.erasurecode.rawcoder.NativeRSRawEncoder
A Reed-Solomon raw encoder using Intel ISA-L library.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoEncode(org.apache.hadoop.io.erasurecode.rawcoder.ByteArrayEncodingState encodingState) Perform the real encoding work using bytes array, supporting offsets and lengths.protected voiddoEncode(org.apache.hadoop.io.erasurecode.rawcoder.ByteBufferEncodingState encodingState) Perform the real encoding work using direct ByteBuffer.protected voidperformEncodeImpl(ByteBuffer[] inputs, int[] inputOffsets, int dataLen, ByteBuffer[] outputs, int[] outputOffsets) booleanTell if direct buffer is preferred or not.voidrelease()Should be called when release this coder.Methods inherited from class org.apache.hadoop.io.erasurecode.rawcoder.RawErasureEncoder
allowChangeInputs, allowVerboseDump, encode, encode, encode, getNumAllUnits, getNumDataUnits, getNumParityUnits
-
Field Details
-
LOG
public static org.slf4j.Logger LOG -
encoderLock
-
-
Constructor Details
-
NativeRSRawEncoder
-
-
Method Details
-
performEncodeImpl
protected void performEncodeImpl(ByteBuffer[] inputs, int[] inputOffsets, int dataLen, ByteBuffer[] outputs, int[] outputOffsets) throws IOException - Throws:
IOException
-
release
public void release()Description copied from class:RawErasureEncoderShould be called when release this coder. Good chance to release encoding or decoding buffers- Overrides:
releasein classRawErasureEncoder
-
preferDirectBuffer
public boolean preferDirectBuffer()Description copied from class:RawErasureEncoderTell if direct buffer is preferred or not. It's for callers to decide how to allocate coding chunk buffers, using DirectByteBuffer or bytes array. It will return false by default.- Returns:
- true if native buffer is preferred for performance consideration, otherwise false.
-
doEncode
protected void doEncode(org.apache.hadoop.io.erasurecode.rawcoder.ByteBufferEncodingState encodingState) throws IOException Description copied from class:RawErasureEncoderPerform the real encoding work using direct ByteBuffer.- Specified by:
doEncodein classRawErasureEncoder- Parameters:
encodingState- the encoding state.- Throws:
IOException- raised on errors performing I/O.
-
doEncode
protected void doEncode(org.apache.hadoop.io.erasurecode.rawcoder.ByteArrayEncodingState encodingState) throws IOException Description copied from class:RawErasureEncoderPerform the real encoding work using bytes array, supporting offsets and lengths.- Specified by:
doEncodein classRawErasureEncoder- Parameters:
encodingState- the encoding state- Throws:
IOException- raised on errors performing I/O.
-