Search in sources :

Example 1 with Backup

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);
}
Also used : BackupInfo(org.apache.asterix.event.model.BackupInfo) Backup(org.apache.asterix.installer.schema.conf.Backup) AsterixInstance(org.apache.asterix.event.model.AsterixInstance) Patterns(org.apache.asterix.event.schema.pattern.Patterns) Date(java.util.Date)

Aggregations

Date (java.util.Date)1 AsterixInstance (org.apache.asterix.event.model.AsterixInstance)1 BackupInfo (org.apache.asterix.event.model.BackupInfo)1 Patterns (org.apache.asterix.event.schema.pattern.Patterns)1 Backup (org.apache.asterix.installer.schema.conf.Backup)1