Search in sources :

Example 86 with VerifyReadPermission

use of com.cinchapi.concourse.server.aop.VerifyReadPermission in project concourse by cinchapi.

the class ConcourseServer method selectKeysCclTimeOrderPage.

@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, Set<TObject>>> selectKeysCclTimeOrderPage(List<String> keys, 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<Set<TObject>>> supplier = () -> emptySortableResultDataset();
    return AtomicOperations.supplyWithRetry(store, atomic -> Operations.selectKeysAstOptionalAtomic(atomic, keys, ast, timestamp, Orders.from(order), Pages.from(page), supplier));
}
Also used : ComplexTObject(com.cinchapi.concourse.thrift.ComplexTObject) TObject(com.cinchapi.concourse.thrift.TObject) AbstractSyntaxTree(com.cinchapi.ccl.syntax.AbstractSyntaxTree) AtomicSupport(com.cinchapi.concourse.server.storage.AtomicSupport) SortableTable(com.cinchapi.concourse.data.sort.SortableTable) VerifyAccessToken(com.cinchapi.concourse.server.aop.VerifyAccessToken) VerifyReadPermission(com.cinchapi.concourse.server.aop.VerifyReadPermission) TranslateClientExceptions(com.cinchapi.concourse.server.aop.TranslateClientExceptions)

Example 87 with VerifyReadPermission

use of com.cinchapi.concourse.server.aop.VerifyReadPermission in project concourse by cinchapi.

the class ConcourseServer method averageKeyCriteriaTime.

@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public TObject averageKeyCriteriaTime(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 average = Operations.avgKeyRecordsAtomic(key, records, timestamp, atomic);
        return Convert.javaToThrift(average);
    });
}
Also used : AbstractSyntaxTree(com.cinchapi.ccl.syntax.AbstractSyntaxTree) AtomicSupport(com.cinchapi.concourse.server.storage.AtomicSupport) VerifyAccessToken(com.cinchapi.concourse.server.aop.VerifyAccessToken) VerifyReadPermission(com.cinchapi.concourse.server.aop.VerifyReadPermission) TranslateClientExceptions(com.cinchapi.concourse.server.aop.TranslateClientExceptions)

Example 88 with VerifyReadPermission

use of com.cinchapi.concourse.server.aop.VerifyReadPermission in project concourse by cinchapi.

the class ConcourseServer method getKeysCriteriaTimePage.

@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, TObject>> getKeysCriteriaTimePage(List<String> keys, TCriteria criteria, long timestamp, TPage page, AccessToken creds, TransactionToken transaction, String environment) throws TException {
    AbstractSyntaxTree ast = compiler.parse(criteria);
    AtomicSupport store = getStore(transaction, environment);
    Supplier<SortableTable<TObject>> supplier = () -> SortableTable.singleValued(new LinkedHashMap<>());
    return Operations.getKeysAstOptionalAtomic(store, keys, ast, timestamp, Orders.from(NO_ORDER), Pages.from(page), supplier);
}
Also used : AbstractSyntaxTree(com.cinchapi.ccl.syntax.AbstractSyntaxTree) AtomicSupport(com.cinchapi.concourse.server.storage.AtomicSupport) SortableTable(com.cinchapi.concourse.data.sort.SortableTable) VerifyAccessToken(com.cinchapi.concourse.server.aop.VerifyAccessToken) VerifyReadPermission(com.cinchapi.concourse.server.aop.VerifyReadPermission) TranslateClientExceptions(com.cinchapi.concourse.server.aop.TranslateClientExceptions)

Example 89 with VerifyReadPermission

use of com.cinchapi.concourse.server.aop.VerifyReadPermission in project concourse by cinchapi.

the class ConcourseServer method browseKeysTime.

@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<String, Map<TObject, Set<Long>>> browseKeysTime(List<String> keys, long timestamp, AccessToken creds, TransactionToken transaction, String environment) throws TException {
    AtomicSupport store = getStore(transaction, environment);
    Map<String, Map<TObject, Set<Long>>> result = TMaps.newLinkedHashMapWithCapacity(keys.size());
    for (String key : keys) {
        result.put(key, Stores.browse(store, key, timestamp));
    }
    return result;
}
Also used : AtomicSupport(com.cinchapi.concourse.server.storage.AtomicSupport) Map(java.util.Map) LinkedHashMap(java.util.LinkedHashMap) NonBlockingHashMap(org.cliffc.high_scale_lib.NonBlockingHashMap) VerifyAccessToken(com.cinchapi.concourse.server.aop.VerifyAccessToken) VerifyReadPermission(com.cinchapi.concourse.server.aop.VerifyReadPermission) TranslateClientExceptions(com.cinchapi.concourse.server.aop.TranslateClientExceptions)

Example 90 with VerifyReadPermission

use of com.cinchapi.concourse.server.aop.VerifyReadPermission in project concourse by cinchapi.

the class ConcourseServer method navigateKeysCriteriaTime.

@SuppressWarnings("deprecation")
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
@Deprecated
public Map<Long, Map<String, Set<TObject>>> navigateKeysCriteriaTime(List<String> keys, 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.navigateKeysRecordsAtomic(keys, records, timestamp, atomic);
    });
}
Also used : AbstractSyntaxTree(com.cinchapi.ccl.syntax.AbstractSyntaxTree) AtomicSupport(com.cinchapi.concourse.server.storage.AtomicSupport) VerifyAccessToken(com.cinchapi.concourse.server.aop.VerifyAccessToken) VerifyReadPermission(com.cinchapi.concourse.server.aop.VerifyReadPermission) TranslateClientExceptions(com.cinchapi.concourse.server.aop.TranslateClientExceptions)

Aggregations

TranslateClientExceptions (com.cinchapi.concourse.server.aop.TranslateClientExceptions)157 VerifyAccessToken (com.cinchapi.concourse.server.aop.VerifyAccessToken)157 VerifyReadPermission (com.cinchapi.concourse.server.aop.VerifyReadPermission)157 AtomicSupport (com.cinchapi.concourse.server.storage.AtomicSupport)157 AbstractSyntaxTree (com.cinchapi.ccl.syntax.AbstractSyntaxTree)118 ComplexTObject (com.cinchapi.concourse.thrift.ComplexTObject)90 TObject (com.cinchapi.concourse.thrift.TObject)90 SortableTable (com.cinchapi.concourse.data.sort.SortableTable)87 SortableColumn (com.cinchapi.concourse.data.sort.SortableColumn)72 SortableSet (com.cinchapi.concourse.data.sort.SortableSet)72 Set (java.util.Set)72 Map (java.util.Map)58 NonBlockingHashMap (org.cliffc.high_scale_lib.NonBlockingHashMap)58 Diff (com.cinchapi.concourse.thrift.Diff)57 AtomicReference (java.util.concurrent.atomic.AtomicReference)57 List (java.util.List)56 NaturalLanguage (com.cinchapi.ccl.util.NaturalLanguage)54 AnyStrings (com.cinchapi.common.base.AnyStrings)54 Array (com.cinchapi.common.base.Array)54 CheckedExceptions (com.cinchapi.common.base.CheckedExceptions)54