Skip to content

Conversation

coderzc
Copy link
Member

@coderzc coderzc commented Feb 16, 2022

implement #165

  • use zero-copy optimize data recv
  • remove fail message
  • improve some config
  • support buffer file sort
  • support sort with buffer file and fix some unit test
  • create target file
  • rebuild sort module
@coderzc coderzc force-pushed the optimize_data_recv branch 4 times, most recently from 865a71e to 24f806e Compare February 17, 2022 05:51
buf.writeBytes(encoded);
}

public static void setMaxBytesPreRead(Channel channel, int length) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PreRead or PerRea?

this.length = length;
}

// Use zero-copy transform from socket channel to file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use "/**" for java doc

Comment on lines +72 to +75
// Skip ackId
buf.skipBytes(Integer.BYTES);
// Skip partition
buf.skipBytes(Integer.BYTES);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skipBytes(Integer.BYTES + Integer.BYTES);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems more clear to skip them separately

this.transportHandler().exceptionCaught(exception, connectionId);
}

@Deprecated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't fail any more?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at present the FailMessage seems there is useless but lack of increased the complexity of the implementation

dataMessage.body());

this.serverSession.onHandledData(requestId);
if (body instanceof FileRegionBuffer) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can add two private methods for if-else branch?

if (this.fileRegionMode) {
return DataMessage.parseWithFileRegion(msgType, in);
} else {
return DataMessage.parseFrom(msgType, in);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also rename parseFrom to parseWithFileRegion style

}

@Override
public String genOutputPath(MessageType messageType, int partition) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to keep an extension point that can use tmpfs?

Function<String, EntryIterator> fileToInput;
Function<String, KvEntryFileWriter> fileToWriter;

if (this.useZeroCopy) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can use a set of subclasses to implement zero-copy mode to replace all the if (this.useZeroCopy)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can use a set of subclasses to implement zero-copy mode to replace all the if (this.useZeroCopy)
updated

* <pre>
* +----------------------+
* | LocalBuffer |
* | Local File |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there no local buffer mode any more?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still have

