-
Notifications
You must be signed in to change notification settings - Fork 45
Adapt batch update strategy #64
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
Conversation
List<Vertex> vertices = vertexAPI.update(req); | ||
assertBatchResponse(vertices, "price", 1); | ||
|
||
req = batchVertexRequest("list", "old", "new", UpdateStrategy.OVERRIDE); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 onlyprice
have update strategy
- Old value from backend :
tom, -1, [oldStr1, oldStr2](list)
- New value1 from json :
tom, 1, [newStr1, newStr2]
- New value2 from json :
tom, null, null
- 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
There was a problem hiding this comment.
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.
this.edges = null; | ||
this.updateStrategies = null; | ||
this.checkVertex = false; | ||
this.createIfNotExist = true; |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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
c0d6d71
to
94cfd28
Compare
Codecov Report
@@ Coverage Diff @@
## master #64 +/- ##
=========================================
Coverage ? 75.47%
Complexity ? 514
=========================================
Files ? 94
Lines ? 2316
Branches ? 143
=========================================
Hits ? 1748
Misses ? 465
Partials ? 103
Continue to review full report at Codecov.
|
No description provided.