类 PulsarClientImpl
java.lang.Object
org.apache.pulsar.client.impl.PulsarClientImpl
- 所有已实现的接口:
Closeable,AutoCloseable,PulsarClient
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明protected final ClientConfigurationDataprotected final io.netty.channel.EventLoopGroup -
构造器概要
构造器构造器说明PulsarClientImpl(ClientConfigurationData conf, io.netty.channel.EventLoopGroup eventLoopGroup) PulsarClientImpl(ClientConfigurationData conf, io.netty.channel.EventLoopGroup eventLoopGroup, ConnectionPool cnxPool) PulsarClientImpl(ClientConfigurationData conf, io.netty.channel.EventLoopGroup eventLoopGroup, ConnectionPool cnxPool, io.netty.util.Timer timer) -
方法概要
修饰符和类型方法说明voidclose()createLookup(String url) protected <T> CompletableFuture<Reader<T>>createMultiTopicReaderAsync(ReaderConfigurationData<T> conf, Schema<T> schema) CompletableFuture<Producer<byte[]>><T> CompletableFuture<Producer<T>>createProducerAsync(ProducerConfigurationData conf, Schema<T> schema) <T> CompletableFuture<Producer<T>>createProducerAsync(ProducerConfigurationData conf, Schema<T> schema, ProducerInterceptors interceptors) CompletableFuture<Reader<byte[]>>createReaderAsync(ReaderConfigurationData<byte[]> conf) <T> CompletableFuture<Reader<T>>createReaderAsync(ReaderConfigurationData<T> conf, Schema<T> schema) protected <T> CompletableFuture<Reader<T>>createSingleTopicReaderAsync(ReaderConfigurationData<T> conf, Schema<T> schema) io.netty.channel.EventLoopGroupgetConnection(String topic) Only for test.CompletableFuture<org.apache.commons.lang3.tuple.Pair<ClientCnx,Boolean>> getConnection(String topic, int randomKeyForSelectConnection) getConnection(String topic, String url) getConnection(InetSocketAddress logicalAddress, InetSocketAddress physicalAddress, int randomKeyForSelectConnection) getNumberOfPartitions(String topic) CompletableFuture<org.apache.pulsar.common.partition.PartitionedTopicMetadata>getPartitionsForTopic(String topic) getProxyConnection(InetSocketAddress logicalAddress, int randomKeyForSelectConnection) Read the schema information for a given topic.com.google.common.cache.LoadingCache<String,SchemaInfoProvider> getState()booleanisClosed()ConsumerBuilder<byte[]><T> ConsumerBuilder<T>newConsumer(Schema<T> schema) protected <T> PartitionedProducerImpl<T>newPartitionedProducerImpl(String topic, ProducerConfigurationData conf, Schema<T> schema, ProducerInterceptors interceptors, CompletableFuture<Producer<T>> producerCreatedFuture, org.apache.pulsar.common.partition.PartitionedTopicMetadata metadata) Factory method for creating PartitionedProducerImpl instance.ProducerBuilder<byte[]><T> ProducerBuilder<T>newProducer(Schema<T> schema) protected <T> ProducerImpl<T>newProducerImpl(String topic, int partitionIndex, ProducerConfigurationData conf, Schema<T> schema, ProducerInterceptors interceptors, CompletableFuture<Producer<T>> producerCreatedFuture, Optional<String> overrideProducerName) Factory method for creating ProducerImpl instance.ReaderBuilder<byte[]><T> ReaderBuilder<T>longTableViewBuilder<byte[]><T> TableViewBuilder<T>newTableView(Schema<T> schema) <T> TableViewBuilder<T>newTableViewBuilder(Schema<T> schema) 已过时。CompletableFuture<Consumer<byte[]>>patternTopicSubscribeAsync(ConsumerConfigurationData<byte[]> conf) protected <T> CompletableFuture<Schema<T>>preProcessSchemaBeforeSubscribe(PulsarClientImpl pulsarClientImpl, Schema<T> schema, String topicName) voidvoidsetLookup(LookupService lookup) voidshutdown()CompletableFuture<Consumer<byte[]>>subscribeAsync(ConsumerConfigurationData<byte[]> conf) <T> CompletableFuture<Consumer<T>>subscribeAsync(ConsumerConfigurationData<T> conf, Schema<T> schema, ConsumerInterceptors<T> interceptors) io.netty.util.Timertimer()visible for pulsar-functions.voidupdateAuthentication(Authentication authentication) voidupdateServiceUrl(String serviceUrl) voidupdateTlsTrustCertsFilePath(String tlsTrustCertsFilePath) voidupdateTlsTrustStorePathAndPassword(String tlsTrustStorePath, String tlsTrustStorePassword)
-
字段详细资料
-
conf
-
eventLoopGroup
protected final io.netty.channel.EventLoopGroup eventLoopGroup
-
-
构造器详细资料
-
PulsarClientImpl
-
PulsarClientImpl
public PulsarClientImpl(ClientConfigurationData conf, io.netty.channel.EventLoopGroup eventLoopGroup) throws PulsarClientException -
PulsarClientImpl
public PulsarClientImpl(ClientConfigurationData conf, io.netty.channel.EventLoopGroup eventLoopGroup, ConnectionPool cnxPool) throws PulsarClientException -
PulsarClientImpl
public PulsarClientImpl(ClientConfigurationData conf, io.netty.channel.EventLoopGroup eventLoopGroup, ConnectionPool cnxPool, io.netty.util.Timer timer) throws PulsarClientException
-
-
方法详细资料
-
getConfiguration
-
getClientClock
-
getState
-
newProducer
- 指定者:
newProducer在接口中PulsarClient
-
newProducer
- 指定者:
newProducer在接口中PulsarClient
-
newConsumer
- 指定者:
newConsumer在接口中PulsarClient
-
newConsumer
- 指定者:
newConsumer在接口中PulsarClient
-
newReader
- 指定者:
newReader在接口中PulsarClient
-
newReader
- 指定者:
newReader在接口中PulsarClient
-
newTableViewBuilder
已过时。usenewTableView(Schema)instead.- 指定者:
newTableViewBuilder在接口中PulsarClient
-
newTableView
- 指定者:
newTableView在接口中PulsarClient
-
newTableView
- 指定者:
newTableView在接口中PulsarClient
-
createProducerAsync
-
createProducerAsync
public <T> CompletableFuture<Producer<T>> createProducerAsync(ProducerConfigurationData conf, Schema<T> schema) -
createProducerAsync
public <T> CompletableFuture<Producer<T>> createProducerAsync(ProducerConfigurationData conf, Schema<T> schema, ProducerInterceptors interceptors) -
newPartitionedProducerImpl
protected <T> PartitionedProducerImpl<T> newPartitionedProducerImpl(String topic, ProducerConfigurationData conf, Schema<T> schema, ProducerInterceptors interceptors, CompletableFuture<Producer<T>> producerCreatedFuture, org.apache.pulsar.common.partition.PartitionedTopicMetadata metadata) Factory method for creating PartitionedProducerImpl instance. Allows overriding the PartitionedProducerImpl instance in tests.- 类型参数:
T- message type class- 参数:
topic- topic nameconf- producer configurationschema- topic schemainterceptors- producer interceptorsproducerCreatedFuture- future for signaling completion of async producer creationmetadata- partitioned topic metadata- 返回:
- new PartitionedProducerImpl instance
-
newProducerImpl
protected <T> ProducerImpl<T> newProducerImpl(String topic, int partitionIndex, ProducerConfigurationData conf, Schema<T> schema, ProducerInterceptors interceptors, CompletableFuture<Producer<T>> producerCreatedFuture, Optional<String> overrideProducerName) Factory method for creating ProducerImpl instance. Allows overriding the ProducerImpl instance in tests.- 类型参数:
T- message type class- 参数:
topic- topic namepartitionIndex- partition index of a partitioned topic. the value -1 is used for non-partitioned topics.conf- producer configurationschema- topic schemainterceptors- producer interceptorsproducerCreatedFuture- future for signaling completion of async producer creation- 返回:
- a producer instance
-
subscribeAsync
-
subscribeAsync
public <T> CompletableFuture<Consumer<T>> subscribeAsync(ConsumerConfigurationData<T> conf, Schema<T> schema, ConsumerInterceptors<T> interceptors) -
patternTopicSubscribeAsync
public CompletableFuture<Consumer<byte[]>> patternTopicSubscribeAsync(ConsumerConfigurationData<byte[]> conf) -
createReaderAsync
-
createReaderAsync
public <T> CompletableFuture<Reader<T>> createReaderAsync(ReaderConfigurationData<T> conf, Schema<T> schema) -
createMultiTopicReaderAsync
protected <T> CompletableFuture<Reader<T>> createMultiTopicReaderAsync(ReaderConfigurationData<T> conf, Schema<T> schema) -
createSingleTopicReaderAsync
protected <T> CompletableFuture<Reader<T>> createSingleTopicReaderAsync(ReaderConfigurationData<T> conf, Schema<T> schema) -
getSchema
Read the schema information for a given topic. If the topic does not exist or it has no schema associated, it will return an empty response -
close
- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中Closeable- 指定者:
close在接口中PulsarClient- 抛出:
PulsarClientException
-
closeAsync
- 指定者:
closeAsync在接口中PulsarClient
-
shutdown
- 指定者:
shutdown在接口中PulsarClient- 抛出:
PulsarClientException
-
isClosed
public boolean isClosed()- 指定者:
isClosed在接口中PulsarClient
-
updateServiceUrl
- 指定者:
updateServiceUrl在接口中PulsarClient- 抛出:
PulsarClientException
-
updateAuthentication
- 抛出:
IOException
-
updateTlsTrustCertsFilePath
-
updateTlsTrustStorePathAndPassword
-
getConnection
public CompletableFuture<org.apache.commons.lang3.tuple.Pair<ClientCnx,Boolean>> getConnection(String topic, int randomKeyForSelectConnection) -
getConnection
Only for test. -
getConnection
-
getLookup
-
getConnectionToServiceUrl
-
getProxyConnection
public CompletableFuture<ClientCnx> getProxyConnection(InetSocketAddress logicalAddress, int randomKeyForSelectConnection) -
getConnection
public CompletableFuture<ClientCnx> getConnection(InetSocketAddress logicalAddress, InetSocketAddress physicalAddress, int randomKeyForSelectConnection) -
timer
public io.netty.util.Timer timer()visible for pulsar-functions. -
externalExecutorProvider
-
newRequestId
public long newRequestId() -
getCnxPool
-
eventLoopGroup
public io.netty.channel.EventLoopGroup eventLoopGroup() -
setLookup
-
getLookup
-
reloadLookUp
-
createLookup
-
getNumberOfPartitions
-
getPartitionedTopicMetadata
public CompletableFuture<org.apache.pulsar.common.partition.PartitionedTopicMetadata> getPartitionedTopicMetadata(String topic) -
getPartitionsForTopic
- 指定者:
getPartitionsForTopic在接口中PulsarClient
-
getSchemaProviderLoadingCache
public com.google.common.cache.LoadingCache<String,SchemaInfoProvider> getSchemaProviderLoadingCache() -
getMemoryLimitController
-
preProcessSchemaBeforeSubscribe
protected <T> CompletableFuture<Schema<T>> preProcessSchemaBeforeSubscribe(PulsarClientImpl pulsarClientImpl, Schema<T> schema, String topicName) -
getInternalExecutorService
-
getScheduledExecutorProvider
-
newTransaction
- 指定者:
newTransaction在接口中PulsarClient
-
newTableView(Schema)instead.