@Override
  public Map<StoreKey, StoreKey> convert(Collection<? extends StoreKey> input) throws Exception {
    if (input == null) {
      return new HashMap<>();
    }

    List<StoreKey> alreadyPresentStoreKeys = new ArrayList<>();
    List<StoreKey> storeKeysTobeConverted = new ArrayList<>();

    input.forEach((storeKey) -> {
      if (conversionCache.containsKey(storeKey)) {
        alreadyPresentStoreKeys.add(storeKey);
      } else {
        storeKeysTobeConverted.add(storeKey);
      }
    });

    Map<StoreKey, StoreKey> map = convertKeys(storeKeysTobeConverted);

    alreadyPresentStoreKeys.forEach((storeKey -> {
      map.put(storeKey, conversionCache.get(storeKey));
    }));

    map.forEach((storeKey, convertedStoreKey) -> {
      cachedKeyCount.put(storeKey, cachedKeyCount.getOrDefault(storeKey, 0) + 1);
    });

    conversionCache.putAll(map);
    return Collections.unmodifiableMap(map);
  }
if any key is present in cache cached result will be returned.
For the remaining keys conversion will be attempted.
@param input the {@link StoreKey}s that need to be converted.
@return {@link Map} map of storeKeys to converted keys
@throws Exception
ambry-api/src/main/java/com/github/ambry/store/AbstractStoreKeyConverter.java