Class JavaInstance
java.lang.Object
org.apache.pulsar.functions.instance.JavaInstance
- All Implemented Interfaces:
AutoCloseable
This is the Java Instance. This is started by the runtimeSpawner using the JavaInstanceClient
program if invoking via a process based invocation or using JavaInstance using a thread
based invocation.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionJavaInstance(org.apache.pulsar.functions.instance.ContextImpl contextImpl, Object userClassObject, InstanceConfig instanceConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()handleMessage(Record<?> record, Object input) handleMessage(Record<?> record, Object input, JavaInstanceRunnable.AsyncResultConsumer asyncResultConsumer, Consumer<Throwable> asyncFailureHandler) voidvoid
-
Constructor Details
-
JavaInstance
public JavaInstance(org.apache.pulsar.functions.instance.ContextImpl contextImpl, Object userClassObject, InstanceConfig instanceConfig)
-
-
Method Details
-
handleMessage
-
handleMessage
public JavaExecutionResult handleMessage(Record<?> record, Object input, JavaInstanceRunnable.AsyncResultConsumer asyncResultConsumer, Consumer<Throwable> asyncFailureHandler) -
initialize
- Throws:
Exception
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
getAndResetMetrics
-
resetMetrics
public void resetMetrics() -
getMetrics
-