Changeset 3590
- Timestamp:
- 11/01/2009 11:59:19 PM (3 weeks ago)
- Files:
-
- XrdHdfs/XrdHdfs.cc (modified) (5 diffs)
- XrdHdfs/XrdHdfs.hh (modified) (2 diffs)
- XrdHdfs/XrdHdfsConfig.cc (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
XrdHdfs/XrdHdfs.cc
r3589 r3590 115 115 // Open the directory and get it's id 116 116 // 117 TRACE(Opendir, "path " << dir_path);118 if (!(dh = hdfsListDirectory(fs, dir_path, &numEntries))) {117 TRACE(Opendir, "path " << fname); 118 if (!(dh = hdfsListDirectory(fs, fname, &numEntries))) { 119 119 isopen = 0; 120 120 if (errno == 0) … … 263 263 } 264 264 265 (XrdHdfsSS.eDest)->Say("File we will access: ", fname); 266 265 267 // Set the actual open mode 266 268 // … … 293 295 int err_code = 0; 294 296 295 if ((fh = hdfsOpenFile(fs, path, open_flag, 0, 0, 0)) == NULL) {297 if ((fh = hdfsOpenFile(fs, fname, open_flag, 0, 0, 0)) == NULL) { 296 298 err_code = errno; 297 hdfsFileInfo * fileInfo = hdfsGetPathInfo(fs, path);299 hdfsFileInfo * fileInfo = hdfsGetPathInfo(fs, fname); 298 300 if (fileInfo != NULL) { 299 301 if (fileInfo->mKind == kObjectKindDirectory) { … … 302 304 hdfsFreeFileInfo(fileInfo, 1); 303 305 } else { 304 err_code = E EXIST;306 err_code = ENOENT; 305 307 } 306 308 } … … 510 512 eDest->logger(lp); 511 513 eDest->Say("Copr. 2009, Brian Bockelman, Hdfs Version "); 514 eDest->Emsg("Config", "Copr. 2009, Brian Bockelman, Hdfs Version "); 512 515 513 516 // Initialize the subsystems 514 517 // 518 N2N_Lib=NULL; 519 the_N2N=NULL; 515 520 tmp = ((NoGo=Configure(configfn)) ? "failed." : "completed."); 516 521 eDest->Say("------ HDFS storage system initialization ", tmp); 522 eDest->Emsg("HDFS storage system initialization.", tmp); 517 523 518 524 // All done. XrdHdfs/XrdHdfs.hh
r3589 r3590 179 179 char *N2N_Parms; // -> Name2Name Object Parameters 180 180 XrdOucName2Name *the_N2N; // -> File mapper object 181 const char *ConfigFN; // Pointer to the configuration filename 182 XrdSysError *eDest; 181 183 182 184 XrdHdfsSys() : XrdOss() {} … … 186 188 187 189 int Configure(const char *); 188 int ConfigN2N( XrdSysError &Eroute);189 int ConfigProc( XrdSysError &Eroute);190 int ConfigXeq(char *, XrdOucStream & , XrdSysError &);191 int xnml(XrdOucStream &Config , XrdSysError &Eroute);190 int ConfigN2N(); 191 int ConfigProc(const char *); 192 int ConfigXeq(char *, XrdOucStream &); 193 int xnml(XrdOucStream &Config); 192 194 193 static XrdSysError *eDest;194 195 195 196 }; XrdHdfs/XrdHdfsConfig.cc
r3588 r3590 20 20 21 21 #include "XrdVersion.hh" 22 #include "XrdOuc/XrdOucEnv.hh" 22 23 #include "XrdSys/XrdSysError.hh" 23 24 #include "XrdSys/XrdSysHeaders.hh" … … 27 28 #include "XrdSec/XrdSecInterface.hh" 28 29 #include "XrdCmsTfc/XrdCmsTfc.hh" 29 #include "Xrd Oss/XrdOssTrace.hh"30 #include "XrdHdfs/XrdHdfs.hh" 30 31 31 32 /******************************************************************************/ … … 33 34 /******************************************************************************/ 34 35 35 #define TS_Xeq(x,m) if (!strcmp(x,var)) return m(Config , Eroute);36 #define TS_Xeq(x,m) if (!strcmp(x,var)) return m(Config); 36 37 37 38 /******************************************************************************/ … … 50 51 int NoGo = 0; 51 52 52 N2N_Lib = "";53 N2N_Lib = NULL; 53 54 the_N2N = NULL; 55 56 eDest->Emsg("Config", "Configuring HDFS."); 54 57 55 58 // Process the configuration file … … 71 74 int cfgFD, retc, NoGo = 0; 72 75 XrdOucEnv myEnv; 73 XrdOucStream Config( &eDest, getenv("XRDINSTANCE"), &myEnv, "=====> ");76 XrdOucStream Config(eDest, getenv("XRDINSTANCE"), &myEnv, "=====> "); 74 77 75 78 // Make sure we have a config file 76 79 // 77 80 if (!Cfn || !*Cfn) 78 {eDest .Emsg("Config", "Configuration file not specified.");81 {eDest->Emsg("Config", "Configuration file not specified."); 79 82 return 1; 80 83 } … … 83 86 // 84 87 if ( (cfgFD = open(Cfn, O_RDONLY, 0)) < 0) 85 {eDest .Emsg("Config", errno, "open config file", Cfn);88 {eDest->Emsg("Config", errno, "open config file", Cfn); 86 89 return 1; 87 90 } 91 ConfigFN = Cfn; 92 88 93 Config.Attach(cfgFD); 89 94 … … 97 102 // All done scanning the file, set dependent parameters. 98 103 // 99 if (N2N_Lib) NoGo |= ConfigN2N( Eroute);104 if (N2N_Lib) NoGo |= ConfigN2N(); 100 105 101 106 // Now check if any errors occured during file i/o 102 107 // 103 108 if ((retc = Config.LastError())) 104 NoGo = eDest .Emsg("Config", retc, "read config file", Cfn);109 NoGo = eDest->Emsg("Config", retc, "read config file", Cfn); 105 110 Config.Close(); 106 111 … … 119 124 // Process items. for either a local or a remote configuration 120 125 // 126 121 127 TS_Xeq("namelib", xnml); 122 128 123 129 // No match found, complain. 124 130 // 125 eDest.Say("Config warning: ignoring unknown directive '",var,"'.");126 Config.Echo();131 //eDest->Say("Config warning: ignoring unknown directive '",var,"'."); 132 //Config.Echo(); 127 133 return 0; 128 134 } … … 132 138 /******************************************************************************/ 133 139 134 int XrdHdfsSys::ConfigN2N( XrdSysError &Eroute)140 int XrdHdfsSys::ConfigN2N() 135 141 { 136 142 XrdSysPlugin *myLib; … … 140 146 // the library must stay open but we never want to reference it again). 141 147 // 142 if (!(myLib = new XrdSysPlugin( &Eroute, N2N_Lib))) return 1;148 if (!(myLib = new XrdSysPlugin(eDest, N2N_Lib))) return 1; 143 149 144 150 // Now get the entry point of the object creator … … 150 156 // Get the Object now 151 157 // 152 the_N2N = ep( &Eroute, ConfigFN,158 the_N2N = ep(eDest, ConfigFN, 153 159 (N2N_Parms ? N2N_Parms : ""), 154 LocalRoot, RemoteRoot);155 return lcl_N2N == 0;160 NULL, NULL); 161 return the_N2N == 0; 156 162 } 157 163 … … 171 177 */ 172 178 173 int XrdHdfsSys::xnml(XrdOucStream &Config , XrdSysError &Eroute)179 int XrdHdfsSys::xnml(XrdOucStream &Config) 174 180 { 175 181 char *val, parms[1024]; … … 178 184 // 179 185 if (!(val = Config.GetWord()) || !val[0]) 180 { Eroute.Emsg("Config", "namelib not specified"); return 1;}186 {eDest->Emsg("Config", "namelib not specified"); return 1;} 181 187 182 188 // Record the path … … 188 194 // 189 195 if (!Config.GetRest(parms, sizeof(parms))) 190 { Eroute.Emsg("Config", "namelib parameters too long"); return 1;}196 {eDest->Emsg("Config", "namelib parameters too long"); return 1;} 191 197 if (N2N_Parms) free(N2N_Parms); 192 198 N2N_Parms = (*parms ? strdup(parms) : 0);
