-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
settings: add functionality for settings override
This commit adds override functionality to the `SettingsWatcher`. We define an `OverrideMonitor` interface that is used to discover the overrides and listen for updates. The logic in `SettingsWatcher` is updated to return the override whenever there is one set, otherwise return the current value as normal. On non-system tenants, an `OverrideMonitor` implementation will use new tenant connector APIs to allow the host cluster to override settings (see the separate RFC). Release note: None
- Loading branch information
1 parent
1457048
commit 2b9e9ce
Showing
8 changed files
with
385 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2021 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package settingswatcher | ||
|
||
// OverridesMonitor is an interface through which the settings watcher can | ||
// receive setting overrides. Used for non-system tenants. | ||
// | ||
// The expected usage is to listen for a message on NotifyCh(), and use | ||
// Current() to retrieve the updated list of overrides when a message is | ||
// received. | ||
type OverridesMonitor interface { | ||
// NotifyCh returns a channel that receives a message any time the current set | ||
// of overrides changes. | ||
NotifyCh() <-chan struct{} | ||
|
||
// Overrides retrieves the current set of setting overrides, as a map from | ||
// setting key to RawValue. Any settings that are present must be set to the | ||
// overridden value. | ||
Overrides() map[string]RawValue | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.