use of com.cinchapi.concourse.server.aop.TranslateClientExceptions in project concourse by cinchapi.
the class ConcourseServer method getCclTimePage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, TObject>> getCclTimePage(String ccl, long timestamp, TPage page, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AbstractSyntaxTree ast = compiler.parse(ccl);
AtomicSupport store = getStore(transaction, environment);
Supplier<SortableTable<TObject>> supplier = () -> SortableTable.singleValued(new LinkedHashMap<>());
return Operations.getAstOptionalAtomic(store, 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 selectKeyRecord.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Set<TObject> selectKeyRecord(String key, long record, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
Function<Store, Set<TObject>> function = $store -> Stores.select($store, key, record);
try {
return function.apply(store);
} catch (InsufficientAtomicityException e) {
return AtomicOperations.supplyWithRetry(store, atomic -> function.apply(atomic));
}
}
use of com.cinchapi.concourse.server.aop.TranslateClientExceptions in project concourse by cinchapi.
the class ConcourseServer method revertKeysRecordsTime.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyWritePermission
public void revertKeysRecordsTime(List<String> keys, List<Long> records, long timestamp, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
AtomicOperations.executeWithRetry(store, (atomic) -> {
for (long record : records) {
for (String key : keys) {
Operations.revertAtomic(key, record, timestamp, atomic);
}
}
});
}
use of com.cinchapi.concourse.server.aop.TranslateClientExceptions in project concourse by cinchapi.
the class ConcourseServer method getKeysRecordsTimeOrderPage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, TObject>> getKeysRecordsTimeOrderPage(List<String> keys, List<Long> records, long timestamp, TOrder order, TPage page, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
Supplier<SortableTable<TObject>> supplier = () -> SortableTable.singleValued(new LinkedHashMap<>(records.size()));
return AtomicOperations.supplyWithRetry(store, atomic -> Operations.getKeysRecordsOptionalAtomic(atomic, keys, records, timestamp, Orders.from(order), Pages.from(page), supplier));
}
use of com.cinchapi.concourse.server.aop.TranslateClientExceptions in project concourse by cinchapi.
the class ConcourseServer method getKeyRecordsOrderPage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, TObject> getKeyRecordsOrderPage(String key, List<Long> records, TOrder order, TPage page, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
Supplier<SortableColumn<TObject>> supplier = () -> SortableColumn.singleValued(key, new LinkedHashMap<>(records.size()));
return AtomicOperations.supplyWithRetry(store, atomic -> Operations.getKeyRecordsAtomic(atomic, key, records, Orders.from(order), Pages.from(page), supplier));
}
Aggregations