use of com.baidu.hugegraph.computer.core.store.hgkvfile.file.reader.HgkvDirReaderImpl in project hugegraph-computer by hugegraph.
the class SorterImpl method mergeInputs.
@Override
public void mergeInputs(List<String> inputs, OuterSortFlusher flusher, List<String> outputs, boolean withSubKv) throws Exception {
InputToEntries inputToEntries;
if (withSubKv) {
inputToEntries = o -> new HgkvDir4SubKvReaderImpl(o).iterator();
} else {
inputToEntries = o -> new HgkvDirReaderImpl(o).iterator();
}
this.mergeInputs(inputs, inputToEntries, flusher, outputs);
}
use of com.baidu.hugegraph.computer.core.store.hgkvfile.file.reader.HgkvDirReaderImpl in project hugegraph-computer by hugegraph.
the class SorterImpl method iterator.
@Override
public PeekableIterator<KvEntry> iterator(List<String> inputs, boolean withSubKv) throws IOException {
InputsSorterImpl sorter = new InputsSorterImpl();
List<EntryIterator> entries = new ArrayList<>();
for (String input : inputs) {
HgkvDirReader reader = new HgkvDirReaderImpl(input, false, withSubKv);
entries.add(reader.iterator());
}
return PeekableIteratorAdaptor.of(sorter.sort(entries));
}
Aggregations