Examples of RpcServer


Examples of com.alibaba.rocketmq.research.rpc.RPCServer

            // args
            int listenPort = args.length > 0 ? Integer.valueOf(args[0]) : 2012;
            int threadCnt = args.length > 1 ? Integer.valueOf(args[1]) : 256;

            RPCServer rpcServer = new DefaultRPCServer(listenPort, threadCnt, threadCnt);
            ServerRPCProcessor serverRPCProcessor = new ServerRPCProcessor();
            rpcServer.registerProcessor(serverRPCProcessor);
            rpcServer.start();
        }
        catch (IOException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

Examples of com.chenshuo.muduo.protorpc.RpcServer

import com.google.protobuf.RpcController;

public class EchoServer {

    public static void main(String[] args) {
        RpcServer server = new RpcServer();
        server.registerService(EchoProto.EchoService.newReflectiveService(new Interface() {
            @Override
            public void echo(RpcController controller, EchoRequest request, RpcCallback<EchoResponse> done) {
                done.run(EchoResponse.newBuilder().setPayload(request.getPayload()).build());
            }
        }));
        server.start(8888);
    }
View Full Code Here

Examples of com.chenshuo.muduo.protorpc.RpcServer

import com.chenshuo.muduo.protorpc.sudoku.SudokuProto;

public class Server {

    public static void main(String[] args) {
        RpcServer server = new RpcServer();
        server.registerService(SudokuProto.SudokuService.newReflectiveService(new SudokuImpl()));
        server.setNewChannelCallback(new NewChannelCallback() {

            @Override
            public void run(RpcChannel channel) {
                // TODO call client

            }
        });
        server.start(9981);
    }
View Full Code Here

Examples of muduo.rpc.RpcServer

import muduo.rpc.RpcServer;

public class Server {

    public static void main(String[] args) {
        RpcServer server = new RpcServer();
        server.registerService(Sudoku.SudokuService.newReflectiveService(new SudokuImpl()));
        server.setNewChannelCallback(new NewChannelCallback() {

            @Override
            public void run(RpcChannel channel) {
                // TODO call client

            }
        });
        server.start(9981);
    }
View Full Code Here

Examples of muduo.rpc.RpcServer

import muduo.rpc.RpcServer;

public class EchoServer {

    public static void main(String[] args) {
        RpcServer server = new RpcServer();
        server.registerService(EchoProto.EchoService.newReflectiveService(new Interface() {
            @Override
            public void echo(RpcController controller, EchoRequest request, RpcCallback<EchoResponse> done) {
                done.run(EchoResponse.newBuilder().setPayload(request.getPayload()).build());
            }
        }));
        server.start(8888);
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.ipc.RpcServer

      BlockingService service =
        AuthenticationProtos.AuthenticationService.newReflectiveBlockingService(this);
      sai.add(new BlockingServiceAndInterface(service,
        AuthenticationProtos.AuthenticationService.BlockingInterface.class));
      this.rpcServer =
        new RpcServer(this, "tokenServer", sai, initialIsa, 3, 1, conf, HConstants.QOS_THRESHOLD);
      this.isa = this.rpcServer.getListenerAddress();
      this.sleeper = new Sleeper(1000, this);
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.ipc.RpcServer

    }
    this.rand = new Random(initialIsa.hashCode());
    String name = "regionserver/" + initialIsa.toString();
    // Set how many times to retry talking to another server over HConnection.
    HConnectionManager.setServerSideHConnectionRetries(this.conf, name, LOG);
    this.rpcServer = new RpcServer(this, name, getServices(),
      /*HBaseRPCErrorHandler.class, OnlineRegions.class},*/
      initialIsa, // BindAddress is IP we got for this server.
      conf.getInt("hbase.regionserver.handler.count", 10),
      conf.getInt("hbase.regionserver.metahandler.count", 10),
      conf, HConstants.QOS_THRESHOLD);
View Full Code Here

Examples of org.apache.hadoop.hbase.ipc.RpcServer

    String name = "master/" + initialIsa.toString();
    // Set how many times to retry talking to another server over HConnection.
    HConnectionManager.setServerSideHConnectionRetries(this.conf, name, LOG);
    int numHandlers = conf.getInt("hbase.master.handler.count",
      conf.getInt("hbase.regionserver.handler.count", 25));
    this.rpcServer = new RpcServer(this, name, getServices(),
      initialIsa, // BindAddress is IP we got for this server.
      numHandlers,
      0, // we dont use high priority handlers in master
      conf,
      0); // this is a DNC w/o high priority handlers
View Full Code Here

Examples of org.apache.hadoop.hbase.ipc.RpcServer

    } catch (InstantiationException e) {
      throw new IllegalArgumentException(e);
    } catch (IllegalAccessException e) {
      throw new IllegalArgumentException(e);
    }
    this.rpcServer = new RpcServer(this, name, getServices(),
      /*HBaseRPCErrorHandler.class, OnlineRegions.class},*/
      initialIsa, // BindAddress is IP we got for this server.
      conf,
      rpcSchedulerFactory.create(conf, this));

View Full Code Here

Examples of org.apache.hadoop.hbase.ipc.RpcServer

    String name = "master/" + initialIsa.toString();
    // Set how many times to retry talking to another server over HConnection.
    HConnectionManager.setServerSideHConnectionRetries(this.conf, name, LOG);
    int numHandlers = conf.getInt(HConstants.MASTER_HANDLER_COUNT,
      conf.getInt(HConstants.REGION_SERVER_HANDLER_COUNT, HConstants.DEFAULT_MASTER_HANLDER_COUNT));
    this.rpcServer = new RpcServer(this, name, getServices(),
      initialIsa, // BindAddress is IP we got for this server.
      conf,
      new FifoRpcScheduler(conf, numHandlers));
    // Set our address.
    this.isa = this.rpcServer.getListenerAddress();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.