Search in sources :

Example 1 with RpcServer

use of com.yahoo.vespa.clustercontroller.core.rpc.RpcServer in project vespa by vespa-engine.

the class FleetController method createForStandAlone.

public static FleetController createForStandAlone(FleetControllerOptions options) throws Exception {
    Timer timer = new RealTimer();
    RpcServer rpcServer = new RpcServer(timer, timer, options.clusterName, options.fleetControllerIndex, options.slobrokBackOffPolicy);
    StatusPageServer statusPageServer = new StatusPageServer(timer, timer, options.httpPort);
    return create(options, timer, statusPageServer, rpcServer, new NoMetricReporter());
}
Also used : RpcServer(com.yahoo.vespa.clustercontroller.core.rpc.RpcServer) StatusPageServer(com.yahoo.vespa.clustercontroller.core.status.statuspage.StatusPageServer) NoMetricReporter(com.yahoo.vespa.clustercontroller.utils.util.NoMetricReporter)

Example 2 with RpcServer

use of com.yahoo.vespa.clustercontroller.core.rpc.RpcServer in project vespa by vespa-engine.

the class RpcServerTest method testRebinding.

@Test
public void testRebinding() throws Exception {
    startingTest("RpcServerTest::testRebinding");
    Slobrok slobrok = new Slobrok();
    String[] slobrokConnectionSpecs = new String[1];
    slobrokConnectionSpecs[0] = "tcp/localhost:" + slobrok.port();
    RpcServer server = new RpcServer(timer, new Object(), "mycluster", 0, new BackOff());
    server.setSlobrokConnectionSpecs(slobrokConnectionSpecs, 0);
    int portUsed = server.getPort();
    server.setSlobrokConnectionSpecs(slobrokConnectionSpecs, portUsed);
    server.disconnect();
    server.disconnect();
    server.connect();
    server.connect();
    server.disconnect();
    server.connect();
    server.shutdown();
    slobrok.stop();
}
Also used : RpcServer(com.yahoo.vespa.clustercontroller.core.rpc.RpcServer) Slobrok(com.yahoo.jrt.slobrok.server.Slobrok) Test(org.junit.Test)

Example 3 with RpcServer

use of com.yahoo.vespa.clustercontroller.core.rpc.RpcServer in project vespa by vespa-engine.

the class FleetControllerTest method createFleetController.

protected FleetController createFleetController(boolean useFakeTimer, FleetControllerOptions options, boolean startThread, StatusPageServerInterface status) throws Exception {
    Timer timer = useFakeTimer ? this.timer : new RealTimer();
    MetricUpdater metricUpdater = new MetricUpdater(new NoMetricReporter(), options.fleetControllerIndex);
    EventLog log = new EventLog(timer, metricUpdater);
    ContentCluster cluster = new ContentCluster(options.clusterName, options.nodes, options.storageDistribution, options.minStorageNodesUp, options.minRatioOfStorageNodesUp);
    NodeStateGatherer stateGatherer = new NodeStateGatherer(timer, timer, log);
    Communicator communicator = new RPCCommunicator(RPCCommunicator.createRealSupervisor(), timer, options.fleetControllerIndex, options.nodeStateRequestTimeoutMS, options.nodeStateRequestTimeoutEarliestPercentage, options.nodeStateRequestTimeoutLatestPercentage, options.nodeStateRequestRoundTripTimeMaxSeconds);
    SlobrokClient lookUp = new SlobrokClient(timer);
    lookUp.setSlobrokConnectionSpecs(new String[0]);
    if (status == null) {
        status = new StatusPageServer(timer, timer, options.httpPort);
    }
    RpcServer rpcServer = new RpcServer(timer, timer, options.clusterName, options.fleetControllerIndex, options.slobrokBackOffPolicy);
    DatabaseHandler database = new DatabaseHandler(timer, options.zooKeeperServerAddress, options.fleetControllerIndex, timer);
    StateChangeHandler stateGenerator = new StateChangeHandler(timer, log, metricUpdater);
    SystemStateBroadcaster stateBroadcaster = new SystemStateBroadcaster(timer, timer);
    MasterElectionHandler masterElectionHandler = new MasterElectionHandler(options.fleetControllerIndex, options.fleetControllerCount, timer, timer);
    FleetController controller = new FleetController(timer, log, cluster, stateGatherer, communicator, status, rpcServer, lookUp, database, stateGenerator, stateBroadcaster, masterElectionHandler, metricUpdater, options);
    if (startThread) {
        controller.start();
    }
    return controller;
}
Also used : RPCCommunicator(com.yahoo.vespa.clustercontroller.core.rpc.RPCCommunicator) StatusPageServer(com.yahoo.vespa.clustercontroller.core.status.statuspage.StatusPageServer) RPCCommunicator(com.yahoo.vespa.clustercontroller.core.rpc.RPCCommunicator) SlobrokClient(com.yahoo.vespa.clustercontroller.core.rpc.SlobrokClient) DatabaseHandler(com.yahoo.vespa.clustercontroller.core.database.DatabaseHandler) RpcServer(com.yahoo.vespa.clustercontroller.core.rpc.RpcServer) NoMetricReporter(com.yahoo.vespa.clustercontroller.utils.util.NoMetricReporter)

Aggregations

RpcServer (com.yahoo.vespa.clustercontroller.core.rpc.RpcServer)3 StatusPageServer (com.yahoo.vespa.clustercontroller.core.status.statuspage.StatusPageServer)2 NoMetricReporter (com.yahoo.vespa.clustercontroller.utils.util.NoMetricReporter)2 Slobrok (com.yahoo.jrt.slobrok.server.Slobrok)1 DatabaseHandler (com.yahoo.vespa.clustercontroller.core.database.DatabaseHandler)1 RPCCommunicator (com.yahoo.vespa.clustercontroller.core.rpc.RPCCommunicator)1 SlobrokClient (com.yahoo.vespa.clustercontroller.core.rpc.SlobrokClient)1 Test (org.junit.Test)1