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

Hbase shard improve and implement mysql/memory shard #974

Merged
merged 8 commits into from
May 19, 2020

Conversation

zhoney
Copy link
Contributor

@zhoney zhoney commented Apr 27, 2020

@codecov
Copy link

codecov bot commented Apr 28, 2020

Codecov Report

Merging #974 into master will decrease coverage by 0.29%.
The diff coverage is 53.82%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #974      +/-   ##
============================================
- Coverage     70.02%   69.73%   -0.30%     
- Complexity     5255     5276      +21     
============================================
  Files           324      324              
  Lines         25433    25730     +297     
  Branches       3559     3619      +60     
============================================
+ Hits          17810    17943     +133     
- Misses         5920     6067     +147     
- Partials       1703     1720      +17     
Impacted Files Coverage Δ Complexity Δ
...gegraph/backend/store/rocksdb/RocksDBSessions.java 100.00% <ø> (ø) 1.00 <0.00> (ø)
...h/backend/store/rocksdbsst/RocksDBSstSessions.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...om/baidu/hugegraph/backend/store/BackendTable.java 25.82% <14.28%> (-66.18%) 11.00 <0.00> (-1.00)
...ugegraph/backend/store/memory/InMemoryDBTable.java 67.14% <28.12%> (-10.84%) 42.00 <10.00> (+1.00) ⬇️
...u/hugegraph/backend/store/mysql/MysqlFeatures.java 80.00% <50.00%> (-5.00%) 16.00 <1.00> (-1.00)
...raph/backend/store/rocksdb/RocksDBStdSessions.java 70.02% <63.63%> (+0.29%) 30.00 <0.00> (ø)
.../hugegraph/backend/store/rocksdb/RocksDBTable.java 72.30% <70.37%> (-0.08%) 37.00 <0.00> (+2.00) ⬇️
...aidu/hugegraph/backend/store/hbase/HbaseTable.java 78.75% <83.67%> (+1.07%) 37.00 <0.00> (ø)
...aidu/hugegraph/backend/store/mysql/MysqlTable.java 79.77% <85.24%> (+0.69%) 92.00 <11.00> (+15.00)
...egraph/backend/store/mysql/MysqlEntryIterator.java 79.48% <91.66%> (+0.38%) 19.00 <5.00> (+2.00)
... and 10 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 cadc15a...4405da1. Read the comment docs.


@Override
protected long estimateDataSize(BackendSession session) {
return 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

0L

@@ -80,9 +80,17 @@ public BackendEntry next() {

this.current = null;
this.count += this.sizeOf(current);
if (this.query.paging() && !this.query.nolimit() &&
this.count > this.query.limit()) {
this.reduce2limit(current);
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 fetch()

} else {
query.scan(String.valueOf(Long.MIN_VALUE),
String.valueOf(Long.MAX_VALUE));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO: unify format
at least unify start and end

Copy link
Contributor

Choose a reason for hiding this comment

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

set START=END=""
and just set cassandra as long value

}

return select;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

improve code

int size = e.subRows().size();
// Remove last paging row
e.subRows().remove(size - 1);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@@ -402,7 +402,8 @@ public Number queryNumber(Session session, Query query) {
this.wrapOrderBy(selection, query);
}
if (query.paging()) {
this.wrapPage(selection, query);
this.wrapPage(selection, query, false);
wrapLimit(selection, query);
Copy link
Contributor

Choose a reason for hiding this comment

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

this.wrapLimit


if (page != null && !page.isEmpty()) {
// >= page
wrapPage(select, query, prefixAnd);
wrapPage(select, query, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

this.wrapPage

} else {
query.scan(String.valueOf(Long.MIN_VALUE),
String.valueOf(Long.MAX_VALUE));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

set START=END=""
and just set cassandra as long value

query.scan("00", BackendTable.ShardSpliter.END);
} else if (backend.equals("mysql") || backend.equals("postgresql")) {
query.scan(BackendTable.ShardSpliter.END,
BackendTable.ShardSpliter.END);
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@zhoney zhoney force-pushed the hbase-shard-improve branch 2 times, most recently from 27496d5 to 750d037 Compare May 13, 2020 03:10
@@ -63,6 +64,7 @@ public abstract RocksDBSessions copy(HugeConfig config,
public static final int SCAN_LTE_END = 0x30;

public abstract String property(String table, String property);
public abstract Pair<byte[], byte[]> getKeyRange(String table);
Copy link
Contributor

Choose a reason for hiding this comment

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

keyRange

startKey = iter.key();
iter.seekToLast();
if (!iter.isValid()) {
return 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 Pair.of(startKey, null);

private static final byte[] EMPTY = new byte[0];
public static final byte[] START_BYTES = new byte[]{0x0};
public static final byte[] END_BYTES = new byte[]{
-1, -1, -1, -1, -1, -1, -1, -1,
Copy link
Contributor

Choose a reason for hiding this comment

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

align

Change-Id: I5a660a08239f63b7da4cc382d6ddb449d1532e5f
Change-Id: Ibb840388667a0ed3e57b965ff607427ff429dcf9
Change-Id: I4dbfd4b726c715cc2f00816d574ae438d1300b2c
Change-Id: Ie146c5abe98b441ecd67de8e5d04900e46e72471
Change-Id: I9d478119d343dc9aab5bd38680090f9b6175dc9e
Change-Id: I0e58d0b1c7947ac3ad10a59d052e87066dce0b67
Change-Id: Id3bf5d13cc3a6cd98e2710e1fb0abefc4afa349f
Change-Id: I6c98ba38bd8e2439dcab21d4cdca3eba04358e92
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

2 participants