public void addToCache(String blobKey, short lifeVersion, BlobState blobState) {
    if (recentBlobCache == null) {
      return;
    }
    if (isVcr) {
      if (blobState == BlobState.TTL_UPDATED) {
        // In case of ttl update we update the ttl without taking into account the life version.
        // So make sure that we do not decrease the lifeVersion in cache due to an incoming ttl update.
        if (recentBlobCache.containsKey(blobKey)) {
          lifeVersion = (short) Math.max(lifeVersion, recentBlobCache.get(blobKey).getLifeVersion());
        }
      }
      recentBlobCache.put(blobKey, new BlobLifeState(blobState, lifeVersion, recentBlobCache.get(blobKey)));
    }
  }
Add a blob state mapping to the recent blob cache.
@param blobKey the blob key to cache.
@param lifeVersion life version to cache.
@param blobState the state of the blob.
ambry-cloud/src/main/java/com/github/ambry/cloud/CloudBlobStore.java