Search in sources :

Example 1 with InMemoryMetricsTableModule

use of io.cdap.cdap.data2.dataset2.module.lib.inmemory.InMemoryMetricsTableModule in project cdap by caskdata.

the class SystemDatasetRuntimeModule method getInMemoryModules.

@Override
public Module getInMemoryModules() {
    return new AbstractModule() {

        @Override
        protected void configure() {
            MapBinder<String, DatasetModule> mapBinder = MapBinder.newMapBinder(binder(), String.class, DatasetModule.class, Constants.Dataset.Manager.DefaultDatasetModules.class);
            // NOTE: order is important due to dependencies between modules
            mapBinder.addBinding("orderedTable-memory").toInstance(new InMemoryTableModule());
            mapBinder.addBinding("metricsTable-memory").toInstance(new InMemoryMetricsTableModule());
            bindDefaultModules(mapBinder);
        }
    };
}
Also used : InMemoryTableModule(co.cask.cdap.data2.dataset2.module.lib.inmemory.InMemoryTableModule) InMemoryMetricsTableModule(co.cask.cdap.data2.dataset2.module.lib.inmemory.InMemoryMetricsTableModule) Constants(co.cask.cdap.common.conf.Constants) HBaseQueueDatasetModule(co.cask.cdap.data2.transaction.queue.hbase.HBaseQueueDatasetModule) LineageDatasetModule(co.cask.cdap.data2.metadata.lineage.LineageDatasetModule) ExternalDatasetModule(co.cask.cdap.data2.dataset2.lib.external.ExternalDatasetModule) UsageDatasetModule(co.cask.cdap.data2.registry.UsageDatasetModule) MetadataDatasetModule(co.cask.cdap.data2.metadata.dataset.MetadataDatasetModule) DatasetModule(co.cask.cdap.api.dataset.module.DatasetModule) AbstractModule(com.google.inject.AbstractModule)

Example 2 with InMemoryMetricsTableModule

use of io.cdap.cdap.data2.dataset2.module.lib.inmemory.InMemoryMetricsTableModule in project cdap by caskdata.

the class SystemDatasetRuntimeModule method getInMemoryModules.

@Override
public Module getInMemoryModules() {
    return new AbstractModule() {

        @Override
        protected void configure() {
            MapBinder<String, DatasetModule> mapBinder = MapBinder.newMapBinder(binder(), String.class, DatasetModule.class, Constants.Dataset.Manager.DefaultDatasetModules.class);
            // NOTE: order is important due to dependencies between modules
            mapBinder.addBinding("orderedTable-memory").toInstance(new InMemoryTableModule());
            mapBinder.addBinding("metricsTable-memory").toInstance(new InMemoryMetricsTableModule());
            bindDefaultModules(mapBinder);
            bind(String.class).annotatedWith(Names.named(Constants.Dataset.TABLE_TYPE)).toInstance("table");
            bind(DatasetDefinition.class).annotatedWith(Names.named(Constants.Dataset.TABLE_TYPE)).to(InMemoryTableDefinition.class);
            bind(String.class).annotatedWith(Names.named(Constants.Dataset.TABLE_TYPE_NO_TX)).toInstance("table-no-tx");
            bind(DatasetDefinition.class).annotatedWith(Names.named(Constants.Dataset.TABLE_TYPE_NO_TX)).to(InMemoryMetricsTableDefinition.class);
            // Direct binding for the Metrics table definition such that metrics system doesn't need to go through
            // dataset service to get metrics table.
            bind(new TypeLiteral<DatasetDefinition<MetricsTable, DatasetAdmin>>() {
            }).toInstance(new InMemoryMetricsTableDefinition(MetricsTable.class.getName()));
        }
    };
}
Also used : InMemoryMetricsTableDefinition(io.cdap.cdap.data2.dataset2.lib.table.inmemory.InMemoryMetricsTableDefinition) InMemoryTableModule(io.cdap.cdap.data2.dataset2.module.lib.inmemory.InMemoryTableModule) MetricsTable(io.cdap.cdap.data2.dataset2.lib.table.MetricsTable) InMemoryMetricsTableModule(io.cdap.cdap.data2.dataset2.module.lib.inmemory.InMemoryMetricsTableModule) TypeLiteral(com.google.inject.TypeLiteral) Constants(io.cdap.cdap.common.conf.Constants) DatasetAdmin(io.cdap.cdap.api.dataset.DatasetAdmin) ExternalDatasetModule(io.cdap.cdap.data2.dataset2.lib.external.ExternalDatasetModule) DatasetModule(io.cdap.cdap.api.dataset.module.DatasetModule) AbstractModule(com.google.inject.AbstractModule)

Example 3 with InMemoryMetricsTableModule

