hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/StorageContainerManager.java
public List<DeleteBlockGroupResult> deleteKeyBlocks(
      List<BlockGroup> keyBlocksInfoList) throws IOException {
    LOG.info("SCM is informed by KSM to delete {} blocks",
        keyBlocksInfoList.size());
    List<DeleteBlockGroupResult> results = new ArrayList<>();
    for (BlockGroup keyBlocks : keyBlocksInfoList) {
      Result resultCode;
      try {
        // We delete blocks in an atomic operation to prevent getting
        // into state like only a partial of blocks are deleted,
        // which will leave key in an inconsistent state.
        scmBlockManager.deleteBlocks(keyBlocks.getBlockIDList());
        resultCode = Result.success;
      } catch (SCMException scmEx) {
        LOG.warn("Fail to delete block: {}", keyBlocks.getGroupID(), scmEx);
        switch (scmEx.getResult()) {
        case CHILL_MODE_EXCEPTION:
          resultCode = Result.chillMode;
          break;
        case FAILED_TO_FIND_BLOCK:
          resultCode = Result.errorNotFound;
          break;
        default:
          resultCode = Result.unknownFailure;
        }
      } catch (IOException ex) {
        LOG.warn("Fail to delete blocks for object key: {}",
            keyBlocks.getGroupID(), ex);
        resultCode = Result.unknownFailure;
      }
      List<DeleteBlockResult> blockResultList = new ArrayList<>();
      for (String blockKey : keyBlocks.getBlockIDList()) {
        blockResultList.add(new DeleteBlockResult(blockKey, resultCode));
      }
      results.add(new DeleteBlockGroupResult(keyBlocks.getGroupID(),
          blockResultList));
    }
    return results;
  }
/**
   * Delete blocks for a set of object keys.
   *
   * @param keyBlocksInfoList list of block keys with object keys to delete.
   * @return deletion results.
   */
Delete blocks for a set of object keys.
@param keyBlocksInfoList list of block keys with object keys to delete.
@return deletion results.
Delete blocks for a set of object keys . @param keyBlocksInfoList list of block keys with object keys to delete . @return deletion results .
public List<DeleteBlockGroupResult> deleteKeyBlocks(
      List<BlockGroup> keyBlocksInfoList) throws IOException {
    LOG.info("SCM is informed by KSM to delete {} blocks",
        keyBlocksInfoList.size());
    List<DeleteBlockGroupResult> results = new ArrayList<>();
    for (BlockGroup keyBlocks : keyBlocksInfoList) {
      Result resultCode;
      try {
        scmBlockManager.deleteBlocks(keyBlocks.getBlockIDList());
        resultCode = Result.success;
      } catch (SCMException scmEx) {
        LOG.warn("Fail to delete block: {}", keyBlocks.getGroupID(), scmEx);
        switch (scmEx.getResult()) {
        case CHILL_MODE_EXCEPTION:
          resultCode = Result.chillMode;
          break;
        case FAILED_TO_FIND_BLOCK:
          resultCode = Result.errorNotFound;
          break;
        default:
          resultCode = Result.unknownFailure;
        }
      } catch (IOException ex) {
        LOG.warn("Fail to delete blocks for object key: {}",
            keyBlocks.getGroupID(), ex);
        resultCode = Result.unknownFailure;
      }
      List<DeleteBlockResult> blockResultList = new ArrayList<>();
      for (String blockKey : keyBlocks.getBlockIDList()) {
        blockResultList.add(new DeleteBlockResult(blockKey, resultCode));
      }
      results.add(new DeleteBlockGroupResult(keyBlocks.getGroupID(),
          blockResultList));
    }
    return results;
  }
public List < DeleteBlockGroupResult > deleteKeyBlocks ( List < BlockGroup > keyBlocksInfoList ) throws IOException { LOG . info ( "SCM is informed by KSM to delete {} blocks" , keyBlocksInfoList . size ( ) ) ; List < DeleteBlockGroupResult > results = new ArrayList < > ( ) ; for ( BlockGroup keyBlocks : keyBlocksInfoList ) { Result resultCode ; try { scmBlockManager . deleteBlocks ( keyBlocks . getBlockIDList ( ) ) ; resultCode = Result . success ; } catch ( SCMException scmEx ) { LOG . warn ( "Fail to delete block: {}" , keyBlocks . getGroupID ( ) , scmEx ) ; switch ( scmEx . getResult ( ) ) { case CHILL_MODE_EXCEPTION : resultCode = Result . chillMode ; break ; case FAILED_TO_FIND_BLOCK : resultCode = Result . errorNotFound ; break ; default : resultCode = Result . unknownFailure ; } } catch ( IOException ex ) { LOG . warn ( "Fail to delete blocks for object key: {}" , keyBlocks . getGroupID ( ) , ex ) ; resultCode = Result . unknownFailure ; } List < DeleteBlockResult > blockResultList = new ArrayList < > ( ) ; for ( String blockKey : keyBlocks . getBlockIDList ( ) ) { blockResultList . add ( new DeleteBlockResult ( blockKey , resultCode ) ) ; } results . add ( new DeleteBlockGroupResult ( keyBlocks . getGroupID ( ) , blockResultList ) ) ; } return results ; }
Delete blocks for a set of object keys.
Delete blocks for a set of object keys .
// We delete blocks in an atomic operation to prevent getting // into state like only a partial of blocks are deleted, // which will leave key in an inconsistent state.