You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "shibd (via GitHub)" <gi...@apache.org> on 2023/02/07 09:54:37 UTC

[GitHub] [pulsar-client-cpp] shibd opened a new pull request, #189: [TableView-1] Add table view API

shibd opened a new pull request, #189:
URL: https://github.com/apache/pulsar-client-cpp/pull/189

   ### Motivation
   #89
   
   The interface definition is committed first, and the commit does not affect compilation. After this merge will push impl.
   
   ### Modifications
   - Define Table view API.
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc-required` 
   (Your PR needs to update docs and you will update later)
   
   - [ ] `doc-not-needed` 
   (Please explain why)
   
   - [x] `doc` 
   (Your PR contains doc changes)
   
   - [ ] `doc-complete`
   (Docs have been already added)
   


-- 
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


[GitHub] [pulsar-client-cpp] BewareMyPower merged pull request #189: [TableView-1] Add table view API

Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower merged PR #189:
URL: https://github.com/apache/pulsar-client-cpp/pull/189


-- 
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


[GitHub] [pulsar-client-cpp] BewareMyPower commented on a diff in pull request #189: [TableView-1] Add table view API

Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower commented on code in PR #189:
URL: https://github.com/apache/pulsar-client-cpp/pull/189#discussion_r1103932572


##########
include/pulsar/TableViewConfiguration.h:
##########
@@ -0,0 +1,73 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#ifndef PULSAR_TABLEVIEW_CONFIGURATION_H_
+#define PULSAR_TABLEVIEW_CONFIGURATION_H_
+
+#include <pulsar/Schema.h>
+#include <pulsar/defines.h>
+
+#include <memory>
+
+namespace pulsar {
+
+struct TableViewConfigurationImpl;
+
+/**
+ * Class specifying the configuration of a consumer.
+ */
+class PULSAR_PUBLIC TableViewConfiguration {

Review Comment:
   Since we have no backward compatibility issue with this new configuration, could you just simplify it with the POD design?
   
   ```c++
   struct TableViewConfiguration {
       SchemaInfo schemaInfo;
       std::string subscriptionName;
   };
   ```
   
   It could save much code and it's more clear.



-- 
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


[GitHub] [pulsar-client-cpp] BewareMyPower commented on a diff in pull request #189: [TableView-1] Add table view API

Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower commented on code in PR #189:
URL: https://github.com/apache/pulsar-client-cpp/pull/189#discussion_r1103931515


##########
include/pulsar/TableViewConfiguration.h:
##########
@@ -0,0 +1,73 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#ifndef PULSAR_TABLEVIEW_CONFIGURATION_H_
+#define PULSAR_TABLEVIEW_CONFIGURATION_H_
+
+#include <pulsar/Schema.h>
+#include <pulsar/defines.h>
+
+#include <memory>
+
+namespace pulsar {
+
+struct TableViewConfigurationImpl;
+
+/**
+ * Class specifying the configuration of a consumer.
+ */
+class PULSAR_PUBLIC TableViewConfiguration {
+   public:
+    TableViewConfiguration();
+    ~TableViewConfiguration();
+    TableViewConfiguration(const TableViewConfiguration&);
+    TableViewConfiguration& operator=(const TableViewConfiguration&);
+
+    /**
+     * @return the schema information declared for this consumer
+     */
+    const SchemaInfo& getSchemaInfo() const;
+
+    /**
+     * 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.
+     *
+     * @param schemaInfo the schema definition object
+     */
+    TableViewConfiguration& setSchemaInfo(const SchemaInfo& schemaInfo);
+
+    /**
+     * @return subscriptionName
+     */
+    const std::string& getSubscriptionName() const;
+
+    /**
+     * Set the internal consumer subscription name of the {@link TableView}.
+     *
+     * @param subscriptionName the name of the subscription to the topic.
+     * Default value is reader-{random string}.
+     */
+    TableViewConfiguration& setSubscriptionName(const std::string subscriptionName);

Review Comment:
   ```suggestion
       TableViewConfiguration& setSubscriptionName(const std::string& subscriptionName);
   ```



-- 
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


[GitHub] [pulsar-client-cpp] shibd commented on a diff in pull request #189: [TableView-1] Add table view API

Posted by "shibd (via GitHub)" <gi...@apache.org>.
shibd commented on code in PR #189:
URL: https://github.com/apache/pulsar-client-cpp/pull/189#discussion_r1105212727


##########
include/pulsar/TableViewConfiguration.h:
##########
@@ -0,0 +1,73 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#ifndef PULSAR_TABLEVIEW_CONFIGURATION_H_
+#define PULSAR_TABLEVIEW_CONFIGURATION_H_
+
+#include <pulsar/Schema.h>
+#include <pulsar/defines.h>
+
+#include <memory>
+
+namespace pulsar {
+
+struct TableViewConfigurationImpl;
+
+/**
+ * Class specifying the configuration of a consumer.
+ */
+class PULSAR_PUBLIC TableViewConfiguration {

Review Comment:
   Sure. Done. PTAL.



-- 
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