예제 #1
0
        public static READDIR3Response Deserialize(XDR xdr)
        {
            int status = xdr.ReadInt();

            xdr.ReadBoolean();
            Nfs3FileAttributes postOpDirAttr = Nfs3FileAttributes.Deserialize(xdr);
            long cookieVerf = 0;
            AList <READDIR3Response.Entry3> entries = new AList <READDIR3Response.Entry3>();

            READDIR3Response.DirList3 dirList = null;
            if (status == Nfs3Status.Nfs3Ok)
            {
                cookieVerf = xdr.ReadHyper();
                while (xdr.ReadBoolean())
                {
                    READDIR3Response.Entry3 e = READDIR3Response.Entry3.Deserialzie(xdr);
                    entries.AddItem(e);
                }
                bool eof = xdr.ReadBoolean();
                READDIR3Response.Entry3[] allEntries = new READDIR3Response.Entry3[entries.Count]
                ;
                Collections.ToArray(entries, allEntries);
                dirList = new READDIR3Response.DirList3(allEntries, eof);
            }
            return(new READDIR3Response(status, postOpDirAttr, cookieVerf, dirList));
        }
예제 #2
0
        public static Org.Apache.Hadoop.Nfs.Nfs3.Response.FSINFO3Response Deserialize(XDR
                                                                                      xdr)
        {
            int status = xdr.ReadInt();

            xdr.ReadBoolean();
            Nfs3FileAttributes postOpObjAttr = Nfs3FileAttributes.Deserialize(xdr);
            int     rtmax       = 0;
            int     rtpref      = 0;
            int     rtmult      = 0;
            int     wtmax       = 0;
            int     wtpref      = 0;
            int     wtmult      = 0;
            int     dtpref      = 0;
            long    maxFileSize = 0;
            NfsTime timeDelta   = null;
            int     properties  = 0;

            if (status == Nfs3Status.Nfs3Ok)
            {
                rtmax       = xdr.ReadInt();
                rtpref      = xdr.ReadInt();
                rtmult      = xdr.ReadInt();
                wtmax       = xdr.ReadInt();
                wtpref      = xdr.ReadInt();
                wtmult      = xdr.ReadInt();
                dtpref      = xdr.ReadInt();
                maxFileSize = xdr.ReadHyper();
                timeDelta   = NfsTime.Deserialize(xdr);
                properties  = xdr.ReadInt();
            }
            return(new Org.Apache.Hadoop.Nfs.Nfs3.Response.FSINFO3Response(status, postOpObjAttr
                                                                           , rtmax, rtpref, rtmult, wtmax, wtpref, wtmult, dtpref, maxFileSize, timeDelta,
                                                                           properties));
        }
예제 #3
0
        public static Org.Apache.Hadoop.Nfs.Nfs3.Response.FSSTAT3Response Deserialize(XDR
                                                                                      xdr)
        {
            int status = xdr.ReadInt();

            xdr.ReadBoolean();
            Nfs3FileAttributes postOpAttr = Nfs3FileAttributes.Deserialize(xdr);
            long tbytes   = 0;
            long fbytes   = 0;
            long abytes   = 0;
            long tfiles   = 0;
            long ffiles   = 0;
            long afiles   = 0;
            int  invarsec = 0;

            if (status == Nfs3Status.Nfs3Ok)
            {
                tbytes   = xdr.ReadHyper();
                fbytes   = xdr.ReadHyper();
                abytes   = xdr.ReadHyper();
                tfiles   = xdr.ReadHyper();
                ffiles   = xdr.ReadHyper();
                afiles   = xdr.ReadHyper();
                invarsec = xdr.ReadInt();
            }
            return(new Org.Apache.Hadoop.Nfs.Nfs3.Response.FSSTAT3Response(status, postOpAttr
                                                                           , tbytes, fbytes, abytes, tfiles, ffiles, afiles, invarsec));
        }
예제 #4
0
        public static Org.Apache.Hadoop.Nfs.Nfs3.Response.PATHCONF3Response Deserialize(XDR
                                                                                        xdr)
        {
            int status = xdr.ReadInt();

            xdr.ReadBoolean();
            Nfs3FileAttributes objPostOpAttr = Nfs3FileAttributes.Deserialize(xdr);
            int  linkMax         = 0;
            int  nameMax         = 0;
            bool noTrunc         = false;
            bool chownRestricted = false;
            bool caseInsensitive = false;
            bool casePreserving  = false;

            if (status == Nfs3Status.Nfs3Ok)
            {
                linkMax         = xdr.ReadInt();
                nameMax         = xdr.ReadInt();
                noTrunc         = xdr.ReadBoolean();
                chownRestricted = xdr.ReadBoolean();
                caseInsensitive = xdr.ReadBoolean();
                casePreserving  = xdr.ReadBoolean();
            }
            return(new Org.Apache.Hadoop.Nfs.Nfs3.Response.PATHCONF3Response(status, objPostOpAttr
                                                                             , linkMax, nameMax, noTrunc, chownRestricted, caseInsensitive, casePreserving));
        }
