Search in sources :

Example 21 with RetryableHazelcastException

use of com.hazelcast.spi.exception.RetryableHazelcastException in project hazelcast by hazelcast.

the class ParallelPartitionScanExecutorTest method execute_fail_retryable.

@Test
public void execute_fail_retryable() {
    PartitionScanRunner runner = mock(PartitionScanRunner.class);
    ParallelPartitionScanExecutor executor = executor(runner);
    Predicate predicate = Predicates.equal("attribute", 1);
    QueryResult queryResult = new QueryResult(IterationType.ENTRY, null, null, Long.MAX_VALUE, false);
    doThrow(new RetryableHazelcastException()).when(runner).run(anyString(), eq(predicate), anyInt(), isA(QueryResult.class));
    expected.expect(RetryableHazelcastException.class);
    executor.execute("Map", predicate, asList(1, 2, 3), queryResult);
}
Also used : RetryableHazelcastException(com.hazelcast.spi.exception.RetryableHazelcastException) Predicate(com.hazelcast.query.Predicate) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 22 with RetryableHazelcastException

use of com.hazelcast.spi.exception.RetryableHazelcastException in project hazelcast by hazelcast.

the class CallerRunsPartitionScanExecutorTest method execute_fail_retryable.

@Test
public void execute_fail_retryable() {
    PartitionScanRunner runner = mock(PartitionScanRunner.class);
    CallerRunsPartitionScanExecutor executor = new CallerRunsPartitionScanExecutor(runner);
    Predicate predicate = Predicates.equal("attribute", 1);
    QueryResult queryResult = new QueryResult(IterationType.ENTRY, null, null, Long.MAX_VALUE, false);
    doThrow(new RetryableHazelcastException()).when(runner).run(anyString(), eq(predicate), anyInt(), eq(queryResult));
    expected.expect(RetryableHazelcastException.class);
    executor.execute("Map", predicate, asList(1, 2, 3), queryResult);
}
Also used : RetryableHazelcastException(com.hazelcast.spi.exception.RetryableHazelcastException) Predicate(com.hazelcast.query.Predicate) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

RetryableHazelcastException (com.hazelcast.spi.exception.RetryableHazelcastException)22 InternalPartitionServiceImpl (com.hazelcast.internal.partition.impl.InternalPartitionServiceImpl)6 Address (com.hazelcast.cluster.Address)5 TopologyChangedException (com.hazelcast.jet.core.TopologyChangedException)4 HazelcastInstanceNotActiveException (com.hazelcast.core.HazelcastInstanceNotActiveException)3 MemberInfo (com.hazelcast.internal.cluster.MemberInfo)3 ClusterServiceImpl (com.hazelcast.internal.cluster.impl.ClusterServiceImpl)3 MembershipManager (com.hazelcast.internal.cluster.impl.MembershipManager)3 TriggerMemberListPublishOp (com.hazelcast.internal.cluster.impl.operations.TriggerMemberListPublishOp)3 ILogger (com.hazelcast.logging.ILogger)3 Address (com.hazelcast.nio.Address)3 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)3 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)3 MemberImpl (com.hazelcast.cluster.impl.MemberImpl)2 MemberLeftException (com.hazelcast.core.MemberLeftException)2 MigrationInfo (com.hazelcast.internal.partition.MigrationInfo)2 Predicate (com.hazelcast.query.Predicate)2 NodeEngine (com.hazelcast.spi.impl.NodeEngine)2 QuickTest (com.hazelcast.test.annotation.QuickTest)2 Test (org.junit.Test)2