Use flatMapIterable when possible
This commit is contained in:
parent
7597e54bac
commit
d411675c2b
@ -201,7 +201,7 @@ public class DatabaseMapDictionaryHashed<T, U, TH> implements DatabaseStageMap<T
|
||||
.getAllValues(snapshot)
|
||||
.map(Entry::getValue)
|
||||
.map(Collections::unmodifiableSet)
|
||||
.flatMap(Flux::fromIterable);
|
||||
.concatMapIterable(list -> list);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1024,7 +1024,7 @@ public class LLLocalDictionary implements LLDictionary {
|
||||
}
|
||||
})
|
||||
.subscribeOn(dbScheduler)
|
||||
.flatMapMany(Flux::fromIterable)
|
||||
.flatMapIterable(list -> list)
|
||||
.onErrorMap(cause -> new IOException("Failed to read keys "
|
||||
+ Arrays.deepToString(keyBufsWindow.toArray(ByteBuf[]::new)), cause))
|
||||
.doAfterTerminate(() -> keyBufsWindow.forEach(ReferenceCounted::release));
|
||||
@ -1243,7 +1243,7 @@ public class LLLocalDictionary implements LLDictionary {
|
||||
}
|
||||
})
|
||||
.subscribeOn(dbScheduler)
|
||||
.flatMapMany(Flux::fromIterable);
|
||||
.concatMapIterable(list -> list);
|
||||
},
|
||||
entriesWindow -> {
|
||||
for (Tuple2<ByteBuf, X> entry : entriesWindow) {
|
||||
|
@ -477,7 +477,7 @@ public class TestDictionaryMap {
|
||||
.flatMapMany(map -> Flux
|
||||
.concat(map.setAndGetPrevious(entries), map.setAndGetPrevious(entries))
|
||||
.map(Map::entrySet)
|
||||
.flatMap(Flux::fromIterable)
|
||||
.concatMapIterable(list -> list)
|
||||
.doAfterTerminate(map::release)
|
||||
)
|
||||
));
|
||||
@ -502,7 +502,7 @@ public class TestDictionaryMap {
|
||||
.flatMapMany(map -> Flux
|
||||
.concat(map.set(entries).then(Mono.empty()), map.clearAndGetPrevious(), map.get(null))
|
||||
.map(Map::entrySet)
|
||||
.flatMap(Flux::fromIterable)
|
||||
.concatMapIterable(list -> list)
|
||||
.doAfterTerminate(map::release)
|
||||
)
|
||||
));
|
||||
@ -555,7 +555,7 @@ public class TestDictionaryMap {
|
||||
map.putMulti(Flux.fromIterable(entries.entrySet())).then(Mono.empty()),
|
||||
map.get(null)
|
||||
.map(Map::entrySet)
|
||||
.flatMapMany(Flux::fromIterable)
|
||||
.flatMapIterable(list -> list)
|
||||
)
|
||||
.doAfterTerminate(map::release)
|
||||
)
|
||||
|
@ -822,7 +822,7 @@ public class TestDictionaryMapDeep {
|
||||
map.setAndGetPrevious(entries)
|
||||
)
|
||||
.map(Map::entrySet)
|
||||
.flatMap(Flux::fromIterable)
|
||||
.concatMapIterable(list -> list)
|
||||
.doAfterTerminate(map::release)
|
||||
)
|
||||
));
|
||||
@ -847,7 +847,7 @@ public class TestDictionaryMapDeep {
|
||||
.flatMapMany(map -> Flux
|
||||
.concat(map.set(entries).then(Mono.empty()), map.clearAndGetPrevious(), map.get(null))
|
||||
.map(Map::entrySet)
|
||||
.flatMap(Flux::fromIterable)
|
||||
.concatMapIterable(list -> list)
|
||||
.doAfterTerminate(map::release)
|
||||
)
|
||||
));
|
||||
@ -900,7 +900,7 @@ public class TestDictionaryMapDeep {
|
||||
map.putMulti(Flux.fromIterable(entries.entrySet())).then(Mono.empty()),
|
||||
map.get(null)
|
||||
.map(Map::entrySet)
|
||||
.flatMapMany(Flux::fromIterable)
|
||||
.flatMapIterable(list -> list)
|
||||
)
|
||||
.doAfterTerminate(map::release)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user