@Override
  Map<String, String> fetchAccountMetadataFromZNRecord(ZNRecord record) {
    if (router.get() == null) {
      logger.error("Router is not yet initialized");
      return null;
    }
    List<String> blobIDAndVersionsJson = record.getListField(ACCOUNT_METADATA_BLOB_IDS_LIST_KEY);
    if (blobIDAndVersionsJson == null || blobIDAndVersionsJson.size() == 0) {
      logger.info("ZNRecord={} to read on path={} does not have a simple list with key={}", record,
          ACCOUNT_METADATA_BLOB_IDS_PATH, ACCOUNT_METADATA_BLOB_IDS_LIST_KEY);
      return null;
    } else {
      // Parse the json string list and get the blob id with the latest version
      // Since the the blobIDAndVersionsJson.size() is greater than 0, max will return an optional with solid value.
      BlobIDAndVersion blobIDAndVersion = blobIDAndVersionsJson.stream()
          .map(BlobIDAndVersion::fromJson)
          .max(Comparator.comparing(BlobIDAndVersion::getVersion))
          .get();

      logger.trace("Start reading remote account data from blob {} and versioned at {}.", blobIDAndVersion.blobID,
          blobIDAndVersion.version);
      return readAccountMetadataFromBlobID(blobIDAndVersion.blobID);
    }
  }
Constructor to create the RouterStore.
@param accountServiceMetrics The metrics set to update metrics.
@param backupFileManager The {@link BackupFileManager} instance to manage backup files.
@param helixStore The {@link HelixPropertyStore} to fetch and update data.
@param router The {@link Router} instance to retrieve and put blobs.
@param forBackFill True if this {@link RouterStore} is created for backfill accounts to new zookeeper node.
@param totalNumberOfVersionToKeep The total number of previous versions of account metadata to keep.
ambry-account/src/main/java/com/github/ambry/account/RouterStore.java