Package com.github.ambry.store
Interface StoreKeyConverter
-
public interface StoreKeyConverter
This is a service that can be used to convert store keys across different formats. Typical usage will be to map b/w different formats of keys that refer to the same blob. The input/output formats are expected to be set when the converter is constructed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Map<StoreKey,StoreKey>
convert(java.util.Collection<? extends StoreKey> input)
Returns a mapping for everyStoreKey
ininput
.void
dropCache()
Drops the cache reference used byStoreKeyConverter
StoreKey
getConverted(StoreKey storeKey)
Returns converted storeKey.
-
-
-
Method Detail
-
convert
java.util.Map<StoreKey,StoreKey> convert(java.util.Collection<? extends StoreKey> input) throws java.lang.Exception
-
getConverted
StoreKey getConverted(StoreKey storeKey)
Returns converted storeKey. Intended to use after runningconvert(Collection)
, as intention is that this will retrieve an already converted storeKey. If called prior toconvert(Collection)
it may throw an IllegalStateException- Parameters:
storeKey
- storeKey you want the converted version of. If the key was not apart of a previousconvert(Collection)
call, method may throw IllegalStateException- Returns:
- the previously converted storeKey
-
dropCache
void dropCache()
Drops the cache reference used byStoreKeyConverter
-
-