/// <summary> /// Serialize an /// <see cref="INodeFileAttributes"/> /// . /// </summary> /// <exception cref="System.IO.IOException"/> public static void WriteINodeFileAttributes(INodeFileAttributes file, DataOutput @out) { WriteLocalName(file, @out); WritePermissionStatus(file, @out); @out.WriteLong(file.GetModificationTime()); @out.WriteLong(file.GetAccessTime()); @out.WriteShort(file.GetFileReplication()); @out.WriteLong(file.GetPreferredBlockSize()); }
public static FsImageProto.INodeSection.INodeFile.Builder BuildINodeFile(INodeFileAttributes file, FSImageFormatProtobuf.SaverContext state) { FsImageProto.INodeSection.INodeFile.Builder b = FsImageProto.INodeSection.INodeFile .NewBuilder().SetAccessTime(file.GetAccessTime()).SetModificationTime(file.GetModificationTime ()).SetPermission(BuildPermissionStatus(file, state.GetStringMap())).SetPreferredBlockSize (file.GetPreferredBlockSize()).SetReplication(file.GetFileReplication()).SetStoragePolicyID (file.GetLocalStoragePolicyID()); AclFeature f = file.GetAclFeature(); if (f != null) { b.SetAcl(BuildAclEntries(f, state.GetStringMap())); } XAttrFeature xAttrFeature = file.GetXAttrFeature(); if (xAttrFeature != null) { b.SetXAttrs(BuildXAttrs(xAttrFeature, state.GetStringMap())); } return(b); }