Skip to content

Commit

Permalink
fix hbase/rocksdb shard bug
Browse files Browse the repository at this point in the history
Change-Id: Ifce3d450712104c067a57c361351c9e047bc0cfa
  • Loading branch information
zhoney committed Dec 21, 2020
1 parent f0d1146 commit 0fae667
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,9 @@ public List<Shard> splitEven(int count) {
length);
byte[] offset = start;
byte[] last = offset;
boolean finished = false;
List<Shard> shards = new ArrayList<>(count);
while (Bytes.compare(offset, end) < 0) {
while (Bytes.compare(offset, end) < 0 && !finished) {
offset = add(offset, each);
if (offset.length > end.length ||
Bytes.compare(offset, end) > 0) {
Expand All @@ -267,6 +268,7 @@ public List<Shard> splitEven(int count) {
}
if (endChanged && Arrays.equals(offset, end)) {
offset = this.endKey;
finished = true;
}
shards.add(new Shard(startKey(last), endKey(offset), 0));
last = offset;
Expand Down

0 comments on commit 0fae667

Please sign in to comment.