Search in sources :

Example 1 with RejectingServer

use of alluxio.network.RejectingServer in project alluxio by Alluxio.

the class PollingMasterInquireClientTest method pollRejectingDoesntHang.

@Test(timeout = 10000)
public void pollRejectingDoesntHang() throws Exception {
    int port = mPort.getPort();
    InetSocketAddress serverAddress = new InetSocketAddress("127.0.0.1", port);
    RejectingServer s = new RejectingServer(serverAddress);
    s.start();
    List<InetSocketAddress> addrs = Arrays.asList(InetSocketAddress.createUnresolved(NetworkAddressUtils.getLocalHostName(Constants.SECOND_MS), port));
    PollingMasterInquireClient client = new PollingMasterInquireClient(addrs, () -> new CountingRetry(0), new ConfigurationBuilder().build());
    try {
        client.getPrimaryRpcAddress();
        fail("Expected polling to fail");
    } catch (UnavailableException e) {
    // Expected
    }
}
Also used : ConfigurationBuilder(alluxio.conf.ConfigurationBuilder) CountingRetry(alluxio.retry.CountingRetry) RejectingServer(alluxio.network.RejectingServer) InetSocketAddress(java.net.InetSocketAddress) UnavailableException(alluxio.exception.status.UnavailableException) Test(org.junit.Test)

Example 2 with RejectingServer

use of alluxio.network.RejectingServer in project alluxio by Alluxio.

the class MasterProcess method startRejectingServers.

protected void startRejectingServers() {
    if (mRejectingRpcServer == null) {
        mRejectingRpcServer = new RejectingServer(mRpcBindAddress);
        mRejectingRpcServer.start();
    }
    if (!isWebServing() && mRejectingWebServer == null) {
        mRejectingWebServer = new RejectingServer(mWebBindAddress);
        mRejectingWebServer.start();
    }
}
Also used : RejectingServer(alluxio.network.RejectingServer)

Aggregations

RejectingServer (alluxio.network.RejectingServer)2 ConfigurationBuilder (alluxio.conf.ConfigurationBuilder)1 UnavailableException (alluxio.exception.status.UnavailableException)1 CountingRetry (alluxio.retry.CountingRetry)1 InetSocketAddress (java.net.InetSocketAddress)1 Test (org.junit.Test)1