private PrimaryBackupClient newClient() { return PrimaryBackupClient.builder() .withClientName(partition.name()) .withPartitionId(partition.id()) .withMembershipService(managementService.getMembershipService()) .withProtocol(new PrimaryBackupClientCommunicator( partition.name(), Serializer.using(PrimaryBackupNamespaces.PROTOCOL), managementService.getMessagingService())) .withPrimaryElection(managementService.getElectionService().getElectionFor(partition.id())) .withSessionIdProvider(managementService.getSessionIdService()) .withThreadContextFactory(threadFactory) .build(); }
private DistributedLogSessionClient newClient() { return DistributedLogSessionClient.builder() .withClientName(partition.name()) .withPartitionId(partition.id()) .withMembershipService(managementService.getMembershipService()) .withProtocol(new LogClientCommunicator( partition.name(), Serializer.using(LogNamespaces.PROTOCOL), managementService.getMessagingService())) .withSessionIdProvider(() -> managementService.getSessionIdService().nextSessionId()) .withPrimaryElection(managementService.getElectionService().getElectionFor(partition.id())) .withThreadContextFactory(threadFactory) .build(); }
private DistributedLogSessionClient newClient() { return DistributedLogSessionClient.builder() .withClientName(partition.name()) .withPartitionId(partition.id()) .withMembershipService(managementService.getMembershipService()) .withProtocol(new LogClientCommunicator( partition.name(), Serializer.using(LogNamespaces.PROTOCOL), managementService.getMessagingService())) .withSessionIdProvider(() -> managementService.getSessionIdService().nextSessionId()) .withPrimaryElection(managementService.getElectionService().getElectionFor(partition.id())) .withThreadContextFactory(threadFactory) .build(); }