Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim-Brooks committed Dec 12, 2024
1 parent d08af89 commit af68a83
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,8 @@ public void maybeFetchRegions(
if (streamFactory == null) {
for (Tuple<CacheFileRegion<KeyType>, RegionGaps> gapsToFetch : gaps) {
for (SparseFileTracker.Gap gap : gapsToFetch.v2().gaps()) {
fetchExecutor.execute(gapsToFetch.v1().fillGapRunnable(gap, writer, null, regionsListener.acquire()));
int offset = Math.toIntExact(gapsToFetch.v2().regionOffset());
fetchExecutor.execute(gapsToFetch.v1().fillGapRunnable(offset, gap, writer, null, regionsListener.acquire()));
}
}
} else {
Expand All @@ -694,7 +695,7 @@ public void maybeFetchRegions(
) {
ArrayList<Runnable> gapFillingTasks = new ArrayList<>();
for (Tuple<CacheFileRegion<KeyType>, RegionGaps> gapsToFetch : gaps) {
int offset = (gapsToFetch.v1().regionKey.region() - firstRegion) * regionSize;
int offset = Math.toIntExact(gapsToFetch.v2().regionOffset());
gapFillingTasks.addAll(
gapsToFetch.v1()
.gapFillingTasks(offset, writer, sequentialGapsListener, streamFactory, gapsToFetch.v2().gaps())
Expand Down

0 comments on commit af68a83

Please sign in to comment.