You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "pegasas (via GitHub)" <gi...@apache.org> on 2023/08/24 17:50:24 UTC

[GitHub] [incubator-uniffle] pegasas opened a new pull request, #1170: Exposing the getDataLen method for ShuffleDataResult

pegasas opened a new pull request, #1170:
URL: https://github.com/apache/incubator-uniffle/pull/1170

   <!--
   1. Title: [#<issue>] <type>(<scope>): <subject>
      Examples:
        - "[#123] feat(operator): support xxx"
        - "[#233] fix: check null before access result in xxx"
        - "[MINOR] refactor: fix typo in variable name"
        - "[MINOR] docs: fix typo in README"
        - "[#255] test: fix flaky test NameOfTheTest"
      Reference: https://www.conventionalcommits.org/en/v1.0.0/
   2. Contributor guidelines:
      https://github.com/apache/incubator-uniffle/blob/master/CONTRIBUTING.md
   3. If the PR is unfinished, please mark this PR as draft.
   -->
   
   ### What changes were proposed in this pull request?
   
   (Please outline the changes and how this PR fixes the issue.)
   
   ### Why are the changes needed?
   
   (Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, describe the bug.)
   
   Fix: # (issue)
   
   ### Does this PR introduce _any_ user-facing change?
   
   (Please list the user-facing changes introduced by your change, including
     1. Change in user-facing APIs.
     2. Addition or removal of property keys.)
   
   No.
   
   ### How was this patch tested?
   
   (Please test your changes, and provide instructions on how to test it:
     1. If you add a feature or fix a bug, add a test to cover your changes. 
     2. If you fix a flaky test, repeat it for many times to prove it works.)
   


-- 
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@uniffle.apache.org

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


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


[GitHub] [incubator-uniffle] pegasas commented on a diff in pull request #1170: [#1164] refactor: Exposing the getDataLen method for ShuffleDataResult

Posted by "pegasas (via GitHub)" <gi...@apache.org>.
pegasas commented on code in PR #1170:
URL: https://github.com/apache/incubator-uniffle/pull/1170#discussion_r1305090955


##########
common/src/main/java/org/apache/uniffle/common/ShuffleDataResult.java:
##########
@@ -71,6 +71,10 @@ public byte[] getData() {
     return ByteBufUtils.readBytes(buffer.byteBuf());
   }
 
+  public int getDataLength() {
+    return getData().length;

Review Comment:
   I directly use `buffer` length instead of directly `getdata()`



-- 
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@uniffle.apache.org

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


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


[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #1170: [#1164] refactor: Exposing the getDataLen method for ShuffleDataResult

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #1170:
URL: https://github.com/apache/incubator-uniffle/pull/1170#discussion_r1305085360


##########
common/src/main/java/org/apache/uniffle/common/ShuffleDataResult.java:
##########
@@ -71,6 +71,10 @@ public byte[] getData() {
     return ByteBufUtils.readBytes(buffer.byteBuf());
   }
 
+  public int getDataLength() {
+    return getData().length;

Review Comment:
   If we use off memory, we use the method `getData`, we will copy extra memory copy.



-- 
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@uniffle.apache.org

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


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


[GitHub] [incubator-uniffle] jerqi commented on pull request #1170: [#1164] refactor: Exposing the getDataLen method for ShuffleDataResult

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on PR #1170:
URL: https://github.com/apache/incubator-uniffle/pull/1170#issuecomment-1693510593

   Could you update your description of pull request?


-- 
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@uniffle.apache.org

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


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


[GitHub] [incubator-uniffle] pegasas commented on pull request #1170: Exposing the getDataLen method for ShuffleDataResult

Posted by "pegasas (via GitHub)" <gi...@apache.org>.
pegasas commented on PR #1170:
URL: https://github.com/apache/incubator-uniffle/pull/1170#issuecomment-1692161962

   try to resolve https://github.com/apache/incubator-uniffle/issues/1164


-- 
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@uniffle.apache.org

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


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


[GitHub] [incubator-uniffle] pegasas commented on pull request #1170: [#1164] refactor: Exposing the getDataLen method for ShuffleDataResult

Posted by "pegasas (via GitHub)" <gi...@apache.org>.
pegasas commented on PR #1170:
URL: https://github.com/apache/incubator-uniffle/pull/1170#issuecomment-1693526431

   > 您能更新一下拉取请求的描述吗?
   
   Sure. Updated.


-- 
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@uniffle.apache.org

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


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


[GitHub] [incubator-uniffle] pegasas commented on a diff in pull request #1170: [#1164] refactor: Exposing the getDataLen method for ShuffleDataResult

Posted by "pegasas (via GitHub)" <gi...@apache.org>.
pegasas commented on code in PR #1170:
URL: https://github.com/apache/incubator-uniffle/pull/1170#discussion_r1305108479


##########
common/src/main/java/org/apache/uniffle/common/ShuffleDataResult.java:
##########
@@ -71,6 +71,16 @@ public byte[] getData() {
     return ByteBufUtils.readBytes(buffer.byteBuf());
   }
 
+  public int getDataLength() {
+    if (buffer == null) {
+      return 0;
+    }
+    if (buffer.nioByteBuffer().hasArray()) {
+      return buffer.nioByteBuffer().array().length;
+    }
+    return ByteBufUtils.readBytes(buffer.byteBuf()).length;

Review Comment:
   sorry, we should directly use `buffer.byteBuf()` array length



-- 
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@uniffle.apache.org

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


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


[GitHub] [incubator-uniffle] pegasas commented on a diff in pull request #1170: [#1164] refactor: Exposing the getDataLen method for ShuffleDataResult

Posted by "pegasas (via GitHub)" <gi...@apache.org>.
pegasas commented on code in PR #1170:
URL: https://github.com/apache/incubator-uniffle/pull/1170#discussion_r1305087476


##########
common/src/main/java/org/apache/uniffle/common/ShuffleDataResult.java:
##########
@@ -71,6 +71,10 @@ public byte[] getData() {
     return ByteBufUtils.readBytes(buffer.byteBuf());
   }
 
+  public int getDataLength() {
+    return getData().length;

Review Comment:
   good point!
   let me think about it..



-- 
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@uniffle.apache.org

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


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


[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #1170: [#1164] refactor: Exposing the getDataLen method for ShuffleDataResult

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #1170:
URL: https://github.com/apache/incubator-uniffle/pull/1170#discussion_r1305106397


##########
common/src/main/java/org/apache/uniffle/common/ShuffleDataResult.java:
##########
@@ -71,6 +71,16 @@ public byte[] getData() {
     return ByteBufUtils.readBytes(buffer.byteBuf());
   }
 
+  public int getDataLength() {
+    if (buffer == null) {
+      return 0;
+    }
+    if (buffer.nioByteBuffer().hasArray()) {
+      return buffer.nioByteBuffer().array().length;
+    }
+    return ByteBufUtils.readBytes(buffer.byteBuf()).length;

Review Comment:
   This method `ByteBufUtils.readBytes` will cause memory copy. 



-- 
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@uniffle.apache.org

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


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


[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #1170: [#1164] refactor: Exposing the getDataLen method for ShuffleDataResult

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #1170:
URL: https://github.com/apache/incubator-uniffle/pull/1170#discussion_r1305122772


##########
common/src/main/java/org/apache/uniffle/common/ShuffleDataResult.java:
##########
@@ -71,6 +71,16 @@ public byte[] getData() {
     return ByteBufUtils.readBytes(buffer.byteBuf());
   }
 
+  public int getDataLength() {
+    if (buffer == null) {
+      return 0;
+    }
+    if (buffer.nioByteBuffer().hasArray()) {
+      return buffer.nioByteBuffer().array().length;
+    }
+    return buffer.byteBuf().array().length;

Review Comment:
   ```suggestion
       return buffer.nioByteBuffer().remaing();
   ```



-- 
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@uniffle.apache.org

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


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


[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #1170: [#1164] Exposing the getDataLen method for ShuffleDataResult

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #1170:
URL: https://github.com/apache/incubator-uniffle/pull/1170#discussion_r1305024017


##########
common/src/main/java/org/apache/uniffle/common/ShuffleDataResult.java:
##########
@@ -79,6 +79,10 @@ public ByteBuffer getDataBuffer() {
     return buffer.nioByteBuffer();
   }
 
+  public int getDataBufferLength() {

Review Comment:
   Could we unify `getData().length()` and `getDataBuffer().remaining()`? 



-- 
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@uniffle.apache.org

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


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


[GitHub] [incubator-uniffle] pegasas commented on a diff in pull request #1170: [#1164] refactor: Exposing the getDataLen method for ShuffleDataResult

Posted by "pegasas (via GitHub)" <gi...@apache.org>.
pegasas commented on code in PR #1170:
URL: https://github.com/apache/incubator-uniffle/pull/1170#discussion_r1305073912


##########
common/src/main/java/org/apache/uniffle/common/ShuffleDataResult.java:
##########
@@ -79,6 +79,10 @@ public ByteBuffer getDataBuffer() {
     return buffer.nioByteBuffer();
   }
 
+  public int getDataBufferLength() {

Review Comment:
   Done.



-- 
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@uniffle.apache.org

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


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


[GitHub] [incubator-uniffle] codecov-commenter commented on pull request #1170: [#1164] refactor: Exposing the getDataLen method for ShuffleDataResult

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1170:
URL: https://github.com/apache/incubator-uniffle/pull/1170#issuecomment-1693425715

   ## [Codecov](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1170?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#1170](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1170?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (26955c8) into [master](https://app.codecov.io/gh/apache/incubator-uniffle/commit/523cc4f8e99231489e8fdcb42dff6718b1c4475d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (523cc4f) will **increase** coverage by `1.10%`.
   > Report is 2 commits behind head on master.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1170      +/-   ##
   ============================================
   + Coverage     53.61%   54.71%   +1.10%     
   - Complexity     2575     2579       +4     
   ============================================
     Files           391      371      -20     
     Lines         22366    20050    -2316     
     Branches       1876     1877       +1     
   ============================================
   - Hits          11992    10971    -1021     
   + Misses         9664     8439    -1225     
   + Partials        710      640      -70     
   ```
   
   
   | [Files Changed](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1170?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...a/org/apache/uniffle/common/ShuffleDataResult.java](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1170?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL2NvbW1vbi9TaHVmZmxlRGF0YVJlc3VsdC5qYXZh) | `33.33% <0.00%> (-4.91%)` | :arrow_down: |
   | [...pache/uniffle/server/ShuffleServerGrpcService.java](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1170?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9TaHVmZmxlU2VydmVyR3JwY1NlcnZpY2UuamF2YQ==) | `0.74% <0.00%> (ø)` | |
   | [...niffle/server/netty/ShuffleServerNettyHandler.java](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1170?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9uZXR0eS9TaHVmZmxlU2VydmVyTmV0dHlIYW5kbGVyLmphdmE=) | `1.47% <0.00%> (+<0.01%)` | :arrow_up: |
   
   ... and [26 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1170/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


-- 
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@uniffle.apache.org

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


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


[GitHub] [incubator-uniffle] jerqi merged pull request #1170: [#1164] refactor: Exposing the getDataLen method for ShuffleDataResult

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi merged PR #1170:
URL: https://github.com/apache/incubator-uniffle/pull/1170


-- 
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@uniffle.apache.org

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


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