Skip to content

Commit

Permalink
fix crd generation
Browse files Browse the repository at this point in the history
  • Loading branch information
razvan committed Oct 28, 2024
1 parent 109e877 commit 05f4303
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 21 deletions.
28 changes: 16 additions & 12 deletions deploy/helm/hbase-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -725,13 +725,17 @@ spec:
type: boolean
type: object
regionMover:
default:
ack: null
maxThreads: null
runBeforeShutdown: null
description: Before terminating a region server pod, the RegionMover tool can be invoked to transfer local regions to other servers. This may cause a lot of network traffic in the Kubernetes cluster if the entire HBase stacklet is being restarted. The operator will compute a timeout period for the region move that will not exceed the graceful shutdown timeout.
nullable: true
properties:
ack:
description: If enabled (default), the region mover will confirm that regions are available on the source as well as the target pods before and after the move.
nullable: true
type: boolean
extraOpts:
additionalMoverOptions:
default: []
description: Additional options to pass to the region mover.
items:
Expand All @@ -741,14 +745,12 @@ spec:
description: Maximum number of threads to use for moving regions.
format: uint16
minimum: 0.0
nullable: true
type: integer
runBeforeShutdown:
description: Move local regions to other servers before terminating a region server's pod.
nullable: true
type: boolean
required:
- ack
- maxThreads
- runBeforeShutdown
type: object
resources:
default:
Expand Down Expand Up @@ -974,13 +976,17 @@ spec:
type: boolean
type: object
regionMover:
default:
ack: null
maxThreads: null
runBeforeShutdown: null
description: Before terminating a region server pod, the RegionMover tool can be invoked to transfer local regions to other servers. This may cause a lot of network traffic in the Kubernetes cluster if the entire HBase stacklet is being restarted. The operator will compute a timeout period for the region move that will not exceed the graceful shutdown timeout.
nullable: true
properties:
ack:
description: If enabled (default), the region mover will confirm that regions are available on the source as well as the target pods before and after the move.
nullable: true
type: boolean
extraOpts:
additionalMoverOptions:
default: []
description: Additional options to pass to the region mover.
items:
Expand All @@ -990,14 +996,12 @@ spec:
description: Maximum number of threads to use for moving regions.
format: uint16
minimum: 0.0
nullable: true
type: integer
runBeforeShutdown:
description: Move local regions to other servers before terminating a region server's pod.
nullable: true
type: boolean
required:
- ack
- maxThreads
- runBeforeShutdown
type: object
resources:
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
runBeforeShutdown: true # <1>
maxThreads: 5 # <2>
ack: false # <3>
extraOpts: ["--designatedFile", "/path/to/designatedFile"] # <4>
additionalMoverOptions: ["--designatedFile", "/path/to/designatedFile"] # <4>

Check notice on line 44 in docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc#L44

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc:44:50: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION
----
<1>: Run the region mover tool before shutting down the region server. Default is `false`.
<2>: Maximum number of threads to use for moving regions. Default is 1.
Expand Down
17 changes: 9 additions & 8 deletions rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,17 +534,17 @@ pub struct RegionMover {
/// source as well as the target pods before and after the move.
ack: Option<bool>,

/// Additional options to pass to the region mover.
#[serde(default)]
extra_opts: Option<RegionMoverExtraCliOpts>,
#[fragment_attrs(serde(flatten))]
cli_opts: Option<RegionMoverExtraCliOpts>,
}

#[derive(Clone, Debug, Eq, Deserialize, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
#[schemars(deny_unknown_fields)]
pub struct RegionMoverExtraCliOpts {
#[serde(flatten)]
pub cli_opts: Vec<String>,
/// Additional options to pass to the region mover.
#[serde(default)]
pub additional_mover_options: Vec<String>,
}

impl Atomic for RegionMoverExtraCliOpts {}
Expand All @@ -555,7 +555,7 @@ impl Default for RegionMover {
run_before_shutdown: Some(false),
max_threads: Some(1),
ack: Some(true),
extra_opts: None,
cli_opts: None,
}
}
}
Expand Down Expand Up @@ -595,6 +595,7 @@ pub struct RegionServerConfig {
/// This may cause a lot of network traffic in the Kubernetes cluster if the entire HBase stacklet is being
/// restarted.
/// The operator will compute a timeout period for the region move that will not exceed the graceful shutdown timeout.
#[fragment_attrs(serde(default))]
pub region_mover: RegionMover,
}

Expand Down Expand Up @@ -1170,9 +1171,9 @@ impl AnyServiceConfig {
command.extend(
config
.region_mover
.extra_opts
.cli_opts
.iter()
.flat_map(|o| o.cli_opts.clone())
.flat_map(|o| o.additional_mover_options.clone())
.map(|s| escape(std::borrow::Cow::Borrowed(&s)).to_string()),
);
command.join(" ")
Expand Down

0 comments on commit 05f4303

Please sign in to comment.