Search in sources :

Example 1 with IniFileConfigDatabase

use of org.locationtech.geogig.storage.fs.IniFileConfigDatabase in project GeoGig by boundlessgeo.

the class JEObjectDatabaseTest method createDb.

private ObjectDatabase createDb() {
    ConfigDatabase configDB = new IniFileConfigDatabase(platform);
    JEObjectDatabase db = new JEObjectDatabase_v0_1(configDB, envProvider, hints);
    db.open();
    return db;
}
Also used : IniFileConfigDatabase(org.locationtech.geogig.storage.fs.IniFileConfigDatabase) ConfigDatabase(org.locationtech.geogig.storage.ConfigDatabase) IniFileConfigDatabase(org.locationtech.geogig.storage.fs.IniFileConfigDatabase)

Example 2 with IniFileConfigDatabase

use of org.locationtech.geogig.storage.fs.IniFileConfigDatabase in project GeoGig by boundlessgeo.

the class JEGraphDatabaseV1StressTest method createDatabase.

@Override
protected GraphDatabase createDatabase(TestPlatform platform) {
    File root = platform.pwd();
    Preconditions.checkState(new File(root, ".geogig").exists());
    envProvider = new EnvironmentBuilder(platform);
    ConfigDatabase configDB = new IniFileConfigDatabase(platform);
    return new JEGraphDatabase_v0_1(configDB, envProvider, new Hints());
}
Also used : Hints(org.locationtech.geogig.repository.Hints) ConfigDatabase(org.locationtech.geogig.storage.ConfigDatabase) IniFileConfigDatabase(org.locationtech.geogig.storage.fs.IniFileConfigDatabase) File(java.io.File) IniFileConfigDatabase(org.locationtech.geogig.storage.fs.IniFileConfigDatabase)

Example 3 with IniFileConfigDatabase

use of org.locationtech.geogig.storage.fs.IniFileConfigDatabase in project GeoGig by boundlessgeo.

the class JEGraphDatabaseV1Test method createDatabase.

@Override
protected GraphDatabase createDatabase(Platform platform) throws Exception {
    File root = platform.pwd();
    Preconditions.checkState(new File(root, ".geogig").exists());
    envProvider = new EnvironmentBuilder(platform);
    ConfigDatabase configDB = new IniFileConfigDatabase(platform);
    return new JEGraphDatabase_v0_1(configDB, envProvider, new Hints());
}
Also used : Hints(org.locationtech.geogig.repository.Hints) ConfigDatabase(org.locationtech.geogig.storage.ConfigDatabase) IniFileConfigDatabase(org.locationtech.geogig.storage.fs.IniFileConfigDatabase) File(java.io.File) IniFileConfigDatabase(org.locationtech.geogig.storage.fs.IniFileConfigDatabase)

Example 4 with IniFileConfigDatabase

use of org.locationtech.geogig.storage.fs.IniFileConfigDatabase in project GeoGig by boundlessgeo.

the class JEGraphDatabaseV2StressTest method createDatabase.

@Override
protected GraphDatabase createDatabase(TestPlatform platform) {
    File root = platform.pwd();
    Preconditions.checkState(new File(root, ".geogig").exists());
    envProvider = new EnvironmentBuilder(platform);
    ConfigDatabase configDB = new IniFileConfigDatabase(platform);
    return new JEGraphDatabase_v0_1(configDB, envProvider, new Hints());
}
Also used : Hints(org.locationtech.geogig.repository.Hints) ConfigDatabase(org.locationtech.geogig.storage.ConfigDatabase) IniFileConfigDatabase(org.locationtech.geogig.storage.fs.IniFileConfigDatabase) File(java.io.File) IniFileConfigDatabase(org.locationtech.geogig.storage.fs.IniFileConfigDatabase)

Example 5 with IniFileConfigDatabase

use of org.locationtech.geogig.storage.fs.IniFileConfigDatabase in project GeoGig by boundlessgeo.

the class CachingModuleTest method setUp.

