xphoenix / afina Goto Github PK
View Code? Open in Web Editor NEWSimple caching server
Simple caching server
Добавить тесты из:
https://github.com/memcached/memcached/blob/master/t/getset.t
https://github.com/memcached/memcached/blob/master/t/issue_104.t
https://github.com/memcached/memcached/blob/master/t/issue_108.t
в unit тесты комманд (test/execute
):
Storage
In file included from /usr/include/c++/7/memory:80:0,
from /home/delta37/sphere/parallel_programming/afina/include/afina/network/Server.h:4,
from /home/delta37/sphere/parallel_programming/afina/src/network/blocking/ServerImpl.h:8,
from /home/delta37/sphere/parallel_programming/afina/src/network/blocking/ServerImpl.cpp:1:
/usr/include/c++/7/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = Afina::Execute::Command]’:
/usr/include/c++/7/bits/unique_ptr.h:268:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = Afina::Execute::Command; _Dp = std::default_deleteAfina::Execute::Command]’
/home/delta37/sphere/parallel_programming/afina/src/network/blocking/ServerImpl.cpp:225:40: required from here
/usr/include/c++/7/bits/unique_ptr.h:76:22: error: invalid application of ‘sizeof’ to incomplete type ‘Afina::Execute::Command’
static_assert(sizeof(_Tp)>0,
^
src/network/CMakeFiles/Network.dir/build.make:110: recipe for target 'src/network/CMakeFiles/Network.dir/blocking/ServerImpl.cpp.o' failed
make[2]: *** [src/network/CMakeFiles/Network.dir/blocking/ServerImpl.cpp.o] Error 1
CMakeFiles/Makefile2:742: recipe for target 'src/network/CMakeFiles/Network.dir/all' failed
make[1]: *** [src/network/CMakeFiles/Network.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Я хотел воспользоваться классом парсером, подключил в ServerImpl.h Parser.h И создал обьект Parser но при компиляции выскочила такая ошибка
[aitap@centos build]$ git log -1
commit d1673be26c9b0202dd56760c4159bc4c54f9baee
Author: Mikhail Plekhanov <[email protected]>
Date: Wed Oct 4 16:23:55 2017 +0300
Lecture 4 examples
[aitap@centos build]$ src/afina
terminate called after throwing an instance of 'std::regex_error'
what(): regex_error
Аварийный останов
[aitap@centos build]$ cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
[aitap@centos build]$ g++ --version | head -1
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
third-party/cxxopts-1.4.3/include/cxxopts.hpp
, строка 433:
std::basic_regex<char> integer_pattern
("(-)?(0x)?([1-9a-zA-Z][0-9a-zA-Z]*)|(0)");
bt full
: http://paste.org.ru/?iqjcey
Сейчас спользуется cxxopts, возможно было бы лучше перейти на другую библиотеку вроде https://github.com/Taywee/args
Самое главное, чтобы у приложения появился вменяемый help
Сейчас парсер (src/protocol/Parser.h,cpp
) знает комманды:
Нужно добавить комманды:
Соответственно нужно создать классы комманд в include/execute
и дописать парсер
Стресс тесты, как привило, выполняют комманду stats, нужно ее добавить. Хотя бы в виде просто заглушки, которая возвращает всегда нули
Кажется, вместо 0 должно было быть SO_REUSEADDR, как в blocking.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.