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
}
}
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();
}
}
Aggregations