dschneider-pivotal commented on a change in pull request #6768:
URL: https://github.com/apache/geode/pull/6768#discussion_r697716916
##########
File path:
geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/data/RedisSortedSet.java
##########
@@ -106,11 +106,19 @@ protected void applyDelta(DeltaInfo deltaInfo) {
public synchronized void toData(DataOutput out, SerializationContext
context) throws IOException {
super.toData(out, context);
InternalDataSerializer.writePrimitiveInt(members.size(), out);
- for (Map.Entry<byte[], OrderedSetEntry> entry : members.entrySet()) {
- byte[] member = entry.getKey();
- byte[] score = entry.getValue().getScoreBytes();
- InternalDataSerializer.writeByteArray(member, out);
- InternalDataSerializer.writeByteArray(score, out);
+ try {
+ members.fastForEach(entry -> {
+ byte[] member = entry.getKey();
+ byte[] score = entry.getValue().getScoreBytes();
+ try {
+ InternalDataSerializer.writeByteArray(member, out);
+ InternalDataSerializer.writeByteArray(score, out);
+ } catch (IOException e) {
+ throw new GemFireIOException("", e);
+ }
+ });
+ } catch (GemFireIOException ex) {
+ throw (IOException) ex.getCause();
Review comment:
The problem is that IOException is a checked exception so I think we
would need a flavor of fastForEach that throws IOException and a flavor of
Consumer that throws IOException.
--
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]