-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxdbcserver.h
More file actions
executable file
·50 lines (36 loc) · 985 Bytes
/
xdbcserver.h
File metadata and controls
executable file
·50 lines (36 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef XDBCSERVER_H
#define XDBCSERVER_H
#include <boost/asio/basic_stream_socket.hpp>
#include <boost/asio.hpp>
#include <boost/bind/bind.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <utility>
#include <atomic>
#include "DataSources/PGReader/PGReader.h"
using namespace boost::asio;
using ip::tcp;
constexpr size_t MAX_ATTRIBUTES = 230;
struct Header {
size_t compressionType;
size_t totalSize;
size_t totalTuples;
size_t intermediateFormat;
size_t uncompressedSize;
size_t crc;
size_t attributeSize[MAX_ATTRIBUTES];
size_t attributeComp[MAX_ATTRIBUTES];
};
class XDBCServer {
public:
explicit XDBCServer(RuntimeEnv &env);
int serve();
int send(int threadno, DataSource &dataReader);
private:
RuntimeEnv *xdbcEnv;
std::vector<std::vector<std::byte>> bp;
std::atomic<int> totalSentBuffers;
std::string tableName;
std::thread _monitorThread;
void monitorQueues();
};
#endif //XDBCSERVER_H