empiredan commented on code in PR #113:
URL: 
https://github.com/apache/incubator-pegasus-website/pull/113#discussion_r2106777332


##########
_docs/en/clients/cpp-client.md:
##########
@@ -2,4 +2,1008 @@
 permalink: clients/cpp-client
 ---
 
-TRANSLATING
+# Obtain Pegasus C++ client
+
+First, you need to compile [Pegasus](/overview/compilation). After compilation 
is complete, run the following command to package the production C++ client 
library:
+
+```
+./run.sh pack_client
+```
+After successful execution, a folder named 
`pegasus-client-{version}-{platform}-{buildType}` and a corresponding `.tar.gz` 
file will be generated in the local directory. Inside this folder, there is a 
`sample/` subdirectory. Navigate into it and run `make` to compile the example 
programs.
+
+
+
+# Configuration File
+
+The C++ client uses the RDSN framework, so its configuration file is 
relatively complex, as shown below:
+
+```
+[apps..default]
+run = true
+count = 1
+;network.client.RPC_CHANNEL_TCP = dsn::tools::sim_network_provider, 65536
+;network.client.RPC_CHANNEL_UDP = dsn::tools::sim_network_provider, 65536
+;network.server.0.RPC_CHANNEL_TCP = dsn::tools::sim_network_provider, 65536
+
+[apps.mimic]
+type = dsn.app.mimic
+arguments =
+pools = THREAD_POOL_DEFAULT
+run = true
+count = 1
+
+[core]
+;tool = simulator
+;tool = fastrun
+tool = nativerun
+;toollets = tracer
+;toollets = tracer, profiler, fault_injector
+pause_on_start = false
+cli_local = false
+cli_remote = false
+
+start_nfs = false
+
+logging_start_level = LOG_LEVEL_DEBUG
+logging_factory_name = dsn::tools::simple_logger
+logging_flush_on_exit = true
+
+enable_default_app_mimic = true
+
+data_dir = ./data
+
+[tools.simple_logger]
+short_header = true
+fast_flush = true
+max_number_of_log_files_on_disk = 10
+stderr_start_level = LOG_LEVEL_ERROR
+
+[tools.hpc_logger]
+per_thread_buffer_bytes = 8192
+max_number_of_log_files_on_disk = 10
+
+[tools.simulator]
+random_seed = 0
+
+[network]
+; how many network threads for network library(used by asio)
+io_service_worker_count = 4
+
+; specification for each thread pool
+[threadpool..default]
+worker_count = 4
+
+[threadpool.THREAD_POOL_DEFAULT]
+name = default
+partitioned = false
+max_input_queue_length = 1024
+worker_priority = THREAD_xPRIORITY_NORMAL
+worker_count = 4
+
+[task..default]
+is_trace = false
+is_profile = false
+allow_inline = false
+fast_execution_in_network_thread = false
+rpc_call_header_format = NET_HDR_DSN
+rpc_call_channel = RPC_CHANNEL_TCP
+rpc_timeout_milliseconds = 5000
+
+[pegasus.clusters]
+onebox = @LOCAL_IP@:34601,@LOCAL_IP@:34602,@LOCAL_IP@:34603
+another_cluster = @SOME_IP@:34601,@SOME_IP@:34601,@SOME_IP@:34601
+```
+For detailed explanations of the configuration file, please refer to 
[Configuration Guide](/administration/config).
+
+

Review Comment:
   ```suggestion
   ```



##########
_docs/en/clients/cpp-client.md:
##########
@@ -2,4 +2,1008 @@
 permalink: clients/cpp-client
 ---
 
