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 Detail

      • convert

        java.util.Map<StoreKey,​StoreKey> convert​(java.util.Collection<? extends StoreKey> input)
                                                throws java.lang.Exception
        Returns a mapping for every StoreKey in input. If a StoreKey is already in the format desired or no mapping exists, returns the same StoreKey as the mapping. Returns null if StoreKey is deprecated or invalid.
        Parameters:
        input - the StoreKeys that need to be converted.
        Returns:
        a mapping for each StoreKey in the new format.
        Throws:
        java.lang.Exception - that may be thrown when performing the conversion operation
      • getConverted

        StoreKey getConverted​(StoreKey storeKey)
        Returns converted storeKey. Intended to use after running convert(Collection), as intention is that this will retrieve an already converted storeKey. If called prior to convert(Collection) it may throw an IllegalStateException
        Parameters:
        storeKey - storeKey you want the converted version of. If the key was not apart of a previous convert(Collection) call, method may throw IllegalStateException
        Returns:
        the previously converted storeKey