Search in sources :

Example 1 with PersistService

use of com.google.inject.persist.PersistService in project metacat by Netflix.

the class S3ConnectorFactory method init.

private void init() {
    //JPA module
    final Map<String, Object> props = Maps.newHashMap(configuration);
    props.put("hibernate.connection.datasource", DataSourceManager.get().load(name, configuration).get(name));
    final Module jpaModule = new JpaPersistModule("s3").properties(props);
    final Module s3Module = new S3Module(name, configuration, infoConverter);
    final Injector injector = Guice.createInjector(jpaModule, s3Module);
    persistService = injector.getInstance(PersistService.class);
    persistService.start();
    this.databaseService = injector.getInstance(ConnectorDatabaseService.class);
    this.tableService = injector.getInstance(ConnectorTableService.class);
    this.partitionService = injector.getInstance(ConnectorPartitionService.class);
}
Also used : ConnectorDatabaseService(com.netflix.metacat.common.server.connectors.ConnectorDatabaseService) ConnectorTableService(com.netflix.metacat.common.server.connectors.ConnectorTableService) Injector(com.google.inject.Injector) ConnectorPartitionService(com.netflix.metacat.common.server.connectors.ConnectorPartitionService) PersistService(com.google.inject.persist.PersistService) Module(com.google.inject.Module) JpaPersistModule(com.google.inject.persist.jpa.JpaPersistModule) JpaPersistModule(com.google.inject.persist.jpa.JpaPersistModule)

Aggregations

Injector (com.google.inject.Injector)1 Module (com.google.inject.Module)1 PersistService (com.google.inject.persist.PersistService)1 JpaPersistModule (com.google.inject.persist.jpa.JpaPersistModule)1 ConnectorDatabaseService (com.netflix.metacat.common.server.connectors.ConnectorDatabaseService)1 ConnectorPartitionService (com.netflix.metacat.common.server.connectors.ConnectorPartitionService)1 ConnectorTableService (com.netflix.metacat.common.server.connectors.ConnectorTableService)1