Search in sources :

Example 1 with Node

use of com.alipay.sofa.jraft.example.rheakv.Node in project sofa-jraft by sofastack.

the class BenchmarkServer method main.

public static void main(final String[] args) {
    if (args.length < 3) {
        LOG.error("[initialServerList], [configPath] are needed.");
    }
    final String initialServerList = args[1];
    final String configPath = args[2];
    final RheaKVStoreOptions opts = Yaml.readConfig(configPath);
    opts.setInitialServerList(initialServerList);
    final Node node = new Node(opts);
    node.start();
    // 
    ConsoleReporter.forRegistry(KVMetrics.metricRegistry()).build().start(30, TimeUnit.SECONDS);
    Runtime.getRuntime().addShutdownHook(new Thread(node::stop));
    LOG.info("BenchmarkServer start OK, options: {}", opts);
}
Also used : RheaKVStoreOptions(com.alipay.sofa.jraft.rhea.options.RheaKVStoreOptions) Node(com.alipay.sofa.jraft.example.rheakv.Node)

Aggregations

Node (com.alipay.sofa.jraft.example.rheakv.Node)1 RheaKVStoreOptions (com.alipay.sofa.jraft.rhea.options.RheaKVStoreOptions)1