public final class JRaftUtils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
bootstrap(BootstrapOptions opts)
Bootstrap a non-empty raft node.
|
static Executor |
createExecutor(String prefix,
int number)
Create a executor with size.
|
static ThreadFactory |
createThreadFactory(String prefixName)
Create a thread factory.
|
static Configuration |
getConfiguration(String s)
Create a configuration from a string in the form of "host1:port1[:idx],host2:port2[:idx]
|
static Endpoint |
getEndPoint(String s)
Create a Endpoint instance from a string in the form of "host:port",
returns null when string is blank.
|
static PeerId |
getPeerId(String s)
Create a peer from a string in the form of "host:port[:idx]",
returns a empty peer when string is blank.
|
static RaftTimerFactory |
raftTimerFactory()
Get raft timer factory.
|
public static RaftTimerFactory raftTimerFactory()
RaftTimerFactorypublic static boolean bootstrap(BootstrapOptions opts) throws InterruptedException
opts - options of bootstrapInterruptedExceptionpublic static Executor createExecutor(String prefix, int number)
prefix - thread name prefixnumber - thread numberThreadPoolExecutor instancepublic static ThreadFactory createThreadFactory(String prefixName)
prefixName - the prefix name of threadThreadFactory instancepublic static Configuration getConfiguration(String s)
public static PeerId getPeerId(String s)
Copyright © 2021. All rights reserved.