コード例 #1
0
ファイル: WriteManager.cs プロジェクト: orf53975/hadoop.net
        /// <exception cref="System.IO.IOException"/>
        internal virtual Nfs3FileAttributes GetFileAttr(DFSClient client, FileHandle dirHandle
                                                        , string fileName)
        {
            string             fileIdPath = Nfs3Utils.GetFileIdPath(dirHandle) + "/" + fileName;
            Nfs3FileAttributes attr       = Nfs3Utils.GetFileAttr(client, fileIdPath, iug);

            if ((attr != null) && (attr.GetType() == NfsFileType.Nfsreg.ToValue()))
            {
                OpenFileCtx openFileCtx = fileContextCache.Get(new FileHandle(attr.GetFileId()));
                if (openFileCtx != null)
                {
                    attr.SetSize(openFileCtx.GetNextOffset());
                    attr.SetUsed(openFileCtx.GetNextOffset());
                }
            }
            return(attr);
        }
コード例 #2
0
ファイル: WriteManager.cs プロジェクト: orf53975/hadoop.net
        /// <summary>If the file is in cache, update the size based on the cached data size</summary>
        /// <exception cref="System.IO.IOException"/>
        internal virtual Nfs3FileAttributes GetFileAttr(DFSClient client, FileHandle fileHandle
                                                        , IdMappingServiceProvider iug)
        {
            string             fileIdPath = Nfs3Utils.GetFileIdPath(fileHandle);
            Nfs3FileAttributes attr       = Nfs3Utils.GetFileAttr(client, fileIdPath, iug);

            if (attr != null)
            {
                OpenFileCtx openFileCtx = fileContextCache.Get(fileHandle);
                if (openFileCtx != null)
                {
                    attr.SetSize(openFileCtx.GetNextOffset());
                    attr.SetUsed(openFileCtx.GetNextOffset());
                }
            }
            return(attr);
        }