Selaa lähdekoodia

HPCC-14056 Make command line ecl-roxie-reload use of forceRetry optional

Must now specify "ecl roxie reload myroxie --retry" to do a forceRetry.

Signed-off-by: Anthony Fishbeck <anthony.fishbeck@lexisnexis.com>
Anthony Fishbeck 9 vuotta sitten
vanhempi
commit
9a0e98ab29

+ 1 - 0
ecl/eclcmd/eclcmd_common.hpp

@@ -91,6 +91,7 @@ typedef IEclCommand *(*EclCommandFactory)(const char *cmdname);
 #define ECLOPT_DELETE_FILES "--delete"
 #define ECLOPT_DELETE_SUBFILES "--delete-subfiles"
 #define ECLOPT_DELETE_RECURSIVE "--delete-recursive"
+#define ECLOPT_RETRY "--retry"
 
 #define ECLOPT_MAIN "--main"
 #define ECLOPT_MAIN_S "-main"  //eclcc compatible format

+ 10 - 2
ecl/eclcmd/roxie/ecl-roxie.cpp

@@ -251,7 +251,7 @@ private:
 class EclCmdRoxieCheckOrReload : public EclCmdCommon
 {
 public:
-    EclCmdRoxieCheckOrReload(bool _reload) : optMsToWait(10000), reload(_reload)
+    EclCmdRoxieCheckOrReload(bool _reload) : optMsToWait(10000), reload(_reload), optRetry(false)
     {
     }
     virtual bool parseCommandLineOptions(ArgvIterator &iter)
@@ -272,6 +272,8 @@ public:
             }
             if (iter.matchOption(optMsToWait, ECLOPT_WAIT))
                 continue;
+            if (reload && iter.matchFlag(optRetry, ECLOPT_RETRY))
+                continue;
             if (EclCmdCommon::matchCommandLineOption(iter, true)!=EclCmdOptionMatch)
                 return false;
         }
@@ -295,7 +297,12 @@ public:
         Owned<IClientRoxieControlCmdRequest> req = client->createRoxieControlCmdRequest();
         req->setWait(optMsToWait);
         req->setProcessCluster(optProcess);
-        req->setCommand((reload) ? CRoxieControlCmd_RELOAD : CRoxieControlCmd_STATE);
+        if (!reload)
+            req->setCommand(CRoxieControlCmd_STATE);
+        else if (optRetry)
+            req->setCommand(CRoxieControlCmd_RELOAD_RETRY);
+        else
+            req->setCommand(CRoxieControlCmd_RELOAD);
 
         Owned<IClientRoxieControlCmdResponse> resp = client->RoxieControlCmd(req);
         if (resp->getExceptions().ordinality())
@@ -358,6 +365,7 @@ private:
     StringAttr optProcess;
     unsigned optMsToWait;
     bool reload;
+    bool optRetry;
 };
 
 class EclCmdRoxieUnusedFiles : public EclCmdCommon

+ 2 - 1
esp/scm/ws_smc.ecm

@@ -313,7 +313,8 @@ ESPenum RoxieControlCmd : string
     ATTACH("Attach"),
     DETACH("Detach"),
     STATE("State"),
-    RELOAD("Reload")
+    RELOAD("Reload"),
+    RELOAD_RETRY("ReloadRetry")
 };
 
 ESPrequest RoxieControlCmdRequest

+ 2 - 0
esp/services/ws_smc/ws_smcService.cpp

@@ -2036,6 +2036,8 @@ inline const char *controlCmdMessage(int cmd)
     case CRoxieControlCmd_DETACH:
         return "<control:lockDali/>";
     case CRoxieControlCmd_RELOAD:
+        return "<control:reload/>";
+    case CRoxieControlCmd_RELOAD_RETRY:
         return "<control:reload forceRetry='1' />";
     case CRoxieControlCmd_STATE:
         return "<control:state/>";