Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
irach-ramos committed Oct 2, 2024
1 parent 8476cc6 commit e4f4e22
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
1 change: 1 addition & 0 deletions golem-common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ pub struct CassandraConfig {
pub username: Option<String>,
pub password: Option<String>,
}

fn default_cassandra_keyspace() -> String {
String::from("__golem")
}
Expand Down
1 change: 1 addition & 0 deletions golem-test-framework/src/config/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,7 @@ impl TestDependencies for CliTestDependencies {
fn worker_executor_cluster(&self) -> Arc<dyn WorkerExecutorCluster + Send + Sync + 'static> {
self.worker_executor_cluster.clone()
}

fn cassandra(
&self,
) -> Arc<dyn crate::components::cassandra::Cassandra + Send + Sync + 'static> {
Expand Down
1 change: 1 addition & 0 deletions golem-test-framework/src/config/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ impl TestDependencies for EnvBasedTestDependencies {
fn worker_executor_cluster(&self) -> Arc<dyn WorkerExecutorCluster + Send + Sync + 'static> {
self.worker_executor_cluster.clone()
}

fn cassandra(&self) -> Arc<dyn Cassandra + Send + Sync + 'static> {
self.cassandra.clone()
}
Expand Down
29 changes: 13 additions & 16 deletions golem-worker-executor-base/src/cassandra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,12 @@ impl CassandraSession {
.query_unpaged(
Query::new(format!(
r#"
CREATE TABLE IF NOT EXISTS {}.kv_store (
namespace TEXT,
key TEXT,
value BLOB,
PRIMARY KEY (namespace, key)
);
"#,
CREATE TABLE IF NOT EXISTS {}.kv_store (
namespace TEXT,
key TEXT,
value BLOB,
PRIMARY KEY (namespace, key)
);"#,
self.keyspace
)),
&[],
Expand All @@ -101,13 +100,12 @@ impl CassandraSession {
.query_unpaged(
Query::new(format!(
r#"
CREATE TABLE IF NOT EXISTS {}.kv_sets (
namespace TEXT,
key TEXT,
value BLOB,
PRIMARY KEY ((namespace, key), value)
);
"#,
CREATE TABLE IF NOT EXISTS {}.kv_sets (
namespace TEXT,
key TEXT,
value BLOB,
PRIMARY KEY ((namespace, key), value)
);"#,
self.keyspace
)),
&[],
Expand All @@ -125,8 +123,7 @@ impl CassandraSession {
score DOUBLE,
value BLOB,
PRIMARY KEY ((namespace, key), score, value)
);
"#,
);"#,
self.keyspace
)),
&[],
Expand Down

0 comments on commit e4f4e22

Please sign in to comment.