l8services
Distributed services with SLA, transactions, and replication.
L8Services is the core services framework for Layer 8. It provides SLA-based service management, distributed caching, leader election, ACID transactions, Map-Reduce, data import/export, file storage, and replication.
Foundation CRUD handler implementing Post, Put, Patch, Delete, and Get. Integrated cache interaction with SLA-based Before/After callbacks. Query support with pagination. Async notification queue with 50,000 capacity.
Thread-safe distributed cache with persistent storage backends, property change listeners, paginated fetch, metadata collection, and replication-aware operations.
Central orchestrator handling registration, discovery, request routing, and transaction coordination. Leader election uses the bully algorithm with 3-second election timeout and 5-second heartbeat timeout. Election debouncing (500ms window) prevents storms. Service grouping reduces election traffic by roughly 80%.
Six-state machine for ACID 2-phase commit: Create, Queue, Run, Commit (or Rollback), Cleanup. Optimized rollback targets only peers that committed. Proper PreCommit map cleanup.
Distributed parallel processing across service nodes. Implement IMapReduceService.Merge() to combine results from all participants. Supports all five actions: MapR_POST, MapR_GET, MapR_PUT, MapR_PATCH, MapR_DELETE.
Full import pipeline with four sub-handlers: AI-based field mapping, import execution with validation, model metadata queries, and template transfer/export. Includes heuristic field matching, multi-format file parsing, value transformation, and typed record building.
L8ReplicationIndexservices/base/services/dcache/services/manager/services/transaction/services/dataimport/services/csvexport/services/filestore/services/replication/services/recovery/Tests use the l8test framework with a 4-node topology across 3 VNets. Coverage includes base service CRUD, distributed cache, Map-Reduce with 9 participants, transaction coordination, replication, notification delivery, and service manager operations. Roughly 5,900 lines of service code across 55 files, plus 1,500 lines of tests across 12 test files.