Akumuli
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
query_results_pooler.h
1 #pragma once
2 #include "httpserver.h"
3 #include "ingestion_pipeline.h"
4 #include "server.h"
5 #include <memory>
6 
7 namespace Akumuli {
8 
11  virtual char* format(char* begin, char* end, const aku_Sample& sample) = 0;
12 };
13 
14 
16 
17  std::string query_text_;
18  std::shared_ptr<DbConnection> connection_;
19  std::shared_ptr<DbCursor> cursor_;
20  std::unique_ptr<OutputFormatter> formatter_;
21 
22  std::vector<char> rdbuf_;
23  int rdbuf_pos_;
24  int rdbuf_top_;
25  static const size_t DEFAULT_RDBUF_SIZE_ = 1000u;
26  static const size_t DEFAULT_ITEM_SIZE_ = sizeof(aku_Sample);
27 
28  QueryResultsPooler(std::shared_ptr<DbConnection> con, int readbufsize);
29 
30  void throw_if_started() const;
31 
32  void throw_if_not_started() const;
33 
34  virtual void start();
35 
36  virtual void append(const char* data, size_t data_size);
37 
38  virtual aku_Status get_error();
39 
40  virtual std::tuple<size_t, bool> read_some(char* buf, size_t buf_size);
41 
42  virtual void close();
43 };
44 
46  std::shared_ptr<DbConnection> con_;
47  int rdbufsize_;
48 
49  QueryProcessor(std::shared_ptr<DbConnection> con, int rdbuf);
50 
51  virtual ReadOperation* create();
52 
53  virtual std::string get_all_stats();
54 };
55 
56 } // namespace
Definition: query_results_pooler.h:15
static const size_t DEFAULT_RDBUF_SIZE_
Last initialized item index in rdbuf_
Definition: query_results_pooler.h:25
int rdbuf_top_
Read position in buffer.
Definition: query_results_pooler.h:24
virtual void start()
Definition: query_results_pooler.cpp:316
Definition: query_results_pooler.h:45
Interface that can be used to create read operations.
Definition: server.h:56
virtual void close()
Definition: query_results_pooler.cpp:412
virtual void append(const char *data, size_t data_size)
Definition: query_results_pooler.cpp:360
virtual std::tuple< size_t, bool > read_some(char *buf, size_t buf_size)
Definition: query_results_pooler.cpp:373
Definition: server.h:22
int rdbuf_pos_
Read buffer.
Definition: query_results_pooler.h:23
Output formatter interface.
Definition: query_results_pooler.h:10
virtual aku_Status get_error()
Definition: query_results_pooler.cpp:365