static String writeAccountMapToRouter(Map<String, String> accountMap, Router router) throws Exception {
    Objects.requireNonNull(router, "Router is null");
    // Construct the json object and save it to ambry server.
    JSONObject object = new JSONObject();
    for (Map.Entry<String, String> entry : accountMap.entrySet()) {
      object.put(entry.getKey(), entry.getValue());
    }

    ByteBufferReadableStreamChannel channel =
        new ByteBufferReadableStreamChannel(ByteBuffer.wrap(object.toString().getBytes(Charsets.UTF_8)));
    BlobProperties properties = new BlobProperties(channel.getSize(), SERVICE_ID, ACCOUNT_ID, CONTAINER_ID, false);
    return router.putBlob(properties, null, channel, PutBlobOptions.DEFAULT).get();
  }
Save the given {@link Account} metadata, as json object, in a blob in {@code AmbryServer}.
@param accountMap The {@link Account} metadata to save.
@param router The {@link Router} instance.
@return A blob id if the operation is finished successfully.
@throws Exception If there is any exceptions while saving the bytes to {@code AmbryServer}.
ambry-account/src/main/java/com/github/ambry/account/RouterStore.java