Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add entrance for pagerank and wcc #1114

Merged
merged 6 commits into from
Jul 28, 2020
Merged

add entrance for pagerank and wcc #1114

merged 6 commits into from
Jul 28, 2020

Conversation

zhoney
Copy link
Contributor

@zhoney zhoney commented Jul 27, 2020

Change-Id: I9d0a35ac8ea2cd7f1c9b6cf86a62a06e68d6498d

Change-Id: I9d0a35ac8ea2cd7f1c9b6cf86a62a06e68d6498d
Change-Id: I5dcd536180e34d25a72b84b0160b198f2429f70b
@codecov
Copy link

codecov bot commented Jul 27, 2020

Codecov Report

Merging #1114 into master will decrease coverage by 3.25%.
The diff coverage is 1.93%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1114      +/-   ##
============================================
- Coverage     69.38%   66.13%   -3.26%     
- Complexity     5625     5652      +27     
============================================
  Files           331      354      +23     
  Lines         27126    28686    +1560     
  Branches       3898     4044     +146     
============================================
+ Hits          18821    18971     +150     
- Misses         6454     7847    +1393     
- Partials       1851     1868      +17     
Impacted Files Coverage Δ Complexity Δ
.../java/com/baidu/hugegraph/api/job/ComputerAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...main/java/com/baidu/hugegraph/job/ComputerJob.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...baidu/hugegraph/job/computer/AbstractComputer.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...com/baidu/hugegraph/job/computer/ComputerPool.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...baidu/hugegraph/job/computer/PageRankComputer.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...h/job/computer/WeakConnectedComponentComputer.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
.../java/com/baidu/hugegraph/task/HugeServerInfo.java 67.39% <0.00%> (-1.00%) 18.00 <1.00> (ø)
...om/baidu/hugegraph/task/StandardTaskScheduler.java 79.14% <0.00%> (-0.26%) 90.00 <0.00> (ø)
...n/java/com/baidu/hugegraph/util/ParameterUtil.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...n/java/com/baidu/hugegraph/config/CoreOptions.java 99.25% <100.00%> (+0.20%) 2.00 <0.00> (ø)
... and 49 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 3cac836...fabce45. Read the comment docs.

this.userDefinedParameters.put(PRECISION, threshold(parameters));
}

private static double threshold (Map<String, Object> parameters) {
Copy link
Contributor

Choose a reason for hiding this comment

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

remove space in "threshold ("

return value;
}

public static String parameterString(Map<String, Object> parameters,
Copy link
Contributor

Choose a reason for hiding this comment

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

add ParameterUtil class and move these methods to it

}

private Map<String, Object> readCommonConfig() {
return readSubConfig(COMMON);
Copy link
Contributor

Choose a reason for hiding this comment

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

this.readSubConfig

ComputePool pool = ComputePool.instance();
Compute compute = pool.find(name);
E.checkArgument(compute != null,
"There is no compute named '%s'", name);
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no compute method named

Change-Id: I7ddfa6ee3959739ed81529bcc7ae078a537fd699
builder.name("compute:" + compute)
.input(JsonUtil.toJson(input))
.job(new ComputeJob());
return ImmutableMap.of("task_id", builder.schedule().id());
Copy link
Contributor

Choose a reason for hiding this comment

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

define var for builder.schedule()


public static final ConfigOption<String> COMPUTER_CONFIG =
new ConfigOption<>(
"computer.config",
Copy link
Contributor

Choose a reason for hiding this comment

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

compute/computer unify into one

public static final String COMPUTE = "compute";

public static boolean check(String name, Map<String, Object> parameters) {
Compute algorithm = ComputePool.instance().find(name);
Copy link
Contributor

Choose a reason for hiding this comment

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

rename

@@ -212,6 +212,10 @@ public static HugeServerInfo fromVertex(Vertex vertex) {
}

public <V> boolean suitableFor(HugeTask<V> task, long now) {
if (task.compute() && !this.role.computer() ||
!task.compute() && this.role.computer()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

use task.compute() != this.role.computer()

this.userDefinedParameters.put(PRECISION, threshold(parameters));
}

private static double threshold(Map<String, Object> parameters) {
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 precision

@SuppressWarnings("unchecked")
private void setComputeSpecifiedParameters() {
((Map<String, Object>) this.commonConfig.get(EXTRA_ARGS))
.putAll(this.userDefinedParameters);
Copy link
Contributor

Choose a reason for hiding this comment

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

align with "."

@Override
public void checkParameters(Map<String, Object> parameters) {
this.userDefinedParameters.put(MAX_STEPS, maxSteps(parameters));
this.userDefinedParameters.put(ALPHA, alpha(parameters));
Copy link
Contributor

Choose a reason for hiding this comment

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

add precision

Compute compute = pool.find(name);
E.checkArgument(compute != null,
"There is no compute method named '%s'", name);
compute.checkParameters(parameters);
Copy link
Contributor

Choose a reason for hiding this comment

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

move into call and rename checkParameters to checkAndCollectParameters


private YamlConfiguration config;
private Map<String, Object> commonConfig = new HashMap<>();
protected Map<String, Object> userDefinedParameters = new HashMap<>();
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 define as field

Change-Id: I6038bd61f5ca9a664acabb4f2036efbda912e62a
// Set current compute job's specified parameters
this.setComputeSpecifiedParameters();
// Set current computer job's specified parameters
this.commonConfig.putAll(this.checkAndCollectParameters(parameters));
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 update commonConfig


// Construct shell command for compute job
// Construct shell command for computer job
Copy link
Contributor

Choose a reason for hiding this comment

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

this.constructShellCommands

import com.baidu.hugegraph.util.E;
import com.baidu.hugegraph.util.JsonUtil;

public class ComputeJob extends SysJob<Object> {
public class ComputerJob extends SysJob<Object> {
Copy link
Contributor

Choose a reason for hiding this comment

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

extends UserJob

Copy link
Contributor Author

Choose a reason for hiding this comment

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

need get computer conf from SysJob's params

Change-Id: I869d0d895917839269293a97b26ace4b7269b7ac
return true;
}

public HugeConfig config() {
Copy link
Contributor

Choose a reason for hiding this comment

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

do not expose HugeConfig to the outside

private static final String ARG_SYMBOL = "C";
private static final String MINUS = "-";
private static final String EQUAL = "=";
private static final String EMPTY = " ";
Copy link
Contributor

Choose a reason for hiding this comment

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

SPACE

try {
Process process = Runtime.getRuntime().exec(command);
exitCode = process.waitFor();
} catch (Exception e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

cache throwable

return DEFAULT_PRECISION;
}
double precision = ParameterUtil.parameterDouble(parameters, PRECISION);
E.checkArgument(precision > 0 && precision < 1,
Copy link
Contributor

Choose a reason for hiding this comment

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

change to 0.0 1.0

worker_heap: 10000,
vertex_input_dir: /data/data_wdc_600/arc,
workers: 51,
zookeeper_list: "10.157.11.170:2181",
Copy link
Contributor

Choose a reason for hiding this comment

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

127.0

Change-Id: I731fc6374992b834f22403be0734ca9288b21b34
@javeme javeme merged commit 5f60a29 into master Jul 28, 2020
@javeme javeme deleted the compute branch July 28, 2020 14:26
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.

None yet

3 participants