-
Notifications
You must be signed in to change notification settings - Fork 575
support olap writeback for cassandra and rocksdb #1506
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
hugegraph-api/src/main/java/com/baidu/hugegraph/api/schema/PropertyKeyAPI.java
Show resolved
Hide resolved
hugegraph-api/src/main/java/com/baidu/hugegraph/serializer/JsonSerializer.java
Outdated
Show resolved
Hide resolved
hugegraph-api/src/main/java/com/baidu/hugegraph/serializer/JsonSerializer.java
Outdated
Show resolved
Hide resolved
...h-cassandra/src/main/java/com/baidu/hugegraph/backend/store/cassandra/CassandraFeatures.java
Show resolved
Hide resolved
hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/SchemaTransaction.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| public boolean olap() { | ||
| return this.olap; |
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.
can return olapPks != null && olapPks not empty
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.
olapPks is for query Vertex, olap is for index query
hugegraph-core/src/main/java/com/baidu/hugegraph/backend/query/Query.java
Outdated
Show resolved
Hide resolved
hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/GraphIndexTransaction.java
Show resolved
Hide resolved
hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/GraphIndexTransaction.java
Outdated
Show resolved
Hide resolved
hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/GraphIndexTransaction.java
Outdated
Show resolved
Hide resolved
a651bbf to
87b0d62
Compare
Codecov Report
@@ Coverage Diff @@
## master #1506 +/- ##
============================================
+ Coverage 59.47% 60.36% +0.88%
- Complexity 6212 6394 +182
============================================
Files 412 417 +5
Lines 33657 34293 +636
Branches 4638 4735 +97
============================================
+ Hits 20019 20701 +682
+ Misses 11545 11458 -87
- Partials 2093 2134 +41
Continue to review full report at Codecov.
|
|
| @Override | ||
| public void addIndexLabel(SchemaLabel schemaLabel, IndexLabel indexLabel) { | ||
| assert this.name.equals(schemaLabel.graph().name()); | ||
| assert ALL_VL.equals(schemaLabel) || |
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.
ALL_VL means what
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.
ALL_VL means all of vertex labels
hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/GraphIndexTransaction.java
Outdated
Show resolved
Hide resolved
hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/GraphIndexTransaction.java
Outdated
Show resolved
Hide resolved
hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/SchemaTransaction.java
Outdated
Show resolved
Hide resolved
|
|
||
| private void clearVertexCache() { | ||
| Future<?> future = this.graphEventHub.notify(Events.CACHE, "clear", | ||
| HugeType.VERTEX); |
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.
need to clear edges cache?
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.
olap properties only affect vertex query results, seems no need to clear edge cache
hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBStore.java
Outdated
Show resolved
Hide resolved
hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBStore.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| @Override | ||
| public void checkAndRegisterOlapTable(Id pkId) { |
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.
not covered by tests
hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBTables.java
Outdated
Show resolved
Hide resolved
|
|
||
| public static class OlapRangeIntIndex extends RangeIntIndex { | ||
|
|
||
| public static final String TABLE = HugeType.OLAP.string(); |
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.
is it the same table name as OlapSecondaryIndex
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.
no, it's like g_ap_ii
hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/SchemaTransaction.java
Outdated
Show resolved
Hide resolved
hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/SchemaTransaction.java
Outdated
Show resolved
Hide resolved
| return this.store() + "_" + HugeType.OLAP.string() + "_" + type.string(); | ||
| return this.store() + "_" + | ||
| HugeType.OLAP.string().toLowerCase() + "_" + | ||
| type.string().toLowerCase(); |
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.
each query will call this method?
use StringBuilder with init-capacity
| public default String olapTableName(Id id) { | ||
| return this.store() + "_" + HugeType.OLAP.string() + "_" + id.asLong(); | ||
| return this.store() + "_" + | ||
| HugeType.OLAP.string().toLowerCase() + "_" + id.asLong(); |
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.
ditto
| if (entry.type() == HugeType.OLAP) { | ||
| table = this.table(this.olapTableName(entry.subId())); | ||
| session = this.session(HugeType.OLAP); | ||
| } else { | ||
| table = this.table(entry.type()); | ||
| } | ||
| table.insert(session, entry); |
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.
move this block to line 446
| } | ||
| } | ||
|
|
||
| protected RocksDBSessions db(HugeType tableType) { |
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.
move to the line of db(String disk) method
| * [1.10] #1333: support read frequency for property key | ||
| * [1.11] #1506: support olap properties | ||
| * [1.11] #1506: support olap properties and rename read frequency to | ||
| * write type |
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.
remove "rename read frequency..."?
| StringBuilder sb = new StringBuilder(7); | ||
| sb.append(this.store()) | ||
| .append("_") | ||
| .append(HugeType.OLAP.string().toLowerCase()) |
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.
HugeType itself is LowerCase?
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.
no. HugeType.string() is UpperCase
hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/BackendStore.java
Outdated
Show resolved
Hide resolved
hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/BackendStore.java
Outdated
Show resolved
Hide resolved
| BackendEntry entry = item.entry(); | ||
|
|
||
| RocksDBTable table; | ||
| if (entry.type() != HugeType.OLAP && !entry.olap()) { |
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.
not the same between entry.olap() and entry.type() == HugeType.OLAP?
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.
not same. entry.type() == HugeType.OLAP means olap vertex, but entry.olap() means olap vertex index
Change-Id: I947c3a96eb7aa67ee9eff5f7fb248e9f4539e91b
Change-Id: Iaacdbaca95630dd37fedd134c8f9ff04516f4d17
Change-Id: I068266c57aa7b0f5b1ed8979868cf5ebd6ee33cd
Change-Id: Ic48c2cba1d2f4d427cc9eeea2dd6268c1b9fa334
Change-Id: I1173061e9aed6e1f1d171f5c72f0bea487aa864a
Change-Id: I72007fea93f7a32d3a25794b184640656d28e7f3
Change-Id: I54e3f4399bcebaa587d263962b01303b2e387676
Change-Id: I947c3a96eb7aa67ee9eff5f7fb248e9f4539e91b