Search in sources :

Example 1 with TestPrimaryBackupProtocolFactory

use of io.atomix.protocols.backup.protocol.TestPrimaryBackupProtocolFactory in project atomix by atomix.

the class PrimaryBackupTest method clearTests.

@Before
@After
public void clearTests() throws Exception {
    Futures.allOf(servers.stream().map(s -> s.stop().exceptionally(v -> null)).collect(Collectors.toList())).get(30, TimeUnit.SECONDS);
    Futures.allOf(clients.stream().map(c -> c.close().exceptionally(v -> null)).collect(Collectors.toList())).get(30, TimeUnit.SECONDS);
    nodes = new ArrayList<>();
    memberId = 0;
    sessionId = 0;
    clients = new ArrayList<>();
    servers = new ArrayList<>();
    protocolFactory = new TestPrimaryBackupProtocolFactory();
    election = new TestPrimaryElection(PartitionId.from("test", 1));
}
Also used : BackupInput(io.atomix.primitive.service.BackupInput) ServiceExecutor(io.atomix.primitive.service.ServiceExecutor) DefaultSerializers(io.atomix.utils.serializer.serializers.DefaultSerializers) TimeoutException(java.util.concurrent.TimeoutException) CompletableFuture(java.util.concurrent.CompletableFuture) Role(io.atomix.protocols.backup.PrimaryBackupServer.Role) EventType(io.atomix.primitive.event.EventType) TestPrimaryBackupProtocolFactory(io.atomix.protocols.backup.protocol.TestPrimaryBackupProtocolFactory) MemberGroupStrategy(io.atomix.primitive.partition.MemberGroupStrategy) PartitionId(io.atomix.primitive.partition.PartitionId) ArrayList(java.util.ArrayList) SessionId(io.atomix.primitive.session.SessionId) OperationId(io.atomix.primitive.operation.OperationId) PrimitiveOperation.operation(io.atomix.primitive.operation.PrimitiveOperation.operation) PrimitiveManagementService(io.atomix.primitive.PrimitiveManagementService) PrimitiveConfig(io.atomix.primitive.config.PrimitiveConfig) After(org.junit.After) Duration(java.time.Duration) TestClusterMembershipService(io.atomix.cluster.TestClusterMembershipService) MemberId(io.atomix.cluster.MemberId) Session(io.atomix.primitive.session.Session) Futures(io.atomix.utils.concurrent.Futures) ConcurrentTestCase(net.jodah.concurrentunit.ConcurrentTestCase) Before(org.junit.Before) PrimitiveBuilder(io.atomix.primitive.PrimitiveBuilder) Commit(io.atomix.primitive.service.Commit) TestPrimaryElection(io.atomix.primitive.partition.TestPrimaryElection) Test(org.junit.Test) Collectors(java.util.stream.Collectors) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) AtomicLong(java.util.concurrent.atomic.AtomicLong) List(java.util.List) PrimitiveService(io.atomix.primitive.service.PrimitiveService) AbstractPrimitiveService(io.atomix.primitive.service.AbstractPrimitiveService) Ignore(org.junit.Ignore) ServiceConfig(io.atomix.primitive.service.ServiceConfig) PrimitiveType(io.atomix.primitive.PrimitiveType) PrimaryElection(io.atomix.primitive.partition.PrimaryElection) Replication(io.atomix.primitive.Replication) BackupOutput(io.atomix.primitive.service.BackupOutput) SessionClient(io.atomix.primitive.session.SessionClient) Serializer(io.atomix.utils.serializer.Serializer) Assert.assertEquals(org.junit.Assert.assertEquals) TestPrimaryElection(io.atomix.primitive.partition.TestPrimaryElection) TestPrimaryBackupProtocolFactory(io.atomix.protocols.backup.protocol.TestPrimaryBackupProtocolFactory) Before(org.junit.Before) After(org.junit.After)

Aggregations

MemberId (io.atomix.cluster.MemberId)1 TestClusterMembershipService (io.atomix.cluster.TestClusterMembershipService)1 PrimitiveBuilder (io.atomix.primitive.PrimitiveBuilder)1 PrimitiveManagementService (io.atomix.primitive.PrimitiveManagementService)1 PrimitiveType (io.atomix.primitive.PrimitiveType)1 Replication (io.atomix.primitive.Replication)1 PrimitiveConfig (io.atomix.primitive.config.PrimitiveConfig)1 EventType (io.atomix.primitive.event.EventType)1 OperationId (io.atomix.primitive.operation.OperationId)1 PrimitiveOperation.operation (io.atomix.primitive.operation.PrimitiveOperation.operation)1 MemberGroupStrategy (io.atomix.primitive.partition.MemberGroupStrategy)1 PartitionId (io.atomix.primitive.partition.PartitionId)1 PrimaryElection (io.atomix.primitive.partition.PrimaryElection)1 TestPrimaryElection (io.atomix.primitive.partition.TestPrimaryElection)1 AbstractPrimitiveService (io.atomix.primitive.service.AbstractPrimitiveService)1 BackupInput (io.atomix.primitive.service.BackupInput)1 BackupOutput (io.atomix.primitive.service.BackupOutput)1 Commit (io.atomix.primitive.service.Commit)1 PrimitiveService (io.atomix.primitive.service.PrimitiveService)1 ServiceConfig (io.atomix.primitive.service.ServiceConfig)1