How abhi608/disdat works
Project Overview and Purpose
• This project is a simulation tool designed to mimic concurrency control in a distributed database. It handles transactions, locking, and site management to simulate the behavior of distributed data management systems.
• The README explains that you compile the executable from source using Makefile and run the simulation against an input file, which likely contains transaction instructions.
File Structure for Architectural Components
• Top-level files such as Makefile, README.md, and design.pdf help give background context.
• The “include” directory contains header files that define the main components, including:
• constants, datamanager, instruction, io, lock, locktable, site, sitemanager, transaction, transactionmanager, variable, and utility functions.
• The “src” directory implements the logic for these components, with each corresponding .cpp file handling functionality for the module named in its header—for instance, transaction.cpp manages transaction operations.
• The “bin” directory yields the final executable.
• The “test” directory holds scripts and sample input/output files used to validate the simulation.
Identifying Key Architectural Components
• Input/Output Manager: Reads instruction files and displays or logs simulation outputs.
• Instruction Processor: Converts input into structured commands.
• Transaction Manager: Manages transaction lifecycles, including processing commits, rollbacks, and conflict resolution.
• Lock Manager & Lock Table: Implements concurrency control by managing locks on data items.
• Data/Variable Manager: Manages simulated variables (database items) and possibly their state across different sites.
• Site Manager: Simulates distributed sites in the database that execute transactions.
• Coordinator/Runner (possibly through the start.cpp): Initiates and controls the overall simulation.
Representing Their Interactions
• The executable (bin/main) uses the start component to kick off the simulation.
• Input is processed by the IO module which hands off parsed instructions to the Instruction Processor.
• The Transaction Manager then coordinates with the Lock Manager to grant or queue locks via the Lock Table.
• Depending on the instruction, the Transaction Manager will interact with the Data Manager and Site Manager to replicate the distributed nature of the database.
Final Checklist
• Use clear labels for each component (e.g., "Input Handler", "Instruction Parser", "Transaction Manager", "Lock Manager", "Data Manager", "Site Manager").
• Fully detail any dependencies such as the relationship between transaction and lock components to capture the concurrency control simulation aspect.