Search in sources :

Example 1 with AdminResponse

use of org.apache.geode.internal.admin.remote.AdminResponse in project geode by apache.

the class PrepareBackupRequest method send.

public static Map<DistributedMember, Set<PersistentID>> send(DM dm, Set recipients) {
    PrepareBackupRequest request = new PrepareBackupRequest();
    request.setRecipients(recipients);
    PrepareBackupReplyProcessor replyProcessor = new PrepareBackupReplyProcessor(dm, recipients);
    request.msgId = replyProcessor.getProcessorId();
    dm.putOutgoing(request);
    try {
        replyProcessor.waitForReplies();
    } catch (ReplyException e) {
        if (!(e.getCause() instanceof CancelException)) {
            throw e;
        }
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    AdminResponse response = request.createResponse((DistributionManager) dm);
    response.setSender(dm.getDistributionManagerId());
    replyProcessor.process(response);
    return replyProcessor.results;
}
Also used : AdminResponse(org.apache.geode.internal.admin.remote.AdminResponse) CancelException(org.apache.geode.CancelException) ReplyException(org.apache.geode.distributed.internal.ReplyException)

Example 2 with AdminResponse

use of org.apache.geode.internal.admin.remote.AdminResponse in project geode by apache.

the class FinishBackupRequest method send.

public static Map<DistributedMember, Set<PersistentID>> send(DM dm, Set recipients, File targetDir, File baselineDir, boolean abort) {
    FinishBackupRequest request = new FinishBackupRequest(targetDir, baselineDir, abort);
    request.setRecipients(recipients);
    FinishBackupReplyProcessor replyProcessor = new FinishBackupReplyProcessor(dm, recipients);
    request.msgId = replyProcessor.getProcessorId();
    dm.putOutgoing(request);
    try {
        replyProcessor.waitForReplies();
    } catch (ReplyException e) {
        if (!(e.getCause() instanceof CancelException)) {
            throw e;
        }
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    AdminResponse response = request.createResponse((DistributionManager) dm);
    response.setSender(dm.getDistributionManagerId());
    replyProcessor.process(response);
    return replyProcessor.results;
}
Also used : AdminResponse(org.apache.geode.internal.admin.remote.AdminResponse) CancelException(org.apache.geode.CancelException) ReplyException(org.apache.geode.distributed.internal.ReplyException)

Example 3 with AdminResponse

use of org.apache.geode.internal.admin.remote.AdminResponse in project geode by apache.

the class FlushToDiskRequest method send.

public static void send(DM dm, Set recipients) {
    FlushToDiskRequest request = new FlushToDiskRequest();
    request.setRecipients(recipients);
    FlushToDiskProcessor replyProcessor = new FlushToDiskProcessor(dm, recipients);
    request.msgId = replyProcessor.getProcessorId();
    dm.putOutgoing(request);
    try {
        replyProcessor.waitForReplies();
    } catch (ReplyException e) {
        if (!(e.getCause() instanceof CancelException)) {
            throw e;
        }
    } catch (InterruptedException e) {
        logger.debug(e);
    }
    AdminResponse response = request.createResponse((DistributionManager) dm);
    response.setSender(dm.getDistributionManagerId());
    replyProcessor.process(response);
}
Also used : AdminResponse(org.apache.geode.internal.admin.remote.AdminResponse) CancelException(org.apache.geode.CancelException) ReplyException(org.apache.geode.distributed.internal.ReplyException)

Aggregations

CancelException (org.apache.geode.CancelException)3 ReplyException (org.apache.geode.distributed.internal.ReplyException)3 AdminResponse (org.apache.geode.internal.admin.remote.AdminResponse)3