Skip to content

Commit 199e5fb

Browse files
authored
feat(shard-distributor): add GetMetadata and GetNamespace methods to executor interface (#7477)
**What changed?** Added `GetMetadata()` and `GetNamespace()` methods to the Executor interface, with implementations in executorImpl and updated mocks. **Why?** Allow components that interact with executors to access their metadata (like gRPC address) and namespace without additional lookups. This is needed for the canary ping handler to identify which executor is responding. **How did you test it?** Verified methods return correct values. Updated mock to include new methods. **Potential risks** None - this only adds interface methods that return existing data. **Release notes** **Documentation Changes** None Signed-off-by: Jakob Haahr Taankvist <[email protected]>
1 parent 6a4ab3d commit 199e5fb

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

service/sharddistributor/client/executorclient/client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ type Executor[SP ShardProcessor] interface {
4545

4646
GetShardProcess(ctx context.Context, shardID string) (SP, error)
4747

48+
// Get the namespace this executor is responsible for
49+
GetNamespace() string
50+
4851
// Set metadata for the executor
4952
SetMetadata(metadata map[string]string)
5053
// Get the current metadata of the executor

service/sharddistributor/client/executorclient/clientimpl.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,10 @@ func (e *executorImpl[SP]) emitMetricsConvergence(converged bool) {
462462
}
463463
}
464464

465+
func (e *executorImpl[SP]) GetNamespace() string {
466+
return e.namespace
467+
}
468+
465469
func (e *executorImpl[SP]) SetMetadata(metadata map[string]string) {
466470
e.metadata.Set(metadata)
467471
}

service/sharddistributor/client/executorclient/interface_mock.go

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)