Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

imbajin
Copy link
Contributor

@imbajin imbajin commented Sep 15, 2019

No description provided.

List<Vertex> vertices = vertexAPI.update(req);
assertBatchResponse(vertices, "price", 1);

req = batchVertexRequest("list", "old", "new", UpdateStrategy.OVERRIDE);
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 always only one element in the list, is it expected and reasonable?

Copy link
Contributor Author

@imbajin imbajin Sep 16, 2019

Choose a reason for hiding this comment

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

OVERRIDE is used for this case:

Person have 3 props: name, price, list ,and only price have update strategy

  1. Old value from backend : tom, -1, [oldStr1, oldStr2](list)
  2. New value1 from json : tom, 1, [newStr1, newStr2]
  3. New value2 from json : tom, null, null
  4. After update , get: tom, 1, [newStr1, newStr2]

however, if we don't set update strategy for list, we will get tom, 1 and lose the list property. OVERRIDE's role is simply to cover olds

Copy link
Contributor

Choose a reason for hiding this comment

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

That's OK, if we can override the list as a whole.

Linary
Linary previously approved these changes Sep 18, 2019
this.edges = null;
this.updateStrategies = null;
this.checkVertex = false;
this.createIfNotExist = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Expand accepted api version(0.45) in HugeClient

private void checkServerApiVersion() {
VersionUtil.Version apiVersion = VersionUtil.Version.of(
this.version.getApiVersion());
VersionUtil.check(apiVersion, "0.38", "0.45",
Copy link
Contributor

Choose a reason for hiding this comment

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

upgrade pom version to 1.7.7


Builder useCustomizeNumberId();

Builder useCustomizeUuid();
Copy link
Contributor

Choose a reason for hiding this comment

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

also update IdStrategy.isCustomize() method to

this == IdStrategy.CUSTOMIZE_STRING || this == IdStrategy.CUSTOMIZE_NUMBER || this == IdStrategy.CUSTOMIZE_UUID;

and please add method in IdStrategy.class

public boolean isCustomizeUUID() {
        return this == IdStrategy.CUSTOMIZE_UUID;
    }

Builder useCustomizeUuid();
Builder useCustomizeUUID();

Builder properties(String... properties);
Copy link
Contributor

Choose a reason for hiding this comment

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

also please add method in DataType.class

public boolean isBoolean() {
        return this == BOOLEAN;
    }

VersionUtil.Version apiVersion = VersionUtil.Version.of(
this.version.getApiVersion());
VersionUtil.check(apiVersion, "0.38", "0.45",
VersionUtil.check(apiVersion, "0.38", "0.46",
Copy link
Contributor

Choose a reason for hiding this comment

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

check no UpdateStrategy.OVERRIDE if apiVersion<0.45 at sending request

@imbajin imbajin force-pushed the adapt-update-strategy branch from c0d6d71 to 94cfd28 Compare September 24, 2019 16:37
@codecov
Copy link

codecov bot commented Sep 24, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@41a631f). Click here to learn what that means.
The diff coverage is 69.23%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #64   +/-   ##
=========================================
  Coverage          ?   75.47%           
  Complexity        ?      514           
=========================================
  Files             ?       94           
  Lines             ?     2316           
  Branches          ?      143           
=========================================
  Hits              ?     1748           
  Misses            ?      465           
  Partials          ?      103
Impacted Files Coverage Δ Complexity Δ
.../baidu/hugegraph/structure/schema/VertexLabel.java 92.85% <ø> (ø) 4 <0> (?)
.../baidu/hugegraph/structure/schema/PropertyKey.java 70.37% <ø> (ø) 3 <0> (?)
...m/baidu/hugegraph/structure/constant/DataType.java 67.85% <0%> (ø) 2 <0> (?)
...baidu/hugegraph/structure/constant/IdStrategy.java 54.54% <0%> (ø) 2 <0> (?)
.../hugegraph/api/graph/structure/UpdateStrategy.java 100% <100%> (ø) 1 <0> (?)
...ugegraph/api/graph/structure/BatchEdgeRequest.java 82.14% <100%> (ø) 2 <1> (?)
...egraph/api/graph/structure/BatchVertexRequest.java 80% <100%> (ø) 2 <1> (?)
...in/java/com/baidu/hugegraph/driver/HugeClient.java 63.63% <100%> (ø) 11 <0> (?)
...in/java/com/baidu/hugegraph/api/graph/EdgeAPI.java 93.61% <100%> (ø) 11 <1> (?)
.../java/com/baidu/hugegraph/api/graph/VertexAPI.java 93.18% <100%> (ø) 11 <1> (?)
... and 2 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 41a631f...94cfd28. Read the comment docs.

@Linary Linary merged commit 451e08f into hugegraph:master Sep 25, 2019
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.

4 participants