wuattr.hpp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #ifndef WUATTR_HPP
  14. #define WUATTR_HPP
  15. #include "jlib.hpp"
  16. #include "jstatcodes.h"
  17. #ifdef WORKUNIT_EXPORTS
  18. #define WORKUNIT_API DECL_EXPORT
  19. #else
  20. #define WORKUNIT_API DECL_IMPORT
  21. #endif
  22. //The wuattribute values start from a high value - so that they do not overlap with StXXX
  23. //They are not currently persisted, so it is fine to modify the list for major releases
  24. enum WuAttr : unsigned
  25. {
  26. WaNone = 0x80000000,
  27. WaAll,
  28. WaKind,
  29. WaIdSource,
  30. WaIdTarget,
  31. WaSourceIndex,
  32. WaTargetIndex,
  33. WaLabel,
  34. WaIsDependency,
  35. WaIsChildGraph,
  36. WaDefinition,
  37. WaDefinitionList,
  38. WaEclName,
  39. WaEclNameList,
  40. WaEclText,
  41. WaRecordSize,
  42. WaPredictedCount,
  43. WaIsGrouped,
  44. WaIsLocal,
  45. WaIsCoLocal,
  46. WaIsOrdered,
  47. WaIsInternal,
  48. WaIsNoAccess,
  49. WaIsGraphIndependent,
  50. WaIsUpdateIfChanged,
  51. WaIsKeyed,
  52. WaIsPreload,
  53. WaIsDiskAccessRequired,
  54. WaIsFileOpt,
  55. WaIsIndexOpt,
  56. WaIsPatchOpt,
  57. WaFilename,
  58. WaIndexname,
  59. WaPatchFilename,
  60. WaIsFilenameDynamic,
  61. WaIsIndexnameDynamic,
  62. WaIsPatchFilenameDynamic,
  63. WaIsEmbedded,
  64. WaIsSpill,
  65. WaIsGlobalSpill,
  66. WaIsAccessedFromChild,
  67. WaIsTransformSpill,
  68. WaOriginalFilename,
  69. WaOutputFilename,
  70. WaUpdatedFilename,
  71. WaDistributeIndexname,
  72. WaIsOriginalFilenameDynamic,
  73. WaIsOutputFilenameDynamic,
  74. WaIsUpdatedFilenameDynamic,
  75. WaIsDistributeIndexnameDynamic,
  76. WaSignedBy,
  77. WaMetaDistribution,
  78. WaMetaGrouping,
  79. WaMetaGlobalSortOrder,
  80. WaMetaLocalSortOrder,
  81. WaMetaGroupSortOrder,
  82. WaSection,
  83. WaSectionList,
  84. WaLibraryName,
  85. WaMatchLikelihood,
  86. WaSpillReason,
  87. WaNumChildQueries,
  88. WaSizeClassApprox,
  89. WaIdParentActivity,
  90. WaNumParallel,
  91. WaAlgorithm,
  92. WaSizePreload,
  93. WaIdLoop,
  94. WaIdSubGraph,
  95. WaIdGraph,
  96. WaIdChildGraph,
  97. WaIdAmbiguousGraph, // unfortunately used for global graphs (library) and child graphs (remote), change in another PR
  98. WaIdLibraryGraph,
  99. WaIdRemoteSubGraph,
  100. WaInterfaceHash,
  101. WaNumMaxOutputs,
  102. WaIsRootGraph,
  103. WaIsNWay,
  104. WaIsCosort,
  105. WaNumGlobalUses,
  106. WaIsMultiInstance,
  107. WaIsDelayed,
  108. WaIsChild,
  109. WaIsSequential,
  110. WaIsLoopBody,
  111. WaNumResults,
  112. WaWhenIndex,
  113. WaIdDependency,
  114. WaIdDependencyList,
  115. WaIsScheduled,
  116. WaIdSuccess,
  117. WaIdFailure,
  118. WaIdRecovery,
  119. WaIdPersist,
  120. WaIdScheduled,
  121. WaPersistName,
  122. WaType,
  123. WaMode,
  124. WaState,
  125. WaCluster,
  126. WaCriticalSection,
  127. WaDiskFormat,
  128. WaRecordFormat,
  129. WaServiceName,
  130. WaMax
  131. };
  132. inline WuAttr & operator++(WuAttr & x) { assert(x<WaMax); x = (WuAttr)(x+1); return x; }
  133. extern WORKUNIT_API const char * queryWuAttributeName(WuAttr kind);
  134. extern WORKUNIT_API WuAttr queryWuAttribute(const char * kind, WuAttr dft);
  135. extern WORKUNIT_API const char * queryAttributeValue(IPropertyTree & src, WuAttr kind, StringBuffer & scratchpad); // may return pointer to scratchpad if necessary
  136. extern WORKUNIT_API WuAttr queryGraphAttrToWuAttr(const char * name);
  137. extern WORKUNIT_API WuAttr queryGraphChildAttToWuAttr(const char * name);
  138. extern WORKUNIT_API void setAttributeValue(IPropertyTree & tgt, WuAttr kind, const char * value);
  139. extern WORKUNIT_API void setAttributeValueBool(IPropertyTree & tgt, WuAttr kind, bool value, bool alwaysAdd = false);
  140. extern WORKUNIT_API void setAttributeValueInt(IPropertyTree & tgt, WuAttr kind, __int64 value);
  141. extern WORKUNIT_API bool isListAttribute(WuAttr kind);
  142. extern WORKUNIT_API bool isMultiAttribute(WuAttr kind);
  143. extern WORKUNIT_API WuAttr getListAttribute(WuAttr kind);
  144. extern WORKUNIT_API WuAttr getSingleKindOfListAttribute(WuAttr kind);
  145. #endif