Package org.apache.pulsar.client.api
Interface TableViewBuilder<T>
-
@Public @Evolving public interface TableViewBuilder<T>
TableViewBuilderis used to configure and create instances ofTableView.- Since:
- 2.10.0
- See Also:
()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TableViewBuilder<T>autoUpdatePartitionsInterval(int interval, java.util.concurrent.TimeUnit unit)Set the interval of updating partitions (default: 1 minute).TableView<T>create()Finalize the creation of theTableViewinstance.java.util.concurrent.CompletableFuture<TableView<T>>createAsync()Finalize the creation of theTableViewinstance in asynchronous mode.TableViewBuilder<T>loadConf(java.util.Map<java.lang.String,java.lang.Object> config)Load the configuration from provided config map.TableViewBuilder<T>topic(java.lang.String topic)Set the topic name of theTableView.
-
-
-
Method Detail
-
loadConf
TableViewBuilder<T> loadConf(java.util.Map<java.lang.String,java.lang.Object> config)
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();- Parameters:
config- configuration to load- Returns:
- the
TableViewBuilderinstance
-
create
TableView<T> create() throws PulsarClientException
Finalize the creation of theTableViewinstance.This method will block until the tableView is created successfully or an exception is thrown.
- Returns:
- the
TableViewinstance - Throws:
PulsarClientException- if the tableView creation fails
-
createAsync
java.util.concurrent.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.- Returns:
- the
TableViewinstance
-
topic
TableViewBuilder<T> topic(java.lang.String topic)
Set the topic name of theTableView.- Parameters:
topic- the name of the topic to create theTableView- Returns:
- the
TableViewBuilderbuilder instance
-
autoUpdatePartitionsInterval
TableViewBuilder<T> autoUpdatePartitionsInterval(int interval, java.util.concurrent.TimeUnit unit)
Set the interval of updating partitions (default: 1 minute).- Parameters:
interval- the interval of updating partitionsunit- the time unit of the interval- Returns:
- the
TableViewBuilderbuilder instance
-
-