use of com.baidu.hugegraph.computer.core.sort.sorter.InputSorter in project hugegraph-computer by hugegraph.
the class KvEntryWriterImpl method sortAndWriteSubKvs.
private void sortAndWriteSubKvs() throws IOException {
BytesInput input = EntriesUtil.inputFromOutput(this.subKvBuffer);
InputSorter sorter = new JavaInputSorter();
Iterator<KvEntry> subKvs = sorter.sort(new KvEntriesInput(input));
while (subKvs.hasNext()) {
KvEntry subKv = subKvs.next();
subKv.key().write(this.output);
subKv.value().write(this.output);
}
}
use of com.baidu.hugegraph.computer.core.sort.sorter.InputSorter in project hugegraph-computer by hugegraph.
the class SorterImpl method sortBuffer.
@Override
public void sortBuffer(RandomAccessInput input, InnerSortFlusher flusher, boolean withSubKv) throws Exception {
try (EntryIterator entries = new KvEntriesInput(input, withSubKv)) {
InputSorter sorter = new JavaInputSorter();
flusher.flush(sorter.sort(entries));
}
}
use of com.baidu.hugegraph.computer.core.sort.sorter.InputSorter in project hugegraph-computer by hugegraph.
the class KvEntryWriterImpl method sortAndWriteSubKvs.
private void sortAndWriteSubKvs() throws IOException {
BytesInput input = EntriesUtil.inputFromOutput(this.subKvBuffer);
InputSorter sorter = new JavaInputSorter();
Iterator<KvEntry> subKvs = sorter.sort(new KvEntriesInput(input));
while (subKvs.hasNext()) {
KvEntry subKv = subKvs.next();
subKv.key().write(this.output);
subKv.value().write(this.output);
}
}
use of com.baidu.hugegraph.computer.core.sort.sorter.InputSorter in project hugegraph-computer by hugegraph.
the class DefaultSorter method sortBuffer.
public void sortBuffer(EntryIterator entries, InnerSortFlusher flusher) throws Exception {
InputSorter sorter = new JavaInputSorter();
flusher.flush(sorter.sort(entries));
}
Aggregations