2323#include " apiserver/interface_provider.h"
2424#include " brpc/server.h"
2525
26- namespace fedb {
26+ namespace openmldb {
2727namespace http {
2828
2929APIServerImpl::~APIServerImpl () = default ;
3030
3131bool APIServerImpl::Init (const sdk::ClusterOptions& options) {
3232 // If cluster sdk is needed, use ptr, don't own it. SQLClusterRouter owns it.
33- auto cluster_sdk = new ::fedb ::sdk::ClusterSDK (options);
33+ auto cluster_sdk = new ::openmldb ::sdk::ClusterSDK (options);
3434 bool ok = cluster_sdk->Init ();
3535 if (!ok) {
3636 LOG (ERROR) << " Fail to connect to db" ;
@@ -39,10 +39,10 @@ bool APIServerImpl::Init(const sdk::ClusterOptions& options) {
3939 return Init (cluster_sdk);
4040}
4141
42- bool APIServerImpl::Init (::fedb ::sdk::ClusterSDK* cluster) {
42+ bool APIServerImpl::Init (::openmldb ::sdk::ClusterSDK* cluster) {
4343 // If cluster sdk is needed, use ptr, don't own it. SQLClusterRouter owns it.
4444 cluster_sdk_ = cluster;
45- auto router = std::make_shared<::fedb ::sdk::SQLClusterRouter>(cluster_sdk_);
45+ auto router = std::make_shared<::openmldb ::sdk::SQLClusterRouter>(cluster_sdk_);
4646 if (!router->Init ()) {
4747 LOG (ERROR) << " Fail to connect to db" ;
4848 return false ;
@@ -75,7 +75,7 @@ void APIServerImpl::Process(google::protobuf::RpcController* cntl_base, const Ht
7575
7676bool APIServerImpl::Json2SQLRequestRow (const butil::rapidjson::Value& non_common_cols_v,
7777 const butil::rapidjson::Value& common_cols_v,
78- std::shared_ptr<fedb ::sdk::SQLRequestRow> row) {
78+ std::shared_ptr<openmldb ::sdk::SQLRequestRow> row) {
7979 auto sch = row->GetSchema ();
8080
8181 // scan all strings to init the total string length
@@ -172,7 +172,7 @@ bool APIServerImpl::AppendJsonValue(const butil::rapidjson::Value& v, hybridse::
172172 return false ;
173173 }
174174 std::vector<std::string> parts;
175- ::fedb ::base::SplitString (v.GetString(), "-", parts);
175+ ::openmldb ::base::SplitString (v.GetString(), "-", parts);
176176 if (parts.size () != 3 ) {
177177 return false ;
178178 }
@@ -315,7 +315,7 @@ void APIServerImpl::RegisterExecSP() {
315315 const auto & schema_impl = dynamic_cast <const ::hybridse::sdk::SchemaImpl&>(sp_info->GetInputSchema ());
316316 // Hard copy, and RequestRow needs shared schema
317317 auto input_schema = std::make_shared<::hybridse::sdk::SchemaImpl>(schema_impl.GetSchema ());
318- auto common_column_indices = std::make_shared<fedb ::sdk::ColumnIndicesSet>(input_schema);
318+ auto common_column_indices = std::make_shared<openmldb ::sdk::ColumnIndicesSet>(input_schema);
319319 decltype (common_cols_v.Size ()) expected_common_size = 0 ;
320320 for (int i = 0 ; i < input_schema->GetColumnCnt (); ++i) {
321321 if (input_schema->IsConstant (i)) {
@@ -435,7 +435,7 @@ void APIServerImpl::RegisterGetTable() {
435435 writer.Member (" msg" ) & std::string (" ok" );
436436 writer.Member (" tables" );
437437 writer.StartArray ();
438- for (std::shared_ptr<::fedb ::nameserver::TableInfo> table : tables) {
438+ for (std::shared_ptr<::openmldb ::nameserver::TableInfo> table : tables) {
439439 writer << table;
440440 }
441441 writer.EndArray ();
@@ -648,15 +648,15 @@ JsonWriter& operator&(JsonWriter& ar, GetSPResp& s) { // NOLINT
648648}
649649
650650JsonWriter& operator &(JsonWriter& ar, // NOLINT
651- const ::google::protobuf::RepeatedPtrField<::fedb ::common::ColumnDesc>& column_desc) {
651+ const ::google::protobuf::RepeatedPtrField<::openmldb ::common::ColumnDesc>& column_desc) {
652652 ar.StartArray ();
653653 for (auto column : column_desc) {
654654 ar.StartObject ();
655655 if (column.has_name ()) {
656656 ar.Member (" name" ) & column.name ();
657657 }
658658 if (column.has_data_type ()) {
659- ar.Member (" data_type" ) & ::fedb ::type::DataType_Name (column.data_type ());
659+ ar.Member (" data_type" ) & ::openmldb ::type::DataType_Name (column.data_type ());
660660 }
661661 if (column.has_not_null ()) {
662662 ar.Member (" not_null" ) & column.not_null ();
@@ -670,7 +670,7 @@ JsonWriter& operator&(JsonWriter& ar, // NOLINT
670670}
671671
672672JsonWriter& operator &(JsonWriter& ar, // NOLINT
673- const ::google::protobuf::RepeatedPtrField<::fedb ::common::ColumnKey>& column_key) {
673+ const ::google::protobuf::RepeatedPtrField<::openmldb ::common::ColumnKey>& column_key) {
674674 ar.StartArray ();
675675 for (auto key : column_key) {
676676 ar.StartObject ();
@@ -695,7 +695,7 @@ JsonWriter& operator&(JsonWriter& ar, // NOLINT
695695 auto & ttl = key.ttl ();
696696 ar.StartObject ();
697697 if (ttl.has_ttl_type ()) {
698- ar.Member (" ttl_type" ) & ::fedb ::type::TTLType_Name (ttl.ttl_type ());
698+ ar.Member (" ttl_type" ) & ::openmldb ::type::TTLType_Name (ttl.ttl_type ());
699699 }
700700 if (ttl.has_abs_ttl ()) {
701701 ar.Member (" abs_ttl" ) & ttl.abs_ttl ();
@@ -711,7 +711,7 @@ JsonWriter& operator&(JsonWriter& ar, // NOLINT
711711}
712712
713713JsonWriter& operator &(JsonWriter& ar, // NOLINT
714- const ::google::protobuf::RepeatedPtrField<::fedb ::common::VersionPair>& schema_versions) {
714+ const ::google::protobuf::RepeatedPtrField<::openmldb ::common::VersionPair>& schema_versions) {
715715 ar.StartArray ();
716716 for (auto version : schema_versions) {
717717 ar.StartObject ();
@@ -726,7 +726,7 @@ JsonWriter& operator&(JsonWriter& ar, // NOLINT
726726 return ar.EndArray ();
727727}
728728
729- JsonWriter& operator &(JsonWriter& ar, std::shared_ptr<::fedb ::nameserver::TableInfo> info) { // NOLINT
729+ JsonWriter& operator &(JsonWriter& ar, std::shared_ptr<::openmldb ::nameserver::TableInfo> info) { // NOLINT
730730 ar.StartObject ();
731731 if (info->has_name ()) {
732732 ar.Member (" name" ) & info->name ();
@@ -745,7 +745,7 @@ JsonWriter& operator&(JsonWriter& ar, std::shared_ptr<::fedb::nameserver::TableI
745745 ar.Member (" replica_num" ) & info->replica_num ();
746746 }
747747 if (info->has_compress_type ()) {
748- ar.Member (" compress_type" ) & ::fedb ::type::CompressType_Name (info->compress_type ());
748+ ar.Member (" compress_type" ) & ::openmldb ::type::CompressType_Name (info->compress_type ());
749749 }
750750 if (info->has_key_entry_max_height ()) {
751751 ar.Member (" key_entry_max_height" ) & info->key_entry_max_height ();
@@ -776,4 +776,4 @@ JsonWriter& operator&(JsonWriter& ar, std::shared_ptr<::fedb::nameserver::TableI
776776}
777777
778778} // namespace http
779- } // namespace fedb
779+ } // namespace openmldb
0 commit comments