Refactored bolt session to use new decoder.

Summary:
Bolt buffer is now a template.

Communication worker now has a new interface.

Fixed network tests to use new interface.

Fixed bolt tests to use new interface.

Added more functions to bolt decoder.

Reviewers: dgleich, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D256
This commit is contained in:
Matej Ferencevic
2017-04-15 15:14:12 +02:00
parent db30e72069
commit f05fcd91c3
39 changed files with 1260 additions and 1112 deletions

View File

@@ -15,6 +15,7 @@
#include "logging/default.hpp"
#include "logging/streams/stdout.hpp"
#include "communication/bolt/v1/decoder/buffer.hpp"
#include "communication/server.hpp"
#include "dbms/dbms.hpp"
#include "io/network/epoll.hpp"
@@ -40,8 +41,16 @@ class TestSession {
int Id() const { return socket_.id(); }
void Execute(const byte* data, size_t len) {
this->socket_.Write(data, len);
void Execute() {
this->socket_.Write(buffer_.data(), buffer_.size());
}
io::network::StreamBuffer Allocate() {
return buffer_.Allocate();
}
void Written(size_t len) {
buffer_.Written(len);
}
void Close() {
@@ -49,6 +58,7 @@ class TestSession {
}
socket_t socket_;
communication::bolt::Buffer<> buffer_;
io::network::Epoll::Event event_;
};