Search in sources :

Example 1 with StoreFeatures

use of org.janusgraph.diskstorage.keycolumnvalue.StoreFeatures in project janusgraph by JanusGraph.

the class JanusGraphBaseTest method openLog.

private Log openLog(String logManagerName, String logName) {
    try {
        ModifiableConfiguration configuration = new ModifiableConfiguration(GraphDatabaseConfiguration.ROOT_NS, config.copy(), BasicConfiguration.Restriction.NONE);
        configuration.set(GraphDatabaseConfiguration.UNIQUE_INSTANCE_ID, "reader");
        configuration.set(GraphDatabaseConfiguration.LOG_READ_INTERVAL, Duration.ofMillis(500L), logManagerName);
        if (logStoreManager == null) {
            logStoreManager = Backend.getStorageManager(configuration);
        }
        StoreFeatures f = logStoreManager.getFeatures();
        boolean part = f.isDistributed() && f.isKeyOrdered();
        if (part) {
            for (String partitionedLogName : new String[] { USER_LOG, TRANSACTION_LOG, MANAGEMENT_LOG }) configuration.set(KCVSLogManager.LOG_MAX_PARTITIONS, 8, partitionedLogName);
        }
        assert logStoreManager != null;
        if (!logManagers.containsKey(logManagerName)) {
            // Open log manager - only supports KCVSLog
            Configuration logConfig = configuration.restrictTo(logManagerName);
            Preconditions.checkArgument(logConfig.get(LOG_BACKEND).equals(LOG_BACKEND.getDefaultValue()));
            logManagers.put(logManagerName, new KCVSLogManager(logStoreManager, logConfig));
        }
        assert logManagers.containsKey(logManagerName);
        return logManagers.get(logManagerName).openLog(logName);
    } catch (BackendException e) {
        throw new JanusGraphException("Could not open log: " + logName, e);
    }
}
Also used : StoreFeatures(org.janusgraph.diskstorage.keycolumnvalue.StoreFeatures) KCVSLogManager(org.janusgraph.diskstorage.log.kcvs.KCVSLogManager) GraphDatabaseConfiguration(org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration) BackendException(org.janusgraph.diskstorage.BackendException)

Example 2 with StoreFeatures

use of org.janusgraph.diskstorage.keycolumnvalue.StoreFeatures in project janusgraph by JanusGraph.

the class AbstractCassandraStoreTest method testOrderedConfiguration.

@Test
@Category({ OrderedKeyStoreTests.class })
public void testOrderedConfiguration() {
    if (!manager.getFeatures().hasOrderedScan()) {
        log.warn("Can't test key-ordered features on incompatible store.  " + "This warning could indicate reduced test coverage and " + "a broken JUnit configuration.  Skipping test {}.", name.getMethodName());
        return;
    }
    StoreFeatures features = manager.getFeatures();
    assertTrue(features.isKeyOrdered());
}
Also used : StoreFeatures(org.janusgraph.diskstorage.keycolumnvalue.StoreFeatures) Category(org.junit.experimental.categories.Category) KeyColumnValueStoreTest(org.janusgraph.diskstorage.KeyColumnValueStoreTest) Test(org.junit.Test)

Example 3 with StoreFeatures

use of org.janusgraph.diskstorage.keycolumnvalue.StoreFeatures in project janusgraph by JanusGraph.

the class AbstractCassandraStoreTest method testTTLSupported.

@Test
public void testTTLSupported() {
    StoreFeatures features = manager.getFeatures();
    assertTrue(features.hasCellTTL());
}
Also used : StoreFeatures(org.janusgraph.diskstorage.keycolumnvalue.StoreFeatures) KeyColumnValueStoreTest(org.janusgraph.diskstorage.KeyColumnValueStoreTest) Test(org.junit.Test)

Example 4 with StoreFeatures

use of org.janusgraph.diskstorage.keycolumnvalue.StoreFeatures in project janusgraph by JanusGraph.

the class EmbeddedStoreTest method testConfiguration.

@Test
@Category({ OrderedKeyStoreTests.class })
public void testConfiguration() {
    StoreFeatures features = manager.getFeatures();
    assertTrue(features.isKeyOrdered());
    assertTrue(features.hasLocalKeyPartition());
}
Also used : StoreFeatures(org.janusgraph.diskstorage.keycolumnvalue.StoreFeatures) Category(org.junit.experimental.categories.Category) AbstractCassandraStoreTest(org.janusgraph.diskstorage.cassandra.AbstractCassandraStoreTest) Test(org.junit.Test)

Example 5 with StoreFeatures

use of org.janusgraph.diskstorage.keycolumnvalue.StoreFeatures in project janusgraph by JanusGraph.

the class CQLStoreTest method testTTLSupported.

@Test
public void testTTLSupported() {
    final StoreFeatures features = this.manager.getFeatures();
    assertTrue(features.hasCellTTL());
}
Also used : StoreFeatures(org.janusgraph.diskstorage.keycolumnvalue.StoreFeatures) KeyColumnValueStoreTest(org.janusgraph.diskstorage.KeyColumnValueStoreTest) Test(org.junit.Test)

Aggregations

StoreFeatures (org.janusgraph.diskstorage.keycolumnvalue.StoreFeatures)11 Test (org.junit.Test)8 KeyColumnValueStoreTest (org.janusgraph.diskstorage.KeyColumnValueStoreTest)6 Category (org.junit.experimental.categories.Category)5 StandardStoreFeatures (org.janusgraph.diskstorage.keycolumnvalue.StandardStoreFeatures)2 BackendException (org.janusgraph.diskstorage.BackendException)1 EntryMetaData (org.janusgraph.diskstorage.EntryMetaData)1 AbstractCassandraStoreTest (org.janusgraph.diskstorage.cassandra.AbstractCassandraStoreTest)1 ModifiableConfiguration (org.janusgraph.diskstorage.configuration.ModifiableConfiguration)1 KeyColumnValueStore (org.janusgraph.diskstorage.keycolumnvalue.KeyColumnValueStore)1 KeyColumnValueStoreManager (org.janusgraph.diskstorage.keycolumnvalue.KeyColumnValueStoreManager)1 StoreTransaction (org.janusgraph.diskstorage.keycolumnvalue.StoreTransaction)1 Locker (org.janusgraph.diskstorage.locking.Locker)1 LockerProvider (org.janusgraph.diskstorage.locking.LockerProvider)1 ExpectedValueCheckingStoreManager (org.janusgraph.diskstorage.locking.consistentkey.ExpectedValueCheckingStoreManager)1 KCVSLogManager (org.janusgraph.diskstorage.log.kcvs.KCVSLogManager)1 StandardBaseTransactionConfig (org.janusgraph.diskstorage.util.StandardBaseTransactionConfig)1 GraphDatabaseConfiguration (org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration)1 Before (org.junit.Before)1