baisui1981 commented on pull request #17521:
URL: https://github.com/apache/flink/pull/17521#issuecomment-955126616


   > But the user-jar is the same for all tasks. You can't use a manifest in 
said jar for differentiating which classes should now be loaded / made 
accessible. You either a) need the CL factory to create a task-specific 
classloader (which you can't because jars are the same and CLs are shared) or 
b) need the cooperation from the user-code to load classes in a specific way.
   
   @zentol Please forgive me for my negligence, I didn’t explain the process 
clearly. 
   Before submit the job to Flink cluster, will package a jar dynamically, at 
then,the metadata info for the manifest which is relevant to the job will be 
put in the jar togother:
   
   code as below 
[FlinkTaskNodeController.java](https://github.com/qlangtech/plugins/blob/864f5bf01fad567fbc09a217f4bbf17c95910f94/tis-incr/tis-realtime-flink/src/main/java/com/qlangtech/plugins/incr/flink/launch/FlinkTaskNodeController.java#L129)
   ``` java
   Manifest manifest = new Manifest();
   Map<String, Attributes> entries = manifest.getEntries();
   Attributes attrs = new Attributes();
   attrs.put(new Attributes.Name(collection.getName()), 
String.valueOf(timestamp));
    // put Flink job name
   entries.put(TISFlinkCDCStart.TIS_APP_NAME, attrs);
   ```
                                                                                
                             
   when submit to the server side, in my customized extend point implementation 
method 
[ClassLoaderFactoryBuilder.buildServerLoaderFactory](https://github.com/qlangtech/plugins/blob/864f5bf01fad567fbc09a217f4bbf17c95910f94/tis-incr/tis-flink-extends/src/main/java/com/qlangtech/plugins/incr/flink/TISFlinClassLoaderFactory.java#L101),will
 extract the param from the submitted jar manifest, at then pull the plugin 
bundles  from TIS plugin repository with http protocol, and initialize the 
PluginManager which is responsible for load class .
   


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