use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method selectKeyRecordsPage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Set<TObject>> selectKeyRecordsPage(String key, List<Long> records, TPage page, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
SortableColumn<Set<TObject>> result = SortableColumn.multiValued(key, TMaps.newLinkedHashMapWithCapacity(records.size()));
AtomicOperations.executeWithRetry(store, atomic -> Operations.selectKeyRecordsAtomic(key, 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 getKeysCriteriaOrder.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, TObject>> getKeysCriteriaOrder(List<String> keys, TCriteria criteria, TOrder order, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AbstractSyntaxTree ast = compiler.parse(criteria);
AtomicSupport store = getStore(transaction, environment);
SortableTable<TObject> result = SortableTable.singleValued(Maps.newLinkedHashMap());
AtomicOperations.executeWithRetry(store, atomic -> Operations.getKeysAstAtomic(keys, ast, Time.NONE, result, null, $result -> $result.sort(Sorting.byValue(Orders.from(order), atomic)), atomic));
return result;
}
use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method selectKeysRecord.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<String, Set<TObject>> selectKeysRecord(List<String> keys, long record, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
Map<String, Set<TObject>> result = Maps.newLinkedHashMap();
AtomicOperations.executeWithRetry(store, (atomic) -> {
for (String key : keys) {
result.put(key, Stores.select(atomic, key, record));
}
});
return result;
}
use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method getCriteriaOrder.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, TObject>> getCriteriaOrder(TCriteria criteria, TOrder order, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AbstractSyntaxTree ast = compiler.parse(criteria);
AtomicSupport store = getStore(transaction, environment);
SortableTable<TObject> result = SortableTable.singleValued(Maps.newLinkedHashMap());
AtomicOperations.executeWithRetry(store, atomic -> Operations.getAstAtomic(ast, Time.NONE, result, null, $result -> $result.sort(Sorting.byValue(Orders.from(order), atomic)), atomic));
return result;
}
use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method getKeysRecordsPage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, TObject>> getKeysRecordsPage(List<String> keys, List<Long> records, TPage page, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
SortableTable<TObject> result = SortableTable.singleValued(Maps.newLinkedHashMap());
AtomicOperations.executeWithRetry(store, atomic -> Operations.getKeysRecordsAtomic(keys, records, result, $records -> Paging.paginate($records, Pages.from(page)), null, atomic));
return result;
}
Aggregations