This is an automated email from the ASF dual-hosted git repository. sanjeevrk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push: new aad9a00 Moved FunctionConfig/SourceConfig/SinkConfig to a more common location (#2818) aad9a00 is described below commit aad9a001f03fe2206a276030953dfc3bd55a81ad Author: Sanjeev Kulkarni <sanjee...@gmail.com> AuthorDate: Tue Oct 23 09:20:33 2018 -0700 Moved FunctionConfig/SourceConfig/SinkConfig to a more common location (#2818) --- .../pulsar/functions/worker/PulsarWorkerAssignmentTest.java | 2 +- .../test/java/org/apache/pulsar/io/PulsarFunctionE2ETest.java | 3 +-- .../test/java/org/apache/pulsar/io/PulsarFunctionTlsTest.java | 2 +- .../main/java/org/apache/pulsar/client/admin/Functions.java | 2 +- .../src/main/java/org/apache/pulsar/client/admin/Sink.java | 2 +- .../src/main/java/org/apache/pulsar/client/admin/Source.java | 2 +- .../apache/pulsar/client/admin/internal/FunctionsImpl.java | 2 +- .../org/apache/pulsar/client/admin/internal/SinkImpl.java | 2 +- .../org/apache/pulsar/client/admin/internal/SourceImpl.java | 2 +- .../java/org/apache/pulsar/admin/cli/CmdFunctionsTest.java | 5 +---- .../main/java/org/apache/pulsar/admin/cli/CmdFunctions.java | 5 ++++- .../src/main/java/org/apache/pulsar/admin/cli/CmdSinks.java | 7 +++++-- .../src/main/java/org/apache/pulsar/admin/cli/CmdSources.java | 9 +++++---- .../test/java/org/apache/pulsar/admin/cli/TestCmdSinks.java | 3 +++ .../test/java/org/apache/pulsar/admin/cli/TestCmdSources.java | 3 +++ .../org/apache/pulsar/common/functions}/ConsumerConfig.java | 2 +- .../org/apache/pulsar/common/functions}/FunctionConfig.java | 5 ++++- .../java/org/apache/pulsar/common/functions}/Resources.java | 2 +- .../org/apache/pulsar/common/functions}/WindowConfig.java | 2 +- .../main/java/org/apache/pulsar/common/io}/SinkConfig.java | 5 ++++- .../main/java/org/apache/pulsar/common/io}/SourceConfig.java | 4 +++- .../pulsar/functions/instance/JavaInstanceRunnable.java | 4 ++-- .../java/org/apache/pulsar/functions/sink/PulsarSink.java | 2 +- .../org/apache/pulsar/functions/sink/PulsarSinkConfig.java | 2 +- .../java/org/apache/pulsar/functions/source/PulsarSource.java | 2 +- .../apache/pulsar/functions/source/PulsarSourceConfig.java | 4 ++-- .../pulsar/functions/windowing/WindowFunctionExecutor.java | 2 +- .../org/apache/pulsar/functions/windowing/WindowUtils.java | 2 +- .../java/org/apache/pulsar/functions/sink/PulsarSinkTest.java | 5 +---- .../org/apache/pulsar/functions/source/PulsarSourceTest.java | 6 ++---- .../functions/windowing/WindowFunctionExecutorTest.java | 2 +- .../apache/pulsar/functions/utils/FunctionConfigUtils.java | 4 ++++ .../apache/pulsar/functions/utils/ResourceConfigUtils.java | 2 ++ .../org/apache/pulsar/functions/utils/SinkConfigUtils.java | 4 ++++ .../org/apache/pulsar/functions/utils/SourceConfigUtils.java | 2 ++ .../main/java/org/apache/pulsar/functions/utils/Utils.java | 2 +- .../org/apache/pulsar/functions/utils/WindowConfigUtils.java | 2 ++ .../pulsar/functions/utils/FunctionConfigUtilsTest.java | 2 ++ .../apache/pulsar/functions/utils/SinkConfigUtilsTest.java | 3 +++ .../apache/pulsar/functions/utils/SourceConfigUtilsTest.java | 2 ++ .../apache/pulsar/functions/utils/WindowConfigUtilsTest.java | 11 +---------- .../pulsar/functions/worker/rest/api/FunctionsImpl.java | 3 +++ .../worker/rest/api/v2/FunctionApiV2ResourceTest.java | 2 +- .../functions/worker/rest/api/v2/SinkApiV2ResourceTest.java | 3 +-- .../functions/worker/rest/api/v2/SourceApiV2ResourceTest.java | 2 +- 45 files changed, 86 insertions(+), 60 deletions(-) diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/functions/worker/PulsarWorkerAssignmentTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/functions/worker/PulsarWorkerAssignmentTest.java index acd6ed3..5af899a 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/functions/worker/PulsarWorkerAssignmentTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/functions/worker/PulsarWorkerAssignmentTest.java @@ -43,7 +43,7 @@ import org.apache.pulsar.client.api.PulsarClient; import org.apache.pulsar.common.policies.data.ClusterData; import org.apache.pulsar.common.policies.data.TenantInfo; import org.apache.pulsar.functions.proto.Function.Assignment; -import org.apache.pulsar.functions.utils.FunctionConfig; +import org.apache.pulsar.common.functions.FunctionConfig; import org.apache.pulsar.functions.utils.Utils; import org.apache.pulsar.zookeeper.LocalBookkeeperEnsemble; import org.slf4j.Logger; diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionE2ETest.java b/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionE2ETest.java index 21133d6..3824619 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionE2ETest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionE2ETest.java @@ -47,11 +47,10 @@ import org.apache.pulsar.common.policies.data.ClusterData; import org.apache.pulsar.common.policies.data.SubscriptionStats; import org.apache.pulsar.common.policies.data.TenantInfo; import org.apache.pulsar.functions.instance.JavaInstanceRunnable; -import org.apache.pulsar.functions.proto.Function.FunctionDetails; import org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus; import org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatusList; import org.apache.pulsar.functions.proto.InstanceCommunication.MetricsData.DataDigest; -import org.apache.pulsar.functions.utils.FunctionConfig; +import org.apache.pulsar.common.functions.FunctionConfig; import org.apache.pulsar.functions.utils.Utils; import org.apache.pulsar.functions.worker.FunctionRuntimeManager; import org.apache.pulsar.functions.worker.WorkerConfig; diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionTlsTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionTlsTest.java index 1a1a95b..19e05a9 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionTlsTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionTlsTest.java @@ -46,7 +46,7 @@ import org.apache.pulsar.client.impl.auth.AuthenticationTls; import org.apache.pulsar.common.policies.data.TenantInfo; import org.apache.pulsar.functions.api.utils.IdentityFunction; import org.apache.pulsar.functions.sink.PulsarSink; -import org.apache.pulsar.functions.utils.FunctionConfig; +import org.apache.pulsar.common.functions.FunctionConfig; import org.apache.pulsar.functions.utils.Utils; import org.apache.pulsar.functions.worker.FunctionMetaDataManager; import org.apache.pulsar.functions.worker.WorkerConfig; diff --git a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Functions.java b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Functions.java index a722605..270dc8d 100644 --- a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Functions.java +++ b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Functions.java @@ -27,7 +27,7 @@ import org.apache.pulsar.client.admin.PulsarAdminException.PreconditionFailedExc import org.apache.pulsar.common.io.ConnectorDefinition; import org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus; import org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatusList; -import org.apache.pulsar.functions.utils.FunctionConfig; +import org.apache.pulsar.common.functions.FunctionConfig; /** * Admin interface for function management. diff --git a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Sink.java b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Sink.java index afad6f3..79b3293 100644 --- a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Sink.java +++ b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Sink.java @@ -24,7 +24,7 @@ import org.apache.pulsar.client.admin.PulsarAdminException.PreconditionFailedExc import org.apache.pulsar.common.io.ConnectorDefinition; import org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus; import org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatusList; -import org.apache.pulsar.functions.utils.SinkConfig; +import org.apache.pulsar.common.io.SinkConfig; import java.util.List; diff --git a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Source.java b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Source.java index 9d1a318..7ac0385 100644 --- a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Source.java +++ b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Source.java @@ -24,7 +24,7 @@ import org.apache.pulsar.client.admin.PulsarAdminException.PreconditionFailedExc import org.apache.pulsar.common.io.ConnectorDefinition; import org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus; import org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatusList; -import org.apache.pulsar.functions.utils.SourceConfig; +import org.apache.pulsar.common.io.SourceConfig; import java.util.List; diff --git a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java index 77cc3d6..a67deb0 100644 --- a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java +++ b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java @@ -48,7 +48,7 @@ import org.apache.pulsar.common.io.ConnectorDefinition; import org.apache.pulsar.common.policies.data.ErrorData; import org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus; import org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatusList; -import org.apache.pulsar.functions.utils.FunctionConfig; +import org.apache.pulsar.common.functions.FunctionConfig; import org.apache.pulsar.functions.worker.WorkerInfo; import org.glassfish.jersey.media.multipart.FormDataBodyPart; import org.glassfish.jersey.media.multipart.FormDataMultiPart; diff --git a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinkImpl.java b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinkImpl.java index d117374..e656434 100644 --- a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinkImpl.java +++ b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinkImpl.java @@ -29,7 +29,7 @@ import org.apache.pulsar.common.io.ConnectorDefinition; import org.apache.pulsar.common.policies.data.ErrorData; import org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus; import org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatusList; -import org.apache.pulsar.functions.utils.SinkConfig; +import org.apache.pulsar.common.io.SinkConfig; import org.glassfish.jersey.media.multipart.FormDataBodyPart; import org.glassfish.jersey.media.multipart.FormDataMultiPart; import org.glassfish.jersey.media.multipart.file.FileDataBodyPart; diff --git a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SourceImpl.java b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SourceImpl.java index 0c7a1df..8fdb2e2 100644 --- a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SourceImpl.java +++ b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SourceImpl.java @@ -29,7 +29,7 @@ import org.apache.pulsar.common.io.ConnectorDefinition; import org.apache.pulsar.common.policies.data.ErrorData; import org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus; import org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatusList; -import org.apache.pulsar.functions.utils.SourceConfig; +import org.apache.pulsar.common.io.SourceConfig; import org.glassfish.jersey.media.multipart.FormDataBodyPart; import org.glassfish.jersey.media.multipart.FormDataMultiPart; import org.glassfish.jersey.media.multipart.file.FileDataBodyPart; diff --git a/pulsar-client-tools-test/src/test/java/org/apache/pulsar/admin/cli/CmdFunctionsTest.java b/pulsar-client-tools-test/src/test/java/org/apache/pulsar/admin/cli/CmdFunctionsTest.java index bf4af8a..4f30bf1 100644 --- a/pulsar-client-tools-test/src/test/java/org/apache/pulsar/admin/cli/CmdFunctionsTest.java +++ b/pulsar-client-tools-test/src/test/java/org/apache/pulsar/admin/cli/CmdFunctionsTest.java @@ -42,10 +42,7 @@ import org.apache.pulsar.client.admin.PulsarAdmin; import org.apache.pulsar.client.impl.conf.ClientConfigurationData; import org.apache.pulsar.functions.api.Context; import org.apache.pulsar.functions.api.Function; -import org.apache.pulsar.functions.api.utils.IdentityFunction; -import org.apache.pulsar.functions.proto.Function.FunctionDetails; -import org.apache.pulsar.functions.sink.PulsarSink; -import org.apache.pulsar.functions.utils.FunctionConfig; +import org.apache.pulsar.common.functions.FunctionConfig; import org.apache.pulsar.functions.utils.Reflections; import org.apache.pulsar.functions.utils.Utils; import org.powermock.api.mockito.PowerMockito; diff --git a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java index dbc48cc..7564d32 100644 --- a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java +++ b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java @@ -66,6 +66,9 @@ import org.apache.commons.lang.StringUtils; import org.apache.pulsar.admin.cli.utils.CmdUtils; import org.apache.pulsar.client.admin.PulsarAdmin; import org.apache.pulsar.client.api.PulsarClientException; +import org.apache.pulsar.common.functions.FunctionConfig; +import org.apache.pulsar.common.functions.Resources; +import org.apache.pulsar.common.functions.WindowConfig; import org.apache.pulsar.functions.instance.AuthenticationConfig; import org.apache.pulsar.functions.instance.InstanceConfig; import org.apache.pulsar.functions.runtime.ProcessRuntimeFactory; @@ -411,7 +414,7 @@ public class CmdFunctions extends CmdBase { functionConfig.setParallelism(parallelism); } - functionConfig.setResources(new org.apache.pulsar.functions.utils.Resources(cpu, ram, disk)); + functionConfig.setResources(new Resources(cpu, ram, disk)); if (timeoutMs != null) { functionConfig.setTimeoutMs(timeoutMs); diff --git a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSinks.java b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSinks.java index b8ba510..a3bfd88 100644 --- a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSinks.java +++ b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSinks.java @@ -50,7 +50,10 @@ import org.apache.pulsar.admin.cli.utils.CmdUtils; import org.apache.pulsar.client.admin.PulsarAdmin; import org.apache.pulsar.client.admin.PulsarAdminException; import org.apache.pulsar.client.admin.internal.FunctionsImpl; +import org.apache.pulsar.common.functions.FunctionConfig; +import org.apache.pulsar.common.functions.Resources; import org.apache.pulsar.common.io.ConnectorDefinition; +import org.apache.pulsar.common.io.SinkConfig; import org.apache.pulsar.common.nar.NarClassLoader; import org.apache.pulsar.functions.instance.AuthenticationConfig; import org.apache.pulsar.functions.utils.*; @@ -382,9 +385,9 @@ public class CmdSinks extends CmdBase { sinkConfig.setArchive(validateSinkType(sinkType)); } - org.apache.pulsar.functions.utils.Resources resources = sinkConfig.getResources(); + Resources resources = sinkConfig.getResources(); if (resources == null) { - resources = new org.apache.pulsar.functions.utils.Resources(); + resources = new Resources(); } if (cpu != null) { resources.setCpu(cpu); diff --git a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSources.java b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSources.java index f295030..baeb5e0 100644 --- a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSources.java +++ b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSources.java @@ -52,11 +52,12 @@ import org.apache.pulsar.admin.cli.utils.CmdUtils; import org.apache.pulsar.client.admin.PulsarAdmin; import org.apache.pulsar.client.admin.PulsarAdminException; import org.apache.pulsar.client.admin.internal.FunctionsImpl; +import org.apache.pulsar.common.functions.Resources; import org.apache.pulsar.common.io.ConnectorDefinition; import org.apache.pulsar.common.nar.NarClassLoader; import org.apache.pulsar.functions.instance.AuthenticationConfig; -import org.apache.pulsar.functions.utils.FunctionConfig; -import org.apache.pulsar.functions.utils.SourceConfig; +import org.apache.pulsar.common.functions.FunctionConfig; +import org.apache.pulsar.common.io.SourceConfig; import org.apache.pulsar.functions.utils.SourceConfigUtils; import org.apache.pulsar.functions.utils.Utils; import org.apache.pulsar.functions.utils.io.ConnectorUtils; @@ -349,9 +350,9 @@ public class CmdSources extends CmdBase { sourceConfig.setArchive(validateSourceType(sourceType)); } - org.apache.pulsar.functions.utils.Resources resources = sourceConfig.getResources(); + Resources resources = sourceConfig.getResources(); if (resources == null) { - resources = new org.apache.pulsar.functions.utils.Resources(); + resources = new Resources(); } if (cpu != null) { resources.setCpu(cpu); diff --git a/pulsar-client-tools/src/test/java/org/apache/pulsar/admin/cli/TestCmdSinks.java b/pulsar-client-tools/src/test/java/org/apache/pulsar/admin/cli/TestCmdSinks.java index 67518d5..6b59023 100644 --- a/pulsar-client-tools/src/test/java/org/apache/pulsar/admin/cli/TestCmdSinks.java +++ b/pulsar-client-tools/src/test/java/org/apache/pulsar/admin/cli/TestCmdSinks.java @@ -40,6 +40,9 @@ import lombok.extern.slf4j.Slf4j; import org.apache.pulsar.admin.cli.utils.CmdUtils; import org.apache.pulsar.client.admin.Sink; import org.apache.pulsar.client.admin.PulsarAdmin; +import org.apache.pulsar.common.functions.FunctionConfig; +import org.apache.pulsar.common.functions.Resources; +import org.apache.pulsar.common.io.SinkConfig; import org.apache.pulsar.functions.utils.*; import org.apache.pulsar.io.cassandra.CassandraStringSink; import org.mockito.Mockito; diff --git a/pulsar-client-tools/src/test/java/org/apache/pulsar/admin/cli/TestCmdSources.java b/pulsar-client-tools/src/test/java/org/apache/pulsar/admin/cli/TestCmdSources.java index 63574f9..cb0c9e9 100644 --- a/pulsar-client-tools/src/test/java/org/apache/pulsar/admin/cli/TestCmdSources.java +++ b/pulsar-client-tools/src/test/java/org/apache/pulsar/admin/cli/TestCmdSources.java @@ -38,6 +38,9 @@ import lombok.extern.slf4j.Slf4j; import org.apache.pulsar.admin.cli.utils.CmdUtils; import org.apache.pulsar.client.admin.Source; import org.apache.pulsar.client.admin.PulsarAdmin; +import org.apache.pulsar.common.functions.FunctionConfig; +import org.apache.pulsar.common.functions.Resources; +import org.apache.pulsar.common.io.SourceConfig; import org.apache.pulsar.functions.utils.*; import org.mockito.Mockito; import org.powermock.api.mockito.PowerMockito; diff --git a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/ConsumerConfig.java b/pulsar-common/src/main/java/org/apache/pulsar/common/functions/ConsumerConfig.java similarity index 96% rename from pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/ConsumerConfig.java rename to pulsar-common/src/main/java/org/apache/pulsar/common/functions/ConsumerConfig.java index de1a7bb..7652336 100644 --- a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/ConsumerConfig.java +++ b/pulsar-common/src/main/java/org/apache/pulsar/common/functions/ConsumerConfig.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.functions.utils; +package org.apache.pulsar.common.functions; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfig.java b/pulsar-common/src/main/java/org/apache/pulsar/common/functions/FunctionConfig.java similarity index 92% rename from pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfig.java rename to pulsar-common/src/main/java/org/apache/pulsar/common/functions/FunctionConfig.java index e206440..ea5866a 100644 --- a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfig.java +++ b/pulsar-common/src/main/java/org/apache/pulsar/common/functions/FunctionConfig.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.functions.utils; +package org.apache.pulsar.common.functions; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -29,6 +29,9 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; import lombok.ToString; +import org.apache.pulsar.common.functions.ConsumerConfig; +import org.apache.pulsar.common.functions.Resources; +import org.apache.pulsar.common.functions.WindowConfig; @Getter @Setter diff --git a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/Resources.java b/pulsar-common/src/main/java/org/apache/pulsar/common/functions/Resources.java similarity index 96% rename from pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/Resources.java rename to pulsar-common/src/main/java/org/apache/pulsar/common/functions/Resources.java index fc187f7..ff8cb55 100644 --- a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/Resources.java +++ b/pulsar-common/src/main/java/org/apache/pulsar/common/functions/Resources.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.functions.utils; +package org.apache.pulsar.common.functions; import lombok.*; diff --git a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/WindowConfig.java b/pulsar-common/src/main/java/org/apache/pulsar/common/functions/WindowConfig.java similarity index 97% rename from pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/WindowConfig.java rename to pulsar-common/src/main/java/org/apache/pulsar/common/functions/WindowConfig.java index 0ea4c79..33f742b 100644 --- a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/WindowConfig.java +++ b/pulsar-common/src/main/java/org/apache/pulsar/common/functions/WindowConfig.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.functions.utils; +package org.apache.pulsar.common.functions; import lombok.Data; import lombok.Getter; diff --git a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfig.java b/pulsar-common/src/main/java/org/apache/pulsar/common/io/SinkConfig.java similarity index 89% rename from pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfig.java rename to pulsar-common/src/main/java/org/apache/pulsar/common/io/SinkConfig.java index 1964c1e..c4bf1ca 100644 --- a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfig.java +++ b/pulsar-common/src/main/java/org/apache/pulsar/common/io/SinkConfig.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.functions.utils; +package org.apache.pulsar.common.io; import java.util.Collection; import java.util.Map; @@ -27,6 +27,9 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; import lombok.ToString; +import org.apache.pulsar.common.functions.ConsumerConfig; +import org.apache.pulsar.common.functions.FunctionConfig; +import org.apache.pulsar.common.functions.Resources; @Getter @Setter diff --git a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfig.java b/pulsar-common/src/main/java/org/apache/pulsar/common/io/SourceConfig.java similarity index 90% rename from pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfig.java rename to pulsar-common/src/main/java/org/apache/pulsar/common/io/SourceConfig.java index 901b0c1..57c0f79 100644 --- a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfig.java +++ b/pulsar-common/src/main/java/org/apache/pulsar/common/io/SourceConfig.java @@ -16,13 +16,15 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.functions.utils; +package org.apache.pulsar.common.io; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; import lombok.ToString; +import org.apache.pulsar.common.functions.FunctionConfig; +import org.apache.pulsar.common.functions.Resources; import java.util.Map; diff --git a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java index 8d587cf..b32ab9d 100644 --- a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java +++ b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java @@ -54,8 +54,8 @@ import org.apache.pulsar.functions.sink.PulsarSinkConfig; import org.apache.pulsar.functions.sink.PulsarSinkDisable; import org.apache.pulsar.functions.source.PulsarSource; import org.apache.pulsar.functions.source.PulsarSourceConfig; -import org.apache.pulsar.functions.utils.ConsumerConfig; -import org.apache.pulsar.functions.utils.FunctionConfig; +import org.apache.pulsar.common.functions.ConsumerConfig; +import org.apache.pulsar.common.functions.FunctionConfig; import org.apache.pulsar.functions.utils.FunctionDetailsUtils; import org.apache.pulsar.functions.utils.Reflections; import org.apache.pulsar.functions.utils.functioncache.FunctionCacheManager; diff --git a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/sink/PulsarSink.java b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/sink/PulsarSink.java index 8c0c29f..4b634d2 100644 --- a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/sink/PulsarSink.java +++ b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/sink/PulsarSink.java @@ -35,7 +35,7 @@ import org.apache.pulsar.functions.instance.FunctionResultRouter; import org.apache.pulsar.functions.instance.SinkRecord; import org.apache.pulsar.functions.source.PulsarRecord; import org.apache.pulsar.functions.source.TopicSchema; -import org.apache.pulsar.functions.utils.FunctionConfig; +import org.apache.pulsar.common.functions.FunctionConfig; import org.apache.pulsar.functions.utils.Reflections; import org.apache.pulsar.io.core.Sink; import org.apache.pulsar.io.core.SinkContext; diff --git a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/sink/PulsarSinkConfig.java b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/sink/PulsarSinkConfig.java index 85757fb..b25b320 100644 --- a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/sink/PulsarSinkConfig.java +++ b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/sink/PulsarSinkConfig.java @@ -21,7 +21,7 @@ package org.apache.pulsar.functions.sink; import lombok.Getter; import lombok.Setter; import lombok.ToString; -import org.apache.pulsar.functions.utils.FunctionConfig; +import org.apache.pulsar.common.functions.FunctionConfig; @Getter @Setter diff --git a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/PulsarSource.java b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/PulsarSource.java index 0e840a2..02e56ab 100644 --- a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/PulsarSource.java +++ b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/PulsarSource.java @@ -35,7 +35,7 @@ import org.apache.pulsar.client.api.*; import org.apache.pulsar.client.impl.MultiTopicsConsumerImpl; import org.apache.pulsar.client.impl.TopicMessageImpl; import org.apache.pulsar.functions.api.Record; -import org.apache.pulsar.functions.utils.FunctionConfig; +import org.apache.pulsar.common.functions.FunctionConfig; import org.apache.pulsar.functions.utils.Reflections; import org.apache.pulsar.io.core.PushSource; import org.apache.pulsar.io.core.SourceContext; diff --git a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/PulsarSourceConfig.java b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/PulsarSourceConfig.java index 65c5847..cf843be 100644 --- a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/PulsarSourceConfig.java +++ b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/PulsarSourceConfig.java @@ -28,8 +28,8 @@ import lombok.Data; import org.apache.pulsar.client.api.SubscriptionType; import org.apache.pulsar.common.util.ObjectMapperFactory; -import org.apache.pulsar.functions.utils.ConsumerConfig; -import org.apache.pulsar.functions.utils.FunctionConfig; +import org.apache.pulsar.common.functions.ConsumerConfig; +import org.apache.pulsar.common.functions.FunctionConfig; @Data public class PulsarSourceConfig { diff --git a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/windowing/WindowFunctionExecutor.java b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/windowing/WindowFunctionExecutor.java index 73c909b..79e0891 100644 --- a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/windowing/WindowFunctionExecutor.java +++ b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/windowing/WindowFunctionExecutor.java @@ -34,7 +34,7 @@ import org.apache.pulsar.functions.api.Context; import org.apache.pulsar.functions.api.Function; import org.apache.pulsar.functions.api.Record; import org.apache.pulsar.functions.utils.Reflections; -import org.apache.pulsar.functions.utils.WindowConfig; +import org.apache.pulsar.common.functions.WindowConfig; import org.apache.pulsar.functions.windowing.evictors.CountEvictionPolicy; import org.apache.pulsar.functions.windowing.evictors.TimeEvictionPolicy; import org.apache.pulsar.functions.windowing.evictors.WatermarkCountEvictionPolicy; diff --git a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/windowing/WindowUtils.java b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/windowing/WindowUtils.java index 73dda87..0c98847 100644 --- a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/windowing/WindowUtils.java +++ b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/windowing/WindowUtils.java @@ -18,7 +18,7 @@ */ package org.apache.pulsar.functions.windowing; -import org.apache.pulsar.functions.utils.WindowConfig; +import org.apache.pulsar.common.functions.WindowConfig; public class WindowUtils { public static String getFullyQualifiedName(String tenant, String namespace, String name) { diff --git a/pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/sink/PulsarSinkTest.java b/pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/sink/PulsarSinkTest.java index 7dfe6a7..51fa452 100644 --- a/pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/sink/PulsarSinkTest.java +++ b/pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/sink/PulsarSinkTest.java @@ -37,7 +37,6 @@ import java.util.HashMap; import java.util.Optional; import java.util.concurrent.CompletableFuture; -import com.google.common.collect.ImmutableMap; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -48,10 +47,8 @@ import org.apache.pulsar.functions.api.Record; import org.apache.pulsar.functions.api.SerDe; import org.apache.pulsar.functions.instance.SinkRecord; import org.apache.pulsar.functions.source.TopicSchema; -import org.apache.pulsar.functions.utils.FunctionConfig; +import org.apache.pulsar.common.functions.FunctionConfig; import org.apache.pulsar.io.core.SinkContext; -import org.hamcrest.Description; -import org.hamcrest.Matcher; import org.mockito.ArgumentMatcher; import org.testng.Assert; import org.testng.annotations.BeforeMethod; diff --git a/pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/source/PulsarSourceTest.java b/pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/source/PulsarSourceTest.java index e4825f2..8e59e00 100644 --- a/pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/source/PulsarSourceTest.java +++ b/pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/source/PulsarSourceTest.java @@ -35,8 +35,6 @@ import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; -import javax.xml.validation.Schema; - import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -46,8 +44,8 @@ import org.apache.pulsar.client.api.ConsumerBuilder; import org.apache.pulsar.client.api.PulsarClientException; import org.apache.pulsar.client.impl.PulsarClientImpl; import org.apache.pulsar.functions.api.SerDe; -import org.apache.pulsar.functions.utils.ConsumerConfig; -import org.apache.pulsar.functions.utils.FunctionConfig; +import org.apache.pulsar.common.functions.ConsumerConfig; +import org.apache.pulsar.common.functions.FunctionConfig; import org.apache.pulsar.io.core.SourceContext; import org.testng.annotations.Test; diff --git a/pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/windowing/WindowFunctionExecutorTest.java b/pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/windowing/WindowFunctionExecutorTest.java index d12a7cf..0a52b74 100644 --- a/pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/windowing/WindowFunctionExecutorTest.java +++ b/pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/windowing/WindowFunctionExecutorTest.java @@ -23,7 +23,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.pulsar.functions.api.Context; import org.apache.pulsar.functions.api.Record; -import org.apache.pulsar.functions.utils.WindowConfig; +import org.apache.pulsar.common.functions.WindowConfig; import org.mockito.Mockito; import org.testng.Assert; import org.testng.annotations.AfterMethod; diff --git a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java b/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java index fa66214..0586a53 100644 --- a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java +++ b/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java @@ -22,6 +22,10 @@ package org.apache.pulsar.functions.utils; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import org.apache.commons.lang.StringUtils; +import org.apache.pulsar.common.functions.ConsumerConfig; +import org.apache.pulsar.common.functions.FunctionConfig; +import org.apache.pulsar.common.functions.Resources; +import org.apache.pulsar.common.functions.WindowConfig; import org.apache.pulsar.common.naming.TopicName; import org.apache.pulsar.functions.proto.Function; import org.apache.pulsar.functions.proto.Function.FunctionDetails; diff --git a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/ResourceConfigUtils.java b/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/ResourceConfigUtils.java index fc80b34..ee46ceb 100644 --- a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/ResourceConfigUtils.java +++ b/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/ResourceConfigUtils.java @@ -19,6 +19,8 @@ package org.apache.pulsar.functions.utils; +import org.apache.pulsar.common.functions.Resources; + public class ResourceConfigUtils { public static void validate(Resources resources) { Double cpu = resources.getCpu(); diff --git a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java b/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java index 4930b14..cea9dc7 100644 --- a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java +++ b/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java @@ -22,6 +22,10 @@ package org.apache.pulsar.functions.utils; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import org.apache.commons.lang.StringUtils; +import org.apache.pulsar.common.functions.ConsumerConfig; +import org.apache.pulsar.common.functions.FunctionConfig; +import org.apache.pulsar.common.functions.Resources; +import org.apache.pulsar.common.io.SinkConfig; import org.apache.pulsar.common.naming.TopicName; import org.apache.pulsar.common.nar.NarClassLoader; import org.apache.pulsar.functions.api.utils.IdentityFunction; diff --git a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfigUtils.java b/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfigUtils.java index 80287b1..8956ff4 100644 --- a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfigUtils.java +++ b/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfigUtils.java @@ -22,6 +22,8 @@ package org.apache.pulsar.functions.utils; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import org.apache.commons.lang3.StringUtils; +import org.apache.pulsar.common.functions.Resources; +import org.apache.pulsar.common.io.SourceConfig; import org.apache.pulsar.common.naming.TopicName; import org.apache.pulsar.common.nar.NarClassLoader; import org.apache.pulsar.functions.api.utils.IdentityFunction; diff --git a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/Utils.java b/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/Utils.java index 91f4835..92f3de6 100644 --- a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/Utils.java +++ b/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/Utils.java @@ -33,9 +33,9 @@ import java.nio.channels.ReadableByteChannel; import java.nio.file.Path; import java.util.Collection; import java.util.Collections; -import java.util.UUID; import org.apache.commons.lang3.StringUtils; +import org.apache.pulsar.common.functions.FunctionConfig; import org.apache.pulsar.common.nar.NarClassLoader; import org.apache.pulsar.functions.api.Function; import org.apache.pulsar.functions.proto.Function.FunctionDetails.Runtime; diff --git a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/WindowConfigUtils.java b/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/WindowConfigUtils.java index cf59a90..42a6b03 100644 --- a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/WindowConfigUtils.java +++ b/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/WindowConfigUtils.java @@ -19,6 +19,8 @@ package org.apache.pulsar.functions.utils; +import org.apache.pulsar.common.functions.WindowConfig; + public class WindowConfigUtils { public static void validate(WindowConfig windowConfig) { if (windowConfig.getWindowLengthDurationMs() == null && windowConfig.getWindowLengthCount() == null) { diff --git a/pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java b/pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java index 1f67798..36ab33d 100644 --- a/pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java +++ b/pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java @@ -19,6 +19,8 @@ package org.apache.pulsar.functions.utils; import com.google.gson.Gson; +import org.apache.pulsar.common.functions.ConsumerConfig; +import org.apache.pulsar.common.functions.FunctionConfig; import org.apache.pulsar.functions.api.utils.IdentityFunction; import org.apache.pulsar.functions.proto.Function; import org.testng.annotations.Test; diff --git a/pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SinkConfigUtilsTest.java b/pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SinkConfigUtilsTest.java index c5d1ea0..3c06f5b 100644 --- a/pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SinkConfigUtilsTest.java +++ b/pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SinkConfigUtilsTest.java @@ -19,6 +19,9 @@ package org.apache.pulsar.functions.utils; import com.google.gson.Gson; +import org.apache.pulsar.common.functions.ConsumerConfig; +import org.apache.pulsar.common.functions.FunctionConfig; +import org.apache.pulsar.common.io.SinkConfig; import org.apache.pulsar.functions.proto.Function; import org.testng.annotations.Test; diff --git a/pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SourceConfigUtilsTest.java b/pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SourceConfigUtilsTest.java index ef4ce61..e12c062 100644 --- a/pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SourceConfigUtilsTest.java +++ b/pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/SourceConfigUtilsTest.java @@ -19,6 +19,8 @@ package org.apache.pulsar.functions.utils; import com.google.gson.Gson; +import org.apache.pulsar.common.functions.FunctionConfig; +import org.apache.pulsar.common.io.SourceConfig; import org.apache.pulsar.functions.proto.Function; import org.testng.annotations.Test; diff --git a/pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/WindowConfigUtilsTest.java b/pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/WindowConfigUtilsTest.java index 7b9fc68..44d36ff 100644 --- a/pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/WindowConfigUtilsTest.java +++ b/pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/WindowConfigUtilsTest.java @@ -19,18 +19,9 @@ package org.apache.pulsar.functions.utils; -import com.google.gson.Gson; -import org.apache.pulsar.common.util.FutureUtil; -import org.apache.pulsar.functions.api.Context; -import org.apache.pulsar.functions.api.Record; -import org.mockito.Mockito; -import org.testng.Assert; +import org.apache.pulsar.common.functions.WindowConfig; import org.testng.annotations.Test; -import java.util.Collections; -import java.util.Map; -import java.util.Optional; - import static org.testng.Assert.fail; /** diff --git a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsImpl.java b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsImpl.java index d965c3c..11a10ab 100644 --- a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsImpl.java +++ b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsImpl.java @@ -68,7 +68,10 @@ import org.apache.pulsar.client.api.MessageId; import org.apache.pulsar.client.api.Producer; import org.apache.pulsar.client.api.Reader; import org.apache.pulsar.client.api.Schema; +import org.apache.pulsar.common.functions.FunctionConfig; import org.apache.pulsar.common.io.ConnectorDefinition; +import org.apache.pulsar.common.io.SinkConfig; +import org.apache.pulsar.common.io.SourceConfig; import org.apache.pulsar.common.nar.NarClassLoader; import org.apache.pulsar.common.policies.data.ErrorData; import org.apache.pulsar.common.policies.data.TenantInfo; diff --git a/pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/rest/api/v2/FunctionApiV2ResourceTest.java b/pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/rest/api/v2/FunctionApiV2ResourceTest.java index 296dba2..6c5e299 100644 --- a/pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/rest/api/v2/FunctionApiV2ResourceTest.java +++ b/pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/rest/api/v2/FunctionApiV2ResourceTest.java @@ -60,7 +60,7 @@ import org.apache.pulsar.functions.proto.Function.SourceSpec; import org.apache.pulsar.functions.proto.Function.SubscriptionType; import org.apache.pulsar.functions.runtime.RuntimeFactory; import org.apache.pulsar.functions.source.TopicSchema; -import org.apache.pulsar.functions.utils.FunctionConfig; +import org.apache.pulsar.common.functions.FunctionConfig; import org.apache.pulsar.functions.utils.FunctionConfigUtils; import org.apache.pulsar.functions.worker.*; import org.apache.pulsar.functions.worker.request.RequestResult; diff --git a/pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/rest/api/v2/SinkApiV2ResourceTest.java b/pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/rest/api/v2/SinkApiV2ResourceTest.java index 3325349..52ad7f2 100644 --- a/pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/rest/api/v2/SinkApiV2ResourceTest.java +++ b/pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/rest/api/v2/SinkApiV2ResourceTest.java @@ -33,7 +33,7 @@ import org.apache.pulsar.functions.proto.Function.FunctionDetails; import org.apache.pulsar.functions.proto.Function.FunctionMetaData; import org.apache.pulsar.functions.runtime.RuntimeFactory; import org.apache.pulsar.functions.source.TopicSchema; -import org.apache.pulsar.functions.utils.SinkConfig; +import org.apache.pulsar.common.io.SinkConfig; import org.apache.pulsar.functions.utils.SinkConfigUtils; import org.apache.pulsar.functions.worker.*; import org.apache.pulsar.functions.worker.request.RequestResult; @@ -61,7 +61,6 @@ import java.util.Map; import java.util.concurrent.CompletableFuture; import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyBoolean; import static org.mockito.Matchers.anyObject; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; diff --git a/pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/rest/api/v2/SourceApiV2ResourceTest.java b/pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/rest/api/v2/SourceApiV2ResourceTest.java index d11cf7e..f2ada5c 100644 --- a/pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/rest/api/v2/SourceApiV2ResourceTest.java +++ b/pulsar-functions/worker/src/test/java/org/apache/pulsar/functions/worker/rest/api/v2/SourceApiV2ResourceTest.java @@ -31,7 +31,7 @@ import org.apache.pulsar.functions.api.utils.IdentityFunction; import org.apache.pulsar.functions.proto.Function.*; import org.apache.pulsar.functions.runtime.RuntimeFactory; import org.apache.pulsar.functions.source.TopicSchema; -import org.apache.pulsar.functions.utils.SourceConfig; +import org.apache.pulsar.common.io.SourceConfig; import org.apache.pulsar.functions.utils.SourceConfigUtils; import org.apache.pulsar.functions.worker.*; import org.apache.pulsar.functions.worker.request.RequestResult;