Search in sources :

Example 11 with BackupManager

use of org.apache.geode.internal.cache.persistence.BackupManager in project geode by apache.

the class PrepareBackupRequest method createResponse.

@Override
protected AdminResponse createResponse(DistributionManager dm) {
    InternalCache cache = GemFireCacheImpl.getInstance();
    HashSet<PersistentID> persistentIds;
    if (cache == null) {
        persistentIds = new HashSet<>();
    } else {
        try {
            BackupManager manager = cache.startBackup(getSender());
            persistentIds = manager.prepareBackup();
        } catch (IOException e) {
            logger.error(LocalizedMessage.create(LocalizedStrings.CliLegacyMessage_ERROR, this.getClass()), e);
            return AdminFailureResponse.create(dm, getSender(), e);
        }
    }
    return new PrepareBackupResponse(this.getSender(), persistentIds);
}
Also used : InternalCache(org.apache.geode.internal.cache.InternalCache) IOException(java.io.IOException) BackupManager(org.apache.geode.internal.cache.persistence.BackupManager) PersistentID(org.apache.geode.cache.persistence.PersistentID)

Aggregations

BackupManager (org.apache.geode.internal.cache.persistence.BackupManager)11 Test (org.junit.Test)5 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)4 IOException (java.io.IOException)3 DiskStore (org.apache.geode.cache.DiskStore)3 Region (org.apache.geode.cache.Region)3 File (java.io.File)2 PersistentID (org.apache.geode.cache.persistence.PersistentID)2 PersistentMemberManager (org.apache.geode.internal.cache.persistence.PersistentMemberManager)2 RegexFileFilter (org.apache.commons.io.filefilter.RegexFileFilter)1 FinishBackupRequest (org.apache.geode.admin.internal.FinishBackupRequest)1 PrepareBackupRequest (org.apache.geode.admin.internal.PrepareBackupRequest)1 DiskStoreFactory (org.apache.geode.cache.DiskStoreFactory)1 DM (org.apache.geode.distributed.internal.DM)1 DLockService (org.apache.geode.distributed.internal.locks.DLockService)1 InternalCache (org.apache.geode.internal.cache.InternalCache)1 RestoreScript (org.apache.geode.internal.cache.persistence.RestoreScript)1 CacheCreation (org.apache.geode.internal.cache.xmlcache.CacheCreation)1 DiskStoreAttributesCreation (org.apache.geode.internal.cache.xmlcache.DiskStoreAttributesCreation)1 DiskBackupResult (org.apache.geode.management.DiskBackupResult)1