use of com.cinchapi.concourse.server.aop.TranslateClientExceptions in project concourse by cinchapi.
the class ConcourseServer method selectKeysCriteriaTimePage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, Set<TObject>>> selectKeysCriteriaTimePage(List<String> keys, TCriteria criteria, long timestamp, TPage page, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AbstractSyntaxTree ast = compiler.parse(criteria);
AtomicSupport store = getStore(transaction, environment);
Supplier<SortableTable<Set<TObject>>> supplier = () -> emptySortableResultDataset();
return Operations.selectKeysAstOptionalAtomic(store, keys, ast, timestamp, Orders.from(NO_ORDER), Pages.from(page), supplier);
}
use of com.cinchapi.concourse.server.aop.TranslateClientExceptions in project concourse by cinchapi.
the class ConcourseServer method averageKeyCcl.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public TObject averageKeyCcl(String key, String ccl, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AbstractSyntaxTree ast = compiler.parse(ccl);
AtomicSupport store = getStore(transaction, environment);
return AtomicOperations.supplyWithRetry(store, (atomic) -> {
Set<Long> records = ast.accept(Finder.instance(), atomic);
Number average = Operations.avgKeyRecordsAtomic(key, records, Time.NONE, atomic);
return Convert.javaToThrift(average);
});
}
use of com.cinchapi.concourse.server.aop.TranslateClientExceptions in project concourse by cinchapi.
the class ConcourseServer method findKeyOperatorValuesOrderPage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Set<Long> findKeyOperatorValuesOrderPage(String key, Operator operator, List<TObject> values, TOrder order, TPage page, AccessToken creds, TransactionToken transaction, String environment) throws TException {
TObject[] tValues = values.toArray(Array.containing());
AtomicSupport store = getStore(transaction, environment);
return AtomicOperations.supplyWithRetry(store, atomic -> {
SortableSet<Set<TObject>> records = SortableSet.of(Stores.find(atomic, key, operator, tValues));
records.sort(Sorting.byValues(Orders.from(order), atomic));
return Paging.page(records, Pages.from(page));
});
}
use of com.cinchapi.concourse.server.aop.TranslateClientExceptions in project concourse by cinchapi.
the class ConcourseServer method countKeyCclTime.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public long countKeyCclTime(String key, String ccl, long timestamp, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AbstractSyntaxTree ast = compiler.parse(ccl);
AtomicSupport store = getStore(transaction, environment);
return AtomicOperations.supplyWithRetry(store, (atomic) -> {
Set<Long> records = ast.accept(Finder.instance(), atomic);
return Operations.countKeyRecordsAtomic(key, records, timestamp, atomic);
});
}
use of com.cinchapi.concourse.server.aop.TranslateClientExceptions in project concourse by cinchapi.
the class ConcourseServer method addKeyValue.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyWritePermission
public long addKeyValue(String key, TObject value, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
return AtomicOperations.supplyWithRetry(store, (atomic) -> {
long record = Time.now();
Operations.addIfEmptyAtomic(key, value, record, atomic);
return record;
});
}
Aggregations