Browse Source

HPCC-26476 FTSlave cleanup

Remove any references to dalift library from places that do not need it.

Remove some unused code.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 3 years ago
parent
commit
bd3599b0fa

+ 0 - 31
dali/ft/daft.cpp

@@ -158,37 +158,6 @@ void CDistributedFileSystem::transfer(IFileDescriptor * from, IFileDescriptor *
     sprayer->spray();
 }
 
-void CDistributedFileSystem::directory(const char * directory, IGroup * machines, IPropertyTree * options, IPropertyTree * result)
-{
-    doDirectory(directory, machines, options, result);
-}
-
-void CDistributedFileSystem::physicalCopy(const char * source, const char * target, IPropertyTree * options, IDaftCopyProgress * progress)
-{
-    Owned<IPropertyTree> dirOptions = createPTree("options");
-    Owned<IPropertyTree> files = createPTree("files");
-
-    dirOptions->setPropBool("@time", false);
-    if (options)
-    {
-        dirOptions->setPropBool("@recurse", options->getPropBool("@recurse", false));
-    }
-
-    StringBuffer localSourceName;
-    RemoteFilename sourceName;
-    sourceName.setRemotePath(source);
-    sourceName.getLocalPath(localSourceName);
-    Owned<IGroup> sourceGroup = createIGroup(1, &sourceName.queryEndpoint());
-    directory(localSourceName.str(), sourceGroup, dirOptions, files);
-    physicalCopy(files, target, options, progress);
-}
-
-
-void CDistributedFileSystem::physicalCopy(IPropertyTree * source, const char * target, IPropertyTree * options, IDaftCopyProgress * progress)
-{
-    doPhysicalCopy(source, target, options, progress);
-}
-
 //-- operations on a single file. --
 
 offset_t CDistributedFileSystem::getSize(IDistributedFile * file, bool forceget, bool dontsetattr)

+ 0 - 4
dali/ft/daft.hpp

@@ -60,10 +60,6 @@ interface IDistributedFileSystem : public IInterface
     virtual void replicate(IFileDescriptor * fd, DaftReplicateMode mode, IPropertyTree * recovery, IRemoteConnection * recoveryConnection, IDFPartFilter *filter, IPropertyTree * options, IDaftProgress * progress , IAbortRequestCallback * abort=NULL , const char *wuid=NULL) = 0;  // create new set of copies (between copy 0 to copy 1 depending on the mode) @crc set in options to copy if crc differs @sizedate if size/date differ.
     virtual void transfer(IFileDescriptor * from, IFileDescriptor * to, IPropertyTree * recovery, IRemoteConnection * recoveryConnection, IDFPartFilter *filter, IPropertyTree * options, IDaftProgress * progress , IAbortRequestCallback * abort=NULL , const char *wuid=NULL) = 0;       // copy between external files, must have 
 
