org.apache.flink.runtime.taskexecutor.FileType Java Examples

The following examples show how to use org.apache.flink.runtime.taskexecutor.FileType. 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: ResourceManager.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public CompletableFuture<TransientBlobKey> requestTaskManagerFileUpload(ResourceID taskManagerId, FileType fileType, Time timeout) {
	log.debug("Request file {} upload from TaskExecutor {}.", fileType, taskManagerId);

	final WorkerRegistration<WorkerType> taskExecutor = taskExecutors.get(taskManagerId);

	if (taskExecutor == null) {
		log.debug("Requested file {} upload from unregistered TaskExecutor {}.", fileType, taskManagerId);
		return FutureUtils.completedExceptionally(new UnknownTaskExecutorException(taskManagerId));
	} else {
		return taskExecutor.getTaskExecutorGateway().requestFileUpload(fileType, timeout);
	}
}
 
Example #2
Source File: TestingResourceManagerGateway.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public CompletableFuture<TransientBlobKey> requestTaskManagerFileUploadByType(ResourceID taskManagerId, FileType fileType, Time timeout) {
	final Function<Tuple2<ResourceID, FileType>, CompletableFuture<TransientBlobKey>> function = requestTaskManagerFileUploadByTypeFunction;

	if (function != null) {
		return function.apply(Tuple2.of(taskManagerId, fileType));
	} else {
		return CompletableFuture.completedFuture(new TransientBlobKey());
	}
}
 
Example #3
Source File: ResourceManager.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public CompletableFuture<TransientBlobKey> requestTaskManagerFileUploadByType(ResourceID taskManagerId, FileType fileType, Time timeout) {
	log.debug("Request {} file upload from TaskExecutor {}.", fileType, taskManagerId);

	final WorkerRegistration<WorkerType> taskExecutor = taskExecutors.get(taskManagerId);

	if (taskExecutor == null) {
		log.debug("Request upload of file {} from unregistered TaskExecutor {}.", fileType, taskManagerId);
		return FutureUtils.completedExceptionally(new UnknownTaskExecutorException(taskManagerId));
	} else {
		return taskExecutor.getTaskExecutorGateway().requestFileUploadByType(fileType, timeout);
	}
}
 
Example #4
Source File: TestingResourceManagerGateway.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public CompletableFuture<TransientBlobKey> requestTaskManagerFileUpload(ResourceID taskManagerId, FileType fileType, Time timeout) {
	final Function<Tuple2<ResourceID, FileType>, CompletableFuture<TransientBlobKey>> function = requestTaskManagerFileUploadFunction;

	if (function != null) {
		return function.apply(Tuple2.of(taskManagerId, fileType));
	} else {
		return CompletableFuture.completedFuture(new TransientBlobKey());
	}
}
 
Example #5
Source File: ResourceManager.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public CompletableFuture<TransientBlobKey> requestTaskManagerFileUpload(ResourceID taskManagerId, FileType fileType, Time timeout) {
	log.debug("Request file {} upload from TaskExecutor {}.", fileType, taskManagerId);

	final WorkerRegistration<WorkerType> taskExecutor = taskExecutors.get(taskManagerId);

	if (taskExecutor == null) {
		log.debug("Requested file {} upload from unregistered TaskExecutor {}.", fileType, taskManagerId);
		return FutureUtils.completedExceptionally(new UnknownTaskExecutorException(taskManagerId));
	} else {
		return taskExecutor.getTaskExecutorGateway().requestFileUpload(fileType, timeout);
	}
}
 
Example #6
Source File: TestingResourceManagerGateway.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public CompletableFuture<TransientBlobKey> requestTaskManagerFileUpload(ResourceID taskManagerId, FileType fileType, Time timeout) {
	final Function<Tuple2<ResourceID, FileType>, CompletableFuture<TransientBlobKey>> function = requestTaskManagerFileUploadFunction;

	if (function != null) {
		return function.apply(Tuple2.of(taskManagerId, fileType));
	} else {
		return CompletableFuture.completedFuture(new TransientBlobKey());
	}
}
 
Example #7
Source File: TestingResourceManagerGateway.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
public void setRequestTaskManagerFileUploadFunction(Function<Tuple2<ResourceID, FileType>, CompletableFuture<TransientBlobKey>> requestTaskManagerFileUploadFunction) {
	this.requestTaskManagerFileUploadFunction = requestTaskManagerFileUploadFunction;
}
 
Example #8
Source File: TaskManagerStdoutFileHandler.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected CompletableFuture<TransientBlobKey> requestFileUpload(ResourceManagerGateway resourceManagerGateway, ResourceID taskManagerResourceId) {
	return resourceManagerGateway.requestTaskManagerFileUpload(taskManagerResourceId, FileType.STDOUT, timeout);
}
 