-TRANSLATING
+# Obtain Pegasus C++ client
+
+First, you need to compile [Pegasus](/overview/compilation). After compilation 
is complete, run the following command to package the production C++ client 
library:
+
+```
+./run.sh pack_client
+```
+After successful execution, a folder named 
`pegasus-client-{version}-{platform}-{buildType}` and a corresponding `.tar.gz` 
file will be generated in the local directory. Inside this folder, there is a 
`sample/` subdirectory. Navigate into it and run `make` to compile the example 
programs.
+
+
+
+# Configuration File
+
+The C++ client uses the RDSN framework, so its configuration file is 
relatively complex, as shown below:
+
+```
+[apps..default]
+run = true
+count = 1
+;network.client.RPC_CHANNEL_TCP = dsn::tools::sim_network_provider, 65536
+;network.client.RPC_CHANNEL_UDP = dsn::tools::sim_network_provider, 65536
+;network.server.0.RPC_CHANNEL_TCP = dsn::tools::sim_network_provider, 65536
+
+[apps.mimic]
+type = dsn.app.mimic
+arguments =
+pools = THREAD_POOL_DEFAULT
+run = true
+count = 1
+
+[core]
+;tool = simulator
+;tool = fastrun
+tool = nativerun
+;toollets = tracer
+;toollets = tracer, profiler, fault_injector
+pause_on_start = false
+cli_local = false
+cli_remote = false
+
+start_nfs = false
+
+logging_start_level = LOG_LEVEL_DEBUG
+logging_factory_name = dsn::tools::simple_logger
+logging_flush_on_exit = true
+
+enable_default_app_mimic = true
+
+data_dir = ./data
+
+[tools.simple_logger]
+short_header = true
+fast_flush = true
+max_number_of_log_files_on_disk = 10
+stderr_start_level = LOG_LEVEL_ERROR
+
+[tools.hpc_logger]
+per_thread_buffer_bytes = 8192
+max_number_of_log_files_on_disk = 10
+
+[tools.simulator]
+random_seed = 0
+
+[network]
+; how many network threads for network library(used by asio)
+io_service_worker_count = 4
+
+; specification for each thread pool
+[threadpool..default]
+worker_count = 4
+
+[threadpool.THREAD_POOL_DEFAULT]
+name = default
+partitioned = false
+max_input_queue_length = 1024
+worker_priority = THREAD_xPRIORITY_NORMAL
+worker_count = 4
+
+[task..default]
+is_trace = false
+is_profile = false
+allow_inline = false
+fast_execution_in_network_thread = false
+rpc_call_header_format = NET_HDR_DSN
+rpc_call_channel = RPC_CHANNEL_TCP
+rpc_timeout_milliseconds = 5000
+
+[pegasus.clusters]
+onebox = @LOCAL_IP@:34601,@LOCAL_IP@:34602,@LOCAL_IP@:34603
+another_cluster = @SOME_IP@:34601,@SOME_IP@:34601,@SOME_IP@:34601
+```
+For detailed explanations of the configuration file, please refer to 
[Configuration Guide](/administration/config).
+
+
+
+# Interface Definition
+
+## Creating a Client Instance
+
+Client Factory Class
+```c++
+namespace pegasus {
+class pegasus_client_factory
+{
+public:
+    ///
+    /// \brief initialize
+    /// initialize pegasus client lib. must call this function before anything 
else.
+    /// \param config_file
+    /// the configuration file of client lib
+    /// \return
+    /// true indicate the initailize is success.
+    ///
+    static bool initialize(const char *config_file);
+
+    ///
+    /// \brief get_client
+    /// get an instance for a given cluster and a given app name.
+    /// \param cluster_name
+    /// the pegasus cluster name.
+    /// a cluster can have multiple apps.
+    /// \param app_name
+    /// an app is a logical isolated k-v store.
+    /// a cluster can have multiple apps.
+    /// \return
+    /// the client instance. DO NOT delete this client even after usage.
+    static pegasus_client *get_client(const char *cluster_name, const char 
*app_name);
+};
+} //end namespace
+```
+Client initialization essentially initializes the underlying RDSN framework.
+
+```c++
+if (!pegasus::pegasus_client_factory::initialize("config.ini")) {
+    fprintf(stderr, "ERROR: init pegasus failed\n");
+    return -1;
+}
+/**succeed, continue**/

Review Comment:
   ```suggestion
   /**succeed, continue**/
   ```



##########
_docs/en/clients/cpp-client.md:
##########
@@ -2,4 +2,1008 @@
 permalink: clients/cpp-client
 ---
 
-TRANSLATING
+# Obtain Pegasus C++ client
+
+First, you need to compile [Pegasus](/overview/compilation). After compilation 
is complete, run the following command to package the production C++ client 
library:
+
+```
+./run.sh pack_client
+```
+After successful execution, a folder named 
`pegasus-client-{version}-{platform}-{buildType}` and a corresponding `.tar.gz` 
file will be generated in the local directory. Inside this folder, there is a 
`sample/` subdirectory. Navigate into it and run `make` to compile the example 
programs.
+
+

Review Comment:
   ```suggestion
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to