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

[GitHub] [pulsar-client-cpp] BewareMyPower opened a new pull request, #236: Speed up the process to start standalone for tests

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

   ### Motivation
   
   It took too much time to start Pulsar standalone for tests because of the slow JVM startup when running `pulsar-admin` commands.
   
   ### Modifications
   
   Use `curl` to send REST requests directly. After this change, the startup time reduced from 1m39.597s to 32.451s in my local env.
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc-required` 
   (Your PR needs to update docs and you will update later)
   
   - [x] `doc-not-needed` 
   (Please explain why)
   
   - [ ] `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 commented on pull request #236: Speed up the process to start standalone for tests

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

   > The pulsar after 2.11 already contains the pulsar-shell. 
   
   Okay. I will replace it with the pulsar-shell command.
   
   


-- 
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 pull request #236: Speed up the process to start standalone for tests

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

   > Is it better to use pulsar-shell instead of using raw HTTP calls?
   
   If we're going to use `pulsar-shell`, we need to download it first and uncompress it to a specific path, then add separated config files for each cluster. But `curl` is already installed in most of the Linux/Unix systems by default.
   
   For this case, using `curl` is simple and enough and I didn't see any advantage of `pulsar-shell`. `pulsar-shell` could have pretty output for JSON, but here we only need to create the namespaces and configure the policies.


-- 
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 #236: Speed up the process to start standalone for tests

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


-- 
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] RobertIndie commented on pull request #236: Speed up the process to start standalone for tests

Posted by "RobertIndie (via GitHub)" <gi...@apache.org>.
RobertIndie commented on PR #236:
URL: https://github.com/apache/pulsar-client-cpp/pull/236#issuecomment-1490141542

   @BewareMyPower  Why do we need to download it separately? This script is running inside the docker. The pulsar after 2.11 already contains the `pulsar-shell`. We just need to use it like the `pulsar-admin`.
   
   Using the `curl` would reduce the readability. It makes the script more complicate.


-- 
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 pull request #236: Speed up the process to start standalone for tests

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

   When I tried to write shell scripts for `pulsar-shell`, I found it's hard to split it into two lines. For example, I met the following error:
   
   ```
   [5/29] ? admin namespaces create public/default -c standalone
   [6/29] Executing admin namespaces grant-permission
   The following options are required: [--actions], [--role]
   ```
   
   while my script is:
   
   ```bash
   admin namespaces create public/default -c standalone
   admin namespaces grant-permission \
       --actions produce,consume --role anonymous \
       public/default
   ```
   
   The backslash seems not recognized, which is bad from my view.
   
   BTW, I think the readability is not bad even with the raw REST APIs.
   1. I wrote the comments for each REST call.
   2. The `curl` command is encapsulated into a shell function `put <path> <body>`.
   
   In addition, it can also be easily used to verify an older Pulsar image (< 2.11.0) to test the backward compatibility.
   
   @RobertIndie 


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