Skip to content

Commit 3d2b644

Browse files
authored
refactor: replace boost predicates with absl (#4111)
1 parent c2772d4 commit 3d2b644

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/nameserver/name_server_impl.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <set>
2424
#include <vector>
2525

26+
#include "absl/strings/match.h"
2627
#include "absl/strings/numbers.h"
2728
#include "absl/strings/str_cat.h"
2829
#include "absl/strings/str_join.h"
@@ -1098,7 +1099,7 @@ void NameServerImpl::UpdateTablets(const std::vector<std::string>& endpoints) {
10981099
std::string nearline_tablet_endpoint;
10991100
for (const auto& endpoint : endpoints) {
11001101
std::string cur_endpoint = endpoint;
1101-
if (boost::starts_with(cur_endpoint, ::openmldb::base::NEARLINE_PREFIX)) {
1102+
if (absl::StartsWith(cur_endpoint, ::openmldb::base::NEARLINE_PREFIX)) {
11021103
nearline_tablet_endpoint = endpoint.substr(::openmldb::base::NEARLINE_PREFIX.size());
11031104
cur_endpoint = nearline_tablet_endpoint;
11041105
} else {
@@ -1263,7 +1264,7 @@ void NameServerImpl::OnTabletOnline(const std::string& endpoint) {
12631264
offline_endpoint_map_.erase(iter);
12641265
return;
12651266
}
1266-
if (!boost::starts_with(value, "startup_")) {
1267+
if (!absl::StartsWith(value, "startup_")) {
12671268
uint64_t cur_time = ::baidu::common::timer::get_micros() / 1000;
12681269
if (cur_time < iter->second + FLAGS_tablet_heartbeat_timeout) {
12691270
PDLOG(INFO,
@@ -1275,7 +1276,7 @@ void NameServerImpl::OnTabletOnline(const std::string& endpoint) {
12751276
}
12761277
}
12771278
}
1278-
if (boost::starts_with(value, "startup_")) {
1279+
if (absl::StartsWith(value, "startup_")) {
12791280
PDLOG(INFO, "endpoint %s is startup, exe tablet offline", endpoint.c_str());
12801281
OnTabletOffline(endpoint, true);
12811282
}

src/tablet/tablet_impl.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <vector>
3535

3636
#include "absl/cleanup/cleanup.h"
37+
#include "absl/strings/match.h"
3738
#include "absl/time/clock.h"
3839
#include "absl/time/time.h"
3940
#include "base/file_util.h"
@@ -4185,7 +4186,7 @@ int TabletImpl::CreateTableInternal(const ::openmldb::api::TableMeta* table_meta
41854186
engine_->ClearCacheLocked("");
41864187

41874188
// we always refresh the aggr catalog in case zk notification arrives later than the `deploy` sql
4188-
if (boost::iequals(table_meta->db(), openmldb::nameserver::PRE_AGG_DB)) {
4189+
if (absl::EqualsIgnoreCase(table_meta->db(), openmldb::nameserver::PRE_AGG_DB)) {
41894190
RefreshAggrCatalog();
41904191
}
41914192
}

0 commit comments

Comments
 (0)