# baotonglu/dash architecture

> Architecture diagram of the GitHub repository baotonglu/dash, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/baotonglu/dash
- Repository: https://github.com/baotonglu/dash

## Overview

##### Main Components Identification

a) Core Hash Table Implementations:
- Dash EH (Extendible Hashing)
- Dash LH (Linear Hashing)
- CCEH (Concurrent Convertible Extendible Hashing)
- Level Hashing

b) Supporting Infrastructure:
- Memory Allocator
- Epoch Manager (external dependency)
- Custom PMDK (external dependency)

##### Specific Elements

a) Hash Table Components:

- Hash Tables  |

- Dash EH  | |

- Dash LH  | |

- CCEH   | |

- Level   | |

b) Utility Components (show as supporting modules):
- Key Generator
- File Access
- Hash Functions
- Random/Uniform Distributions

c) Memory Management:
- PMDK integration
- Persistent memory regions
- Epoch management boundaries

##### Technical Details to Highlight

Annotations for:
- Thread management (supports up to 24 physical cores)
- NUMA node awareness
- Persistent memory operations
- Concurrent access patterns

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Application
        Entry["Application Entry Point"]:::app
        Bench["Benchmark Framework"]:::app
    end

    subgraph "Hash Table Implementations"
        direction TB
        BaseHash["Base Hash Interface"]:::core
        DashEH["Dash EH"]:::primary
        DashLH["Dash LH"]:::primary
        CCEH["CCEH"]:::secondary
        Level["Level Hashing"]:::secondary
        
        BaseHash --> DashEH
        BaseHash --> DashLH
        BaseHash --> CCEH
        BaseHash --> Level
    end

    subgraph "Memory Management"
        direction TB
        Allocator["Memory Allocator"]:::memory
        PMDK["Custom PMDK"]:::external
        Epoch["Epoch Manager"]:::external
        
        Allocator --> PMDK
        Allocator --> Epoch
    end

    subgraph "Utility Components"
        direction TB
        KeyGen["Key Generator"]:::util
        FileAccess["File Access"]:::util
        HashFunc["Hash Functions"]:::util
        RandDist["Random Distribution"]:::util
        UniDist["Uniform Distribution"]:::util
        KVPair["Key-Value Pair"]:::util
        SysUtil["System Utilities"]:::util
    end

    Entry --> BaseHash
    Bench --> BaseHash
    DashEH --> Allocator
    DashLH --> Allocator
    CCEH --> Allocator
    Level --> Allocator
    
    BaseHash --> HashFunc
    BaseHash --> KVPair
    Entry --> FileAccess
    Bench --> FileAccess
    KeyGen --> RandDist
    KeyGen --> UniDist
    Entry --> SysUtil
    Bench --> SysUtil

    %% Click Events
    click CCEH "https://github.com/baotonglu/dash/blob/master/src/CCEH/CCEH_baseline.h"
    click Level "https://github.com/baotonglu/dash/blob/master/src/Level/level_baseline.h"
    click DashLH "https://github.com/baotonglu/dash/blob/master/src/lh_finger.h"
    click DashEH "https://github.com/baotonglu/dash/blob/master/src/ex_finger.h"
    click Allocator "https://github.com/baotonglu/dash/blob/master/src/allocator.h"
    click HashFunc "https://github.com/baotonglu/dash/blob/master/util/hash.h"
    click KeyGen "https://github.com/baotonglu/dash/blob/master/util/key_generator.hpp"
    click FileAccess "https://github.com/baotonglu/dash/blob/master/util/file_access.h"
    click RandDist "https://github.com/baotonglu/dash/blob/master/util/random.h"
    click UniDist "https://github.com/baotonglu/dash/blob/master/util/uniform.hpp"
    click Entry "https://github.com/baotonglu/dash/blob/master/src/example.cpp"
    click Bench "https://github.com/baotonglu/dash/blob/master/src/test_pmem.cpp"
    click BaseHash "https://github.com/baotonglu/dash/blob/master/src/Hash.h"
    click SysUtil "https://github.com/baotonglu/dash/blob/master/util/System.hpp"
    click KVPair "https://github.com/baotonglu/dash/blob/master/util/pair.h"

    %% Styling
    classDef primary fill:#2196F3,stroke:#1565C0,color:white
    classDef secondary fill:#4CAF50,stroke:#2E7D32,color:white
    classDef memory fill:#FF9800,stroke:#EF6C00,color:white
    classDef external fill:#9E9E9E,stroke:#616161,color:white
    classDef util fill:#FFC107,stroke:#FFA000,color:black
    classDef app fill:#F44336,stroke:#C62828,color:white
    classDef core fill:#673AB7,stroke:#4527A0,color:white

    %% Legend
    subgraph Legend
        Primary["Primary Implementation"]:::primary
        Secondary["Secondary Implementation"]:::secondary
        MemComp["Memory Component"]:::memory
        ExtDep["External Dependency"]:::external
        Utility["Utility Component"]:::util
        AppComp["Application Component"]:::app
        CoreComp["Core Component"]:::core
    end
```
