use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method navigateKeyCclTime.
@SuppressWarnings("deprecation")
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
@Deprecated
public Map<Long, Set<TObject>> navigateKeyCclTime(String key, 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.navigateKeyRecordsAtomic(key, records, timestamp, atomic);
});
}
use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method reviewRecordStartEnd.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, List<String>> reviewRecordStartEnd(long record, long start, long end, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
Map<Long, List<String>> base = store.review(record);
Map<Long, List<String>> result = TMaps.newLinkedHashMapWithCapacity(base.size());
int index = Timestamps.findNearestSuccessorForTimestamp(base.keySet(), start);
Entry<Long, List<String>> entry = null;
for (int i = index; i < base.size(); ++i) {
entry = Iterables.get(base.entrySet(), i);
if (entry.getKey() >= end) {
break;
}
result.put(entry.getKey(), entry.getValue());
}
return result;
}
use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method getCclTimePage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Map<String, TObject>> getCclTimePage(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.getAstOptionalAtomic(store, ast, timestamp, Orders.from(NO_ORDER), Pages.from(page), supplier);
}
use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method selectKeyRecord.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Set<TObject> selectKeyRecord(String key, long record, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
Function<Store, Set<TObject>> function = $store -> Stores.select($store, key, record);
try {
return function.apply(store);
} catch (InsufficientAtomicityException e) {
return AtomicOperations.supplyWithRetry(store, atomic -> function.apply(atomic));
}
}
use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method revertKeysRecordsTime.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyWritePermission
public void revertKeysRecordsTime(List<String> keys, List<Long> records, long timestamp, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
AtomicOperations.executeWithRetry(store, (atomic) -> {
for (long record : records) {
for (String key : keys) {
Operations.revertAtomic(key, record, timestamp, atomic);
}
}
});
}
Aggregations