-    virtual void directory(const char * directory, IGroup * machines, IPropertyTree * options, IPropertyTree * result) = 0;                 // @recurse=false @time=true @crc=false
-    virtual void physicalCopy(const char * source, const char * target, IPropertyTree * options, IDaftCopyProgress * progress = NULL) = 0;      // options can include @recurse @copyMissing @copyExisting @preserveTimes @preserveIfNewer @verboseFull @verbose
-    virtual void physicalCopy(IPropertyTree * source, const char * target, IPropertyTree * options, IDaftCopyProgress * progress = NULL) = 0;   // property tree is same structure as result of directory
-
 //operations on a single file.
     virtual offset_t getSize(IDistributedFile * file,
                              bool forceget=false,                               // if true gets physical size (ignores cached attribute)

+ 0 - 4
dali/ft/daft.ipp

@@ -36,10 +36,6 @@ public:
     virtual void replicate(IFileDescriptor * fd, DaftReplicateMode mode, IPropertyTree * recovery, IRemoteConnection * recoveryConnection, IDFPartFilter *filter, IPropertyTree * options, IDaftProgress * progress, IAbortRequestCallback * abort, const char *wuid);
     virtual void transfer(IFileDescriptor * from, IFileDescriptor * to, IPropertyTree * recovery, IRemoteConnection * recoveryConnection, IDFPartFilter *filter, IPropertyTree * options, IDaftProgress * progress, IAbortRequestCallback * abort, const char *wuid);
 
-    virtual void directory(const char * directory, IGroup * machines, IPropertyTree * options, IPropertyTree * result);
-    virtual void physicalCopy(const char * source, const char * target, IPropertyTree * options, IDaftCopyProgress * progress);
-    virtual void physicalCopy(IPropertyTree * source, const char * target, IPropertyTree * options, IDaftCopyProgress * progress);
-
 //operations on a single file.
     virtual offset_t getSize(IDistributedFile * file,bool forceget,bool dontsetattr);
     virtual bool compress(IDistributedFile * file);                                                  

+ 1 - 2
esp/services/ws_dfu/CMakeLists.txt

@@ -98,11 +98,10 @@ target_link_libraries ( ws_dfu
          dllserver 
          deftype 
          workunit 
-         hql   
+         hql
          fileview2 
          xmllib 
          esphttp 
-         dalift 
          SMCLib 
          dfuXRefLib 
          dfuwu 

+ 4 - 4
esp/services/ws_dfu/ws_dfuService.cpp

@@ -2230,7 +2230,7 @@ void CWsDfuEx::doGetFileDetails(IEspContext &context, IUserDescriptor *udesc, co
         df->setRestrictedAccess(changeRestriction==CDFUChangeRestriction_Restrict);
     }
 
-    offset_t size=queryDistributedFileSystem().getSize(df), recordSize=df->queryAttributes().getPropInt64("@recordSize",0);
+    offset_t size=df->getFileSize(true, false), recordSize=df->queryAttributes().getPropInt64("@recordSize",0);
 
     CDateTime dt;
     df->getModificationTime(dt);
@@ -2537,7 +2537,7 @@ void CWsDfuEx::doGetFileDetails(IEspContext &context, IUserDescriptor *udesc, co
 
                 try
                 {
-                    offset_t size = queryDistributedFileSystem().getSize(part);
+                    offset_t size = part->getFileSize(true, false);
                     if (version >= 1.38)
                         FilePart->setPartSizeInt64(size);
 
@@ -2549,12 +2549,12 @@ void CWsDfuEx::doGetFileDetails(IEspContext &context, IUserDescriptor *udesc, co
                 catch(IException *e)
                 {
                     StringBuffer msg;
-                    IERRLOG("Exception %d:%s in WS_DFU queryDistributedFileSystem().getSize()", e->errorCode(), e->errorMessage(msg).str());
+                    IERRLOG("Exception %d:%s in WS_DFU getFileSize()", e->errorCode(), e->errorMessage(msg).str());
                     e->Release();
                 }
                 catch(...)
                 {
-                    IERRLOG("Unknown exception in WS_DFU queryDistributedFileSystem().getSize()");
+                    IERRLOG("Unknown exception in WS_DFU getFileSize");
                 }
 
                 PartList.append(*FilePart.getClear());

+ 2 - 2
esp/services/ws_dfu/ws_dfuXRefService.cpp

@@ -232,8 +232,8 @@ void CWsDfuXRefEx::readLostFileQueryResult(IEspContext &context, StringBuffer &b
         try
         {
             Owned<IDistributedFile> df = queryDistributedFileDirectory().lookup(fileName, userDesc, false, false, false, NULL, defaultPrivilegedUser, 0);
-            if(df)
-                item.addPropInt64("Size", queryDistributedFileSystem().getSize(df));
+            if (df)
+                item.addPropInt64("Size", df->getFileSize(true, false));
         }
         catch(IException *e)
         {

+ 0 - 1
esp/services/ws_smc/CMakeLists.txt

@@ -82,7 +82,6 @@ target_link_libraries ( ws_smc
          hrpc 
          remote 
          dalibase 
-         dalift 
          dllserver 
          nbcd 
          eclrtl 

+ 0 - 1
esp/services/ws_topology/CMakeLists.txt

@@ -70,7 +70,6 @@ target_link_libraries ( ws_topology
          xmllib 
          esphttp 
          dalibase 
-         dalift 
          dllserver 
          nbcd 
          eclrtl 

+ 0 - 1
esp/services/ws_workunits/CMakeLists.txt

@@ -107,7 +107,6 @@ target_link_libraries ( ws_workunits
          xmllib
          esphttp
          dalibase
-         dalift
          dllserver
          nbcd
          eclrtl

+ 0 - 1
esp/smc/SMCLib/CMakeLists.txt

@@ -79,7 +79,6 @@ target_link_libraries ( SMCLib
          xmllib 
          esphttp 
          dalibase 
-         dalift 
          dllserver 
          nbcd 
          eclrtl 

+ 0 - 33
esp/smc/SMCLib/LogicFileWrapper.cpp

@@ -95,39 +95,6 @@ bool LogicFileWrapper::doDeleteFile(const char* logicalName,const char *cluster,
     return false;
 }
 
-bool LogicFileWrapper::doCompressFile(const char* name,StringBuffer& returnStr, IUserDescriptor* udesc)
-{
-    try
-    {
-        Owned<IDistributedFile> df = queryDistributedFileDirectory().lookup(name, udesc, false, false, false, nullptr, defaultPrivilegedUser) ;
-        if(!df)
-            return false;
-
-        ErrorReceiver err;
-        TaskQueue tq(200,&err);
-
-        Owned<IDistributedFilePartIterator> pi = df->getIterator();
-        ForEach(*pi)
-        {
-            tq.put(new CompressTask(&pi->query()));
-        }
-
-        tq.join();
-        err.getErrors(returnStr);
-    }
-    catch(IException* e){   
-      StringBuffer msg;
-      e->errorMessage(msg);
-        IWARNLOG("%s", msg.str());
-        e->Release();
-    }
-    catch(...){
-        IWARNLOG("Unknown Exception caught within doCompressFile");
-    }
-
-    return true; 
-}
-
 IDistributedFile* lookupLogicalName(IEspContext& context, const char* logicalName, bool writeattr, bool hold,
     bool lockSuperOwner, IDistributedFileTransaction* transaction, bool privilegedUser, unsigned timeout)
 {

+ 0 - 35
esp/smc/SMCLib/LogicFileWrapper.hpp

@@ -44,7 +44,6 @@ public:
     LogicFileWrapper();
     virtual ~LogicFileWrapper();
     bool doDeleteFile(const char* name, const char *cluster, StringBuffer& returnStr, IUserDescriptor* udesc = NULL);
-    bool doCompressFile(const char* name,StringBuffer& returnStr, IUserDescriptor* udesc = 0);
     void FindClusterName(const char* logicalName,StringBuffer& returnCluster, IUserDescriptor* udesc = 0);
 
 };
@@ -125,40 +124,6 @@ struct DeleteTask: public CInterface, implements ITask
 
     Linked<IDistributedFilePart> part;
 };
-struct CompressTask: public CInterface, implements ITask
-{
-    IMPLEMENT_IINTERFACE;    
-    CompressTask(IDistributedFilePart* _part): part(_part)
-    {
-    }
-
-    virtual int run()
-    {
-        try
-        {
-            queryDistributedFileSystem().compress(part);
-        }
-        catch(IException* e)
-        {
-            StringBuffer err;
-            e->errorMessage(err);
-            LOG(MCerror, unknownJob, "%s", err.str());
-            e->Release();
-        }
-        catch(...)
-        {
-            IERRLOG("Unknown Exception thrown\n");
-        }
-        return 0;
-    }
-
-    virtual bool stop()
-    {
-        return false;
-    }
-
-    Linked<IDistributedFilePart> part;
-};
 
 extern LFWRAPPER_API IDistributedFile* lookupLogicalName(IEspContext& contcontext, const char* logicalName, bool writeattr,
     bool hold, bool lockSuperOwner, IDistributedFileTransaction* transaction, bool privilegedUser, unsigned timeout=INFINITE);

+ 0 - 1
thorlcr/activities/activitymasters_lcr.cmake

@@ -119,7 +119,6 @@ target_link_libraries ( activitymasters_lcr
          workunit 
          thorcodectx_lcr 
          graph_lcr 
-         dalift 
          mfilemanager_lcr 
          graphmaster_lcr 
     )

+ 0 - 1
thorlcr/graph/graphmaster_lcr.cmake

@@ -69,7 +69,6 @@ target_link_libraries ( graphmaster_lcr
          workunit 
          thorcodectx_lcr 
          graph_lcr 
-         dalift 
          mfilemanager_lcr 
     )
 

+ 0 - 1
thorlcr/master/CMakeLists.txt

@@ -83,7 +83,6 @@ target_link_libraries (  thormaster_lcr
          thorsort_lcr 
          thorhelper 
          thorcodectx_lcr 
-         dalift 
          mfilemanager_lcr 
          graphmaster_lcr 
          activitymasters_lcr 

+ 0 - 1
thorlcr/mfilemanager/CMakeLists.txt

@@ -60,7 +60,6 @@ target_link_libraries ( mfilemanager_lcr
          jlib
          remote 
          dalibase 
-         dalift 
          dllserver 
          nbcd 
          eclrtl