You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/13 21:59:26 UTC

[GitHub] [pulsar] merlimat commented on a change in pull request #10213: [Doc] Add descriptions for C++ Client API docs

merlimat commented on a change in pull request #10213:
URL: https://github.com/apache/pulsar/pull/10213#discussion_r612590177



##########
File path: pulsar-client-cpp/include/pulsar/Client.h
##########
@@ -86,42 +86,140 @@ class PULSAR_PUBLIC Client {
      */
     Result createProducer(const std::string& topic, const ProducerConfiguration& conf, Producer& producer);
 
+    /**
+     * Asynchronously create a producer with the default ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param callback the callback that is triggered when the producer is created successfully or not

Review comment:
       We should add the `callback` argument: `Callback function that will be invoked when the operation is completed`

##########
File path: pulsar-client-cpp/include/pulsar/Client.h
##########
@@ -86,42 +86,140 @@ class PULSAR_PUBLIC Client {
      */
     Result createProducer(const std::string& topic, const ProducerConfiguration& conf, Producer& producer);
 
+    /**
+     * Asynchronously create a producer with the default ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param callback the callback that is triggered when the producer is created successfully or not
+     */
     void createProducerAsync(const std::string& topic, CreateProducerCallback callback);
 
+    /**
+     * Asynchronously create a producer with the customized ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param configuration the customized ProducerConfiguration
+     */
     void createProducerAsync(const std::string& topic, ProducerConfiguration conf,
                              CreateProducerCallback callback);
 
+    /**
+     * Subscribe to a given topic and subscription combination with the default ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name
+     * @return ResultOk if it subscribes to the topic successfully

Review comment:
       ```suggestion
        * @param[out] consumer the consumer instance to be returned
        * @return ResultOk if it subscribes to the topic successfully
   ```

##########
File path: pulsar-client-cpp/include/pulsar/Authentication.h
##########
@@ -178,14 +349,54 @@ class Oauth2TokenResult {
     Oauth2TokenResult();
     ~Oauth2TokenResult();
 
+    /**
+     * Set the access token string
+     *
+     * @param AccessToken the access token string

Review comment:
       ```suggestion
        * @param accessToken the access token string
   ```

##########
File path: pulsar-client-cpp/include/pulsar/Authentication.h
##########
@@ -157,9 +300,37 @@ class PULSAR_PUBLIC AuthAthenz : public Authentication {
    public:
     AuthAthenz(AuthenticationDataPtr&);
     ~AuthAthenz();
+
+    /**
+     * Create an AuthAthenz with a ParamMap
+     *
+     * The required parameter keys are “tenantDomain”, “tenantService”, “providerDomain”, “privateKey”, and
+     * “ztsUrl”
+     *
+     * @param parameter the key-value to construct ZTS client

Review comment:
       ```suggestion
        * @param params the key-value to construct ZTS client
   ```

##########
File path: pulsar-client-cpp/include/pulsar/Authentication.h
##########
@@ -178,14 +349,54 @@ class Oauth2TokenResult {
     Oauth2TokenResult();
     ~Oauth2TokenResult();
 
+    /**
+     * Set the access token string
+     *
+     * @param AccessToken the access token string
+     */
     Oauth2TokenResult& setAccessToken(const std::string& accessToken);
+
+    /**
+     * Set the ID token
+     *
+     * @param IdToken the ID token

Review comment:
       ```suggestion
        * @param idToken the ID token
   ```

##########
File path: pulsar-client-cpp/include/pulsar/Authentication.h
##########
@@ -178,14 +349,54 @@ class Oauth2TokenResult {
     Oauth2TokenResult();
     ~Oauth2TokenResult();
 
+    /**
+     * Set the access token string
+     *
+     * @param AccessToken the access token string
+     */
     Oauth2TokenResult& setAccessToken(const std::string& accessToken);
+
+    /**
+     * Set the ID token
+     *
+     * @param IdToken the ID token
+     */
     Oauth2TokenResult& setIdToken(const std::string& idToken);
+
+    /**
+     * Set the refresh token which can be used to obtain new access tokens using the same authorization grant
+     * or null for none
+     *
+     * @param RefreshToken the refresh token

Review comment:
       ```suggestion
        * @param refreshToken the refresh token
   ```

##########
File path: pulsar-client-cpp/include/pulsar/Client.h
##########
@@ -86,42 +86,140 @@ class PULSAR_PUBLIC Client {
      */
     Result createProducer(const std::string& topic, const ProducerConfiguration& conf, Producer& producer);
 
+    /**
+     * Asynchronously create a producer with the default ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param callback the callback that is triggered when the producer is created successfully or not
+     */
     void createProducerAsync(const std::string& topic, CreateProducerCallback callback);
 
+    /**
+     * Asynchronously create a producer with the customized ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param configuration the customized ProducerConfiguration

Review comment:
       ```suggestion
        * @param conf the customized ProducerConfiguration
        * @param callback Callback function that will be invoked when the operation is completed
   ```

##########
File path: pulsar-client-cpp/include/pulsar/Authentication.h
##########
@@ -178,14 +349,54 @@ class Oauth2TokenResult {
     Oauth2TokenResult();
     ~Oauth2TokenResult();
 
+    /**
+     * Set the access token string
+     *
+     * @param AccessToken the access token string
+     */
     Oauth2TokenResult& setAccessToken(const std::string& accessToken);
+
+    /**
+     * Set the ID token
+     *
+     * @param IdToken the ID token
+     */
     Oauth2TokenResult& setIdToken(const std::string& idToken);
+
+    /**
+     * Set the refresh token which can be used to obtain new access tokens using the same authorization grant
+     * or null for none
+     *
+     * @param RefreshToken the refresh token
+     */
     Oauth2TokenResult& setRefreshToken(const std::string& refreshToken);
+
+    /**
+     * Set the token lifetime
+     *
+     * @param ExpiresIn the token lifetime

Review comment:
       ```suggestion
        * @param expiresIn the token lifetime
   ```

##########
File path: pulsar-client-cpp/include/pulsar/Client.h
##########
@@ -86,42 +86,140 @@ class PULSAR_PUBLIC Client {
      */
     Result createProducer(const std::string& topic, const ProducerConfiguration& conf, Producer& producer);
 
+    /**
+     * Asynchronously create a producer with the default ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param callback the callback that is triggered when the producer is created successfully or not
+     */
     void createProducerAsync(const std::string& topic, CreateProducerCallback callback);
 
+    /**
+     * Asynchronously create a producer with the customized ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param configuration the customized ProducerConfiguration
+     */
     void createProducerAsync(const std::string& topic, ProducerConfiguration conf,
                              CreateProducerCallback callback);
 
+    /**
+     * Subscribe to a given topic and subscription combination with the default ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name

Review comment:
       ```suggestion
        * @param subscriptionName the subscription name
   ```

##########
File path: pulsar-client-cpp/include/pulsar/Client.h
##########
@@ -86,42 +86,140 @@ class PULSAR_PUBLIC Client {
      */
     Result createProducer(const std::string& topic, const ProducerConfiguration& conf, Producer& producer);
 
+    /**
+     * Asynchronously create a producer with the default ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param callback the callback that is triggered when the producer is created successfully or not
+     */
     void createProducerAsync(const std::string& topic, CreateProducerCallback callback);
 
+    /**
+     * Asynchronously create a producer with the customized ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param configuration the customized ProducerConfiguration
+     */
     void createProducerAsync(const std::string& topic, ProducerConfiguration conf,
                              CreateProducerCallback callback);
 
+    /**
+     * Subscribe to a given topic and subscription combination with the default ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name
+     * @return ResultOk if it subscribes to the topic successfully
+     */
     Result subscribe(const std::string& topic, const std::string& subscriptionName, Consumer& consumer);
+
+    /**
+     * Subscribe to a given topic and subscription combination with the customized ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name

Review comment:
       ```suggestion
        * @param subscriptionName the subscription name
        * @param conf the consumer configuration object
        * @param[out] consumer the consumer instance to be returned
   ```

##########
File path: pulsar-client-cpp/include/pulsar/Client.h
##########
@@ -86,42 +86,140 @@ class PULSAR_PUBLIC Client {
      */
     Result createProducer(const std::string& topic, const ProducerConfiguration& conf, Producer& producer);
 
+    /**
+     * Asynchronously create a producer with the default ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param callback the callback that is triggered when the producer is created successfully or not
+     */
     void createProducerAsync(const std::string& topic, CreateProducerCallback callback);
 
+    /**
+     * Asynchronously create a producer with the customized ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param configuration the customized ProducerConfiguration
+     */
     void createProducerAsync(const std::string& topic, ProducerConfiguration conf,
                              CreateProducerCallback callback);
 
+    /**
+     * Subscribe to a given topic and subscription combination with the default ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name
+     * @return ResultOk if it subscribes to the topic successfully
+     */
     Result subscribe(const std::string& topic, const std::string& subscriptionName, Consumer& consumer);
+
+    /**
+     * Subscribe to a given topic and subscription combination with the customized ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name
+     * @return ResultOk if it subscribes to the topic successfully
+     */
     Result subscribe(const std::string& topic, const std::string& subscriptionName,
                      const ConsumerConfiguration& conf, Consumer& consumer);
 
+    /**
+     * Asynchronously subscribe to a given topic and subscription combination with the default
+     * ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name
+     * @param callback the callback that is triggered when a given topic and subscription combination with the
+     * default ConsumerConfiguration are asynchronously subscribed successfully or not
+     */
     void subscribeAsync(const std::string& topic, const std::string& subscriptionName,
                         SubscribeCallback callback);
+
+    /**
+     * Asynchronously subscribe to a given topic and subscription combination with the customized
+     * ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name
+     * @param configuration the customized ConsumerConfiguration

Review comment:
       ```suggestion
        * @param subscriptionName the subscription name
        * @param conf the customized ConsumerConfiguration
   ```

##########
File path: pulsar-client-cpp/include/pulsar/Client.h
##########
@@ -86,42 +86,140 @@ class PULSAR_PUBLIC Client {
      */
     Result createProducer(const std::string& topic, const ProducerConfiguration& conf, Producer& producer);
 
+    /**
+     * Asynchronously create a producer with the default ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param callback the callback that is triggered when the producer is created successfully or not
+     */
     void createProducerAsync(const std::string& topic, CreateProducerCallback callback);
 
+    /**
+     * Asynchronously create a producer with the customized ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param configuration the customized ProducerConfiguration
+     */
     void createProducerAsync(const std::string& topic, ProducerConfiguration conf,
                              CreateProducerCallback callback);
 
+    /**
+     * Subscribe to a given topic and subscription combination with the default ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name
+     * @return ResultOk if it subscribes to the topic successfully
+     */
     Result subscribe(const std::string& topic, const std::string& subscriptionName, Consumer& consumer);
+
+    /**
+     * Subscribe to a given topic and subscription combination with the customized ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name
+     * @return ResultOk if it subscribes to the topic successfully
+     */
     Result subscribe(const std::string& topic, const std::string& subscriptionName,
                      const ConsumerConfiguration& conf, Consumer& consumer);
 
+    /**
+     * Asynchronously subscribe to a given topic and subscription combination with the default
+     * ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name
+     * @param callback the callback that is triggered when a given topic and subscription combination with the
+     * default ConsumerConfiguration are asynchronously subscribed successfully or not
+     */
     void subscribeAsync(const std::string& topic, const std::string& subscriptionName,
                         SubscribeCallback callback);
+
+    /**
+     * Asynchronously subscribe to a given topic and subscription combination with the customized
+     * ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name
+     * @param configuration the customized ConsumerConfiguration
+     * @param callback the callback that is triggered when a given topic and subscription combination with the
+     * customized ConsumerConfiguration are asynchronously subscribed successfully or not
+     */
     void subscribeAsync(const std::string& topic, const std::string& subscriptionName,
                         const ConsumerConfiguration& conf, SubscribeCallback callback);
 
     /**
-     * subscribe for multiple topics under the same namespace.
+     * Subscribe to multiple topics under the same namespace.

Review comment:
       ```suggestion
        * Subscribe to multiple topics under the same namespace.
        *
        * @param topics a list of topic names to subscribe to
        * @param subscriptionName the subscription name
        * @param[out] consumer the consumer instance to be returned
   ```

##########
File path: pulsar-client-cpp/include/pulsar/Client.h
##########
@@ -86,42 +86,140 @@ class PULSAR_PUBLIC Client {
      */
     Result createProducer(const std::string& topic, const ProducerConfiguration& conf, Producer& producer);
 
+    /**
+     * Asynchronously create a producer with the default ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param callback the callback that is triggered when the producer is created successfully or not
+     */
     void createProducerAsync(const std::string& topic, CreateProducerCallback callback);
 
+    /**
+     * Asynchronously create a producer with the customized ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param configuration the customized ProducerConfiguration
+     */
     void createProducerAsync(const std::string& topic, ProducerConfiguration conf,
                              CreateProducerCallback callback);
 
+    /**
+     * Subscribe to a given topic and subscription combination with the default ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name
+     * @return ResultOk if it subscribes to the topic successfully
+     */
     Result subscribe(const std::string& topic, const std::string& subscriptionName, Consumer& consumer);
+
+    /**
+     * Subscribe to a given topic and subscription combination with the customized ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name
+     * @return ResultOk if it subscribes to the topic successfully
+     */
     Result subscribe(const std::string& topic, const std::string& subscriptionName,
                      const ConsumerConfiguration& conf, Consumer& consumer);
 
+    /**
+     * Asynchronously subscribe to a given topic and subscription combination with the default
+     * ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name
+     * @param callback the callback that is triggered when a given topic and subscription combination with the
+     * default ConsumerConfiguration are asynchronously subscribed successfully or not
+     */
     void subscribeAsync(const std::string& topic, const std::string& subscriptionName,
                         SubscribeCallback callback);
+
+    /**
+     * Asynchronously subscribe to a given topic and subscription combination with the customized
+     * ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name
+     * @param configuration the customized ConsumerConfiguration
+     * @param callback the callback that is triggered when a given topic and subscription combination with the
+     * customized ConsumerConfiguration are asynchronously subscribed successfully or not
+     */
     void subscribeAsync(const std::string& topic, const std::string& subscriptionName,
                         const ConsumerConfiguration& conf, SubscribeCallback callback);
 
     /**
-     * subscribe for multiple topics under the same namespace.
+     * Subscribe to multiple topics under the same namespace.
      */
     Result subscribe(const std::vector<std::string>& topics, const std::string& subscriptionName,
                      Consumer& consumer);
+
+    /**
+     * Subscribe to multiple topics with the customized ConsumerConfiguration under the same namespace

Review comment:
       ```suggestion
        * Subscribe to multiple topics with the customized ConsumerConfiguration under the same namespace
        *
        * @param topics a list of topic names to subscribe to
        * @param subscriptionName the subscription name
        * @param conf the customized ConsumerConfiguration
        * @param[out] consumer the consumer instance to be returned
   ```

##########
File path: pulsar-client-cpp/include/pulsar/Client.h
##########
@@ -86,42 +86,140 @@ class PULSAR_PUBLIC Client {
      */
     Result createProducer(const std::string& topic, const ProducerConfiguration& conf, Producer& producer);
 
+    /**
+     * Asynchronously create a producer with the default ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param callback the callback that is triggered when the producer is created successfully or not

Review comment:
       ```suggestion
        * @param callback the callback that is triggered when the producer is created successfully or not
        * @param callback Callback function that will be invoked when the operation is completed
   ```

##########
File path: pulsar-client-cpp/include/pulsar/Client.h
##########
@@ -86,42 +86,140 @@ class PULSAR_PUBLIC Client {
      */
     Result createProducer(const std::string& topic, const ProducerConfiguration& conf, Producer& producer);
 
+    /**
+     * Asynchronously create a producer with the default ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param callback the callback that is triggered when the producer is created successfully or not
+     */
     void createProducerAsync(const std::string& topic, CreateProducerCallback callback);
 
+    /**
+     * Asynchronously create a producer with the customized ProducerConfiguration for publishing on a specific
+     * topic
+     *
+     * @param topic the name of the topic where to produce
+     * @param configuration the customized ProducerConfiguration
+     */
     void createProducerAsync(const std::string& topic, ProducerConfiguration conf,
                              CreateProducerCallback callback);
 
+    /**
+     * Subscribe to a given topic and subscription combination with the default ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name
+     * @return ResultOk if it subscribes to the topic successfully
+     */
     Result subscribe(const std::string& topic, const std::string& subscriptionName, Consumer& consumer);
+
+    /**
+     * Subscribe to a given topic and subscription combination with the customized ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name
+     * @return ResultOk if it subscribes to the topic successfully
+     */
     Result subscribe(const std::string& topic, const std::string& subscriptionName,
                      const ConsumerConfiguration& conf, Consumer& consumer);
 
+    /**
+     * Asynchronously subscribe to a given topic and subscription combination with the default
+     * ConsumerConfiguration
+     *
+     * @param topic the topic name
+     * @param subscription the subscription name

Review comment:
       ```suggestion
        * @param subscriptionName the subscription name
   ```




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

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