Package org.apache.pulsar.client.impl
Class PartitionedProducerImpl<T>
- java.lang.Object
-
- org.apache.pulsar.client.impl.ProducerBase<T>
-
- org.apache.pulsar.client.impl.PartitionedProducerImpl<T>
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,org.apache.pulsar.client.api.Producer<T>
public class PartitionedProducerImpl<T> extends ProducerBase<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.pulsar.client.impl.ProducerBase
ProducerBase.MultiSchemaMode
-
-
Field Summary
Fields Modifier and Type Field Description protected PulsarClientImplclientprotected java.lang.Stringtopic-
Fields inherited from class org.apache.pulsar.client.impl.ProducerBase
conf, interceptors, multiSchemaMode, producerCreatedFuture, schema, schemaCache
-
-
Constructor Summary
Constructors Constructor Description PartitionedProducerImpl(PulsarClientImpl client, java.lang.String topic, ProducerConfigurationData conf, int numPartitions, java.util.concurrent.CompletableFuture<org.apache.pulsar.client.api.Producer<T>> producerCreatedFuture, org.apache.pulsar.client.api.Schema<T> schema, ProducerInterceptors interceptors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanchangeToConnecting()protected booleanchangeToReadyState()protected booleanchangeToRegisteringSchemaState()java.util.concurrent.CompletableFuture<java.lang.Void>closeAsync()java.util.concurrent.CompletableFuture<java.lang.Void>flushAsync()protected org.apache.pulsar.client.impl.HandlerState.StategetAndUpdateState(java.util.function.UnaryOperator<org.apache.pulsar.client.impl.HandlerState.State> updater)PulsarClientImplgetClient()longgetLastDisconnectedTimestamp()longgetLastSequenceId()intgetNumOfPartitions()java.util.concurrent.CompletableFuture<java.lang.Void>getOriginalLastSendFuture()java.util.concurrent.CompletableFuture<java.lang.Void>getPartitionsAutoUpdateFuture()io.netty.util.TimeoutgetPartitionsAutoUpdateTimeout()java.lang.StringgetProducerName()java.util.List<ProducerImpl<T>>getProducers()protected org.apache.pulsar.client.impl.HandlerState.StategetState()ProducerStatsRecorderImplgetStats()booleanisConnected()protected voidsetState(org.apache.pulsar.client.impl.HandlerState.State s)-
Methods inherited from class org.apache.pulsar.client.impl.ProducerBase
beforeSend, close, flush, getConfiguration, getTopic, newMessage, newMessage, newMessage, onPartitionsChange, onSendAcknowledgement, producerCreatedFuture, send, send, sendAsync, sendAsync, toString
-
-
-
-
Field Detail
-
client
protected final PulsarClientImpl client
-
topic
protected final java.lang.String topic
-
-
Constructor Detail
-
PartitionedProducerImpl
public PartitionedProducerImpl(PulsarClientImpl client, java.lang.String topic, ProducerConfigurationData conf, int numPartitions, java.util.concurrent.CompletableFuture<org.apache.pulsar.client.api.Producer<T>> producerCreatedFuture, org.apache.pulsar.client.api.Schema<T> schema, ProducerInterceptors interceptors)
-
-
Method Detail
-
getProducerName
public java.lang.String getProducerName()
-
getLastSequenceId
public long getLastSequenceId()
-
flushAsync
public java.util.concurrent.CompletableFuture<java.lang.Void> flushAsync()
-
isConnected
public boolean isConnected()
-
getLastDisconnectedTimestamp
public long getLastDisconnectedTimestamp()
-
closeAsync
public java.util.concurrent.CompletableFuture<java.lang.Void> closeAsync()
- Specified by:
closeAsyncin interfaceorg.apache.pulsar.client.api.Producer<T>- Specified by:
closeAsyncin classProducerBase<T>
-
getStats
public ProducerStatsRecorderImpl getStats()
-
getProducers
public java.util.List<ProducerImpl<T>> getProducers()
-
getPartitionsAutoUpdateFuture
public java.util.concurrent.CompletableFuture<java.lang.Void> getPartitionsAutoUpdateFuture()
-
getPartitionsAutoUpdateTimeout
public io.netty.util.Timeout getPartitionsAutoUpdateTimeout()
-
getOriginalLastSendFuture
public java.util.concurrent.CompletableFuture<java.lang.Void> getOriginalLastSendFuture()
-
getNumOfPartitions
public int getNumOfPartitions()
-
changeToReadyState
protected boolean changeToReadyState()
-
changeToRegisteringSchemaState
protected boolean changeToRegisteringSchemaState()
-
getState
protected org.apache.pulsar.client.impl.HandlerState.State getState()
-
changeToConnecting
protected boolean changeToConnecting()
-
setState
protected void setState(org.apache.pulsar.client.impl.HandlerState.State s)
-
getAndUpdateState
protected org.apache.pulsar.client.impl.HandlerState.State getAndUpdateState(java.util.function.UnaryOperator<org.apache.pulsar.client.impl.HandlerState.State> updater)
-
getClient
public PulsarClientImpl getClient()
-
-