Bläddra i källkod

Remove unused port argument

Renato Golin 13 år sedan
förälder
incheckning
8f46c18c29

+ 2 - 2
common/workunit/workunit.cpp

@@ -5424,7 +5424,7 @@ void CLocalWorkUnit::deleteTempFiles(const char *graph, bool deleteOwned, bool d
         {
             const char *name = file.queryProp("@name");
             LOG(MCdebugProgress, unknownJob, "Removing workunit file %s from DFS", name);
-            queryDistributedFileDirectory().removePhysical(name, 0, NULL, NULL, queryUserDescriptor());
+            queryDistributedFileDirectory().removePhysical(name, NULL, NULL, queryUserDescriptor());
             toRemove.append(file);
         }
     }
@@ -5532,7 +5532,7 @@ void CLocalWorkUnit::releaseFile(const char *fileName)
             files->removeTree(file);
             if (!name.isEmpty()&&(1 == usageCount))
             {
-                if (queryDistributedFileDirectory().removePhysical(fileName, 0, NULL, NULL, queryUserDescriptor()))
+                if (queryDistributedFileDirectory().removePhysical(fileName, NULL, NULL, queryUserDescriptor()))
                     LOG(MCdebugProgress, unknownJob, "Removed (released) file %s from DFS", name.get());
             }
         }

+ 13 - 17
dali/base/dadfs.cpp

@@ -908,7 +908,7 @@ public:
 
     void addEntry(CDfsLogicalFileName &lfn,IPropertyTree *root,bool superfile, bool ignoreexists);
     bool removeEntry(const char *_logicalname,IUserDescriptor *user);
-    bool removePhysical(const char *_logicalname,unsigned short port,const char *cluster,IMultiException *mexcept,IUserDescriptor *user);
+    bool removePhysical(const char *_logicalname,const char *cluster,IMultiException *mexcept,IUserDescriptor *user);
     bool renamePhysical(const char *oldname,const char *newname,unsigned short port,IMultiException *exceptions,IUserDescriptor *user);
     void removeEmptyScope(const char *name);
 
@@ -920,7 +920,7 @@ public:
     void setDefaultUser(IUserDescriptor *user);
     IUserDescriptor* queryDefaultUser();
 
-    bool doRemovePhysical(CDfsLogicalFileName &dlfn,unsigned short port,const char *cluster,IMultiException *mexcept,IUserDescriptor *user,bool ignoresub);
+    bool doRemovePhysical(CDfsLogicalFileName &dlfn,const char *cluster,IMultiException *mexcept,IUserDescriptor *user,bool ignoresub);
     bool doRemoveEntry(CDfsLogicalFileName &dlfn,IUserDescriptor *user,bool ignoresub);
     DistributedFileCompareResult fileCompare(const char *lfn1,const char *lfn2,DistributedFileCompareMode mode,StringBuffer &errstr,IUserDescriptor *user);
     bool filePhysicalVerify(const char *lfn1,bool includecrc,StringBuffer &errstr,IUserDescriptor *user);
@@ -1158,7 +1158,7 @@ public:
     {
         try {
             if (remphys) 
-                queryDistributedFileDirectory().removePhysical(lfn.get(),0,NULL,NULL,user);
+                queryDistributedFileDirectory().removePhysical(lfn.get(),NULL,NULL,user.get());
             else 
                 queryDistributedFileDirectory().removeEntry(lfn.get(),user);
         }
@@ -3153,7 +3153,7 @@ public:
         parent->removeEntry(lname.get(),udesc);
     }
 
-    bool removePhysicalPartFiles(unsigned short port,const char *cluster,IMultiException *mexcept)
+    bool removePhysicalPartFiles(const char *cluster,IMultiException *mexcept)
     {
         Owned<IGroup> grpfilter;
         if (cluster&&*cluster) {
@@ -3178,7 +3178,6 @@ public:
         class casyncfor: public CAsyncFor
         {
             IDistributedFile *file;
-            unsigned short port;
             CriticalSection &errcrit;
             IMultiException *mexcept;
             unsigned width;
@@ -3186,11 +3185,10 @@ public:
         public:
             bool ok;
             bool islazy;
-            casyncfor(IDistributedFile *_file,unsigned _width,unsigned short _port,IGroup *_grpfilter,IMultiException *_mexcept,CriticalSection &_errcrit)
+            casyncfor(IDistributedFile *_file,unsigned _width,IGroup *_grpfilter,IMultiException *_mexcept,CriticalSection &_errcrit)
                 : errcrit(_errcrit)
             {
                 file = _file;
-                port = _port;
                 ok = true;
                 mexcept = _mexcept;
                 width = _width;
@@ -3206,8 +3204,6 @@ public:
                     part->getFilename(rfn,copy);
                     if (grpfilter&&(grpfilter->rank(rfn.queryEndpoint())==RANK_NULL))
                         continue;
-                    if (port)
-                        rfn.setPort(port); // if daliservix
                     Owned<IFile> partfile = createIFile(rfn);
                     StringBuffer eps;
                     try
@@ -3238,7 +3234,7 @@ public:
                     }
                 }
             }
-        } afor(this,width,port,grpfilter,mexcept,errcrit);
+        } afor(this,width,grpfilter,mexcept,errcrit);
         afor.islazy = queryAttributes().getPropInt("@lazy")!=0;
         afor.For(width,10,false,true);
         if (cluster&&*cluster) 
