Skip to content

Commit 25bf23a

Browse files
renaming
1 parent 46529de commit 25bf23a

8 files changed

Lines changed: 30 additions & 30 deletions

File tree

apix/config/v1alpha1/endpointpickerconfig_types.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,18 +239,18 @@ type DataLayerConfig struct {
239239
// If omitted, the EPP uses the default Kubernetes-based discovery.
240240
Discovery *DiscoveryConfig `json:"discovery,omitempty"`
241241
// +optional
242-
// SharedStateStorePluginRef names the plugin instance to use as the cross-EPP
243-
// shared state store. The reference is to the name of an entry in the
244-
// top-level Plugins section. If omitted, no shared state store is used
245-
// and plugins that read shared state fall back to local data.
246-
SharedStateStorePluginRef string `json:"sharedStateStorePluginRef,omitempty"`
242+
// CrossReplicaStorePluginRef names the plugin instance to use as the cross-EPP
243+
// cross-replica store. The reference is to the name of an entry in the
244+
// top-level Plugins section. If omitted, no cross-replica store is used
245+
// and plugins that read cross-replica state fall back to local data.
246+
CrossReplicaStorePluginRef string `json:"crossReplicaStorePluginRef,omitempty"`
247247
}
248248

249249
func (dlc *DataLayerConfig) String() string {
250250
if dlc == nil {
251251
return nilString
252252
}
253-
return fmt.Sprintf("{Sources: %v, Discovery: %v, SharedStateStorePluginRef: %s}", dlc.Sources, dlc.Discovery, dlc.SharedStateStorePluginRef)
253+
return fmt.Sprintf("{Sources: %v, Discovery: %v, CrossReplicaStorePluginRef: %s}", dlc.Sources, dlc.Discovery, dlc.CrossReplicaStorePluginRef)
254254
}
255255

256256
// DiscoveryConfig references the EndpointDiscovery plugin to use.

pkg/epp/config/loader/configloader.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,10 @@ func buildDataLayerConfig(rawDataConfig *configapi.DataLayerConfig, handle fwkpl
432432
return &cfg, nil
433433
}
434434

