Skip to content

Commit

Permalink
Consolidate Resettable instances (#6604)
Browse files Browse the repository at this point in the history
### Problem

Given that we always reset the entire `Store` and `CommandRunner` at once, the usage of `Resettable` in those modules is overly fine grained.

### Solution

Move the `Store` and `CommandRunner` into a single external `Resettable` instance, and then remove all internal usage of `Resettable`.

### Result

Simpler code, possibly slightly better performance.
  • Loading branch information
Stu Hood committed Oct 9, 2018
1 parent aeb800d commit 883c54f
Show file tree
Hide file tree
Showing 15 changed files with 142 additions and 271 deletions.
2 changes: 0 additions & 2 deletions src/rust/engine/Cargo.lock

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

1 change: 0 additions & 1 deletion src/rust/engine/fs/Cargo.toml
Expand Up @@ -24,7 +24,6 @@ lmdb = "0.8"
log = "0.4"
parking_lot = "0.6"
protobuf = { version = "2.0.4", features = ["with-bytes"] }
resettable = { path = "../resettable" }
sha2 = "0.7"
serde = "1.0"
serde_derive = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/rust/engine/fs/brfs/src/main.rs
Expand Up @@ -679,7 +679,7 @@ fn main() {
Some(address) => fs::Store::with_remote(
&store_path,
pool,
address.to_owned(),
address,
args.value_of("remote-instance-name").map(str::to_owned),
root_ca_certs,
oauth_bearer_token,
Expand Down
2 changes: 1 addition & 1 deletion src/rust/engine/fs/fs_util/src/main.rs
Expand Up @@ -264,7 +264,7 @@ fn execute(top_match: &clap::ArgMatches) -> Result<(), ExitError> {
Store::with_remote(
&store_dir,
pool.clone(),
cas_address.to_owned(),
cas_address,
top_match
.value_of("remote-instance_name")
.map(str::to_owned),
Expand Down
1 change: 0 additions & 1 deletion src/rust/engine/fs/src/lib.rs
Expand Up @@ -65,7 +65,6 @@ extern crate log;
extern crate mock;
extern crate parking_lot;
extern crate protobuf;
extern crate resettable;
extern crate serde;
extern crate sha2;
#[cfg(test)]
Expand Down

0 comments on commit 883c54f

Please sign in to comment.