Skip to content

Conversation

houzhizhen
Copy link
Contributor

No description provided.


import java.nio.ByteBuffer;

public interface BufferHandler {
Copy link
Contributor

Choose a reason for hiding this comment

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

MessageHandler

/**
* This method is called before a iteration.
*/
void startIteration();
Copy link
Contributor

Choose a reason for hiding this comment

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

start() is ok, means start send

Copy link
Contributor Author

Choose a reason for hiding this comment

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

start usually used to start a service, and called only once.

Copy link
Contributor Author

@houzhizhen houzhizhen Mar 15, 2021

Choose a reason for hiding this comment

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

startSession, finishSession

/**
* Startup server, return the port listened.
*/
int setup(Config config, BufferHandler handler);
Copy link
Contributor

Choose a reason for hiding this comment

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

rename to listen(), don't return int

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A Transport4server need to listen on a port, there are multiple workers on a computer, need to listen on different port.

public interface BufferHandler {

/**
* Hand the buffer, it may block the caller a few seconds if it needs
Copy link
Contributor

Choose a reason for hiding this comment

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

don't block netty handler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can leads to OOM if the speed of data process is slower than the speed of data received. There is no good async at both sender and receiver.

* Startup server, return the port listened.
*/
int setup(Config config, BufferHandler handler);

Copy link
Contributor

Choose a reason for hiding this comment

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

add pauseReceive() and resumeReceive()
if the pending_messages feature can control flow rate, we can delete ignore-resume

Copy link
Contributor Author

Choose a reason for hiding this comment

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

listen, set the port range in config.

* once.
* @throws IOException if can't create connection.
*/
void init(String hostname, int port) throws IOException;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pass config as parameter, client set config MAX_PENDING_REQUESTS in conifg


public static final ConfigOption<Integer> WORKER_DATA_PORT_RANGE_START =
new ConfigOption<>(
"worker.data_port_range_start",
Copy link
Contributor

Choose a reason for hiding this comment

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

data_port_start

public static final ConfigOption<Integer> WORKER_DATA_PORT_RANGE_START =
new ConfigOption<>(
"worker.data_port_range_start",
"The start of range that the worker's data port listen on.",
Copy link
Contributor

Choose a reason for hiding this comment

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

improve description, listen port not listen port range.
also explain that we will choose one from small to large of the range

@codecov-io
Copy link

codecov-io commented Mar 16, 2021

Codecov Report

Merging #20 (e74cb42) into master (2b76996) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@ Coverage Diff @@ ## master #20 +/- ## ============================================ + Coverage 80.82% 80.86% +0.04%  Complexity 790 790 ============================================ Files 79 79 Lines 2602 2608 +6 Branches 236 236 ============================================ + Hits 2103 2109 +6  Misses 380 380 Partials 119 119 
Impacted Files Coverage Δ Complexity Δ
...ugegraph/computer/core/config/ComputerOptions.java 98.55% <100.00%> (+0.13%) 2.00 <0.00> (ø)

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 2b76996...e74cb42. Read the comment docs.

"worker.data_port_range_start",
"The start of range that the worker's data port listen on.",
"worker.data_port_start",
"The start of range [WORKER_DATA_PORT_START, " +
Copy link
Contributor

Choose a reason for hiding this comment

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

[data_port_start, data_port_end]

"WORKER_DATA_PORT_END]. The worker will choose one from " +
"small to large of the range for data transportation.",
"The start of range [data_port_start, data_port_end]. " +
"The worker will choose one from small to large of the range" +
Copy link
Contributor

Choose a reason for hiding this comment

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

wrap line before "range"


/**
* Startup server, return the port listened. The port range in config is
* [{@link @ComputerOptions.WORKER_DATA_PORT_RANGE_START #STATIC_FIELD},
Copy link
Contributor

Choose a reason for hiding this comment

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

update it

javeme
javeme previously approved these changes Mar 16, 2021
coderzc
coderzc previously approved these changes Mar 16, 2021

/**
* Init the connection from client to server. This method is called only
* once. MAX_PENDING_REQUESTS is set in config
Copy link
Contributor

Choose a reason for hiding this comment

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

remove redudant blank before 'is'

void init(Config config, String hostname, int port) throws IOException;

/**
* This method is called before a iteration of sending buffers.
Copy link
Contributor

Choose a reason for hiding this comment

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

before a iteration -> before an iteration

@houzhizhen houzhizhen dismissed stale reviews from coderzc and javeme via 4caf851 March 16, 2021 12:49
@javeme javeme merged commit 1b60c55 into master Mar 17, 2021
@javeme javeme deleted the comm branch March 17, 2021 03:45
yandababa2 pushed a commit to yandababa2/hugegraph-computer that referenced this pull request Oct 22, 2021
yandababa2 added a commit to yandababa2/hugegraph-computer that referenced this pull request Oct 22, 2021
yandababa2 pushed a commit to yandababa2/hugegraph-computer that referenced this pull request Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants