21 #ifndef KINETIC_CPP_CLIENT_NONBLOCKING_PACKET_SENDER_H_
22 #define KINETIC_CPP_CLIENT_NONBLOCKING_PACKET_SENDER_H_
24 #include <sys/select.h>
28 #include <unordered_map>
29 #include <glog/logging.h>
31 #include "gmock/gmock.h"
33 #include "kinetic/nonblocking_packet_service_interface.h"
34 #include "kinetic/connection_options.h"
35 #include "kinetic/hmac_provider.h"
36 #include "kinetic_client.pb.h"
37 #include "nonblocking_packet.h"
38 #include "socket_wrapper_interface.h"
39 #include "nonblocking_packet_receiver.h"
43 using com::seagate::kinetic::client::proto::Message;
44 using com::seagate::kinetic::client::proto::Command;
45 using com::seagate::kinetic::client::proto::Command_Status_StatusCode;
48 using std::unique_ptr;
51 using std::unordered_map;
57 virtual void Enqueue(unique_ptr<Message> message, unique_ptr<Command> command,
const shared_ptr<const string> value,
58 unique_ptr<HandlerInterface> handler, HandlerKey handler_key) = 0;
59 virtual NonblockingPacketServiceStatus Send() = 0;
62 virtual bool Remove(HandlerKey key) = 0;
68 shared_ptr<NonblockingReceiverInterface> receiver,
69 shared_ptr<NonblockingPacketWriterFactoryInterface> packet_writer_factory,
72 void Enqueue(unique_ptr<Message> message, unique_ptr<Command> command,
const shared_ptr<const string> value,
73 unique_ptr<HandlerInterface> handler, HandlerKey handler_key);
74 NonblockingPacketServiceStatus Send();
75 bool Remove(HandlerKey key);
79 unique_ptr<const Message> message;
80 unique_ptr<const Command> command;
81 shared_ptr<const string> value;
82 unique_ptr<HandlerInterface> handler;
83 HandlerKey handler_key;
86 shared_ptr<SocketWrapperInterface> socket_wrapper_;
87 shared_ptr<NonblockingReceiverInterface> receiver_;
88 shared_ptr<NonblockingPacketWriterFactoryInterface> packet_writer_factory_;
91 int64_t sequence_number_;
92 HandlerKey handler_key_;
93 unique_ptr<NonblockingPacketWriterInterface> current_writer_;
94 shared_ptr<HandlerInterface> handler_;
95 deque<unique_ptr<Request>> request_queue_;
96 google::int64 message_sequence_;
103 #endif // KINETIC_CPP_CLIENT_NONBLOCKING_PACKET_SENDER_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)
Use this struct to pass all connection options to the KineticConnectionFactory.