diff --git a/pulsar-functions/src/main/java/org/apache/pulsar/functions/spawner/ExecutionResult.java b/pulsar-functions/src/main/java/org/apache/pulsar/functions/spawner/ExecutionResult.java index 41669f10a9144..25c8af4929ec4 100644 --- a/pulsar-functions/src/main/java/org/apache/pulsar/functions/spawner/ExecutionResult.java +++ b/pulsar-functions/src/main/java/org/apache/pulsar/functions/spawner/ExecutionResult.java @@ -18,14 +18,13 @@ */ package org.apache.pulsar.functions.spawner; -import java.io.ByteArrayOutputStream; import java.util.concurrent.TimeoutException; /** * An interface that represents the result of a function call. */ public interface ExecutionResult { - + Exception getUserException(); TimeoutException getTimeoutException(); diff --git a/pulsar-functions/src/main/java/org/apache/pulsar/functions/spawner/LimitsConfig.java b/pulsar-functions/src/main/java/org/apache/pulsar/functions/spawner/LimitsConfig.java index 9fbf0dc806d16..0db1a06db06f0 100644 --- a/pulsar-functions/src/main/java/org/apache/pulsar/functions/spawner/LimitsConfig.java +++ b/pulsar-functions/src/main/java/org/apache/pulsar/functions/spawner/LimitsConfig.java @@ -18,26 +18,17 @@ */ package org.apache.pulsar.functions.spawner; +import lombok.*; + /** * This represents the config related to the resource limits of function calls */ +@Data +@Setter +@Getter +@EqualsAndHashCode +@ToString class LimitsConfig { private int timeBudgetInMs; private int maxMemory; - - public int getTimeBudgetInMs() { - return timeBudgetInMs; - } - - public void setTimeBudgetInMs(int timeBudgetInMs) { - this.timeBudgetInMs = timeBudgetInMs; - } - - public int getMaxMemory() { - return maxMemory; - } - - public void setMaxMemory(int maxMemory) { - this.maxMemory = maxMemory; - } } \ No newline at end of file diff --git a/pulsar-functions/src/main/java/org/apache/pulsar/functions/spawner/Spawner.java b/pulsar-functions/src/main/java/org/apache/pulsar/functions/spawner/Spawner.java index ebb5a28cf98f7..2a4a533d50c0b 100644 --- a/pulsar-functions/src/main/java/org/apache/pulsar/functions/spawner/Spawner.java +++ b/pulsar-functions/src/main/java/org/apache/pulsar/functions/spawner/Spawner.java @@ -23,17 +23,13 @@ */ package org.apache.pulsar.functions.spawner; -import org.apache.pulsar.client.api.*; -import org.apache.pulsar.functions.instance.JavaExecutionResult; -import org.apache.pulsar.functions.instance.JavaInstance; + import org.apache.pulsar.functions.instance.JavaInstanceConfig; import org.apache.pulsar.functions.runtime.container.FunctionContainer; import org.apache.pulsar.functions.runtime.container.ThreadFunctionContainerFactory; -import org.apache.pulsar.functions.runtime.functioncache.FunctionCacheManager; -import org.apache.pulsar.functions.runtime.functioncache.FunctionCacheManagerImpl; import org.apache.pulsar.functions.subscribermanager.SubscriberManager; -class Spawner { +public class Spawner { private LimitsConfig limitsConfig; private AssignmentInfo assignmentInfo; private String pulsarBrokerRootUrl;