00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_THDFSFile
00013 #define ROOT_THDFSFile
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef ROOT_TFile
00026 #include "TFile.h"
00027 #endif
00028
00029 #ifndef ROOT_TSystem
00030 #include "TSystem.h"
00031 #endif
00032
00033 class THDFSFile : public TFile {
00034
00035 private:
00036 void *fHdfsFH;
00037 void *fFS;
00038 Long64_t fSize;
00039 Long64_t fSysOffset;
00040 char *fPath;
00041
00042 Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode);
00043 Int_t SysClose(Int_t fd);
00044 Int_t SysRead(Int_t fd, void *buf, Int_t len);
00045 Int_t SysWrite(Int_t fd, const void *buf, Int_t len);
00046 Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence);
00047 Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime);
00048 Int_t SysSync(Int_t fd);
00049
00050 public:
00051 THDFSFile(const char *path, Option_t *option="",
00052 const char *ftitle="", Int_t compress=1);
00053 virtual ~THDFSFile();
00054
00055 void ResetErrno() const;
00056
00057 ClassDef(THDFSFile, 0)
00058 };
00059
00060
00061
00062 class THDFSSystem : public TSystem {
00063
00064 private:
00065 void *fFH;
00066 void *fDirp;
00067 TUrl *fUrlp;
00068 Int_t fDirEntries;
00069 Int_t fDirCtr;
00070
00071 public:
00072 THDFSSystem();
00073 virtual ~THDFSSystem() { }
00074
00075 Int_t MakeDirectory(const char *name);
00076 void *OpenDirectory(const char *name);
00077 void FreeDirectory(void *dirp);
00078 const char *GetDirEntry(void *dirp);
00079 Int_t GetPathInfo(const char *path, FileStat_t &buf);
00080 Bool_t AccessPathName(const char *path, EAccessMode mode);
00081 Int_t Unlink(const char *path);
00082
00083 ClassDef(THDFSSystem,0)
00084 };
00085
00086 #endif