pub struct OperationParameters { /* private fields */ }Expand description
What Client::update_operation_parameters should change.
The parameters a running operation will accept: which pool it competes in, and how much of that pool it gets. Everything else about an operation is fixed when it starts.
use ytsaurus_client::OperationParameters;
// Move a job that turned out to matter into the pool that gets served
// first, and give it twice the share.
let urgent = OperationParameters::new().with_pool("interactive").with_weight(2.0);Implementations§
Source§impl OperationParameters
impl OperationParameters
Sourcepub fn with_pool(self, pool: impl AsRef<str>) -> Self
pub fn with_pool(self, pool: impl AsRef<str>) -> Self
Moves the operation into another pool.
Applies to every pool tree the operation runs in. Verified on a local
cluster: a top-level key here lands under
runtime_parameters/scheduling_options_per_pool_tree/<tree>, once per
tree. OperationParameters::with_pool_in_tree names one instead.
Sourcepub fn with_weight(self, weight: f64) -> Self
pub fn with_weight(self, weight: f64) -> Self
Changes the operation’s share of its pool.
A double, and the cluster means it: 1.0 is the default share, 2.0 is
twice as much of whatever the pool gets.
Sourcepub fn with_pool_in_tree(
self,
tree: impl AsRef<str>,
pool: impl AsRef<str>,
) -> Self
pub fn with_pool_in_tree( self, tree: impl AsRef<str>, pool: impl AsRef<str>, ) -> Self
Moves the operation into another pool of one tree.
For an installation with more than one pool tree, where the operation should move in one of them and stay where it is in the others.
Adds to what the tree’s entry already holds rather than replacing it:
update_operation_parameters assigns, so an entry that arrived here
with a weight in it and left with only a pool would reset that
weight on the cluster and report success.
Sourcepub fn with_raw(self, key: impl AsRef<str>, value: YsonValue) -> Self
pub fn with_raw(self, key: impl AsRef<str>, value: YsonValue) -> Self
Sets any parameter this builder does not model — acl, annotations,
scheduling_tag_filter.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether this would ask the cluster to change nothing.
Client::update_operation_parameters refuses an empty update: the
cluster answers 200 and does nothing, so the mistake is invisible where
it is made.
Trait Implementations§
Source§impl Clone for OperationParameters
impl Clone for OperationParameters
Source§fn clone(&self) -> OperationParameters
fn clone(&self) -> OperationParameters
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more