use of com.baidu.hugegraph.backend.serializer.BinaryEntryIterator in project incubator-hugegraph by apache.
the class HbaseTable method newEntryIterator.
protected BackendEntryIterator newEntryIterator(Query query, RowIterator rows) {
return new BinaryEntryIterator<>(rows, query, (entry, row) -> {
E.checkState(!row.isEmpty(), "Can't parse empty HBase result");
byte[] id = row.getRow();
if (entry == null || !Bytes.prefixWith(id, entry.id().asBytes())) {
HugeType type = query.resultType();
// NOTE: only support BinaryBackendEntry currently
entry = new BinaryBackendEntry(type, id, this.enablePartition);
}
try {
this.parseRowColumns(row, entry, query, this.enablePartition);
} catch (IOException e) {
throw new BackendException("Failed to read HBase columns", e);
}
return entry;
});
}
use of com.baidu.hugegraph.backend.serializer.BinaryEntryIterator in project incubator-hugegraph by apache.
the class RocksDBTable method newEntryIterator.
protected static final BackendEntryIterator newEntryIterator(BackendColumnIterator cols, Query query) {
return new BinaryEntryIterator<>(cols, query, (entry, col) -> {
if (entry == null || !entry.belongToMe(col)) {
HugeType type = query.resultType();
// NOTE: only support BinaryBackendEntry currently
entry = new BinaryBackendEntry(type, col.name);
} else {
assert !Bytes.equals(entry.id().asBytes(), col.name);
}
entry.columns(col);
return entry;
});
}
Aggregations