use of io.cdap.cdap.data2.dataset2.module.lib.inmemory.InMemoryMetricsTableModule in project cdap by cdapio.

the class SystemDatasetRuntimeModule method getInMemoryModules.

@Override
public Module getInMemoryModules() {
    return new AbstractModule() {

        @Override
        protected void configure() {
            MapBinder<String, DatasetModule> mapBinder = MapBinder.newMapBinder(binder(), String.class, DatasetModule.class, Constants.Dataset.Manager.DefaultDatasetModules.class);
            // NOTE: order is important due to dependencies between modules
            mapBinder.addBinding("orderedTable-memory").toInstance(new InMemoryTableModule());
            mapBinder.addBinding("metricsTable-memory").toInstance(new InMemoryMetricsTableModule());
            bindDefaultModules(mapBinder);
            bind(String.class).annotatedWith(Names.named(Constants.Dataset.TABLE_TYPE)).toInstance("table");
            bind(DatasetDefinition.class).annotatedWith(Names.named(Constants.Dataset.TABLE_TYPE)).to(InMemoryTableDefinition.class);
            bind(String.class).annotatedWith(Names.named(Constants.Dataset.TABLE_TYPE_NO_TX)).toInstance("table-no-tx");
            bind(DatasetDefinition.class).annotatedWith(Names.named(Constants.Dataset.TABLE_TYPE_NO_TX)).to(InMemoryMetricsTableDefinition.class);
            // Direct binding for the Metrics table definition such that metrics system doesn't need to go through
            // dataset service to get metrics table.
            bind(new TypeLiteral<DatasetDefinition<MetricsTable, DatasetAdmin>>() {
            }).toInstance(new InMemoryMetricsTableDefinition(MetricsTable.class.getName()));
        }
    };
}
Also used : InMemoryMetricsTableDefinition(io.cdap.cdap.data2.dataset2.lib.table.inmemory.InMemoryMetricsTableDefinition) InMemoryTableModule(io.cdap.cdap.data2.dataset2.module.lib.inmemory.InMemoryTableModule) MetricsTable(io.cdap.cdap.data2.dataset2.lib.table.MetricsTable) InMemoryMetricsTableModule(io.cdap.cdap.data2.dataset2.module.lib.inmemory.InMemoryMetricsTableModule) TypeLiteral(com.google.inject.TypeLiteral) Constants(io.cdap.cdap.common.conf.Constants) DatasetAdmin(io.cdap.cdap.api.dataset.DatasetAdmin) ExternalDatasetModule(io.cdap.cdap.data2.dataset2.lib.external.ExternalDatasetModule) DatasetModule(io.cdap.cdap.api.dataset.module.DatasetModule) AbstractModule(com.google.inject.AbstractModule)

Aggregations

AbstractModule (com.google.inject.AbstractModule)3 TypeLiteral (com.google.inject.TypeLiteral)2 DatasetAdmin (io.cdap.cdap.api.dataset.DatasetAdmin)2 DatasetModule (io.cdap.cdap.api.dataset.module.DatasetModule)2 Constants (io.cdap.cdap.common.conf.Constants)2 ExternalDatasetModule (io.cdap.cdap.data2.dataset2.lib.external.ExternalDatasetModule)2 MetricsTable (io.cdap.cdap.data2.dataset2.lib.table.MetricsTable)2 InMemoryMetricsTableDefinition (io.cdap.cdap.data2.dataset2.lib.table.inmemory.InMemoryMetricsTableDefinition)2 InMemoryMetricsTableModule (io.cdap.cdap.data2.dataset2.module.lib.inmemory.InMemoryMetricsTableModule)2 InMemoryTableModule (io.cdap.cdap.data2.dataset2.module.lib.inmemory.InMemoryTableModule)2 DatasetModule (co.cask.cdap.api.dataset.module.DatasetModule)1 Constants (co.cask.cdap.common.conf.Constants)1 ExternalDatasetModule (co.cask.cdap.data2.dataset2.lib.external.ExternalDatasetModule)1 InMemoryMetricsTableModule (co.cask.cdap.data2.dataset2.module.lib.inmemory.InMemoryMetricsTableModule)1 InMemoryTableModule (co.cask.cdap.data2.dataset2.module.lib.inmemory.InMemoryTableModule)1 MetadataDatasetModule (co.cask.cdap.data2.metadata.dataset.MetadataDatasetModule)1 LineageDatasetModule (co.cask.cdap.data2.metadata.lineage.LineageDatasetModule)1 UsageDatasetModule (co.cask.cdap.data2.registry.UsageDatasetModule)1 HBaseQueueDatasetModule (co.cask.cdap.data2.transaction.queue.hbase.HBaseQueueDatasetModule)1