예제 #5
0
        public static Org.Apache.Hadoop.Nfs.Nfs3.Response.GETATTR3Response Deserialize(XDR
                                                                                       xdr)
        {
            int status = xdr.ReadInt();
            Nfs3FileAttributes attr = (status == Nfs3Status.Nfs3Ok) ? Nfs3FileAttributes.Deserialize
                                          (xdr) : new Nfs3FileAttributes();

            return(new Org.Apache.Hadoop.Nfs.Nfs3.Response.GETATTR3Response(status, attr));
        }
예제 #6
0
        public static Org.Apache.Hadoop.Nfs.Nfs3.Response.WccData Deserialize(XDR xdr)
        {
            xdr.ReadBoolean();
            WccAttr preOpAttr = WccAttr.Deserialize(xdr);

            xdr.ReadBoolean();
            Nfs3FileAttributes postOpAttr = Nfs3FileAttributes.Deserialize(xdr);

            return(new Org.Apache.Hadoop.Nfs.Nfs3.Response.WccData(preOpAttr, postOpAttr));
        }
예제 #7
0
            internal static READDIRPLUS3Response.EntryPlus3 Deseralize(XDR xdr)
            {
                long   fileId = xdr.ReadHyper();
                string name   = xdr.ReadString();
                long   cookie = xdr.ReadHyper();

                xdr.ReadBoolean();
                Nfs3FileAttributes nameAttr      = Nfs3FileAttributes.Deserialize(xdr);
                FileHandle         objFileHandle = new FileHandle();

                objFileHandle.Deserialize(xdr);
                return(new READDIRPLUS3Response.EntryPlus3(fileId, name, cookie, nameAttr, objFileHandle
                                                           ));
            }
예제 #8
0
        public static Org.Apache.Hadoop.Nfs.Nfs3.Response.ACCESS3Response Deserialize(XDR
                                                                                      xdr)
        {
            int status = xdr.ReadInt();
            Nfs3FileAttributes postOpAttr = null;
            int access = 0;

            if (status == Nfs3Status.Nfs3Ok)
            {
                postOpAttr = Nfs3FileAttributes.Deserialize(xdr);
                access     = xdr.ReadInt();
            }
            return(new Org.Apache.Hadoop.Nfs.Nfs3.Response.ACCESS3Response(status, postOpAttr
                                                                           , access));
        }
예제 #9
0
        public static Org.Apache.Hadoop.Nfs.Nfs3.Response.READLINK3Response Deserialize(XDR
                                                                                        xdr)
        {
            int status = xdr.ReadInt();

            xdr.ReadBoolean();
            Nfs3FileAttributes postOpSymlinkAttr = Nfs3FileAttributes.Deserialize(xdr);

            byte[] path = new byte[0];
            if (status == Nfs3Status.Nfs3Ok)
            {
                path = xdr.ReadVariableOpaque();
            }
            return(new Org.Apache.Hadoop.Nfs.Nfs3.Response.READLINK3Response(status, postOpSymlinkAttr
                                                                             , path));
        }
예제 #10
0
        /// <exception cref="System.IO.IOException"/>
        public LOOKUP3Response(XDR xdr)
            : base(-1)
        {
            fileHandle = new FileHandle();
            status     = xdr.ReadInt();
            Nfs3FileAttributes objAttr = null;

            if (status == Nfs3Status.Nfs3Ok)
            {
                if (!fileHandle.Deserialize(xdr))
                {
                    throw new IOException("can't deserialize file handle");
                }
                objAttr = xdr.ReadBoolean() ? Nfs3FileAttributes.Deserialize(xdr) : null;
            }
            postOpObjAttr = objAttr;
            postOpDirAttr = xdr.ReadBoolean() ? Nfs3FileAttributes.Deserialize(xdr) : null;
        }
예제 #11
0
        public static Org.Apache.Hadoop.Nfs.Nfs3.Response.MKDIR3Response Deserialize(XDR
                                                                                     xdr)
        {
            int                status        = xdr.ReadInt();
            FileHandle         objFileHandle = new FileHandle();
            Nfs3FileAttributes objAttr       = null;
            WccData            dirWcc;

            if (status == Nfs3Status.Nfs3Ok)
            {
                xdr.ReadBoolean();
                objFileHandle.Deserialize(xdr);
                xdr.ReadBoolean();
                objAttr = Nfs3FileAttributes.Deserialize(xdr);
            }
            dirWcc = WccData.Deserialize(xdr);
            return(new Org.Apache.Hadoop.Nfs.Nfs3.Response.MKDIR3Response(status, objFileHandle
                                                                          , objAttr, dirWcc));
        }
예제 #12
0
        public static Org.Apache.Hadoop.Nfs.Nfs3.Response.READ3Response Deserialize(XDR xdr
                                                                                    )
        {
            int status = xdr.ReadInt();

            xdr.ReadBoolean();
            Nfs3FileAttributes postOpAttr = Nfs3FileAttributes.Deserialize(xdr);
            int  count = 0;
            bool eof   = false;

            byte[] data = new byte[0];
            if (status == Nfs3Status.Nfs3Ok)
            {
                count = xdr.ReadInt();
                eof   = xdr.ReadBoolean();
                int len = xdr.ReadInt();
                System.Diagnostics.Debug.Assert((len == count));
                data = xdr.ReadFixedOpaque(count);
            }
            return(new Org.Apache.Hadoop.Nfs.Nfs3.Response.READ3Response(status, postOpAttr,
                                                                         count, eof, ByteBuffer.Wrap(data)));
        }