Package org.apache.flink.runtime.rest
Class RestClient
java.lang.Object
org.apache.flink.runtime.rest.RestClient
- All Implemented Interfaces:
AutoCloseable,org.apache.flink.util.AutoCloseableAsync
This client is the counter-part to the
RestServerEndpoint.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRestClient(org.apache.flink.configuration.Configuration configuration, Executor executor) RestClient(org.apache.flink.configuration.Configuration configuration, Executor executor, String host, int port) -
Method Summary
Modifier and TypeMethodDescriptionstatic RestClientCreates a new RestClient for the provided root URL.<M extends MessageHeaders<EmptyRequestBody,P, EmptyMessageParameters>, P extends ResponseBody>
CompletableFuture<P>sendRequest(String targetAddress, int targetPort, M messageHeaders) <M extends MessageHeaders<R,P, U>, U extends MessageParameters, R extends RequestBody, P extends ResponseBody>
CompletableFuture<P>sendRequest(String targetAddress, int targetPort, M messageHeaders, U messageParameters, R request) <M extends MessageHeaders<R,P, U>, U extends MessageParameters, R extends RequestBody, P extends ResponseBody>
CompletableFuture<P>sendRequest(String targetAddress, int targetPort, M messageHeaders, U messageParameters, R request, Collection<FileUpload> fileUploads) <M extends MessageHeaders<R,P, U>, U extends MessageParameters, R extends RequestBody, P extends ResponseBody>
CompletableFuture<P>sendRequest(String targetAddress, int targetPort, M messageHeaders, U messageParameters, R request, Collection<FileUpload> fileUploads, RestAPIVersion<? extends RestAPIVersion<?>> apiVersion) voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.util.AutoCloseableAsync
close
-
Field Details
-
VERSION_PLACEHOLDER
- See Also:
-
-
Constructor Details
-
RestClient
public RestClient(org.apache.flink.configuration.Configuration configuration, Executor executor) throws org.apache.flink.util.ConfigurationException - Throws:
org.apache.flink.util.ConfigurationException
-
RestClient
public RestClient(org.apache.flink.configuration.Configuration configuration, Executor executor, String host, int port) throws org.apache.flink.util.ConfigurationException - Throws:
org.apache.flink.util.ConfigurationException
-
-
Method Details
-
forUrl
public static RestClient forUrl(org.apache.flink.configuration.Configuration configuration, Executor executor, URL rootUrl) throws org.apache.flink.util.ConfigurationException Creates a new RestClient for the provided root URL. If the protocol of the URL is "https", then SSL is automatically enabled for the REST client.- Throws:
org.apache.flink.util.ConfigurationException
-
closeAsync
- Specified by:
closeAsyncin interfaceorg.apache.flink.util.AutoCloseableAsync
-
shutdown
-
sendRequest
public <M extends MessageHeaders<EmptyRequestBody,P, CompletableFuture<P> sendRequestEmptyMessageParameters>, P extends ResponseBody> (String targetAddress, int targetPort, M messageHeaders) throws IOException - Throws:
IOException
-
sendRequest
public <M extends MessageHeaders<R,P, CompletableFuture<P> sendRequestU>, U extends MessageParameters, R extends RequestBody, P extends ResponseBody> (String targetAddress, int targetPort, M messageHeaders, U messageParameters, R request) throws IOException - Throws:
IOException
-
sendRequest
public <M extends MessageHeaders<R,P, CompletableFuture<P> sendRequestU>, U extends MessageParameters, R extends RequestBody, P extends ResponseBody> (String targetAddress, int targetPort, M messageHeaders, U messageParameters, R request, Collection<FileUpload> fileUploads) throws IOException - Throws:
IOException
-
sendRequest
public <M extends MessageHeaders<R,P, CompletableFuture<P> sendRequestU>, U extends MessageParameters, R extends RequestBody, P extends ResponseBody> (String targetAddress, int targetPort, M messageHeaders, U messageParameters, R request, Collection<FileUpload> fileUploads, RestAPIVersion<? extends RestAPIVersion<?>> apiVersion) throws IOException - Throws:
IOException
-