Example #9
Source File: TaskManagerLogFileHandler.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected CompletableFuture<TransientBlobKey> requestFileUpload(ResourceManagerGateway resourceManagerGateway, ResourceID taskManagerResourceId) {
	return resourceManagerGateway.requestTaskManagerFileUpload(taskManagerResourceId, FileType.LOG, timeout);
}
 
Example #10
Source File: TestingResourceManagerGateway.java    From flink with Apache License 2.0 4 votes vote down vote up
public void setRequestTaskManagerFileUploadFunction(Function<Tuple2<ResourceID, FileType>, CompletableFuture<TransientBlobKey>> requestTaskManagerFileUploadFunction) {
	this.requestTaskManagerFileUploadFunction = requestTaskManagerFileUploadFunction;
}
 
Example #11
Source File: TaskManagerLogFileHandler.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
protected CompletableFuture<TransientBlobKey> requestFileUpload(ResourceManagerGateway resourceManagerGateway, ResourceID taskManagerResourceId) {
	return resourceManagerGateway.requestTaskManagerFileUpload(taskManagerResourceId, FileType.LOG, timeout);
}
 
Example #12
Source File: TaskManagerStdoutFileHandler.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
protected CompletableFuture<TransientBlobKey> requestFileUpload(ResourceManagerGateway resourceManagerGateway, ResourceID taskManagerResourceId) {
	return resourceManagerGateway.requestTaskManagerFileUpload(taskManagerResourceId, FileType.STDOUT, timeout);
}
 
Example #13
Source File: TaskManagerStdoutFileHandler.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected CompletableFuture<TransientBlobKey> requestFileUpload(ResourceManagerGateway resourceManagerGateway, Tuple2<ResourceID, String> taskManagerIdAndFileName) {
	return resourceManagerGateway.requestTaskManagerFileUploadByType(taskManagerIdAndFileName.f0, FileType.STDOUT, timeout);
}
 
Example #14
Source File: TaskManagerLogFileHandler.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected CompletableFuture<TransientBlobKey> requestFileUpload(ResourceManagerGateway resourceManagerGateway, Tuple2<ResourceID, String> taskManagerIdAndFileName) {
	return resourceManagerGateway.requestTaskManagerFileUploadByType(taskManagerIdAndFileName.f0, FileType.LOG, timeout);
}
 
Example #15
Source File: TestingResourceManagerGateway.java    From flink with Apache License 2.0 4 votes vote down vote up
public void setRequestTaskManagerFileUploadByTypeFunction(Function<Tuple2<ResourceID, FileType>, CompletableFuture<TransientBlobKey>> requestTaskManagerFileUploadByTypeFunction) {
	this.requestTaskManagerFileUploadByTypeFunction = requestTaskManagerFileUploadByTypeFunction;
}
 
Example #16
Source File: ResourceManagerGateway.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Request the file upload from the given {@link TaskExecutor} to the cluster's {@link BlobServer}. The
 * corresponding {@link TransientBlobKey} is returned.
 *
 * @param taskManagerId identifying the {@link TaskExecutor} to upload the specified file
 * @param fileType type of the file to upload
 * @param timeout for the asynchronous operation
 * @return Future which is completed with the {@link TransientBlobKey} after uploading the file to the
 * {@link BlobServer}.
 */
CompletableFuture<TransientBlobKey> requestTaskManagerFileUpload(ResourceID taskManagerId, FileType fileType, @RpcTimeout Time timeout);
 
Example #17
Source File: ResourceManagerGateway.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Request the file upload from the given {@link TaskExecutor} to the cluster's {@link BlobServer}. The
 * corresponding {@link TransientBlobKey} is returned.
 *
 * @param taskManagerId identifying the {@link TaskExecutor} to upload the specified file
 * @param fileType type of the file to upload
 * @param timeout for the asynchronous operation
 * @return Future which is completed with the {@link TransientBlobKey} after uploading the file to the
 * {@link BlobServer}.
 */
CompletableFuture<TransientBlobKey> requestTaskManagerFileUploadByType(ResourceID taskManagerId, FileType fileType, @RpcTimeout Time timeout);
 
Example #18
Source File: ResourceManagerGateway.java    From Flink-CEPplus with Apache License 2.0 2 votes vote down vote up
/**
 * Request the file upload from the given {@link TaskExecutor} to the cluster's {@link BlobServer}. The
 * corresponding {@link TransientBlobKey} is returned.
 *
 * @param taskManagerId identifying the {@link TaskExecutor} to upload the specified file
 * @param fileType type of the file to upload
 * @param timeout for the asynchronous operation
 * @return Future which is completed with the {@link TransientBlobKey} after uploading the file to the
 * {@link BlobServer}.
 */
CompletableFuture<TransientBlobKey> requestTaskManagerFileUpload(ResourceID taskManagerId, FileType fileType, @RpcTimeout Time timeout);