From 96f37635e8f55bde894d19dab8cc0c79d83b8708 Mon Sep 17 00:00:00 2001 From: Isabel Zhou Date: Wed, 13 May 2026 14:10:01 -0400 Subject: [PATCH] refactor: replace boost predicates with absl Replace boost::starts_with with absl::StartsWith in name_server_impl.cc (3 sites) and boost::iequals with absl::EqualsIgnoreCase in tablet_impl.cc (1 site), matching the convention used after the boost::ends_with replacement in #4107. No behavior change. --- src/nameserver/name_server_impl.cc | 7 ++++--- src/tablet/tablet_impl.cc | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/nameserver/name_server_impl.cc b/src/nameserver/name_server_impl.cc index a59233d481e..b9d078f4e1d 100644 --- a/src/nameserver/name_server_impl.cc +++ b/src/nameserver/name_server_impl.cc @@ -23,6 +23,7 @@ #include #include +#include "absl/strings/match.h" #include "absl/strings/numbers.h" #include "absl/strings/str_cat.h" #include "absl/strings/str_join.h" @@ -1098,7 +1099,7 @@ void NameServerImpl::UpdateTablets(const std::vector& endpoints) { std::string nearline_tablet_endpoint; for (const auto& endpoint : endpoints) { std::string cur_endpoint = endpoint; - if (boost::starts_with(cur_endpoint, ::openmldb::base::NEARLINE_PREFIX)) { + if (absl::StartsWith(cur_endpoint, ::openmldb::base::NEARLINE_PREFIX)) { nearline_tablet_endpoint = endpoint.substr(::openmldb::base::NEARLINE_PREFIX.size()); cur_endpoint = nearline_tablet_endpoint; } else { @@ -1263,7 +1264,7 @@ void NameServerImpl::OnTabletOnline(const std::string& endpoint) { offline_endpoint_map_.erase(iter); return; } - if (!boost::starts_with(value, "startup_")) { + if (!absl::StartsWith(value, "startup_")) { uint64_t cur_time = ::baidu::common::timer::get_micros() / 1000; if (cur_time < iter->second + FLAGS_tablet_heartbeat_timeout) { PDLOG(INFO, @@ -1275,7 +1276,7 @@ void NameServerImpl::OnTabletOnline(const std::string& endpoint) { } } } - if (boost::starts_with(value, "startup_")) { + if (absl::StartsWith(value, "startup_")) { PDLOG(INFO, "endpoint %s is startup, exe tablet offline", endpoint.c_str()); OnTabletOffline(endpoint, true); } diff --git a/src/tablet/tablet_impl.cc b/src/tablet/tablet_impl.cc index 5a99b7b23e7..b2799fb2868 100644 --- a/src/tablet/tablet_impl.cc +++ b/src/tablet/tablet_impl.cc @@ -34,6 +34,7 @@ #include #include "absl/cleanup/cleanup.h" +#include "absl/strings/match.h" #include "absl/time/clock.h" #include "absl/time/time.h" #include "base/file_util.h" @@ -4185,7 +4186,7 @@ int TabletImpl::CreateTableInternal(const ::openmldb::api::TableMeta* table_meta engine_->ClearCacheLocked(""); // we always refresh the aggr catalog in case zk notification arrives later than the `deploy` sql - if (boost::iequals(table_meta->db(), openmldb::nameserver::PRE_AGG_DB)) { + if (absl::EqualsIgnoreCase(table_meta->db(), openmldb::nameserver::PRE_AGG_DB)) { RefreshAggrCatalog(); } }