如何确保 Google Cloud Dataflow 的暂存位置没有类加载器问题,用于同一 JAR 的 2 个不同版本
How do I ensure there are no classloader issues in Google Cloud Dataflow's staging location for 2 different versions of the same JAR
当 运行 Google Cloud Dataflow 'WordCount' example 时,我发现了一些意想不到的事情。我在暂存位置注意到同一个 JAR 的 2 个版本!
我编辑了我的 WordCount POM 以使用更新的 SLF4J 日志记录 JAR。 (1.7.8)
显然,较新的 JAR 已与旧 JAR 一起部署。旧的 JAR 没有被删除。
根据我之前在其他 Java 项目中的经验,我怀疑这可能会导致类加载问题。但也许不是。
Google 云数据流如何处理潜在的类加载?它使用 OSGI 吗?或者可能与 JAR 文件名末尾的哈希签名有关?
或者我应该在每次部署时清理暂存位置吗?
Dataflow 识别要暂存的必要文件并在 PackagingUtil.java to prevent collisions, so this should not be an issue. The staged files are explicitly passed to the job in filesToStage
in DataflowPipelineRunner.java 中附加哈希,而不是查看暂存目录的全部内容。
当 运行 Google Cloud Dataflow 'WordCount' example 时,我发现了一些意想不到的事情。我在暂存位置注意到同一个 JAR 的 2 个版本!
我编辑了我的 WordCount POM 以使用更新的 SLF4J 日志记录 JAR。 (1.7.8)
显然,较新的 JAR 已与旧 JAR 一起部署。旧的 JAR 没有被删除。
根据我之前在其他 Java 项目中的经验,我怀疑这可能会导致类加载问题。但也许不是。
Google 云数据流如何处理潜在的类加载?它使用 OSGI 吗?或者可能与 JAR 文件名末尾的哈希签名有关?
或者我应该在每次部署时清理暂存位置吗?
Dataflow 识别要暂存的必要文件并在 PackagingUtil.java to prevent collisions, so this should not be an issue. The staged files are explicitly passed to the job in filesToStage
in DataflowPipelineRunner.java 中附加哈希,而不是查看暂存目录的全部内容。