use of com.cinchapi.concourse.server.aop.TranslateClientExceptions in project concourse by cinchapi.
the class ConcourseServer method getKeyCclTimePage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, TObject> getKeyCclTimePage(String key, 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<SortableColumn<TObject>> supplier = () -> SortableColumn.singleValued(key, new LinkedHashMap<>());
return Operations.getKeyAstOptionalAtomic(store, key, 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 navigateKeyCriteriaTime.
@SuppressWarnings("deprecation")
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
@Deprecated
public Map<Long, Set<TObject>> navigateKeyCriteriaTime(String key, TCriteria criteria, long timestamp, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AbstractSyntaxTree ast = compiler.parse(criteria);
AtomicSupport store = getStore(transaction, environment);
return AtomicOperations.supplyWithRetry(store, (atomic) -> {
Set<Long> records = ast.accept(Finder.instance(), atomic);
return Operations.navigateKeyRecordsAtomic(key, records, timestamp, atomic);
});
}
use of com.cinchapi.concourse.server.aop.TranslateClientExceptions in project concourse by cinchapi.
the class ConcourseServer method setKeyValueRecords.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyWritePermission
public void setKeyValueRecords(String key, TObject value, List<Long> records, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
AtomicOperations.executeWithRetry(store, (atomic) -> {
for (long record : records) {
atomic.set(key, value, record);
}
});
}
use of com.cinchapi.concourse.server.aop.TranslateClientExceptions in project concourse by cinchapi.
the class ConcourseServer method minKeyCriteriaTime.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public TObject minKeyCriteriaTime(String key, TCriteria criteria, long timestamp, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AbstractSyntaxTree ast = compiler.parse(criteria);
AtomicSupport store = getStore(transaction, environment);
return AtomicOperations.supplyWithRetry(store, (atomic) -> {
Set<Long> records = ast.accept(Finder.instance(), atomic);
Number min = Operations.minKeyRecordsAtomic(key, records, timestamp, atomic);
return Convert.javaToThrift(min);
});
}
use of com.cinchapi.concourse.server.aop.TranslateClientExceptions in project concourse by cinchapi.
the class ConcourseServer method browseKeys.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<String, Map<TObject, Set<Long>>> browseKeys(List<String> keys, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
Map<String, Map<TObject, Set<Long>>> result = Maps.newLinkedHashMap();
AtomicOperations.executeWithRetry(store, (atomic) -> {
for (String key : keys) {
result.put(key, Stores.browse(atomic, key));
}
});
return result;
}
Aggregations