umamaheswararao commented on a change in pull request #3218:
URL: https://github.com/apache/ozone/pull/3218#discussion_r837584308
##########
File path:
hadoop-hdds/erasurecode/src/main/java/org/apache/ozone/erasurecode/rawcoder/AbstractNativeRawDecoder.java
##########
@@ -54,10 +54,6 @@ protected void doDecode(ByteBufferDecodingState
decodingState)
throws IOException {
decoderLock.readLock().lock();
try {
- if (nativeCoder == 0) {
Review comment:
This variable actually set from native code ( jni_common.c#setCoder ).
Since the JNI binding happens at hadoop code itself, we don't need this here
until we copy the native code bits.
Please remove the variable declaration also from this file.
##########
File path:
hadoop-hdds/erasurecode/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/HadoopNativeECAccessorUtil.java
##########
@@ -0,0 +1,60 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.io.erasurecode.rawcoder;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+import org.apache.hadoop.hdds.annotation.InterfaceAudience;
+
+/**
+ * the class of Hadoop Native EC.
Review comment:
Please change the doc as follows:
This class is used to access some of the protected API from hadoop native EC
java code. This is needed until we adapt the native ec code from hadoop.
##########
File path:
hadoop-hdds/erasurecode/src/main/java/org/apache/ozone/erasurecode/rawcoder/NativeRSRawEncoder.java
##########
@@ -29,47 +33,36 @@
@InterfaceAudience.Private
public class NativeRSRawEncoder extends AbstractNativeRawEncoder {
- static {
- ErasureCodeNative.checkNativeCodeLoaded();
- }
+ private org.apache.hadoop.io.erasurecode.rawcoder.NativeRSRawEncoder
+ hadoopNativeRSRawEncoder;
+ public static final Logger LOG =
+ LoggerFactory.getLogger(NativeRSRawEncoder.class);
public NativeRSRawEncoder(ECReplicationConfig ecReplicationConfig) {
super(ecReplicationConfig);
- encoderLock.writeLock().lock();
- try {
- initImpl(ecReplicationConfig.getData(), ecReplicationConfig.getParity());
- } finally {
- encoderLock.writeLock().unlock();
- }
+ hadoopNativeRSRawEncoder =
+ new org.apache.hadoop.io.erasurecode.rawcoder.NativeRSRawEncoder(
+ new ErasureCoderOptions(ecReplicationConfig.getData(),
+ ecReplicationConfig.getParity()));
+ LOG.info("Using the Native ISA-l Library........");
Review comment:
I just added the above log for checking flow. I think we don't need the
above line of log. and also make sure to remove above LOG declaration and
imports cleanup.
##########
File path:
hadoop-hdds/erasurecode/src/main/java/org/apache/ozone/erasurecode/rawcoder/NativeXORRawEncoder.java
##########
@@ -29,42 +33,31 @@
@InterfaceAudience.Private
public class NativeXORRawEncoder extends AbstractNativeRawEncoder {
- static {
- ErasureCodeNative.checkNativeCodeLoaded();
- }
+ private org.apache.hadoop.io.erasurecode.rawcoder.NativeXORRawEncoder
+ hadoopNativeXORRawEncoder;
+ public static final Logger LOG =
+ LoggerFactory.getLogger(NativeXORRawEncoder.class);
public NativeXORRawEncoder(ECReplicationConfig ecReplicationConfig) {
super(ecReplicationConfig);
- encoderLock.writeLock().lock();
- try {
- initImpl(ecReplicationConfig.getData(), ecReplicationConfig.getParity());
- } finally {
- encoderLock.writeLock().unlock();
- }
+ hadoopNativeXORRawEncoder =
+ new org.apache.hadoop.io.erasurecode.rawcoder.NativeXORRawEncoder(
+ new ErasureCoderOptions(ecReplicationConfig.getData(),
+ ecReplicationConfig.getParity()));
+ LOG.info("Using the Native ISA-l Library........");
Review comment:
Remove this logging as explained above.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]