Search in sources :

Example 11 with DistributedSystemConfig

use of org.apache.geode.admin.DistributedSystemConfig in project geode by apache.

the class IncrementalBackupDUnitTest method incremental.

/**
   * Invokes {@link AdminDistributedSystem#backupAllMembers(File, File)} on a member.
   * 
   * @param vm a member of the distributed system.
   * @return a status of the backup operation.
   */
private BackupStatus incremental(VM vm) {
    return (BackupStatus) vm.invoke(new SerializableCallable("Backup all members.") {

        @Override
        public Object call() {
            DistributedSystemConfig config;
            AdminDistributedSystem adminDS = null;
            try {
                config = AdminDistributedSystemFactory.defineDistributedSystem(getSystem(), "");
                adminDS = AdminDistributedSystemFactory.getDistributedSystem(config);
                adminDS.connect();
                return adminDS.backupAllMembers(getIncrementalDir(), getBaselineBackupDir());
            } catch (AdminException e) {
                throw new RuntimeException(e);
            } finally {
                if (adminDS != null) {
                    adminDS.disconnect();
                }
            }
        }
    });
}
Also used : AdminException(org.apache.geode.admin.AdminException) DistributedSystemConfig(org.apache.geode.admin.DistributedSystemConfig) SerializableCallable(org.apache.geode.test.dunit.SerializableCallable) AdminDistributedSystem(org.apache.geode.admin.AdminDistributedSystem) BackupStatus(org.apache.geode.admin.BackupStatus)

Aggregations

DistributedSystemConfig (org.apache.geode.admin.DistributedSystemConfig)11 AdminException (org.apache.geode.admin.AdminException)10 AdminDistributedSystem (org.apache.geode.admin.AdminDistributedSystem)9 SerializableCallable (org.apache.geode.test.dunit.SerializableCallable)5 SerializableRunnable (org.apache.geode.test.dunit.SerializableRunnable)5 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)5 Test (org.junit.Test)5 HashMap (java.util.HashMap)4 Map (java.util.Map)4 Set (java.util.Set)4 BackupStatus (org.apache.geode.admin.BackupStatus)4 GemFireCacheImpl (org.apache.geode.internal.cache.GemFireCacheImpl)4 Host (org.apache.geode.test.dunit.Host)4 VM (org.apache.geode.test.dunit.VM)4 FlakyTest (org.apache.geode.test.junit.categories.FlakyTest)4 IOException (java.io.IOException)3 Cache (org.apache.geode.cache.Cache)3 Region (org.apache.geode.cache.Region)3 ConflictingPersistentDataException (org.apache.geode.cache.persistence.ConflictingPersistentDataException)3 PersistentID (org.apache.geode.cache.persistence.PersistentID)3