Search in sources :

Example 1 with WaitUntilParallelGatewaySenderFlushedCoordinator

use of org.apache.geode.internal.cache.wan.parallel.WaitUntilParallelGatewaySenderFlushedCoordinator in project geode by apache.

the class AbstractGatewaySender method waitUntilFlushed.

public boolean waitUntilFlushed(long timeout, TimeUnit unit) throws InterruptedException {
    boolean result = false;
    if (isParallel()) {
        try {
            WaitUntilParallelGatewaySenderFlushedCoordinator coordinator = new WaitUntilParallelGatewaySenderFlushedCoordinator(this, timeout, unit, true);
            result = coordinator.waitUntilFlushed();
        } catch (BucketMovedException | CancelException | RegionDestroyedException e) {
            logger.warn(LocalizedStrings.AbstractGatewaySender_CAUGHT_EXCEPTION_ATTEMPTING_WAIT_UNTIL_FLUSHED_RETRYING.toLocalizedString(), e);
            throw e;
        } catch (Throwable t) {
            logger.warn(LocalizedStrings.AbstractGatewaySender_CAUGHT_EXCEPTION_ATTEMPTING_WAIT_UNTIL_FLUSHED_RETURNING.toLocalizedString(), t);
            throw new InternalGemFireError(t);
        }
        return result;
    } else {
        // Serial senders are currently not supported
        throw new UnsupportedOperationException(LocalizedStrings.AbstractGatewaySender_WAIT_UNTIL_FLUSHED_NOT_SUPPORTED_FOR_SERIAL_SENDERS.toLocalizedString());
    }
}
Also used : RegionDestroyedException(org.apache.geode.cache.RegionDestroyedException) BucketMovedException(org.apache.geode.internal.cache.execute.BucketMovedException) CancelException(org.apache.geode.CancelException) WaitUntilParallelGatewaySenderFlushedCoordinator(org.apache.geode.internal.cache.wan.parallel.WaitUntilParallelGatewaySenderFlushedCoordinator) InternalGemFireError(org.apache.geode.InternalGemFireError)

Aggregations

CancelException (org.apache.geode.CancelException)1 InternalGemFireError (org.apache.geode.InternalGemFireError)1 RegionDestroyedException (org.apache.geode.cache.RegionDestroyedException)1 BucketMovedException (org.apache.geode.internal.cache.execute.BucketMovedException)1 WaitUntilParallelGatewaySenderFlushedCoordinator (org.apache.geode.internal.cache.wan.parallel.WaitUntilParallelGatewaySenderFlushedCoordinator)1