You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by bh...@apache.org on 2020/05/28 17:50:50 UTC

[beam] branch release-2.22.0 updated: [BEAM-9971] Do not use context classloader. (#11784) (#11842)

This is an automated email from the ASF dual-hosted git repository.

bhulette pushed a commit to branch release-2.22.0
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/release-2.22.0 by this push:
     new 775af5c  [BEAM-9971] Do not use context classloader. (#11784) (#11842)
775af5c is described below

commit 775af5c555761a2f8883f0baa2bef69668b03d82
Author: Brian Hulette <bh...@google.com>
AuthorDate: Thu May 28 10:50:32 2020 -0700

    [BEAM-9971] Do not use context classloader. (#11784) (#11842)
    
    * [BEAM-9971] Do not use context classloader.
    
    * Add TODO(BEAM-10109).
    
    Co-authored-by: Kyle Weaver <kc...@google.com>
---
 .../org/apache/beam/runners/core/construction/NativeTransforms.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/NativeTransforms.java b/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/NativeTransforms.java
index 730a5ca..9ea47a1 100644
--- a/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/NativeTransforms.java
+++ b/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/NativeTransforms.java
@@ -46,7 +46,10 @@ public class NativeTransforms {
    * Returns true if an only if the Runner understands this transform and can handle it directly.
    */
   public static boolean isNative(RunnerApi.PTransform pTransform) {
-    Iterator<IsNativeTransform> matchers = ServiceLoader.load(IsNativeTransform.class).iterator();
+    // TODO(BEAM-10109) Use default (context) classloader.
+    Iterator<IsNativeTransform> matchers =
+        ServiceLoader.load(IsNativeTransform.class, NativeTransforms.class.getClassLoader())
+            .iterator();
     while (matchers.hasNext()) {
       if (matchers.next().test(pTransform)) {
         return true;