Skip to content

add DataDirManager#43

Merged
houzhizhen merged 6 commits intomasterfrom
data-server-manager
May 8, 2021
Merged

add DataDirManager#43
houzhizhen merged 6 commits intomasterfrom
data-server-manager

Conversation

@houzhizhen
Copy link
Copy Markdown
Contributor

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2021

Codecov Report

Merging #43 (6c336a5) into master (c9e5ef4) will increase coverage by 0.08%.
The diff coverage is 92.68%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #43      +/-   ##
============================================
+ Coverage     83.14%   83.23%   +0.08%     
- Complexity     1362     1373      +11     
============================================
  Files           149      150       +1     
  Lines          4522     4563      +41     
  Branches        379      381       +2     
============================================
+ Hits           3760     3798      +38     
  Misses          534      534              
- Partials        228      231       +3     
Impacted Files Coverage Δ Complexity Δ
...hugegraph/computer/core/store/DataFileManager.java 91.42% <91.42%> (ø) 11.00 <11.00> (?)
...ugegraph/computer/core/config/ComputerOptions.java 99.37% <100.00%> (+0.02%) 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 c9e5ef4...6c336a5. Read the comment docs.

@houzhizhen houzhizhen force-pushed the data-server-manager branch from c89310d to 63d548b Compare April 28, 2021 11:07
@Override
public File nextDir() {
int index = this.sequence.incrementAndGet();
// Index can't be negative.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just add assert index >= 0


import java.io.File;

public interface DataDirHandler {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

prefer DataFilesHandler
and seems this is not handler

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

DataFilesHandler -> DataFileGenerator

/**
* @return the next file to persist data like vertices, edges and messages.
*/
File nextFile(String label, int superstep);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what does the label mean

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

label means message type, different message type in different directory.

@houzhizhen houzhizhen force-pushed the data-server-manager branch from 63d548b to ef125fa Compare April 30, 2021 02:53
@houzhizhen houzhizhen force-pushed the data-server-manager branch from ef125fa to 489403d Compare May 6, 2021 12:22
public static final ConfigOption<Long> WORKER_RECEIVE_BUFFERS_SIZE_LIMIT =
new ConfigOption<>(
"worker.receive_buffers_size_limit",
"The limit of received buffers that total size can't " +
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The limit bytes of buffers of received data, the total size of all buffers can't excess this limit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

"worker.receive_buffers_size_limit",
"The limit of received buffers that total size can't " +
"excess this limit. If received buffers reach this limit," +
" they will be merged into a file. ",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

put space to the previous line as possible

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done


public static final ConfigOption<Long> WORKER_RECEIVE_BUFFERS_SIZE_LIMIT =
new ConfigOption<>(
"worker.receive_buffers_size_limit",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

received_buffers_bytes_limit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

new ConfigListOption<>(
"worker.data_dirs",
true,
"The dirs separated by ',' that received vertices and " +
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dirs -- use full name

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

"messages can persist into. ",
disallowEmpty(),
String.class,
ImmutableList.of("_temporary")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

set "jobs" instead of "_temporary"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

public void init(Config config) {
String jobId = config.get(ComputerOptions.JOB_ID);
List<String> paths = config.get(ComputerOptions.WORKER_DATA_DIRS);
LOG.info("Worker data dirs: {}", paths);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

improve message

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

File dir = new File(path);
File jobDir = new File(dir, jobId);
this.mkdirs(jobDir);
LOG.info("Added data dir: {}", jobDir);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

improve message, add more details and context

);

public static final ConfigOption<Long> WORKER_RECEIVE_BUFFERS_SIZE_LIMIT =
public static final ConfigOption<Long> WORKER_RECEIVED_BUFFERS_SIZE_LIMIT =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WORKER_RECEIVED_BUFFERS_BYTES_LIMIT

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

" they will be merged into a file. ",
"worker.received_buffers_bytes_limit",
"The limit bytes of buffers of received data, the " +
"total size of all buffers can't excess this limit. If " +
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

adjust wrap line

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

String jobId = config.get(ComputerOptions.JOB_ID);
List<String> paths = config.get(ComputerOptions.WORKER_DATA_DIRS);
LOG.info("Worker data dirs: {}", paths);
LOG.info("The directories '{}' configured to persist data", paths);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The directories '{}' configured to persist data for job {}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

File jobDir = new File(dir, jobId);
this.mkdirs(jobDir);
LOG.info("Added data dir: {}", jobDir);
LOG.info("Initialized directory {} to directory list", jobDir);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

debug

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@houzhizhen houzhizhen merged commit 1aaf9c0 into master May 8, 2021
@houzhizhen houzhizhen deleted the data-server-manager branch May 8, 2021 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants