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); }
/// <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()); }