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


Java FileWithSnapshotFeature.isCurrentFileDeleted方法代码示例

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


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

示例1: getPreferredBlockReplication

import org.apache.hadoop.hdfs.server.namenode.snapshot.FileWithSnapshotFeature; //导入方法依赖的package包/类
public short getPreferredBlockReplication() {
  short max = getFileReplication(CURRENT_STATE_ID);
  FileWithSnapshotFeature sf = this.getFileWithSnapshotFeature();
  if (sf != null) {
    short maxInSnapshot = sf.getMaxBlockRepInDiffs(null);
    if (sf.isCurrentFileDeleted()) {
      return maxInSnapshot;
    }
    max = maxInSnapshot > max ? maxInSnapshot : max;
  }
  if(!isStriped()){
    return max;
  }
  // TODO support more policies based on policyId
  ErasureCodingPolicy ecPolicy =
      ErasureCodingPolicyManager.getSystemDefaultPolicy();
  return (short) (ecPolicy.getNumDataUnits() + ecPolicy.getNumParityUnits());
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:19,代码来源:INodeFile.java

示例2: computeContentSummary4Snapshot

import org.apache.hadoop.hdfs.server.namenode.snapshot.FileWithSnapshotFeature; //导入方法依赖的package包/类
private void computeContentSummary4Snapshot(final Content.Counts counts) {
  // file length and diskspace only counted for the latest state of the file
  // i.e. either the current state or the last snapshot
  FileWithSnapshotFeature sf = getFileWithSnapshotFeature();
  if (sf != null) {
    final FileDiffList diffs = sf.getDiffs();
    final int n = diffs.asList().size();
    counts.add(Content.FILE, n);
    if (n > 0 && sf.isCurrentFileDeleted()) {
      counts.add(Content.LENGTH, diffs.getLast().getFileSize());
    }

    if (sf.isCurrentFileDeleted()) {
      final long lastFileSize = diffs.getLast().getFileSize();
      counts.add(Content.DISKSPACE, lastFileSize * getBlockReplication());
    }
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:19,代码来源:INodeFile.java

示例3: getBlockReplication

import org.apache.hadoop.hdfs.server.namenode.snapshot.FileWithSnapshotFeature; //导入方法依赖的package包/类
@Override // BlockCollection
public short getBlockReplication() {
  short max = getFileReplication(CURRENT_STATE_ID);
  FileWithSnapshotFeature sf = this.getFileWithSnapshotFeature();
  if (sf != null) {
    short maxInSnapshot = sf.getMaxBlockRepInDiffs();
    if (sf.isCurrentFileDeleted()) {
      return maxInSnapshot;
    }
    max = maxInSnapshot > max ? maxInSnapshot : max;
  }
  return max;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:INodeFile.java

示例4: computeContentSummary

import org.apache.hadoop.hdfs.server.namenode.snapshot.FileWithSnapshotFeature; //导入方法依赖的package包/类
@Override
public final ContentSummaryComputationContext computeContentSummary(
    final ContentSummaryComputationContext summary) {
  final ContentCounts counts = summary.getCounts();
  FileWithSnapshotFeature sf = getFileWithSnapshotFeature();
  long fileLen = 0;
  if (sf == null) {
    fileLen = computeFileSize();
    counts.addContent(Content.FILE, 1);
  } else {
    final FileDiffList diffs = sf.getDiffs();
    final int n = diffs.asList().size();
    counts.addContent(Content.FILE, n);
    if (n > 0 && sf.isCurrentFileDeleted()) {
      fileLen =  diffs.getLast().getFileSize();
    } else {
      fileLen = computeFileSize();
    }
  }
  counts.addContent(Content.LENGTH, fileLen);
  counts.addContent(Content.DISKSPACE, storagespaceConsumed());

  if (getStoragePolicyID() != ID_UNSPECIFIED){
    BlockStoragePolicy bsp = summary.getBlockStoragePolicySuite().
        getPolicy(getStoragePolicyID());
    List<StorageType> storageTypes = bsp.chooseStorageTypes(getFileReplication());
    for (StorageType t : storageTypes) {
      if (!t.supportTypeQuota()) {
        continue;
      }
      counts.addTypeSpace(t, fileLen);
    }
  }
  return summary;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:36,代码来源:INodeFile.java

示例5: computeContentSummary4Current

import org.apache.hadoop.hdfs.server.namenode.snapshot.FileWithSnapshotFeature; //导入方法依赖的package包/类
private void computeContentSummary4Current(final Content.Counts counts) {
  FileWithSnapshotFeature sf = this.getFileWithSnapshotFeature();
  if (sf != null && sf.isCurrentFileDeleted()) {
    return;
  }

  counts.add(Content.LENGTH, computeFileSize());
  counts.add(Content.FILE, 1);
  counts.add(Content.DISKSPACE, diskspaceConsumed());
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:11,代码来源:INodeFile.java


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