Constants.java 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. package org.apache.dolphinscheduler.common;
  18. import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
  19. import org.apache.dolphinscheduler.common.utils.OSUtils;
  20. import org.apache.dolphinscheduler.common.utils.StringUtils;
  21. import java.util.regex.Pattern;
  22. /**
  23. * Constants
  24. */
  25. public final class Constants {
  26. private Constants() {
  27. throw new UnsupportedOperationException("Construct Constants");
  28. }
  29. /**
  30. * quartz config
  31. */
  32. public static final String ORG_QUARTZ_JOBSTORE_DRIVERDELEGATECLASS = "org.quartz.jobStore.driverDelegateClass";
  33. public static final String ORG_QUARTZ_SCHEDULER_INSTANCENAME = "org.quartz.scheduler.instanceName";
  34. public static final String ORG_QUARTZ_SCHEDULER_INSTANCEID = "org.quartz.scheduler.instanceId";
  35. public static final String ORG_QUARTZ_SCHEDULER_MAKESCHEDULERTHREADDAEMON = "org.quartz.scheduler.makeSchedulerThreadDaemon";
  36. public static final String ORG_QUARTZ_JOBSTORE_USEPROPERTIES = "org.quartz.jobStore.useProperties";
  37. public static final String ORG_QUARTZ_THREADPOOL_CLASS = "org.quartz.threadPool.class";
  38. public static final String ORG_QUARTZ_THREADPOOL_THREADCOUNT = "org.quartz.threadPool.threadCount";
  39. public static final String ORG_QUARTZ_THREADPOOL_MAKETHREADSDAEMONS = "org.quartz.threadPool.makeThreadsDaemons";
  40. public static final String ORG_QUARTZ_THREADPOOL_THREADPRIORITY = "org.quartz.threadPool.threadPriority";
  41. public static final String ORG_QUARTZ_JOBSTORE_CLASS = "org.quartz.jobStore.class";
  42. public static final String ORG_QUARTZ_JOBSTORE_TABLEPREFIX = "org.quartz.jobStore.tablePrefix";
  43. public static final String ORG_QUARTZ_JOBSTORE_ISCLUSTERED = "org.quartz.jobStore.isClustered";
  44. public static final String ORG_QUARTZ_JOBSTORE_MISFIRETHRESHOLD = "org.quartz.jobStore.misfireThreshold";
  45. public static final String ORG_QUARTZ_JOBSTORE_CLUSTERCHECKININTERVAL = "org.quartz.jobStore.clusterCheckinInterval";
  46. public static final String ORG_QUARTZ_JOBSTORE_ACQUIRETRIGGERSWITHINLOCK = "org.quartz.jobStore.acquireTriggersWithinLock";
  47. public static final String ORG_QUARTZ_JOBSTORE_DATASOURCE = "org.quartz.jobStore.dataSource";
  48. public static final String ORG_QUARTZ_DATASOURCE_MYDS_CONNECTIONPROVIDER_CLASS = "org.quartz.dataSource.myDs.connectionProvider.class";
  49. /**
  50. * quartz config default value
  51. */
  52. public static final String QUARTZ_TABLE_PREFIX = "QRTZ_";
  53. public static final String QUARTZ_MISFIRETHRESHOLD = "60000";
  54. public static final String QUARTZ_CLUSTERCHECKININTERVAL = "5000";
  55. public static final String QUARTZ_DATASOURCE = "myDs";
  56. public static final String QUARTZ_THREADCOUNT = "25";
  57. public static final String QUARTZ_THREADPRIORITY = "5";
  58. public static final String QUARTZ_INSTANCENAME = "DolphinScheduler";
  59. public static final String QUARTZ_INSTANCEID = "AUTO";
  60. public static final String QUARTZ_ACQUIRETRIGGERSWITHINLOCK = "true";
  61. /**
  62. * common properties path
  63. */
  64. public static final String COMMON_PROPERTIES_PATH = "/common.properties";
  65. /**
  66. * fs.defaultFS
  67. */
  68. public static final String FS_DEFAULTFS = "fs.defaultFS";
  69. /**
  70. * fs s3a endpoint
  71. */
  72. public static final String FS_S3A_ENDPOINT = "fs.s3a.endpoint";
  73. /**
  74. * fs s3a access key
  75. */
  76. public static final String FS_S3A_ACCESS_KEY = "fs.s3a.access.key";
  77. /**
  78. * fs s3a secret key
  79. */
  80. public static final String FS_S3A_SECRET_KEY = "fs.s3a.secret.key";
  81. /**
  82. * hadoop configuration
  83. */
  84. public static final String HADOOP_RM_STATE_ACTIVE = "ACTIVE";
  85. public static final String HADOOP_RM_STATE_STANDBY = "STANDBY";
  86. public static final String HADOOP_RESOURCE_MANAGER_HTTPADDRESS_PORT = "resource.manager.httpaddress.port";
  87. /**
  88. * yarn.resourcemanager.ha.rm.ids
  89. */
  90. public static final String YARN_RESOURCEMANAGER_HA_RM_IDS = "yarn.resourcemanager.ha.rm.ids";
  91. /**
  92. * yarn.application.status.address
  93. */
  94. public static final String YARN_APPLICATION_STATUS_ADDRESS = "yarn.application.status.address";
  95. /**
  96. * yarn.job.history.status.address
  97. */
  98. public static final String YARN_JOB_HISTORY_STATUS_ADDRESS = "yarn.job.history.status.address";
  99. /**
  100. * hdfs configuration
  101. * hdfs.root.user
  102. */
  103. public static final String HDFS_ROOT_USER = "hdfs.root.user";
  104. /**
  105. * hdfs/s3 configuration
  106. * resource.upload.path
  107. */
  108. public static final String RESOURCE_UPLOAD_PATH = "resource.upload.path";
  109. /**
  110. * data basedir path
  111. */
  112. public static final String DATA_BASEDIR_PATH = "data.basedir.path";
  113. /**
  114. * dolphinscheduler.env.path
  115. */
  116. public static final String DOLPHINSCHEDULER_ENV_PATH = "dolphinscheduler.env.path";
  117. /**
  118. * environment properties default path
  119. */
  120. public static final String ENV_PATH = "env/dolphinscheduler_env.sh";
  121. /**
  122. * python home
  123. */
  124. public static final String PYTHON_HOME = "PYTHON_HOME";
  125. /**
  126. * resource.view.suffixs
  127. */
  128. public static final String RESOURCE_VIEW_SUFFIXS = "resource.view.suffixs";
  129. public static final String RESOURCE_VIEW_SUFFIXS_DEFAULT_VALUE = "txt,log,sh,bat,conf,cfg,py,java,sql,xml,hql,properties,json,yml,yaml,ini,js";
  130. /**
  131. * development.state
  132. */
  133. public static final String DEVELOPMENT_STATE = "development.state";
  134. /**
  135. * sudo enable
  136. */
  137. public static final String SUDO_ENABLE = "sudo.enable";
  138. /**
  139. * string true
  140. */
  141. public static final String STRING_TRUE = "true";
  142. /**
  143. * string false
  144. */
  145. public static final String STRING_FALSE = "false";
  146. /**
  147. * resource storage type
  148. */
  149. public static final String RESOURCE_STORAGE_TYPE = "resource.storage.type";
  150. /**
  151. * MasterServer directory registered in zookeeper
  152. */
  153. public static final String REGISTRY_DOLPHINSCHEDULER_MASTERS = "/nodes/master";
  154. /**
  155. * WorkerServer directory registered in zookeeper
  156. */
  157. public static final String REGISTRY_DOLPHINSCHEDULER_WORKERS = "/nodes/worker";
  158. /**
  159. * all servers directory registered in zookeeper
  160. */
  161. public static final String REGISTRY_DOLPHINSCHEDULER_DEAD_SERVERS = "/dead-servers";
  162. /**
  163. * registry node prefix
  164. */
  165. public static final String REGISTRY_DOLPHINSCHEDULER_NODE = "/nodes";
  166. /**
  167. * MasterServer lock directory registered in zookeeper
  168. */
  169. public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_MASTERS = "/lock/masters";
  170. /**
  171. * MasterServer failover directory registered in zookeeper
  172. */
  173. public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_MASTERS = "/lock/failover/masters";
  174. /**
  175. * WorkerServer failover directory registered in zookeeper
  176. */
  177. public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_WORKERS = "/lock/failover/workers";
  178. /**
  179. * MasterServer startup failover runing and fault tolerance process
  180. */
  181. public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_STARTUP_MASTERS = "/lock/failover/startup-masters";
  182. /**
  183. * comma ,
  184. */
  185. public static final String COMMA = ",";
  186. /**
  187. * slash /
  188. */
  189. public static final String SLASH = "/";
  190. /**
  191. * COLON :
  192. */
  193. public static final String COLON = ":";
  194. /**
  195. * SPACE " "
  196. */
  197. public static final String SPACE = " ";
  198. /**
  199. * SINGLE_SLASH /
  200. */
  201. public static final String SINGLE_SLASH = "/";
  202. /**
  203. * DOUBLE_SLASH //
  204. */
  205. public static final String DOUBLE_SLASH = "//";
  206. /**
  207. * SINGLE_QUOTES "'"
  208. */
  209. public static final String SINGLE_QUOTES = "'";
  210. /**
  211. * DOUBLE_QUOTES "\""
  212. */
  213. public static final String DOUBLE_QUOTES = "\"";
  214. /**
  215. * SEMICOLON ;
  216. */
  217. public static final String SEMICOLON = ";";
  218. /**
  219. * EQUAL SIGN
  220. */
  221. public static final String EQUAL_SIGN = "=";
  222. /**
  223. * AT SIGN
  224. */
  225. public static final String AT_SIGN = "@";
  226. /**
  227. * date format of yyyy-MM-dd HH:mm:ss
  228. */
  229. public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
  230. /**
  231. * date format of yyyyMMddHHmmss
  232. */
  233. public static final String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
  234. /**
  235. * date format of yyyyMMddHHmmssSSS
  236. */
  237. public static final String YYYYMMDDHHMMSSSSS = "yyyyMMddHHmmssSSS";
  238. /**
  239. * http connect time out
  240. */
  241. public static final int HTTP_CONNECT_TIMEOUT = 60 * 1000;
  242. /**
  243. * http connect request time out
  244. */
  245. public static final int HTTP_CONNECTION_REQUEST_TIMEOUT = 60 * 1000;
  246. /**
  247. * httpclient soceket time out
  248. */
  249. public static final int SOCKET_TIMEOUT = 60 * 1000;
  250. /**
  251. * http header
  252. */
  253. public static final String HTTP_HEADER_UNKNOWN = "unKnown";
  254. /**
  255. * http X-Forwarded-For
  256. */
  257. public static final String HTTP_X_FORWARDED_FOR = "X-Forwarded-For";
  258. /**
  259. * http X-Real-IP
  260. */
  261. public static final String HTTP_X_REAL_IP = "X-Real-IP";
  262. /**
  263. * UTF-8
  264. */
  265. public static final String UTF_8 = "UTF-8";
  266. /**
  267. * user name regex
  268. */
  269. public static final Pattern REGEX_USER_NAME = Pattern.compile("^[a-zA-Z0-9._-]{3,39}$");
  270. /**
  271. * email regex
  272. */
  273. public static final Pattern REGEX_MAIL_NAME = Pattern.compile("^([a-z0-9A-Z]+[_|\\-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$");
  274. /**
  275. * default display rows
  276. */
  277. public static final int DEFAULT_DISPLAY_ROWS = 10;
  278. /**
  279. * read permission
  280. */
  281. public static final int READ_PERMISSION = 2 * 1;
  282. /**
  283. * write permission
  284. */
  285. public static final int WRITE_PERMISSION = 2 * 2;
  286. /**
  287. * execute permission
  288. */
  289. public static final int EXECUTE_PERMISSION = 1;
  290. /**
  291. * default admin permission
  292. */
  293. public static final int DEFAULT_ADMIN_PERMISSION = 7;
  294. /**
  295. * all permissions
  296. */
  297. public static final int ALL_PERMISSIONS = READ_PERMISSION | WRITE_PERMISSION | EXECUTE_PERMISSION;
  298. /**
  299. * max task timeout
  300. */
  301. public static final int MAX_TASK_TIMEOUT = 24 * 3600;
  302. /**
  303. * master cpu load
  304. */
  305. public static final int DEFAULT_MASTER_CPU_LOAD = Runtime.getRuntime().availableProcessors() * 2;
  306. /**
  307. * worker cpu load
  308. */
  309. public static final int DEFAULT_WORKER_CPU_LOAD = Runtime.getRuntime().availableProcessors() * 2;
  310. /**
  311. * worker host weight
  312. */
  313. public static final int DEFAULT_WORKER_HOST_WEIGHT = 100;
  314. /**
  315. * default log cache rows num,output when reach the number
  316. */
  317. public static final int DEFAULT_LOG_ROWS_NUM = 4 * 16;
  318. /**
  319. * log flush interval?output when reach the interval
  320. */
  321. public static final int DEFAULT_LOG_FLUSH_INTERVAL = 1000;
  322. /**
  323. * time unit secong to minutes
  324. */
  325. public static final int SEC_2_MINUTES_TIME_UNIT = 60;
  326. /***
  327. *
  328. * rpc port
  329. */
  330. public static final int RPC_PORT = 50051;
  331. /***
  332. * alert rpc port
  333. */
  334. public static final int ALERT_RPC_PORT = 50052;
  335. /**
  336. * forbid running task
  337. */
  338. public static final String FLOWNODE_RUN_FLAG_FORBIDDEN = "FORBIDDEN";
  339. /**
  340. * normal running task
  341. */
  342. public static final String FLOWNODE_RUN_FLAG_NORMAL = "NORMAL";
  343. /**
  344. * datasource configuration path
  345. */
  346. public static final String DATASOURCE_PROPERTIES = "/datasource.properties";
  347. public static final String DEFAULT = "Default";
  348. public static final String USER = "user";
  349. public static final String PASSWORD = "password";
  350. public static final String XXXXXX = "******";
  351. public static final String NULL = "NULL";
  352. public static final String THREAD_NAME_MASTER_SERVER = "Master-Server";
  353. public static final String THREAD_NAME_WORKER_SERVER = "Worker-Server";
  354. /**
  355. * command parameter keys
  356. */
  357. public static final String CMD_PARAM_RECOVER_PROCESS_ID_STRING = "ProcessInstanceId";
  358. public static final String CMD_PARAM_RECOVERY_START_NODE_STRING = "StartNodeIdList";
  359. public static final String CMD_PARAM_RECOVERY_WAITING_THREAD = "WaitingThreadInstanceId";
  360. public static final String CMD_PARAM_SUB_PROCESS = "processInstanceId";
  361. public static final String CMD_PARAM_EMPTY_SUB_PROCESS = "0";
  362. public static final String CMD_PARAM_SUB_PROCESS_PARENT_INSTANCE_ID = "parentProcessInstanceId";
  363. public static final String CMD_PARAM_SUB_PROCESS_DEFINE_ID = "processDefinitionId";
  364. public static final String CMD_PARAM_START_NODE_NAMES = "StartNodeNameList";
  365. public static final String CMD_PARAM_START_PARAMS = "StartParams";
  366. public static final String CMD_PARAM_FATHER_PARAMS = "fatherParams";
  367. /**
  368. * complement data start date
  369. */
  370. public static final String CMDPARAM_COMPLEMENT_DATA_START_DATE = "complementStartDate";
  371. /**
  372. * complement data end date
  373. */
  374. public static final String CMDPARAM_COMPLEMENT_DATA_END_DATE = "complementEndDate";
  375. /**
  376. * data source config
  377. */
  378. public static final String SPRING_DATASOURCE_DRIVER_CLASS_NAME = "spring.datasource.driver-class-name";
  379. public static final String SPRING_DATASOURCE_URL = "spring.datasource.url";
  380. public static final String SPRING_DATASOURCE_USERNAME = "spring.datasource.username";
  381. public static final String SPRING_DATASOURCE_PASSWORD = "spring.datasource.password";
  382. public static final String SPRING_DATASOURCE_VALIDATION_QUERY_TIMEOUT = "spring.datasource.validationQueryTimeout";
  383. public static final String SPRING_DATASOURCE_INITIAL_SIZE = "spring.datasource.initialSize";
  384. public static final String SPRING_DATASOURCE_MIN_IDLE = "spring.datasource.minIdle";
  385. public static final String SPRING_DATASOURCE_MAX_ACTIVE = "spring.datasource.maxActive";
  386. public static final String SPRING_DATASOURCE_MAX_WAIT = "spring.datasource.maxWait";
  387. public static final String SPRING_DATASOURCE_TIME_BETWEEN_EVICTION_RUNS_MILLIS = "spring.datasource.timeBetweenEvictionRunsMillis";
  388. public static final String SPRING_DATASOURCE_TIME_BETWEEN_CONNECT_ERROR_MILLIS = "spring.datasource.timeBetweenConnectErrorMillis";
  389. public static final String SPRING_DATASOURCE_MIN_EVICTABLE_IDLE_TIME_MILLIS = "spring.datasource.minEvictableIdleTimeMillis";
  390. public static final String SPRING_DATASOURCE_VALIDATION_QUERY = "spring.datasource.validationQuery";
  391. public static final String SPRING_DATASOURCE_TEST_WHILE_IDLE = "spring.datasource.testWhileIdle";
  392. public static final String SPRING_DATASOURCE_TEST_ON_BORROW = "spring.datasource.testOnBorrow";
  393. public static final String SPRING_DATASOURCE_TEST_ON_RETURN = "spring.datasource.testOnReturn";
  394. public static final String SPRING_DATASOURCE_POOL_PREPARED_STATEMENTS = "spring.datasource.poolPreparedStatements";
  395. public static final String SPRING_DATASOURCE_DEFAULT_AUTO_COMMIT = "spring.datasource.defaultAutoCommit";
  396. public static final String SPRING_DATASOURCE_KEEP_ALIVE = "spring.datasource.keepAlive";
  397. public static final String SPRING_DATASOURCE_MAX_POOL_PREPARED_STATEMENT_PER_CONNECTION_SIZE = "spring.datasource.maxPoolPreparedStatementPerConnectionSize";
  398. public static final String DEVELOPMENT = "development";
  399. public static final String QUARTZ_PROPERTIES_PATH = "quartz.properties";
  400. /**
  401. * sleep time
  402. */
  403. public static final int SLEEP_TIME_MILLIS = 1000;
  404. /**
  405. * master task instance cache-database refresh interval
  406. */
  407. public static final int CACHE_REFRESH_TIME_MILLIS = 20 * 1000;
  408. /**
  409. * heartbeat for zk info length
  410. */
  411. public static final int HEARTBEAT_FOR_ZOOKEEPER_INFO_LENGTH = 10;
  412. public static final int HEARTBEAT_WITH_WEIGHT_FOR_ZOOKEEPER_INFO_LENGTH = 11;
  413. /**
  414. * jar
  415. */
  416. public static final String JAR = "jar";
  417. /**
  418. * hadoop
  419. */
  420. public static final String HADOOP = "hadoop";
  421. /**
  422. * -D <property>=<value>
  423. */
  424. public static final String D = "-D";
  425. /**
  426. * -D mapreduce.job.name=name
  427. */
  428. public static final String MR_NAME = "mapreduce.job.name";
  429. /**
  430. * -D mapreduce.job.queuename=queuename
  431. */
  432. public static final String MR_QUEUE = "mapreduce.job.queuename";
  433. /**
  434. * spark params constant
  435. */
  436. public static final String MASTER = "--master";
  437. public static final String DEPLOY_MODE = "--deploy-mode";
  438. /**
  439. * --class CLASS_NAME
  440. */
  441. public static final String MAIN_CLASS = "--class";
  442. /**
  443. * --driver-cores NUM
  444. */
  445. public static final String DRIVER_CORES = "--driver-cores";
  446. /**
  447. * --driver-memory MEM
  448. */
  449. public static final String DRIVER_MEMORY = "--driver-memory";
  450. /**
  451. * --num-executors NUM
  452. */
  453. public static final String NUM_EXECUTORS = "--num-executors";
  454. /**
  455. * --executor-cores NUM
  456. */
  457. public static final String EXECUTOR_CORES = "--executor-cores";
  458. /**
  459. * --executor-memory MEM
  460. */
  461. public static final String EXECUTOR_MEMORY = "--executor-memory";
  462. /**
  463. * --name NAME
  464. */
  465. public static final String SPARK_NAME = "--name";
  466. /**
  467. * --queue QUEUE
  468. */
  469. public static final String SPARK_QUEUE = "--queue";
  470. /**
  471. * exit code success
  472. */
  473. public static final int EXIT_CODE_SUCCESS = 0;
  474. /**
  475. * exit code kill
  476. */
  477. public static final int EXIT_CODE_KILL = 137;
  478. /**
  479. * exit code failure
  480. */
  481. public static final int EXIT_CODE_FAILURE = -1;
  482. /**
  483. * process or task definition failure
  484. */
  485. public static final int DEFINITION_FAILURE = -1;
  486. /**
  487. * date format of yyyyMMdd
  488. */
  489. public static final String PARAMETER_FORMAT_DATE = "yyyyMMdd";
  490. /**
  491. * date format of yyyyMMddHHmmss
  492. */
  493. public static final String PARAMETER_FORMAT_TIME = "yyyyMMddHHmmss";
  494. /**
  495. * system date(yyyyMMddHHmmss)
  496. */
  497. public static final String PARAMETER_DATETIME = "system.datetime";
  498. /**
  499. * system date(yyyymmdd) today
  500. */
  501. public static final String PARAMETER_CURRENT_DATE = "system.biz.curdate";
  502. /**
  503. * system date(yyyymmdd) yesterday
  504. */
  505. public static final String PARAMETER_BUSINESS_DATE = "system.biz.date";
  506. /**
  507. * ACCEPTED
  508. */
  509. public static final String ACCEPTED = "ACCEPTED";
  510. /**
  511. * SUCCEEDED
  512. */
  513. public static final String SUCCEEDED = "SUCCEEDED";
  514. /**
  515. * NEW
  516. */
  517. public static final String NEW = "NEW";
  518. /**
  519. * NEW_SAVING
  520. */
  521. public static final String NEW_SAVING = "NEW_SAVING";
  522. /**
  523. * SUBMITTED
  524. */
  525. public static final String SUBMITTED = "SUBMITTED";
  526. /**
  527. * FAILED
  528. */
  529. public static final String FAILED = "FAILED";
  530. /**
  531. * KILLED
  532. */
  533. public static final String KILLED = "KILLED";
  534. /**
  535. * RUNNING
  536. */
  537. public static final String RUNNING = "RUNNING";
  538. /**
  539. * underline "_"
  540. */
  541. public static final String UNDERLINE = "_";
  542. /**
  543. * quartz job prifix
  544. */
  545. public static final String QUARTZ_JOB_PRIFIX = "job";
  546. /**
  547. * quartz job group prifix
  548. */
  549. public static final String QUARTZ_JOB_GROUP_PRIFIX = "jobgroup";
  550. /**
  551. * projectId
  552. */
  553. public static final String PROJECT_ID = "projectId";
  554. /**
  555. * processId
  556. */
  557. public static final String SCHEDULE_ID = "scheduleId";
  558. /**
  559. * schedule
  560. */
  561. public static final String SCHEDULE = "schedule";
  562. /**
  563. * application regex
  564. */
  565. public static final String APPLICATION_REGEX = "application_\\d+_\\d+";
  566. public static final String PID = OSUtils.isWindows() ? "handle" : "pid";
  567. /**
  568. * month_begin
  569. */
  570. public static final String MONTH_BEGIN = "month_begin";
  571. /**
  572. * add_months
  573. */
  574. public static final String ADD_MONTHS = "add_months";
  575. /**
  576. * month_end
  577. */
  578. public static final String MONTH_END = "month_end";
  579. /**
  580. * week_begin
  581. */
  582. public static final String WEEK_BEGIN = "week_begin";
  583. /**
  584. * week_end
  585. */
  586. public static final String WEEK_END = "week_end";
  587. /**
  588. * timestamp
  589. */
  590. public static final String TIMESTAMP = "timestamp";
  591. public static final char SUBTRACT_CHAR = '-';
  592. public static final char ADD_CHAR = '+';
  593. public static final char MULTIPLY_CHAR = '*';
  594. public static final char DIVISION_CHAR = '/';
  595. public static final char LEFT_BRACE_CHAR = '(';
  596. public static final char RIGHT_BRACE_CHAR = ')';
  597. public static final String ADD_STRING = "+";
  598. public static final String MULTIPLY_STRING = "*";
  599. public static final String DIVISION_STRING = "/";
  600. public static final String LEFT_BRACE_STRING = "(";
  601. public static final char P = 'P';
  602. public static final char N = 'N';
  603. public static final String SUBTRACT_STRING = "-";
  604. public static final String GLOBAL_PARAMS = "globalParams";
  605. public static final String LOCAL_PARAMS = "localParams";
  606. public static final String LOCAL_PARAMS_LIST = "localParamsList";
  607. public static final String SUBPROCESS_INSTANCE_ID = "subProcessInstanceId";
  608. public static final String PROCESS_INSTANCE_STATE = "processInstanceState";
  609. public static final String PARENT_WORKFLOW_INSTANCE = "parentWorkflowInstance";
  610. public static final String CONDITION_RESULT = "conditionResult";
  611. public static final String DEPENDENCE = "dependence";
  612. public static final String TASK_TYPE = "taskType";
  613. public static final String TASK_LIST = "taskList";
  614. public static final String RWXR_XR_X = "rwxr-xr-x";
  615. public static final String QUEUE = "queue";
  616. public static final String QUEUE_NAME = "queueName";
  617. public static final int LOG_QUERY_SKIP_LINE_NUMBER = 0;
  618. public static final int LOG_QUERY_LIMIT = 4096;
  619. /**
  620. * master/worker server use for zk
  621. */
  622. public static final String MASTER_TYPE = "master";
  623. public static final String WORKER_TYPE = "worker";
  624. public static final String DELETE_OP = "delete";
  625. public static final String ADD_OP = "add";
  626. public static final String ALIAS = "alias";
  627. public static final String CONTENT = "content";
  628. public static final String DEPENDENT_SPLIT = ":||";
  629. public static final String DEPENDENT_ALL = "ALL";
  630. /**
  631. * preview schedule execute count
  632. */
  633. public static final int PREVIEW_SCHEDULE_EXECUTE_COUNT = 5;
  634. /**
  635. * kerberos
  636. */
  637. public static final String KERBEROS = "kerberos";
  638. /**
  639. * kerberos expire time
  640. */
  641. public static final String KERBEROS_EXPIRE_TIME = "kerberos.expire.time";
  642. /**
  643. * java.security.krb5.conf
  644. */
  645. public static final String JAVA_SECURITY_KRB5_CONF = "java.security.krb5.conf";
  646. /**
  647. * java.security.krb5.conf.path
  648. */
  649. public static final String JAVA_SECURITY_KRB5_CONF_PATH = "java.security.krb5.conf.path";
  650. /**
  651. * hadoop.security.authentication
  652. */
  653. public static final String HADOOP_SECURITY_AUTHENTICATION = "hadoop.security.authentication";
  654. /**
  655. * hadoop.security.authentication
  656. */
  657. public static final String HADOOP_SECURITY_AUTHENTICATION_STARTUP_STATE = "hadoop.security.authentication.startup.state";
  658. /**
  659. * com.amazonaws.services.s3.enableV4
  660. */
  661. public static final String AWS_S3_V4 = "com.amazonaws.services.s3.enableV4";
  662. /**
  663. * loginUserFromKeytab user
  664. */
  665. public static final String LOGIN_USER_KEY_TAB_USERNAME = "login.user.keytab.username";
  666. /**
  667. * loginUserFromKeytab path
  668. */
  669. public static final String LOGIN_USER_KEY_TAB_PATH = "login.user.keytab.path";
  670. /**
  671. * task log info format
  672. */
  673. public static final String TASK_LOG_INFO_FORMAT = "TaskLogInfo-%s";
  674. /**
  675. * hive conf
  676. */
  677. public static final String HIVE_CONF = "hiveconf:";
  678. /**
  679. * flink
  680. */
  681. public static final String FLINK_YARN_CLUSTER = "yarn-cluster";
  682. public static final String FLINK_RUN_MODE = "-m";
  683. public static final String FLINK_YARN_SLOT = "-ys";
  684. public static final String FLINK_APP_NAME = "-ynm";
  685. public static final String FLINK_QUEUE = "-yqu";
  686. public static final String FLINK_TASK_MANAGE = "-yn";
  687. public static final String FLINK_JOB_MANAGE_MEM = "-yjm";
  688. public static final String FLINK_TASK_MANAGE_MEM = "-ytm";
  689. public static final String FLINK_MAIN_CLASS = "-c";
  690. public static final String FLINK_PARALLELISM = "-p";
  691. public static final String FLINK_SHUTDOWN_ON_ATTACHED_EXIT = "-sae";
  692. public static final int[] NOT_TERMINATED_STATES = new int[] {
  693. ExecutionStatus.SUBMITTED_SUCCESS.ordinal(),
  694. ExecutionStatus.RUNNING_EXECUTION.ordinal(),
  695. ExecutionStatus.DELAY_EXECUTION.ordinal(),
  696. ExecutionStatus.READY_PAUSE.ordinal(),
  697. ExecutionStatus.READY_STOP.ordinal(),
  698. ExecutionStatus.NEED_FAULT_TOLERANCE.ordinal(),
  699. ExecutionStatus.WAITTING_THREAD.ordinal(),
  700. ExecutionStatus.WAITTING_DEPEND.ordinal()
  701. };
  702. /**
  703. * status
  704. */
  705. public static final String STATUS = "status";
  706. /**
  707. * message
  708. */
  709. public static final String MSG = "msg";
  710. /**
  711. * data total
  712. */
  713. public static final String COUNT = "count";
  714. /**
  715. * page size
  716. */
  717. public static final String PAGE_SIZE = "pageSize";
  718. /**
  719. * current page no
  720. */
  721. public static final String PAGE_NUMBER = "pageNo";
  722. /**
  723. *
  724. */
  725. public static final String DATA_LIST = "data";
  726. public static final String TOTAL_LIST = "totalList";
  727. public static final String CURRENT_PAGE = "currentPage";
  728. public static final String TOTAL_PAGE = "totalPage";
  729. public static final String TOTAL = "total";
  730. /**
  731. * workflow
  732. */
  733. public static final String WORKFLOW_LIST = "workFlowList";
  734. public static final String WORKFLOW_RELATION_LIST = "workFlowRelationList";
  735. /**
  736. * session user
  737. */
  738. public static final String SESSION_USER = "session.user";
  739. public static final String SESSION_ID = "sessionId";
  740. public static final String PASSWORD_DEFAULT = "******";
  741. /**
  742. * locale
  743. */
  744. public static final String LOCALE_LANGUAGE = "language";
  745. /**
  746. * driver
  747. */
  748. public static final String ORG_POSTGRESQL_DRIVER = "org.postgresql.Driver";
  749. public static final String COM_MYSQL_JDBC_DRIVER = "com.mysql.jdbc.Driver";
  750. public static final String ORG_APACHE_HIVE_JDBC_HIVE_DRIVER = "org.apache.hive.jdbc.HiveDriver";
  751. public static final String COM_CLICKHOUSE_JDBC_DRIVER = "ru.yandex.clickhouse.ClickHouseDriver";
  752. public static final String COM_ORACLE_JDBC_DRIVER = "oracle.jdbc.driver.OracleDriver";
  753. public static final String COM_SQLSERVER_JDBC_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
  754. public static final String COM_DB2_JDBC_DRIVER = "com.ibm.db2.jcc.DB2Driver";
  755. public static final String COM_PRESTO_JDBC_DRIVER = "com.facebook.presto.jdbc.PrestoDriver";
  756. /**
  757. * database type
  758. */
  759. public static final String MYSQL = "MYSQL";
  760. public static final String POSTGRESQL = "POSTGRESQL";
  761. public static final String HIVE = "HIVE";
  762. public static final String SPARK = "SPARK";
  763. public static final String CLICKHOUSE = "CLICKHOUSE";
  764. public static final String ORACLE = "ORACLE";
  765. public static final String SQLSERVER = "SQLSERVER";
  766. public static final String DB2 = "DB2";
  767. public static final String PRESTO = "PRESTO";
  768. /**
  769. * jdbc url
  770. */
  771. public static final String JDBC_MYSQL = "jdbc:mysql://";
  772. public static final String JDBC_POSTGRESQL = "jdbc:postgresql://";
  773. public static final String JDBC_HIVE_2 = "jdbc:hive2://";
  774. public static final String JDBC_CLICKHOUSE = "jdbc:clickhouse://";
  775. public static final String JDBC_ORACLE_SID = "jdbc:oracle:thin:@";
  776. public static final String JDBC_ORACLE_SERVICE_NAME = "jdbc:oracle:thin:@//";
  777. public static final String JDBC_SQLSERVER = "jdbc:sqlserver://";
  778. public static final String JDBC_DB2 = "jdbc:db2://";
  779. public static final String JDBC_PRESTO = "jdbc:presto://";
  780. public static final String ADDRESS = "address";
  781. public static final String DATABASE = "database";
  782. public static final String JDBC_URL = "jdbcUrl";
  783. public static final String PRINCIPAL = "principal";
  784. public static final String OTHER = "other";
  785. public static final String ORACLE_DB_CONNECT_TYPE = "connectType";
  786. public static final String KERBEROS_KRB5_CONF_PATH = "javaSecurityKrb5Conf";
  787. public static final String KERBEROS_KEY_TAB_USERNAME = "loginUserKeytabUsername";
  788. public static final String KERBEROS_KEY_TAB_PATH = "loginUserKeytabPath";
  789. /**
  790. * session timeout
  791. */
  792. public static final int SESSION_TIME_OUT = 7200;
  793. public static final int MAX_FILE_SIZE = 1024 * 1024 * 1024;
  794. public static final String UDF = "UDF";
  795. public static final String CLASS = "class";
  796. public static final String RECEIVERS = "receivers";
  797. public static final String RECEIVERS_CC = "receiversCc";
  798. /**
  799. * dataSource sensitive param
  800. */
  801. public static final String DATASOURCE_PASSWORD_REGEX = "(?<=(\"password\":\")).*?(?=(\"))";
  802. /**
  803. * default worker group
  804. */
  805. public static final String DEFAULT_WORKER_GROUP = "default";
  806. public static final Integer TASK_INFO_LENGTH = 5;
  807. /**
  808. * new
  809. * schedule time
  810. */
  811. public static final String PARAMETER_SHECDULE_TIME = "schedule.time";
  812. /**
  813. * authorize writable perm
  814. */
  815. public static final int AUTHORIZE_WRITABLE_PERM = 7;
  816. /**
  817. * authorize readable perm
  818. */
  819. public static final int AUTHORIZE_READABLE_PERM = 4;
  820. /**
  821. * plugin configurations
  822. */
  823. public static final String PLUGIN_JAR_SUFFIX = ".jar";
  824. public static final int NORMAL_NODE_STATUS = 0;
  825. public static final int ABNORMAL_NODE_STATUS = 1;
  826. public static final String START_TIME = "start time";
  827. public static final String END_TIME = "end time";
  828. public static final String START_END_DATE = "startDate,endDate";
  829. /**
  830. * system line separator
  831. */
  832. public static final String SYSTEM_LINE_SEPARATOR = System.getProperty("line.separator");
  833. public static final String EXCEL_SUFFIX_XLS = ".xls";
  834. /**
  835. * datasource encryption salt
  836. */
  837. public static final String DATASOURCE_ENCRYPTION_SALT_DEFAULT = "!@#$%^&*";
  838. public static final String DATASOURCE_ENCRYPTION_ENABLE = "datasource.encryption.enable";
  839. public static final String DATASOURCE_ENCRYPTION_SALT = "datasource.encryption.salt";
  840. /**
  841. * network interface preferred
  842. */
  843. public static final String DOLPHIN_SCHEDULER_NETWORK_INTERFACE_PREFERRED = "dolphin.scheduler.network.interface.preferred";
  844. /**
  845. * network IP gets priority, default inner outer
  846. */
  847. public static final String DOLPHIN_SCHEDULER_NETWORK_PRIORITY_STRATEGY = "dolphin.scheduler.network.priority.strategy";
  848. /**
  849. * exec shell scripts
  850. */
  851. public static final String SH = "sh";
  852. /**
  853. * pstree, get pud and sub pid
  854. */
  855. public static final String PSTREE = "pstree";
  856. /**
  857. * snow flake, data center id, this id must be greater than 0 and less than 32
  858. */
  859. public static final String SNOW_FLAKE_DATA_CENTER_ID = "data.center.id";
  860. /**
  861. * docker & kubernetes
  862. */
  863. public static final boolean DOCKER_MODE = StringUtils.isNotEmpty(System.getenv("DOCKER"));
  864. public static final boolean KUBERNETES_MODE = StringUtils.isNotEmpty(System.getenv("KUBERNETES_SERVICE_HOST")) && StringUtils.isNotEmpty(System.getenv("KUBERNETES_SERVICE_PORT"));
  865. }