class OMDirectoryCreateResponse extends OMClientResponse {

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

    if (Result.SUCCESS == result) {
      // Add all parent keys to batch.
      for (OmKeyInfo parentKeyInfo : parentKeyInfos) {
        String parentKey = omMetadataManager
            .getOzoneDirKey(parentKeyInfo.getVolumeName(),
                parentKeyInfo.getBucketName(), parentKeyInfo.getKeyName());
        LOG.debug("putWithBatch parent : key {} info : {}", parentKey,
            parentKeyInfo);
        omMetadataManager.getKeyTable()
            .putWithBatch(batchOperation, parentKey, parentKeyInfo);
      }

      String dirKey = omMetadataManager.getOzoneKey(dirKeyInfo.getVolumeName(),
          dirKeyInfo.getBucketName(), dirKeyInfo.getKeyName());
      omMetadataManager.getKeyTable().putWithBatch(batchOperation, dirKey,
          dirKeyInfo);
    } else if (Result.DIRECTORY_ALREADY_EXISTS == result) {
      // When directory already exists, we don't add it to cache. And it is
      // not an error, in this case dirKeyInfo will be null.
      LOG.debug("Directory already exists. addToDBBatch is a no-op");
    }
  }

  public  OMDirectoryCreateResponse(@Nonnull OMResponse omResponse,
      @Nonnull OmKeyInfo dirKeyInfo,
      @Nonnull List<OmKeyInfo> parentKeyInfos, @Nonnull Result result);
  public  OMDirectoryCreateResponse(@Nonnull OMResponse omResponse,
      @Nonnull Result result);

}