Browse Source

HPCC-25979 Allow internal/expert options to be set

Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
Jake Smith 4 years ago
parent
commit
5d4d69fdbb
2 changed files with 23 additions and 4 deletions
  1. 4 0
      helm/hpcc/values.schema.json
  2. 19 4
      thorlcr/graph/thgraph.cpp

+ 4 - 0
helm/hpcc/values.schema.json

@@ -936,6 +936,10 @@
         },
         "eclAgentResources": {
           "$ref": "#/definitions/resources"
+        },
+        "expert": {
+          "description": "Custom internal options usually reserved for internal testing",
+          "type": "object"
         }
       }
     },

+ 19 - 4
thorlcr/graph/thgraph.cpp

@@ -2953,15 +2953,27 @@ void CJobBase::decrease(offset_t usage, const char *key)
     diskUsage -= usage;
 }
 
+static inline StringBuffer &getExpertOptPath(const char *opt, StringBuffer &out)
+{
+#ifdef _CONTAINERIZED
+    return out.append("expert/@").append(opt);
+#else
+    return out.append("Debug/@").append(opt);
+#endif
+}
+
 // these getX methods for property in workunit settings, then global setting, defaulting to provided 'dft' if not present
 StringBuffer &CJobBase::getOpt(const char *opt, StringBuffer &out)
 {
     if (!opt || !*opt)
         return out; // probably error
-    VStringBuffer gOpt("Debug/@%s", opt);
     getWorkUnitValue(opt, out);
     if (0 == out.length())
+    {
+        StringBuffer gOpt;
+        getExpertOptPath(opt, gOpt);
         globals->getProp(gOpt, out);
+    }
     return out;
 }
 
@@ -2969,7 +2981,8 @@ bool CJobBase::getOptBool(const char *opt, bool dft)
 {
     if (!opt || !*opt)
         return dft; // probably error
-    VStringBuffer gOpt("Debug/@%s", opt);
+    StringBuffer gOpt;
+    getExpertOptPath(opt, gOpt);    
     return getWorkUnitValueBool(opt, globals->getPropBool(gOpt, dft));
 }
 
@@ -2977,7 +2990,8 @@ int CJobBase::getOptInt(const char *opt, int dft)
 {
     if (!opt || !*opt)
         return dft; // probably error
-    VStringBuffer gOpt("Debug/@%s", opt);
+    StringBuffer gOpt;
+    getExpertOptPath(opt, gOpt);    
     return (int)getWorkUnitValueInt(opt, globals->getPropInt(gOpt, dft));
 }
 
@@ -2985,7 +2999,8 @@ __int64 CJobBase::getOptInt64(const char *opt, __int64 dft)
 {
     if (!opt || !*opt)
         return dft; // probably error
-    VStringBuffer gOpt("Debug/@%s", opt);
+    StringBuffer gOpt;
+    getExpertOptPath(opt, gOpt);    
     return getWorkUnitValueInt(opt, globals->getPropInt64(gOpt, dft));
 }