@@ -4628,7 +4624,7 @@ public:
         parent->removeEntry(lname.get(),udesc);
     }
 
-    bool removePhysicalPartFiles(unsigned short port,const char *clustername,IMultiException *mexcept)
+    bool removePhysicalPartFiles(const char *clustername,IMultiException *mexcept)
     {
         throw MakeStringException(-1,"removePhysicalPartFiles not supported for SuperFiles");
         return false; 
@@ -5052,7 +5048,7 @@ private:
                     dlfn.set(subnames.item(i).text.get());
                     if (!transaction||!delayed||!transaction->addDelayedDelete(dlfn.get(),remphys,udesc)) {
                         if (remphys) 
-                            done = parent->doRemovePhysical(dlfn,0,NULL,NULL,udesc,true);
+                            done = parent->doRemovePhysical(dlfn,NULL,NULL,udesc,true);
                         else {
                             done = parent->doRemoveEntry(dlfn,udesc,true);
                         }
@@ -6796,7 +6792,7 @@ void CDistributedFileDirectory::removeEmptyScope(const char *scope)
     }
 }
 
-bool CDistributedFileDirectory::doRemovePhysical(CDfsLogicalFileName &dlfn,unsigned short port,const char *cluster,IMultiException *exceptions,IUserDescriptor *user,bool ignoresub)
+bool CDistributedFileDirectory::doRemovePhysical(CDfsLogicalFileName &dlfn,const char *cluster,IMultiException *exceptions,IUserDescriptor *user,bool ignoresub)
 {
     CriticalBlock block(removesect);
     const char *logicalname = dlfn.get();
@@ -6826,7 +6822,7 @@ bool CDistributedFileDirectory::doRemovePhysical(CDfsLogicalFileName &dlfn,unsig
         file->detach(); 
     }
     try {
-        file->removePhysicalPartFiles(port,clustername.str(),exceptions); 
+        file->removePhysicalPartFiles(clustername.str(),exceptions);
     }
     catch (IException *e)
     {
@@ -6839,11 +6835,11 @@ bool CDistributedFileDirectory::doRemovePhysical(CDfsLogicalFileName &dlfn,unsig
     return true;
 }
 
-bool CDistributedFileDirectory::removePhysical(const char *_logicalname,unsigned short port,const char *cluster,IMultiException *exceptions,IUserDescriptor *user)
+bool CDistributedFileDirectory::removePhysical(const char *_logicalname,const char *cluster,IMultiException *exceptions,IUserDescriptor *user)
 {
     CDfsLogicalFileName dlfn;
     dlfn.set(_logicalname);
-    return doRemovePhysical(dlfn,port,cluster,exceptions,user,false);
+    return doRemovePhysical(dlfn,cluster,exceptions,user,false);
 }
 
     
@@ -9636,7 +9632,7 @@ void CDistributedFileDirectory::promoteSuperFiles(unsigned numsf,const char **sf
     // MORE - once deletion of logic files are also in transaction we can move this up (and allow promote within transactions)
     if (delsub) {
         ForEachItemIn(j,outunlinked) 
-            removePhysical(outunlinked.item(j),0,NULL,NULL,user);
+            removePhysical(outunlinked.item(j),NULL,NULL,user);
     }
 }
 

+ 2 - 2
dali/base/dadfs.hpp

@@ -238,7 +238,7 @@ interface IDistributedFile: extends IInterface
 
     virtual unsigned numCopies(unsigned partno) = 0;                            // number of copies
 
-    virtual bool removePhysicalPartFiles(unsigned short port=0,const char *cluster=NULL,IMultiException *exceptions=NULL) = 0;          // removes all physical part files
+    virtual bool removePhysicalPartFiles(const char *cluster=NULL,IMultiException *exceptions=NULL) = 0;          // removes all physical part files
                                                                                 // returns true if no major errors
 
     virtual bool existsPhysicalPartFiles(unsigned short port) = 0;              // returns true if physical patrs all exist (on primary OR secondary)
@@ -461,7 +461,7 @@ interface IDistributedFileDirectory: extends IInterface
     virtual IDFScopeIterator *getScopeIterator(const char *subscope=NULL,bool recursive=true,bool includeempty=false, IUserDescriptor *user=NULL)=0;
 
     virtual bool removeEntry(const char *name,IUserDescriptor *user=NULL) = 0;  // equivalent to lookup/detach/release
-    virtual bool removePhysical(const char *name,unsigned short port=0,const char *cluster=NULL,IMultiException *exceptions=NULL,IUserDescriptor *user=NULL) = 0;                           // removes the physical parts as well as entry
+    virtual bool removePhysical(const char *name,const char *cluster=NULL,IMultiException *exceptions=NULL,IUserDescriptor *user=NULL) = 0;                           // removes the physical parts as well as entry
     virtual bool renamePhysical(const char *oldname,const char *newname,unsigned short port=0,IMultiException *exceptions=NULL,IUserDescriptor *user=NULL) = 0;                         // renames the physical parts as well as entry
     virtual void removeEmptyScope(const char *scope) = 0;   // does nothing if called on non-empty scope
     

+ 3 - 3
dali/dfu/dfurun.cpp

@@ -863,7 +863,7 @@ public:
                     return;
                 }
                 dfile->detach();
-                dfile->removePhysicalPartFiles(0,NULL,NULL);
+                dfile->removePhysicalPartFiles(NULL,NULL);
             }
             dfile.clear();
         }
