Procházet zdrojové kódy

HPCC-23670 Rename isCloud() to isContainerized()

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday před 5 roky
rodič
revize
048829b80c

+ 1 - 1
common/workunit/workunit.cpp

@@ -12863,7 +12863,7 @@ extern WORKUNIT_API void associateLocalFile(IWUQuery * query, WUFileType type, c
 {
     StringBuffer fullPathName;
     makeAbsolutePath(name, fullPathName);
-    if (isCloud())
+    if (isContainerized())
     {
         const char *dllserver_root = getenv("HPCC_DLLSERVER_PATH");
         assertex(dllserver_root != nullptr);

+ 1 - 1
dali/base/dasds.cpp

@@ -8763,7 +8763,7 @@ public:
             throw;
         }
         // In nas/non-local storage mode, create a published named group for 1-way files to use
-        if (isCloud())
+        if (isContainerized())
             queryNamedGroupStore().ensureNasGroup(1);
         storeLoaded = true;
         manager->start();

+ 1 - 1
dali/server/daserver.cpp

@@ -144,7 +144,7 @@ void usage(void)
  */
 static bool populateWhiteListFromEnvironment(IWhiteListWriter &writer)
 {
-    if (isCloud())
+    if (isContainerized())
         return false;
     Owned<IRemoteConnection> conn = querySDS().connect("/Environment", 0, 0, INFINITE);
     assertex(conn);

+ 3 - 3
ecl/hthor/hthor.cpp

@@ -352,7 +352,7 @@ ClusterWriteHandler *createClusterWriteHandler(IAgentContext &agent, IHThorIndex
         OwnedRoxieString cluster(iwHelper ? iwHelper->getCluster(clusterIdx++) : dwHelper->getCluster(clusterIdx++));
         if(!cluster)
             break;
-        if (isCloud())
+        if (isContainerized())
             throw makeStringException(0, "Output clusters not supported in cloud environment");
         if(!clusterHandler)
         {
@@ -654,7 +654,7 @@ void CHThorDiskWriteActivity::publish()
         // add cluster
         StringBuffer mygroupname;
         Owned<IGroup> mygrp;
-        if (isCloud())
+        if (isContainerized())
         {
             queryNamedGroupStore().getNasGroupName(mygroupname, 1);
             mygrp.setown(queryNamedGroupStore().lookup(mygroupname));
@@ -1222,7 +1222,7 @@ void CHThorIndexWriteActivity::execute()
         // add cluster
         StringBuffer mygroupname;
         Owned<IGroup> mygrp = NULL;
-        if (isCloud())
+        if (isContainerized())
         {
             queryNamedGroupStore().getNasGroupName(mygroupname, 1);
             mygrp.setown(queryNamedGroupStore().lookup(mygroupname));

+ 2 - 2
roxie/ccd/ccdserver.cpp

@@ -11720,7 +11720,7 @@ protected:
             OwnedRoxieString cluster(helper.getCluster(clusterIdx));
             if(!cluster)
                 break;
-            if (isCloud())
+            if (isContainerized())
                 throw makeStringException(0, "Output clusters not supported in cloud environment");
             clusters.append(cluster);
             clusterIdx++;
@@ -11732,7 +11732,7 @@ protected:
         }
         else
         {
-            if (isCloud())
+            if (isContainerized())
             {
                 StringBuffer nasGroupName;
                 queryNamedGroupStore().getNasGroupName(nasGroupName, 1);

+ 6 - 7
system/jlib/jutil.cpp

@@ -1692,14 +1692,13 @@ void doStackProbe()
 #pragma GCC diagnostic pop
 #endif
 
-extern jlib_decl bool isCloud()
+extern jlib_decl bool isContainerized()
 {
-    static bool cloudy = []()
-        {
-            const char *env = getenv("HPCC_containerized");
-            return (env && atoi(env)==1);
-        }();
-    return cloudy;
+#ifdef _CONTAINERIZED
+    return true;
+#else
+    return false;
+#endif
 }
 
 #ifdef _WIN32

+ 1 - 1
system/jlib/jutil.hpp

@@ -284,7 +284,7 @@ extern jlib_decl unsigned msTick();
 extern jlib_decl unsigned usTick();
 extern jlib_decl int write_pidfile(const char * instance);
 extern jlib_decl void doStackProbe();
-extern jlib_decl bool isCloud();
+extern jlib_decl bool isContainerized();
 
 #ifndef arraysize
 #define arraysize(T) (sizeof(T)/sizeof(*T))

+ 1 - 1
thorlcr/master/thmastermain.cpp

@@ -857,7 +857,7 @@ int main( int argc, const char *argv[]  )
         kjServiceMpTag = allocateClusterMPTag();
 
         unsigned numSlaves = 0;
-        if (isCloud())
+        if (isContainerized())
         {
             if (!globals->hasProp("@numSlaves"))
                 throw makeStringException(0, "Number of slaves not defined (numSlaves)");

+ 3 - 3
thorlcr/mfilemanager/thmfilemanager.cpp

@@ -231,7 +231,7 @@ public:
          * that matches the width of the cluster.
          * Also create a 1-way named group, that is used in special cases, e.g. BUILDINDEX,FEW
          */
-        if (isCloud())
+        if (isContainerized())
             queryNamedGroupStore().ensureNasGroup(queryClusterWidth());
     }
     StringBuffer &mangleLFN(CJobBase &job, const char *lfn, StringBuffer &out)
@@ -381,7 +381,7 @@ public:
 
     IFileDescriptor *create(CJobBase &job, const char *logicalName, StringArray &groupNames, IArrayOf<IGroup> &groups, bool overwriteok, unsigned helperFlags=0, bool nonLocalIndex=false, unsigned restrictedWidth=0)
     {
-        if (isCloud())
+        if (isContainerized())
         {
             StringBuffer nasGroupName;
             // NB: normally size = queryClusterWidth(), but can be 1 (e.g. if BUILDINDEX,FEW)
@@ -742,7 +742,7 @@ void fillClusterArray(CJobBase &job, const char *filename, StringArray &clusters
     }
     else
     {
-        if (isCloud())
+        if (isContainerized())
             throw makeStringException(0, "Output clusters not supported in cloud environment");
         const char *cluster = clusters.item(0);
         Owned<IGroup> group = queryNamedGroupStore().lookup(cluster);