defaultConfig.set(GraphDatabaseConfiguration.UNIQUE_INSTANCE_ID, "default"); BaseTransactionConfig defaultTxConfig = new StandardBaseTransactionConfig.Builder().customOptions(defaultConfig).timestampProvider(TimestampProviders.MICRO).build(); StoreFeatures backingFeatures = new StandardStoreFeatures.Builder().keyConsistent(globalConfig, localConfig).build();
public InMemoryStoreManager(final Configuration configuration) { stores = new ConcurrentHashMap<>(); features = new StandardStoreFeatures.Builder() .orderedScan(true) .unorderedScan(true) .keyOrdered(true) .persists(false) .optimisticLocking(true) .keyConsistent(GraphDatabaseConfiguration.buildGraphConfiguration()) .build(); // features = new StoreFeatures(); // features.supportsOrderedScan = true; // features.supportsUnorderedScan = true; // features.supportsBatchMutation = false; // features.supportsTxIsolation = false; // features.supportsConsistentKeyOperations = true; // features.supportsLocking = false; // features.isDistributed = false; // features.supportsMultiQuery = false; // features.isKeyOrdered = true; // features.hasLocalKeyPartition = false; }
final StandardStoreFeatures.Builder fb = new StandardStoreFeatures.Builder(); fb.batchMutation(true).distributed(true); fb.timestamps(true).cellTTL(true); fb.keyConsistent((onlyUseLocalConsistency ? local : global), local); fb.optimisticLocking(true); fb.multiQuery(false); case "RandomPartitioner": case "Murmur3Partitioner": { fb.keyOrdered(false).orderedScan(false).unorderedScan(true); deployment = Deployment.REMOTE; break; fb.keyOrdered(true).orderedScan(true).unorderedScan(false); deployment = (hostnames.length == 1)// mark deployment as local only in case we have byte ordered partitioner and local this.storeFeatures = fb.build(); this.openStores = new ConcurrentHashMap<>();
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(); }
@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(); }
/** * 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()); }
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(); }
public ExpectedValueCheckingStoreManager(KeyColumnValueStoreManager storeManager, String lockStoreSuffix, LockerProvider lockerProvider, Duration maxReadTime) { super(storeManager); this.lockStoreSuffix = lockStoreSuffix; this.lockerProvider = lockerProvider; this.maxReadTime = maxReadTime; this.storeFeatures = new StandardStoreFeatures.Builder(storeManager.getFeatures()).locking(true).build(); this.stores = new HashMap<>(6); }