Skip to content

Commit 64279b2

Browse files
authored
refactor(flowcontrol): move the priority queue out of the plugins tree (#2146)
With the queue plugin registry removed (#2036), the priority queue is a plain internal component of flow control, not a plugin. Move it from pkg/epp/flowcontrol/framework/plugins/queue to pkg/epp/flowcontrol/queue, deleting the now-empty pkg/epp/flowcontrol/framework tree so the only "framework" package left is the plugin SDK at pkg/epp/framework. Update the flow-control README pillars that still described the deleted sub-package and the long-removed QueueCapability system. Signed-off-by: Luke Van Drie <lukevandrie@google.com>
1 parent 92060d8 commit 64279b2

7 files changed

Lines changed: 11 additions & 10 deletions

File tree

pkg/epp/flowcontrol/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,14 @@ their justifications, please refer to the detailed documentation within the rele
9999
processing loop. It manages a worker that distributes incoming requests, apply policies, and dispatch
100100
requests to the backends. Its design focuses on high throughput and backpressure.
101101

102-
2. **Pluggable `Policy` Framework (`./framework`)**: This defines the core interfaces for all pluggable logic. It
103-
features a two-tier policy system for `Fairness` (decisions *between* different flows) and `Ordering`
104-
(decisions *within* a single flow) logic, covering both request dispatch and displacement.
105-
106-
3. **Extensible `SafeQueue` System (`./framework`)**: This defines the `framework.SafeQueue` interface for
107-
concurrent-safe request storage. It uses a `QueueCapability` system that allows for diverse and extensible queue
108-
implementations (e.g., FIFO, Priority Heap) while maintaining a stable interface.
102+
2. **Pluggable `Policy` Contracts (`/pkg/epp/framework/interface/flowcontrol`)**: The plugin SDK defines the core
103+
interfaces for all pluggable logic. It features a two-tier policy system for `Fairness` (decisions *between*
104+
different flows) and `Ordering` (decisions *within* a single flow) logic, covering both request dispatch and
105+
displacement.
106+
107+
3. **The `SafeQueue` (`./contracts`, `./queue`)**: The `contracts.SafeQueue` interface defines concurrent-safe
108+
request storage, and `./queue` provides the priority-queue implementation whose dispatch order is determined by
109+
the flow's configured `OrderingPolicy`.
109110

110111
4. **The `FlowRegistry` (`./registry`, `./contracts`)**: This is the stateful control plane of the system. It manages
111112
the configuration and lifecycle of all flows, policies, and queues. It presents a view of its state to the
File renamed without changes.
File renamed without changes.

pkg/epp/flowcontrol/framework/plugins/queue/priorityqueue_test.go renamed to pkg/epp/flowcontrol/queue/priorityqueue_test.go

File renamed without changes.

pkg/epp/flowcontrol/registry/managedqueue_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828

2929
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/contracts"
3030
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/contracts/mocks"
31-
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/framework/plugins/queue"
31+
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/queue"
3232
"github.com/llm-d/llm-d-router/pkg/epp/framework/interface/flowcontrol"
3333
fwkfcmocks "github.com/llm-d/llm-d-router/pkg/epp/framework/interface/flowcontrol/mocks"
3434
)

pkg/epp/flowcontrol/registry/registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030

3131
"github.com/llm-d/llm-d-router/pkg/common/observability/logging"
3232
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/contracts"
33-
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/framework/plugins/queue"
33+
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/queue"
3434
"github.com/llm-d/llm-d-router/pkg/epp/framework/interface/flowcontrol"
3535
"github.com/llm-d/llm-d-router/pkg/epp/metrics"
3636
)

pkg/epp/flowcontrol/registry/registry_helpers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
testclock "k8s.io/utils/clock/testing"
2929

3030
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/contracts"
31-
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/framework/plugins/queue"
31+
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/queue"
3232
"github.com/llm-d/llm-d-router/pkg/epp/framework/interface/flowcontrol"
3333
"github.com/llm-d/llm-d-router/pkg/epp/framework/interface/flowcontrol/mocks"
3434
)

0 commit comments

Comments
 (0)