Hongshun Wang created FLINK-36023:
-------------------------------------

             Summary: Flink K8S Native Application Mode add wrong jar url.
                 Key: FLINK-36023
                 URL: https://issues.apache.org/jira/browse/FLINK-36023
             Project: Flink
          Issue Type: Improvement
            Reporter: Hongshun Wang


In https://issues.apache.org/jira/browse/FLINK-34853 , a great job made to 
summit CDC Job in Flink K8S Native Application Mode.However,  some change will 
occur problem:
 # if user summit job not in Flink K8S Native Application Mode, and put jar in 
/mypackage/usrlib will be casted to &\{FLINK_HOME}/usrlib.
 # if user summit job in Flink K8S Native Application Mode , jar in 
local://usrlib have already been added to classpath of JM and TM, thus no need 
to add jar anymore.

 
{code:java}
public static <T extends Factory> Optional<URL> getJarPathByIdentifier(
            String identifier, Class<T> factoryClass) {
        try {
         ...
            if (urlString.contains("usrlib")) {
                String flinkHome = System.getenv("FLINK_HOME");
                urlString = urlString.replace("usrlib", flinkHome + "/usrlib");
            }
           ....
            }
            return Optional.of(url);
        } catch (Exception e) {
            throw new RuntimeException(
                    String.format("Failed to search JAR by factory identifier 
\"%s\"", identifier),
                    e);
        }
    }
}
 {code}
 

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to