Git Product home page Git Product logo

afina's Issues

Добавить тесты для комманд

Добавить тесты из:

  • 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):

  • Сгенерировать mock интерфейса Storage
  • Написать тесты повторяющие логику по ссылке выше

Command is incomplete type

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 но при компиляции выскочила такая ошибка

Afina падает до main() на CentOS 7 из-за cxxopts

[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

Сделать help для afina

Сейчас спользуется cxxopts, возможно было бы лучше перейти на другую библиотеку вроде https://github.com/Taywee/args

Самое главное, чтобы у приложения появился вменяемый help

Добавить комманды в парсер

Сейчас парсер (src/protocol/Parser.h,cpp) знает комманды:

  • set
  • add
  • append
  • prepend
  • get
  • gets

Нужно добавить комманды:

  • replace
  • cas
  • delete
  • incr
  • decr
  • touch

Соответственно нужно создать классы комманд в include/execute и дописать парсер

Добавить комманду stats

Стресс тесты, как привило, выполняют комманду stats, нужно ее добавить. Хотя бы в виде просто заглушки, которая возвращает всегда нули

  • Поправить парсер (и тесты для парсера)
  • Добавить .h и .cpp в комманды
  • Изменить интерфейс Storage, чтобы из него можно было тянуть статистику по памяти

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.