Skip to content

Commit

Permalink
Add nodes and data size to extra param (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
Linary authored Feb 4, 2020
1 parent 4bd64ce commit 0a71d12
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.baidu.hugegraph</groupId>
<artifactId>hugegraph-common</artifactId>
<version>1.7.2</version>
<version>1.7.3</version>

<name>hugegraph-common</name>
<url>https://github.com/hugegraph/hugegraph-common</url>
Expand Down Expand Up @@ -218,7 +218,7 @@
<manifestEntries>
<!-- Must be on one line, otherwise the automatic
upgrade script cannot replace the version number -->
<Implementation-Version>1.7.2.0</Implementation-Version>
<Implementation-Version>1.7.3.0</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
Expand Down
31 changes: 31 additions & 0 deletions src/main/java/com/baidu/hugegraph/license/ExtraParam.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,30 @@ public class ExtraParam {
@JsonProperty("cpus")
private int cpus;

// The unit is MB
@JsonProperty("ram")
private int ram;

@JsonProperty("threads")
private int threads;

// The unit is MB
@JsonProperty("memory")
private int memory;

@JsonProperty("nodes")
private int nodes;

// The unit is MB
@JsonProperty("data_size")
private long dataSize;

@JsonProperty("vertices")
private long vertices;

@JsonProperty("edges")
private long edges;

public String id() {
return this.id;
}
Expand Down Expand Up @@ -85,4 +100,20 @@ public int threads() {
public int memory() {
return this.memory;
}

public int nodes() {
return this.nodes;
}

public long dataSize() {
return this.dataSize;
}

public long vertices() {
return this.vertices;
}

public long edges() {
return this.edges;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ public class CommonVersion {

// The second parameter of Version.of() is for all-in-one JAR
public static final Version VERSION = Version.of(CommonVersion.class,
"1.7.2");
"1.7.3");
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ public void testDeserializeExtraParam() throws IOException {
+ "\"cpus\":32,"
+ "\"ram\":65536,"
+ "\"threads\":96,"
+ "\"memory\":32768"
+ "\"memory\":32768,"
+ "\"nodes\":3,"
+ "\"data_size\":1024,"
+ "\"vertices\":1000,"
+ "\"edges\":2000"
+ "}";
ObjectMapper mapper = new ObjectMapper();
ExtraParam param = mapper.readValue(json, ExtraParam.class);
Expand All @@ -53,5 +57,9 @@ public void testDeserializeExtraParam() throws IOException {
Assert.assertEquals(65536, param.ram());
Assert.assertEquals(96, param.threads());
Assert.assertEquals(32768, param.memory());
Assert.assertEquals(3, param.nodes());
Assert.assertEquals(1024, param.dataSize());
Assert.assertEquals(1000, param.vertices());
Assert.assertEquals(2000, param.edges());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ public void testDeserializeLicenseCreateParam()
+ "\"cpus\":32,"
+ "\"ram\":65536,"
+ "\"threads\":96,"
+ "\"memory\":32768"
+ "\"memory\":32768,"
+ "\"nodes\":3,"
+ "\"data_size\":1024,"
+ "\"vertices\":1000,"
+ "\"edges\":2000"
+ "},"
+ "{"
+ "\"id\":\"server-2\","
Expand All @@ -70,7 +74,11 @@ public void testDeserializeLicenseCreateParam()
+ "\"cpus\":64,"
+ "\"ram\":65536,"
+ "\"threads\":96,"
+ "\"memory\":65536"
+ "\"memory\":65536,"
+ "\"nodes\":30,"
+ "\"data_size\":10240,"
+ "\"vertices\":10000,"
+ "\"edges\":20000"
+ "}"
+ "]"
+ "}";
Expand Down

0 comments on commit 0a71d12

Please sign in to comment.