This is an automated email from the ASF dual-hosted git repository.

laszlog pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git


The following commit(s) were added to refs/heads/master by this push:
     new 49ffa3cc9 IMPALA-12426: (Addendum) Remove Usage of Unnecessary this->
49ffa3cc9 is described below

commit 49ffa3cc9a872bdf4e3cd5e620296ef76ab010d2
Author: jasonmfehr <[email protected]>
AuthorDate: Wed Feb 21 13:17:43 2024 -0800

    IMPALA-12426: (Addendum) Remove Usage of Unnecessary this->
    
    The commit 408c606 added code that used the pattern "this->"
    unnecessarily. Remove instances of using "this->" from the code changes
    in this commit.
    
    Change-Id: Ia6b1d8ba7e27d20ba1ac83caff5e56fd0f9347c0
    Reviewed-on: http://gerrit.cloudera.org:8080/21047
    Reviewed-by: Riza Suminto <[email protected]>
    Reviewed-by: Michael Smith <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 be/src/service/impala-server.cc        |  8 ++--
 be/src/service/internal-server-test.cc | 27 +++++------
 be/src/service/internal-server.cc      | 87 +++++++++++++++++-----------------
 3 files changed, 60 insertions(+), 62 deletions(-)

diff --git a/be/src/service/impala-server.cc b/be/src/service/impala-server.cc
index 6217956fb..a49d0eccf 100644
--- a/be/src/service/impala-server.cc
+++ b/be/src/service/impala-server.cc
@@ -548,7 +548,7 @@ ImpalaServer::ImpalaServer(ExecEnv* exec_env)
   if ((!TestInfo::is_test() || TestInfo::is_be_cluster_test()) && 
FLAGS_is_coordinator) {
     auto catalog_cb = [this] (const StatestoreSubscriber::TopicDeltaMap& state,
         vector<TTopicDelta>* topic_updates) {
-      this->CatalogUpdateCallback(state, topic_updates);
+      CatalogUpdateCallback(state, topic_updates);
     };
     // The 'local-catalog' implementation only needs minimal metadata to
     // trigger cache invalidations.
@@ -2574,7 +2574,7 @@ void ImpalaServer::ConnectionStart(
     const TUniqueId& session_id = connection_context.connection_id;
     // Generate a secret per Beeswax session so that the HS2 secret validation 
mechanism
     // prevent accessing of Beeswax sessions from HS2.
-    TUniqueId secret = this->RandomUniqueID();
+    TUniqueId secret = RandomUniqueID();
     shared_ptr<SessionState> session_state =
         std::make_shared<SessionState>(this, session_id, secret);
     session_state->closed = false;
@@ -3453,8 +3453,8 @@ void ImpalaServer::GetAllConnectionContexts(
 TUniqueId ImpalaServer::RandomUniqueID() {
   uuid conn_uuid;
   {
-    lock_guard<mutex> l(this->uuid_lock_);
-    conn_uuid = this->crypto_uuid_generator_();
+    lock_guard<mutex> l(uuid_lock_);
+    conn_uuid = crypto_uuid_generator_();
   }
   TUniqueId conn_id;
   UUIDToTUniqueId(conn_uuid, &conn_id);
diff --git a/be/src/service/internal-server-test.cc 
b/be/src/service/internal-server-test.cc
index e4f868864..04f55fd81 100644
--- a/be/src/service/internal-server-test.cc
+++ b/be/src/service/internal-server-test.cc
@@ -125,17 +125,17 @@ class DatabaseTest {
       // See the warning on the category_count_ class member definition.
       EXPECT_LE(category_count_, 11);
 
-      this->impala_server_ = impala_server;
-      this->database_name_ = StrCat(name_prefix, "_", GetCurrentTimeMicros());
+      impala_server_ = impala_server;
+      database_name_ = StrCat(name_prefix, "_", GetCurrentTimeMicros());
       TUniqueId query_id;
-      EXPECT_OK(this->impala_server_->ExecuteIgnoreResults("impala", 
StrCat("create "
-          "database ", this->database_name_), &query_id));
+      EXPECT_OK(impala_server_->ExecuteIgnoreResults("impala", StrCat("create 
database ",
+          database_name_), &query_id));
       assertQueryState(query_id, QUERY_STATE_SUCCESS);
 
       if (create_table) {
         table_name_ = StrCat(database_name_, ".", "products");
-        EXPECT_OK(this->impala_server_->ExecuteIgnoreResults("impala", 
StrCat("create "
-            "table ", table_name_, "(id INT, name STRING, first_sold 
TIMESTAMP, "
+        EXPECT_OK(impala_server_->ExecuteIgnoreResults("impala", 
StrCat("create table ",
+            table_name_, "(id INT, name STRING, first_sold TIMESTAMP, "
             "last_sold TIMESTAMP, price DECIMAL(30, 2)) partitioned by 
(category INT)"),
             &query_id));
         assertQueryState(query_id, QUERY_STATE_SUCCESS);
@@ -161,7 +161,7 @@ class DatabaseTest {
           }
         }
 
-        EXPECT_OK(this->impala_server_->ExecuteIgnoreResults("impala", sql1, 
&query_id));
+        EXPECT_OK(impala_server_->ExecuteIgnoreResults("impala", sql1, 
&query_id));
         assertQueryState(query_id, QUERY_STATE_SUCCESS);
 
         // Insert some products that do not have a last_sold time.
@@ -181,27 +181,26 @@ class DatabaseTest {
           }
         }
 
-        EXPECT_OK(this->impala_server_->ExecuteIgnoreResults("impala", sql2,
-            &query_id));
+        EXPECT_OK(impala_server_->ExecuteIgnoreResults("impala", sql2, 
&query_id));
         assertQueryState(query_id, QUERY_STATE_SUCCESS);
       }
     }
 
     ~DatabaseTest() {
-      RETURN_VOID_IF_ERROR(this->impala_server_->ExecuteIgnoreResults("impala",
-          "drop database if exists " + this->database_name_ + " cascade"));
+      RETURN_VOID_IF_ERROR(impala_server_->ExecuteIgnoreResults("impala",
+          "drop database if exists " + database_name_ + " cascade"));
     }
 
     const string GetDbName() const {
-        return this->database_name_;
+        return database_name_;
     }
 
     const string GetTableName() const {
-        return this->table_name_;
+        return table_name_;
     }
 
     int GetCategoryCount() const {
-      return this->category_count_;
+      return category_count_;
     }
 
   private:
diff --git a/be/src/service/internal-server.cc 
b/be/src/service/internal-server.cc
index 7e9c62c58..ed1db08ff 100644
--- a/be/src/service/internal-server.cc
+++ b/be/src/service/internal-server.cc
@@ -37,28 +37,27 @@ Status ImpalaServer::OpenSession(const string& user_name, 
TUniqueId& new_session
     const TQueryOptions& query_opts) {
   shared_ptr<ThriftServer::ConnectionContext> conn_ctx =
       make_shared<ThriftServer::ConnectionContext>();
-  conn_ctx->connection_id = this->RandomUniqueID();
+  conn_ctx->connection_id = RandomUniqueID();
   conn_ctx->server_name = ImpalaServer::INTERNAL_SERVER_NAME;
   conn_ctx->username = user_name;
   conn_ctx->network_address.hostname = "in-memory.localhost";
 
-  this->ConnectionStart(*conn_ctx.get());
+  ConnectionStart(*conn_ctx.get());
 
   {
-    lock_guard<mutex> l(this->connection_to_sessions_map_lock_);
-    new_session_id = *this->
-        connection_to_sessions_map_[conn_ctx->connection_id].cbegin();
+    lock_guard<mutex> l(connection_to_sessions_map_lock_);
+    new_session_id = 
*connection_to_sessions_map_[conn_ctx->connection_id].cbegin();
   }
 
   {
-    lock_guard<mutex> l(this->internal_server_connections_lock_);
-    this->internal_server_connections_.insert(make_pair(new_session_id, 
conn_ctx));
+    lock_guard<mutex> l(internal_server_connections_lock_);
+    internal_server_connections_.insert(make_pair(new_session_id, conn_ctx));
   }
 
   shared_ptr<ImpalaServer::SessionState> session_state;
   {
-    lock_guard<mutex> l(this->session_state_map_lock_);
-    session_state = this->session_state_map_[new_session_id];
+    lock_guard<mutex> l(session_state_map_lock_);
+    session_state = session_state_map_[new_session_id];
     std::map<string, string> query_opts_map;
     TQueryOptionsToMap(query_opts, &query_opts_map);
     for (auto iter=query_opts_map.cbegin(); iter!=query_opts_map.cend(); 
iter++) {
@@ -69,33 +68,33 @@ Status ImpalaServer::OpenSession(const string& user_name, 
TUniqueId& new_session
     }
   }
 
-  this->MarkSessionActive(session_state);
+  MarkSessionActive(session_state);
 
   return Status::OK();
 } // ImpalaServer::OpenSession
 
 bool ImpalaServer::CloseSession(const TUniqueId& session_id) {
   {
-    lock_guard<mutex> l(this->session_state_map_lock_);
+    lock_guard<mutex> l(session_state_map_lock_);
 
-    auto iter = this->session_state_map_.find(session_id);
-    if (iter == this->session_state_map_.end()) {
+    auto iter = session_state_map_.find(session_id);
+    if (iter == session_state_map_.end()) {
       return false;
     }
 
-    this->MarkSessionInactive(iter->second);
+    MarkSessionInactive(iter->second);
   }
 
   {
-    lock_guard<mutex> l(this->internal_server_connections_lock_, adopt_lock);
-    this->internal_server_connections_lock_.lock();
-
-    const auto iter = this->internal_server_connections_.find(session_id);
-    if (iter != this->internal_server_connections_.end()) {
-      this->internal_server_connections_lock_.unlock();
-      this->ConnectionEnd(*iter->second.get());
-      this->internal_server_connections_lock_.lock();
-      this->internal_server_connections_.erase(iter);
+    lock_guard<mutex> l(internal_server_connections_lock_, adopt_lock);
+    internal_server_connections_lock_.lock();
+
+    const auto iter = internal_server_connections_.find(session_id);
+    if (iter != internal_server_connections_.end()) {
+      internal_server_connections_lock_.unlock();
+      ConnectionEnd(*iter->second.get());
+      internal_server_connections_lock_.lock();
+      internal_server_connections_.erase(iter);
     }
   }
 
@@ -107,15 +106,15 @@ Status ImpalaServer::ExecuteIgnoreResults(const string& 
user_name, const string&
   TUniqueId session_id;
   TUniqueId internal_query_id;
 
-  RETURN_IF_ERROR(this->SubmitAndWait(user_name, sql, session_id, 
internal_query_id));
+  RETURN_IF_ERROR(SubmitAndWait(user_name, sql, session_id, 
internal_query_id));
 
   if (query_id != nullptr) {
     *query_id = internal_query_id;
   }
 
-  this->CloseQuery(internal_query_id);
+  CloseQuery(internal_query_id);
 
-  this->CloseSession(session_id);
+  CloseSession(session_id);
 
   return Status::OK();
 } //ImpalaServer::ExecuteIgnoreResults
@@ -126,16 +125,16 @@ Status ImpalaServer::ExecuteAndFetchAllText(const 
std::string& user_name,
   TUniqueId session_id;
   TUniqueId internal_query_id;
 
-  RETURN_IF_ERROR(this->SubmitAndWait(user_name, sql, session_id, 
internal_query_id));
+  RETURN_IF_ERROR(SubmitAndWait(user_name, sql, session_id, 
internal_query_id));
 
   if (query_id != nullptr) {
     *query_id = internal_query_id;
   }
 
-  RETURN_IF_ERROR(this->FetchAllRows(internal_query_id, results, columns));
+  RETURN_IF_ERROR(FetchAllRows(internal_query_id, results, columns));
 
-  this->CloseQuery(internal_query_id);
-  this->CloseSession(session_id);
+  CloseQuery(internal_query_id);
+  CloseSession(session_id);
 
   return Status::OK();
 } // ImpalaServer::ExecuteAndFetchAllText
@@ -143,10 +142,10 @@ Status ImpalaServer::ExecuteAndFetchAllText(const 
std::string& user_name,
 Status ImpalaServer::SubmitAndWait(const string& user_name, const string& sql,
     TUniqueId& new_session_id, TUniqueId& new_query_id) {
 
-  RETURN_IF_ERROR(this->OpenSession(user_name, new_session_id));
-  RETURN_IF_ERROR(this->SubmitQuery(sql, new_session_id, new_query_id));
+  RETURN_IF_ERROR(OpenSession(user_name, new_session_id));
+  RETURN_IF_ERROR(SubmitQuery(sql, new_session_id, new_query_id));
 
-  return this->WaitForResults(new_query_id);
+  return WaitForResults(new_query_id);
 } // ImpalaServer::SubmitAndWait
 
 Status ImpalaServer::WaitForResults(TUniqueId& query_id) {
@@ -157,7 +156,7 @@ Status ImpalaServer::WaitForResults(TUniqueId& query_id) {
 
   int64_t block_wait_time;
   bool timed_out;
-  RETURN_IF_ERROR(this->WaitForResults(query_handle->query_id(), &query_handle,
+  RETURN_IF_ERROR(WaitForResults(query_handle->query_id(), &query_handle,
       &block_wait_time, &timed_out));
   query_id = query_handle->query_id();
 
@@ -178,10 +177,10 @@ Status ImpalaServer::SubmitQuery(const string& sql, const 
TUniqueId& session_id,
   // locate the previously opened session
   shared_ptr<SessionState> session_state;
   {
-    lock_guard<mutex> l(this->session_state_map_lock_);
+    lock_guard<mutex> l(session_state_map_lock_);
 
-    const auto iter = this->session_state_map_.find(session_id);
-    if (iter == this->session_state_map_.end()) {
+    const auto iter = session_state_map_.find(session_id);
+    if (iter == session_state_map_.end()) {
       return Status::Expected(TErrorCode::GENERAL, PrintId(session_id));
     }
 
@@ -194,13 +193,13 @@ Status ImpalaServer::SubmitQuery(const string& sql, const 
TUniqueId& session_id,
   query_context.client_request.query_options = session_state->QueryOptions();
   set_query_options_mask = session_state->set_query_options_mask;
 
-  this->AddPoolConfiguration(&query_context, ~set_query_options_mask);
+  AddPoolConfiguration(&query_context, ~set_query_options_mask);
 
   QueryHandle query_handle;
-  RETURN_IF_ERROR(this->Execute(&query_context, session_state, &query_handle, 
nullptr));
+  RETURN_IF_ERROR(Execute(&query_context, session_state, &query_handle, 
nullptr));
   new_query_id = query_handle->query_id();
 
-  RETURN_IF_ERROR(this->SetQueryInflight(session_state, query_handle));
+  RETURN_IF_ERROR(SetQueryInflight(session_state, query_handle));
 
   return Status::OK();
 } // ImpalaServer::SubmitQuery
@@ -256,15 +255,15 @@ Status ImpalaServer::FetchAllRows(const TUniqueId& 
query_id, query_results& resu
 } // ImpalaServer::FetchAllRows
 
 void ImpalaServer::CloseQuery(const TUniqueId& query_id) {
-  this->UnregisterQueryDiscardResult(query_id, false);
+  UnregisterQueryDiscardResult(query_id, false);
 } // ImpalaServer::CloseQuery
 
 void ImpalaServer::GetConnectionContextList(
     ThriftServer::ConnectionContextList* connection_contexts) {
-  lock_guard<mutex> l(this->internal_server_connections_lock_);
+  lock_guard<mutex> l(internal_server_connections_lock_);
 
-  for(auto iter = this->internal_server_connections_.cbegin();
-      iter != this->internal_server_connections_.cend(); iter++) {
+  for(auto iter = internal_server_connections_.cbegin();
+      iter != internal_server_connections_.cend(); iter++) {
     connection_contexts->push_back(iter->second);
   }
 } // ImpalaServer::GetConnectionContextList

Reply via email to