A brief description of src/ and subdirectories.
Main function, just calls to command line parser from administration/main/, error and backtrace definitions, main interfaces (abstract classes), home thread mixin for objects that can only be used on a single thread, math utils, etc..
Architecture-dependent code, spinlocks, timers, barriers, files, etc..
IO read/write worker threads, condition variables and mutexes, tcp/udp sockets.
IO operation scheduler, IO event listening, IO throttling, IO statistics.
One shot timers with callbacks for each platform.
Coroutines/fibers, message hub/queue (one per thread with MAX_THREADS queues), etc.. Every function runs inside coroutines inside threads (uses msg hub to store next coros).
Arch-dependent event queue with a callback on_event().
Arch-dependent condition variable using pipes/eventfd.
B-tree operations on top of buffer caches, btree slice, secondary indexes, etc..
Typedefs for main buffer classes, buf_lock_t, cache_t, transaction_t, etc..
Memory page/block eviction, replacement and flush policies, txn and snapshots, etc..
Rethink cluster logic, node roles, blueprint implementation, command-line / web backends, etc..
Implementation of suggester for blueprints, reactor driver/manager, loggers and metadata definitions for namespace, database, machine, etc..
Helper functions to parse commands from command-line interface.
HTTP user applications for system log, backfilling progress, etc.
Cluster system issues/problems that need to be resolved.
Rethink server main options and startup functions.
Throttling mechanism for query processing in a cluster node, uses clustered mailboxes.
Data and shard consistency mechanisms using clustered mailboxes known as business cards.
Read/Write queries are sent to the primary machine of a shard (master_t). The master_t forwards them to the brodcaster_t (primary) of that shard. The broadcaster_t sorts and distributes them to one or more listener_t,
A listener_t is the cluster-facing interface of a replica for a single shard. A listener_t performs read/writes to the B-tree. A secondary machine is essentially just a listener_t.
History of table data regions (shards) is identified by a branch ID + timestamp. A branch is the DB state when a broadcaster_t was created + sequence of writes.
The replier_t basically is there to wait for the backfilling to complete (from sec to pri), and only then it will tell the broadcaster_t that the listener_t can now also receive (up-to-date) read requests.
Query processing for each shard. A primary machine of a shard has a master_t receiving queries from other nodes.
Cluster node functions to match the blueprint. A node role can be primary, secondary or nothing/sleep.
Blueprint and shard suggester algorithms.
Architecture-independent concurrent structures used by threads and coroutines.
Concurrent queues.
Auth key, blob, bitset, buffer group, list, queue, two-level array, etc. Some are serializable.
RDB custom serialization format implementation (e.g. used for cluster node communication).
External process (fork) pool, workers/jobs and javascript job that uses V8 (js engine).
HTTP server/parser and request router.
Custom cJSON wrapper with iterators, etc.
Memcached protocol server, parser, etc.. (abandoned and replaced with reql)
Memcached wrapper for btree operations.
Dummy protocol and serializer implementation for testing.
Line parser for TCP sockets.
Performance monitor, they're used across the code base for stats.
Server that parses protobuf requests/responses (subclass of http_app_t).
Sharding, node backfill protocol (uses RDB SERIALIZABLE format) and query parser/protocol (uses protobuf).
Serialization and evaluation of protocol terms, functions, expressions, etc.
Implementation of cluster regions for key/data sharding.
Cluster/Inter-node communication mechanisms.
Message handler and service interfaces for implementing small clustered/inter-node apps.
A directory is a clustered app that stores metadata for every node, where node/peer ID is the key.
Mailbox impl on top of message services, a mailbox belongs to a thread running in a node.
A semilattice is a sub-region of metadata. A semilattice manager is a clustered app that keeps metadata in sync (through joins) between nodes.
Semilattice joinable types (including virtual clocks).
Semilattice observers (can also write through a join).
IO Serializers. Multiplexer/translator, merger (for bulk index ops) and log.
DB file extent/metablock/block managers and index journal/log.
Structure of DB files (LBA means Logical Block Addressing).