congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
RaftClient$Builder.withMemberId
Code IndexAdd Tabnine to your IDE (free)

How to use
withMemberId
method
in
io.atomix.protocols.raft.RaftClient$Builder

Best Java code snippets using io.atomix.protocols.raft.RaftClient$Builder.withMemberId (Showing top 4 results out of 315)

origin: atomix/atomix

/**
 * Creates a Raft client.
 */
private RaftClient createClient() throws Exception {
 MemberId memberId = nextNodeId();
 RaftClientProtocol protocol;
 if (USE_NETTY) {
  Address address = Address.from(++port);
  MessagingService messagingManager = new NettyMessagingService("test", address, new MessagingConfig()).start().join();
  addressMap.put(memberId, address);
  protocol = new RaftClientMessagingProtocol(messagingManager, PROTOCOL_SERIALIZER, addressMap::get);
 } else {
  protocol = protocolFactory.newClientProtocol(memberId);
 }
 RaftClient client = RaftClient.builder()
   .withMemberId(memberId)
   .withProtocol(protocol)
   .build();
 client.connect(members.stream().map(RaftMember::memberId).collect(Collectors.toList())).join();
 clients.add(client);
 return client;
}
origin: apache/zeppelin

 @Override
 public void run() {
  LOGGER.info("RaftClientThread run() >>>");
  int raftClientPort = 0;
  try {
   raftClientPort = RemoteInterpreterUtils.findRandomAvailablePortOnAllLocalInterfaces();
  } catch (IOException e) {
   LOGGER.error(e.getMessage());
  }
  MemberId memberId = MemberId.from(ZEPL_CLIENT_ID + zeplServerHost + ":" + raftClientPort);
  Address address = Address.from(zeplServerHost, raftClientPort);
  raftAddressMap.put(memberId, address);
  MessagingService messagingManager
    = NettyMessagingService.builder().withAddress(address).build().start().join();
  RaftClientProtocol protocol = new RaftClientMessagingProtocol(
    messagingManager, protocolSerializer, raftAddressMap::get);
  raftClient = RaftClient.builder()
    .withMemberId(memberId)
    .withPartitionId(PartitionId.from("partition", 1))
    .withProtocol(protocol)
    .build();
  raftClient.connect(clusterMemberIds).join();
  raftSessionClient = createProxy(raftClient);
  LOGGER.info("RaftClientThread run() <<<");
 }
}).start();
origin: atomix/atomix

/**
 * Creates a Raft client.
 */
private RaftClient createClient() throws Exception {
 Member member = nextNode();
 RaftClientProtocol protocol;
 if (USE_NETTY) {
  MessagingService messagingService = new NettyMessagingService("test", member.address(), new MessagingConfig()).start().join();
  protocol = new RaftClientMessagingProtocol(messagingService, PROTOCOL_SERIALIZER, addressMap::get);
 } else {
  protocol = protocolFactory.newClientProtocol(member.id());
 }
 RaftClient client = RaftClient.builder()
   .withMemberId(member.id())
   .withPartitionId(PartitionId.from("test", 1))
   .withProtocol(protocol)
   .withThreadModel(ThreadModel.SHARED_THREAD_POOL)
   .build();
 client.connect(members.stream().map(Member::id).collect(Collectors.toList())).join();
 clients.add(client);
 return client;
}
origin: atomix/atomix

 private RaftClient newRaftClient(RaftClientProtocol protocol) {
  return RaftClient.builder()
    .withClientId(partition.name())
    .withPartitionId(partition.id())
    .withMemberId(localMemberId)
    .withProtocol(protocol)
    .withThreadContextFactory(threadContextFactory)
    .build();
 }
}
io.atomix.protocols.raftRaftClient$BuilderwithMemberId

Javadoc

Sets the local node identifier.

Popular methods of RaftClient$Builder

  • build
  • withPartitionId
    Sets the partition identifier.
  • withProtocol
    Sets the client protocol.
  • withClientId
    Sets the client ID. The client ID is a name that should be unique among all clients. The ID will be
  • withThreadContextFactory
    Sets the client thread context factory.
  • withThreadModel
    Sets the client thread model.

Popular in Java

  • Start an intent from android
  • setScale (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • putExtra (Intent)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • JComboBox (javax.swing)
  • Join (org.hibernate.mapping)
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now