How couchbase/platform works
This repository is Couchbase’s cross-platform C++ utility library: it provides reusable building blocks rather than a standalone user-facing application. Callers use its facilities for cryptography and encrypted files, logging, cgroup inspection, histograms, memory allocation, JSON validation, compression, sockets, and general platform services. The tree and sampled sources show these as largely independent library capabilities, not a single execution pipeline. There is no README, and unsampled modules are represented only where their paths and roles are supported by the tree or SOURCE INDEX.
Main entry points: file_writer.cc Encrypted file writer · cgroup.cc Cgroup interface · file_reader.cc Encrypted file reader · cgroup_private.cc Cgroup discovery
Components 22
Crypto and logging
- Crypto primitives
cbcrypto/symmetric.cc - Encrypted file reader
cbcrypto/file_reader.cc - Encrypted file writer
cbcrypto/file_writer.cc - File associated data
cbcrypto/encrypted_file_associated_data.h - Digest functions
cbcrypto/digest.cc - Rotating file sink
cblogger/custom_rotating_file_sink.cc - Logger runtime
cblogger/spdlogger.cc
System services
- Cgroup interface
cgroup/cgroup.cc - Cgroup discovery
cgroup/cgroup_private.cc - Socket utilities
cbsocket/socket.cc - Process monitoring
src/process_monitor.cc
Data utilities
- Hex strings
src/string_hex.cc - Sized buffers
src/sized_buffer.cc - HDR histogram
hdrhistogram/hdrhistogram.cc - Histogram iteration
include/hdrhistogram/iterator_range.h - JSON checker API
include/JSON_checker.h - JSON validation
src/JSON_checker.cc - Compression
cbcompress/compress.cc
Memory and concurrency
- Arena allocator
src/je_arena_malloc.cc - Relaxed atomics
include/relaxed_atomic.h - Arena client config
include/platform/cb_arena_malloc_client.h
Other components
- Library callers
Connections 21
- Library callers → Crypto primitives: uses
- Library callers → Encrypted file reader: uses
- Library callers → Encrypted file writer: uses
- Library callers → Logger runtime: uses
- Library callers → Cgroup interface: uses
- Library callers → Socket utilities: uses
- Library callers → Process monitoring: uses
- Library callers → HDR histogram: uses
- Library callers → JSON validation: uses
- Library callers → Compression: uses
- Encrypted file reader → File associated data: references
cbcrypto/file_reader.cc - Encrypted file writer → File associated data: references
cbcrypto/file_writer.cc - Rotating file sink → Encrypted file writer: writes through
cblogger/custom_rotating_file_sink.cc - Digest functions → Hex strings: uses
cbcrypto/digest.cc - Hex strings → Sized buffers: uses
- Cgroup interface → Cgroup discovery: uses
cgroup/cgroup.cc - Cgroup discovery → Cgroup interface: implements
cgroup/cgroup_private.cc - HDR histogram → Histogram iteration: uses
- JSON validation → JSON checker API: implements
src/JSON_checker.cc - Arena allocator → Relaxed atomics: uses
src/je_arena_malloc.cc - Arena client config → Relaxed atomics: uses
include/platform/cb_arena_malloc_client.h