Search in sources :

Example 1 with KCVSConfiguration

use of com.thinkaurelius.titan.diskstorage.configuration.backend.KCVSConfiguration in project titan by thinkaurelius.

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("titan"), "general");
    } catch (BackendException e) {
        throw new RuntimeException(e);
    }
}
Also used : KCVSConfiguration(com.thinkaurelius.titan.diskstorage.configuration.backend.KCVSConfiguration) StoreTransaction(com.thinkaurelius.titan.diskstorage.keycolumnvalue.StoreTransaction) KeyColumnValueStoreManager(com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager) InMemoryStoreManager(com.thinkaurelius.titan.diskstorage.keycolumnvalue.inmemory.InMemoryStoreManager) BackendOperation(com.thinkaurelius.titan.diskstorage.util.BackendOperation) BackendException(com.thinkaurelius.titan.diskstorage.BackendException)

Example 2 with KCVSConfiguration

use of com.thinkaurelius.titan.diskstorage.configuration.backend.KCVSConfiguration in project titan by thinkaurelius.

the class Backend method getConfiguration.

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

Aggregations

KCVSConfiguration (com.thinkaurelius.titan.diskstorage.configuration.backend.KCVSConfiguration)2 TitanException (com.thinkaurelius.titan.core.TitanException)1 BackendException (com.thinkaurelius.titan.diskstorage.BackendException)1 KeyColumnValueStoreManager (com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager)1 StoreTransaction (com.thinkaurelius.titan.diskstorage.keycolumnvalue.StoreTransaction)1 InMemoryStoreManager (com.thinkaurelius.titan.diskstorage.keycolumnvalue.inmemory.InMemoryStoreManager)1 BackendOperation (com.thinkaurelius.titan.diskstorage.util.BackendOperation)1