You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "momo-jun (via GitHub)" <gi...@apache.org> on 2023/05/09 10:15:35 UTC

[GitHub] [pulsar-site] momo-jun commented on a diff in pull request #565: Add CPP client table view doc.

momo-jun commented on code in PR #565:
URL: https://github.com/apache/pulsar-site/pull/565#discussion_r1188439794


##########
docs/client-libraries-tableviews.md:
##########
@@ -4,36 +4,105 @@ title: Work with TableView
 sidebar_label: "Work with TableView"
 ---
 
+````mdx-code-block
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+````
+
 After setting up your clients, you can explore more to start working with [TableView](concepts-clients.md#tableview).
 
 ## Configure TableView
 
-The following is an example of how to configure a TableView.
 
-```java
-TableView<String> tv = client.newTableViewBuilder(Schema.STRING)
-  .topic("my-tableview")
-  .create()
-```
+````mdx-code-block
+<Tabs groupId="lang-choice"
+defaultValue="Java"
+values={[{"label":"Java","value":"Java"},{"label":"C++","value":"C++"}]}>
+<TabItem value="Java">
+
+  The following is an example of how to configure a TableView.
+  ```java
+    TableView<String> tv = client.newTableViewBuilder(Schema.STRING)
+    .topic("my-tableview")
+    .create()
+  ```
+
+  You can use the available parameters in the `loadConf` configuration or related [API](/api/client/2.10.0-SNAPSHOT/org/apache/pulsar/client/api/TableViewBuilder.html) to customize your TableView.
+
+  | Name | Type| Required? |  <div>Description</div> | Default
+  |---|---|---|---|---
+  | `topic` | string | yes | The topic name of the TableView. | N/A
+  | `autoUpdatePartitionInterval` | int | no | The interval to check for newly added partitions. | 60 (seconds)
+  | `subscriptionName` | string | no | The subscription name of the TableView. | null
+
+</TabItem>
+
+<TabItem value="C++">
+
+
+  This feature is supported in C++ client 3.2.0 or later versions.
+
+
+  ```cpp
+  ClientConfiguration clientConfiguration;
+  clientConfiguration.setPartititionsUpdateInterval(100);
+  Client client("pulsar://localhost:6650", clientConfiguration);
+  TableViewConfiguration tableViewConfiguration{schemaInfo, "test-subscription-name"};
+  TableView tableView;
+  client.createTableView("my-tableview", tableViewConfiguration, tableView)
+  ```
+
+  You can use the available parameters to customize your TableView.
+
+  | Name | Type| Required? |  <div>Description</div> | Default
+  |---|---|---|---|---
+  | `topic` | string | yes | The topic name of the TableView. | N/A
+  | `schemaInfo` | struct | no | Declare the schema of the data that this table view will be accepting. The schema will be checked against the schema of the topic, and the table view creation will fail if it's not compatible. | N/A

Review Comment:
   ```suggestion
     | `schemaInfo` | struct | no | Declare the schema of the data that this TableView can accept. The schema will be checked against the schema of the topic, and the TableView creation will fail if it's incompatible. | N/A
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org