Package com.linkedin.norbert.cluster.javaapi

Examples of com.linkedin.norbert.cluster.javaapi.Node


    config.setClusterClient(cc);
    NetworkClient nc = new NettyNetworkClient(config, new RoundRobinLoadBalancerFactory());
//    PartitionedNetworkClient<Integer> nc = new NettyPartitionedNetworkClient<Integer>(config, new IntegerConsistentHashPartitionedLoadBalancerFactory());
    nc.registerRequest(NorbertExampleProtos.Ping.getDefaultInstance(), NorbertExampleProtos.PingResponse.getDefaultInstance());

    Node node = cc.getNodeWithId(1);

    Future<Message> f = nc.sendMessageToNode(NorbertExampleProtos.Ping.newBuilder().setTimestamp(System.currentTimeMillis()).build(), node);
    try {
      NorbertExampleProtos.PingResponse response = (NorbertExampleProtos.PingResponse) f.get(750, TimeUnit.MILLISECONDS);
      System.out.println(String.format("Ping took %dms", System.currentTimeMillis() - response.getTimestamp()));
View Full Code Here

TOP

Related Classes of com.linkedin.norbert.cluster.javaapi.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.