From 4733db7b9f0081136cae088adbea7c1c4ec72d2e Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Fri, 19 Jan 2024 18:39:40 -0800 Subject: [PATCH] Refactor TypedFunction, ObjectProcessor, and ObjectProcessorFunctions (#4992) * `io.deephaven.functions` renamed to `io.deephaven.function`, moved to `util/function/`, `:util-function` project * `io.deephaven.processor` moved to `engine/processor/`, `:engine-processor` project * `io.deephaven.processor.functions` renamed to `io.deephaven.processor.function`, moved to `engine/processor-function/`, `:engine-processor-function` project --- Util/function/build.gradle | 19 +++ Util/function/gradle.properties | 1 + .../deephaven/function}/BooleanFunctions.java | 2 +- .../io/deephaven/function}/ByteFunctions.java | 2 +- .../io/deephaven/function}/CharFunctions.java | 2 +- .../deephaven/function}/DoubleFunctions.java | 2 +- .../deephaven/function}/FloatFunctions.java | 2 +- .../io/deephaven/function}/IntFunctions.java | 2 +- .../io/deephaven/function}/LongFunctions.java | 2 +- .../deephaven/function}/ObjectFunctions.java | 2 +- .../function}/PrimitiveFunctions.java | 2 +- .../deephaven/function}/ShortFunctions.java | 2 +- .../function}/ToBooleanFunction.java | 2 +- .../deephaven/function}/ToByteFunction.java | 2 +- .../deephaven/function}/ToCharFunction.java | 2 +- .../deephaven/function}/ToDoubleFunction.java | 2 +- .../deephaven/function}/ToFloatFunction.java | 2 +- .../io/deephaven/function}/ToIntFunction.java | 2 +- .../deephaven/function}/ToLongFunction.java | 2 +- .../deephaven/function}/ToObjectFunction.java | 2 +- .../function}/ToPrimitiveFunction.java | 2 +- .../deephaven/function}/ToShortFunction.java | 2 +- .../io/deephaven/function}/TypedFunction.java | 2 +- .../deephaven/function}/TypedFunctions.java | 2 +- .../function}/ToBooleanFunctionTest.java | 14 +-- .../function}/ToByteFunctionTest.java | 4 +- .../function}/ToCharFunctionTest.java | 4 +- .../function}/ToDoubleFunctionTest.java | 4 +- .../function}/ToFloatFunctionTest.java | 4 +- .../function}/ToIntFunctionTest.java | 4 +- .../function}/ToLongFunctionTest.java | 4 +- .../function}/ToObjectFunctionTest.java | 4 +- .../function}/ToShortFunctionTest.java | 4 +- .../build.gradle | 0 .../gradle.properties | 0 .../deephaven/annotations/BuildableStyle.java | 0 .../io/deephaven/annotations/SimpleStyle.java | 0 .../deephaven/annotations/SingletonStyle.java | 0 engine/processor-function/build.gradle | 21 ++++ engine/processor-function/gradle.properties | 1 + .../processor/function}/ChunkUtils.java | 12 +- .../function}/ObjectProcessorFunctions.java | 4 +- .../ObjectProcessorFunctionsImpl.java | 25 ++-- .../ObjectProcessorFunctionsTest.java | 39 +++--- engine/processor/build.gradle | 19 +++ engine/processor/gradle.properties | 1 + .../deephaven/processor/ObjectProcessor.java | 2 +- .../processor/ObjectProcessorNoop.java | 0 .../processor/ObjectProcessorRowLimited.java | 0 .../processor/ObjectProcessorStrict.java | 0 .../processor/ObjectProcessorTypes.java | 0 .../processor/ObjectProcessorNoopTest.java | 2 +- .../ObjectProcessorRowLimitedTest.java | 2 +- .../processor/ObjectProcessorStrictTest.java | 2 +- .../processor/ObjectProcessorTest.java | 2 +- extensions/kafka/build.gradle | 3 + .../java/io/deephaven/kafka/BoxTransform.java | 22 ++-- .../kafka/DhNullableTypeTransform.java | 22 ++-- .../io/deephaven/kafka/NullFunctions.java | 22 ++-- .../java/io/deephaven/kafka/ProtobufImpl.java | 6 +- .../deephaven/kafka/ToChunkTypeTransform.java | 10 +- .../io/deephaven/kafka/UnboxTransform.java | 20 +-- .../kafka/ingest/BooleanFieldCopier.java | 33 ----- .../kafka/ingest/ByteFieldCopier.java | 44 ------- .../kafka/ingest/CharFieldCopier.java | 39 ------ .../kafka/ingest/DoubleFieldCopier.java | 39 ------ .../kafka/ingest/FieldCopierAdapter.java | 115 +----------------- .../ingest/FieldCopierProcessorImpl.java | 33 +++++ .../kafka/ingest/FloatFieldCopier.java | 39 ------ .../kafka/ingest/IntFieldCopier.java | 39 ------ .../kafka/ingest/LongFieldCopier.java | 39 ------ .../kafka/ingest/ObjectFieldCopier.java | 33 ----- .../kafka/ingest/ShortFieldCopier.java | 39 ------ extensions/protobuf/build.gradle | 1 + .../main/java/io/deephaven/protobuf/Box.java | 24 ++-- .../java/io/deephaven/protobuf/Builtin.java | 12 +- .../io/deephaven/protobuf/BypassOnNull.java | 22 ++-- .../java/io/deephaven/protobuf/FieldPath.java | 2 +- .../io/deephaven/protobuf/MessageParser.java | 2 +- .../protobuf/MessageParserSingle.java | 2 +- .../ProtobufDescriptorParserImpl.java | 24 ++-- .../deephaven/protobuf/ProtobufFunction.java | 2 +- .../deephaven/protobuf/ProtobufFunctions.java | 2 +- .../protobuf/ByteWrapperCustomType.java | 6 +- .../io/deephaven/protobuf/FieldPathTest.java | 2 +- .../ProtobufDescriptorParserTest.java | 6 +- settings.gradle | 11 +- 87 files changed, 314 insertions(+), 643 deletions(-) create mode 100644 Util/function/build.gradle create mode 100644 Util/function/gradle.properties rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/BooleanFunctions.java (99%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/ByteFunctions.java (97%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/CharFunctions.java (97%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/DoubleFunctions.java (98%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/FloatFunctions.java (97%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/IntFunctions.java (97%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/LongFunctions.java (97%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/ObjectFunctions.java (99%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/PrimitiveFunctions.java (98%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/ShortFunctions.java (97%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/ToBooleanFunction.java (99%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/ToByteFunction.java (97%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/ToCharFunction.java (97%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/ToDoubleFunction.java (97%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/ToFloatFunction.java (97%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/ToIntFunction.java (97%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/ToLongFunction.java (97%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/ToObjectFunction.java (99%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/ToPrimitiveFunction.java (97%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/ToShortFunction.java (97%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/TypedFunction.java (95%) rename {extensions/protobuf/src/main/java/io/deephaven/functions => Util/function/src/main/java/io/deephaven/function}/TypedFunctions.java (97%) rename {extensions/protobuf/src/test/java/io/deephaven/functions => Util/function/src/test/java/io/deephaven/function}/ToBooleanFunctionTest.java (92%) rename {extensions/protobuf/src/test/java/io/deephaven/functions => Util/function/src/test/java/io/deephaven/function}/ToByteFunctionTest.java (84%) rename {extensions/protobuf/src/test/java/io/deephaven/functions => Util/function/src/test/java/io/deephaven/function}/ToCharFunctionTest.java (84%) rename {extensions/protobuf/src/test/java/io/deephaven/functions => Util/function/src/test/java/io/deephaven/function}/ToDoubleFunctionTest.java (81%) rename {extensions/protobuf/src/test/java/io/deephaven/functions => Util/function/src/test/java/io/deephaven/function}/ToFloatFunctionTest.java (81%) rename {extensions/protobuf/src/test/java/io/deephaven/functions => Util/function/src/test/java/io/deephaven/function}/ToIntFunctionTest.java (81%) rename {extensions/protobuf/src/test/java/io/deephaven/functions => Util/function/src/test/java/io/deephaven/function}/ToLongFunctionTest.java (81%) rename {extensions/protobuf/src/test/java/io/deephaven/functions => Util/function/src/test/java/io/deephaven/function}/ToObjectFunctionTest.java (88%) rename {extensions/protobuf/src/test/java/io/deephaven/functions => Util/function/src/test/java/io/deephaven/function}/ToShortFunctionTest.java (82%) rename Util/{util-immutables => immutables}/build.gradle (100%) rename Util/{util-immutables => immutables}/gradle.properties (100%) rename Util/{util-immutables => immutables}/src/main/java/io/deephaven/annotations/BuildableStyle.java (100%) rename Util/{util-immutables => immutables}/src/main/java/io/deephaven/annotations/SimpleStyle.java (100%) rename Util/{util-immutables => immutables}/src/main/java/io/deephaven/annotations/SingletonStyle.java (100%) create mode 100644 engine/processor-function/build.gradle create mode 100644 engine/processor-function/gradle.properties rename {extensions/kafka/src/main/java/io/deephaven/kafka/ingest => engine/processor-function/src/main/java/io/deephaven/processor/function}/ChunkUtils.java (94%) rename {extensions/kafka/src/main/java/io/deephaven/processor/functions => engine/processor-function/src/main/java/io/deephaven/processor/function}/ObjectProcessorFunctions.java (90%) rename {extensions/kafka/src/main/java/io/deephaven/processor/functions => engine/processor-function/src/main/java/io/deephaven/processor/function}/ObjectProcessorFunctionsImpl.java (95%) rename {extensions/kafka/src/test/java/io/deephaven/processor/functions => engine/processor-function/src/test/java/io/deephaven/processor/function}/ObjectProcessorFunctionsTest.java (84%) create mode 100644 engine/processor/build.gradle create mode 100644 engine/processor/gradle.properties rename {extensions/kafka => engine/processor}/src/main/java/io/deephaven/processor/ObjectProcessor.java (98%) rename {extensions/kafka => engine/processor}/src/main/java/io/deephaven/processor/ObjectProcessorNoop.java (100%) rename {extensions/kafka => engine/processor}/src/main/java/io/deephaven/processor/ObjectProcessorRowLimited.java (100%) rename {extensions/kafka => engine/processor}/src/main/java/io/deephaven/processor/ObjectProcessorStrict.java (100%) rename {extensions/kafka => engine/processor}/src/main/java/io/deephaven/processor/ObjectProcessorTypes.java (100%) rename {extensions/kafka => engine/processor}/src/test/java/io/deephaven/processor/ObjectProcessorNoopTest.java (99%) rename {extensions/kafka => engine/processor}/src/test/java/io/deephaven/processor/ObjectProcessorRowLimitedTest.java (98%) rename {extensions/kafka => engine/processor}/src/test/java/io/deephaven/processor/ObjectProcessorStrictTest.java (99%) rename {extensions/kafka => engine/processor}/src/test/java/io/deephaven/processor/ObjectProcessorTest.java (98%) delete mode 100644 extensions/kafka/src/main/java/io/deephaven/kafka/ingest/BooleanFieldCopier.java delete mode 100644 extensions/kafka/src/main/java/io/deephaven/kafka/ingest/ByteFieldCopier.java delete mode 100644 extensions/kafka/src/main/java/io/deephaven/kafka/ingest/CharFieldCopier.java delete mode 100644 extensions/kafka/src/main/java/io/deephaven/kafka/ingest/DoubleFieldCopier.java create mode 100644 extensions/kafka/src/main/java/io/deephaven/kafka/ingest/FieldCopierProcessorImpl.java delete mode 100644 extensions/kafka/src/main/java/io/deephaven/kafka/ingest/FloatFieldCopier.java delete mode 100644 extensions/kafka/src/main/java/io/deephaven/kafka/ingest/IntFieldCopier.java delete mode 100644 extensions/kafka/src/main/java/io/deephaven/kafka/ingest/LongFieldCopier.java delete mode 100644 extensions/kafka/src/main/java/io/deephaven/kafka/ingest/ObjectFieldCopier.java delete mode 100644 extensions/kafka/src/main/java/io/deephaven/kafka/ingest/ShortFieldCopier.java diff --git a/Util/function/build.gradle b/Util/function/build.gradle new file mode 100644 index 00000000000..74f3394075c --- /dev/null +++ b/Util/function/build.gradle @@ -0,0 +1,19 @@ +plugins { + id 'java-library' + id 'io.deephaven.project.register' +} + +dependencies { + api project(':qst-type') + + compileOnly depAnnotations + + Classpaths.inheritJUnitPlatform(project) + Classpaths.inheritAssertJ(project) + testImplementation 'org.junit.jupiter:junit-jupiter' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' +} + +test { + useJUnitPlatform() +} diff --git a/Util/function/gradle.properties b/Util/function/gradle.properties new file mode 100644 index 00000000000..c186bbfdde1 --- /dev/null +++ b/Util/function/gradle.properties @@ -0,0 +1 @@ +io.deephaven.project.ProjectType=JAVA_PUBLIC diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/BooleanFunctions.java b/Util/function/src/main/java/io/deephaven/function/BooleanFunctions.java similarity index 99% rename from extensions/protobuf/src/main/java/io/deephaven/functions/BooleanFunctions.java rename to Util/function/src/main/java/io/deephaven/function/BooleanFunctions.java index f64cd61a474..7856b2fdabb 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/BooleanFunctions.java +++ b/Util/function/src/main/java/io/deephaven/function/BooleanFunctions.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import org.jetbrains.annotations.NotNull; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/ByteFunctions.java b/Util/function/src/main/java/io/deephaven/function/ByteFunctions.java similarity index 97% rename from extensions/protobuf/src/main/java/io/deephaven/functions/ByteFunctions.java rename to Util/function/src/main/java/io/deephaven/function/ByteFunctions.java index d44cef49b45..7aeb0aa5231 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/ByteFunctions.java +++ b/Util/function/src/main/java/io/deephaven/function/ByteFunctions.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import java.util.Objects; import java.util.function.Function; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/CharFunctions.java b/Util/function/src/main/java/io/deephaven/function/CharFunctions.java similarity index 97% rename from extensions/protobuf/src/main/java/io/deephaven/functions/CharFunctions.java rename to Util/function/src/main/java/io/deephaven/function/CharFunctions.java index 428465ff8e8..cff3d37d742 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/CharFunctions.java +++ b/Util/function/src/main/java/io/deephaven/function/CharFunctions.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import java.util.Objects; import java.util.function.Function; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/DoubleFunctions.java b/Util/function/src/main/java/io/deephaven/function/DoubleFunctions.java similarity index 98% rename from extensions/protobuf/src/main/java/io/deephaven/functions/DoubleFunctions.java rename to Util/function/src/main/java/io/deephaven/function/DoubleFunctions.java index f1fab905a14..2b18947fde1 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/DoubleFunctions.java +++ b/Util/function/src/main/java/io/deephaven/function/DoubleFunctions.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import java.util.Objects; import java.util.function.Function; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/FloatFunctions.java b/Util/function/src/main/java/io/deephaven/function/FloatFunctions.java similarity index 97% rename from extensions/protobuf/src/main/java/io/deephaven/functions/FloatFunctions.java rename to Util/function/src/main/java/io/deephaven/function/FloatFunctions.java index 5e8c6d35f03..9fbfa53260e 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/FloatFunctions.java +++ b/Util/function/src/main/java/io/deephaven/function/FloatFunctions.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import java.util.Objects; import java.util.function.Function; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/IntFunctions.java b/Util/function/src/main/java/io/deephaven/function/IntFunctions.java similarity index 97% rename from extensions/protobuf/src/main/java/io/deephaven/functions/IntFunctions.java rename to Util/function/src/main/java/io/deephaven/function/IntFunctions.java index f707d16f654..2b1f8b7d917 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/IntFunctions.java +++ b/Util/function/src/main/java/io/deephaven/function/IntFunctions.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import java.util.Objects; import java.util.function.Function; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/LongFunctions.java b/Util/function/src/main/java/io/deephaven/function/LongFunctions.java similarity index 97% rename from extensions/protobuf/src/main/java/io/deephaven/functions/LongFunctions.java rename to Util/function/src/main/java/io/deephaven/function/LongFunctions.java index 30ba0608f65..adce8bea481 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/LongFunctions.java +++ b/Util/function/src/main/java/io/deephaven/function/LongFunctions.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import java.util.Objects; import java.util.function.Function; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/ObjectFunctions.java b/Util/function/src/main/java/io/deephaven/function/ObjectFunctions.java similarity index 99% rename from extensions/protobuf/src/main/java/io/deephaven/functions/ObjectFunctions.java rename to Util/function/src/main/java/io/deephaven/function/ObjectFunctions.java index 951441a0e09..f2a18263a9f 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/ObjectFunctions.java +++ b/Util/function/src/main/java/io/deephaven/function/ObjectFunctions.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import io.deephaven.qst.type.CustomType; import io.deephaven.qst.type.GenericType; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/PrimitiveFunctions.java b/Util/function/src/main/java/io/deephaven/function/PrimitiveFunctions.java similarity index 98% rename from extensions/protobuf/src/main/java/io/deephaven/functions/PrimitiveFunctions.java rename to Util/function/src/main/java/io/deephaven/function/PrimitiveFunctions.java index c4ba0015685..7a00b4ef090 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/PrimitiveFunctions.java +++ b/Util/function/src/main/java/io/deephaven/function/PrimitiveFunctions.java @@ -1,4 +1,4 @@ -package io.deephaven.functions; +package io.deephaven.function; import java.util.Objects; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/ShortFunctions.java b/Util/function/src/main/java/io/deephaven/function/ShortFunctions.java similarity index 97% rename from extensions/protobuf/src/main/java/io/deephaven/functions/ShortFunctions.java rename to Util/function/src/main/java/io/deephaven/function/ShortFunctions.java index efe8543f915..75e1e6fb1e0 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/ShortFunctions.java +++ b/Util/function/src/main/java/io/deephaven/function/ShortFunctions.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import java.util.Objects; import java.util.function.Function; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/ToBooleanFunction.java b/Util/function/src/main/java/io/deephaven/function/ToBooleanFunction.java similarity index 99% rename from extensions/protobuf/src/main/java/io/deephaven/functions/ToBooleanFunction.java rename to Util/function/src/main/java/io/deephaven/function/ToBooleanFunction.java index 11c727a0398..cfbdc5c6f79 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/ToBooleanFunction.java +++ b/Util/function/src/main/java/io/deephaven/function/ToBooleanFunction.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import io.deephaven.qst.type.BooleanType; import io.deephaven.qst.type.Type; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/ToByteFunction.java b/Util/function/src/main/java/io/deephaven/function/ToByteFunction.java similarity index 97% rename from extensions/protobuf/src/main/java/io/deephaven/functions/ToByteFunction.java rename to Util/function/src/main/java/io/deephaven/function/ToByteFunction.java index 511938a68e2..3ce8b3f6d5b 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/ToByteFunction.java +++ b/Util/function/src/main/java/io/deephaven/function/ToByteFunction.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import io.deephaven.qst.type.ByteType; import io.deephaven.qst.type.Type; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/ToCharFunction.java b/Util/function/src/main/java/io/deephaven/function/ToCharFunction.java similarity index 97% rename from extensions/protobuf/src/main/java/io/deephaven/functions/ToCharFunction.java rename to Util/function/src/main/java/io/deephaven/function/ToCharFunction.java index 6e6cbc30bfb..e53aa3e7f39 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/ToCharFunction.java +++ b/Util/function/src/main/java/io/deephaven/function/ToCharFunction.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import io.deephaven.qst.type.CharType; import io.deephaven.qst.type.Type; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/ToDoubleFunction.java b/Util/function/src/main/java/io/deephaven/function/ToDoubleFunction.java similarity index 97% rename from extensions/protobuf/src/main/java/io/deephaven/functions/ToDoubleFunction.java rename to Util/function/src/main/java/io/deephaven/function/ToDoubleFunction.java index 46a20e0e2c9..e478a4d1fa0 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/ToDoubleFunction.java +++ b/Util/function/src/main/java/io/deephaven/function/ToDoubleFunction.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import io.deephaven.qst.type.DoubleType; import io.deephaven.qst.type.Type; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/ToFloatFunction.java b/Util/function/src/main/java/io/deephaven/function/ToFloatFunction.java similarity index 97% rename from extensions/protobuf/src/main/java/io/deephaven/functions/ToFloatFunction.java rename to Util/function/src/main/java/io/deephaven/function/ToFloatFunction.java index ad131d34105..cb5119ad423 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/ToFloatFunction.java +++ b/Util/function/src/main/java/io/deephaven/function/ToFloatFunction.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import io.deephaven.qst.type.FloatType; import io.deephaven.qst.type.Type; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/ToIntFunction.java b/Util/function/src/main/java/io/deephaven/function/ToIntFunction.java similarity index 97% rename from extensions/protobuf/src/main/java/io/deephaven/functions/ToIntFunction.java rename to Util/function/src/main/java/io/deephaven/function/ToIntFunction.java index 4bf7f603230..2daf02b18fa 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/ToIntFunction.java +++ b/Util/function/src/main/java/io/deephaven/function/ToIntFunction.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import io.deephaven.qst.type.IntType; import io.deephaven.qst.type.Type; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/ToLongFunction.java b/Util/function/src/main/java/io/deephaven/function/ToLongFunction.java similarity index 97% rename from extensions/protobuf/src/main/java/io/deephaven/functions/ToLongFunction.java rename to Util/function/src/main/java/io/deephaven/function/ToLongFunction.java index 674431642dc..73214f82fb2 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/ToLongFunction.java +++ b/Util/function/src/main/java/io/deephaven/function/ToLongFunction.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import io.deephaven.qst.type.LongType; import io.deephaven.qst.type.Type; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/ToObjectFunction.java b/Util/function/src/main/java/io/deephaven/function/ToObjectFunction.java similarity index 99% rename from extensions/protobuf/src/main/java/io/deephaven/functions/ToObjectFunction.java rename to Util/function/src/main/java/io/deephaven/function/ToObjectFunction.java index 80b61870ea9..79adadcb269 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/ToObjectFunction.java +++ b/Util/function/src/main/java/io/deephaven/function/ToObjectFunction.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import io.deephaven.qst.type.GenericType; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/ToPrimitiveFunction.java b/Util/function/src/main/java/io/deephaven/function/ToPrimitiveFunction.java similarity index 97% rename from extensions/protobuf/src/main/java/io/deephaven/functions/ToPrimitiveFunction.java rename to Util/function/src/main/java/io/deephaven/function/ToPrimitiveFunction.java index 6d0c6b6b8c9..b1450838532 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/ToPrimitiveFunction.java +++ b/Util/function/src/main/java/io/deephaven/function/ToPrimitiveFunction.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import io.deephaven.qst.type.PrimitiveType; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/ToShortFunction.java b/Util/function/src/main/java/io/deephaven/function/ToShortFunction.java similarity index 97% rename from extensions/protobuf/src/main/java/io/deephaven/functions/ToShortFunction.java rename to Util/function/src/main/java/io/deephaven/function/ToShortFunction.java index 7c4810a78ec..4ba6ab930f9 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/ToShortFunction.java +++ b/Util/function/src/main/java/io/deephaven/function/ToShortFunction.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import io.deephaven.qst.type.ShortType; import io.deephaven.qst.type.Type; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/TypedFunction.java b/Util/function/src/main/java/io/deephaven/function/TypedFunction.java similarity index 95% rename from extensions/protobuf/src/main/java/io/deephaven/functions/TypedFunction.java rename to Util/function/src/main/java/io/deephaven/function/TypedFunction.java index 71894b1266e..6a700dc3210 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/TypedFunction.java +++ b/Util/function/src/main/java/io/deephaven/function/TypedFunction.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.functions; +package io.deephaven.function; import io.deephaven.qst.type.Type; diff --git a/extensions/protobuf/src/main/java/io/deephaven/functions/TypedFunctions.java b/Util/function/src/main/java/io/deephaven/function/TypedFunctions.java similarity index 97% rename from extensions/protobuf/src/main/java/io/deephaven/functions/TypedFunctions.java rename to Util/function/src/main/java/io/deephaven/function/TypedFunctions.java index 46d9bbeeb02..f2a9d0001a2 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/functions/TypedFunctions.java +++ b/Util/function/src/main/java/io/deephaven/function/TypedFunctions.java @@ -1,4 +1,4 @@ -package io.deephaven.functions; +package io.deephaven.function; import java.util.Objects; diff --git a/extensions/protobuf/src/test/java/io/deephaven/functions/ToBooleanFunctionTest.java b/Util/function/src/test/java/io/deephaven/function/ToBooleanFunctionTest.java similarity index 92% rename from extensions/protobuf/src/test/java/io/deephaven/functions/ToBooleanFunctionTest.java rename to Util/function/src/test/java/io/deephaven/function/ToBooleanFunctionTest.java index 316bf10dff0..1681527cffa 100644 --- a/extensions/protobuf/src/test/java/io/deephaven/functions/ToBooleanFunctionTest.java +++ b/Util/function/src/test/java/io/deephaven/function/ToBooleanFunctionTest.java @@ -1,15 +1,15 @@ -package io.deephaven.functions; +package io.deephaven.function; import org.junit.jupiter.api.Test; import java.util.List; -import static io.deephaven.functions.ToBooleanFunction.and; -import static io.deephaven.functions.ToBooleanFunction.map; -import static io.deephaven.functions.ToBooleanFunction.not; -import static io.deephaven.functions.ToBooleanFunction.ofFalse; -import static io.deephaven.functions.ToBooleanFunction.ofTrue; -import static io.deephaven.functions.ToBooleanFunction.or; +import static io.deephaven.function.ToBooleanFunction.and; +import static io.deephaven.function.ToBooleanFunction.map; +import static io.deephaven.function.ToBooleanFunction.not; +import static io.deephaven.function.ToBooleanFunction.ofFalse; +import static io.deephaven.function.ToBooleanFunction.ofTrue; +import static io.deephaven.function.ToBooleanFunction.or; import static org.assertj.core.api.Assertions.assertThat; public class ToBooleanFunctionTest { diff --git a/extensions/protobuf/src/test/java/io/deephaven/functions/ToByteFunctionTest.java b/Util/function/src/test/java/io/deephaven/function/ToByteFunctionTest.java similarity index 84% rename from extensions/protobuf/src/test/java/io/deephaven/functions/ToByteFunctionTest.java rename to Util/function/src/test/java/io/deephaven/function/ToByteFunctionTest.java index 612e24fb0c6..cde2254fa2d 100644 --- a/extensions/protobuf/src/test/java/io/deephaven/functions/ToByteFunctionTest.java +++ b/Util/function/src/test/java/io/deephaven/function/ToByteFunctionTest.java @@ -1,8 +1,8 @@ -package io.deephaven.functions; +package io.deephaven.function; import org.junit.jupiter.api.Test; -import static io.deephaven.functions.ToByteFunction.map; +import static io.deephaven.function.ToByteFunction.map; import static org.assertj.core.api.Assertions.assertThat; public class ToByteFunctionTest { diff --git a/extensions/protobuf/src/test/java/io/deephaven/functions/ToCharFunctionTest.java b/Util/function/src/test/java/io/deephaven/function/ToCharFunctionTest.java similarity index 84% rename from extensions/protobuf/src/test/java/io/deephaven/functions/ToCharFunctionTest.java rename to Util/function/src/test/java/io/deephaven/function/ToCharFunctionTest.java index 551ed87ce46..77b3d25a03f 100644 --- a/extensions/protobuf/src/test/java/io/deephaven/functions/ToCharFunctionTest.java +++ b/Util/function/src/test/java/io/deephaven/function/ToCharFunctionTest.java @@ -1,8 +1,8 @@ -package io.deephaven.functions; +package io.deephaven.function; import org.junit.jupiter.api.Test; -import static io.deephaven.functions.ToCharFunction.map; +import static io.deephaven.function.ToCharFunction.map; import static org.assertj.core.api.Assertions.assertThat; public class ToCharFunctionTest { diff --git a/extensions/protobuf/src/test/java/io/deephaven/functions/ToDoubleFunctionTest.java b/Util/function/src/test/java/io/deephaven/function/ToDoubleFunctionTest.java similarity index 81% rename from extensions/protobuf/src/test/java/io/deephaven/functions/ToDoubleFunctionTest.java rename to Util/function/src/test/java/io/deephaven/function/ToDoubleFunctionTest.java index 40fdc738c09..7c6765f7855 100644 --- a/extensions/protobuf/src/test/java/io/deephaven/functions/ToDoubleFunctionTest.java +++ b/Util/function/src/test/java/io/deephaven/function/ToDoubleFunctionTest.java @@ -1,8 +1,8 @@ -package io.deephaven.functions; +package io.deephaven.function; import org.junit.jupiter.api.Test; -import static io.deephaven.functions.ToDoubleFunction.map; +import static io.deephaven.function.ToDoubleFunction.map; import static org.assertj.core.api.Assertions.assertThat; public class ToDoubleFunctionTest { diff --git a/extensions/protobuf/src/test/java/io/deephaven/functions/ToFloatFunctionTest.java b/Util/function/src/test/java/io/deephaven/function/ToFloatFunctionTest.java similarity index 81% rename from extensions/protobuf/src/test/java/io/deephaven/functions/ToFloatFunctionTest.java rename to Util/function/src/test/java/io/deephaven/function/ToFloatFunctionTest.java index c408030d40b..36a887140a2 100644 --- a/extensions/protobuf/src/test/java/io/deephaven/functions/ToFloatFunctionTest.java +++ b/Util/function/src/test/java/io/deephaven/function/ToFloatFunctionTest.java @@ -1,8 +1,8 @@ -package io.deephaven.functions; +package io.deephaven.function; import org.junit.jupiter.api.Test; -import static io.deephaven.functions.ToFloatFunction.map; +import static io.deephaven.function.ToFloatFunction.map; import static org.assertj.core.api.Assertions.assertThat; public class ToFloatFunctionTest { diff --git a/extensions/protobuf/src/test/java/io/deephaven/functions/ToIntFunctionTest.java b/Util/function/src/test/java/io/deephaven/function/ToIntFunctionTest.java similarity index 81% rename from extensions/protobuf/src/test/java/io/deephaven/functions/ToIntFunctionTest.java rename to Util/function/src/test/java/io/deephaven/function/ToIntFunctionTest.java index b2d2c80f314..55d4635eee5 100644 --- a/extensions/protobuf/src/test/java/io/deephaven/functions/ToIntFunctionTest.java +++ b/Util/function/src/test/java/io/deephaven/function/ToIntFunctionTest.java @@ -1,8 +1,8 @@ -package io.deephaven.functions; +package io.deephaven.function; import org.junit.jupiter.api.Test; -import static io.deephaven.functions.ToIntFunction.map; +import static io.deephaven.function.ToIntFunction.map; import static org.assertj.core.api.Assertions.assertThat; public class ToIntFunctionTest { diff --git a/extensions/protobuf/src/test/java/io/deephaven/functions/ToLongFunctionTest.java b/Util/function/src/test/java/io/deephaven/function/ToLongFunctionTest.java similarity index 81% rename from extensions/protobuf/src/test/java/io/deephaven/functions/ToLongFunctionTest.java rename to Util/function/src/test/java/io/deephaven/function/ToLongFunctionTest.java index 10847dbd72c..9b846f6d0a6 100644 --- a/extensions/protobuf/src/test/java/io/deephaven/functions/ToLongFunctionTest.java +++ b/Util/function/src/test/java/io/deephaven/function/ToLongFunctionTest.java @@ -1,8 +1,8 @@ -package io.deephaven.functions; +package io.deephaven.function; import org.junit.jupiter.api.Test; -import static io.deephaven.functions.ToLongFunction.map; +import static io.deephaven.function.ToLongFunction.map; import static org.assertj.core.api.Assertions.assertThat; public class ToLongFunctionTest { diff --git a/extensions/protobuf/src/test/java/io/deephaven/functions/ToObjectFunctionTest.java b/Util/function/src/test/java/io/deephaven/function/ToObjectFunctionTest.java similarity index 88% rename from extensions/protobuf/src/test/java/io/deephaven/functions/ToObjectFunctionTest.java rename to Util/function/src/test/java/io/deephaven/function/ToObjectFunctionTest.java index 4aac140c0ee..e341b3c1c9f 100644 --- a/extensions/protobuf/src/test/java/io/deephaven/functions/ToObjectFunctionTest.java +++ b/Util/function/src/test/java/io/deephaven/function/ToObjectFunctionTest.java @@ -1,9 +1,9 @@ -package io.deephaven.functions; +package io.deephaven.function; import io.deephaven.qst.type.Type; import org.junit.jupiter.api.Test; -import static io.deephaven.functions.ToObjectFunction.map; +import static io.deephaven.function.ToObjectFunction.map; import static org.assertj.core.api.Assertions.assertThat; public class ToObjectFunctionTest { diff --git a/extensions/protobuf/src/test/java/io/deephaven/functions/ToShortFunctionTest.java b/Util/function/src/test/java/io/deephaven/function/ToShortFunctionTest.java similarity index 82% rename from extensions/protobuf/src/test/java/io/deephaven/functions/ToShortFunctionTest.java rename to Util/function/src/test/java/io/deephaven/function/ToShortFunctionTest.java index 9c70b949d11..9cf838ac17b 100644 --- a/extensions/protobuf/src/test/java/io/deephaven/functions/ToShortFunctionTest.java +++ b/Util/function/src/test/java/io/deephaven/function/ToShortFunctionTest.java @@ -1,8 +1,8 @@ -package io.deephaven.functions; +package io.deephaven.function; import org.junit.jupiter.api.Test; -import static io.deephaven.functions.ToShortFunction.map; +import static io.deephaven.function.ToShortFunction.map; import static org.assertj.core.api.Assertions.assertThat; public class ToShortFunctionTest { diff --git a/Util/util-immutables/build.gradle b/Util/immutables/build.gradle similarity index 100% rename from Util/util-immutables/build.gradle rename to Util/immutables/build.gradle diff --git a/Util/util-immutables/gradle.properties b/Util/immutables/gradle.properties similarity index 100% rename from Util/util-immutables/gradle.properties rename to Util/immutables/gradle.properties diff --git a/Util/util-immutables/src/main/java/io/deephaven/annotations/BuildableStyle.java b/Util/immutables/src/main/java/io/deephaven/annotations/BuildableStyle.java similarity index 100% rename from Util/util-immutables/src/main/java/io/deephaven/annotations/BuildableStyle.java rename to Util/immutables/src/main/java/io/deephaven/annotations/BuildableStyle.java diff --git a/Util/util-immutables/src/main/java/io/deephaven/annotations/SimpleStyle.java b/Util/immutables/src/main/java/io/deephaven/annotations/SimpleStyle.java similarity index 100% rename from Util/util-immutables/src/main/java/io/deephaven/annotations/SimpleStyle.java rename to Util/immutables/src/main/java/io/deephaven/annotations/SimpleStyle.java diff --git a/Util/util-immutables/src/main/java/io/deephaven/annotations/SingletonStyle.java b/Util/immutables/src/main/java/io/deephaven/annotations/SingletonStyle.java similarity index 100% rename from Util/util-immutables/src/main/java/io/deephaven/annotations/SingletonStyle.java rename to Util/immutables/src/main/java/io/deephaven/annotations/SingletonStyle.java diff --git a/engine/processor-function/build.gradle b/engine/processor-function/build.gradle new file mode 100644 index 00000000000..216662c7f56 --- /dev/null +++ b/engine/processor-function/build.gradle @@ -0,0 +1,21 @@ +plugins { + id 'java-library' + id 'io.deephaven.project.register' +} + + +dependencies { + api project(':engine-processor') + api project(':util-function') + + implementation project(':engine-time') + + Classpaths.inheritJUnitPlatform(project) + Classpaths.inheritAssertJ(project) + testImplementation 'org.junit.jupiter:junit-jupiter' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' +} + +test { + useJUnitPlatform() +} diff --git a/engine/processor-function/gradle.properties b/engine/processor-function/gradle.properties new file mode 100644 index 00000000000..c186bbfdde1 --- /dev/null +++ b/engine/processor-function/gradle.properties @@ -0,0 +1 @@ +io.deephaven.project.ProjectType=JAVA_PUBLIC diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/ChunkUtils.java b/engine/processor-function/src/main/java/io/deephaven/processor/function/ChunkUtils.java similarity index 94% rename from extensions/kafka/src/main/java/io/deephaven/kafka/ingest/ChunkUtils.java rename to engine/processor-function/src/main/java/io/deephaven/processor/function/ChunkUtils.java index f7bdb400b4d..ca3ecd3a8d4 100644 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/ChunkUtils.java +++ b/engine/processor-function/src/main/java/io/deephaven/processor/function/ChunkUtils.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.kafka.ingest; +package io.deephaven.processor.function; import io.deephaven.chunk.ObjectChunk; import io.deephaven.chunk.WritableBooleanChunk; @@ -13,10 +13,10 @@ import io.deephaven.chunk.WritableLongChunk; import io.deephaven.chunk.WritableObjectChunk; import io.deephaven.chunk.WritableShortChunk; -import io.deephaven.functions.ToByteFunction; -import io.deephaven.functions.ToCharFunction; -import io.deephaven.functions.ToFloatFunction; -import io.deephaven.functions.ToShortFunction; +import io.deephaven.function.ToByteFunction; +import io.deephaven.function.ToCharFunction; +import io.deephaven.function.ToFloatFunction; +import io.deephaven.function.ToShortFunction; import java.util.function.Function; import java.util.function.Predicate; @@ -24,7 +24,7 @@ import java.util.function.ToIntFunction; import java.util.function.ToLongFunction; -public class ChunkUtils { +final class ChunkUtils { public static void applyInto( Predicate booleanFunction, diff --git a/extensions/kafka/src/main/java/io/deephaven/processor/functions/ObjectProcessorFunctions.java b/engine/processor-function/src/main/java/io/deephaven/processor/function/ObjectProcessorFunctions.java similarity index 90% rename from extensions/kafka/src/main/java/io/deephaven/processor/functions/ObjectProcessorFunctions.java rename to engine/processor-function/src/main/java/io/deephaven/processor/function/ObjectProcessorFunctions.java index aa1539c3912..c7484441b37 100644 --- a/extensions/kafka/src/main/java/io/deephaven/processor/functions/ObjectProcessorFunctions.java +++ b/engine/processor-function/src/main/java/io/deephaven/processor/function/ObjectProcessorFunctions.java @@ -1,10 +1,10 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.processor.functions; +package io.deephaven.processor.function; import io.deephaven.chunk.ObjectChunk; -import io.deephaven.functions.TypedFunction; +import io.deephaven.function.TypedFunction; import io.deephaven.processor.ObjectProcessor; import java.util.List; diff --git a/extensions/kafka/src/main/java/io/deephaven/processor/functions/ObjectProcessorFunctionsImpl.java b/engine/processor-function/src/main/java/io/deephaven/processor/function/ObjectProcessorFunctionsImpl.java similarity index 95% rename from extensions/kafka/src/main/java/io/deephaven/processor/functions/ObjectProcessorFunctionsImpl.java rename to engine/processor-function/src/main/java/io/deephaven/processor/function/ObjectProcessorFunctionsImpl.java index afa4763c204..5e4c043b7b3 100644 --- a/extensions/kafka/src/main/java/io/deephaven/processor/functions/ObjectProcessorFunctionsImpl.java +++ b/engine/processor-function/src/main/java/io/deephaven/processor/function/ObjectProcessorFunctionsImpl.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.processor.functions; +package io.deephaven.processor.function; import io.deephaven.chunk.ObjectChunk; import io.deephaven.chunk.WritableByteChunk; @@ -13,18 +13,17 @@ import io.deephaven.chunk.WritableLongChunk; import io.deephaven.chunk.WritableObjectChunk; import io.deephaven.chunk.WritableShortChunk; -import io.deephaven.functions.ToBooleanFunction; -import io.deephaven.functions.ToByteFunction; -import io.deephaven.functions.ToCharFunction; -import io.deephaven.functions.ToDoubleFunction; -import io.deephaven.functions.ToFloatFunction; -import io.deephaven.functions.ToIntFunction; -import io.deephaven.functions.ToLongFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.functions.ToPrimitiveFunction; -import io.deephaven.functions.ToShortFunction; -import io.deephaven.functions.TypedFunction; -import io.deephaven.kafka.ingest.ChunkUtils; +import io.deephaven.function.ToBooleanFunction; +import io.deephaven.function.ToByteFunction; +import io.deephaven.function.ToCharFunction; +import io.deephaven.function.ToDoubleFunction; +import io.deephaven.function.ToFloatFunction; +import io.deephaven.function.ToIntFunction; +import io.deephaven.function.ToLongFunction; +import io.deephaven.function.ToObjectFunction; +import io.deephaven.function.ToPrimitiveFunction; +import io.deephaven.function.ToShortFunction; +import io.deephaven.function.TypedFunction; import io.deephaven.processor.ObjectProcessor; import io.deephaven.qst.type.ArrayType; import io.deephaven.qst.type.BoxedBooleanType; diff --git a/extensions/kafka/src/test/java/io/deephaven/processor/functions/ObjectProcessorFunctionsTest.java b/engine/processor-function/src/test/java/io/deephaven/processor/function/ObjectProcessorFunctionsTest.java similarity index 84% rename from extensions/kafka/src/test/java/io/deephaven/processor/functions/ObjectProcessorFunctionsTest.java rename to engine/processor-function/src/test/java/io/deephaven/processor/function/ObjectProcessorFunctionsTest.java index 66cf7fa1853..7758808dd51 100644 --- a/extensions/kafka/src/test/java/io/deephaven/processor/functions/ObjectProcessorFunctionsTest.java +++ b/engine/processor-function/src/test/java/io/deephaven/processor/function/ObjectProcessorFunctionsTest.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending */ -package io.deephaven.processor.functions; +package io.deephaven.processor.function; import io.deephaven.chunk.WritableByteChunk; import io.deephaven.chunk.WritableCharChunk; @@ -12,19 +12,20 @@ import io.deephaven.chunk.WritableLongChunk; import io.deephaven.chunk.WritableObjectChunk; import io.deephaven.chunk.WritableShortChunk; -import io.deephaven.functions.ToByteFunction; -import io.deephaven.functions.ToCharFunction; -import io.deephaven.functions.ToDoubleFunction; -import io.deephaven.functions.ToFloatFunction; -import io.deephaven.functions.ToIntFunction; -import io.deephaven.functions.ToLongFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.functions.ToShortFunction; +import io.deephaven.function.ToByteFunction; +import io.deephaven.function.ToCharFunction; +import io.deephaven.function.ToDoubleFunction; +import io.deephaven.function.ToFloatFunction; +import io.deephaven.function.ToIntFunction; +import io.deephaven.function.ToLongFunction; +import io.deephaven.function.ToObjectFunction; +import io.deephaven.function.ToShortFunction; import io.deephaven.processor.ObjectProcessor; import io.deephaven.qst.type.Type; import io.deephaven.util.BooleanUtils; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import java.time.Instant; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; @@ -44,7 +45,8 @@ public void testObjectProcessorFunctionsCorrectAndColumnOriented() { (ToLongFunction) orchestrator::toLong, (ToFloatFunction) orchestrator::toFloat, (ToDoubleFunction) orchestrator::toDouble, - ToObjectFunction.of(orchestrator::toString, Type.stringType())))); + ToObjectFunction.of(orchestrator::toString, Type.stringType()), + ToObjectFunction.of(orchestrator::toInstant, Type.instantType())))); try ( WritableObjectChunk in = WritableObjectChunk.makeWritableChunk(numRows); WritableByteChunk c1 = WritableByteChunk.makeWritableChunk(numRows); @@ -55,8 +57,9 @@ public void testObjectProcessorFunctionsCorrectAndColumnOriented() { WritableLongChunk c6 = WritableLongChunk.makeWritableChunk(numRows); WritableFloatChunk c7 = WritableFloatChunk.makeWritableChunk(numRows); WritableDoubleChunk c8 = WritableDoubleChunk.makeWritableChunk(numRows); - WritableObjectChunk c9 = WritableObjectChunk.makeWritableChunk(numRows)) { - List> out = List.of(c1, c2, c3, c4, c5, c6, c7, c8, c9); + WritableObjectChunk c9 = WritableObjectChunk.makeWritableChunk(numRows); + WritableLongChunk c10 = WritableLongChunk.makeWritableChunk(numRows)) { + List> out = List.of(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10); for (WritableChunk c : out) { c.setSize(0); } @@ -74,6 +77,7 @@ public void testObjectProcessorFunctionsCorrectAndColumnOriented() { assertThat(c7.get(i)).isEqualTo(42.0f); assertThat(c8.get(i)).isEqualTo(42.0); assertThat(c9.get(i)).isEqualTo("42"); + assertThat(c10.get(i)).isEqualTo(42000000L); } } orchestrator.assertDone(); @@ -92,6 +96,7 @@ private static class FunctionOrchestrator { private int floats; private int doubles; private int strings; + private int instants; public FunctionOrchestrator(int numRows) { this.numRows = numRows; @@ -150,8 +155,14 @@ String toString(Object ignore) { return "42"; } - void assertDone() { + Instant toInstant(Object ignore) { assertThat(strings).isEqualTo(numRows); + ++instants; + return Instant.ofEpochMilli(42); + } + + void assertDone() { + assertThat(instants).isEqualTo(numRows); } } } diff --git a/engine/processor/build.gradle b/engine/processor/build.gradle new file mode 100644 index 00000000000..3e79e0fa7a8 --- /dev/null +++ b/engine/processor/build.gradle @@ -0,0 +1,19 @@ +plugins { + id 'java-library' + id 'io.deephaven.project.register' +} + + +dependencies { + api project(':qst-type') + api project(':engine-chunk') + + Classpaths.inheritJUnitPlatform(project) + Classpaths.inheritAssertJ(project) + testImplementation 'org.junit.jupiter:junit-jupiter' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' +} + +test { + useJUnitPlatform() +} diff --git a/engine/processor/gradle.properties b/engine/processor/gradle.properties new file mode 100644 index 00000000000..c186bbfdde1 --- /dev/null +++ b/engine/processor/gradle.properties @@ -0,0 +1 @@ +io.deephaven.project.ProjectType=JAVA_PUBLIC diff --git a/extensions/kafka/src/main/java/io/deephaven/processor/ObjectProcessor.java b/engine/processor/src/main/java/io/deephaven/processor/ObjectProcessor.java similarity index 98% rename from extensions/kafka/src/main/java/io/deephaven/processor/ObjectProcessor.java rename to engine/processor/src/main/java/io/deephaven/processor/ObjectProcessor.java index 3a5b46c6253..6128ec0536b 100644 --- a/extensions/kafka/src/main/java/io/deephaven/processor/ObjectProcessor.java +++ b/engine/processor/src/main/java/io/deephaven/processor/ObjectProcessor.java @@ -129,7 +129,7 @@ static ObjectProcessor noop(List> outputTypes, boolean fillWithNu * * * {@link InstantType} - * {@link ChunkType#Long} ({@link io.deephaven.time.DateTimeUtils#epochNanos(Instant)}) + * {@link ChunkType#Long} (io.deephaven.time.DateTimeUtils#epochNanos(Instant)) * * * All other {@link GenericType} diff --git a/extensions/kafka/src/main/java/io/deephaven/processor/ObjectProcessorNoop.java b/engine/processor/src/main/java/io/deephaven/processor/ObjectProcessorNoop.java similarity index 100% rename from extensions/kafka/src/main/java/io/deephaven/processor/ObjectProcessorNoop.java rename to engine/processor/src/main/java/io/deephaven/processor/ObjectProcessorNoop.java diff --git a/extensions/kafka/src/main/java/io/deephaven/processor/ObjectProcessorRowLimited.java b/engine/processor/src/main/java/io/deephaven/processor/ObjectProcessorRowLimited.java similarity index 100% rename from extensions/kafka/src/main/java/io/deephaven/processor/ObjectProcessorRowLimited.java rename to engine/processor/src/main/java/io/deephaven/processor/ObjectProcessorRowLimited.java diff --git a/extensions/kafka/src/main/java/io/deephaven/processor/ObjectProcessorStrict.java b/engine/processor/src/main/java/io/deephaven/processor/ObjectProcessorStrict.java similarity index 100% rename from extensions/kafka/src/main/java/io/deephaven/processor/ObjectProcessorStrict.java rename to engine/processor/src/main/java/io/deephaven/processor/ObjectProcessorStrict.java diff --git a/extensions/kafka/src/main/java/io/deephaven/processor/ObjectProcessorTypes.java b/engine/processor/src/main/java/io/deephaven/processor/ObjectProcessorTypes.java similarity index 100% rename from extensions/kafka/src/main/java/io/deephaven/processor/ObjectProcessorTypes.java rename to engine/processor/src/main/java/io/deephaven/processor/ObjectProcessorTypes.java diff --git a/extensions/kafka/src/test/java/io/deephaven/processor/ObjectProcessorNoopTest.java b/engine/processor/src/test/java/io/deephaven/processor/ObjectProcessorNoopTest.java similarity index 99% rename from extensions/kafka/src/test/java/io/deephaven/processor/ObjectProcessorNoopTest.java rename to engine/processor/src/test/java/io/deephaven/processor/ObjectProcessorNoopTest.java index aa9ce50b2a3..3c76aa2efa0 100644 --- a/extensions/kafka/src/test/java/io/deephaven/processor/ObjectProcessorNoopTest.java +++ b/engine/processor/src/test/java/io/deephaven/processor/ObjectProcessorNoopTest.java @@ -14,7 +14,7 @@ import io.deephaven.chunk.WritableShortChunk; import io.deephaven.qst.type.Type; import io.deephaven.util.QueryConstants; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.List; diff --git a/extensions/kafka/src/test/java/io/deephaven/processor/ObjectProcessorRowLimitedTest.java b/engine/processor/src/test/java/io/deephaven/processor/ObjectProcessorRowLimitedTest.java similarity index 98% rename from extensions/kafka/src/test/java/io/deephaven/processor/ObjectProcessorRowLimitedTest.java rename to engine/processor/src/test/java/io/deephaven/processor/ObjectProcessorRowLimitedTest.java index 89696c65bf2..338a2052ec1 100644 --- a/extensions/kafka/src/test/java/io/deephaven/processor/ObjectProcessorRowLimitedTest.java +++ b/engine/processor/src/test/java/io/deephaven/processor/ObjectProcessorRowLimitedTest.java @@ -8,7 +8,7 @@ import io.deephaven.chunk.WritableIntChunk; import io.deephaven.chunk.WritableObjectChunk; import io.deephaven.qst.type.Type; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.List; diff --git a/extensions/kafka/src/test/java/io/deephaven/processor/ObjectProcessorStrictTest.java b/engine/processor/src/test/java/io/deephaven/processor/ObjectProcessorStrictTest.java similarity index 99% rename from extensions/kafka/src/test/java/io/deephaven/processor/ObjectProcessorStrictTest.java rename to engine/processor/src/test/java/io/deephaven/processor/ObjectProcessorStrictTest.java index 674ba8241ce..5f8c0760a87 100644 --- a/extensions/kafka/src/test/java/io/deephaven/processor/ObjectProcessorStrictTest.java +++ b/engine/processor/src/test/java/io/deephaven/processor/ObjectProcessorStrictTest.java @@ -12,7 +12,7 @@ import io.deephaven.chunk.attributes.Any; import io.deephaven.qst.type.Type; import io.deephaven.util.QueryConstants; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; diff --git a/extensions/kafka/src/test/java/io/deephaven/processor/ObjectProcessorTest.java b/engine/processor/src/test/java/io/deephaven/processor/ObjectProcessorTest.java similarity index 98% rename from extensions/kafka/src/test/java/io/deephaven/processor/ObjectProcessorTest.java rename to engine/processor/src/test/java/io/deephaven/processor/ObjectProcessorTest.java index f87d9b10a68..4aebb796dd1 100644 --- a/extensions/kafka/src/test/java/io/deephaven/processor/ObjectProcessorTest.java +++ b/engine/processor/src/test/java/io/deephaven/processor/ObjectProcessorTest.java @@ -6,7 +6,7 @@ import io.deephaven.chunk.ChunkType; import io.deephaven.qst.type.PrimitiveType; import io.deephaven.qst.type.Type; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/extensions/kafka/build.gradle b/extensions/kafka/build.gradle index 0543ed01a0b..9a859b61edb 100644 --- a/extensions/kafka/build.gradle +++ b/extensions/kafka/build.gradle @@ -8,6 +8,8 @@ description 'Kafka: Integrating Engine tables with Kafka' dependencies { api project(':engine-table') + api project(':engine-processor') + api 'org.apache.avro:avro:1.11.2' // Using io.confluent dependencies requires code in the toplevel build.gradle to add their maven repository. @@ -26,6 +28,7 @@ dependencies { api project(':extensions-protobuf') + implementation project(':engine-processor-function') implementation project(':Configuration') implementation project(':log-factory') implementation depTrove3 diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/BoxTransform.java b/extensions/kafka/src/main/java/io/deephaven/kafka/BoxTransform.java index 70ed02548c0..3bfe444f2e5 100644 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/BoxTransform.java +++ b/extensions/kafka/src/main/java/io/deephaven/kafka/BoxTransform.java @@ -3,17 +3,17 @@ */ package io.deephaven.kafka; -import io.deephaven.functions.ToBooleanFunction; -import io.deephaven.functions.ToByteFunction; -import io.deephaven.functions.ToCharFunction; -import io.deephaven.functions.ToDoubleFunction; -import io.deephaven.functions.ToFloatFunction; -import io.deephaven.functions.ToIntFunction; -import io.deephaven.functions.ToLongFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.functions.ToPrimitiveFunction; -import io.deephaven.functions.ToShortFunction; -import io.deephaven.functions.TypedFunction; +import io.deephaven.function.ToBooleanFunction; +import io.deephaven.function.ToByteFunction; +import io.deephaven.function.ToCharFunction; +import io.deephaven.function.ToDoubleFunction; +import io.deephaven.function.ToFloatFunction; +import io.deephaven.function.ToIntFunction; +import io.deephaven.function.ToLongFunction; +import io.deephaven.function.ToObjectFunction; +import io.deephaven.function.ToPrimitiveFunction; +import io.deephaven.function.ToShortFunction; +import io.deephaven.function.TypedFunction; import io.deephaven.qst.type.BoxedBooleanType; import io.deephaven.qst.type.BoxedByteType; import io.deephaven.qst.type.BoxedCharType; diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/DhNullableTypeTransform.java b/extensions/kafka/src/main/java/io/deephaven/kafka/DhNullableTypeTransform.java index 9132913f185..5a77aaac7df 100644 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/DhNullableTypeTransform.java +++ b/extensions/kafka/src/main/java/io/deephaven/kafka/DhNullableTypeTransform.java @@ -3,17 +3,17 @@ */ package io.deephaven.kafka; -import io.deephaven.functions.ToBooleanFunction; -import io.deephaven.functions.ToByteFunction; -import io.deephaven.functions.ToCharFunction; -import io.deephaven.functions.ToDoubleFunction; -import io.deephaven.functions.ToFloatFunction; -import io.deephaven.functions.ToIntFunction; -import io.deephaven.functions.ToLongFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.functions.ToPrimitiveFunction; -import io.deephaven.functions.ToShortFunction; -import io.deephaven.functions.TypedFunction; +import io.deephaven.function.ToBooleanFunction; +import io.deephaven.function.ToByteFunction; +import io.deephaven.function.ToCharFunction; +import io.deephaven.function.ToDoubleFunction; +import io.deephaven.function.ToFloatFunction; +import io.deephaven.function.ToIntFunction; +import io.deephaven.function.ToLongFunction; +import io.deephaven.function.ToObjectFunction; +import io.deephaven.function.ToPrimitiveFunction; +import io.deephaven.function.ToShortFunction; +import io.deephaven.function.TypedFunction; class DhNullableTypeTransform { diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/NullFunctions.java b/extensions/kafka/src/main/java/io/deephaven/kafka/NullFunctions.java index 7e71c9ddae8..948d78430fc 100644 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/NullFunctions.java +++ b/extensions/kafka/src/main/java/io/deephaven/kafka/NullFunctions.java @@ -14,17 +14,17 @@ import io.deephaven.qst.type.PrimitiveType; import io.deephaven.qst.type.ShortType; import io.deephaven.qst.type.Type; -import io.deephaven.functions.ToBooleanFunction; -import io.deephaven.functions.ToByteFunction; -import io.deephaven.functions.ToCharFunction; -import io.deephaven.functions.ToDoubleFunction; -import io.deephaven.functions.ToFloatFunction; -import io.deephaven.functions.ToIntFunction; -import io.deephaven.functions.ToLongFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.functions.ToPrimitiveFunction; -import io.deephaven.functions.ToShortFunction; -import io.deephaven.functions.TypedFunction; +import io.deephaven.function.ToBooleanFunction; +import io.deephaven.function.ToByteFunction; +import io.deephaven.function.ToCharFunction; +import io.deephaven.function.ToDoubleFunction; +import io.deephaven.function.ToFloatFunction; +import io.deephaven.function.ToIntFunction; +import io.deephaven.function.ToLongFunction; +import io.deephaven.function.ToObjectFunction; +import io.deephaven.function.ToPrimitiveFunction; +import io.deephaven.function.ToShortFunction; +import io.deephaven.function.TypedFunction; import io.deephaven.util.QueryConstants; import java.util.Optional; diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ProtobufImpl.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ProtobufImpl.java index a545763f2b4..e59986ec2bf 100644 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/ProtobufImpl.java +++ b/extensions/kafka/src/main/java/io/deephaven/kafka/ProtobufImpl.java @@ -17,9 +17,9 @@ import io.deephaven.api.ColumnName; import io.deephaven.engine.table.ColumnDefinition; import io.deephaven.engine.table.TableDefinition; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.functions.ToPrimitiveFunction; -import io.deephaven.functions.TypedFunction; +import io.deephaven.function.ToObjectFunction; +import io.deephaven.function.ToPrimitiveFunction; +import io.deephaven.function.TypedFunction; import io.deephaven.kafka.KafkaTools.Consume; import io.deephaven.kafka.KafkaTools.KeyOrValue; import io.deephaven.kafka.KafkaTools.KeyOrValueIngestData; diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ToChunkTypeTransform.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ToChunkTypeTransform.java index 0e03f8dfd09..29c28eb8aa3 100644 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/ToChunkTypeTransform.java +++ b/extensions/kafka/src/main/java/io/deephaven/kafka/ToChunkTypeTransform.java @@ -3,11 +3,11 @@ */ package io.deephaven.kafka; -import io.deephaven.functions.ToByteFunction; -import io.deephaven.functions.ToLongFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.functions.ToPrimitiveFunction; -import io.deephaven.functions.TypedFunction; +import io.deephaven.function.ToByteFunction; +import io.deephaven.function.ToLongFunction; +import io.deephaven.function.ToObjectFunction; +import io.deephaven.function.ToPrimitiveFunction; +import io.deephaven.function.TypedFunction; import io.deephaven.qst.type.ArrayType; import io.deephaven.qst.type.BoxedBooleanType; import io.deephaven.qst.type.BoxedByteType; diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/UnboxTransform.java b/extensions/kafka/src/main/java/io/deephaven/kafka/UnboxTransform.java index 9fb4122891a..ba1c2a741f9 100644 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/UnboxTransform.java +++ b/extensions/kafka/src/main/java/io/deephaven/kafka/UnboxTransform.java @@ -3,16 +3,16 @@ */ package io.deephaven.kafka; -import io.deephaven.functions.ToByteFunction; -import io.deephaven.functions.ToCharFunction; -import io.deephaven.functions.ToDoubleFunction; -import io.deephaven.functions.ToFloatFunction; -import io.deephaven.functions.ToIntFunction; -import io.deephaven.functions.ToLongFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.functions.ToPrimitiveFunction; -import io.deephaven.functions.ToShortFunction; -import io.deephaven.functions.TypedFunction; +import io.deephaven.function.ToByteFunction; +import io.deephaven.function.ToCharFunction; +import io.deephaven.function.ToDoubleFunction; +import io.deephaven.function.ToFloatFunction; +import io.deephaven.function.ToIntFunction; +import io.deephaven.function.ToLongFunction; +import io.deephaven.function.ToObjectFunction; +import io.deephaven.function.ToPrimitiveFunction; +import io.deephaven.function.ToShortFunction; +import io.deephaven.function.TypedFunction; import io.deephaven.qst.type.ArrayType; import io.deephaven.qst.type.BoxedBooleanType; import io.deephaven.qst.type.BoxedByteType; diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/BooleanFieldCopier.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/BooleanFieldCopier.java deleted file mode 100644 index 96c3b69f025..00000000000 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/BooleanFieldCopier.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.kafka.ingest; - -import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableChunk; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.functions.ToBooleanFunction; - -import java.util.Objects; - -class BooleanFieldCopier implements FieldCopier { - public static BooleanFieldCopier of(ToBooleanFunction f) { - return new BooleanFieldCopier(f); - } - - private final ToBooleanFunction f; - - private BooleanFieldCopier(ToBooleanFunction f) { - this.f = Objects.requireNonNull(f); - } - - @Override - public void copyField( - ObjectChunk inputChunk, - WritableChunk publisherChunk, - int sourceOffset, - int destOffset, - int length) { - ChunkUtils.applyInto(f, inputChunk, sourceOffset, publisherChunk.asWritableBooleanChunk(), destOffset, length); - } -} diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/ByteFieldCopier.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/ByteFieldCopier.java deleted file mode 100644 index 077d8646c9a..00000000000 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/ByteFieldCopier.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.kafka.ingest; - -import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableChunk; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.functions.ToByteFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.util.BooleanUtils; -import io.deephaven.util.type.TypeUtils; - -import java.util.Objects; - -class ByteFieldCopier implements FieldCopier { - public static ByteFieldCopier of(ToByteFunction f) { - return new ByteFieldCopier(f); - } - - public static ByteFieldCopier of(ToObjectFunction f) { - return of(f.mapToByte(TypeUtils::unbox)); - } - - public static ByteFieldCopier ofBoolean(ToObjectFunction f) { - return of(f.mapToByte(BooleanUtils::booleanAsByte)); - } - - private final ToByteFunction f; - - private ByteFieldCopier(ToByteFunction f) { - this.f = Objects.requireNonNull(f); - } - - @Override - public void copyField( - ObjectChunk inputChunk, - WritableChunk publisherChunk, - int sourceOffset, - int destOffset, - int length) { - ChunkUtils.applyInto(f, inputChunk, sourceOffset, publisherChunk.asWritableByteChunk(), destOffset, length); - } -} diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/CharFieldCopier.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/CharFieldCopier.java deleted file mode 100644 index 0eb3b5b3f81..00000000000 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/CharFieldCopier.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.kafka.ingest; - -import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableChunk; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.functions.ToCharFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.util.type.TypeUtils; - -import java.util.Objects; - -class CharFieldCopier implements FieldCopier { - public static CharFieldCopier of(ToCharFunction f) { - return new CharFieldCopier(f); - } - - public static CharFieldCopier of(ToObjectFunction f) { - return of(f.mapToChar(TypeUtils::unbox)); - } - - private final ToCharFunction f; - - private CharFieldCopier(ToCharFunction f) { - this.f = Objects.requireNonNull(f); - } - - @Override - public void copyField( - ObjectChunk inputChunk, - WritableChunk publisherChunk, - int sourceOffset, - int destOffset, - int length) { - ChunkUtils.applyInto(f, inputChunk, sourceOffset, publisherChunk.asWritableCharChunk(), destOffset, length); - } -} diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/DoubleFieldCopier.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/DoubleFieldCopier.java deleted file mode 100644 index 1b82518af52..00000000000 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/DoubleFieldCopier.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.kafka.ingest; - -import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableChunk; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.functions.ToDoubleFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.util.type.TypeUtils; - -import java.util.Objects; - -class DoubleFieldCopier implements FieldCopier { - public static DoubleFieldCopier of(ToDoubleFunction f) { - return new DoubleFieldCopier(f); - } - - public static DoubleFieldCopier of(ToObjectFunction f) { - return of(f.mapToDouble(TypeUtils::unbox)); - } - - private final ToDoubleFunction f; - - private DoubleFieldCopier(ToDoubleFunction f) { - this.f = Objects.requireNonNull(f); - } - - @Override - public void copyField( - ObjectChunk inputChunk, - WritableChunk publisherChunk, - int sourceOffset, - int destOffset, - int length) { - ChunkUtils.applyInto(f, inputChunk, sourceOffset, publisherChunk.asWritableDoubleChunk(), destOffset, length); - } -} diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/FieldCopierAdapter.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/FieldCopierAdapter.java index 896dc8749e4..3f92a57dc7e 100644 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/FieldCopierAdapter.java +++ b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/FieldCopierAdapter.java @@ -3,117 +3,14 @@ */ package io.deephaven.kafka.ingest; -import io.deephaven.qst.type.BoxedBooleanType; -import io.deephaven.functions.ToBooleanFunction; -import io.deephaven.functions.ToByteFunction; -import io.deephaven.functions.ToCharFunction; -import io.deephaven.functions.ToDoubleFunction; -import io.deephaven.functions.ToFloatFunction; -import io.deephaven.functions.ToIntFunction; -import io.deephaven.functions.ToLongFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.functions.ToPrimitiveFunction; -import io.deephaven.functions.ToShortFunction; -import io.deephaven.functions.TypedFunction; +import io.deephaven.processor.function.ObjectProcessorFunctions; +import io.deephaven.function.TypedFunction; -public enum FieldCopierAdapter - implements TypedFunction.Visitor, ToPrimitiveFunction.Visitor { - INSTANCE; +import java.util.List; - public static FieldCopier of(TypedFunction f) { - return f.walk(INSTANCE); - } - - public static FieldCopier of(ToPrimitiveFunction f) { - return f.walk((ToPrimitiveFunction.Visitor) INSTANCE); - } - - public static FieldCopier of(ToBooleanFunction f) { - return BooleanFieldCopier.of(f); - } +public final class FieldCopierAdapter { - public static FieldCopier of(ToCharFunction f) { - return CharFieldCopier.of(f); - } - - public static FieldCopier of(ToByteFunction f) { - return ByteFieldCopier.of(f); - } - - public static FieldCopier of(ToShortFunction f) { - return ShortFieldCopier.of(f); - } - - public static FieldCopier of(ToIntFunction f) { - return IntFieldCopier.of(f); - } - - public static FieldCopier of(ToLongFunction f) { - return LongFieldCopier.of(f); - } - - public static FieldCopier of(ToFloatFunction f) { - return FloatFieldCopier.of(f); - } - - public static FieldCopier of(ToDoubleFunction f) { - return DoubleFieldCopier.of(f); - } - - public static FieldCopier of(ToObjectFunction f) { - if (f.returnType().equals(BoxedBooleanType.of())) { - return ByteFieldCopier.ofBoolean(f.cast(BoxedBooleanType.of())); - } - return ObjectFieldCopier.of(f); - } - - @Override - public FieldCopier visit(ToPrimitiveFunction f) { - return of(f); - } - - @Override - public FieldCopier visit(ToBooleanFunction f) { - return of(f); - } - - @Override - public FieldCopier visit(ToCharFunction f) { - return of(f); - } - - @Override - public FieldCopier visit(ToByteFunction f) { - return of(f); - } - - @Override - public FieldCopier visit(ToShortFunction f) { - return of(f); - } - - @Override - public FieldCopier visit(ToIntFunction f) { - return of(f); - } - - @Override - public FieldCopier visit(ToLongFunction f) { - return of(f); - } - - @Override - public FieldCopier visit(ToFloatFunction f) { - return of(f); - } - - @Override - public FieldCopier visit(ToDoubleFunction f) { - return of(f); - } - - @Override - public FieldCopier visit(ToObjectFunction f) { - return of(f); + public static FieldCopier of(TypedFunction f) { + return new FieldCopierProcessorImpl(ObjectProcessorFunctions.of(List.of(f))); } } diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/FieldCopierProcessorImpl.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/FieldCopierProcessorImpl.java new file mode 100644 index 00000000000..acfceedd060 --- /dev/null +++ b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/FieldCopierProcessorImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending + */ +package io.deephaven.kafka.ingest; + +import io.deephaven.chunk.ObjectChunk; +import io.deephaven.chunk.WritableChunk; +import io.deephaven.chunk.attributes.Values; +import io.deephaven.processor.ObjectProcessor; + +import java.util.List; +import java.util.Objects; + +final class FieldCopierProcessorImpl implements FieldCopier { + + private final ObjectProcessor processor; + + FieldCopierProcessorImpl(ObjectProcessor processor) { + this.processor = Objects.requireNonNull(processor); + } + + @Override + public void copyField(ObjectChunk inputChunk, WritableChunk publisherChunk, + int sourceOffset, int destOffset, int length) { + final int originalSize = publisherChunk.size(); + publisherChunk.setSize(destOffset); + try { + processor.processAll(inputChunk.slice(sourceOffset, length), List.of(publisherChunk)); + } finally { + publisherChunk.setSize(originalSize); + } + } +} diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/FloatFieldCopier.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/FloatFieldCopier.java deleted file mode 100644 index 8be6811daae..00000000000 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/FloatFieldCopier.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.kafka.ingest; - -import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableChunk; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.functions.ToFloatFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.util.type.TypeUtils; - -import java.util.Objects; - -class FloatFieldCopier implements FieldCopier { - public static FloatFieldCopier of(ToFloatFunction f) { - return new FloatFieldCopier(f); - } - - public static FloatFieldCopier of(ToObjectFunction f) { - return of(f.mapToFloat(TypeUtils::unbox)); - } - - private final ToFloatFunction f; - - private FloatFieldCopier(ToFloatFunction f) { - this.f = Objects.requireNonNull(f); - } - - @Override - public void copyField( - ObjectChunk inputChunk, - WritableChunk publisherChunk, - int sourceOffset, - int destOffset, - int length) { - ChunkUtils.applyInto(f, inputChunk, sourceOffset, publisherChunk.asWritableFloatChunk(), destOffset, length); - } -} diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/IntFieldCopier.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/IntFieldCopier.java deleted file mode 100644 index 6e73a805f5a..00000000000 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/IntFieldCopier.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.kafka.ingest; - -import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableChunk; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.functions.ToIntFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.util.type.TypeUtils; - -import java.util.Objects; - -class IntFieldCopier implements FieldCopier { - public static IntFieldCopier of(ToIntFunction f) { - return new IntFieldCopier(f); - } - - public static IntFieldCopier of(ToObjectFunction f) { - return of(f.mapToInt(TypeUtils::unbox)); - } - - private final ToIntFunction f; - - private IntFieldCopier(ToIntFunction f) { - this.f = Objects.requireNonNull(f); - } - - @Override - public void copyField( - ObjectChunk inputChunk, - WritableChunk publisherChunk, - int sourceOffset, - int destOffset, - int length) { - ChunkUtils.applyInto(f, inputChunk, sourceOffset, publisherChunk.asWritableIntChunk(), destOffset, length); - } -} diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/LongFieldCopier.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/LongFieldCopier.java deleted file mode 100644 index 78ccbd46051..00000000000 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/LongFieldCopier.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.kafka.ingest; - -import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableChunk; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.functions.ToLongFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.util.type.TypeUtils; - -import java.util.Objects; - -class LongFieldCopier implements FieldCopier { - public static LongFieldCopier of(ToLongFunction f) { - return new LongFieldCopier(f); - } - - public static LongFieldCopier of(ToObjectFunction f) { - return of(f.mapToLong(TypeUtils::unbox)); - } - - private final ToLongFunction f; - - private LongFieldCopier(ToLongFunction f) { - this.f = Objects.requireNonNull(f); - } - - @Override - public void copyField( - ObjectChunk inputChunk, - WritableChunk publisherChunk, - int sourceOffset, - int destOffset, - int length) { - ChunkUtils.applyInto(f, inputChunk, sourceOffset, publisherChunk.asWritableLongChunk(), destOffset, length); - } -} diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/ObjectFieldCopier.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/ObjectFieldCopier.java deleted file mode 100644 index 7bdf39051d8..00000000000 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/ObjectFieldCopier.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.kafka.ingest; - -import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableChunk; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.functions.ToObjectFunction; - -import java.util.Objects; - -class ObjectFieldCopier implements FieldCopier { - public static ObjectFieldCopier of(ToObjectFunction f) { - return new ObjectFieldCopier(f); - } - - private final ToObjectFunction f; - - private ObjectFieldCopier(ToObjectFunction f) { - this.f = Objects.requireNonNull(f); - } - - @Override - public void copyField( - ObjectChunk inputChunk, - WritableChunk publisherChunk, - int sourceOffset, - int destOffset, - int length) { - ChunkUtils.applyInto(f, inputChunk, sourceOffset, publisherChunk.asWritableObjectChunk(), destOffset, length); - } -} diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/ShortFieldCopier.java b/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/ShortFieldCopier.java deleted file mode 100644 index a14cab19ada..00000000000 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/ingest/ShortFieldCopier.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending - */ -package io.deephaven.kafka.ingest; - -import io.deephaven.chunk.ObjectChunk; -import io.deephaven.chunk.WritableChunk; -import io.deephaven.chunk.attributes.Values; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.functions.ToShortFunction; -import io.deephaven.util.type.TypeUtils; - -import java.util.Objects; - -class ShortFieldCopier implements FieldCopier { - public static ShortFieldCopier of(ToShortFunction f) { - return new ShortFieldCopier(f); - } - - public static ShortFieldCopier of(ToObjectFunction f) { - return of(f.mapToShort(TypeUtils::unbox)); - } - - private final ToShortFunction f; - - private ShortFieldCopier(ToShortFunction f) { - this.f = Objects.requireNonNull(f); - } - - @Override - public void copyField( - ObjectChunk inputChunk, - WritableChunk publisherChunk, - int sourceOffset, - int destOffset, - int length) { - ChunkUtils.applyInto(f, inputChunk, sourceOffset, publisherChunk.asWritableShortChunk(), destOffset, length); - } -} diff --git a/extensions/protobuf/build.gradle b/extensions/protobuf/build.gradle index 3f622256c3c..895393260dc 100644 --- a/extensions/protobuf/build.gradle +++ b/extensions/protobuf/build.gradle @@ -6,6 +6,7 @@ plugins { dependencies { api project(':qst-type') + api project(':util-function') api 'com.google.protobuf:protobuf-java:3.24.1' implementation project(':engine-query-constants') diff --git a/extensions/protobuf/src/main/java/io/deephaven/protobuf/Box.java b/extensions/protobuf/src/main/java/io/deephaven/protobuf/Box.java index 618374f1680..f146ef99eab 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/protobuf/Box.java +++ b/extensions/protobuf/src/main/java/io/deephaven/protobuf/Box.java @@ -3,18 +3,18 @@ */ package io.deephaven.protobuf; -import io.deephaven.functions.ToBooleanFunction; -import io.deephaven.functions.ToByteFunction; -import io.deephaven.functions.ToCharFunction; -import io.deephaven.functions.ToDoubleFunction; -import io.deephaven.functions.ToFloatFunction; -import io.deephaven.functions.ToIntFunction; -import io.deephaven.functions.ToLongFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.functions.ToPrimitiveFunction; -import io.deephaven.functions.ToShortFunction; -import io.deephaven.functions.TypedFunction; -import io.deephaven.functions.TypedFunction.Visitor; +import io.deephaven.function.ToBooleanFunction; +import io.deephaven.function.ToByteFunction; +import io.deephaven.function.ToCharFunction; +import io.deephaven.function.ToDoubleFunction; +import io.deephaven.function.ToFloatFunction; +import io.deephaven.function.ToIntFunction; +import io.deephaven.function.ToLongFunction; +import io.deephaven.function.ToObjectFunction; +import io.deephaven.function.ToPrimitiveFunction; +import io.deephaven.function.ToShortFunction; +import io.deephaven.function.TypedFunction; +import io.deephaven.function.TypedFunction.Visitor; class Box implements Visitor, ToPrimitiveFunction.Visitor { public static Object apply(TypedFunction f, T value) { diff --git a/extensions/protobuf/src/main/java/io/deephaven/protobuf/Builtin.java b/extensions/protobuf/src/main/java/io/deephaven/protobuf/Builtin.java index 4837d967c93..65794fa64c3 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/protobuf/Builtin.java +++ b/extensions/protobuf/src/main/java/io/deephaven/protobuf/Builtin.java @@ -20,12 +20,12 @@ import com.google.protobuf.Timestamp; import com.google.protobuf.UInt32Value; import com.google.protobuf.UInt64Value; -import io.deephaven.functions.ToBooleanFunction; -import io.deephaven.functions.ToDoubleFunction; -import io.deephaven.functions.ToFloatFunction; -import io.deephaven.functions.ToIntFunction; -import io.deephaven.functions.ToLongFunction; -import io.deephaven.functions.ToObjectFunction; +import io.deephaven.function.ToBooleanFunction; +import io.deephaven.function.ToDoubleFunction; +import io.deephaven.function.ToFloatFunction; +import io.deephaven.function.ToIntFunction; +import io.deephaven.function.ToLongFunction; +import io.deephaven.function.ToObjectFunction; import io.deephaven.protobuf.FieldOptions.BytesBehavior; import io.deephaven.qst.type.CustomType; import io.deephaven.qst.type.GenericType; diff --git a/extensions/protobuf/src/main/java/io/deephaven/protobuf/BypassOnNull.java b/extensions/protobuf/src/main/java/io/deephaven/protobuf/BypassOnNull.java index 1286c35dd3b..e8f0226f629 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/protobuf/BypassOnNull.java +++ b/extensions/protobuf/src/main/java/io/deephaven/protobuf/BypassOnNull.java @@ -3,17 +3,17 @@ */ package io.deephaven.protobuf; -import io.deephaven.functions.ToBooleanFunction; -import io.deephaven.functions.ToByteFunction; -import io.deephaven.functions.ToCharFunction; -import io.deephaven.functions.ToDoubleFunction; -import io.deephaven.functions.ToFloatFunction; -import io.deephaven.functions.ToIntFunction; -import io.deephaven.functions.ToLongFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.functions.ToPrimitiveFunction; -import io.deephaven.functions.ToShortFunction; -import io.deephaven.functions.TypedFunction; +import io.deephaven.function.ToBooleanFunction; +import io.deephaven.function.ToByteFunction; +import io.deephaven.function.ToCharFunction; +import io.deephaven.function.ToDoubleFunction; +import io.deephaven.function.ToFloatFunction; +import io.deephaven.function.ToIntFunction; +import io.deephaven.function.ToLongFunction; +import io.deephaven.function.ToObjectFunction; +import io.deephaven.function.ToPrimitiveFunction; +import io.deephaven.function.ToShortFunction; +import io.deephaven.function.TypedFunction; import io.deephaven.qst.type.BoxedBooleanType; import io.deephaven.util.QueryConstants; diff --git a/extensions/protobuf/src/main/java/io/deephaven/protobuf/FieldPath.java b/extensions/protobuf/src/main/java/io/deephaven/protobuf/FieldPath.java index c7f1be54baa..4e80d4b629f 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/protobuf/FieldPath.java +++ b/extensions/protobuf/src/main/java/io/deephaven/protobuf/FieldPath.java @@ -5,7 +5,7 @@ import com.google.protobuf.Descriptors.FieldDescriptor; import io.deephaven.annotations.SimpleStyle; -import io.deephaven.functions.ToBooleanFunction; +import io.deephaven.function.ToBooleanFunction; import org.immutables.value.Value.Immutable; import org.immutables.value.Value.Lazy; import org.immutables.value.Value.Parameter; diff --git a/extensions/protobuf/src/main/java/io/deephaven/protobuf/MessageParser.java b/extensions/protobuf/src/main/java/io/deephaven/protobuf/MessageParser.java index 521ea482d39..6b94d9a3615 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/protobuf/MessageParser.java +++ b/extensions/protobuf/src/main/java/io/deephaven/protobuf/MessageParser.java @@ -5,7 +5,7 @@ import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Message; -import io.deephaven.functions.TypedFunction; +import io.deephaven.function.TypedFunction; import java.util.ArrayList; import java.util.List; diff --git a/extensions/protobuf/src/main/java/io/deephaven/protobuf/MessageParserSingle.java b/extensions/protobuf/src/main/java/io/deephaven/protobuf/MessageParserSingle.java index 9771721ec19..0516c31afaf 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/protobuf/MessageParserSingle.java +++ b/extensions/protobuf/src/main/java/io/deephaven/protobuf/MessageParserSingle.java @@ -5,7 +5,7 @@ import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Message; -import io.deephaven.functions.TypedFunction; +import io.deephaven.function.TypedFunction; /** * A specialized / simplified version of {@link MessageParser} that produces a single unnamed function. diff --git a/extensions/protobuf/src/main/java/io/deephaven/protobuf/ProtobufDescriptorParserImpl.java b/extensions/protobuf/src/main/java/io/deephaven/protobuf/ProtobufDescriptorParserImpl.java index 2f404fbd442..a8528646917 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/protobuf/ProtobufDescriptorParserImpl.java +++ b/extensions/protobuf/src/main/java/io/deephaven/protobuf/ProtobufDescriptorParserImpl.java @@ -20,18 +20,18 @@ import io.deephaven.qst.type.BoxedLongType; import io.deephaven.qst.type.GenericType; import io.deephaven.qst.type.Type; -import io.deephaven.functions.ToBooleanFunction; -import io.deephaven.functions.ToByteFunction; -import io.deephaven.functions.ToCharFunction; -import io.deephaven.functions.ToDoubleFunction; -import io.deephaven.functions.ToFloatFunction; -import io.deephaven.functions.ToIntFunction; -import io.deephaven.functions.ToLongFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.functions.ToPrimitiveFunction; -import io.deephaven.functions.ToShortFunction; -import io.deephaven.functions.TypedFunction; -import io.deephaven.functions.TypedFunction.Visitor; +import io.deephaven.function.ToBooleanFunction; +import io.deephaven.function.ToByteFunction; +import io.deephaven.function.ToCharFunction; +import io.deephaven.function.ToDoubleFunction; +import io.deephaven.function.ToFloatFunction; +import io.deephaven.function.ToIntFunction; +import io.deephaven.function.ToLongFunction; +import io.deephaven.function.ToObjectFunction; +import io.deephaven.function.ToPrimitiveFunction; +import io.deephaven.function.ToShortFunction; +import io.deephaven.function.TypedFunction; +import io.deephaven.function.TypedFunction.Visitor; import io.deephaven.util.QueryConstants; import java.lang.reflect.Array; diff --git a/extensions/protobuf/src/main/java/io/deephaven/protobuf/ProtobufFunction.java b/extensions/protobuf/src/main/java/io/deephaven/protobuf/ProtobufFunction.java index 0fc8e95542f..71558061048 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/protobuf/ProtobufFunction.java +++ b/extensions/protobuf/src/main/java/io/deephaven/protobuf/ProtobufFunction.java @@ -5,7 +5,7 @@ import com.google.protobuf.Message; import io.deephaven.annotations.SimpleStyle; -import io.deephaven.functions.TypedFunction; +import io.deephaven.function.TypedFunction; import org.immutables.value.Value.Immutable; import org.immutables.value.Value.Parameter; diff --git a/extensions/protobuf/src/main/java/io/deephaven/protobuf/ProtobufFunctions.java b/extensions/protobuf/src/main/java/io/deephaven/protobuf/ProtobufFunctions.java index 7529314853c..27cfff94662 100644 --- a/extensions/protobuf/src/main/java/io/deephaven/protobuf/ProtobufFunctions.java +++ b/extensions/protobuf/src/main/java/io/deephaven/protobuf/ProtobufFunctions.java @@ -5,7 +5,7 @@ import com.google.protobuf.Message; import io.deephaven.annotations.BuildableStyle; -import io.deephaven.functions.TypedFunction; +import io.deephaven.function.TypedFunction; import org.immutables.value.Value.Immutable; import java.util.List; diff --git a/extensions/protobuf/src/test/java/io/deephaven/protobuf/ByteWrapperCustomType.java b/extensions/protobuf/src/test/java/io/deephaven/protobuf/ByteWrapperCustomType.java index 3ca71a558d4..28269711953 100644 --- a/extensions/protobuf/src/test/java/io/deephaven/protobuf/ByteWrapperCustomType.java +++ b/extensions/protobuf/src/test/java/io/deephaven/protobuf/ByteWrapperCustomType.java @@ -3,9 +3,9 @@ import com.google.auto.service.AutoService; import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Message; -import io.deephaven.functions.ToByteFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.functions.TypedFunction; +import io.deephaven.function.ToByteFunction; +import io.deephaven.function.ToObjectFunction; +import io.deephaven.function.TypedFunction; import io.deephaven.protobuf.test.ByteWrapper; import io.deephaven.qst.type.Type; diff --git a/extensions/protobuf/src/test/java/io/deephaven/protobuf/FieldPathTest.java b/extensions/protobuf/src/test/java/io/deephaven/protobuf/FieldPathTest.java index 858d008c384..92671c75f06 100644 --- a/extensions/protobuf/src/test/java/io/deephaven/protobuf/FieldPathTest.java +++ b/extensions/protobuf/src/test/java/io/deephaven/protobuf/FieldPathTest.java @@ -1,7 +1,7 @@ package io.deephaven.protobuf; import com.google.protobuf.Descriptors.FieldDescriptor; -import io.deephaven.functions.ToBooleanFunction; +import io.deephaven.function.ToBooleanFunction; import io.deephaven.protobuf.test.FieldPathTesting; import io.deephaven.protobuf.test.FieldPathTesting.Bar; import io.deephaven.protobuf.test.FieldPathTesting.Baz; diff --git a/extensions/protobuf/src/test/java/io/deephaven/protobuf/ProtobufDescriptorParserTest.java b/extensions/protobuf/src/test/java/io/deephaven/protobuf/ProtobufDescriptorParserTest.java index 47db6a87599..508b253078d 100644 --- a/extensions/protobuf/src/test/java/io/deephaven/protobuf/ProtobufDescriptorParserTest.java +++ b/extensions/protobuf/src/test/java/io/deephaven/protobuf/ProtobufDescriptorParserTest.java @@ -16,9 +16,9 @@ import com.google.protobuf.Timestamp; import com.google.protobuf.UInt32Value; import com.google.protobuf.UInt64Value; -import io.deephaven.functions.ToLongFunction; -import io.deephaven.functions.ToObjectFunction; -import io.deephaven.functions.TypedFunction; +import io.deephaven.function.ToLongFunction; +import io.deephaven.function.ToObjectFunction; +import io.deephaven.function.TypedFunction; import io.deephaven.protobuf.FieldOptions.BytesBehavior; import io.deephaven.protobuf.FieldOptions.MapBehavior; import io.deephaven.protobuf.FieldOptions.WellKnownBehavior; diff --git a/settings.gradle b/settings.gradle index 97d5ba67270..6a724c3de62 100644 --- a/settings.gradle +++ b/settings.gradle @@ -212,6 +212,12 @@ project(':engine-query-constants').projectDir = file('engine/query-constants') include(':engine-sql') project(':engine-sql').projectDir = file('engine/sql') +include ':engine-processor' +project(':engine-processor').projectDir = file('engine/processor') + +include ':engine-processor-function' +project(':engine-processor-function').projectDir = file('engine/processor-function') + include(':extensions-csv') project(':extensions-csv').projectDir = file('extensions/csv') @@ -316,7 +322,10 @@ project(':qst-type').projectDir = file('qst/type') include(':application-mode') include(':util-immutables') -project(':util-immutables').projectDir = file('Util/util-immutables') +project(':util-immutables').projectDir = file('Util/immutables') + +include ':util-function' +project(':util-function').projectDir = file('Util/function') include(':deephaven-jpy-config') project(':deephaven-jpy-config').projectDir = file('py/jpy-config')