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 rebuild(boolean) for index label create #1106

Merged
merged 6 commits into from
Jul 24, 2020
Merged

Conversation

zhoney
Copy link
Contributor

@zhoney zhoney commented Jul 22, 2020

implements: #1105

Change-Id: I09385b0fde907f4bdcbc3a06e17261f4ede5aab3

implements: #1105

Change-Id: I09385b0fde907f4bdcbc3a06e17261f4ede5aab3
@codecov
Copy link

codecov bot commented Jul 22, 2020

Codecov Report

Merging #1106 into master will increase coverage by 9.02%.
The diff coverage is 38.46%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1106      +/-   ##
============================================
+ Coverage     60.35%   69.38%   +9.02%     
- Complexity     4709     5625     +916     
============================================
  Files           331      331              
  Lines         26997    27126     +129     
  Branches       3865     3898      +33     
============================================
+ Hits          16295    18821    +2526     
+ Misses         8915     6453    -2462     
- Partials       1787     1852      +65     
Impacted Files Coverage Δ Complexity Δ
.../com/baidu/hugegraph/api/schema/IndexLabelAPI.java 72.50% <0.00%> (-1.86%) 0.00 <0.00> (ø)
...in/java/com/baidu/hugegraph/schema/IndexLabel.java 79.56% <ø> (+4.30%) 39.00 <0.00> (+2.00)
...du/hugegraph/schema/builder/IndexLabelBuilder.java 88.14% <40.00%> (-0.02%) 115.00 <0.00> (+4.00) ⬇️
...n/java/com/baidu/hugegraph/version/ApiVersion.java 75.00% <100.00%> (ø) 0.00 <0.00> (ø)
...om/baidu/hugegraph/backend/query/QueryResults.java 71.15% <0.00%> (-10.48%) 40.00% <0.00%> (+1.00%) ⬇️
...n/java/com/baidu/hugegraph/config/CoreOptions.java 99.04% <0.00%> (+0.02%) 2.00% <0.00%> (ø%)
.../baidu/hugegraph/backend/tx/SchemaTransaction.java 91.54% <0.00%> (+0.49%) 70.00% <0.00%> (+1.00%)
...om/baidu/hugegraph/task/StandardTaskScheduler.java 79.39% <0.00%> (+0.50%) 90.00% <0.00%> (+9.00%)
...n/java/com/baidu/hugegraph/structure/HugeEdge.java 74.74% <0.00%> (+0.51%) 85.00% <0.00%> (+4.00%)
...ava/com/baidu/hugegraph/structure/HugeElement.java 70.52% <0.00%> (+0.52%) 70.00% <0.00%> (+3.00%)
... and 135 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 125b2ef...6032b1d. Read the comment docs.

@@ -272,6 +274,7 @@ public void checkUpdate() {
if (this.checkExist != null) {
builder.checkExist(this.checkExist);
}
builder.rebuild(this.rebuild);
Copy link
Contributor

Choose a reason for hiding this comment

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

prefer keep "Boolean rebuild" define and call builder.rebuild(this.rebuild) if (this. rebuild != null)

Change-Id: I2f4fc7865ccd8e6521a9dce39cf1b389015df027
Change-Id: I47aca53280ee3fd21cbe47c3e2ef0490dca29362
if (!this.rebuild) {
indexLabel.status(SchemaStatus.CREATED);
this.graph().addIndexLabel(schemaLabel, indexLabel);
return new IndexLabel.CreatedIndexLabel(indexLabel, null);
Copy link
Contributor

Choose a reason for hiding this comment

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

return ID_ZERO instead of null

Change-Id: I4c89f1fe4b5317e5b0a1c93744d57470a56c129c
Change-Id: I772e98d33f822654b8d5015ba374d1d9cb5ec71b
@@ -225,7 +241,7 @@ public IndexLabel create() {
IndexLabel.CreatedIndexLabel createdIndexLabel = this.createWithTask();

Id task = createdIndexLabel.task();
if (task == null) {
if (task == IdGenerator.ZERO) {
Copy link
Contributor

Choose a reason for hiding this comment

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

update comment at line 245

Change-Id: I6d399bf0d90f6c91ab64c2bdd01edcb4a35c0a50
@Linary Linary merged commit 3cac836 into master Jul 24, 2020
@Linary Linary deleted the no-rebuild-il-create branch July 24, 2020 09:55
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