memgraph/experimental/distributed
Goran Zuzic 7f1c7a46cc Distributed tests
Summary:
1. added distributed tests, currently only one can be run (TODO)
2. usability changes: add Close() to Subscription
3. EventStream::Subscription -> Subscription
4. Add Subscription to ChainOnce
5. Added README.md conventions5

Reviewers: sasa.stanko

Reviewed By: sasa.stanko

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D701
2017-08-24 10:33:48 +02:00
..
src Distributed tests 2017-08-24 10:33:48 +02:00
tests Distributed tests 2017-08-24 10:33:48 +02:00
.clang-format Merged experimental repo. 2017-08-03 12:48:19 +02:00
.gitignore Merged experimental repo. 2017-08-03 12:48:19 +02:00
CMakeLists.txt Make System a singleton + Fix some protocol errors 2017-08-22 16:30:25 +02:00
init Merged experimental repo. 2017-08-03 12:48:19 +02:00
README.md Distributed tests 2017-08-24 10:33:48 +02:00

distributed memgraph

This subdirectory structure implements distributed infrastructure of Memgraph.

Terminology

  • Memgraph Node Id (mnid): a machine (processs) that runs a (distributed) Memgraph program.
  • Node: a computer that performs (distributed) work.
  • Vertex: an abstract graph concept.
  • Reactor: a unit of concurrent execution, lives on its own thread.
  • Channel: a (one-way) communication abstraction between Reactors. The reactors can be on the same machine or on different processes.
  • Message: gets sent through channels. Must be serializable if sent via network layer (library: cereal).
  • Event: arrival of a (subclass of) Message. You can register callbacks. Register exact callbacks (not for derivated/subclasses).
  • EventStream: read-end of a channel, is owned by exactly one Reactor/thread.
  • ChannelWriter: write-end of a channel, can be owned (wrote into) by multiple threads.

Ownership:

  • System, Distributed are singletons. They should be always alive.
  • ChannelWriter (write-end) should be lightweight and can be copied arbitrarily.
  • EventStream (read-end) should never be written by anyone except the owner (the reactor that created it).

Code Conventions

  • Locked: A method having a Locked... prefix indicates that you have to lock the appropriate mutex before calling this function.
  • ALWAYS close channels. You will memory leak if you don't. Reactor::CloseChannel or Subscription::Close will do the trick.

Dependencies

  • cereal