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 StoreFeatures getFeatures() { Configuration c = GraphDatabaseConfiguration.buildGraphConfiguration(); StandardStoreFeatures.Builder fb = new StandardStoreFeatures.Builder() .orderedScan(true).unorderedScan(true).batchMutation(true) .multiQuery(true).distributed(true).keyOrdered(true).storeTTL(true) .cellTTL(true).timestamps(true).preferredTimestamps(PREFERRED_TIMESTAMPS) .optimisticLocking(true).keyConsistent(c); try { fb.localKeyPartition(getDeployment() == Deployment.LOCAL); } catch (Exception e) { logger.warn("Unexpected exception during getDeployment()", e); } return fb.build(); }
private StandardStoreFeatures initializeFeatures(final Configuration config) { final Builder builder = new StandardStoreFeatures.Builder(); return builder.batchMutation(true) .cellTTL(false) .distributed(true) .keyConsistent(config) .keyOrdered(false) .localKeyPartition(false) .locking(config.get(Constants.DYNAMODB_USE_NATIVE_LOCKING)) .multiQuery(true) .orderedScan(false) .preferredTimestamps(TimestampProviders.MILLI) //ignored because timestamps is false .storeTTL(false) .timestamps(false) .transactional(false) .supportsInterruption(false) .optimisticLocking(true) .unorderedScan(true) .visibility(false).build(); }
/** * Construct a Builder whose default values exactly match the values on * the supplied {@code template}. */ public Builder(StoreFeatures template) { unorderedScan(template.hasUnorderedScan()); orderedScan(template.hasOrderedScan()); multiQuery(template.hasMultiQuery()); locking(template.hasLocking()); batchMutation(template.hasBatchMutation()); localKeyPartition(template.hasLocalKeyPartition()); keyOrdered(template.isKeyOrdered()); distributed(template.isDistributed()); transactional(template.hasTxIsolation()); timestamps(template.hasTimestamps()); preferredTimestamps(template.getPreferredTimestamps()); cellTTL(template.hasCellTTL()); storeTTL(template.hasStoreTTL()); visibility(template.hasVisibility()); persists(template.supportsPersistence()); if (template.isKeyConsistent()) { keyConsistent(template.getKeyConsistentTxConfig(), template.getLocalKeyConsistentTxConfig()); } scanTxConfig(template.getScanTxConfig()); supportsInterruption(template.supportsInterruption()); optimisticLocking(template.hasOptimisticLocking()); }