Search in sources :

Example 21 with VerifyWritePermission

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

the class ConcourseServer method clearKeysRecord.

@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyWritePermission
public void clearKeysRecord(List<String> keys, long record, AccessToken creds, TransactionToken transaction, String environment) throws TException {
    AtomicSupport store = getStore(transaction, environment);
    AtomicOperations.executeWithRetry(store, (atomic) -> {
        for (String key : keys) {
            Operations.clearKeyRecordAtomic(key, record, atomic);
        }
    });
}
Also used : AtomicSupport(com.cinchapi.concourse.server.storage.AtomicSupport) VerifyWritePermission(com.cinchapi.concourse.server.aop.VerifyWritePermission) VerifyAccessToken(com.cinchapi.concourse.server.aop.VerifyAccessToken) TranslateClientExceptions(com.cinchapi.concourse.server.aop.TranslateClientExceptions)

Example 22 with VerifyWritePermission

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

the class ConcourseServer method reconcileKeyRecordValues.

@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyWritePermission
public void reconcileKeyRecordValues(String key, long record, Set<TObject> values, AccessToken creds, TransactionToken transaction, String environment) throws TException {
    AtomicSupport store = getStore(transaction, environment);
    AtomicOperations.executeWithRetry(store, (atomic) -> {
        Set<TObject> existingValues = store.select(key, record);
        for (TObject existingValue : existingValues) {
            if (!values.remove(existingValue)) {
                atomic.remove(key, existingValue, record);
            }
        }
        for (TObject value : values) {
            atomic.add(key, value, record);
        }
    });
}
Also used : ComplexTObject(com.cinchapi.concourse.thrift.ComplexTObject) TObject(com.cinchapi.concourse.thrift.TObject) AtomicSupport(com.cinchapi.concourse.server.storage.AtomicSupport) VerifyWritePermission(com.cinchapi.concourse.server.aop.VerifyWritePermission) VerifyAccessToken(com.cinchapi.concourse.server.aop.VerifyAccessToken) TranslateClientExceptions(com.cinchapi.concourse.server.aop.TranslateClientExceptions)

Aggregations

TranslateClientExceptions (com.cinchapi.concourse.server.aop.TranslateClientExceptions)22 VerifyAccessToken (com.cinchapi.concourse.server.aop.VerifyAccessToken)22 VerifyWritePermission (com.cinchapi.concourse.server.aop.VerifyWritePermission)22 AtomicSupport (com.cinchapi.concourse.server.storage.AtomicSupport)22 ComplexTObject (com.cinchapi.concourse.thrift.ComplexTObject)6 TObject (com.cinchapi.concourse.thrift.TObject)6 Multimap (com.google.common.collect.Multimap)3 AbstractSyntaxTree (com.cinchapi.ccl.syntax.AbstractSyntaxTree)2 AtomicOperation (com.cinchapi.concourse.server.storage.AtomicOperation)2 AtomicStateException (com.cinchapi.concourse.server.storage.AtomicStateException)2 TransactionStateException (com.cinchapi.concourse.server.storage.TransactionStateException)2 DuplicateEntryException (com.cinchapi.concourse.thrift.DuplicateEntryException)2 TransactionException (com.cinchapi.concourse.thrift.TransactionException)2 SortableSet (com.cinchapi.concourse.data.sort.SortableSet)1 Set (java.util.Set)1