@Override public CompletableFuture<Void> stop() { if (started.compareAndSet(true, false)) { managementService.getMembershipService().removeListener(clusterEventListener); return transactions.close().exceptionally(e -> null); } return CompletableFuture.completedFuture(null); }
public CoreTransactionService(PrimitiveManagementService managementService) { this.managementService = checkNotNull(managementService); this.localMemberId = managementService.getMembershipService().getLocalMember().id(); }
public CrdtCounterDelegate(String name, CrdtProtocolConfig config, PrimitiveManagementService managementService) { this.localMemberId = managementService.getMembershipService().getLocalMember().id(); this.clusterCommunicator = managementService.getCommunicationService(); this.executorService = managementService.getExecutorService(); this.subject = String.format("atomix-crdt-counter-%s", name); clusterCommunicator.subscribe(subject, SERIALIZER::decode, this::updateCounters, executorService); broadcastFuture = executorService.scheduleAtFixedRate( this::broadcastCounters, config.getGossipInterval().toMillis(), config.getGossipInterval().toMillis(), TimeUnit.MILLISECONDS); }
@Override @SuppressWarnings("unchecked") public CompletableFuture<TransactionService> start() { PrimitiveProtocol protocol = managementService.getPartitionService().getSystemPartitionGroup().newProtocol(); return AtomicMapType.<TransactionId, TransactionInfo>instance() .newBuilder("atomix-transactions", new AtomicMapConfig(), managementService) .withSerializer(SERIALIZER) .withProtocol((ProxyProtocol) protocol) .withCacheEnabled() .buildAsync() .thenApply(transactions -> { this.transactions = transactions.async(); managementService.getMembershipService().addListener(clusterEventListener); LOGGER.info("Started"); started.set(true); return this; }); }
public AntiEntropyMapDelegate(String name, Serializer entrySerializer, AntiEntropyProtocolConfig config, PrimitiveManagementService managementService) { this.localMemberId = managementService.getMembershipService().getLocalMember().id(); this.mapName = name; this.entrySerializer = entrySerializer; this.membershipService = managementService.getMembershipService(); : managementService.getMembershipService() .getMembers() .stream()
@Override public CompletableFuture<Void> stop() { if (started.compareAndSet(true, false)) { managementService.getMembershipService().removeListener(clusterEventListener); return transactions.close().exceptionally(e -> null); } return CompletableFuture.completedFuture(null); }
public CoreTransactionService(PrimitiveManagementService managementService) { this.managementService = checkNotNull(managementService); this.localMemberId = managementService.getMembershipService().getLocalMember().id(); }
public CrdtCounterDelegate(String name, CrdtProtocolConfig config, PrimitiveManagementService managementService) { this.localMemberId = managementService.getMembershipService().getLocalMember().id(); this.clusterCommunicator = managementService.getCommunicationService(); this.executorService = managementService.getExecutorService(); this.subject = String.format("atomix-crdt-counter-%s", name); clusterCommunicator.subscribe(subject, SERIALIZER::decode, this::updateCounters, executorService); broadcastFuture = executorService.scheduleAtFixedRate( this::broadcastCounters, config.getGossipInterval().toMillis(), config.getGossipInterval().toMillis(), TimeUnit.MILLISECONDS); }
@Override @SuppressWarnings("unchecked") public CompletableFuture<TransactionService> start() { PrimitiveProtocol protocol = managementService.getPartitionService().getSystemPartitionGroup().newProtocol(); return AtomicMapType.<TransactionId, TransactionInfo>instance() .newBuilder("atomix-transactions", new AtomicMapConfig(), managementService) .withSerializer(SERIALIZER) .withProtocol((ProxyProtocol) protocol) .withCacheEnabled() .buildAsync() .thenApply(transactions -> { this.transactions = transactions.async(); managementService.getMembershipService().addListener(clusterEventListener); LOGGER.info("Started"); started.set(true); return this; }); }
public AntiEntropyMapDelegate(String name, Serializer entrySerializer, AntiEntropyProtocolConfig config, PrimitiveManagementService managementService) { this.localMemberId = managementService.getMembershipService().getLocalMember().id(); this.mapName = name; this.entrySerializer = entrySerializer; this.membershipService = managementService.getMembershipService(); managementService.getMembershipService() .getMembers() .stream()