jerrypeng edited a comment on pull request #10878:
URL: https://github.com/apache/pulsar/pull/10878#issuecomment-859661172


   @eolivelli there are three classloaders used:
   
   1. rootClassLoader - contains only the API interfaces for Pulsar Client API, 
Functions, and IO
   
   2. instanceClassLoader - is a child of rootClassLoader. Contains API 
interfaces + all the implementations and framework code e.g. 
pulsar-client-original, pulsar-function-instance, etc
   
   3. functionClassLoader - is a child of the rootClassLoader.  Contains API 
interfaces + user submitted classes, i.e. classes in the JAR or NAR the use 
submittied.
   
   The rootClassLoader can be viewed as loading the classes that contain the 
interfaces in which the function instance / framework code interacts with the 
user submitted submitted classes that implement the Pulsar Function / IO 
interfaces.
   
   When the JavaInstanceRunnable thread is running code that is framework code, 
i.e. Pulsar Function Instance code, the thread context loader needs to be set 
to instanceClassLoader.  When the JavaInstanceRunnable thread is running code 
that is user submitted, e.g. when source.open(), sink.open, function.process(), 
etc, is called, the thread context loader needs to be set to 
functionClassLoader.


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to