@coderzc coderzc force-pushed the optimize_data_recv branch 2 times, most recently from b77a046 to da0a0b9 Compare February 17, 2022 07:31
if (this.threadNum(config) != 0) {
this.sortExecutor = ExecutorUtil.newFixedThreadPool(
this.threadNum(config), this.threadPrefix());
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep final mark and set sortExecutor=null

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Boolean zeroCopyMode =
config.get(ComputerOptions.TRANSPORT_ZERO_COPY_MODE);
if (!zeroCopyMode) {
this.recvBuffers = new MessageRecvBuffers(buffersLimit,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check other codes where used recvBuffers to avoid NPE

@coderzc coderzc force-pushed the optimize_data_recv branch 2 times, most recently from 7a483f1 to 690a2a5 Compare February 17, 2022 08:27
@corgiboygsj corgiboygsj force-pushed the optimize_data_recv branch 4 times, most recently from 62195d1 to fa07a59 Compare February 17, 2022 09:23
@coderzc coderzc changed the title Optimize data recv optimize data receiving Feb 17, 2022
@codecov
Copy link

codecov bot commented Feb 22, 2022

Codecov Report

Merging #181 (bc4e56e) into master (02a9361) will decrease coverage by 0.72%.
The diff coverage is 76.60%.

Impacted file tree graph

@@ Coverage Diff @@ ## master #181 +/- ## ============================================ - Coverage 87.33% 86.60% -0.73%  - Complexity 3150 3190 +40  ============================================ Files 332 339 +7 Lines 11806 12046 +240 Branches 1053 1070 +17 ============================================ + Hits 10311 10433 +122  - Misses 989 1095 +106  - Partials 506 518 +12 
Impacted Files Coverage Δ
...omputer/core/combiner/AbstractPointerCombiner.java 100.00% <ø> (ø)
...ph/computer/core/combiner/VertexValueCombiner.java 78.26% <ø> (ø)
...uter/core/common/exception/TransportException.java 72.22% <ø> (-5.56%) ⬇️
...ugegraph/computer/core/compute/ComputeManager.java 86.84% <ø> (ø)
...raph/computer/core/compute/FileGraphPartition.java 86.97% <ø> (ø)
...raph/computer/core/compute/input/MessageInput.java 91.30% <ø> (ø)
...h/computer/core/compute/input/ReusablePointer.java 87.09% <ø> (ø)
...om/baidu/hugegraph/computer/core/io/IOFactory.java 70.58% <ø> (ø)
...u/hugegraph/computer/core/io/StreamGraphInput.java 97.43% <ø> (ø)
.../hugegraph/computer/core/io/StreamGraphOutput.java 96.96% <ø> (ø)
... and 88 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 02a9361...bc4e56e. Read the comment docs.

@javeme
Copy link
Contributor

javeme commented Mar 2, 2022

There are still some comments need to be addressed

@coderzc coderzc marked this pull request as draft March 2, 2022 07:52
@github-actions
Copy link

github-actions bot commented Apr 1, 2022

Due to the lack of activity, the current pr is marked as stale and will be closed after 180 days, any update will remove the stale label

@github-actions
Copy link

github-actions bot commented May 2, 2022

Due to the lack of activity, the current pr is marked as stale and will be closed after 180 days, any update will remove the stale label

@javeme javeme removed the inactive label May 4, 2022
@coderzc coderzc marked this pull request as ready for review May 7, 2022 09:24
buf.writeBytes(encoded);
}

public static void setMaxBytesPreRead(Channel channel, int length) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PreRead or PerRead?

waitSortTimeout);
this.sortBuffers = new MessageRecvBuffers(buffersLimit,
waitSortTimeout);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check other code used recvBuffers and sortBuffers, since recvBuffers/sortBuffers may be null

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked there is no other reference when useFileRegion == true

@coderzc coderzc changed the title optimize data receiving feature: optimize data receiving May 10, 2022
javeme
javeme previously approved these changes May 10, 2022
@javeme
Copy link
Contributor

javeme commented May 12, 2022

@coderzc
Copy link
Member Author

coderzc commented May 17, 2022

can we try install hdfs through shell scrtipt: https://github.com/beyondstorage/setup-hdfs/blob/master/src/setup-hdfs.ts#L13

I will fix it in #184

@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #181 (fd037a4) into master (bcaef85) will decrease coverage by 0.76%.
The diff coverage is 76.90%.

@@ Coverage Diff @@ ## master #181 +/- ## ============================================ - Coverage 86.79% 86.03% -0.77%  - Complexity 3169 3206 +37  ============================================ Files 334 341 +7 Lines 11962 12200 +238 Branches 1068 1085 +17 ============================================ + Hits 10383 10496 +113  - Misses 1067 1176 +109  - Partials 512 528 +16 
Impacted Files Coverage Δ
...omputer/core/combiner/AbstractPointerCombiner.java 100.00% <ø> (ø)
...ph/computer/core/combiner/VertexValueCombiner.java 78.26% <ø> (ø)
...uter/core/common/exception/TransportException.java 72.22% <ø> (-5.56%) ⬇️
...ugegraph/computer/core/compute/ComputeManager.java 86.51% <ø> (ø)
...raph/computer/core/compute/FileGraphPartition.java 87.55% <ø> (ø)
...raph/computer/core/compute/input/MessageInput.java 91.30% <ø> (ø)
...h/computer/core/compute/input/ReusablePointer.java 87.09% <ø> (ø)
...om/baidu/hugegraph/computer/core/io/IOFactory.java 70.58% <ø> (ø)
...u/hugegraph/computer/core/io/StreamGraphInput.java 97.43% <ø> (ø)
.../hugegraph/computer/core/io/StreamGraphOutput.java 96.96% <ø> (ø)
... and 89 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bcaef85...fd037a4. Read the comment docs.

javeme
javeme previously approved these changes May 19, 2022
@javeme javeme merged commit 1800517 into master May 19, 2022
@javeme javeme deleted the optimize_data_recv branch May 19, 2022 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants