Ingest: fix split batch bug & Increase ingest timeout (#272)

Signed-off-by: marsishandsome <marsishandsome@gmail.com>
This commit is contained in:
Liangliang Gu 2021-09-08 19:52:16 +08:00 committed by GitHub
parent ebe1edc65c
commit 591815b889
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -78,7 +78,7 @@ public class ImporterClient {
pairs.add(ImportSstpb.Pair.newBuilder().setKey(pair.first).setValue(pair.second).build());
totalBytes += (pair.first.size() + pair.second.size());
}
if (totalBytes > maxKVBatchBytes) {
if (totalBytes > maxKVBatchBytes || !iterator.hasNext()) {
break;
}
}
@ -89,6 +89,7 @@ public class ImporterClient {
streamOpened = true;
}
writeBatch(pairs);
totalBytes = 0;
}
if (streamOpened) {