Skip to content

Commit 4cc246d

Browse files
committed
Cleanup dead code, also add some more comments
1 parent f89bb96 commit 4cc246d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

pkg/epp/backend/metrics/types.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,4 @@ func (f *PodMetricsFactory) ReleaseEndpoint(ep PodMetrics) {
7575
}
7676
}
7777

78-
func (f *PodMetricsFactory) GetAttributes() *datalayer.Attributes {
79-
return datalayer.NewAttributes()
80-
}
81-
8278
type PodMetrics = datalayer.Endpoint

pkg/epp/requestcontrol/director.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,9 @@ func prepareData(plugin PrepareDataPlugin, ctx context.Context, request *schedul
378378
}
379379
}
380380

381+
// executePluginsAsDAG executes PrepareData plugins as a DAG based on their dependencies asynchronously.
382+
// So, a plugin is executed only after all its dependencies have been executed.
383+
// If there is a cycle or other error in the DAG, it returns an error.
381384
func (d *Director) executePluginsAsDAG(ctx context.Context, request *schedulingtypes.LLMRequest, pods []schedulingtypes.Pod, plugins []PrepareDataPlugin) error {
382385
// Build the DAG
383386
// The error validation happens on startup when loading the config. So, here there should not be any error.

pkg/epp/requestcontrol/graph_util.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ func buildDAG(plugins []PrepareDataPlugin) map[string][]string {
2626
dag[plugin.TypedName().String()] = []string{}
2727
}
2828
// Create dependency graph as a DAG.
29-
for i := 0; i < len(plugins); i++ {
30-
for j := 0; j < len(plugins); j++ {
29+
for i := range plugins {
30+
for j := range plugins {
3131
if i == j {
3232
continue
3333
}
@@ -50,7 +50,8 @@ func buildDAG(plugins []PrepareDataPlugin) map[string][]string {
5050
return dag
5151
}
5252

53-
// Where will we call prepareData from? How will the data be actually fetched? Can we put the data in DependencyNode?
53+
// prepareDataGraph builds a DAG of data preparation plugins and checks for cycles.
54+
// If there is a cycle, it returns an error.
5455
func prepareDataGraph(plugins []PrepareDataPlugin) (map[string][]string, error) {
5556
nameToNode := map[string]PrepareDataPlugin{}
5657

0 commit comments

Comments
 (0)