Esempio n. 1
0
        /// <summary>Is this inode in the latest snapshot?</summary>
        public bool IsInLatestSnapshot(int latestSnapshotId)
        {
            if (latestSnapshotId == Org.Apache.Hadoop.Hdfs.Server.Namenode.Snapshot.Snapshot.
                CurrentStateId || latestSnapshotId == Org.Apache.Hadoop.Hdfs.Server.Namenode.Snapshot.Snapshot
                .NoSnapshotId)
            {
                return(false);
            }
            // if parent is a reference node, parent must be a renamed node. We can
            // stop the check at the reference node.
            if (parent != null && parent.IsReference())
            {
                return(true);
            }
            INodeDirectory parentDir = GetParent();

            if (parentDir == null)
            {
                // root
                return(true);
            }
            if (!parentDir.IsInLatestSnapshot(latestSnapshotId))
            {
                return(false);
            }
            Org.Apache.Hadoop.Hdfs.Server.Namenode.INode child = parentDir.GetChild(GetLocalNameBytes
                                                                                        (), latestSnapshotId);
            if (this == child)
            {
                return(true);
            }
            return(child != null && child.IsReference() && this == child.AsReference().GetReferredINode
                       ());
        }
Esempio n. 2
0
 /// <summary>Set container.</summary>
 public void SetParentReference(INodeReference parent)
 {
     this.parent = parent;
 }
Esempio n. 3
0
 /// <summary>Set parent directory</summary>
 public void SetParent(INodeDirectory parent)
 {
     this.parent = parent;
 }
Esempio n. 4
0
 internal INode(Org.Apache.Hadoop.Hdfs.Server.Namenode.INode parent)
 {
     this.parent = parent;
 }