Improve unique id performance (#1911)

Remove the default constructor for UniqueID
Add a gen_uid method in UniqueId. If need to generate a new uid, users should call this api explicitly.
Reuse boost random generator not generate a new one every time.
This commit is contained in:
yiguolei
2019-09-29 18:20:02 +08:00
committed by ZHAO Chun
parent 8f016d3ab2
commit f852f50acb
18 changed files with 83 additions and 29 deletions

View File

@ -48,7 +48,7 @@ Status KafkaDataConsumer::init(StreamLoadContext* ctx) {
std::stringstream ss;
ss << BackendOptions::get_localhost() << "_";
std::string group_id = ss.str() + UniqueId().to_string();
std::string group_id = ss.str() + UniqueId::gen_uid().to_string();
LOG(INFO) << "init kafka consumer with group id: " << group_id;
std::string errstr;