MCPcopy Create free account
hub / github.com/eth-easl/dirigent / NewControlPlane

Function NewControlPlane

internal/control_plane/control_plane.go:62–79  ·  view source on GitHub ↗
(client persistence.PersistenceLayer, outputFile string, placementPolicy placement_policy.PlacementPolicy,
	dataplaneCreator core.DataplaneFactory, workerNodeCreator core.WorkerNodeFactory, cfg *config.ControlPlaneConfig)

Source from the content-addressed store, hash-verified

60}
61
62func NewControlPlane(client persistence.PersistenceLayer, outputFile string, placementPolicy placement_policy.PlacementPolicy,
63 dataplaneCreator core.DataplaneFactory, workerNodeCreator core.WorkerNodeFactory, cfg *config.ControlPlaneConfig) *ControlPlane {
64
65 return &ControlPlane{
66 DataPlaneConnections: synchronization.NewControlPlaneSyncStructure[string, core.DataPlaneInterface](),
67 NIStorage: synchronization.NewControlPlaneSyncStructure[string, core.WorkerNodeInterface](),
68 SIStorage: synchronization.NewControlPlaneSyncStructure[string, *ServiceInfoStorage](),
69
70 ColdStartTracing: tracing.NewColdStartTracingService(outputFile),
71 PlacementPolicy: placementPolicy,
72 PersistenceLayer: client,
73
74 dataPlaneCreator: dataplaneCreator,
75 workerNodeCreator: workerNodeCreator,
76
77 Config: cfg,
78 }
79}
80
81// Dataplanes functions
82

Callers 15

CreateNewCpApiServerFunction · 0.92
TestRegisterWorkerFunction · 0.85
TestRegisterDataplanesFunction · 0.85
TestRegisterServicesFunction · 0.85
TestDeregisterWorkerFunction · 0.85
TestDeregisterDataplanesFunction · 0.85
TestDeregisterServicesFunction · 0.85

Calls 2

Tested by 15

TestRegisterWorkerFunction · 0.68
TestRegisterDataplanesFunction · 0.68
TestRegisterServicesFunction · 0.68
TestDeregisterWorkerFunction · 0.68
TestDeregisterDataplanesFunction · 0.68
TestDeregisterServicesFunction · 0.68
TestStressRegisterNodesFunction · 0.68