@@ -1224,7 +1224,7 @@ public:
                                     oldfile.clear();
                                     if (!options->getOverwrite())
                                         throw MakeStringException(-1,"Destination file %s already exists and overwrite not specified",tmp.str());
-                                    fdir.removePhysical(tmp.str(),0,NULL,NULL,userdesc);
+                                    fdir.removePhysical(tmp.str(),NULL,NULL,userdesc);
                                 }
                             }
                             StringBuffer jobname;
@@ -1385,7 +1385,7 @@ public:
                         if (options->getNoDelete())
                             fdir.removeEntry(tmp.str(),userdesc);
                         else
-                            fdir.removePhysical(tmp.str(),0,NULL,NULL,userdesc);
+                            fdir.removePhysical(tmp.str(),NULL,NULL,userdesc);
                         Audit("REMOVE",userdesc,tmp.clear(),NULL);
                         runningconn.clear();
                     }

+ 3 - 3
dali/dfu/dfuutil.cpp

@@ -613,7 +613,7 @@ public:
                 dfile->detach();
             else {
                 dfile->detach();
-                dfile->removePhysicalPartFiles(0,NULL,NULL);
+                dfile->removePhysicalPartFiles(NULL,NULL);
             }
             dfile.clear();
         }
@@ -689,7 +689,7 @@ public:
                 dfile->detach();
             else {
                 dfile->detach();
-                dfile->removePhysicalPartFiles(0,NULL,NULL);
+                dfile->removePhysicalPartFiles(NULL,NULL);
             }
             dfile.clear();
         }
@@ -893,7 +893,7 @@ public:
                     return;
                 }
                 dfile->detach();
-                dfile->removePhysicalPartFiles(0,NULL,NULL);
+                dfile->removePhysicalPartFiles(NULL,NULL);
             }
             dfile.clear();
         }

+ 1 - 1
dali/ft/daft.cpp

@@ -220,7 +220,7 @@ bool CDistributedFileSystem::remove(IDistributedFile * file,const char *cluster,
         cluster = NULL; // deleting the last cluster removes the file
         file->detach(); 
     }
-    return file->removePhysicalPartFiles(0,cluster,mexcept); // this is bit cavalier with errors - but better orphans than inconsistant DFS
+    return file->removePhysicalPartFiles(cluster,mexcept); // this is bit cavalier with errors - but better orphans than inconsistant DFS
 }
 
 bool CDistributedFileSystem::compress(IDistributedFile * file)

+ 1 - 1
plugins/fileservices/fileservices.cpp

@@ -349,7 +349,7 @@ FILESERVICES_API void FILESERVICES_CALL fsDeleteLogicalFile(ICodeContext *ctx, c
     Linked<IUserDescriptor> udesc = ctx->queryUserDescriptor();
     StringBuffer uname;
     PrintLog("Deleting NS logical file %s for user %s", lfn.str(),udesc?udesc->getUserName(uname).str():"");
-    if (queryDistributedFileDirectory().removePhysical(lfn.str(),0,NULL,NULL,udesc))
+    if (queryDistributedFileDirectory().removePhysical(lfn.str(),NULL,NULL,udesc))
     {
         StringBuffer s("DeleteLogicalFile ('");         // ** TBD use removephysical (handles cluster)
         s.append(lfn).append("') done");