class OMKeyCreateResponse extends OMClientResponse {

  @Override
  protected void addToDBBatch(OMMetadataManager omMetadataManager,
      BatchOperation batchOperation) throws IOException {

    /**
     * Create parent directory entries during Key Create - do not wait
     * for Key Commit request.
     * XXX handle stale directory entries.
     */
    if (parentKeyInfos != null) {
      for (OmKeyInfo parentKeyInfo : parentKeyInfos) {
        String parentKey = omMetadataManager
            .getOzoneDirKey(parentKeyInfo.getVolumeName(),
                parentKeyInfo.getBucketName(), parentKeyInfo.getKeyName());
        if (LOG.isDebugEnabled()) {
          LOG.debug("putWithBatch adding parent : key {} info : {}", parentKey,
              parentKeyInfo);
        }
        omMetadataManager.getKeyTable()
            .putWithBatch(batchOperation, parentKey, parentKeyInfo);
      }
    }

    String openKey = omMetadataManager.getOpenKey(omKeyInfo.getVolumeName(),
        omKeyInfo.getBucketName(), omKeyInfo.getKeyName(), openKeySessionID);
    omMetadataManager.getOpenKeyTable().putWithBatch(batchOperation,
        openKey, omKeyInfo);

    // update volume usedBytes.
    omMetadataManager.getVolumeTable().putWithBatch(batchOperation,
        omMetadataManager.getVolumeKey(omVolumeArgs.getVolume()),
        omVolumeArgs);
    // update bucket usedBytes.
    omMetadataManager.getBucketTable().putWithBatch(batchOperation,
        omMetadataManager.getBucketKey(omVolumeArgs.getVolume(),
            omBucketInfo.getBucketName()), omBucketInfo);
  }

  public  OMKeyCreateResponse(@Nonnull OMResponse omResponse,
      @Nonnull OmKeyInfo omKeyInfo, List<OmKeyInfo> parentKeyInfos,
      long openKeySessionID, @Nonnull OmVolumeArgs omVolumeArgs,
      @Nonnull OmBucketInfo omBucketInfo);
  public  OMKeyCreateResponse(@Nonnull OMResponse omResponse);

}