fix parallelism when listing live files

This commit is contained in:
Andrea Cavalli 2024-10-01 23:53:31 +02:00
parent c859b8238f
commit 6a68c8452b

View File

@ -571,9 +571,9 @@ public class DatabaseMapDictionary<T, U> extends DatabaseMapDictionaryDeep<T, U,
public static <T, U> Stream<Stream<Entry<T, U>>> getAllEntriesFastUnsafe(DatabaseMapDictionary<T, U> dict, public static <T, U> Stream<Stream<Entry<T, U>>> getAllEntriesFastUnsafe(DatabaseMapDictionary<T, U> dict,
BiConsumer<Entry<Buf, Buf>, Throwable> deserializationErrorHandler) { BiConsumer<Entry<Buf, Buf>, Throwable> deserializationErrorHandler) {
try { try {
return ((LLLocalDictionary) dict.dictionary) var liveFiles = StreamUtils.toListOn(dict.getDbReadPool(),
.getAllLiveFiles() ((LLLocalDictionary) dict.dictionary).getAllLiveFiles());
.sequential() return liveFiles.stream()
.map(file -> file.iterate(new SSTRangeFull()).map(state -> switch (state) { .map(file -> file.iterate(new SSTRangeFull()).map(state -> switch (state) {
case RocksDBFileIterationStateBegin rocksDBFileIterationStateBegin: case RocksDBFileIterationStateBegin rocksDBFileIterationStateBegin:
yield null; yield null;