Skip to content

Conversation

@zhoney
Copy link
Contributor

@zhoney zhoney commented Jun 17, 2021

Change-Id: I947c3a96eb7aa67ee9eff5f7fb248e9f4539e91b

}

public boolean olap() {
return this.olap;
Copy link
Contributor

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

Copy link
Contributor Author

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

@zhoney zhoney force-pushed the olap-writeback branch 2 times, most recently from a651bbf to 87b0d62 Compare June 25, 2021 03:36
@codecov
Copy link

codecov bot commented Jun 25, 2021

Codecov Report

Merging #1506 (295355a) into master (379859a) will increase coverage by 0.88%.
The diff coverage is 81.05%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ
...api/src/main/java/com/baidu/hugegraph/api/API.java 69.04% <ø> (ø)
...ava/com/baidu/hugegraph/api/profile/GraphsAPI.java 10.71% <0.00%> (ø)
...ava/com/baidu/hugegraph/serializer/Serializer.java 0.00% <ø> (ø)
...e/src/main/java/com/baidu/hugegraph/HugeGraph.java 65.30% <ø> (ø)
...hugegraph/backend/serializer/TextBackendEntry.java 83.43% <0.00%> (-3.08%) ⬇️
...om/baidu/hugegraph/backend/store/BackendEntry.java 69.44% <0.00%> (-1.99%) ⬇️
.../hugegraph/backend/store/BackendStoreProvider.java 0.00% <0.00%> (ø)
...hugegraph/backend/store/mysql/MysqlSerializer.java 0.00% <0.00%> (ø)
...egraph/backend/store/mysql/MysqlStoreProvider.java 0.00% <ø> (ø)
...idu/hugegraph/backend/store/mysql/MysqlTables.java 0.00% <0.00%> (ø)
... and 82 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 379859a...295355a. Read the comment docs.

@javeme
Copy link
Contributor

javeme commented Jun 25, 2021

Error:  Tests run: 371, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 628.431 s <<< FAILURE! - in com.baidu.hugegraph.unit.UnitTestSuite
Error:  testToString(com.baidu.hugegraph.unit.core.QueryTest)  Time elapsed: 0.013 s  <<< FAILURE!
org.junit.ComparisonFailure: expected:<...e id in [1, 3] and [[LABEL == 3, PROPERTIES < 18]]`> but was:<...e id in [1, 3] and [[PROPERTIES < 18, LABEL == 3]]`>
	at com.baidu.hugegraph.unit.core.QueryTest.testToString(QueryTest.java:120)

@Override
public void addIndexLabel(SchemaLabel schemaLabel, IndexLabel indexLabel) {
assert this.name.equals(schemaLabel.graph().name());
assert ALL_VL.equals(schemaLabel) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

ALL_VL means what

Copy link
Contributor Author

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


private void clearVertexCache() {
Future<?> future = this.graphEventHub.notify(Events.CACHE, "clear",
HugeType.VERTEX);
Copy link
Contributor

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?

Copy link
Contributor Author

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

}

@Override
public void checkAndRegisterOlapTable(Id pkId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

not covered by tests


public static class OlapRangeIntIndex extends RangeIntIndex {

public static final String TABLE = HugeType.OLAP.string();
Copy link
Contributor

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

Copy link
Contributor Author

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

return this.store() + "_" + HugeType.OLAP.string() + "_" + type.string();
return this.store() + "_" +
HugeType.OLAP.string().toLowerCase() + "_" +
type.string().toLowerCase();
Copy link
Contributor

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();
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Comment on lines 449 to 458
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);
Copy link
Contributor

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) {
Copy link
Contributor

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
Copy link
Contributor

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())
Copy link
Contributor

Choose a reason for hiding this comment

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

HugeType itself is LowerCase?

Copy link
Contributor Author

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

BackendEntry entry = item.entry();

RocksDBTable table;
if (entry.type() != HugeType.OLAP && !entry.olap()) {
Copy link
Contributor

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?

Copy link
Contributor Author

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

zhoney added 13 commits July 20, 2021 18:02
Change-Id: I947c3a96eb7aa67ee9eff5f7fb248e9f4539e91b
Change-Id: Iaacdbaca95630dd37fedd134c8f9ff04516f4d17
Change-Id: I068266c57aa7b0f5b1ed8979868cf5ebd6ee33cd
Change-Id: Id1ffefc10cba8306743acee20e20dee926865da6
Change-Id: Ic48c2cba1d2f4d427cc9eeea2dd6268c1b9fa334
Change-Id: Ifa5c0fba1488fec0636c58892992ffa49d75265f
Change-Id: Ice6dce962b54d54e59303338cfe42921221e5c8f
Change-Id: I1173061e9aed6e1f1d171f5c72f0bea487aa864a
Change-Id: I72007fea93f7a32d3a25794b184640656d28e7f3
Change-Id: Ie92f81aec2cd1d10a815c02f946ef01f9d657823
Change-Id: I97d2cea75ec344aa6ccd5587e24351f3e7ed05a9
Change-Id: I54e3f4399bcebaa587d263962b01303b2e387676
Change-Id: If1ccf204837b671cd53904834a80f72020ed9d90
Change-Id: I273d215355ec5d49ebb9ba3cf8159b1af013f937
@zhoney zhoney merged commit ef37b3a into master Jul 22, 2021
@zhoney zhoney deleted the olap-writeback branch July 22, 2021 15:53
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.

3 participants