diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/AbstractNativeRawDecoder.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/AbstractNativeRawDecoder.java index 55edb649830..d6aa8bdc39f 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/AbstractNativeRawDecoder.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/AbstractNativeRawDecoder.java @@ -19,6 +19,7 @@ package org.apache.hadoop.io.erasurecode.rawcoder; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.io.erasurecode.ErasureCoderOptions; +import org.apache.hadoop.util.PerformanceAdvisory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -66,7 +67,7 @@ abstract class AbstractNativeRawDecoder extends RawErasureDecoder { @Override protected void doDecode(ByteArrayDecodingState decodingState) { - LOG.warn("convertToByteBufferState is invoked, " + + PerformanceAdvisory.LOG.debug("convertToByteBufferState is invoked, " + "not efficiently. Please use direct ByteBuffer inputs/outputs"); ByteBufferDecodingState bbdState = decodingState.convertToByteBufferState(); @@ -78,6 +79,11 @@ abstract class AbstractNativeRawDecoder extends RawErasureDecoder { } } + @Override + public boolean preferDirectBuffer() { + return true; + } + // To link with the underlying data structure in the native layer. // No get/set as only used by native codes. private long nativeCoder; diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/AbstractNativeRawEncoder.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/AbstractNativeRawEncoder.java index b2c7016215e..21805fe9212 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/AbstractNativeRawEncoder.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/AbstractNativeRawEncoder.java @@ -19,6 +19,7 @@ package org.apache.hadoop.io.erasurecode.rawcoder; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.io.erasurecode.ErasureCoderOptions; +import org.apache.hadoop.util.PerformanceAdvisory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -63,7 +64,7 @@ abstract class AbstractNativeRawEncoder extends RawErasureEncoder { @Override protected void doEncode(ByteArrayEncodingState encodingState) { - LOG.warn("convertToByteBufferState is invoked, " + + PerformanceAdvisory.LOG.debug("convertToByteBufferState is invoked, " + "not efficiently. Please use direct ByteBuffer inputs/outputs"); ByteBufferEncodingState bbeState = encodingState.convertToByteBufferState(); @@ -75,6 +76,11 @@ abstract class AbstractNativeRawEncoder extends RawErasureEncoder { } } + @Override + public boolean preferDirectBuffer() { + return true; + } + // To link with the underlying data structure in the native layer. // No get/set as only used by native codes. private long nativeCoder;