anikakelhanka opened a new pull request, #23714: URL: https://github.com/apache/flink/pull/23714
## What is the purpose of the change This pull request updates Flink's History Server logic to enable getting logs and data from multiple directories at a time by using a path with wildcards (i.e glob pattern) from HadoopFileSystem locations. The feature can be very useful for cloud based use cases where users wish to setup history server in multi cluster environment. ## Brief change log - Enhance the Flink's FileSystem API by adding a function that exposes the Hadoop's file system API GlobStatus feature. - Flink's HistoryServerArchiveFetcher currently uses the HadoopFileSystem's listStatus API method to read files from the location specified in 'historyserver.archive.fs.dir' property which by design does not resolve patterns/wildcards in the history server file path. - We enhance the Flink's FileSystem API by introducing a new method similar to Hadoop's `globStatus(Path pathPattern)` as below: ``` public FileStatus[] globStatus(Path pathPattern) throws IOException ``` - This new method is now implemented in Flink's HadoopFileSystem class such that it uses the Hadoop's internal globStatus implementation. ``` public FileStatus[] globStatus(final Path pathPattern) throws IOException { final FileStatus[] hadoopFiles = this.fs.globStatus(toHadoopPath(pathPattern)); // rest of the code } ``` - Finally, HistoryServerArchiveFetcher.java will call the new globStatus() API instead of listStatus() for HadoopFileSystem. ## Verifying this change Please make sure both new and modified tests in this PR follows the conventions defined in our code quality guide: https://flink.apache.org/contributing/code-style-and-quality-common.html#testing This change added tests and can be verified as follows: - Added unit tests to test the functionality of the new globSatus API in Flink's HadoopFileSystem class - Manually verified the change by running two 3-node clusters (GCP Dataproc) with logs storage on object store (Google Cloud Storage) and reading their logs from another single node cluster's history server UI Interface. ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): no - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no - The serializers: no - The runtime per-record code paths (performance sensitive): no - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no - The S3 file system connector: no ## Documentation - Does this pull request introduce a new feature? yes - If yes, how is the feature documented? JavaDocs -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org