You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "duke8253 (via GitHub)" <gi...@apache.org> on 2023/03/03 16:11:10 UTC

[GitHub] [trafficserver] duke8253 commented on a diff in pull request #9323: Support config reloading using plugin msg for STEK Share Plugin

duke8253 commented on code in PR #9323:
URL: https://github.com/apache/trafficserver/pull/9323#discussion_r1124674529


##########
plugins/experimental/stek_share/stek_share.h:
##########
@@ -21,103 +21,139 @@ limitations under the License.
 
 #include <deque>
 #include <mutex>
+#include <shared_mutex>
 #include <time.h>
 
 #include <libnuraft/nuraft.hxx>
 
 #include "stek_utils.h"
 
-class STEKShareServer
+class PluginConfig
 {
 public:
-  STEKShareServer() : server_id_(1), addr_("localhost"), port_(25000), sm_(nullptr), smgr_(nullptr), raft_instance_(nullptr)
+  PluginConfig()
   {
-    last_updated_    = 0;
-    current_log_idx_ = 0;
-
     // Default ASIO thread pool size: 4.
-    asio_thread_pool_size_ = 4;
+    asio_thread_pool_size = 4;
 
     // Default heart beat interval: 100 ms.
-    heart_beat_interval_ = 100;
+    heart_beat_interval = 100;
 
     // Default election timeout: 200~400 ms.
-    election_timeout_lower_bound_ = 200;
-    election_timeout_upper_bound_ = 400;
+    election_timeout_lower_bound = 200;
+    election_timeout_upper_bound = 400;
 
     // Up to 5 logs will be preserved ahead the last snapshot.
-    reserved_log_items_ = 5;
+    reserved_log_items = 5;
 
     // Snapshot will be created for every 5 log appends.
-    snapshot_distance_ = 5;
+    snapshot_distance = 5;
 
     // Client timeout: 3000 ms.
-    client_req_timeout_ = 3000;
-
-    std::memset(ticket_keys_, 0, SSL_TICKET_KEY_SIZE * 2);
-  }
-
-  void
-  reset()
-  {
-    sm_.reset();
-    smgr_.reset();
-    raft_instance_.reset();
+    client_req_timeout = 3000;
   }
 
   // Server ID.
-  int server_id_;
+  int server_id;
 
   // Server address.
-  std::string addr_;
+  std::string address;
 
   // Server port.
-  int port_;
+  int port;
 
-  // Endpoint: "<addr>:<port>".
-  std::string endpoint_;
+  // Endpoint: "<address>:<port>".
+  std::string endpoint;

Review Comment:
   I would still need to convert back to string since `nuraft::srv_config` expects a string



-- 
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: github-unsubscribe@trafficserver.apache.org

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