@Override public Features features() { return JanusGraphFeatures.getFeatures(this, backend.getStoreFeatures()); }
public Backend getBackend() { Backend backend = new Backend(configuration); backend.initialize(configuration); storeFeatures = backend.getStoreFeatures(); return backend; }
public VertexIDAssigner getIDAssigner(Backend backend) { return new VertexIDAssigner(configuration, backend.getIDAuthority(), backend.getStoreFeatures()); }
/** * Sets time-to-live for those schema types that support it * * @param type * @param duration Note that only 'seconds' granularity is supported */ @Override public void setTTL(final JanusGraphSchemaType type, final Duration duration) { if (!graph.getBackend().getStoreFeatures().hasCellTTL()) throw new UnsupportedOperationException("The storage engine does not support TTL"); if (type instanceof VertexLabelVertex) { Preconditions.checkArgument(((VertexLabelVertex) type).isStatic(), "must define vertex label as static to allow setting TTL"); } else { Preconditions.checkArgument(type instanceof EdgeLabelVertex || type instanceof PropertyKeyVertex, "TTL is not supported for type " + type.getClass().getSimpleName()); } Preconditions.checkArgument(type instanceof JanusGraphSchemaVertex); Integer ttlSeconds = (duration.isZero()) ? null : (int) duration.getSeconds(); setTypeModifier(type, ModifierType.TTL, ttlSeconds); }
@Test public void verifyEligibility() { Preconditions.checkArgument(!graph.getConfiguration().getBackend().getStoreFeatures().hasTxIsolation(), "This test suite only applies to eventually consistent data stores"); }
public RecordIterator<Long> getVertexIDs(final BackendTransaction tx) { Preconditions.checkArgument(backend.getStoreFeatures().hasOrderedScan() || backend.getStoreFeatures().hasUnorderedScan(), "The configured storage backend does not support global graph operations - use Faunus instead"); final KeyIterator keyIterator; if (backend.getStoreFeatures().hasUnorderedScan()) { keyIterator = tx.edgeStoreKeys(vertexExistenceQuery); } else { keyIterator = tx.edgeStoreKeys(new KeyRangeQuery(IDHandler.MIN_KEY, IDHandler.MAX_KEY, vertexExistenceQuery)); } return new RecordIterator<Long>() { @Override public boolean hasNext() { return keyIterator.hasNext(); } @Override public Long next() { return idManager.getKeyID(keyIterator.next()); } @Override public void close() throws IOException { keyIterator.close(); } @Override public void remove() { throw new UnsupportedOperationException("Removal not supported"); } }; }
@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); } }
StoreFeatures storeFeatures = backend.getStoreFeatures(); this.indexSerializer = new IndexSerializer(configuration.getConfiguration(), this.serializer, this.backend.getIndexInformation(), storeFeatures.isDistributed() && storeFeatures.isKeyOrdered());
final boolean hasTxIsolation = backend.getStoreFeatures().hasTxIsolation(); final boolean logTransaction = config.hasLogTransactions() && !tx.getConfiguration().hasEnabledBatchLoading(); final KCVSLog txLog = logTransaction?backend.getSystemTxLog():null;
@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); } }
try { b = graph.getConfiguration().getBackend(); if (b.getStoreFeatures().hasTxIsolation()) { log.info("Skipping " + getClass().getSimpleName() + "." + methodName.getMethodName()); return;