# amitshah261/chandy-lamport-snapshot-algorithm architecture

> Architecture diagram of the GitHub repository amitshah261/chandy-lamport-snapshot-algorithm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amitshah261/chandy-lamport-snapshot-algorithm
- Repository: https://github.com/amitshah261/chandy-lamport-snapshot-algorithm

## Overview

This is a small distributed-systems demonstration of the Chandy–Lamport snapshot algorithm. Each runtime instance transfers funds among three configured processes; process 1 periodically initiates snapshots, and the program reports transfers and snapshot state to the user. The excerpts show the network, marker handling, and process state, but do not show Channel.java being used. The graph therefore leaves that class unconnected and omits uncertain internal steps.

Main entry points: [`ChandyLamport.java`](https://github.com/amitshah261/chandy-lamport-snapshot-algorithm/blob/master/ChandyLamport.java) (Snapshot runtime), [`Process.java`](https://github.com/amitshah261/chandy-lamport-snapshot-algorithm/blob/master/Process.java) (Process state), [`ServerProperties.java`](https://github.com/amitshah261/chandy-lamport-snapshot-algorithm/blob/master/ServerProperties.java) (Server configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_algorithm["Snapshot runtime<br/>[ChandyLamport.java]"]
end

subgraph group_state["State"]
  node_process_state["Process state<br/>[Process.java]"]
  node_channel_class["Channel state class<br/>[Channel.java]"]
end

subgraph group_config["Configuration"]
  node_server_config["Server configuration"]
end

node_operator(("User"))

node_algorithm -->|"reads and updates"| node_process_state
node_algorithm -->|"loads configuration"| node_server_config
node_process_state -->|"loads configuration"| node_server_config
node_algorithm -->|"sends transfers and markers"| node_algorithm
node_algorithm -->|"displays results"| node_operator

click node_algorithm "https://github.com/amitshah261/chandy-lamport-snapshot-algorithm/blob/master/ChandyLamport.java"
click node_process_state "https://github.com/amitshah261/chandy-lamport-snapshot-algorithm/blob/master/Process.java"
click node_channel_class "https://github.com/amitshah261/chandy-lamport-snapshot-algorithm/blob/master/Channel.java"
click node_server_config "https://github.com/amitshah261/chandy-lamport-snapshot-algorithm/blob/master/ServerProperties.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_algorithm,node_operator toneBlue
class node_process_state,node_channel_class toneAmber
class node_server_config toneMint
```

## Components

### Runtime

- [Snapshot runtime](https://github.com/amitshah261/chandy-lamport-snapshot-algorithm/blob/master/ChandyLamport.java): `ChandyLamport.java`

### State

- [Process state](https://github.com/amitshah261/chandy-lamport-snapshot-algorithm/blob/master/Process.java): `Process.java`
- [Channel state class](https://github.com/amitshah261/chandy-lamport-snapshot-algorithm/blob/master/Channel.java): `Channel.java`

### Configuration

- [Server configuration](https://github.com/amitshah261/chandy-lamport-snapshot-algorithm/blob/master/ServerProperties.java): `ServerProperties.java`

### Other components

- **User**

## Connections

- Snapshot runtime → Process state: reads and updates (evidence: `ChandyLamport.java`)
- Snapshot runtime → Server configuration: loads configuration (evidence: `ChandyLamport.java`)
- Process state → Server configuration: loads configuration (evidence: `Process.java`)
- Snapshot runtime → Snapshot runtime: sends transfers and markers (evidence: `ChandyLamport.java`)
- Snapshot runtime → User: displays results (evidence: `README.md`)
