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

Fix inappropriate shard will cause base64 decode error #1383

Merged
merged 2 commits into from
Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ public List<Shard> getSplits(Session session, long splitSize) {
long maxKey = this.maxKey();
double each = maxKey / count;

long offset = 0L;
String last = this.position(offset);
List<Shard> splits = new ArrayList<>((int) count);
String last = START;
long offset = 0L;
while (offset < maxKey) {
offset += each;
if (offset > maxKey) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ public long estimateNumKeys(Session session) {

@Override
public byte[] position(String position) {
// The value of START AND END are same
Copy link
Contributor

Choose a reason for hiding this comment

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

AND => and
but prefer don't assume START and END are the same, prefer START.equals(position) || END.equals(position)

if (END.equals(position)) {
return null;
}
Expand Down