Package org.apache.beam.sdk.io.pulsar
Class PulsarIO.Read<T>
java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PBegin,PCollection<T>>
org.apache.beam.sdk.io.pulsar.PulsarIO.Read<T>
- All Implemented Interfaces:
Serializable,HasDisplayData
- Enclosing class:
PulsarIO
- See Also:
-
Field Summary
Fields inherited from class org.apache.beam.sdk.transforms.PTransform
annotations, displayData, name, resourceHints -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOverride this method to specify how thisPTransformshould be expanded on the givenInputT.withAdminUrl(String url) Configure Pulsar admin url.withClientUrl(String url) Configure Pulsar client url.withConsumerPollingTimeout(long duration) Sets the timeout time in seconds for Pulsar consumer polling request.withEndMessageId(org.apache.pulsar.client.api.MessageId msgId) withEndTimestamp(Long timestamp) Set elements timestamped to the moment it get processed.Set elements timestamped byMessage.getPublishTime().withPulsarAdmin(SerializableFunction<String, org.apache.pulsar.client.admin.PulsarAdmin> pulsarAdminFn) withPulsarClient(SerializableFunction<String, org.apache.pulsar.client.api.PulsarClient> pulsarClientFn) withStartTimestamp(Long timestamp) Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
-
Constructor Details
-
Read
public Read()
-
-
Method Details
-
withAdminUrl
Configure Pulsar admin url.Admin client is used to approximate backlogs. This setting is optional.
- Parameters:
url- admin url. For example,"http://localhost:8080".
-
withClientUrl
Configure Pulsar client url."pulsar://localhost:6650".- Parameters:
url- client url. For example,
-
withTopic
-
withStartTimestamp
-
withEndTimestamp
-
withEndMessageId
-
withPublishTime
Set elements timestamped byMessage.getPublishTime(). It is the default. -
withProcessingTime
Set elements timestamped to the moment it get processed. -
withConsumerPollingTimeout
Sets the timeout time in seconds for Pulsar consumer polling request. A lower timeout optimizes for latency. Increase the timeout if the consumer is not fetching any records. The default is 2 seconds. -
withPulsarClient
public PulsarIO.Read<T> withPulsarClient(SerializableFunction<String, org.apache.pulsar.client.api.PulsarClient> pulsarClientFn) -
withPulsarAdmin
public PulsarIO.Read<T> withPulsarAdmin(SerializableFunction<String, org.apache.pulsar.client.admin.PulsarAdmin> pulsarAdminFn) -
expand
Description copied from class:PTransformOverride this method to specify how thisPTransformshould be expanded on the givenInputT.NOTE: This method should not be called directly. Instead apply the
PTransformshould be applied to theInputTusing theapplymethod.Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).
- Specified by:
expandin classPTransform<PBegin,PCollection<T>>
-