use of com.cinchapi.ccl.syntax.AbstractSyntaxTree in project concourse by cinchapi.
the class ConcourseServer method selectKeyCclTimePage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Set<TObject>> selectKeyCclTimePage(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<Set<TObject>>> supplier = () -> SortableColumn.multiValued(key, new LinkedHashMap<>());
return Operations.selectKeyAstOptionalAtomic(store, key, ast, timestamp, Orders.from(NO_ORDER), Pages.from(page), supplier);
}
use of com.cinchapi.ccl.syntax.AbstractSyntaxTree in project concourse by cinchapi.
the class ConcourseServer method sumKeyCriteriaTime.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public TObject sumKeyCriteriaTime(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 sum = Operations.sumKeyRecordsAtomic(key, records, timestamp, atomic);
return Convert.javaToThrift(sum);
});
}
use of com.cinchapi.ccl.syntax.AbstractSyntaxTree in project concourse by cinchapi.
the class ConcourseServer method selectKeysCriteriaTimeOrderPage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, Set<TObject>>> selectKeysCriteriaTimeOrderPage(List<String> keys, TCriteria criteria, long timestamp, TOrder order, 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 AtomicOperations.supplyWithRetry(store, atomic -> Operations.selectKeysAstOptionalAtomic(atomic, keys, ast, timestamp, Orders.from(order), Pages.from(page), supplier));
}
use of com.cinchapi.ccl.syntax.AbstractSyntaxTree in project concourse by cinchapi.
the class ConcourseServer method getCclTimeOrderPage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, TObject>> getCclTimeOrderPage(String ccl, long timestamp, TOrder order, 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 AtomicOperations.supplyWithRetry(store, atomic -> Operations.getAstOptionalAtomic(atomic, ast, timestamp, Orders.from(order), Pages.from(page), supplier));
}
use of com.cinchapi.ccl.syntax.AbstractSyntaxTree in project concourse by cinchapi.
the class ConcourseServer method selectKeyCclTimeOrderPage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Set<TObject>> selectKeyCclTimeOrderPage(String key, String ccl, long timestamp, TOrder order, TPage page, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AbstractSyntaxTree ast = compiler.parse(ccl);
AtomicSupport store = getStore(transaction, environment);
Supplier<SortableColumn<Set<TObject>>> supplier = () -> SortableColumn.multiValued(key, new LinkedHashMap<>());
return AtomicOperations.supplyWithRetry(store, atomic -> Operations.selectKeyAstOptionalAtomic(atomic, key, ast, timestamp, Orders.from(order), Pages.from(page), supplier));
}
Aggregations