Files
kmsvc-manage/internal/operator/admin.go
T
riotpiaole 3ac4083a68 feat(operator): add queue-operator CRD reconciler with shard split/drain
Reconciles Queue CRs into Kafka topics + Redis shard-map/queue-meta state:
creates shard-0 on first reconcile, splits a shard's hash range into two
children once its split threshold is crossed, drains and closes a parent
shard once its consumer group has fully caught up and its retention
window has elapsed, and tears down every shard's topic + Redis state on
deletion. Includes the manager entrypoint (cmd/queue-operator) and RBAC.
2026-06-21 17:08:17 -07:00

17 lines
556 B
Go

package operator
import (
"context"
"github.com/rockliang/kafka-management-service/internal/kafka"
)
// TopicAdmin is the subset of internal/kafka.Admin the reconciler needs,
// abstracted so tests can substitute a fake instead of a real Kafka cluster.
type TopicAdmin interface {
CreateTopic(ctx context.Context, topic string, cfg kafka.TopicConfig) error
DeleteTopic(ctx context.Context, topic string) error
LogEndOffsetSum(ctx context.Context, topic string) (int64, error)
ConsumerLag(ctx context.Context, group, topic string) (int64, error)
}