36 Client *client, uint32_t fd, uint32_t buf_size,
37 uint32_t outstanding, uint64_t start_offset, uint64_t end_offset) :
38 m_client(client), m_fd(fd), m_read_size(buf_size), m_eof(false),
49 if (start_offset > 0) {
58 lock_guard<mutex> lock(
m_mutex);
84 unique_lock<mutex> lock(
m_mutex);
100 lock_guard<mutex> lock(
m_mutex);
107 HT_ERRORF(
"FS read error (amount=%u, fd=%d) : %s",
145 unique_lock<mutex> lock(
m_mutex);
146 uint8_t *ptr = (uint8_t *)buf;
148 long available, nread;
170 if (available >= nleft) {
171 memcpy(ptr, m_ptr, nleft);
181 else if (available == 0) {
190 memcpy(ptr, m_ptr, available);
215 for (uint32_t i=0; i<n; i++) {
static int32_t response_code(const Event *event)
Returns the response code from an event event generated in response to a request message.
uint64_t m_outstanding_offset
static String string_format_message(const Event *event)
Returns error message decoded standard error MESSAGE generated in response to a request message...
virtual ~ClientBufferedReaderHandler()
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
size_t read(void *buf, size_t len)
uint32_t m_max_outstanding
Compatibility Macros for C/C++.
ClientBufferedReaderHandler(Client *client, uint32_t fd, uint32_t buf_size, uint32_t outstanding, uint64_t start_offset, uint64_t end_offset)
const uint8_t * m_end_ptr
void read(int32_t fd, size_t amount, DispatchHandler *handler) override
std::queue< EventPtr > m_queue
std::condition_variable m_cond
Declarations for Protocol.
Request/response message event.
virtual void handle(EventPtr &event)
Callback method.
Proxy class for FS broker.
void seek(int32_t fd, uint64_t offset, DispatchHandler *handler) override
#define HT_ERRORF(msg,...)
File system broker framework and client library.
Error codes, Exception handling, error logging.
#define HT_THROW(_code_, _msg_)
void decode_response_read(EventPtr &event, const void **buffer, uint64_t *offset, uint32_t *length) override
Decodes the response from a read request.