How clarky0505/cpp_tlfss works
TLSS is a single-node file storage service. Its principal workflow runs from the interactive client over the custom TCP Reactor to the storage service, which authenticates users, handles virtual-directory and file commands, and coordinates metadata with MySQL and file contents with asynchronous disk transfer. Monitoring and optimized memory copying are distinct subsystems; the README describes monitoring as independently run rather than started by the main service. Some subsystem links rely on README documentation because implementation excerpts are incomplete.
Main entry points: server.cpp Command service · engine.cpp Monitor engine · service_engine.cpp Storage engine · event_loop.cpp TCP Reactor
Components 22
Client
- Interactive client
src/ftp/client.cpp - TCP client
src/common/net/tcp_client.cpp
Storage service
- Command service
src/ftp/server.cpp - Authentication
src/auth/auth_service.cpp - User repository
src/auth/user_repository.cpp - Storage engine
src/ftp/service_engine.cpp - File transfer
inc/ftp/file_transfer.h - Async disk I/O
src/ftp/async_file_receiver.cpp - SHA-256 objects
inc/ftp/file_transfer.h
Runtime platform
- TCP Reactor
src/common/net/event_loop.cpp - TCP server
src/common/net/tcp_server.cpp - Worker pool
src/common/base/tlss_thread_pool.cpp - MySQL pool
src/common/base/mysql_connection_pool.cpp - Network buffer
src/common/net/buffer.cpp
Monitoring
- Monitor engine
src/monitor/engine.cpp - Metric store
src/monitor/monitor_store.cpp - Monitor CLI
src/monitor/cli_server.cpp - UDP metrics
src/monitor/udp_publisher.cpp - Reliable alarms
src/monitor/reliable_alarm_collector.cpp
Memory copy
- Copy dispatcher
src/common/memory/memcpy_dispatch.cpp
Other components
- CLI user
- MySQL
Connections 21
- CLI user → Interactive client: issues commands
README.md - Interactive client → TCP client: connects through
- TCP client → TCP Reactor: uses event loop
- TCP server → TCP Reactor: runs on
- TCP Reactor → Command service: dispatches requests
README.md - Command service → Worker pool: submits work
- Command service → Authentication: authenticates users
- Authentication → User repository: queries and creates users
src/auth/auth_service.cpp - User repository → MySQL pool: borrows connections
src/auth/user_repository.cpp - Storage engine → MySQL pool: borrows connections
src/ftp/service_engine.cpp - MySQL pool → MySQL: manages connections
- Command service → Storage engine: handles namespace metadata
- Command service → File transfer: coordinates transfers
src/ftp/server.cpp - File transfer → Async disk I/O: uses asynchronous I/O
- Async disk I/O → SHA-256 objects: publishes file objects
- Storage engine → SHA-256 objects: records object hash
src/ftp/service_engine.cpp - Monitor engine → Metric store: reads and updates
src/monitor/engine.cpp - Monitor CLI → Monitor engine: accesses monitoring
- Monitor engine → UDP metrics: publishes metrics
- Monitor engine → Reliable alarms: supports reliable alarms
- Network buffer → Copy dispatcher: uses default copy
README.md