当前位置: 首页>>代码示例>>Java>>正文


Java FileWithSnapshotFeature.cleanFile方法代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.server.namenode.snapshot.FileWithSnapshotFeature.cleanFile方法的典型用法代码示例。如果您正苦于以下问题:Java FileWithSnapshotFeature.cleanFile方法的具体用法?Java FileWithSnapshotFeature.cleanFile怎么用?Java FileWithSnapshotFeature.cleanFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hdfs.server.namenode.snapshot.FileWithSnapshotFeature的用法示例。


在下文中一共展示了FileWithSnapshotFeature.cleanFile方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cleanSubtree

import org.apache.hadoop.hdfs.server.namenode.snapshot.FileWithSnapshotFeature; //导入方法依赖的package包/类
@Override
public Quota.Counts cleanSubtree(final int snapshot, int priorSnapshotId,
    final BlocksMapUpdateInfo collectedBlocks,
    final List<INode> removedINodes, final boolean countDiffChange)
    throws QuotaExceededException {
  FileWithSnapshotFeature sf = getFileWithSnapshotFeature();
  if (sf != null) {
    return sf.cleanFile(this, snapshot, priorSnapshotId, collectedBlocks,
        removedINodes, countDiffChange);
  }
  Quota.Counts counts = Quota.Counts.newInstance();
  if (snapshot == CURRENT_STATE_ID && priorSnapshotId == NO_SNAPSHOT_ID) {
    // this only happens when deleting the current file and the file is not
    // in any snapshot
    computeQuotaUsage(counts, false);
    destroyAndCollectBlocks(collectedBlocks, removedINodes);
  } else if (snapshot == CURRENT_STATE_ID && priorSnapshotId != NO_SNAPSHOT_ID) {
    // when deleting the current file and the file is in snapshot, we should
    // clean the 0-sized block if the file is UC
    FileUnderConstructionFeature uc = getFileUnderConstructionFeature();
    if (uc != null) {
      uc.cleanZeroSizeBlock(this, collectedBlocks);
    }
  }
  return counts;
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:27,代码来源:INodeFile.java

示例2: cleanSubtree

import org.apache.hadoop.hdfs.server.namenode.snapshot.FileWithSnapshotFeature; //导入方法依赖的package包/类
@Override
public QuotaCounts cleanSubtree(BlockStoragePolicySuite bsps, final int snapshot,
                                int priorSnapshotId,
    final BlocksMapUpdateInfo collectedBlocks,
    final List<INode> removedINodes) {
  FileWithSnapshotFeature sf = getFileWithSnapshotFeature();
  if (sf != null) {
    return sf.cleanFile(bsps, this, snapshot, priorSnapshotId, collectedBlocks,
        removedINodes);
  }
  QuotaCounts counts = new QuotaCounts.Builder().build();
  if (snapshot == CURRENT_STATE_ID) {
    if (priorSnapshotId == NO_SNAPSHOT_ID) {
      // this only happens when deleting the current file and the file is not
      // in any snapshot
      computeQuotaUsage(bsps, counts, false);
      destroyAndCollectBlocks(bsps, collectedBlocks, removedINodes);
    } else {
      // when deleting the current file and the file is in snapshot, we should
      // clean the 0-sized block if the file is UC
      FileUnderConstructionFeature uc = getFileUnderConstructionFeature();
      if (uc != null) {
        uc.cleanZeroSizeBlock(this, collectedBlocks);
      }
    }
  }
  return counts;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:29,代码来源:INodeFile.java

示例3: cleanSubtree

import org.apache.hadoop.hdfs.server.namenode.snapshot.FileWithSnapshotFeature; //导入方法依赖的package包/类
@Override
public void cleanSubtree(ReclaimContext reclaimContext,
    final int snapshot, int priorSnapshotId) {
  FileWithSnapshotFeature sf = getFileWithSnapshotFeature();
  if (sf != null) {
    // TODO: avoid calling getStoragePolicyID
    sf.cleanFile(reclaimContext, this, snapshot, priorSnapshotId,
        getStoragePolicyID());
  } else {
    if (snapshot == CURRENT_STATE_ID) {
      if (priorSnapshotId == NO_SNAPSHOT_ID) {
        // this only happens when deleting the current file and it is not
        // in any snapshot
        destroyAndCollectBlocks(reclaimContext);
      } else {
        FileUnderConstructionFeature uc = getFileUnderConstructionFeature();
        // when deleting the current file and it is in snapshot, we should
        // clean the 0-sized block if the file is UC
        if (uc != null) {
          uc.cleanZeroSizeBlock(this, reclaimContext.collectedBlocks);
          if (reclaimContext.removedUCFiles != null) {
            reclaimContext.removedUCFiles.add(getId());
          }
        }
      }
    }
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:29,代码来源:INodeFile.java

示例4: cleanSubtree

import org.apache.hadoop.hdfs.server.namenode.snapshot.FileWithSnapshotFeature; //导入方法依赖的package包/类
@Override
public Quota.Counts cleanSubtree(final int snapshot, int priorSnapshotId,
    final BlocksMapUpdateInfo collectedBlocks,
    final List<INode> removedINodes) {
  FileWithSnapshotFeature sf = getFileWithSnapshotFeature();
  if (sf != null) {
    return sf.cleanFile(this, snapshot, priorSnapshotId, collectedBlocks,
        removedINodes);
  }
  Quota.Counts counts = Quota.Counts.newInstance();
  if (snapshot == CURRENT_STATE_ID) {
    if (priorSnapshotId == NO_SNAPSHOT_ID) {
      // this only happens when deleting the current file and the file is not
      // in any snapshot
      computeQuotaUsage(counts, false);
      destroyAndCollectBlocks(collectedBlocks, removedINodes);
    } else {
      // when deleting the current file and the file is in snapshot, we should
      // clean the 0-sized block if the file is UC
      FileUnderConstructionFeature uc = getFileUnderConstructionFeature();
      if (uc != null) {
        uc.cleanZeroSizeBlock(this, collectedBlocks);
      }
    }
  }
  return counts;
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:28,代码来源:INodeFile.java

示例5: cleanSubtree

import org.apache.hadoop.hdfs.server.namenode.snapshot.FileWithSnapshotFeature; //导入方法依赖的package包/类
@Override
public Quota.Counts cleanSubtree(final int snapshot, int priorSnapshotId,
    final BlocksMapUpdateInfo collectedBlocks,
    final List<INode> removedINodes, final boolean countDiffChange)
    throws QuotaExceededException {
  FileWithSnapshotFeature sf = getFileWithSnapshotFeature();
  if (sf != null) {
    return sf.cleanFile(this, snapshot, priorSnapshotId, collectedBlocks,
        removedINodes, countDiffChange);
  }
  Quota.Counts counts = Quota.Counts.newInstance();
  if (snapshot == CURRENT_STATE_ID) {
    if (priorSnapshotId == NO_SNAPSHOT_ID) {
      // this only happens when deleting the current file and the file is not
      // in any snapshot
      computeQuotaUsage(counts, false);
      destroyAndCollectBlocks(collectedBlocks, removedINodes);
    } else {
      // when deleting the current file and the file is in snapshot, we should
      // clean the 0-sized block if the file is UC
      FileUnderConstructionFeature uc = getFileUnderConstructionFeature();
      if (uc != null) {
        uc.cleanZeroSizeBlock(this, collectedBlocks);
      }
    }
  }
  return counts;
}
 
开发者ID:yncxcw,项目名称:FlexMap,代码行数:29,代码来源:INodeFile.java


注:本文中的org.apache.hadoop.hdfs.server.namenode.snapshot.FileWithSnapshotFeature.cleanFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。