-
Notifications
You must be signed in to change notification settings - Fork 528
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
upgrade store version due to read frequency of property key #1341
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -483,16 +483,16 @@ public VertexLabel readVertexLabel(HugeGraph graph, | |
|
||
TableBackendEntry entry = this.convertEntry(backendEntry); | ||
|
||
Number id = entry.column(HugeKeys.ID); | ||
String name = entry.column(HugeKeys.NAME); | ||
Number idStrategy = entry.column(HugeKeys.ID_STRATEGY); | ||
Object properties = entry.column(HugeKeys.PROPERTIES); | ||
Object primaryKeys = entry.column(HugeKeys.PRIMARY_KEYS); | ||
Object nullableKeys = entry.column(HugeKeys.NULLABLE_KEYS); | ||
Object indexLabels = entry.column(HugeKeys.INDEX_LABELS); | ||
Number status = entry.column(HugeKeys.STATUS); | ||
Number ttl = entry.column(HugeKeys.TTL); | ||
Number ttlStartTime = entry.column(HugeKeys.TTL_START_TIME); | ||
Number id = schemaColumn(entry, HugeKeys.ID); | ||
String name = schemaColumn(entry, HugeKeys.NAME); | ||
Number idStrategy = schemaColumn(entry, HugeKeys.ID_STRATEGY); | ||
Object properties = schemaColumn(entry, HugeKeys.PROPERTIES); | ||
Object primaryKeys = schemaColumn(entry, HugeKeys.PRIMARY_KEYS); | ||
Object nullableKeys = schemaColumn(entry, HugeKeys.NULLABLE_KEYS); | ||
Object indexLabels = schemaColumn(entry, HugeKeys.INDEX_LABELS); | ||
Number status = schemaColumn(entry, HugeKeys.STATUS); | ||
Number ttl = schemaColumn(entry, HugeKeys.TTL); | ||
Number ttlStartTime = schemaColumn(entry, HugeKeys.TTL_START_TIME); | ||
|
||
VertexLabel vertexLabel = new VertexLabel(graph, this.toId(id), name); | ||
vertexLabel.idStrategy(SerialEnum.fromCode(IdStrategy.class, | ||
|
@@ -518,18 +518,18 @@ public EdgeLabel readEdgeLabel(HugeGraph graph, BackendEntry backendEntry) { | |
|
||
TableBackendEntry entry = this.convertEntry(backendEntry); | ||
|
||
Number id = entry.column(HugeKeys.ID); | ||
String name = entry.column(HugeKeys.NAME); | ||
Number frequency = entry.column(HugeKeys.FREQUENCY); | ||
Number sourceLabel = entry.column(HugeKeys.SOURCE_LABEL); | ||
Number targetLabel = entry.column(HugeKeys.TARGET_LABEL); | ||
Object sortKeys = entry.column(HugeKeys.SORT_KEYS); | ||
Object nullableKeys = entry.column(HugeKeys.NULLABLE_KEYS); | ||
Object properties = entry.column(HugeKeys.PROPERTIES); | ||
Object indexLabels = entry.column(HugeKeys.INDEX_LABELS); | ||
Number status = entry.column(HugeKeys.STATUS); | ||
Number ttl = entry.column(HugeKeys.TTL); | ||
Number ttlStartTime = entry.column(HugeKeys.TTL_START_TIME); | ||
Number id = schemaColumn(entry, HugeKeys.ID); | ||
String name = schemaColumn(entry, HugeKeys.NAME); | ||
Number frequency = schemaColumn(entry, HugeKeys.FREQUENCY); | ||
Number sourceLabel = schemaColumn(entry, HugeKeys.SOURCE_LABEL); | ||
Number targetLabel = schemaColumn(entry, HugeKeys.TARGET_LABEL); | ||
Object sortKeys = schemaColumn(entry, HugeKeys.SORT_KEYS); | ||
Object nullableKeys = schemaColumn(entry, HugeKeys.NULLABLE_KEYS); | ||
Object properties = schemaColumn(entry, HugeKeys.PROPERTIES); | ||
Object indexLabels = schemaColumn(entry, HugeKeys.INDEX_LABELS); | ||
Number status = schemaColumn(entry, HugeKeys.STATUS); | ||
Number ttl = schemaColumn(entry, HugeKeys.TTL); | ||
Number ttlStartTime = schemaColumn(entry, HugeKeys.TTL_START_TIME); | ||
|
||
EdgeLabel edgeLabel = new EdgeLabel(graph, this.toId(id), name); | ||
edgeLabel.frequency(SerialEnum.fromCode(Frequency.class, | ||
|
@@ -558,14 +558,14 @@ public PropertyKey readPropertyKey(HugeGraph graph, | |
|
||
TableBackendEntry entry = this.convertEntry(backendEntry); | ||
|
||
Number id = entry.column(HugeKeys.ID); | ||
String name = entry.column(HugeKeys.NAME); | ||
Number dataType = entry.column(HugeKeys.DATA_TYPE); | ||
Number cardinality = entry.column(HugeKeys.CARDINALITY); | ||
Number aggregateType = entry.column(HugeKeys.AGGREGATE_TYPE); | ||
Number readFrequency = entry.column(HugeKeys.READ_FREQUENCY); | ||
Object properties = entry.column(HugeKeys.PROPERTIES); | ||
Number status = entry.column(HugeKeys.STATUS); | ||
Number id = schemaColumn(entry, HugeKeys.ID); | ||
String name = schemaColumn(entry, HugeKeys.NAME); | ||
Number dataType = schemaColumn(entry, HugeKeys.DATA_TYPE); | ||
Number cardinality = schemaColumn(entry, HugeKeys.CARDINALITY); | ||
Number aggregateType = schemaColumn(entry, HugeKeys.AGGREGATE_TYPE); | ||
Number readFrequency = schemaColumn(entry, HugeKeys.READ_FREQUENCY); | ||
Object properties = schemaColumn(entry, HugeKeys.PROPERTIES); | ||
Number status = schemaColumn(entry, HugeKeys.STATUS); | ||
|
||
PropertyKey propertyKey = new PropertyKey(graph, this.toId(id), name); | ||
propertyKey.dataType(SerialEnum.fromCode(DataType.class, | ||
|
@@ -610,13 +610,13 @@ public IndexLabel readIndexLabel(HugeGraph graph, | |
|
||
TableBackendEntry entry = this.convertEntry(backendEntry); | ||
|
||
Number id = entry.column(HugeKeys.ID); | ||
String name = entry.column(HugeKeys.NAME); | ||
Number baseType = entry.column(HugeKeys.BASE_TYPE); | ||
Number baseValueId = entry.column(HugeKeys.BASE_VALUE); | ||
Number indexType = entry.column(HugeKeys.INDEX_TYPE); | ||
Object indexFields = entry.column(HugeKeys.FIELDS); | ||
Number status = entry.column(HugeKeys.STATUS); | ||
Number id = schemaColumn(entry, HugeKeys.ID); | ||
String name = schemaColumn(entry, HugeKeys.NAME); | ||
Number baseType = schemaColumn(entry, HugeKeys.BASE_TYPE); | ||
Number baseValueId = schemaColumn(entry, HugeKeys.BASE_VALUE); | ||
Number indexType = schemaColumn(entry, HugeKeys.INDEX_TYPE); | ||
Object indexFields = schemaColumn(entry, HugeKeys.FIELDS); | ||
Number status = schemaColumn(entry, HugeKeys.STATUS); | ||
|
||
IndexLabel indexLabel = new IndexLabel(graph, this.toId(id), name); | ||
indexLabel.baseType(SerialEnum.fromCode(HugeType.class, | ||
|
@@ -669,7 +669,8 @@ protected void writeEnableLabelIndex(SchemaLabel schema, | |
|
||
protected void readEnableLabelIndex(SchemaLabel schema, | ||
TableBackendEntry entry) { | ||
Boolean enableLabelIndex = entry.column(HugeKeys.ENABLE_LABEL_INDEX); | ||
Boolean enableLabelIndex = schemaColumn(entry, | ||
HugeKeys.ENABLE_LABEL_INDEX); | ||
schema.enableLabelIndex(enableLabelIndex); | ||
} | ||
|
||
|
@@ -678,4 +679,13 @@ protected abstract void writeUserdata(SchemaElement schema, | |
|
||
protected abstract void readUserdata(SchemaElement schema, | ||
TableBackendEntry entry); | ||
|
||
private static <T> T schemaColumn(TableBackendEntry entry, HugeKeys key) { | ||
assert entry.type().isSchema(); | ||
|
||
T column = entry.column(key); | ||
E.checkState(column != null, "Not found key '%s' from entry %s", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wrap line before message |
||
key, entry); | ||
return column; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
how to deal with can't get version-info from old version backend