use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method clearRecords.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyWritePermission
public void clearRecords(List<Long> records, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
AtomicOperations.executeWithRetry(store, (atomic) -> {
for (long record : records) {
Operations.clearRecordAtomic(record, atomic);
}
});
}
use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method clearKeyRecord.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyWritePermission
public void clearKeyRecord(String key, long record, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
AtomicOperations.executeWithRetry(store, (atomic) -> {
Operations.clearKeyRecordAtomic(key, record, atomic);
});
}
use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method minKeyCriteria.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public TObject minKeyCriteria(String key, TCriteria criteria, 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, Time.NONE, atomic);
return Convert.javaToThrift(min);
});
}
use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method selectKeyRecordsTimeOrderPage.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Map<Long, Set<TObject>> selectKeyRecordsTimeOrderPage(String key, List<Long> records, long timestamp, TOrder order, TPage page, AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
Supplier<SortableColumn<Set<TObject>>> supplier = () -> SortableColumn.multiValued(key, new LinkedHashMap<>(records.size()));
return AtomicOperations.supplyWithRetry(store, atomic -> Operations.selectKeyRecordsOptionalAtomic(atomic, key, records, timestamp, Orders.from(order), Pages.from(page), supplier));
}
use of com.cinchapi.concourse.server.storage.AtomicSupport in project concourse by cinchapi.
the class ConcourseServer method describe.
@Override
@TranslateClientExceptions
@VerifyAccessToken
@VerifyReadPermission
public Set<String> describe(AccessToken creds, TransactionToken transaction, String environment) throws TException {
AtomicSupport store = getStore(transaction, environment);
Set<String> result = Sets.newLinkedHashSet();
AtomicOperations.executeWithRetry(store, (atomic) -> {
Set<Long> records = store.getAllRecords();
for (long record : records) {
result.addAll(store.describe(record));
}
});
return result;
}
Aggregations