Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
474 changes: 349 additions & 125 deletions Cargo.lock

Large diffs are not rendered by default.

1,590 changes: 1,256 additions & 334 deletions Cargo.nix

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["rust/crd", "rust/operator-binary"]
members = ["rust/operator-binary"]
resolver = "2"

[workspace.package]
Expand All @@ -10,6 +10,10 @@ edition = "2021"
repository = "https://github.com/stackabletech/hbase-operator"

[workspace.dependencies]
stackable-versioned = { git = "https://github.com/stackabletech/operator-rs.git", features = ["k8s"], tag = "stackable-versioned-0.5.0" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.85.0" }
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" }

anyhow = "1.0"
built = { version = "0.7", features = ["chrono", "git2"] }
clap = "4.5"
Expand All @@ -23,8 +27,6 @@ serde_json = "1.0"
serde_yaml = "0.9"
shell-escape = "0.1"
snafu = "0.8"
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.85.0" }
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" }
strum = { version = "0.26", features = ["derive"] }
tokio = { version = "1.40", features = ["full"] }
tracing = "0.1"
Expand Down
3 changes: 3 additions & 0 deletions crate-hashes.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 0 additions & 24 deletions rust/crd/Cargo.toml

This file was deleted.

9 changes: 6 additions & 3 deletions rust/operator-binary/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@ repository.workspace = true
publish = false

[dependencies]
stackable-hbase-crd = { path = "../crd" }
stackable-versioned.workspace = true
stackable-operator.workspace = true
product-config.workspace = true

anyhow.workspace = true
clap.workspace = true
const_format.workspace = true
fnv.workspace = true
futures.workspace = true
product-config.workspace = true
indoc.workspace = true
serde.workspace = true
serde_json.workspace = true
shell-escape.workspace = true
snafu.workspace = true
stackable-operator.workspace = true
strum.workspace = true
tokio.workspace = true
tracing.workspace = true
Expand Down
25 changes: 16 additions & 9 deletions rust/operator-binary/src/config/jvm.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
use snafu::{OptionExt, ResultExt, Snafu};
use stackable_hbase_crd::{
AnyServiceConfig, HbaseCluster, HbaseRole, CONFIG_DIR_NAME, JVM_SECURITY_PROPERTIES_FILE,
METRICS_PORT,
};
use stackable_operator::{
memory::{BinaryMultiple, MemoryQuantity},
role_utils::{self, JvmArgumentOverrides},
};

use crate::crd::{
v1alpha1, AnyServiceConfig, HbaseRole, CONFIG_DIR_NAME, JVM_SECURITY_PROPERTIES_FILE,
METRICS_PORT,
};

const JAVA_HEAP_FACTOR: f32 = 0.8;

#[derive(Snafu, Debug)]
Expand Down Expand Up @@ -49,7 +50,7 @@ pub fn construct_global_jvm_args(kerberos_enabled: bool) -> String {
/// JVM arguments that are specifically for the role (server), so will *not* be used e.g. by CLI tools.
/// Heap settings are excluded, as they go into `HBASE_HEAPSIZE`.
pub fn construct_role_specific_non_heap_jvm_args(
hbase: &HbaseCluster,
hbase: &v1alpha1::HbaseCluster,
hbase_role: &HbaseRole,
role_group: &str,
product_version: &str,
Expand Down Expand Up @@ -142,9 +143,8 @@ fn is_heap_jvm_argument(jvm_argument: &str) -> bool {

#[cfg(test)]
mod tests {
use stackable_hbase_crd::{HbaseCluster, HbaseRole};

use super::*;
use crate::crd::{v1alpha1, HbaseRole};

#[test]
fn test_construct_jvm_arguments_defaults() {
Expand Down Expand Up @@ -260,8 +260,15 @@ mod tests {

fn construct_boilerplate(
hbase_cluster: &str,
) -> (HbaseCluster, HbaseRole, AnyServiceConfig, String, String) {
let hbase: HbaseCluster = serde_yaml::from_str(hbase_cluster).expect("illegal test input");
) -> (
v1alpha1::HbaseCluster,
HbaseRole,
AnyServiceConfig,
String,
String,
) {
let hbase: v1alpha1::HbaseCluster =
serde_yaml::from_str(hbase_cluster).expect("illegal test input");

let hbase_role = HbaseRole::RegionServer;
let merged_config = hbase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use stackable_operator::{
k8s_openapi::api::core::v1::{PodAffinity, PodAntiAffinity},
};

use crate::{HbaseRole, APP_NAME};
use crate::crd::{HbaseRole, APP_NAME};

pub fn get_affinity(
cluster_name: &str,
Expand Down Expand Up @@ -91,7 +91,7 @@ mod tests {
};

use super::*;
use crate::HbaseCluster;
use crate::crd::v1alpha1;

#[rstest]
#[case(HbaseRole::Master)]
Expand Down Expand Up @@ -122,7 +122,8 @@ mod tests {
default:
replicas: 1
"#;
let hbase: HbaseCluster = serde_yaml::from_str(input).expect("illegal test input");
let hbase: v1alpha1::HbaseCluster =
serde_yaml::from_str(input).expect("illegal test input");
let affinity = hbase
.merged_config(
&role,
Expand Down
Loading