You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/07/26 19:59:23 UTC

[GitHub] [ozone] swamirishi opened a new pull request, #3623: HDDS-7051. : Fix offset Condition in ECKeyOutputStream

swamirishi opened a new pull request, #3623:
URL: https://github.com/apache/ozone/pull/3623

   ## What changes were proposed in this pull request?
   Fix offset Condition in ECKeyOutputStream
   Condition checking with offset+writtenLen !< length if offset is not zero.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-7051
   
   ## How was this patch tested?
   
   Current flows all have offset =0.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] umamaheswararao merged pull request #3623: HDDS-7051. Fix offset Condition in ECKeyOutputStream

Posted by GitBox <gi...@apache.org>.
umamaheswararao merged PR #3623:
URL: https://github.com/apache/ozone/pull/3623


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] kaijchen commented on a diff in pull request #3623: HDDS-7051. Fix offset Condition in ECKeyOutputStream

Posted by GitBox <gi...@apache.org>.
kaijchen commented on code in PR #3623:
URL: https://github.com/apache/ozone/pull/3623#discussion_r935048638


##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java:
##########
@@ -154,7 +154,7 @@ public void write(byte[] b, int off, int len) throws IOException {
     }
     try {
       int writtenLen = 0;
-      while (off + writtenLen < len) {

Review Comment:
   LGTM. Thanks for the fix @swamirishi.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] umamaheswararao commented on a diff in pull request #3623: HDDS-7051. Fix offset Condition in ECKeyOutputStream

Posted by GitBox <gi...@apache.org>.
umamaheswararao commented on code in PR #3623:
URL: https://github.com/apache/ozone/pull/3623#discussion_r937272195


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestECKeyOutputStream.java:
##########
@@ -277,18 +282,28 @@ public void test21ChunksInSingleWriteOp() throws IOException {
     testMultipleChunksInSingleWriteOp(21);
   }
 
-  public void testMultipleChunksInSingleWriteOp(int numChunks)
-      throws IOException {
-    byte[] inputData = getInputBytes(numChunks);
+  public void testMultipleChunksInSingleWriteOp(int offset,

Review Comment:
   This also can be private.



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestECKeyOutputStream.java:
##########
@@ -277,18 +282,28 @@ public void test21ChunksInSingleWriteOp() throws IOException {
     testMultipleChunksInSingleWriteOp(21);
   }
 
-  public void testMultipleChunksInSingleWriteOp(int numChunks)
-      throws IOException {
-    byte[] inputData = getInputBytes(numChunks);
+  public void testMultipleChunksInSingleWriteOp(int offset,
+                                                int bufferChunks, int numChunks)
+          throws IOException {
+    byte[] inputData = getInputBytes(offset, bufferChunks, numChunks);
     final OzoneBucket bucket = getOzoneBucket();
-    String keyName = "testMultipleChunksInSingleWriteOp" + numChunks;
+    String keyName =
+            String.format("testMultipleChunksInSingleWriteOpOffset" +
+                    "%dBufferChunks%dNumChunks", offset, bufferChunks,
+                    numChunks);
     try (OzoneOutputStream out = bucket.createKey(keyName, 4096,
         new ECReplicationConfig(3, 2, ECReplicationConfig.EcCodec.RS,
             chunkSize), new HashMap<>())) {
-      out.write(inputData);
+      out.write(inputData, offset, numChunks * chunkSize);
     }
 
-    validateContent(inputData, bucket, bucket.getKey(keyName));
+    validateContent(offset, numChunks * chunkSize, inputData, bucket,
+            bucket.getKey(keyName));
+  }
+
+  public void testMultipleChunksInSingleWriteOp(int numChunks)

Review Comment:
   This can be private right?



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] umamaheswararao commented on a diff in pull request #3623: HDDS-7051. Fix offset Condition in ECKeyOutputStream

Posted by GitBox <gi...@apache.org>.
umamaheswararao commented on code in PR #3623:
URL: https://github.com/apache/ozone/pull/3623#discussion_r934786321


##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java:
##########
@@ -154,7 +154,7 @@ public void write(byte[] b, int off, int len) throws IOException {
     }
     try {
       int writtenLen = 0;
-      while (off + writtenLen < len) {

Review Comment:
   Thanks for fixing it @swamirishi. This needs a test.



##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java:
##########
@@ -154,7 +154,7 @@ public void write(byte[] b, int off, int len) throws IOException {
     }
     try {
       int writtenLen = 0;
-      while (off + writtenLen < len) {

Review Comment:
   @kaijchen do you want to take a look at it?
   
   Fortunately most of the apps seems to be using off starts from 0, so, we have not hit this one :-)



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org