21 #ifndef KINETIC_CPP_CLIENT_NONBLOCKING_PACKET_RECEIVER_H_
22 #define KINETIC_CPP_CLIENT_NONBLOCKING_PACKET_RECEIVER_H_
24 #include <sys/select.h>
28 #include <unordered_map>
29 #include <glog/logging.h>
31 #include "kinetic/nonblocking_packet_service_interface.h"
32 #include "kinetic/connection_options.h"
33 #include "kinetic/hmac_provider.h"
34 #include "kinetic_client.pb.h"
35 #include "nonblocking_packet.h"
36 #include "socket_wrapper_interface.h"
40 using com::seagate::kinetic::client::proto::Message;
41 using com::seagate::kinetic::client::proto::Command;
42 using com::seagate::kinetic::client::proto::Command_Status_StatusCode;
45 using std::unique_ptr;
48 using std::unordered_map;
50 enum NonblockingPacketServiceStatus {
60 virtual bool Enqueue(shared_ptr<HandlerInterface> handler, google::int64 sequence,
61 HandlerKey handler_key) = 0;
62 virtual NonblockingPacketServiceStatus Receive() = 0;
63 virtual int64_t connection_id() = 0;
64 virtual bool Remove(HandlerKey key) = 0;
72 bool Enqueue(shared_ptr<HandlerInterface> handler, google::int64 sequence,
73 HandlerKey handler_key);
74 NonblockingPacketServiceStatus Receive();
75 int64_t connection_id();
76 bool Remove(HandlerKey key);
81 shared_ptr<SocketWrapperInterface> socket_wrapper_;
85 int64_t connection_id_;
86 shared_ptr<HandlerInterface> handler_;
89 unique_ptr<const string> value_;
90 unordered_map<google::protobuf::int64, pair<shared_ptr<HandlerInterface>, HandlerKey>> map_;
94 unordered_map<HandlerKey, google::protobuf::int64> handler_to_message_seq_map_;
100 #endif // KINETIC_CPP_CLIENT_NONBLOCKING_PACKET_RECEIVER_H_
Wrapper class that handles computing HMACs. The supplied implementation uses openssl, but users can supply an alternate implementation that uses a different library (e. g. one providing specialized HW accelaration)
Indicates whether a Kinetic operation (get, put, security, etc) put succeeded or failed. Unlike Status it provides details like whether the failure resulted from a version or an HMAC error.
Use this struct to pass all connection options to the KineticConnectionFactory.