public abstract class RestServerEndpoint extends Object implements RestService
| Modifier and Type | Class and Description |
|---|---|
static class |
RestServerEndpoint.RestHandlerUrlComparator
Comparator for Rest URLs.
|
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
log |
protected Map<String,String> |
responseHeaders |
protected Path |
uploadDir |
| Constructor and Description |
|---|
RestServerEndpoint(org.apache.flink.configuration.Configuration configuration) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
closeAsync() |
String |
getRestBaseUrl()
Returns the base URL of the REST server endpoint.
|
int |
getRestPort()
Port of the running rest service.
|
InetSocketAddress |
getServerAddress()
Returns the address on which this endpoint is accepting requests.
|
protected abstract List<org.apache.flink.api.java.tuple.Tuple2<RestHandlerSpecification,org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler>> |
initializeHandlers(CompletableFuture<String> localAddressFuture)
This method is called at the beginning of
start() to setup all handlers that the
REST server endpoint implementation requires. |
protected CompletableFuture<Void> |
shutDownInternal()
Stops this REST server endpoint.
|
void |
start()
Starts this REST server endpoint.
|
protected abstract void |
startInternal()
Hook to start sub class specific services.
|
protected final org.slf4j.Logger log
protected final Path uploadDir
public RestServerEndpoint(org.apache.flink.configuration.Configuration configuration)
throws IOException,
org.apache.flink.util.ConfigurationException
IOExceptionorg.apache.flink.util.ConfigurationExceptionprotected abstract List<org.apache.flink.api.java.tuple.Tuple2<RestHandlerSpecification,org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler>> initializeHandlers(CompletableFuture<String> localAddressFuture)
start() to setup all handlers that the
REST server endpoint implementation requires.localAddressFuture - future rest address of the RestServerEndpointpublic final void start()
throws Exception
Exception - if we cannot start the RestServerEndpointprotected abstract void startInternal()
throws Exception
Exception - if an error occurred@Nullable public InetSocketAddress getServerAddress()
public String getRestBaseUrl()
public int getRestPort()
RestServicegetRestPort in interface RestServicepublic CompletableFuture<Void> closeAsync()
closeAsync in interface org.apache.flink.util.AutoCloseableAsyncprotected CompletableFuture<Void> shutDownInternal()
Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.