Пример #1
0
            public static FsImageProto.INodeSection.INodeDirectory.Builder BuildINodeDirectory
                (INodeDirectoryAttributes dir, FSImageFormatProtobuf.SaverContext state)
            {
                QuotaCounts quota = dir.GetQuotaCounts();

                FsImageProto.INodeSection.INodeDirectory.Builder b = FsImageProto.INodeSection.INodeDirectory
                                                                     .NewBuilder().SetModificationTime(dir.GetModificationTime()).SetNsQuota(quota.GetNameSpace
                                                                                                                                                 ()).SetDsQuota(quota.GetStorageSpace()).SetPermission(BuildPermissionStatus(dir,
                                                                                                                                                                                                                             state.GetStringMap()));
                if (quota.GetTypeSpaces().AnyGreaterOrEqual(0))
                {
                    b.SetTypeQuotas(BuildQuotaByStorageTypeEntries(quota));
                }
                AclFeature f = dir.GetAclFeature();

                if (f != null)
                {
                    b.SetAcl(BuildAclEntries(f, state.GetStringMap()));
                }
                XAttrFeature xAttrFeature = dir.GetXAttrFeature();

                if (xAttrFeature != null)
                {
                    b.SetXAttrs(BuildXAttrs(xAttrFeature, state.GetStringMap()));
                }
                return(b);
            }
Пример #2
0
 /// <summary>
 /// Serialize a
 /// <see cref="INodeDirectory"/>
 /// </summary>
 /// <param name="a">The node to write</param>
 /// <param name="out">
 /// The
 /// <see cref="System.IO.DataOutput"/>
 /// where the fields are written
 /// </param>
 /// <exception cref="System.IO.IOException"/>
 public static void WriteINodeDirectoryAttributes(INodeDirectoryAttributes a, DataOutput
                                                  @out)
 {
     WriteLocalName(a, @out);
     WritePermissionStatus(a, @out);
     @out.WriteLong(a.GetModificationTime());
     WriteQuota(a.GetQuotaCounts(), @out);
 }
 public override bool MetadataEquals(INodeDirectoryAttributes other)
 {
     return(other != null && GetQuotaCounts().Equals(other.GetQuotaCounts()) && GetPermissionLong
                () == other.GetPermissionLong() && GetAclFeature() == other.GetAclFeature() && GetXAttrFeature
                () == other.GetXAttrFeature());
 }
 public abstract bool MetadataEquals(INodeDirectoryAttributes other);