Exemplo n.º 1
0
        internal override void AddAclFeature(AclFeature f)
        {
            AclFeature f1 = GetAclFeature();

            if (f1 != null)
            {
                throw new InvalidOperationException("Duplicated ACLFeature");
            }
            AddFeature(AclStorage.AddAclFeature(f));
        }
Exemplo n.º 2
0
 internal SnapshotCopy(byte[] name, PermissionStatus permissions, AclFeature aclFeature
                       , long modificationTime, long accessTime, XAttrFeature xAttrFeature)
 {
     this.name       = name;
     this.permission = INodeWithAdditionalFields.PermissionStatusFormat.ToLong(permissions
                                                                               );
     if (aclFeature != null)
     {
         aclFeature = AclStorage.AddAclFeature(aclFeature);
     }
     this.aclFeature       = aclFeature;
     this.modificationTime = modificationTime;
     this.accessTime       = accessTime;
     this.xAttrFeature     = xAttrFeature;
 }
Exemplo n.º 3
0
 internal SnapshotCopy(INode inode)
 {
     this.name       = inode.GetLocalNameBytes();
     this.permission = inode.GetPermissionLong();
     if (inode.GetAclFeature() != null)
     {
         aclFeature = AclStorage.AddAclFeature(inode.GetAclFeature());
     }
     else
     {
         aclFeature = null;
     }
     this.modificationTime = inode.GetModificationTime();
     this.accessTime       = inode.GetAccessTime();
     this.xAttrFeature     = inode.GetXAttrFeature();
 }
Exemplo n.º 4
0
        /// <summary>Copy constructor</summary>
        /// <param name="other">The INodeDirectory to be copied</param>
        /// <param name="adopt">
        /// Indicate whether or not need to set the parent field of child
        /// INodes to the new node
        /// </param>
        /// <param name="featuresToCopy">
        /// any number of features to copy to the new node.
        /// The method will do a reference copy, not a deep copy.
        /// </param>
        public INodeDirectory(Org.Apache.Hadoop.Hdfs.Server.Namenode.INodeDirectory other
                              , bool adopt, params INode.Feature[] featuresToCopy)
            : base(other)
        {
            this.children = other.children;
            if (adopt && this.children != null)
            {
                foreach (INode child in children)
                {
                    child.SetParent(this);
                }
            }
            this.features = featuresToCopy;
            AclFeature aclFeature = GetFeature(typeof(AclFeature));

            if (aclFeature != null)
            {
                // for the de-duplication of AclFeature
                RemoveFeature(aclFeature);
                AddFeature(AclStorage.AddAclFeature(aclFeature));
            }
        }