umamaheswararao commented on a change in pull request #2444:
URL: https://github.com/apache/ozone/pull/2444#discussion_r703608003



##########
File path: 
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/ECReplicationConfig.java
##########
@@ -75,6 +87,7 @@ public int getRequiredNodes() {
     return HddsProtos.ECReplicationConfig.newBuilder()
         .setData(data)
         .setParity(parity)
+        .setCodec(codec)
         .build();
   }
 

Review comment:
       Should we consider codec also in equals?

##########
File path: 
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/ECReplicationConfig.java
##########
@@ -28,18 +28,29 @@
  * Replication configuration for EC replication.
  */
 public class ECReplicationConfig implements ReplicationConfig {
-  
+
   private static final Pattern STRING_FORMAT = 
Pattern.compile("(\\d+)-(\\d+)");
-  
+
+  public static final String RS_CODEC = "rs";
+  public static final String XOR_CODEC = "xor";
+
   private int data;
 
   private int parity;
 
+  private String codec = RS_CODEC;
+
   public ECReplicationConfig(int data, int parity) {
     this.data = data;
     this.parity = parity;
   }
 
+  public ECReplicationConfig(int data, int parity, String codec) {
+    this.data = data;
+    this.parity = parity;
+    this.codec = codec;
+  }
+
   public ECReplicationConfig(String string) {
     final Matcher matcher = STRING_FORMAT.matcher(string);
     if (!matcher.matches()) {

Review comment:
       You may want to update this message as we may allow codec also in config?

##########
File path: 
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/ECReplicationConfig.java
##########
@@ -28,18 +28,29 @@
  * Replication configuration for EC replication.
  */
 public class ECReplicationConfig implements ReplicationConfig {
-  
+
   private static final Pattern STRING_FORMAT = 
Pattern.compile("(\\d+)-(\\d+)");

Review comment:
       Now we should be able to configure with codec option right? Could you 
please add comment to show the expected valid format ?

##########
File path: 
hadoop-hdds/erasurecode/src/main/java/org/apache/ozone/erasurecode/ECChunk.java
##########
@@ -0,0 +1,113 @@
+/**
+ * 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
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.ozone.erasurecode;
+
+import java.nio.ByteBuffer;
+
+/**
+ * A wrapper for ByteBuffer or bytes array for an erasure code chunk.
+ */
+public class ECChunk {

Review comment:
       Looks like ECChunk abstraction we used only in tests? I think it's ok to 
have it for now and later we can cleanup if we don't use it ( to avoid code 
modifications in this patch)




-- 
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]

Reply via email to