public class PartitionedProducerImpl<T> extends ProducerBase<T>
| Modifier and Type | Field and Description |
|---|---|
protected PulsarClientImpl |
client |
protected String |
topic |
conf, interceptors, producerCreatedFuture, schema| Constructor and Description |
|---|
PartitionedProducerImpl(PulsarClientImpl client,
String topic,
ProducerConfigurationData conf,
int numPartitions,
CompletableFuture<Producer<T>> producerCreatedFuture,
org.apache.pulsar.client.api.Schema<T> schema,
ProducerInterceptors<T> interceptors) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
changeToReadyState() |
CompletableFuture<Void> |
closeAsync()
Close the producer and releases resources allocated.
|
CompletableFuture<Void> |
flushAsync()
Flush all the messages buffered in the client and wait until all messages have been successfully persisted.
|
protected org.apache.pulsar.client.impl.HandlerState.State |
getAndUpdateState(UnaryOperator<org.apache.pulsar.client.impl.HandlerState.State> updater) |
PulsarClientImpl |
getClient() |
long |
getLastSequenceId()
Get the last sequence id that was published by this producer.
|
String |
getProducerName() |
List<ProducerImpl<T>> |
getProducers() |
protected org.apache.pulsar.client.impl.HandlerState.State |
getState() |
ProducerStatsRecorderImpl |
getStats()
Get statistics for the producer
numMsgsSent : Number of messages sent in the current interval
numBytesSent : Number of bytes sent in the current interval
numSendFailed : Number of messages failed to send in the current interval
numAcksReceived : Number of acks received in the current interval
totalMsgsSent : Total number of messages sent
totalBytesSent : Total number of bytes sent
totalSendFailed : Total number of messages failed to send
totalAcksReceived: Total number of acks received
|
boolean |
isConnected() |
protected void |
setState(org.apache.pulsar.client.impl.HandlerState.State s) |
beforeSend, close, flush, getConfiguration, getTopic, newMessage, onSendAcknowledgement, producerCreatedFuture, send, send, sendAsync, sendAsync, toStringprotected final PulsarClientImpl client
protected final String topic
public PartitionedProducerImpl(PulsarClientImpl client, String topic, ProducerConfigurationData conf, int numPartitions, CompletableFuture<Producer<T>> producerCreatedFuture, org.apache.pulsar.client.api.Schema<T> schema, ProducerInterceptors<T> interceptors)
public String getProducerName()
public long getLastSequenceId()
Producer
This represent either the automatically assigned or custom sequence id (set on the MessageBuilder) that
was published and acknowledged by the broker.
After recreating a producer with the same producer name, this will return the last message that was published in the previous producer session, or -1 if there no message was ever published.
public CompletableFuture<Void> flushAsync()
ProducerProducer.flush()public boolean isConnected()
public CompletableFuture<Void> closeAsync()
ProducercloseAsync in interface Producer<T>closeAsync in class ProducerBase<T>public ProducerStatsRecorderImpl getStats()
Producerpublic List<ProducerImpl<T>> getProducers()
protected boolean changeToReadyState()
protected org.apache.pulsar.client.impl.HandlerState.State getState()
protected void setState(org.apache.pulsar.client.impl.HandlerState.State s)
protected org.apache.pulsar.client.impl.HandlerState.State getAndUpdateState(UnaryOperator<org.apache.pulsar.client.impl.HandlerState.State> updater)
public PulsarClientImpl getClient()
Copyright © 2017–2019 Apache Software Foundation. All rights reserved.