gaborgsomogyi commented on code in PR #21604:
URL: https://github.com/apache/flink/pull/21604#discussion_r1062455873


##########
flink-runtime/src/main/java/org/apache/flink/runtime/security/token/hadoop/HadoopFSDelegationTokenProvider.java:
##########
@@ -69,12 +69,35 @@ public String serviceName() {
     @Override
     public void init(Configuration configuration) throws Exception {
         flinkConfiguration = configuration;
-        hadoopConfiguration = 
HadoopUtils.getHadoopConfiguration(configuration);
-        kerberosLoginProvider = new KerberosLoginProvider(configuration);
+        try {
+            hadoopConfiguration = 
HadoopUtils.getHadoopConfiguration(configuration);
+            kerberosLoginProvider = new KerberosLoginProvider(configuration);
+        } catch (NoClassDefFoundError e) {
+            LOG.info(
+                    "Hadoop FS is not available (not packaged with this 
application): {} : \"{}\".",
+                    e.getClass().getSimpleName(),
+                    e.getMessage());
+        }
     }
 
     @Override
     public boolean delegationTokensRequired() throws Exception {
+        /**
+         * The general rule how a provider/receiver must behave is the 
following: The provider and
+         * the receiver must be added to the classpath together with all the 
additionally required
+         * dependencies.
+         *
+         * <p>This null check is required because the Hadoop FS provider is 
always on classpath but
+         * Hadoop FS jars are optional. Such case configuration is not able to 
be loaded. This
+         * construct is intended to be removed when HBase provider/receiver 
pair can be externalized
+         * (namely if a provider/receiver throws an exception then workload 
must be stopped).
+         */
+        if (hadoopConfiguration == null) {
+            LOG.debug(
+                    "Hadoop FS is not available (not packaged with this 
application), hence no "
+                            + "tokens will be acquired.");
+            return false;
+        }

Review Comment:
   This is temporary solution as mentioned before.



-- 
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

Reply via email to