Skip to content

Commit

Permalink
Add quality warnings to pulsar (apache#32346)
Browse files Browse the repository at this point in the history
* Add quality warnings to pulsar

* spotless
  • Loading branch information
damccorm authored and reeba212 committed Dec 4, 2024
1 parent a35e304 commit 4be1a6a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -144,6 +154,11 @@ public PCollection<PulsarMessage> 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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<PulsarSourceDescriptor, PulsarMessage> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<byte[], Void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 4be1a6a

Please sign in to comment.