Skip to content

Commit

Permalink
GEODE-10008: Avoid possible EntryDestroyedException error (apache#7343)
Browse files Browse the repository at this point in the history
  • Loading branch information
albertogpz authored Feb 17, 2022
1 parent 4d1a263 commit 9cd402f
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

import org.apache.logging.log4j.Logger;

Expand Down Expand Up @@ -186,13 +184,11 @@ private Optional<CliFunctionResult> sendBatch(String memberName,
return batch;
}

private Set<?> getEntries(Region<?, ?> region, GatewaySender sender) {
private List<?> getEntries(Region<?, ?> region, GatewaySender sender) {
if (region instanceof PartitionedRegion && sender.isParallel()) {
return ((PartitionedRegion) region).getDataStore().getAllLocalBucketRegions()
.stream()
.flatMap(br -> ((Set<?>) br.entrySet()).stream()).collect(Collectors.toSet());
return ((PartitionedRegion) region).getDataStore().getEntries();
}
return region.entrySet();
return new ArrayList<>(region.entrySet());
}

/**
Expand Down

0 comments on commit 9cd402f

Please sign in to comment.