435-
if ref := rawDataConfig.SharedStateStorePluginRef; ref != "" {
436-
store, ok := handle.Plugin(ref).(fwkdl.SharedStateStore)
435+
if ref := rawDataConfig.CrossReplicaStorePluginRef; ref != "" {
436+
store, ok := handle.Plugin(ref).(fwkdl.CrossReplicaStore)
437437
if !ok {
438-
return nil, fmt.Errorf("the plugin %s is not a fwkdl.SharedStateStore", ref)
438+
return nil, fmt.Errorf("the plugin %s is not a fwkdl.CrossReplicaStore", ref)
439439
}
440440
cfg.Store = store
441441
}

pkg/epp/datalayer/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
// the set-up phase.
3030
type Config struct {
3131
Sources []DataSourceConfig // the data sources configured in the data layer
32-
Store fwkdl.SharedStateStore
32+
Store fwkdl.CrossReplicaStore
3333
}
3434

3535
func (c *Config) String() string {

pkg/epp/datalayer/runtime.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type Runtime struct {
5353
notification *notificationManager
5454
endpoint *endpointManager
5555
extractors *extractorMap
56-
store fwkdl.SharedStateStore
56+
store fwkdl.CrossReplicaStore
5757

5858
pendingMu sync.Mutex
5959
pendingRegistrations []fwkdl.PendingRegistration // code-registered (source-type, extractor) pairs, resolved by Configure()
@@ -446,8 +446,8 @@ func (r *Runtime) dispatchEndpointEvent(ctx context.Context, logger logr.Logger,
446446
if err := epExt.Extract(ctx, *processed); err != nil {
447447
logger.Error(err, "endpoint extractor failed", "extractor", ext.TypedName())
448448
}
449-
if contributor, ok := ext.(fwkdl.SharedStateContributor); ok && r.store != nil {
450-
spec := contributor.SharedState()
449+
if contributor, ok := ext.(fwkdl.CrossReplicaContributor); ok && r.store != nil {
450+
spec := contributor.CrossReplicaState()
451451
endpointID := processed.Endpoint.GetMetadata().GetNamespacedName().String()
452452
switch processed.Type {
453453
case fwkdl.EventAddOrUpdate:

pkg/epp/framework/interface/datalayer/state_store.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ import (
2525
// StateKey namespaces cross-EPP shared state.
2626
type StateKey string
2727

28-
// SharedStateStore is a cross-EPP state store for sharing state across replicas.
28+
// CrossReplicaStore is a cross-EPP state store for sharing state across replicas.
2929
// Implementations own the sync mechanism (e.g., Redis pub/sub, gossip) and the
3030
// aggregation strategy (e.g., sum for in-flight load, union for cache state).
3131
// The store can dispatch per StateKey for different aggregation strategies.
32-
type SharedStateStore interface {
32+
type CrossReplicaStore interface {
3333
fwkplugin.Plugin
3434

3535
// Set writes a value for the given key and endpoint. The runtime calls
@@ -46,16 +46,16 @@ type SharedStateStore interface {
4646
Delete(ctx context.Context, key StateKey, endpointID string) error
4747
}
4848

49-
// SharedStateContributor is an opt-in interface for endpoint extractors that
49+
// CrossReplicaContributor is an opt-in interface for endpoint extractors that
5050
// want their installed attributes to reflect cross-replica aggregate state.
5151
// The plugin's Extract method is unchanged; the runtime detects this interface
5252
// and wires the store transparently.
53-
type SharedStateContributor interface {
54-
SharedState() SharedStateSpec
53+
type CrossReplicaContributor interface {
54+
CrossReplicaState() CrossReplicaSpec
5555
}
5656

57-
// SharedStateSpec declares what a SharedStateContributor publishes and where.
58-
type SharedStateSpec struct {
57+
// CrossReplicaSpec declares what a CrossReplicaContributor publishes and where.
58+
type CrossReplicaSpec struct {
5959
// StateKey namespaces this contributor's data in the store.
6060
StateKey StateKey
6161

pkg/epp/framework/plugins/datalayer/cross_plugin/state_store_mock.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ import (
2828

2929
const LocalStateStoreType = "local-state-store"
3030

31-
var _ fwkdl.SharedStateStore = (*LocalStateStore)(nil)
31+
var _ fwkdl.CrossReplicaStore = (*LocalStateStore)(nil)
3232

33-
// LocalStateStore is an in-memory mock SharedStateStore for single-replica
33+
// LocalStateStore is an in-memory mock CrossReplicaStore for single-replica
3434
// deployments and testing. No cross-replica sync is performed.
3535
type LocalStateStore struct {
3636
typedName fwkplugin.TypedName

pkg/epp/framework/plugins/requestcontrol/dataproducer/inflightload/producer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ var (
116116
_ requestcontrol.DataProducer = &InFlightLoadProducer{}
117117
_ datalayer.EndpointExtractor = (*InFlightLoadProducer)(nil)
118118
_ datalayer.Registrant = &InFlightLoadProducer{}
119-
_ datalayer.SharedStateContributor = (*InFlightLoadProducer)(nil)
119+
_ datalayer.CrossReplicaContributor = (*InFlightLoadProducer)(nil)
120120
_ fwkplugin.ConsumerPlugin = &InFlightLoadProducer{}
121121
_ fwkplugin.StateDumper = &InFlightLoadProducer{}
122122
)
@@ -279,9 +279,9 @@ func (p *InFlightLoadProducer) RegisterDependencies(r datalayer.Registrar) error
279279
})
280280
}
281281

282-
// SharedState declares the cross-EPP state this plugin contributes.
283-
func (p *InFlightLoadProducer) SharedState() datalayer.SharedStateSpec {
284-
return datalayer.SharedStateSpec{
282+
// CrossReplicaState declares the cross-EPP state this plugin contributes.
283+
func (p *InFlightLoadProducer) CrossReplicaState() datalayer.CrossReplicaSpec {
284+
return datalayer.CrossReplicaSpec{
285285
StateKey: datalayer.StateKey("inflight:" + p.typedName.Name),
286286
AttributeKey: p.dk.String(),
287287
Supply: func(endpointID string) func() datalayer.Cloneable {

pkg/epp/requestcontrol/director.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func NewDirectorWithConfig(
129129
admissionController AdmissionController,
130130
endpointCandidates contracts.EndpointCandidates,
131131
config *Config,
132-
store fwkdl.SharedStateStore,
132+
store fwkdl.CrossReplicaStore,
133133
) *Director {
134134
return &Director{
135135
datastore: datastore,
@@ -202,7 +202,7 @@ type Director struct {
202202
admissionController AdmissionController
203203
endpointCandidates contracts.EndpointCandidates
204204
requestControlPlugins Config
205-
store fwkdl.SharedStateStore
205+
store fwkdl.CrossReplicaStore
206206
// We just need a pointer to an int32 variable since Priority is a pointer in InferenceObjective.
207207
// No need to set this in the constructor, since the value we want is the default (0)
208208
// and value types cannot be nil.
@@ -622,8 +622,8 @@ func (d *Director) runDataProducerPlugins(ctx context.Context,
622622
if err := dataProducerPluginsWithTimeout(ctx, producerTimeout(p), []fwkrc.DataProducer{p}, request, endpoints); err != nil {
623623
return err
624624
}
625-
if contributor, ok := p.(fwkdl.SharedStateContributor); ok && d.store != nil {
626-
spec := contributor.SharedState()
625+
if contributor, ok := p.(fwkdl.CrossReplicaContributor); ok && d.store != nil {
626+
spec := contributor.CrossReplicaState()
627627
for _, ep := range endpoints {
628628
if ep == nil || ep.GetMetadata() == nil {
629629
continue

0 commit comments

Comments
 (0)