hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject hadoop git commit: HDFS-10739: libhdfs++: In RpcEngine replace vector with deque for pending requests. Contributed by Anatoli Shein.
Date Tue, 09 Aug 2016 19:55:58 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDFS-8707 8e4002738 -> 0a29537f3


HDFS-10739: libhdfs++: In RpcEngine replace vector with deque for pending requests.  Contributed
by Anatoli Shein.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/0a29537f
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/0a29537f
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/0a29537f

Branch: refs/heads/HDFS-8707
Commit: 0a29537f3823d8538a02064288813aefaf567ba9
Parents: 8e40027
Author: James <jhc@apache.org>
Authored: Tue Aug 9 15:55:18 2016 -0400
Committer: James <jhc@apache.org>
Committed: Tue Aug 9 15:55:18 2016 -0400

----------------------------------------------------------------------
 .../src/main/native/libhdfspp/lib/rpc/rpc_connection.cc         | 1 -
 .../src/main/native/libhdfspp/lib/rpc/rpc_engine.h              | 5 +++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/0a29537f/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_connection.cc
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_connection.cc
b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_connection.cc
index 03f83f4..fccfb09 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_connection.cc
+++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_connection.cc
@@ -445,7 +445,6 @@ void RpcConnection::SendRpcRequests(const std::vector<std::shared_ptr<Request>
>
     Status status = Status::ResourceUnavailable("RpcConnection closed before send.");
     engine_->AsyncRpcCommsError(status, shared_from_this(), requests);
   } else {
-    pending_requests_.reserve(pending_requests_.size() + requests.size());
     for (auto r: requests) {
       if (r->method_name() != SASL_METHOD_NAME)
         pending_requests_.push_back(r);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0a29537f/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.h
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.h
b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.h
index 47618a6..efaf407 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.h
+++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.h
@@ -41,6 +41,7 @@
 #include <memory>
 #include <unordered_map>
 #include <vector>
+#include <deque>
 #include <mutex>
 #include <future>
 
@@ -234,10 +235,10 @@ class RpcConnection : public std::enable_shared_from_this<RpcConnection>
{
   // The request being sent over the wire; will also be in requests_on_fly_
   std::shared_ptr<Request> request_over_the_wire_;
   // Requests to be sent over the wire
-  std::vector<std::shared_ptr<Request>> pending_requests_;
+  std::deque<std::shared_ptr<Request>> pending_requests_;
   // Requests to be sent over the wire during authentication; not retried if
   //   there is a connection error
-  std::vector<std::shared_ptr<Request>> auth_requests_;
+  std::deque<std::shared_ptr<Request>> auth_requests_;
   // Requests that are waiting for responses
   typedef std::unordered_map<int, std::shared_ptr<Request>> RequestOnFlyMap;
   RequestOnFlyMap requests_on_fly_;


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message