@Before
public void setUp() throws Exception {
    odbCache = mock(Cache.class);
    indexCache = mock(Cache.class);
    final ObjectDatabaseCacheFactory odbCacheFac = mock(ObjectDatabaseCacheFactory.class);
    when(odbCacheFac.get()).thenReturn(odbCache);
    final StagingDatabaseCacheFactory indexCacheFac = mock(StagingDatabaseCacheFactory.class);
    when(indexCacheFac.get()).thenReturn(indexCache);
    File workingDirectory = tmpFolder.getRoot();
    final Platform platform = new TestPlatform(workingDirectory);
    Module module = new AbstractModule() {

        @Override
        protected void configure() {
            bind(Context.class).to(GuiceInjector.class).in(Scopes.SINGLETON);
            Multibinder.newSetBinder(binder(), Decorator.class);
            bind(DecoratorProvider.class).in(Scopes.SINGLETON);
            DataStreamSerializationFactoryV1 sfac = DataStreamSerializationFactoryV1.INSTANCE;
            bind(ObjectSerializingFactory.class).toInstance(sfac);
            bind(ObjectDatabase.class).to(HeapObjectDatabse.class).in(Scopes.SINGLETON);
            bind(StagingDatabase.class).to(HeapStagingDatabase.class).in(Scopes.SINGLETON);
            ConfigDatabase config = new IniFileConfigDatabase(platform);
            bind(ConfigDatabase.class).toInstance(config);
            bind(ObjectDatabaseCacheFactory.class).toInstance(odbCacheFac);
            bind(StagingDatabaseCacheFactory.class).toInstance(indexCacheFac);
        }
    };
    Context injector = Guice.createInjector(Modules.override(new CachingModule()).with(module)).getInstance(org.locationtech.geogig.api.Context.class);
    odb = injector.objectDatabase();
    index = injector.stagingDatabase();
    odb.open();
    index.open();
    odb.put(o1);
    odb.put(o2);
    odb.put(o3);
    index.put(s1);
    index.put(s2);
    index.put(s3);
}
Also used : ObjectSerializingFactory(org.locationtech.geogig.storage.ObjectSerializingFactory) Context(org.locationtech.geogig.api.Context) TestPlatform(org.locationtech.geogig.api.TestPlatform) Platform(org.locationtech.geogig.api.Platform) DecoratorProvider(org.locationtech.geogig.di.DecoratorProvider) IniFileConfigDatabase(org.locationtech.geogig.storage.fs.IniFileConfigDatabase) ConfigDatabase(org.locationtech.geogig.storage.ConfigDatabase) HeapObjectDatabse(org.locationtech.geogig.storage.memory.HeapObjectDatabse) IniFileConfigDatabase(org.locationtech.geogig.storage.fs.IniFileConfigDatabase) AbstractModule(com.google.inject.AbstractModule) GuiceInjector(org.locationtech.geogig.di.GuiceInjector) TestPlatform(org.locationtech.geogig.api.TestPlatform) HeapStagingDatabase(org.locationtech.geogig.storage.memory.HeapStagingDatabase) Module(com.google.inject.Module) AbstractModule(com.google.inject.AbstractModule) DataStreamSerializationFactoryV1(org.locationtech.geogig.storage.datastream.DataStreamSerializationFactoryV1) File(java.io.File) Cache(com.google.common.cache.Cache) Before(org.junit.Before)

Aggregations

ConfigDatabase (org.locationtech.geogig.storage.ConfigDatabase)6 IniFileConfigDatabase (org.locationtech.geogig.storage.fs.IniFileConfigDatabase)6 File (java.io.File)5 Hints (org.locationtech.geogig.repository.Hints)4 Cache (com.google.common.cache.Cache)1 AbstractModule (com.google.inject.AbstractModule)1 Module (com.google.inject.Module)1 Before (org.junit.Before)1 Context (org.locationtech.geogig.api.Context)1 Platform (org.locationtech.geogig.api.Platform)1 TestPlatform (org.locationtech.geogig.api.TestPlatform)1 DecoratorProvider (org.locationtech.geogig.di.DecoratorProvider)1 GuiceInjector (org.locationtech.geogig.di.GuiceInjector)1 ObjectSerializingFactory (org.locationtech.geogig.storage.ObjectSerializingFactory)1 DataStreamSerializationFactoryV1 (org.locationtech.geogig.storage.datastream.DataStreamSerializationFactoryV1)1 HeapObjectDatabse (org.locationtech.geogig.storage.memory.HeapObjectDatabse)1 HeapStagingDatabase (org.locationtech.geogig.storage.memory.HeapStagingDatabase)1