protected StandardBaseTransactionConfig getConsistentTxConfig(StoreManager manager) { return StandardBaseTransactionConfig.of(times,manager.getFeatures().getKeyConsistentTxConfig()); }
@Override public StoreTransaction openTx() throws BackendException { return storeManagerLocking.beginTransaction(StandardBaseTransactionConfig.of( configuration.get(TIMESTAMP_PROVIDER), storeFeatures.getKeyConsistentTxConfig())); }
@Override public StoreTransaction openTx() throws BackendException { return manager.beginTransaction(StandardBaseTransactionConfig.of(config.get(TIMESTAMP_PROVIDER),features.getKeyConsistentTxConfig())); }
@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); }
randomUniqueIDLimit,uniqueIDUpperBound); uniqueId = -1; storeTxConfigBuilder.customOptions(manager.getFeatures().getKeyConsistentTxConfig()); } else { randomizeUniqueId = false; storeTxConfigBuilder.customOptions(manager.getFeatures().getLocalKeyConsistentTxConfig()); } else { storeTxConfigBuilder.customOptions(manager.getFeatures().getKeyConsistentTxConfig());
@Override public Long retrieveSchemaByName(String typeName) { // Get a consistent tx Configuration customTxOptions = backend.getStoreFeatures().getKeyConsistentTxConfig(); StandardJanusGraphTx consistentTx = null; try { consistentTx = StandardJanusGraph.this.newTransaction(new StandardTransactionBuilder(getConfiguration(), StandardJanusGraph.this, customTxOptions).groupName(GraphDatabaseConfiguration.METRICS_SCHEMA_PREFIX_DEFAULT)); consistentTx.getTxHandle().disableCache(); JanusGraphVertex v = Iterables.getOnlyElement(QueryUtil.getVertices(consistentTx, BaseKey.SchemaName, typeName), null); return v!=null?v.longId():null; } finally { TXUtils.rollbackQuietly(consistentTx); } }
@Override public ExpectedValueCheckingTransaction beginTransaction(BaseTransactionConfig configuration) throws BackendException { // Get a transaction without any guarantees about strong consistency StoreTransaction inconsistentTx = manager.beginTransaction(configuration); // Get a transaction that provides global strong consistency Configuration customOptions = new MergedConfiguration(storeFeatures.getKeyConsistentTxConfig(), configuration.getCustomOptions()); BaseTransactionConfig consistentTxCfg = new StandardBaseTransactionConfig.Builder(configuration) .customOptions(customOptions).build(); StoreTransaction strongConsistentTx = manager.beginTransaction(consistentTxCfg); // Return a wrapper around both the inconsistent and consistent store transactions return new ExpectedValueCheckingTransaction(inconsistentTx, strongConsistentTx, maxReadTime); }
@Override public EntryList retrieveSchemaRelations(final long schemaId, final BaseRelationType type, final Direction dir) { SliceQuery query = queryCache.getQuery(type,dir); Configuration customTxOptions = backend.getStoreFeatures().getKeyConsistentTxConfig(); StandardJanusGraphTx consistentTx = null; try { consistentTx = StandardJanusGraph.this.newTransaction(new StandardTransactionBuilder(getConfiguration(), StandardJanusGraph.this, customTxOptions).groupName(GraphDatabaseConfiguration.METRICS_SCHEMA_PREFIX_DEFAULT)); consistentTx.getTxHandle().disableCache(); return edgeQuery(schemaId, query, consistentTx.getTxHandle()); } finally { TXUtils.rollbackQuietly(consistentTx); } }
/** * 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()); }