Search in sources :

Example 1 with KCVSConfiguration

use of org.janusgraph.diskstorage.configuration.backend.KCVSConfiguration in project janusgraph by JanusGraph.

the class KCVSConfigTest method getConfig.

@Override
public WriteConfiguration getConfig() {
    final KeyColumnValueStoreManager manager = new InMemoryStoreManager(Configuration.EMPTY);
    ModifiableConfiguration config = GraphDatabaseConfiguration.buildGraphConfiguration();
    config.set(GraphDatabaseConfiguration.TIMESTAMP_PROVIDER, TimestampProviders.MICRO);
    try {
        return new KCVSConfiguration(new BackendOperation.TransactionalProvider() {

            @Override
            public StoreTransaction openTx() throws BackendException {
                return manager.beginTransaction(StandardBaseTransactionConfig.of(TimestampProviders.MICRO, manager.getFeatures().getKeyConsistentTxConfig()));
            }

            @Override
            public void close() throws BackendException {
                manager.close();
            }
        }, config, manager.openDatabase("janusgraph"), "general");
    } catch (BackendException e) {
        throw new RuntimeException(e);
    }
}
Also used : KCVSConfiguration(org.janusgraph.diskstorage.configuration.backend.KCVSConfiguration) StoreTransaction(org.janusgraph.diskstorage.keycolumnvalue.StoreTransaction) KeyColumnValueStoreManager(org.janusgraph.diskstorage.keycolumnvalue.KeyColumnValueStoreManager) InMemoryStoreManager(org.janusgraph.diskstorage.keycolumnvalue.inmemory.InMemoryStoreManager) BackendOperation(org.janusgraph.diskstorage.util.BackendOperation) BackendException(org.janusgraph.diskstorage.BackendException)

Example 2 with KCVSConfiguration

use of org.janusgraph.diskstorage.configuration.backend.KCVSConfiguration in project janusgraph by JanusGraph.

the class Backend method getConfiguration.

private static KCVSConfiguration getConfiguration(final BackendOperation.TransactionalProvider txProvider, final KeyColumnValueStore store, final String identifier, final Configuration config) {
    try {
        KCVSConfiguration keyColumnValueStoreConfiguration = new KCVSConfiguration(txProvider, config, store, identifier);
        keyColumnValueStoreConfiguration.setMaxOperationWaitTime(config.get(SETUP_WAITTIME));
        return keyColumnValueStoreConfiguration;
    } catch (BackendException e) {
        throw new JanusGraphException("Could not open global configuration", e);
    }
}
Also used : KCVSConfiguration(org.janusgraph.diskstorage.configuration.backend.KCVSConfiguration) JanusGraphException(org.janusgraph.core.JanusGraphException)

Aggregations

KCVSConfiguration (org.janusgraph.diskstorage.configuration.backend.KCVSConfiguration)2 JanusGraphException (org.janusgraph.core.JanusGraphException)1 BackendException (org.janusgraph.diskstorage.BackendException)1 KeyColumnValueStoreManager (org.janusgraph.diskstorage.keycolumnvalue.KeyColumnValueStoreManager)1 StoreTransaction (org.janusgraph.diskstorage.keycolumnvalue.StoreTransaction)1 InMemoryStoreManager (org.janusgraph.diskstorage.keycolumnvalue.inmemory.InMemoryStoreManager)1 BackendOperation (org.janusgraph.diskstorage.util.BackendOperation)1