接口 TableViewBuilder<T>
TableViewBuilder is used to configure and create instances of TableView.- 从以下版本开始:
- 2.10.0
- 另请参阅:
-
方法概要
修饰符和类型方法说明autoUpdatePartitionsInterval(int interval, TimeUnit unit) Set the interval of updating partitions (default: 1 minute).create()Finalize the creation of theTableViewinstance.Finalize the creation of theTableViewinstance in asynchronous mode.Set theConsumerCryptoFailureActionto specify.cryptoKeyReader(CryptoKeyReader cryptoKeyReader) Set theCryptoKeyReaderto decrypt the message payloads.defaultCryptoKeyReader(String privateKey) Set the default implementation ofCryptoKeyReader.defaultCryptoKeyReader(Map<String, String> privateKeys) Set the default implementation ofCryptoKeyReader.Load the configuration from provided config map.subscriptionName(String subscriptionName) Set the subscription name of theTableView.Set the topic name of theTableView.
-
方法详细资料
-
loadConf
Load the configuration from provided config map.Example:
Map<String, Object> config = new HashMap<>(); config.put("topicName", "test-topic"); config.put("autoUpdatePartitionsSeconds", "300"); TableViewBuilder<byte[]> builder = ...; builder = builder.loadConf(config); TableView<byte[]> tableView = builder.create();- 参数:
config- configuration to load- 返回:
- the
TableViewBuilderinstance
-
create
Finalize the creation of theTableViewinstance.This method will block until the tableView is created successfully or an exception is thrown.
- 返回:
- the
TableViewinstance - 抛出:
PulsarClientException- if the tableView creation fails
-
createAsync
CompletableFuture<TableView<T>> createAsync()Finalize the creation of theTableViewinstance in asynchronous mode.This method will return a
CompletableFuturethat can be used to access the instance when it's ready.- 返回:
- the
TableViewinstance
-
topic
Set the topic name of theTableView.- 参数:
topic- the name of the topic to create theTableView- 返回:
- the
TableViewBuilderbuilder instance
-
autoUpdatePartitionsInterval
Set the interval of updating partitions (default: 1 minute).- 参数:
interval- the interval of updating partitionsunit- the time unit of the interval- 返回:
- the
TableViewBuilderbuilder instance
-
subscriptionName
Set the subscription name of theTableView.- 参数:
subscriptionName- the name of the subscription to the topic- 返回:
- the
TableViewBuilderbuilder instance
-
cryptoKeyReader
Set theCryptoKeyReaderto decrypt the message payloads.- 参数:
cryptoKeyReader- CryptoKeyReader object- 返回:
- the
TableViewBuilderbuilder instance
-
defaultCryptoKeyReader
Set the default implementation ofCryptoKeyReader.Configure the key reader to be used to decrypt message payloads.
- 参数:
privateKey- the private key that is always used to decrypt message payloads.- 返回:
- the
TableViewBuilderbuilder instance
-
defaultCryptoKeyReader
Set the default implementation ofCryptoKeyReader.Configure the key reader to be used to decrypt message payloads.
- 参数:
privateKeys- the map of private key names and their URIs used to decrypt message payloads.- 返回:
- the
TableViewBuilderbuilder instance
-
cryptoFailureAction
Set theConsumerCryptoFailureActionto specify.- 参数:
action- the action to take when the decoding fails- 返回:
- the
TableViewBuilderbuilder instance
-