use of org.apache.asterix.installer.schema.conf.Backup in project asterixdb by apache.
the class BackupConfig method execCommand.
@Override
protected void execCommand() throws Exception {
InstallerDriver.initConfig(true);
String asterixInstanceName = ((BackupConfig) config).name;
AsterixInstance instance = AsterixEventServiceUtil.validateAsterixInstanceExists(asterixInstanceName, State.INACTIVE);
List<BackupInfo> backupInfo = instance.getBackupInfo();
Backup backupConf = AsterixEventService.getConfiguration().getBackup();
Patterns patterns = PatternCreator.INSTANCE.getBackUpAsterixPattern(instance, backupConf);
AsterixEventService.getAsterixEventServiceClient(instance.getCluster()).submit(patterns);
int backupId = backupInfo.size();
BackupInfo binfo = new BackupInfo(backupId, new Date(), backupConf);
backupInfo.add(binfo);
LOGGER.info(asterixInstanceName + " backed up " + binfo);
ServiceProvider.INSTANCE.getLookupService().updateAsterixInstance(instance);
}
Aggregations