use of com.cinchapi.concourse.server.aop.VerifyReadPermission in project concourse by cinchapi.
the class ConcourseServer method selectCclTimePage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, Set<TObject>>> selectCclTimePage(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<SortableTable<Set<TObject>>> supplier = () -> emptySortableResultDataset();
return Operations.selectAstOptionalAtomic(store, ast, timestamp, Orders.from(NO_ORDER), Pages.from(page), supplier);
}
use of com.cinchapi.concourse.server.aop.VerifyReadPermission in project concourse by cinchapi.
the class ConcourseServer method diffKeyRecordStartEnd.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Diff, Set<TObject>> diffKeyRecordStartEnd(String key, long record, long start, long end, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
AtomicReference<Set<TObject>> startValues = new AtomicReference<>(null);
AtomicReference<Set<TObject>> endValues = new AtomicReference<>(null);
AtomicOperations.executeWithRetry(store, (atomic) -> {
startValues.set(store.select(key, record, start));
endValues.set(store.select(key, record, end));
});
Map<Diff, Set<TObject>> result = Maps.newHashMapWithExpectedSize(2);
Set<TObject> xor = Sets.symmetricDifference(startValues.get(), endValues.get());
int expectedSize = xor.size() / 2;
Set<TObject> added = Sets.newHashSetWithExpectedSize(expectedSize);
Set<TObject> removed = Sets.newHashSetWithExpectedSize(expectedSize);
for (TObject current : xor) {
if (!startValues.get().contains(current))
added.add(current);
else {
removed.add(current);
}
}
if (!added.isEmpty()) {
result.put(Diff.ADDED, added);
}
if (!removed.isEmpty()) {
result.put(Diff.REMOVED, removed);
}
return result;
}
use of com.cinchapi.concourse.server.aop.VerifyReadPermission in project concourse by cinchapi.
the class ConcourseServer method navigateKeysCclTime.
@SuppressWarnings("deprecation")
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
@Deprecated
public Map<Long, Map<String, Set<TObject>>> navigateKeysCclTime(List<String> keys, String ccl, long timestamp, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AbstractSyntaxTree ast = compiler.parse(ccl);
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);
});
}
use of com.cinchapi.concourse.server.aop.VerifyReadPermission in project concourse by cinchapi.
the class ConcourseServer method getKeysCclTimePage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, TObject>> getKeysCclTimePage(List<String> keys, 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<SortableTable<TObject>> supplier = () -> SortableTable.singleValued(new LinkedHashMap<>());
return Operations.getKeysAstOptionalAtomic(store, keys, ast, timestamp, Orders.from(NO_ORDER), Pages.from(page), supplier);
}
use of com.cinchapi.concourse.server.aop.VerifyReadPermission in project concourse by cinchapi.
the class ConcourseServer method describeRecords.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Set<String>> describeRecords(List<Long> records, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
Map<Long, Set<String>> result = Maps.newLinkedHashMap();
AtomicOperations.executeWithRetry(store, (atomic) -> {
for (long record : records) {
result.put(record, atomic.describe(record));
}
});
return result;
}
Aggregations