Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/renderer/src/components/nodes/ServiceNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ import {
ServerCog,
BookOpen,
Bell,
LineChart
LineChart,
Hash,
Boxes,
SplitSquareHorizontal,
SquareStack
} from 'lucide-react'

import UniversalHandle from '@renderer/components/ui/UniversalHandle'
Expand Down Expand Up @@ -82,7 +86,11 @@ const ICON_LOOKUP: Record<string, LucideIcon> = {
'log-aggregator': Library,
tracing: Radar,
alerting: BellRing,
'health-check': HeartPulse
'health-check': HeartPulse,
hashing: Hash,
sharding: Boxes,
partition: SplitSquareHorizontal,
shard: SquareStack
}

const ServiceNode = ({ id, data, selected }: NodeProps<ServiceNodeData>) => {
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/src/config/catalogConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,10 @@ export const CATALOG_CONFIG: CatalogCategory[] = [
'alerting-engine',
'health-check-monitor'
])
},
{
id: 'partitioning-sharding',
title: 'Data Partitioning',
items: getItems(['hashing', 'sharding', 'partition-node', 'shard-node'])
}
]
44 changes: 43 additions & 1 deletion src/renderer/src/config/nodeRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ import {
LineChart,
Sliders,
Key,
ToggleLeft
ToggleLeft,
Hash,
Boxes,
SplitSquareHorizontal,
SquareStack
} from 'lucide-react'
import { getTheme } from './themeConfig'

Expand Down Expand Up @@ -487,6 +491,44 @@ export const NODE_REGISTRY: Record<string, NodeDef> = {
icon: HeartPulse,
lookupKey: 'health-check',
defaultData: { iconKey: 'health-check', status: 'healthy', throughput: 100, load: 5 }
},

// Partitioning & Sharding
hashing: {
id: 'hashing',
type: 'serviceNode',
label: 'Hashing',
subLabel: 'Hash Router',
icon: Hash,
lookupKey: 'hashing',
defaultData: { iconKey: 'hashing', status: 'healthy', throughput: 10000, load: 15 }
},
sharding: {
id: 'sharding',
type: 'serviceNode',
label: 'Sharding',
subLabel: 'Distribution logic',
icon: Boxes,
lookupKey: 'sharding',
defaultData: { iconKey: 'sharding', status: 'healthy', throughput: 15000, load: 20 }
},
'partition-node': {
id: 'partition-node',
type: 'serviceNode',
label: 'Partition',
subLabel: 'Logical Slice',
icon: SplitSquareHorizontal,
lookupKey: 'partition',
defaultData: { iconKey: 'partition', status: 'healthy', throughput: 5000, load: 10 }
},
'shard-node': {
id: 'shard-node',
type: 'serviceNode',
label: 'Shard',
subLabel: 'Physical Slice',
icon: SquareStack,
lookupKey: 'shard',
defaultData: { iconKey: 'shard', status: 'healthy', throughput: 5000, load: 30 }
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/renderer/src/config/themeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ export const THEME_CONFIG: Record<string, ColorTheme> = {
alerting: { bg: 'bg-red-500', border: 'border-red-600', text: 'text-red-600' },
'health-check': { bg: 'bg-emerald-400', border: 'border-emerald-500', text: 'text-emerald-500' },

// Partitioning & Sharding
hashing: { bg: 'bg-fuchsia-500', border: 'border-fuchsia-600', text: 'text-fuchsia-600' },
sharding: { bg: 'bg-indigo-500', border: 'border-indigo-600', text: 'text-indigo-600' },
partition: { bg: 'bg-cyan-500', border: 'border-cyan-600', text: 'text-cyan-600' },
shard: { bg: 'bg-emerald-500', border: 'border-emerald-600', text: 'text-emerald-600' },

// Fallbacks
default: { bg: 'bg-slate-500', border: 'border-slate-600', text: 'text-slate-600' }
}
Expand Down