org.apache.flink.runtime.rest.messages.taskmanager.TaskManagerMessageParameters Java Examples
The following examples show how to use
org.apache.flink.runtime.rest.messages.taskmanager.TaskManagerMessageParameters.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TaskManagerLogListHandler.java From flink with Apache License 2.0 | 6 votes |
@Override protected CompletableFuture<LogListInfo> handleRequest( @Nonnull HandlerRequest<EmptyRequestBody, TaskManagerMessageParameters> request, @Nonnull ResourceManagerGateway gateway) throws RestHandlerException { final ResourceID taskManagerId = request.getPathParameter(TaskManagerIdPathParameter.class); final ResourceManagerGateway resourceManagerGateway = getResourceManagerGateway(resourceManagerGatewayRetriever); final CompletableFuture<Collection<LogInfo>> logsWithLengthFuture = resourceManagerGateway.requestTaskManagerLogList(taskManagerId, timeout); return logsWithLengthFuture.thenApply(LogListInfo::new).exceptionally( (throwable) -> { final Throwable strippedThrowable = ExceptionUtils.stripCompletionException(throwable); if (strippedThrowable instanceof UnknownTaskExecutorException) { throw new CompletionException( new RestHandlerException( "Could not find TaskExecutor " + taskManagerId, HttpResponseStatus.NOT_FOUND, strippedThrowable )); } else { throw new CompletionException(throwable); } }); }
Example #2
Source File: TaskManagerDetailsHandler.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
public TaskManagerDetailsHandler( GatewayRetriever<? extends RestfulGateway> leaderRetriever, Time timeout, Map<String, String> responseHeaders, MessageHeaders<EmptyRequestBody, TaskManagerDetailsInfo, TaskManagerMessageParameters> messageHeaders, GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever, MetricFetcher metricFetcher) { super(leaderRetriever, timeout, responseHeaders, messageHeaders, resourceManagerGatewayRetriever); this.metricFetcher = Preconditions.checkNotNull(metricFetcher); this.metricStore = metricFetcher.getMetricStore(); }
Example #3
Source File: TaskManagerLogListHandlerTest.java From flink with Apache License 2.0 | 5 votes |
private static HandlerRequest<EmptyRequestBody, TaskManagerMessageParameters> createRequest(ResourceID taskManagerId) throws HandlerRequestException { Map<String, String> pathParameters = new HashMap<>(); pathParameters.put(TaskManagerIdPathParameter.KEY, taskManagerId.toString()); Map<String, List<String>> queryParameters = Collections.emptyMap(); return new HandlerRequest<>( EmptyRequestBody.getInstance(), new TaskManagerMessageParameters(), pathParameters, queryParameters); }
Example #4
Source File: TaskManagerLogFileHandler.java From flink with Apache License 2.0 | 5 votes |
public TaskManagerLogFileHandler( @Nonnull GatewayRetriever<? extends RestfulGateway> leaderRetriever, @Nonnull Time timeout, @Nonnull Map<String, String> responseHeaders, @Nonnull UntypedResponseMessageHeaders<EmptyRequestBody, TaskManagerMessageParameters> untypedResponseMessageHeaders, @Nonnull GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever, @Nonnull TransientBlobService transientBlobService, @Nonnull Time cacheEntryDuration) { super(leaderRetriever, timeout, responseHeaders, untypedResponseMessageHeaders, resourceManagerGatewayRetriever, transientBlobService, cacheEntryDuration); }
Example #5
Source File: TaskManagerDetailsHandler.java From flink with Apache License 2.0 | 5 votes |
public TaskManagerDetailsHandler( GatewayRetriever<? extends RestfulGateway> leaderRetriever, Time timeout, Map<String, String> responseHeaders, MessageHeaders<EmptyRequestBody, TaskManagerDetailsInfo, TaskManagerMessageParameters> messageHeaders, GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever, MetricFetcher metricFetcher) { super(leaderRetriever, timeout, responseHeaders, messageHeaders, resourceManagerGatewayRetriever); this.metricFetcher = Preconditions.checkNotNull(metricFetcher); this.metricStore = metricFetcher.getMetricStore(); }
Example #6
Source File: TaskManagerThreadDumpHandler.java From flink with Apache License 2.0 | 5 votes |
@Override protected CompletableFuture<ThreadDumpInfo> handleRequest( @Nonnull HandlerRequest<EmptyRequestBody, TaskManagerMessageParameters> request, @Nonnull ResourceManagerGateway gateway) throws RestHandlerException { final ResourceID taskManagerId = request.getPathParameter(TaskManagerIdPathParameter.class); return gateway.requestThreadDump(taskManagerId, timeout); }
Example #7
Source File: TaskManagerThreadDumpHandler.java From flink with Apache License 2.0 | 5 votes |
public TaskManagerThreadDumpHandler( GatewayRetriever<? extends RestfulGateway> leaderRetriever, Time timeout, Map<String, String> responseHeaders, MessageHeaders<EmptyRequestBody, ThreadDumpInfo, TaskManagerMessageParameters> messageHeaders, GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever) { super(leaderRetriever, timeout, responseHeaders, messageHeaders, resourceManagerGatewayRetriever); }
Example #8
Source File: TaskManagerLogListHandler.java From flink with Apache License 2.0 | 5 votes |
public TaskManagerLogListHandler( GatewayRetriever<? extends RestfulGateway> leaderRetriever, Time timeout, Map<String, String> responseHeaders, MessageHeaders<EmptyRequestBody, LogListInfo, TaskManagerMessageParameters> messageHeaders, GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever) { super(leaderRetriever, timeout, responseHeaders, messageHeaders, resourceManagerGatewayRetriever); this.resourceManagerGatewayRetriever = Preconditions.checkNotNull(resourceManagerGatewayRetriever); }
Example #9
Source File: TaskManagerStdoutFileHandler.java From flink with Apache License 2.0 | 5 votes |
public TaskManagerStdoutFileHandler( @Nonnull GatewayRetriever<? extends RestfulGateway> leaderRetriever, @Nonnull Time timeout, @Nonnull Map<String, String> responseHeaders, @Nonnull UntypedResponseMessageHeaders<EmptyRequestBody, TaskManagerMessageParameters> untypedResponseMessageHeaders, @Nonnull GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever, @Nonnull TransientBlobService transientBlobService, @Nonnull Time cacheEntryDuration) { super(leaderRetriever, timeout, responseHeaders, untypedResponseMessageHeaders, resourceManagerGatewayRetriever, transientBlobService, cacheEntryDuration); }
Example #10
Source File: AbstractTaskManagerFileHandlerTest.java From flink with Apache License 2.0 | 5 votes |
@BeforeClass public static void setup() throws IOException, HandlerRequestException { final Configuration configuration = new Configuration(); configuration.setString(BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath()); blobServer = new BlobServer(configuration, new VoidBlobStore()); handlerRequest = new HandlerRequest<>( EmptyRequestBody.getInstance(), new TaskManagerMessageParameters(), Collections.singletonMap(TaskManagerIdPathParameter.KEY, EXPECTED_TASK_MANAGER_ID.getResourceIdString()), Collections.emptyMap()); }
Example #11
Source File: TaskManagerLogFileHandler.java From flink with Apache License 2.0 | 5 votes |
public TaskManagerLogFileHandler( @Nonnull GatewayRetriever<? extends RestfulGateway> leaderRetriever, @Nonnull Time timeout, @Nonnull Map<String, String> responseHeaders, @Nonnull UntypedResponseMessageHeaders<EmptyRequestBody, TaskManagerMessageParameters> untypedResponseMessageHeaders, @Nonnull GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever, @Nonnull TransientBlobService transientBlobService, @Nonnull Time cacheEntryDuration) { super(leaderRetriever, timeout, responseHeaders, untypedResponseMessageHeaders, resourceManagerGatewayRetriever, transientBlobService, cacheEntryDuration); }
Example #12
Source File: TaskManagerDetailsHandler.java From flink with Apache License 2.0 | 5 votes |
public TaskManagerDetailsHandler( GatewayRetriever<? extends RestfulGateway> leaderRetriever, Time timeout, Map<String, String> responseHeaders, MessageHeaders<EmptyRequestBody, TaskManagerDetailsInfo, TaskManagerMessageParameters> messageHeaders, GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever, MetricFetcher metricFetcher) { super(leaderRetriever, timeout, responseHeaders, messageHeaders, resourceManagerGatewayRetriever); this.metricFetcher = Preconditions.checkNotNull(metricFetcher); this.metricStore = metricFetcher.getMetricStore(); }
Example #13
Source File: TaskManagerStdoutFileHandler.java From flink with Apache License 2.0 | 5 votes |
public TaskManagerStdoutFileHandler( @Nonnull GatewayRetriever<? extends RestfulGateway> leaderRetriever, @Nonnull Time timeout, @Nonnull Map<String, String> responseHeaders, @Nonnull UntypedResponseMessageHeaders<EmptyRequestBody, TaskManagerMessageParameters> untypedResponseMessageHeaders, @Nonnull GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever, @Nonnull TransientBlobService transientBlobService, @Nonnull Time cacheEntryDuration) { super(leaderRetriever, timeout, responseHeaders, untypedResponseMessageHeaders, resourceManagerGatewayRetriever, transientBlobService, cacheEntryDuration); }
Example #14
Source File: AbstractTaskManagerFileHandlerTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@BeforeClass public static void setup() throws IOException, HandlerRequestException { final Configuration configuration = new Configuration(); configuration.setString(BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath()); blobServer = new BlobServer(configuration, new VoidBlobStore()); handlerRequest = new HandlerRequest<>( EmptyRequestBody.getInstance(), new TaskManagerMessageParameters(), Collections.singletonMap(TaskManagerIdPathParameter.KEY, EXPECTED_TASK_MANAGER_ID.getResourceIdString()), Collections.emptyMap()); }
Example #15
Source File: TaskManagerLogFileHandler.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
public TaskManagerLogFileHandler( @Nonnull GatewayRetriever<? extends RestfulGateway> leaderRetriever, @Nonnull Time timeout, @Nonnull Map<String, String> responseHeaders, @Nonnull UntypedResponseMessageHeaders<EmptyRequestBody, TaskManagerMessageParameters> untypedResponseMessageHeaders, @Nonnull GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever, @Nonnull TransientBlobService transientBlobService, @Nonnull Time cacheEntryDuration) { super(leaderRetriever, timeout, responseHeaders, untypedResponseMessageHeaders, resourceManagerGatewayRetriever, transientBlobService, cacheEntryDuration); }
Example #16
Source File: TaskManagerStdoutFileHandler.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
public TaskManagerStdoutFileHandler( @Nonnull GatewayRetriever<? extends RestfulGateway> leaderRetriever, @Nonnull Time timeout, @Nonnull Map<String, String> responseHeaders, @Nonnull UntypedResponseMessageHeaders<EmptyRequestBody, TaskManagerMessageParameters> untypedResponseMessageHeaders, @Nonnull GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever, @Nonnull TransientBlobService transientBlobService, @Nonnull Time cacheEntryDuration) { super(leaderRetriever, timeout, responseHeaders, untypedResponseMessageHeaders, resourceManagerGatewayRetriever, transientBlobService, cacheEntryDuration); }
Example #17
Source File: TaskManagerDetailsHandler.java From flink with Apache License 2.0 | 4 votes |
@Override protected CompletableFuture<TaskManagerDetailsInfo> handleRequest( @Nonnull HandlerRequest<EmptyRequestBody, TaskManagerMessageParameters> request, @Nonnull ResourceManagerGateway gateway) throws RestHandlerException { final ResourceID taskManagerResourceId = request.getPathParameter(TaskManagerIdPathParameter .class); CompletableFuture<TaskManagerInfo> taskManagerInfoFuture = gateway.requestTaskManagerInfo(taskManagerResourceId, timeout); metricFetcher.update(); return taskManagerInfoFuture.thenApply( (TaskManagerInfo taskManagerInfo) -> { final MetricStore.TaskManagerMetricStore tmMetrics = metricStore.getTaskManagerMetricStore(taskManagerResourceId.getResourceIdString()); final TaskManagerMetricsInfo taskManagerMetricsInfo; if (tmMetrics != null) { log.debug("Create metrics info for TaskManager {}.", taskManagerResourceId); taskManagerMetricsInfo = createTaskManagerMetricsInfo(tmMetrics); } else { log.debug("No metrics for TaskManager {}.", taskManagerResourceId); taskManagerMetricsInfo = TaskManagerMetricsInfo.empty(); } return new TaskManagerDetailsInfo( taskManagerInfo, taskManagerMetricsInfo); }) .exceptionally( (Throwable throwable) -> { final Throwable strippedThrowable = ExceptionUtils.stripExecutionException(throwable); if (strippedThrowable instanceof UnknownTaskExecutorException) { throw new CompletionException( new RestHandlerException( "Could not find TaskExecutor " + taskManagerResourceId + '.', HttpResponseStatus.NOT_FOUND, strippedThrowable)); } else { throw new CompletionException(strippedThrowable); } } ); }
Example #18
Source File: AbstractTaskManagerFileHandlerTest.java From flink with Apache License 2.0 | 4 votes |
protected TestTaskManagerFileHandler(@Nonnull GatewayRetriever<? extends RestfulGateway> leaderRetriever, @Nonnull Time timeout, @Nonnull Map<String, String> responseHeaders, @Nonnull UntypedResponseMessageHeaders<EmptyRequestBody, TaskManagerMessageParameters> untypedResponseMessageHeaders, @Nonnull GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever, @Nonnull TransientBlobService transientBlobService, @Nonnull Time cacheEntryDuration, Queue<CompletableFuture<TransientBlobKey>> requestFileUploads, ResourceID expectedTaskManagerId) { super(leaderRetriever, timeout, responseHeaders, untypedResponseMessageHeaders, resourceManagerGatewayRetriever, transientBlobService, cacheEntryDuration); this.requestFileUploads = Preconditions.checkNotNull(requestFileUploads); this.expectedTaskManagerId = Preconditions.checkNotNull(expectedTaskManagerId); }
Example #19
Source File: AbstractTaskManagerFileHandlerTest.java From flink with Apache License 2.0 | 4 votes |
@Override public TaskManagerMessageParameters getUnresolvedMessageParameters() { return new TaskManagerMessageParameters(); }
Example #20
Source File: AbstractTaskManagerFileHandlerTest.java From Flink-CEPplus with Apache License 2.0 | 4 votes |
@Override public TaskManagerMessageParameters getUnresolvedMessageParameters() { return new TaskManagerMessageParameters(); }
Example #21
Source File: AbstractTaskManagerFileHandlerTest.java From Flink-CEPplus with Apache License 2.0 | 4 votes |
protected TestTaskManagerFileHandler(@Nonnull GatewayRetriever<? extends RestfulGateway> leaderRetriever, @Nonnull Time timeout, @Nonnull Map<String, String> responseHeaders, @Nonnull UntypedResponseMessageHeaders<EmptyRequestBody, TaskManagerMessageParameters> untypedResponseMessageHeaders, @Nonnull GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever, @Nonnull TransientBlobService transientBlobService, @Nonnull Time cacheEntryDuration, Queue<CompletableFuture<TransientBlobKey>> requestFileUploads, ResourceID expectedTaskManagerId) { super(leaderRetriever, timeout, responseHeaders, untypedResponseMessageHeaders, resourceManagerGatewayRetriever, transientBlobService, cacheEntryDuration); this.requestFileUploads = Preconditions.checkNotNull(requestFileUploads); this.expectedTaskManagerId = Preconditions.checkNotNull(expectedTaskManagerId); }
Example #22
Source File: TaskManagerDetailsHandler.java From flink with Apache License 2.0 | 4 votes |
@Override protected CompletableFuture<TaskManagerDetailsInfo> handleRequest( @Nonnull HandlerRequest<EmptyRequestBody, TaskManagerMessageParameters> request, @Nonnull ResourceManagerGateway gateway) throws RestHandlerException { final ResourceID taskManagerResourceId = request.getPathParameter(TaskManagerIdPathParameter .class); CompletableFuture<TaskManagerInfo> taskManagerInfoFuture = gateway.requestTaskManagerInfo(taskManagerResourceId, timeout); metricFetcher.update(); return taskManagerInfoFuture.thenApply( (TaskManagerInfo taskManagerInfo) -> { final MetricStore.TaskManagerMetricStore tmMetrics = metricStore.getTaskManagerMetricStore(taskManagerResourceId.getResourceIdString()); final TaskManagerMetricsInfo taskManagerMetricsInfo; if (tmMetrics != null) { log.debug("Create metrics info for TaskManager {}.", taskManagerResourceId); taskManagerMetricsInfo = createTaskManagerMetricsInfo(tmMetrics); } else { log.debug("No metrics for TaskManager {}.", taskManagerResourceId); taskManagerMetricsInfo = TaskManagerMetricsInfo.empty(); } return new TaskManagerDetailsInfo( taskManagerInfo, taskManagerMetricsInfo); }) .exceptionally( (Throwable throwable) -> { final Throwable strippedThrowable = ExceptionUtils.stripExecutionException(throwable); if (strippedThrowable instanceof UnknownTaskExecutorException) { throw new CompletionException( new RestHandlerException( "Could not find TaskExecutor " + taskManagerResourceId + '.', HttpResponseStatus.NOT_FOUND, strippedThrowable)); } else { throw new CompletionException(strippedThrowable); } } ); }
Example #23
Source File: TaskManagerDetailsHandler.java From Flink-CEPplus with Apache License 2.0 | 4 votes |
@Override protected CompletableFuture<TaskManagerDetailsInfo> handleRequest( @Nonnull HandlerRequest<EmptyRequestBody, TaskManagerMessageParameters> request, @Nonnull ResourceManagerGateway gateway) throws RestHandlerException { final ResourceID taskManagerResourceId = request.getPathParameter(TaskManagerIdPathParameter .class); CompletableFuture<TaskManagerInfo> taskManagerInfoFuture = gateway.requestTaskManagerInfo(taskManagerResourceId, timeout); metricFetcher.update(); return taskManagerInfoFuture.thenApply( (TaskManagerInfo taskManagerInfo) -> { final MetricStore.TaskManagerMetricStore tmMetrics = metricStore.getTaskManagerMetricStore(taskManagerResourceId.getResourceIdString()); final TaskManagerMetricsInfo taskManagerMetricsInfo; if (tmMetrics != null) { log.debug("Create metrics info for TaskManager {}.", taskManagerResourceId); taskManagerMetricsInfo = createTaskManagerMetricsInfo(tmMetrics); } else { log.debug("No metrics for TaskManager {}.", taskManagerResourceId); taskManagerMetricsInfo = TaskManagerMetricsInfo.empty(); } return new TaskManagerDetailsInfo( taskManagerInfo, taskManagerMetricsInfo); }) .exceptionally( (Throwable throwable) -> { final Throwable strippedThrowable = ExceptionUtils.stripExecutionException(throwable); if (strippedThrowable instanceof UnknownTaskExecutorException) { throw new CompletionException( new RestHandlerException( "Could not find TaskExecutor " + taskManagerResourceId + '.', HttpResponseStatus.NOT_FOUND, strippedThrowable)); } else { throw new CompletionException(strippedThrowable); } } ); }
Example #24
Source File: AbstractTaskManagerFileHandlerTest.java From flink with Apache License 2.0 | 4 votes |
protected TestTaskManagerFileHandler(@Nonnull GatewayRetriever<? extends RestfulGateway> leaderRetriever, @Nonnull Time timeout, @Nonnull Map<String, String> responseHeaders, @Nonnull UntypedResponseMessageHeaders<EmptyRequestBody, TaskManagerMessageParameters> untypedResponseMessageHeaders, @Nonnull GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever, @Nonnull TransientBlobService transientBlobService, @Nonnull Time cacheEntryDuration, Queue<CompletableFuture<TransientBlobKey>> requestFileUploads, ResourceID expectedTaskManagerId) { super(leaderRetriever, timeout, responseHeaders, untypedResponseMessageHeaders, resourceManagerGatewayRetriever, transientBlobService, cacheEntryDuration); this.requestFileUploads = Preconditions.checkNotNull(requestFileUploads); this.expectedTaskManagerId = Preconditions.checkNotNull(expectedTaskManagerId); }
Example #25
Source File: AbstractTaskManagerFileHandlerTest.java From flink with Apache License 2.0 | 4 votes |
@Override public TaskManagerMessageParameters getUnresolvedMessageParameters() { return new TaskManagerMessageParameters(); }