@Override
  public Map<String, MessageInfo> findAllMessageInfosForKey(StoreKey key) throws StoreException {
    checkStarted();
    final Timer.Context context = metrics.findAllMessageInfosResponse.time();
    try {
      List<IndexValue> values = index.findAllIndexValuesForKey(key, null);
      if (values == null) {
        return Collections.emptyMap();
      }
      Map<String, MessageInfo> result = new HashMap<>();
      for (IndexValue value : values) {
        Offset offset = value.getOffset();
        String mapKey = offset.getName().toString() + "_" + offset.getOffset();
        result.put(mapKey, fromIndexValue(key, value));
      }
      return result;
    } catch (StoreException e) {
      if (e.getErrorCode() == StoreErrorCodes.IOError) {
        onError();
      }
      throw e;
    } finally {
      context.stop();
    }
  }
Checks the used capacity of the store against the configured percentage thresholds to see if the store
should be read-only or read-write
ambry-store/src/main/java/com/github/ambry/store/BlobStore.java