-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-768 Store config uniqueness enforced by StoreManager #1555
base: main
Are you sure you want to change the base?
Changes from 2 commits
324df36
9f67019
ccca3a6
6bb7cc2
01f23a7
4a4d11a
d361abf
91a3557
9adeef3
0022bdf
aff36b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ use nativelink_proto::google::devtools::build::v1::{ | |
PublishBuildToolEventStreamRequest, PublishLifecycleEventRequest, StreamId, | ||
}; | ||
use nativelink_service::bep_server::BepServer; | ||
use nativelink_store::default_store_factory::store_factory; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this seems heavy at first read but maybe it is an improvement to both the naming and the functionality. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
use nativelink_store::default_store_factory::make_and_add_store_to_manager; | ||
use nativelink_store::store_manager::StoreManager; | ||
use nativelink_util::buf_channel::make_buf_channel_pair; | ||
use nativelink_util::channel_body_for_tests::ChannelBody; | ||
|
@@ -52,15 +52,14 @@ const BEP_STORE_NAME: &str = "main_bep"; | |
/// Utility function to construct a [`StoreManager`] | ||
async fn make_store_manager() -> Result<Arc<StoreManager>, Error> { | ||
let store_manager = Arc::new(StoreManager::new()); | ||
store_manager.add_store( | ||
make_and_add_store_to_manager( | ||
BEP_STORE_NAME, | ||
store_factory( | ||
&StoreSpec::memory(MemorySpec::default()), | ||
&store_manager, | ||
None, | ||
) | ||
.await?, | ||
); | ||
&StoreSpec::memory(MemorySpec::default()), | ||
&store_manager, | ||
None, | ||
) | ||
.await?; | ||
|
||
Ok(store_manager) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my understanding, what is the reason why you moved away from
store_factory
rather than modifyingstore_factory
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still using
store_factory
to build the Store, but wrapping up inmake_and_add_store_to_manager
because it makes building and adding a Store to a StoreManager a single step from a public-facing perspective.