Search in sources :

Example 56 with VerifyReadPermission

use of com.cinchapi.concourse.server.aop.VerifyReadPermission 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);
}
Also used : AbstractSyntaxTree(com.cinchapi.ccl.syntax.AbstractSyntaxTree) AtomicSupport(com.cinchapi.concourse.server.storage.AtomicSupport) SortableColumn(com.cinchapi.concourse.data.sort.SortableColumn) VerifyAccessToken(com.cinchapi.concourse.server.aop.VerifyAccessToken) VerifyReadPermission(com.cinchapi.concourse.server.aop.VerifyReadPermission) TranslateClientExceptions(com.cinchapi.concourse.server.aop.TranslateClientExceptions)

Example 57 with VerifyReadPermission

use of com.cinchapi.concourse.server.aop.VerifyReadPermission 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);
    });
}
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 58 with VerifyReadPermission

use of com.cinchapi.concourse.server.aop.VerifyReadPermission 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);
    });
}
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 59 with VerifyReadPermission

use of com.cinchapi.concourse.server.aop.VerifyReadPermission 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;
}
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 60 with VerifyReadPermission

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

the class ConcourseServer method countKeyCriteriaTime.

@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public long countKeyCriteriaTime(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.countKeyRecordsAtomic(key, 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