use of com.baidu.hugegraph.computer.core.store.hgkvfile.file.builder.HgkvDirBuilder in project hugegraph-computer by hugegraph.
the class SorterImpl method sortBuffers.
private void sortBuffers(List<EntryIterator> entries, OuterSortFlusher flusher, String output) throws IOException {
InputsSorter sorter = new InputsSorterImpl();
try (HgkvDirBuilder builder = new HgkvDirBuilderImpl(this.config, output)) {
EntryIterator result = sorter.sort(entries);
flusher.flush(result, builder);
}
}
use of com.baidu.hugegraph.computer.core.store.hgkvfile.file.builder.HgkvDirBuilder in project hugegraph-computer by hugegraph.
the class HgkvDirMergerImpl method mergeInputs.
private void mergeInputs(List<String> inputs, InputToEntries inputToEntries, OuterSortFlusher flusher, String output) throws Exception {
/*
* File value format is different, upper layer is required to
* provide the file reading mode
*/
List<EntryIterator> entries = inputs.stream().map(inputToEntries::inputToEntries).collect(Collectors.toList());
InputsSorter sorter = new InputsSorterImpl();
// Merge inputs and write to output
try (EntryIterator sortedKv = sorter.sort(entries);
HgkvDirBuilder builder = new HgkvDirBuilderImpl(this.config, output)) {
flusher.flush(sortedKv, builder);
}
}
Aggregations