@Override
  public CompletableFuture<PutResult> put(NamedBlobRecord record, NamedBlobState state, Boolean isUpsert) {
    return executeTransactionAsync(record.getAccountName(), record.getContainerName(), true,
        (accountId, containerId, connection) -> {
          long startTime = this.time.milliseconds();
          // Do upsert when it's using new table and 'x-ambry-named-upsert' header is not set to false (default is true)
          logger.trace("NamedBlobPutInfo: accountId='{}', containerId='{}', blobName='{}', isUpsert='{}'", accountId,
              containerId, record.getBlobName(), isUpsert);
          if (!isUpsert) {
            NamedBlobRecord recordCurrent = null;
            try {
              recordCurrent =
                  run_get_v2(record.getAccountName(), record.getContainerName(), record.getBlobName(), GetOption.None,
                      accountId, containerId, connection);
            } catch (RestServiceException e) {
              logger.trace(
                  "Skip exception in pulling data from db: accountId='{}', containerId='{}', blobName='{}': {}",
                  accountId, containerId, record.getBlobName(), e);
            }
            if (recordCurrent != null) {
              logger.error(
                  "PUT conflict: Named blob {} already exist, the existing blob id is {}, the new blob id is {}",
                  record.getBlobName(), recordCurrent.getBlobId(), record.getBlobId());
              throw buildException("PUT: Blob still alive", RestServiceErrorCode.Conflict, record.getAccountName(),
                  record.getContainerName(), record.getBlobName());
            }
          }
          PutResult putResult = run_put_v2(record, state, accountId, containerId, connection);
          metricsRecoder.namedBlobPutTimeInMs.update(this.time.milliseconds() - startTime);
          return putResult;
        }, null);
  }
Constructor to create the Metrics.
@param metricRegistry The {@link MetricRegistry}.
ambry-named-mysql/src/main/java/com/github/ambry/named/MySqlNamedBlobDb.java