use of com.serotonin.m2m2.db.dao.migration.progress.MigrationProgressDao in project ma-core-public by MangoAutomation.
the class MigrationPointValueDaoDefinition method initialize.
@Override
public void initialize() {
if (definitions.size() < 2) {
throw new IllegalStateException("Migration requires two enabled time-series databases");
}
// list of injected definitions does not include ourselves, get the next two definitions
this.primary = definitions.get(0);
this.secondary = definitions.get(1);
primary.initialize();
secondary.initialize();
this.pointValueDao = new MigrationPointValueDao(primary.getPointValueDao(), secondary.getPointValueDao(), dataPointDao, vo -> true, env, executorService, scheduledExecutorService, context, timer, migrationProgressDao);
if (log.isInfoEnabled()) {
log.info("Time series migration enabled, from {} (secondary) to {} (primary)", secondary.getClass().getSimpleName(), primary.getClass().getSimpleName());
}
}
use of com.serotonin.m2m2.db.dao.migration.progress.MigrationProgressDao in project ma-core-public by infiniteautomation.
the class MigrationPointValueDaoDefinition method initialize.
@Override
public void initialize() {
if (definitions.size() < 2) {
throw new IllegalStateException("Migration requires two enabled time-series databases");
}
// list of injected definitions does not include ourselves, get the next two definitions
this.primary = definitions.get(0);
this.secondary = definitions.get(1);
primary.initialize();
secondary.initialize();
this.pointValueDao = new MigrationPointValueDao(primary.getPointValueDao(), secondary.getPointValueDao(), dataPointDao, executorService, scheduledExecutorService, clock.withZone(config.getZone()), migrationProgressDao, config);
context.addApplicationListener((ApplicationListener<MangoConfigurationReloadedEvent>) e -> pointValueDao.reloadConfig());
if (log.isInfoEnabled()) {
log.info("Time series migration enabled, from {} (secondary) to {} (primary)", secondary.getClass().getSimpleName(), primary.getClass().getSimpleName());
}
}
Aggregations