Java Code Examples for org.apache.hadoop.hdfs.server.namenode.INode#computeContentSummary()

The following examples show how to use org.apache.hadoop.hdfs.server.namenode.INode#computeContentSummary() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DirectoryWithSnapshotFeature.java    From hadoop with Apache License 2.0 5 votes vote down vote up
public void computeContentSummary4Snapshot(final BlockStoragePolicySuite bsps,
    final ContentCounts counts) {
  // Create a new blank summary context for blocking processing of subtree.
  ContentSummaryComputationContext summary = 
      new ContentSummaryComputationContext(bsps);
  for(DirectoryDiff d : diffs) {
    for(INode deleted : d.getChildrenDiff().getList(ListType.DELETED)) {
      deleted.computeContentSummary(summary);
    }
  }
  // Add the counts from deleted trees.
  counts.addContents(summary.getCounts());
  // Add the deleted directory count.
  counts.addContent(Content.DIRECTORY, diffs.asList().size());
}
 
Example 2
Source File: DirectoryWithSnapshotFeature.java    From big-c with Apache License 2.0 5 votes vote down vote up
public void computeContentSummary4Snapshot(final BlockStoragePolicySuite bsps,
    final ContentCounts counts) {
  // Create a new blank summary context for blocking processing of subtree.
  ContentSummaryComputationContext summary = 
      new ContentSummaryComputationContext(bsps);
  for(DirectoryDiff d : diffs) {
    for(INode deleted : d.getChildrenDiff().getList(ListType.DELETED)) {
      deleted.computeContentSummary(summary);
    }
  }
  // Add the counts from deleted trees.
  counts.addContents(summary.getCounts());
  // Add the deleted directory count.
  counts.addContent(Content.DIRECTORY, diffs.asList().size());
}