Class MiniClusterJobClient
- java.lang.Object
-
- org.apache.flink.runtime.minicluster.MiniClusterJobClient
-
- All Implemented Interfaces:
org.apache.flink.core.execution.JobClient
,CoordinationRequestGateway
public final class MiniClusterJobClient extends Object implements org.apache.flink.core.execution.JobClient, CoordinationRequestGateway
AJobClient
for aMiniCluster
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MiniClusterJobClient.JobFinalizationBehavior
Determines the behavior of theMiniClusterJobClient
when the job finishes.
-
Constructor Summary
Constructors Constructor Description MiniClusterJobClient(org.apache.flink.api.common.JobID jobID, MiniCluster miniCluster, ClassLoader classLoader, MiniClusterJobClient.JobFinalizationBehavior finalizationBehaviour)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<Void>
cancel()
CompletableFuture<Map<String,Object>>
getAccumulators()
CompletableFuture<org.apache.flink.api.common.JobExecutionResult>
getJobExecutionResult()
org.apache.flink.api.common.JobID
getJobID()
CompletableFuture<org.apache.flink.api.common.JobStatus>
getJobStatus()
void
reportHeartbeat(long expiredTimestamp)
CompletableFuture<CoordinationResponse>
sendCoordinationRequest(String operatorUid, CoordinationRequest request)
Send out a request to a specified coordinator and return the response.CompletableFuture<String>
stopWithSavepoint(boolean terminate, String savepointDirectory, org.apache.flink.core.execution.SavepointFormatType formatType)
CompletableFuture<String>
triggerSavepoint(String savepointDirectory, org.apache.flink.core.execution.SavepointFormatType formatType)
-
-
-
Constructor Detail
-
MiniClusterJobClient
public MiniClusterJobClient(org.apache.flink.api.common.JobID jobID, MiniCluster miniCluster, ClassLoader classLoader, MiniClusterJobClient.JobFinalizationBehavior finalizationBehaviour)
Creates aMiniClusterJobClient
for the givenJobID
andMiniCluster
. This will shut down theMiniCluster
after job result retrieval ifshutdownCluster
istrue
.
-
-
Method Detail
-
getJobID
public org.apache.flink.api.common.JobID getJobID()
- Specified by:
getJobID
in interfaceorg.apache.flink.core.execution.JobClient
-
getJobStatus
public CompletableFuture<org.apache.flink.api.common.JobStatus> getJobStatus()
- Specified by:
getJobStatus
in interfaceorg.apache.flink.core.execution.JobClient
-
cancel
public CompletableFuture<Void> cancel()
- Specified by:
cancel
in interfaceorg.apache.flink.core.execution.JobClient
-
stopWithSavepoint
public CompletableFuture<String> stopWithSavepoint(boolean terminate, @Nullable String savepointDirectory, org.apache.flink.core.execution.SavepointFormatType formatType)
- Specified by:
stopWithSavepoint
in interfaceorg.apache.flink.core.execution.JobClient
-
triggerSavepoint
public CompletableFuture<String> triggerSavepoint(@Nullable String savepointDirectory, org.apache.flink.core.execution.SavepointFormatType formatType)
- Specified by:
triggerSavepoint
in interfaceorg.apache.flink.core.execution.JobClient
-
getAccumulators
public CompletableFuture<Map<String,Object>> getAccumulators()
- Specified by:
getAccumulators
in interfaceorg.apache.flink.core.execution.JobClient
-
getJobExecutionResult
public CompletableFuture<org.apache.flink.api.common.JobExecutionResult> getJobExecutionResult()
- Specified by:
getJobExecutionResult
in interfaceorg.apache.flink.core.execution.JobClient
-
sendCoordinationRequest
public CompletableFuture<CoordinationResponse> sendCoordinationRequest(String operatorUid, CoordinationRequest request)
Description copied from interface:CoordinationRequestGateway
Send out a request to a specified coordinator and return the response.On the client side, a unique operatorUid must be defined to identify an operator. Otherwise, the query cannot be executed correctly. Note that we use operatorUid instead of operatorID because the latter is an internal runtime concept that cannot be recognized by the client.
- Specified by:
sendCoordinationRequest
in interfaceCoordinationRequestGateway
- Parameters:
operatorUid
- specifies which coordinator to receive the requestrequest
- the request to send- Returns:
- the response from the coordinator
-
reportHeartbeat
public void reportHeartbeat(long expiredTimestamp)
- Specified by:
reportHeartbeat
in interfaceorg.apache.flink.core.execution.JobClient
-
-