Class ThreadRuntimeFactory
java.lang.Object
org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactory
- All Implemented Interfaces:
AutoCloseable,RuntimeFactory
Thread based function container factory implementation.
-
Constructor Summary
ConstructorsConstructorDescriptionThreadRuntimeFactory(String threadGroupName, String pulsarServiceUrl, String stateStorageImplClass, String storageServiceUrl, org.apache.pulsar.functions.instance.AuthenticationConfig authConfig, org.apache.pulsar.functions.secretsprovider.SecretsProvider secretsProvider, org.apache.pulsar.functions.instance.stats.FunctionCollectorRegistry collectorRegistry, String narExtractionDirectory, ClassLoader rootClassLoader, boolean exposePulsarAdminClientEnabled, String pulsarWebServiceUrl) This constructor is used by other runtimes (e.g. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()createContainer(org.apache.pulsar.functions.instance.InstanceConfig instanceConfig, String jarFile, String originalCodeFileName, Long expectedHealthCheckInterval) Create a function container to execute a java instance.voidinitialize(WorkerConfig workerConfig, org.apache.pulsar.functions.instance.AuthenticationConfig authenticationConfig, org.apache.pulsar.functions.secretsproviderconfigurator.SecretsProviderConfigurator secretsProviderConfigurator, ConnectorsManager connectorsManager, Optional<FunctionAuthProvider> functionAuthProvider, Optional<RuntimeCustomizer> runtimeCustomizer) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.functions.runtime.RuntimeFactory
doAdmissionChecks, externallyManaged, getAuthProvider, getRuntimeCustomizer
-
Constructor Details
-
ThreadRuntimeFactory
public ThreadRuntimeFactory(String threadGroupName, String pulsarServiceUrl, String stateStorageImplClass, String storageServiceUrl, org.apache.pulsar.functions.instance.AuthenticationConfig authConfig, org.apache.pulsar.functions.secretsprovider.SecretsProvider secretsProvider, org.apache.pulsar.functions.instance.stats.FunctionCollectorRegistry collectorRegistry, String narExtractionDirectory, ClassLoader rootClassLoader, boolean exposePulsarAdminClientEnabled, String pulsarWebServiceUrl) throws Exception This constructor is used by other runtimes (e.g. ProcessRuntime and KubernetesRuntime) that rely on ThreadRuntime to actually run an instance of the function. When used by other runtimes, the arguments such as secretsProvider and rootClassLoader will be provided.- Throws:
Exception
-
-
Method Details
-
initialize
public void initialize(WorkerConfig workerConfig, org.apache.pulsar.functions.instance.AuthenticationConfig authenticationConfig, org.apache.pulsar.functions.secretsproviderconfigurator.SecretsProviderConfigurator secretsProviderConfigurator, ConnectorsManager connectorsManager, Optional<FunctionAuthProvider> functionAuthProvider, Optional<RuntimeCustomizer> runtimeCustomizer) throws Exception - Specified by:
initializein interfaceRuntimeFactory- Throws:
Exception
-
createContainer
public ThreadRuntime createContainer(org.apache.pulsar.functions.instance.InstanceConfig instanceConfig, String jarFile, String originalCodeFileName, Long expectedHealthCheckInterval) Description copied from interface:RuntimeFactoryCreate a function container to execute a java instance.- Specified by:
createContainerin interfaceRuntimeFactory- Parameters:
instanceConfig- java instance configjarFile- code fileexpectedHealthCheckInterval- expected health check interval in seconds- Returns:
- function container to start/stop instance
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceRuntimeFactory
-