-
Notifications
You must be signed in to change notification settings - Fork 503
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
Conversation
Codecov Report
@@ 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 Continue to review full report at Codecov.
|
|
||
@Override | ||
protected long estimateDataSize(BackendSession session) { | ||
return 0; |
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.
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); |
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 fetch()
} else { | ||
query.scan(String.valueOf(Long.MIN_VALUE), | ||
String.valueOf(Long.MAX_VALUE)); | ||
} |
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.
TODO: unify format
at least unify start and end
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.
set START=END=""
and just set cassandra as long value
} | ||
|
||
return select; | ||
} |
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.
improve code
int size = e.subRows().size(); | ||
// Remove last paging row | ||
e.subRows().remove(size - 1); | ||
} |
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
@@ -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); |
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.
this.wrapLimit
|
||
if (page != null && !page.isEmpty()) { | ||
// >= page | ||
wrapPage(select, query, prefixAnd); | ||
wrapPage(select, query, true); |
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.
this.wrapPage
} else { | ||
query.scan(String.valueOf(Long.MIN_VALUE), | ||
String.valueOf(Long.MAX_VALUE)); | ||
} |
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.
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); |
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
27496d5
to
750d037
Compare
@@ -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); |
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.
keyRange
startKey = iter.key(); | ||
iter.seekToLast(); | ||
if (!iter.isValid()) { | ||
return null; |
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.
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, |
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.
align
Change-Id: I5a660a08239f63b7da4cc382d6ddb449d1532e5f
Change-Id: Ibb840388667a0ed3e57b965ff607427ff429dcf9
Change-Id: I4dbfd4b726c715cc2f00816d574ae438d1300b2c
Change-Id: I9d478119d343dc9aab5bd38680090f9b6175dc9e
Change-Id: Id3bf5d13cc3a6cd98e2710e1fb0abefc4afa349f
750d037
to
4405da1
Compare
Hbase shard range参考:https://blog.csdn.net/shenxiaoming77/article/details/22675919