public class AgentRpcServer extends Object implements AutoCloseable
GrpcServer
that utilizes the Hub Agent configuration.
It will generate and utilize a self-signed certificate to encrypt the traffic between itself
and clients. This requires all clients connecting to this server use an insecure client that
trusts self-signed certificates. Its slightly better than plaintext, but still insecure as it
can easily be MITMed.
In the future, we may allow configuring certificates properly.
The server starts serving after object creation. To stop the server call the close()
method.Constructor and Description |
---|
AgentRpcServer(AlluxioConfiguration conf,
AgentProcessContext ctx)
Creates and starts a new
GrpcServer . |
Modifier and Type | Method and Description |
---|---|
void |
awaitTermination()
Blocks until the server is terminated.
|
void |
close() |
static InetSocketAddress |
getConfiguredAddress(AlluxioConfiguration conf) |
int |
getPort() |
boolean |
isServing() |
public AgentRpcServer(AlluxioConfiguration conf, AgentProcessContext ctx) throws IOException
GrpcServer
.conf
- alluxio configurationctx
- the context used to instantiate the rpc servicesIOException
- if the server fails to startpublic static InetSocketAddress getConfiguredAddress(AlluxioConfiguration conf)
conf
- alluxio configurationpublic int getPort()
public boolean isServing()
public void awaitTermination()
public void close()
close
in interface AutoCloseable
Copyright © 2023. All Rights Reserved.