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,
BiConsumer<Entry<Buf, Buf>, Throwable> deserializationErrorHandler) {
try {
return ((LLLocalDictionary) dict.dictionary)
.getAllLiveFiles()
.sequential()
var liveFiles = StreamUtils.toListOn(dict.getDbReadPool(),
((LLLocalDictionary) dict.dictionary).getAllLiveFiles());
return liveFiles.stream()
.map(file -> file.iterate(new SSTRangeFull()).map(state -> switch (state) {
case RocksDBFileIterationStateBegin rocksDBFileIterationStateBegin:
yield null;