use of com.cinchapi.concourse.server.storage.Store in project concourse by cinchapi.
the class ConcourseServer method selectKeyCriteriaPage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Set<TObject>> selectKeyCriteriaPage(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<Set<TObject>> result = SortableColumn.multiValued(key, Maps.newLinkedHashMap());
AtomicOperations.executeWithRetry(store, atomic -> Operations.selectKeyAstAtomic(key, ast, Time.NONE, result, records -> Paging.paginate(records, Pages.from(page)), null, atomic));
return result;
}
use of com.cinchapi.concourse.server.storage.Store in project concourse by cinchapi.
the class ConcourseServer method getCriteriaTimeOrder.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, TObject>> getCriteriaTimeOrder(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<TObject> result = SortableTable.singleValued(Maps.newLinkedHashMap());
AtomicOperations.executeWithRetry(store, atomic -> Operations.getAstAtomic(ast, timestamp, result, null, $result -> $result.sort(Sorting.byValue(Orders.from(order), atomic), timestamp), atomic));
return result;
}
use of com.cinchapi.concourse.server.storage.Store in project concourse by cinchapi.
the class ConcourseServer method selectRecordsPage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, Set<TObject>>> selectRecordsPage(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.selectRecordsAtomic(records, result, $records -> Paging.paginate($records, Pages.from(page)), null, atomic));
return result;
}
use of com.cinchapi.concourse.server.storage.Store in project concourse by cinchapi.
the class ConcourseServer method selectCclPage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, Set<TObject>>> selectCclPage(String ccl, TPage page, AccessToken creds, TransactionToken transaction, String environment) throws TException {
try {
AbstractSyntaxTree ast = compiler.parse(ccl);
AtomicSupport store = getStore(transaction, environment);
SortableTable<Set<TObject>> result = emptySortableResultDataset();
AtomicOperations.executeWithRetry(store, atomic -> Operations.selectAstAtomic(ast, Time.NONE, result, records -> Paging.paginate(records, Pages.from(page)), null, atomic));
return result;
} catch (Exception e) {
throw new ParseException(e.getMessage());
}
}
use of com.cinchapi.concourse.server.storage.Store in project concourse by cinchapi.
the class ConcourseServer method selectCriteriaPage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, Set<TObject>>> selectCriteriaPage(TCriteria criteria, TPage page, 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, Time.NONE, result, records -> Paging.paginate(records, Pages.from(page)), null, atomic));
return result;
}
Aggregations