use of org.apache.gora.hbase.query.HBaseGetResult in project gora by apache.
the class HBaseStore method execute.
@Override
public org.apache.gora.query.Result<K, T> execute(Query<K, T> query) throws GoraException {
try {
// check if query.fields is null
query.setFields(getFieldsToQuery(query.getFields()));
if (query.getStartKey() != null && query.getStartKey().equals(query.getEndKey())) {
Get get = new Get(toBytes(query.getStartKey()));
addFields(get, query.getFields());
addTimeRange(get, query);
Result result = table.get(get);
return new HBaseGetResult<>(this, query, result);
} else {
ResultScanner scanner = createScanner(query);
org.apache.gora.query.Result<K, T> result = new HBaseScannerResult<>(this, query, scanner);
return result;
}
} catch (IOException ex) {
throw new GoraException(ex);
}
}
Aggregations