NSAmelchev commented on code in PR #10360:
URL: https://github.com/apache/ignite/pull/10360#discussion_r1018784691
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java:
##########
@@ -3254,19 +3271,73 @@ public LocalSnapshotSender(String snpName, @Nullable
String snpPath) {
assert totalBytes % pageSize == 0 : "Given file with delta
pages has incorrect size: " + fileIo.size();
+ int pagesCnt = (int)(totalBytes / pageSize);
+
+ Integer batchSize = deltaSortBatch.get();
+
+ GridIntIterator iter;
+
+ if (batchSize == null || batchSize <= 0)
+ iter = U.forRange(0, pagesCnt);
+ else {
+ iter = new GridIntIterator() {
+ private int idx = 0;
+
+ private Iterator<Integer> sortedIter;
+
+ @Override public boolean hasNext() {
+ if (sortedIter == null || !sortedIter.hasNext()) {
+ try {
+ advance();
+ }
+ catch (Exception e) {
+ throw new IgniteException(e);
+ }
+ }
+
+ return sortedIter.hasNext();
+ }
+
+ @Override public int next() {
+ return sortedIter.next();
Review Comment:
Added check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]