本文整理汇总了Java中org.apache.hadoop.hdfs.server.namenode.snapshot.DirectoryWithSnapshotFeature.addChild方法的典型用法代码示例。如果您正苦于以下问题:Java DirectoryWithSnapshotFeature.addChild方法的具体用法?Java DirectoryWithSnapshotFeature.addChild怎么用?Java DirectoryWithSnapshotFeature.addChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hdfs.server.namenode.snapshot.DirectoryWithSnapshotFeature
的用法示例。
在下文中一共展示了DirectoryWithSnapshotFeature.addChild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addChild
import org.apache.hadoop.hdfs.server.namenode.snapshot.DirectoryWithSnapshotFeature; //导入方法依赖的package包/类
/**
* Add a child inode to the directory.
*
* @param node INode to insert
* @param setModTime set modification time for the parent node
* not needed when replaying the addition and
* the parent already has the proper mod time
* @return false if the child with this name already exists;
* otherwise, return true;
*/
public boolean addChild(INode node, final boolean setModTime,
final int latestSnapshotId) throws QuotaExceededException {
final int low = searchChildren(node.getLocalNameBytes());
if (low >= 0) {
return false;
}
if (isInLatestSnapshot(latestSnapshotId)) {
// create snapshot feature if necessary
DirectoryWithSnapshotFeature sf = this.getDirectoryWithSnapshotFeature();
if (sf == null) {
sf = this.addSnapshotFeature(null);
}
return sf.addChild(this, node, setModTime, latestSnapshotId);
}
addChild(node, low);
if (setModTime) {
// update modification time of the parent directory
updateModificationTime(node.getModificationTime(), latestSnapshotId);
}
return true;
}