diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakePageSource.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakePageSource.java index 8eff63a9ffe4..9cd618593c3c 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakePageSource.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakePageSource.java @@ -34,6 +34,7 @@ import java.util.Optional; import java.util.OptionalLong; import java.util.Set; +import java.util.concurrent.CompletableFuture; import java.util.function.Supplier; import static com.google.common.base.Throwables.throwIfInstanceOf; @@ -162,6 +163,12 @@ public boolean isFinished() return delegate.isFinished(); } + @Override + public CompletableFuture isBlocked() + { + return delegate.isBlocked(); + } + @Override public Page getNextPage() { diff --git a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakePageSource.java b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakePageSource.java new file mode 100644 index 000000000000..022467bd0bb2 --- /dev/null +++ b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakePageSource.java @@ -0,0 +1,28 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.trino.plugin.deltalake; + +import io.trino.spi.connector.ConnectorPageSource; +import org.junit.jupiter.api.Test; + +import static io.trino.spi.testing.InterfaceTestUtils.assertAllMethodsOverridden; + +public class TestDeltaLakePageSource +{ + @Test + public void testEverythingImplemented() + { + assertAllMethodsOverridden(ConnectorPageSource.class, DeltaLakePageSource.class); + } +} diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HivePageSource.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HivePageSource.java index b951f6527afd..0c3c6bfff40a 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HivePageSource.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HivePageSource.java @@ -40,6 +40,7 @@ import java.util.List; import java.util.Optional; import java.util.OptionalLong; +import java.util.concurrent.CompletableFuture; import java.util.function.Function; import static com.google.common.base.Preconditions.checkArgument; @@ -152,6 +153,12 @@ public boolean isFinished() return delegate.isFinished(); } + @Override + public CompletableFuture isBlocked() + { + return delegate.isBlocked(); + } + @Override public Page getNextPage() { diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHivePageSource.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHivePageSource.java new file mode 100644 index 000000000000..c36be5c41eb4 --- /dev/null +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHivePageSource.java @@ -0,0 +1,28 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.trino.plugin.hive; + +import io.trino.spi.connector.ConnectorPageSource; +import org.junit.jupiter.api.Test; + +import static io.trino.spi.testing.InterfaceTestUtils.assertAllMethodsOverridden; + +public class TestHivePageSource +{ + @Test + public void testEverythingImplemented() + { + assertAllMethodsOverridden(ConnectorPageSource.class, HivePageSource.class); + } +} diff --git a/plugin/trino-hudi/src/main/java/io/trino/plugin/hudi/HudiPageSource.java b/plugin/trino-hudi/src/main/java/io/trino/plugin/hudi/HudiPageSource.java index 9c2edec73309..337ad783db8e 100644 --- a/plugin/trino-hudi/src/main/java/io/trino/plugin/hudi/HudiPageSource.java +++ b/plugin/trino-hudi/src/main/java/io/trino/plugin/hudi/HudiPageSource.java @@ -18,10 +18,13 @@ import io.trino.spi.block.Block; import io.trino.spi.block.RunLengthEncodedBlock; import io.trino.spi.connector.ConnectorPageSource; +import io.trino.spi.metrics.Metrics; import java.io.IOException; import java.util.List; import java.util.Map; +import java.util.OptionalLong; +import java.util.concurrent.CompletableFuture; import static io.airlift.slice.Slices.utf8Slice; import static io.trino.plugin.base.util.Closables.closeAllSuppress; @@ -113,6 +116,24 @@ public boolean isFinished() return dataPageSource.isFinished(); } + @Override + public CompletableFuture isBlocked() + { + return dataPageSource.isBlocked(); + } + + @Override + public OptionalLong getCompletedPositions() + { + return dataPageSource.getCompletedPositions(); + } + + @Override + public Metrics getMetrics() + { + return dataPageSource.getMetrics(); + } + @Override public Page getNextPage() { diff --git a/plugin/trino-hudi/src/test/java/io/trino/plugin/hudi/TestHudiPageSource.java b/plugin/trino-hudi/src/test/java/io/trino/plugin/hudi/TestHudiPageSource.java new file mode 100644 index 000000000000..8bb46f8fb3f5 --- /dev/null +++ b/plugin/trino-hudi/src/test/java/io/trino/plugin/hudi/TestHudiPageSource.java @@ -0,0 +1,28 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.trino.plugin.hudi; + +import io.trino.spi.connector.ConnectorPageSource; +import org.junit.jupiter.api.Test; + +import static io.trino.spi.testing.InterfaceTestUtils.assertAllMethodsOverridden; + +public class TestHudiPageSource +{ + @Test + public void testEverythingImplemented() + { + assertAllMethodsOverridden(ConnectorPageSource.class, HudiPageSource.class); + } +} diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergPageSource.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergPageSource.java index 32342239c5f5..7a2730d5d1b6 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergPageSource.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergPageSource.java @@ -29,6 +29,7 @@ import java.util.Map; import java.util.Optional; import java.util.OptionalLong; +import java.util.concurrent.CompletableFuture; import java.util.function.Supplier; import static com.google.common.base.Preconditions.checkArgument; @@ -113,6 +114,12 @@ public boolean isFinished() return delegate.isFinished(); } + @Override + public CompletableFuture isBlocked() + { + return delegate.isBlocked(); + } + @Override public Page getNextPage() { diff --git a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergPageSource.java b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergPageSource.java new file mode 100644 index 000000000000..15fe7fda0f9b --- /dev/null +++ b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergPageSource.java @@ -0,0 +1,34 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.trino.plugin.iceberg; + +import io.trino.spi.connector.ConnectorPageSource; +import org.junit.jupiter.api.Test; + +import static io.trino.spi.testing.InterfaceTestUtils.assertAllMethodsOverridden; + +public class TestIcebergPageSource +{ + @Test + public void testEverythingImplemented() + { + assertAllMethodsOverridden(ConnectorPageSource.class, IcebergPageSource.class); + } + + @Test + public void testEverythingImplementedConstantPopulatingPageSource() + { + assertAllMethodsOverridden(ConnectorPageSource.class, ConstantPopulatingPageSource.class); + } +}