You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "waitinfuture (via GitHub)" <gi...@apache.org> on 2023/03/15 06:57:30 UTC

[GitHub] [incubator-celeborn] waitinfuture opened a new pull request, #1352: [CELEBORN-428][FLINK] Refine logic in PartitionSortedBuffer.allocateB…

waitinfuture opened a new pull request, #1352:
URL: https://github.com/apache/incubator-celeborn/pull/1352

   …uffersForRecord
   
   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     - Make sure the PR title start w/ a JIRA ticket, e.g. '[CELEBORN-XXXX] Your PR title ...'.
     - Be sure to keep the PR description updated to reflect all changes.
     - Please write your PR title to summarize what this PR proposes.
     - If possible, provide a concise example to reproduce the issue for a faster review.
   -->
   
   ### What changes were proposed in this pull request?
   Refine logic in PartitionSortedBuffer.allocateBuffersForRecord
   
   
   ### Why are the changes needed?
   Refine logic in PartitionSortedBuffer.allocateBuffersForRecord
   
   
   ### Does this PR introduce _any_ user-facing change?
   NO
   
   
   ### How was this patch tested?
   UT
   


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

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


[GitHub] [incubator-celeborn] codecov[bot] commented on pull request #1352: [CELEBORN-428][FLINK] Refine logic in PartitionSortedBuffer.allocateB…

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #1352:
URL: https://github.com/apache/incubator-celeborn/pull/1352#issuecomment-1469458122

   ## [Codecov](https://codecov.io/gh/apache/incubator-celeborn/pull/1352?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1352](https://codecov.io/gh/apache/incubator-celeborn/pull/1352?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (dea7581) into [main](https://codecov.io/gh/apache/incubator-celeborn/commit/889e8ca644b01812f1b60135af7e69e5c3f50b5a?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (889e8ca) will **increase** coverage by `0.06%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@             Coverage Diff              @@
   ##               main    #1352      +/-   ##
   ============================================
   + Coverage     29.72%   29.78%   +0.06%     
   - Complexity      912      919       +7     
   ============================================
     Files           221      221              
     Lines         18550    18550              
     Branches       1981     1981              
   ============================================
   + Hits           5513     5523      +10     
   + Misses        12639    12635       -4     
   + Partials        398      392       -6     
   ```
   
   
   [see 2 files with indirect coverage changes](https://codecov.io/gh/apache/incubator-celeborn/pull/1352/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :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=The+Apache+Software+Foundation)
   


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

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


[GitHub] [incubator-celeborn] waitinfuture commented on pull request #1352: [CELEBORN-428][FLINK] Refine logic in PartitionSortedBuffer.allocateB…

Posted by "waitinfuture (via GitHub)" <gi...@apache.org>.
waitinfuture commented on PR #1352:
URL: https://github.com/apache/incubator-celeborn/pull/1352#issuecomment-1469447502

   ping @zhongqiangczq @RexXiong 


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

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


[GitHub] [incubator-celeborn] zhongqiangczq commented on a diff in pull request #1352: [CELEBORN-428][FLINK] Remove unnecessary lock in PartitionSortedBuffer

Posted by "zhongqiangczq (via GitHub)" <gi...@apache.org>.
zhongqiangczq commented on code in PR #1352:
URL: https://github.com/apache/incubator-celeborn/pull/1352#discussion_r1136652758


##########
client-flink/common/src/main/java/org/apache/celeborn/plugin/flink/buffer/PartitionSortedBuffer.java:
##########
@@ -201,18 +201,20 @@ private void writeRecord(ByteBuffer source) {
 
   private boolean allocateBuffersForRecord(int numRecordBytes) throws IOException {
     int numBytesRequired = INDEX_ENTRY_SIZE + numRecordBytes;
-    int availableBytes = writeSegmentIndex == buffers.size() ? 0 : bufferSize - writeSegmentOffset;
+    int currentBufferAvailableBytes =
+        writeSegmentIndex == buffers.size() ? 0 : bufferSize - writeSegmentOffset;
 
     // return directly if current available bytes is adequate
-    if (availableBytes >= numBytesRequired) {
+    if (currentBufferAvailableBytes >= numBytesRequired) {
       return true;
     }
 
     // skip the remaining free space if the available bytes is not enough for an index entry
-    if (availableBytes < INDEX_ENTRY_SIZE) {
-      updateWriteSegmentIndexAndOffset(availableBytes);
-      availableBytes = 0;
+    if (currentBufferAvailableBytes < INDEX_ENTRY_SIZE) {
+      updateWriteSegmentIndexAndOffset(currentBufferAvailableBytes);
     }
+    int totalAvailableBytes =
+        (buffers.size() - writeSegmentIndex) * bufferSize - writeSegmentOffset;

Review Comment:
   if currentBufferAvailableBytes < INDEX_ENTRY_SIZE then updateWriteSegmentIndexAndOffset, writeSegmentIndex will ++
    now writeSegmentIndex equals buffers.size(),so  totalAvailableBytes will be negative(-writeSegmentOffset)



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

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


[GitHub] [incubator-celeborn] waitinfuture merged pull request #1352: [CELEBORN-428][FLINK] Remove unnecessary lock in PartitionSortedBuffer

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


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

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


[GitHub] [incubator-celeborn] zhongqiangczq commented on a diff in pull request #1352: [CELEBORN-428][FLINK] Remove unnecessary lock in PartitionSortedBuffer

Posted by "zhongqiangczq (via GitHub)" <gi...@apache.org>.
zhongqiangczq commented on code in PR #1352:
URL: https://github.com/apache/incubator-celeborn/pull/1352#discussion_r1136652758


##########
client-flink/common/src/main/java/org/apache/celeborn/plugin/flink/buffer/PartitionSortedBuffer.java:
##########
@@ -201,18 +201,20 @@ private void writeRecord(ByteBuffer source) {
 
   private boolean allocateBuffersForRecord(int numRecordBytes) throws IOException {
     int numBytesRequired = INDEX_ENTRY_SIZE + numRecordBytes;
-    int availableBytes = writeSegmentIndex == buffers.size() ? 0 : bufferSize - writeSegmentOffset;
+    int currentBufferAvailableBytes =
+        writeSegmentIndex == buffers.size() ? 0 : bufferSize - writeSegmentOffset;
 
     // return directly if current available bytes is adequate
-    if (availableBytes >= numBytesRequired) {
+    if (currentBufferAvailableBytes >= numBytesRequired) {
       return true;
     }
 
     // skip the remaining free space if the available bytes is not enough for an index entry
-    if (availableBytes < INDEX_ENTRY_SIZE) {
-      updateWriteSegmentIndexAndOffset(availableBytes);
-      availableBytes = 0;
+    if (currentBufferAvailableBytes < INDEX_ENTRY_SIZE) {
+      updateWriteSegmentIndexAndOffset(currentBufferAvailableBytes);
     }
+    int totalAvailableBytes =
+        (buffers.size() - writeSegmentIndex) * bufferSize - writeSegmentOffset;

Review Comment:
   if currentBufferAvailableBytes < INDEX_ENTRY_SIZE then updateWriteSegmentIndexAndOffset, writeSegmentIndex will ++
    now writeSegmentIndex equals buffers.size(),so  totalAvailableBytes will be negative(-writeSegmentOffset)



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

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