use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method selectKeyCriteriaOrder.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Set<TObject>> selectKeyCriteriaOrder(String key, TCriteria criteria, TOrder order, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AbstractSyntaxTree ast = compiler.parse(criteria);
AtomicSupport store = getStore(transaction, environment);
SortableColumn<Set<TObject>> result = SortableColumn.multiValued(key, Maps.newLinkedHashMap());
AtomicOperations.executeWithRetry(store, atomic -> Operations.selectKeyAstAtomic(key, ast, Time.NONE, result, null, $result -> $result.sort(Sorting.byValues(Orders.from(order), atomic)), atomic));
return result;
}
use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method getKeyCriteriaPage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, TObject> getKeyCriteriaPage(String key, TCriteria criteria, TPage page, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AbstractSyntaxTree ast = compiler.parse(criteria);
AtomicSupport store = getStore(transaction, environment);
SortableColumn<TObject> result = SortableColumn.singleValued(key, Maps.newLinkedHashMap());
AtomicOperations.executeWithRetry(store, atomic -> Operations.getKeyAstAtomic(key, ast, Time.NONE, result, records -> Paging.paginate(records, Pages.from(page)), null, atomic));
return result;
}
use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method selectCriteriaTimeOrder.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, Set<TObject>>> selectCriteriaTimeOrder(TCriteria criteria, long timestamp, TOrder order, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AbstractSyntaxTree ast = compiler.parse(criteria);
AtomicSupport store = getStore(transaction, environment);
SortableTable<Set<TObject>> result = emptySortableResultDataset();
AtomicOperations.executeWithRetry(store, atomic -> Operations.selectAstAtomic(ast, timestamp, result, null, $result -> $result.sort(Sorting.byValues(Orders.from(order), atomic), timestamp), atomic));
return result;
}
use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method selectKeysRecordsPage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, Set<TObject>>> selectKeysRecordsPage(List<String> keys, List<Long> records, TPage page, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
SortableTable<Set<TObject>> result = emptySortableResultDatasetWithCapacity(records.size());
AtomicOperations.executeWithRetry(store, atomic -> Operations.selectKeysRecordsAtomic(keys, records, result, $records -> Paging.paginate($records, Pages.from(page)), null, atomic));
return result;
}
use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method findCriteriaOrder.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Set<Long> findCriteriaOrder(TCriteria criteria, TOrder order, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AbstractSyntaxTree ast = compiler.parse(criteria);
AtomicSupport store = getStore(transaction, environment);
return AtomicOperations.supplyWithRetry(store, (atomic) -> {
SortableSet<Set<TObject>> records = SortableSet.of(ast.accept(Finder.instance(), atomic));
records.sort(Sorting.byValues(Orders.from(order), store));
return records;
});
}
Aggregations