@Override public void acquireLock(StaticBuffer key, StaticBuffer column, StaticBuffer expectedValue, StoreTransaction txh) throws BackendException { store.acquireLock(key,column,expectedValue,unwrapTx(txh)); }
public TTLKCVSManager(KeyColumnValueStoreManager manager) { super(manager); Preconditions.checkArgument(manager.getFeatures().hasCellTTL()); Preconditions.checkArgument(!manager.getFeatures().hasStoreTTL(), "Using TTLKCVSManager with %s is redundant: underlying implementation already supports store-level ttl", manager); this.features = new StandardStoreFeatures.Builder(manager.getFeatures()).storeTTL(true).build(); }
@Override public Iterator<Entry> getNewIterator(int newLimit) { if (newLimit>sliceQuery.getLimit()) sliceQuery = sliceQuery.updateLimit(newLimit); return getBasicIterator(); } }
@Override public StoreTransaction openTx() throws BackendException { StandardBaseTransactionConfig config; if (keyConsistentOperations) { config = StandardBaseTransactionConfig.of(times,manager.storeManager.getFeatures().getKeyConsistentTxConfig()); } else { config = StandardBaseTransactionConfig.of(times); } return manager.storeManager.beginTransaction(config); }
@Override public KeySliceQuery setLimit(int limit) { super.setLimit(limit); return this; }
/** * Opens an ordered database by the given name. If the database does not exist, it is * created. If it has already been opened, the existing handle is returned. * * @param name Name of database * @return Database Handle * @throws org.janusgraph.diskstorage.BackendException * */ default KeyColumnValueStore openDatabase(String name) throws BackendException { return openDatabase(name, StoreMetaData.EMPTY); }
@Override public Boolean call() throws Exception { manager.mutateMany(subMutations, tx); return true; }
@Override public void close() throws BackendException { manager.close(); } },manager.openDatabase(SYSTEM_PROPERTIES_STORE_NAME),config);
@Override public void close() throws BackendException { store.close(); } }
/** * Returns true if the specified key-column pair exists in the store. * * @param store Store * @param key Key * @param column Column * @param txh Transaction * @return TRUE, if key has at least one column-value pair, else FALSE */ public static boolean containsKeyColumn(KeyColumnValueStore store, StaticBuffer key, StaticBuffer column, StoreTransaction txh) throws BackendException { return get(store, key, column, txh) != null; }
@Override public RecordIterator<Entry> getEntries() { // TODO: add metrics to entries if ever needed return iterator.getEntries(); }
@Override public List<KeyRange> getLocalKeyPartition() throws BackendException { return backend.getLocalKeyPartition(); } }
public StandardStoreFeatures build() { return new StandardStoreFeatures(unorderedScan, orderedScan, multiQuery, locking, batchMutation, localKeyPartition, keyOrdered, distributed, transactional, keyConsistent, timestamps, preferredTimestamps, cellLevelTTL, storeLevelTTL, visibility, supportsPersist, keyConsistentTxConfig, localKeyConsistentTxConfig, scanTxConfig, supportsInterruption, optimisticLocking); } }
@Override public KeyRangeQuery setLimit(int limit) { super.setLimit(limit); return this; }