From 8cc80ff44c56125d59e010b4299582ecef6b40ae Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Wed, 28 Aug 2024 14:10:37 +0100 Subject: [PATCH] Add quality warnings to pulsar (#32346) * Add quality warnings to pulsar * spotless --- .../org/apache/beam/sdk/io/pulsar/PulsarIO.java | 15 +++++++++++++++ .../beam/sdk/io/pulsar/ReadFromPulsarDoFn.java | 5 +++++ .../beam/sdk/io/pulsar/WriteToPulsarDoFn.java | 5 +++++ .../apache/beam/sdk/io/pulsar/package-info.java | 6 +++++- 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/PulsarIO.java b/sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/PulsarIO.java index 6d0f0a08a0192..aaff08a96d369 100644 --- a/sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/PulsarIO.java +++ b/sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/PulsarIO.java @@ -31,12 +31,22 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.joda.time.Instant; +/** + * Class for reading and writing from Apache Pulsar. Support is currently incomplete, and there may + * be bugs; see https://github.com/apache/beam/issues/31078 for more info, and comment in that issue + * if you run into issues with this IO. + */ @SuppressWarnings({"rawtypes", "nullness"}) public class PulsarIO { /** Static class, prevent instantiation. */ private PulsarIO() {} + /** + * Read from Apache Pulsar. Support is currently incomplete, and there may be bugs; see + * https://github.com/apache/beam/issues/31078 for more info, and comment in that issue if you run + * into issues with this IO. + */ public static Read read() { return new AutoValue_PulsarIO_Read.Builder() .setPulsarClient(PulsarIOUtils.PULSAR_CLIENT_SERIALIZABLE_FUNCTION) @@ -144,6 +154,11 @@ public PCollection expand(PBegin input) { } } + /** + * Write to Apache Pulsar. Support is currently incomplete, and there may be bugs; see + * https://github.com/apache/beam/issues/31078 for more info, and comment in that issue if you run + * into issues with this IO. + */ public static Write write() { return new AutoValue_PulsarIO_Write.Builder().build(); } diff --git a/sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/ReadFromPulsarDoFn.java b/sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/ReadFromPulsarDoFn.java index 97a8dcd6e2b45..a4e0a78e6343c 100644 --- a/sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/ReadFromPulsarDoFn.java +++ b/sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/ReadFromPulsarDoFn.java @@ -43,6 +43,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * Transform for reading from Apache Pulsar. Support is currently incomplete, and there may be bugs; + * see https://github.com/apache/beam/issues/31078 for more info, and comment in that issue if you + * run into issues with this IO. + */ @DoFn.UnboundedPerElement @SuppressWarnings({"rawtypes", "nullness"}) public class ReadFromPulsarDoFn extends DoFn { diff --git a/sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/WriteToPulsarDoFn.java b/sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/WriteToPulsarDoFn.java index 9659940e02bd2..375e8ce92a3a7 100644 --- a/sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/WriteToPulsarDoFn.java +++ b/sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/WriteToPulsarDoFn.java @@ -23,6 +23,11 @@ import org.apache.pulsar.client.api.PulsarClient; import org.apache.pulsar.client.api.PulsarClientException; +/** + * Transform for writing to Apache Pulsar. Support is currently incomplete, and there may be bugs; + * see https://github.com/apache/beam/issues/31078 for more info, and comment in that issue if you + * run into issues with this IO. + */ @DoFn.UnboundedPerElement @SuppressWarnings({"rawtypes", "nullness"}) public class WriteToPulsarDoFn extends DoFn { diff --git a/sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/package-info.java b/sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/package-info.java index 8b7ab101a72df..ffa15257fe5ae 100644 --- a/sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/package-info.java +++ b/sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/package-info.java @@ -15,5 +15,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** Transforms for reading and writing from Apache Pulsar. */ +/** + * Transforms for reading and writing from Apache Pulsar. Support is currently incomplete, and there + * may be bugs; see https://github.com/apache/beam/issues/31078 for more info, and comment in that + * issue if you run into issues with this IO. + */ package org.apache.beam.sdk.io.pulsar;