Skip to content

Commit 51e3049

Browse files
MichaelCuevasfacebook-github-bot
authored andcommitted
delete LfsFallbackRemoteStore
Summary: Grepping shows it's not longer used anywhere. It's safe to delete altogether. This will also fix 2 warnings: ``` warning: associated function `new` is never used --> fbcode/eden/scm/lib/revisionstore/src/lfs.rs:1993:12 | 1992 | impl LfsFallbackRemoteStore { | --------------------------- associated function in this implementation 1993 | pub fn new(wrapped_store: Arc<dyn RemoteDataStore>) -> Arc<dyn RemoteDataStore> { | ^^^ warning: associated function `new` is never used --> fbcode/eden/scm/lib/revisionstore/src/lfs.rs:1993:12 | 1992 | impl LfsFallbackRemoteStore { | --------------------------- associated function in this implementation 1993 | pub fn new(wrapped_store: Arc<dyn RemoteDataStore>) -> Arc<dyn RemoteDataStore> { | ^^^ | = note: `#[warn(dead_code)]` on by default ``` Reviewed By: quark-zju Differential Revision: D65218832 fbshipit-source-id: 55825e13e9e1d3367f2da58c15e86768462b41e9
1 parent 2e820dd commit 51e3049

File tree

1 file changed

+0
-72
lines changed
  • eden/scm/lib/revisionstore/src

1 file changed

+0
-72
lines changed

eden/scm/lib/revisionstore/src/lfs.rs

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,78 +1980,6 @@ impl LocalStore for LfsRemoteStore {
19801980
}
19811981
}
19821982

1983-
/// Wraps another remote store to retry fetching content-keys from their HgId keys.
1984-
///
1985-
/// If for any reason, the LFS server is turned off, we will end up in here for blobs where we have
1986-
/// the pointer locally, but not the blob. In this case, we want the code to fallback to fetching
1987-
/// the blob with the regular non-LFS protocol, hence this stores merely translates
1988-
/// `StoreKey::Content` onto `StoreKey::HgId` before asking the non-LFS remote store to fetch data
1989-
/// for these.
1990-
pub struct LfsFallbackRemoteStore(Arc<dyn RemoteDataStore>);
1991-
1992-
impl LfsFallbackRemoteStore {
1993-
pub fn new(wrapped_store: Arc<dyn RemoteDataStore>) -> Arc<dyn RemoteDataStore> {
1994-
Arc::new(Self(wrapped_store))
1995-
}
1996-
}
1997-
1998-
impl RemoteDataStore for LfsFallbackRemoteStore {
1999-
fn prefetch(&self, keys: &[StoreKey]) -> Result<Vec<StoreKey>> {
2000-
let mut not_found = Vec::new();
2001-
let not_prefetched = self.0.prefetch(
2002-
&keys
2003-
.iter()
2004-
.filter_map(|key| match key {
2005-
StoreKey::HgId(_) => {
2006-
not_found.push(key.clone());
2007-
None
2008-
}
2009-
StoreKey::Content(_, hgid) => match hgid {
2010-
None => {
2011-
not_found.push(key.clone());
2012-
None
2013-
}
2014-
Some(hgid) => Some(StoreKey::hgid(hgid.clone())),
2015-
},
2016-
})
2017-
.collect::<Vec<_>>(),
2018-
)?;
2019-
2020-
not_found.extend(not_prefetched);
2021-
Ok(not_found)
2022-
}
2023-
2024-
fn upload(&self, keys: &[StoreKey]) -> Result<Vec<StoreKey>> {
2025-
Ok(keys.to_vec())
2026-
}
2027-
}
2028-
2029-
impl HgIdDataStore for LfsFallbackRemoteStore {
2030-
fn get(&self, key: StoreKey) -> Result<StoreResult<Vec<u8>>> {
2031-
match self.prefetch(&[key.clone()]) {
2032-
Ok(_) => self.0.get(key),
2033-
Err(_) => Ok(StoreResult::NotFound(key)),
2034-
}
2035-
}
2036-
2037-
fn get_meta(&self, key: StoreKey) -> Result<StoreResult<Metadata>> {
2038-
match self.prefetch(&[key.clone()]) {
2039-
Ok(_) => self.0.get_meta(key),
2040-
Err(_) => Ok(StoreResult::NotFound(key)),
2041-
}
2042-
}
2043-
2044-
fn refresh(&self) -> Result<()> {
2045-
self.0.refresh()
2046-
}
2047-
}
2048-
2049-
impl LocalStore for LfsFallbackRemoteStore {
2050-
fn get_missing(&self, keys: &[StoreKey]) -> Result<Vec<StoreKey>> {
2051-
self.0.get_missing(keys)
2052-
}
2053-
}
2054-
20551983
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
20561984
enum RetryStrategy {
20571985
RetryError,

0 commit comments

Comments
 (0)