Constants.java 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936
  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 java.util.regex.Pattern;
  21. /**
  22. * Constants
  23. */
  24. public final class Constants {
  25. private Constants() {
  26. throw new IllegalStateException("Constants class");
  27. }
  28. /**
  29. * quartz config
  30. */
  31. public static final String ORG_QUARTZ_JOBSTORE_DRIVERDELEGATECLASS = "org.quartz.jobStore.driverDelegateClass";
  32. public static final String ORG_QUARTZ_SCHEDULER_INSTANCENAME = "org.quartz.scheduler.instanceName";
  33. public static final String ORG_QUARTZ_SCHEDULER_INSTANCEID = "org.quartz.scheduler.instanceId";
  34. public static final String ORG_QUARTZ_SCHEDULER_MAKESCHEDULERTHREADDAEMON = "org.quartz.scheduler.makeSchedulerThreadDaemon";
  35. public static final String ORG_QUARTZ_JOBSTORE_USEPROPERTIES = "org.quartz.jobStore.useProperties";
  36. public static final String ORG_QUARTZ_THREADPOOL_CLASS = "org.quartz.threadPool.class";
  37. public static final String ORG_QUARTZ_THREADPOOL_THREADCOUNT = "org.quartz.threadPool.threadCount";
  38. public static final String ORG_QUARTZ_THREADPOOL_MAKETHREADSDAEMONS = "org.quartz.threadPool.makeThreadsDaemons";
  39. public static final String ORG_QUARTZ_THREADPOOL_THREADPRIORITY = "org.quartz.threadPool.threadPriority";
  40. public static final String ORG_QUARTZ_JOBSTORE_CLASS = "org.quartz.jobStore.class";
  41. public static final String ORG_QUARTZ_JOBSTORE_TABLEPREFIX = "org.quartz.jobStore.tablePrefix";
  42. public static final String ORG_QUARTZ_JOBSTORE_ISCLUSTERED = "org.quartz.jobStore.isClustered";
  43. public static final String ORG_QUARTZ_JOBSTORE_MISFIRETHRESHOLD = "org.quartz.jobStore.misfireThreshold";
  44. public static final String ORG_QUARTZ_JOBSTORE_CLUSTERCHECKININTERVAL = "org.quartz.jobStore.clusterCheckinInterval";
  45. public static final String ORG_QUARTZ_JOBSTORE_ACQUIRETRIGGERSWITHINLOCK = "org.quartz.jobStore.acquireTriggersWithinLock";
  46. public static final String ORG_QUARTZ_JOBSTORE_DATASOURCE = "org.quartz.jobStore.dataSource";
  47. public static final String ORG_QUARTZ_DATASOURCE_MYDS_CONNECTIONPROVIDER_CLASS = "org.quartz.dataSource.myDs.connectionProvider.class";
  48. /**
  49. * quartz config default value
  50. */
  51. public static final String QUARTZ_TABLE_PREFIX = "QRTZ_";
  52. public static final String QUARTZ_MISFIRETHRESHOLD = "60000";
  53. public static final String QUARTZ_CLUSTERCHECKININTERVAL = "5000";
  54. public static final String QUARTZ_DATASOURCE = "myDs";
  55. public static final String QUARTZ_THREADCOUNT = "25";
  56. public static final String QUARTZ_THREADPRIORITY = "5";
  57. public static final String QUARTZ_INSTANCENAME = "DolphinScheduler";
  58. public static final String QUARTZ_INSTANCEID = "AUTO";
  59. public static final String QUARTZ_ACQUIRETRIGGERSWITHINLOCK = "true";
  60. /**
  61. * common properties path
  62. */
  63. public static final String COMMON_PROPERTIES_PATH = "/common.properties";
  64. /**
  65. * fs.defaultFS
  66. */
  67. public static final String FS_DEFAULTFS = "fs.defaultFS";
  68. /**
  69. * fs s3a endpoint
  70. */
  71. public static final String FS_S3A_ENDPOINT = "fs.s3a.endpoint";
  72. /**
  73. * fs s3a access key
  74. */
  75. public static final String FS_S3A_ACCESS_KEY = "fs.s3a.access.key";
  76. /**
  77. * fs s3a secret key
  78. */
  79. public static final String FS_S3A_SECRET_KEY = "fs.s3a.secret.key";
  80. /**
  81. * yarn.resourcemanager.ha.rm.ids
  82. */
  83. public static final String YARN_RESOURCEMANAGER_HA_RM_IDS = "yarn.resourcemanager.ha.rm.ids";
  84. public static final String YARN_RESOURCEMANAGER_HA_XX = "xx";
  85. /**
  86. * yarn.application.status.address
  87. */
  88. public static final String YARN_APPLICATION_STATUS_ADDRESS = "yarn.application.status.address";
  89. /**
  90. * hdfs configuration
  91. * hdfs.root.user
  92. */
  93. public static final String HDFS_ROOT_USER = "hdfs.root.user";
  94. /**
  95. * hdfs/s3 configuration
  96. * resource.upload.path
  97. */
  98. public static final String RESOURCE_UPLOAD_PATH = "resource.upload.path";
  99. /**
  100. * data basedir path
  101. */
  102. public static final String DATA_BASEDIR_PATH = "data.basedir.path";
  103. /**
  104. * dolphinscheduler.env.path
  105. */
  106. public static final String DOLPHINSCHEDULER_ENV_PATH = "dolphinscheduler.env.path";
  107. /**
  108. * environment properties default path
  109. */
  110. public static final String ENV_PATH = "env/dolphinscheduler_env.sh";
  111. /**
  112. * python home
  113. */
  114. public static final String PYTHON_HOME="PYTHON_HOME";
  115. /**
  116. * resource.view.suffixs
  117. */
  118. public static final String RESOURCE_VIEW_SUFFIXS = "resource.view.suffixs";
  119. public static final String RESOURCE_VIEW_SUFFIXS_DEFAULT_VALUE = "txt,log,sh,conf,cfg,py,java,sql,hql,xml,properties";
  120. /**
  121. * development.state
  122. */
  123. public static final String DEVELOPMENT_STATE = "development.state";
  124. public static final String DEVELOPMENT_STATE_DEFAULT_VALUE = "true";
  125. /**
  126. * string true
  127. */
  128. public static final String STRING_TRUE = "true";
  129. /**
  130. * string true
  131. */
  132. public static final String STRING_FALSE = "false";
  133. /**
  134. * resource storage type
  135. */
  136. public static final String RESOURCE_STORAGE_TYPE = "resource.storage.type";
  137. /**
  138. * MasterServer directory registered in zookeeper
  139. */
  140. public static final String ZOOKEEPER_DOLPHINSCHEDULER_MASTERS = "/nodes/master";
  141. /**
  142. * WorkerServer directory registered in zookeeper
  143. */
  144. public static final String ZOOKEEPER_DOLPHINSCHEDULER_WORKERS = "/nodes/worker";
  145. /**
  146. * all servers directory registered in zookeeper
  147. */
  148. public static final String ZOOKEEPER_DOLPHINSCHEDULER_DEAD_SERVERS = "/dead-servers";
  149. /**
  150. * MasterServer lock directory registered in zookeeper
  151. */
  152. public static final String ZOOKEEPER_DOLPHINSCHEDULER_LOCK_MASTERS = "/lock/masters";
  153. /**
  154. * MasterServer failover directory registered in zookeeper
  155. */
  156. public static final String ZOOKEEPER_DOLPHINSCHEDULER_LOCK_FAILOVER_MASTERS = "/lock/failover/masters";
  157. /**
  158. * WorkerServer failover directory registered in zookeeper
  159. */
  160. public static final String ZOOKEEPER_DOLPHINSCHEDULER_LOCK_FAILOVER_WORKERS = "/lock/failover/workers";
  161. /**
  162. * MasterServer startup failover runing and fault tolerance process
  163. */
  164. public static final String ZOOKEEPER_DOLPHINSCHEDULER_LOCK_FAILOVER_STARTUP_MASTERS = "/lock/failover/startup-masters";
  165. /**
  166. * comma ,
  167. */
  168. public static final String COMMA = ",";
  169. /**
  170. * slash /
  171. */
  172. public static final String SLASH = "/";
  173. /**
  174. * COLON :
  175. */
  176. public static final String COLON = ":";
  177. /**
  178. * SINGLE_SLASH /
  179. */
  180. public static final String SINGLE_SLASH = "/";
  181. /**
  182. * DOUBLE_SLASH //
  183. */
  184. public static final String DOUBLE_SLASH = "//";
  185. /**
  186. * SEMICOLON ;
  187. */
  188. public static final String SEMICOLON = ";";
  189. /**
  190. * EQUAL SIGN
  191. */
  192. public static final String EQUAL_SIGN = "=";
  193. public static final String WORKER_MAX_CPULOAD_AVG = "worker.max.cpuload.avg";
  194. public static final String WORKER_RESERVED_MEMORY = "worker.reserved.memory";
  195. public static final String MASTER_MAX_CPULOAD_AVG = "master.max.cpuload.avg";
  196. public static final String MASTER_RESERVED_MEMORY = "master.reserved.memory";
  197. /**
  198. * date format of yyyy-MM-dd HH:mm:ss
  199. */
  200. public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
  201. /**
  202. * date format of yyyyMMddHHmmss
  203. */
  204. public static final String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
  205. /**
  206. * http connect time out
  207. */
  208. public static final int HTTP_CONNECT_TIMEOUT = 60 * 1000;
  209. /**
  210. * http connect request time out
  211. */
  212. public static final int HTTP_CONNECTION_REQUEST_TIMEOUT = 60 * 1000;
  213. /**
  214. * httpclient soceket time out
  215. */
  216. public static final int SOCKET_TIMEOUT = 60 * 1000;
  217. /**
  218. * http header
  219. */
  220. public static final String HTTP_HEADER_UNKNOWN = "unKnown";
  221. /**
  222. * http X-Forwarded-For
  223. */
  224. public static final String HTTP_X_FORWARDED_FOR = "X-Forwarded-For";
  225. /**
  226. * http X-Real-IP
  227. */
  228. public static final String HTTP_X_REAL_IP = "X-Real-IP";
  229. /**
  230. * UTF-8
  231. */
  232. public static final String UTF_8 = "UTF-8";
  233. /**
  234. * user name regex
  235. */
  236. public static final Pattern REGEX_USER_NAME = Pattern.compile("^[a-zA-Z0-9._-]{3,20}$");
  237. /**
  238. * email regex
  239. */
  240. 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,}$");
  241. /**
  242. * read permission
  243. */
  244. public static final int READ_PERMISSION = 2 * 1;
  245. /**
  246. * write permission
  247. */
  248. public static final int WRITE_PERMISSION = 2 * 2;
  249. /**
  250. * execute permission
  251. */
  252. public static final int EXECUTE_PERMISSION = 1;
  253. /**
  254. * default admin permission
  255. */
  256. public static final int DEFAULT_ADMIN_PERMISSION = 7;
  257. /**
  258. * all permissions
  259. */
  260. public static final int ALL_PERMISSIONS = READ_PERMISSION | WRITE_PERMISSION | EXECUTE_PERMISSION;
  261. /**
  262. * max task timeout
  263. */
  264. public static final int MAX_TASK_TIMEOUT = 24 * 3600;
  265. /**
  266. * master cpu load
  267. */
  268. public static final int DEFAULT_MASTER_CPU_LOAD = Runtime.getRuntime().availableProcessors() * 2;
  269. /**
  270. * master reserved memory
  271. */
  272. public static final double DEFAULT_MASTER_RESERVED_MEMORY = OSUtils.totalMemorySize() / 10;
  273. /**
  274. * worker cpu load
  275. */
  276. public static final int DEFAULT_WORKER_CPU_LOAD = Runtime.getRuntime().availableProcessors() * 2;
  277. /**
  278. * worker reserved memory
  279. */
  280. public static final double DEFAULT_WORKER_RESERVED_MEMORY = OSUtils.totalMemorySize() / 10;
  281. /**
  282. * default log cache rows num,output when reach the number
  283. */
  284. public static final int DEFAULT_LOG_ROWS_NUM = 4 * 16;
  285. /**
  286. * log flush interval?output when reach the interval
  287. */
  288. public static final int DEFAULT_LOG_FLUSH_INTERVAL = 1000;
  289. /**
  290. * time unit secong to minutes
  291. */
  292. public static final int SEC_2_MINUTES_TIME_UNIT = 60;
  293. /***
  294. *
  295. * rpc port
  296. */
  297. public static final int RPC_PORT = 50051;
  298. /**
  299. * forbid running task
  300. */
  301. public static final String FLOWNODE_RUN_FLAG_FORBIDDEN = "FORBIDDEN";
  302. /**
  303. * datasource configuration path
  304. */
  305. public static final String DATASOURCE_PROPERTIES = "/datasource.properties";
  306. public static final String TASK_RECORD_URL = "task.record.datasource.url";
  307. public static final String TASK_RECORD_FLAG = "task.record.flag";
  308. public static final String TASK_RECORD_USER = "task.record.datasource.username";
  309. public static final String TASK_RECORD_PWD = "task.record.datasource.password";
  310. public static final String DEFAULT = "Default";
  311. public static final String USER = "user";
  312. public static final String PASSWORD = "password";
  313. public static final String XXXXXX = "******";
  314. public static final String NULL = "NULL";
  315. public static final String THREAD_NAME_MASTER_SERVER = "Master-Server";
  316. public static final String THREAD_NAME_WORKER_SERVER = "Worker-Server";
  317. public static final String TASK_RECORD_TABLE_HIVE_LOG = "eamp_hive_log_hd";
  318. public static final String TASK_RECORD_TABLE_HISTORY_HIVE_LOG = "eamp_hive_hist_log_hd";
  319. /**
  320. * command parameter keys
  321. */
  322. public static final String CMDPARAM_RECOVER_PROCESS_ID_STRING = "ProcessInstanceId";
  323. public static final String CMDPARAM_RECOVERY_START_NODE_STRING = "StartNodeIdList";
  324. public static final String CMDPARAM_RECOVERY_WAITTING_THREAD = "WaittingThreadInstanceId";
  325. public static final String CMDPARAM_SUB_PROCESS = "processInstanceId";
  326. public static final String CMDPARAM_EMPTY_SUB_PROCESS = "0";
  327. public static final String CMDPARAM_SUB_PROCESS_PARENT_INSTANCE_ID = "parentProcessInstanceId";
  328. public static final String CMDPARAM_SUB_PROCESS_DEFINE_ID = "processDefinitionId";
  329. public static final String CMDPARAM_START_NODE_NAMES = "StartNodeNameList";
  330. /**
  331. * complement data start date
  332. */
  333. public static final String CMDPARAM_COMPLEMENT_DATA_START_DATE = "complementStartDate";
  334. /**
  335. * complement data end date
  336. */
  337. public static final String CMDPARAM_COMPLEMENT_DATA_END_DATE = "complementEndDate";
  338. /**
  339. * hadoop configuration
  340. */
  341. public static final String HADOOP_RM_STATE_ACTIVE = "ACTIVE";
  342. public static final String HADOOP_RM_STATE_STANDBY = "STANDBY";
  343. public static final String HADOOP_RESOURCE_MANAGER_HTTPADDRESS_PORT = "resource.manager.httpaddress.port";
  344. /**
  345. * data source config
  346. */
  347. public static final String SPRING_DATASOURCE_DRIVER_CLASS_NAME = "spring.datasource.driver-class-name";
  348. public static final String SPRING_DATASOURCE_URL = "spring.datasource.url";
  349. public static final String SPRING_DATASOURCE_USERNAME = "spring.datasource.username";
  350. public static final String SPRING_DATASOURCE_PASSWORD = "spring.datasource.password";
  351. public static final String SPRING_DATASOURCE_VALIDATION_QUERY_TIMEOUT = "spring.datasource.validationQueryTimeout";
  352. public static final String SPRING_DATASOURCE_INITIAL_SIZE = "spring.datasource.initialSize";
  353. public static final String SPRING_DATASOURCE_MIN_IDLE = "spring.datasource.minIdle";
  354. public static final String SPRING_DATASOURCE_MAX_ACTIVE = "spring.datasource.maxActive";
  355. public static final String SPRING_DATASOURCE_MAX_WAIT = "spring.datasource.maxWait";
  356. public static final String SPRING_DATASOURCE_TIME_BETWEEN_EVICTION_RUNS_MILLIS = "spring.datasource.timeBetweenEvictionRunsMillis";
  357. public static final String SPRING_DATASOURCE_TIME_BETWEEN_CONNECT_ERROR_MILLIS = "spring.datasource.timeBetweenConnectErrorMillis";
  358. public static final String SPRING_DATASOURCE_MIN_EVICTABLE_IDLE_TIME_MILLIS = "spring.datasource.minEvictableIdleTimeMillis";
  359. public static final String SPRING_DATASOURCE_VALIDATION_QUERY = "spring.datasource.validationQuery";
  360. public static final String SPRING_DATASOURCE_TEST_WHILE_IDLE = "spring.datasource.testWhileIdle";
  361. public static final String SPRING_DATASOURCE_TEST_ON_BORROW = "spring.datasource.testOnBorrow";
  362. public static final String SPRING_DATASOURCE_TEST_ON_RETURN = "spring.datasource.testOnReturn";
  363. public static final String SPRING_DATASOURCE_POOL_PREPARED_STATEMENTS = "spring.datasource.poolPreparedStatements";
  364. public static final String SPRING_DATASOURCE_DEFAULT_AUTO_COMMIT = "spring.datasource.defaultAutoCommit";
  365. public static final String SPRING_DATASOURCE_KEEP_ALIVE = "spring.datasource.keepAlive";
  366. public static final String SPRING_DATASOURCE_MAX_POOL_PREPARED_STATEMENT_PER_CONNECTION_SIZE = "spring.datasource.maxPoolPreparedStatementPerConnectionSize";
  367. public static final String DEVELOPMENT = "development";
  368. public static final String QUARTZ_PROPERTIES_PATH = "quartz.properties";
  369. /**
  370. * sleep time
  371. */
  372. public static final int SLEEP_TIME_MILLIS = 1000;
  373. /**
  374. * heartbeat for zk info length
  375. */
  376. public static final int HEARTBEAT_FOR_ZOOKEEPER_INFO_LENGTH = 5;
  377. /**
  378. * hadoop params constant
  379. */
  380. /**
  381. * jar
  382. */
  383. public static final String JAR = "jar";
  384. /**
  385. * hadoop
  386. */
  387. public static final String HADOOP = "hadoop";
  388. /**
  389. * -D parameter
  390. */
  391. public static final String D = "-D";
  392. /**
  393. * -D mapreduce.job.queuename=ququename
  394. */
  395. public static final String MR_QUEUE = "mapreduce.job.queuename";
  396. /**
  397. * spark params constant
  398. */
  399. public static final String MASTER = "--master";
  400. public static final String DEPLOY_MODE = "--deploy-mode";
  401. /**
  402. * --class CLASS_NAME
  403. */
  404. public static final String MAIN_CLASS = "--class";
  405. /**
  406. * --driver-cores NUM
  407. */
  408. public static final String DRIVER_CORES = "--driver-cores";
  409. /**
  410. * --driver-memory MEM
  411. */
  412. public static final String DRIVER_MEMORY = "--driver-memory";
  413. /**
  414. * --num-executors NUM
  415. */
  416. public static final String NUM_EXECUTORS = "--num-executors";
  417. /**
  418. * --executor-cores NUM
  419. */
  420. public static final String EXECUTOR_CORES = "--executor-cores";
  421. /**
  422. * --executor-memory MEM
  423. */
  424. public static final String EXECUTOR_MEMORY = "--executor-memory";
  425. /**
  426. * --queue QUEUE
  427. */
  428. public static final String SPARK_QUEUE = "--queue";
  429. /**
  430. * --queue --qu
  431. */
  432. public static final String FLINK_QUEUE = "--qu";
  433. /**
  434. * exit code success
  435. */
  436. public static final int EXIT_CODE_SUCCESS = 0;
  437. /**
  438. * exit code kill
  439. */
  440. public static final int EXIT_CODE_KILL = 137;
  441. /**
  442. * exit code failure
  443. */
  444. public static final int EXIT_CODE_FAILURE = -1;
  445. /**
  446. * date format of yyyyMMdd
  447. */
  448. public static final String PARAMETER_FORMAT_DATE = "yyyyMMdd";
  449. /**
  450. * date format of yyyyMMddHHmmss
  451. */
  452. public static final String PARAMETER_FORMAT_TIME = "yyyyMMddHHmmss";
  453. /**
  454. * system date(yyyyMMddHHmmss)
  455. */
  456. public static final String PARAMETER_DATETIME = "system.datetime";
  457. /**
  458. * system date(yyyymmdd) today
  459. */
  460. public static final String PARAMETER_CURRENT_DATE = "system.biz.curdate";
  461. /**
  462. * system date(yyyymmdd) yesterday
  463. */
  464. public static final String PARAMETER_BUSINESS_DATE = "system.biz.date";
  465. /**
  466. * ACCEPTED
  467. */
  468. public static final String ACCEPTED = "ACCEPTED";
  469. /**
  470. * SUCCEEDED
  471. */
  472. public static final String SUCCEEDED = "SUCCEEDED";
  473. /**
  474. * NEW
  475. */
  476. public static final String NEW = "NEW";
  477. /**
  478. * NEW_SAVING
  479. */
  480. public static final String NEW_SAVING = "NEW_SAVING";
  481. /**
  482. * SUBMITTED
  483. */
  484. public static final String SUBMITTED = "SUBMITTED";
  485. /**
  486. * FAILED
  487. */
  488. public static final String FAILED = "FAILED";
  489. /**
  490. * KILLED
  491. */
  492. public static final String KILLED = "KILLED";
  493. /**
  494. * RUNNING
  495. */
  496. public static final String RUNNING = "RUNNING";
  497. /**
  498. * underline "_"
  499. */
  500. public static final String UNDERLINE = "_";
  501. /**
  502. * quartz job prifix
  503. */
  504. public static final String QUARTZ_JOB_PRIFIX = "job";
  505. /**
  506. * quartz job group prifix
  507. */
  508. public static final String QUARTZ_JOB_GROUP_PRIFIX = "jobgroup";
  509. /**
  510. * projectId
  511. */
  512. public static final String PROJECT_ID = "projectId";
  513. /**
  514. * processId
  515. */
  516. public static final String SCHEDULE_ID = "scheduleId";
  517. /**
  518. * schedule
  519. */
  520. public static final String SCHEDULE = "schedule";
  521. /**
  522. * application regex
  523. */
  524. public static final String APPLICATION_REGEX = "application_\\d+_\\d+";
  525. public static final String PID = "pid";
  526. /**
  527. * month_begin
  528. */
  529. public static final String MONTH_BEGIN = "month_begin";
  530. /**
  531. * add_months
  532. */
  533. public static final String ADD_MONTHS = "add_months";
  534. /**
  535. * month_end
  536. */
  537. public static final String MONTH_END = "month_end";
  538. /**
  539. * week_begin
  540. */
  541. public static final String WEEK_BEGIN = "week_begin";
  542. /**
  543. * week_end
  544. */
  545. public static final String WEEK_END = "week_end";
  546. /**
  547. * timestamp
  548. */
  549. public static final String TIMESTAMP = "timestamp";
  550. public static final char SUBTRACT_CHAR = '-';
  551. public static final char ADD_CHAR = '+';
  552. public static final char MULTIPLY_CHAR = '*';
  553. public static final char DIVISION_CHAR = '/';
  554. public static final char LEFT_BRACE_CHAR = '(';
  555. public static final char RIGHT_BRACE_CHAR = ')';
  556. public static final String ADD_STRING = "+";
  557. public static final String MULTIPLY_STRING = "*";
  558. public static final String DIVISION_STRING = "/";
  559. public static final String LEFT_BRACE_STRING = "(";
  560. public static final char P = 'P';
  561. public static final char N = 'N';
  562. public static final String SUBTRACT_STRING = "-";
  563. public static final String GLOBAL_PARAMS = "globalParams";
  564. public static final String LOCAL_PARAMS = "localParams";
  565. public static final String PROCESS_INSTANCE_STATE = "processInstanceState";
  566. public static final String TASK_LIST = "taskList";
  567. public static final String RWXR_XR_X = "rwxr-xr-x";
  568. /**
  569. * master/worker server use for zk
  570. */
  571. public static final String MASTER_PREFIX = "master";
  572. public static final String WORKER_PREFIX = "worker";
  573. public static final String DELETE_ZK_OP = "delete";
  574. public static final String ADD_ZK_OP = "add";
  575. public static final String ALIAS = "alias";
  576. public static final String CONTENT = "content";
  577. public static final String DEPENDENT_SPLIT = ":||";
  578. /**
  579. * preview schedule execute count
  580. */
  581. public static final int PREVIEW_SCHEDULE_EXECUTE_COUNT = 5;
  582. /**
  583. * kerberos
  584. */
  585. public static final String KERBEROS = "kerberos";
  586. /**
  587. * java.security.krb5.conf
  588. */
  589. public static final String JAVA_SECURITY_KRB5_CONF = "java.security.krb5.conf";
  590. /**
  591. * java.security.krb5.conf.path
  592. */
  593. public static final String JAVA_SECURITY_KRB5_CONF_PATH = "java.security.krb5.conf.path";
  594. /**
  595. * hadoop.security.authentication
  596. */
  597. public static final String HADOOP_SECURITY_AUTHENTICATION = "hadoop.security.authentication";
  598. /**
  599. * hadoop.security.authentication
  600. */
  601. public static final String HADOOP_SECURITY_AUTHENTICATION_STARTUP_STATE = "hadoop.security.authentication.startup.state";
  602. /**
  603. * loginUserFromKeytab user
  604. */
  605. public static final String LOGIN_USER_KEY_TAB_USERNAME = "login.user.keytab.username";
  606. /**
  607. * default worker group id
  608. */
  609. public static final int DEFAULT_WORKER_ID = -1;
  610. /**
  611. * loginUserFromKeytab path
  612. */
  613. public static final String LOGIN_USER_KEY_TAB_PATH = "login.user.keytab.path";
  614. /**
  615. * task log info format
  616. */
  617. public static final String TASK_LOG_INFO_FORMAT = "TaskLogInfo-%s";
  618. /**
  619. * hive conf
  620. */
  621. public static final String HIVE_CONF = "hiveconf:";
  622. //flink ??
  623. public static final String FLINK_YARN_CLUSTER = "yarn-cluster";
  624. public static final String FLINK_RUN_MODE = "-m";
  625. public static final String FLINK_YARN_SLOT = "-ys";
  626. public static final String FLINK_APP_NAME = "-ynm";
  627. public static final String FLINK_TASK_MANAGE = "-yn";
  628. public static final String FLINK_JOB_MANAGE_MEM = "-yjm";
  629. public static final String FLINK_TASK_MANAGE_MEM = "-ytm";
  630. public static final String FLINK_DETACH = "-d";
  631. public static final String FLINK_MAIN_CLASS = "-c";
  632. public static final int[] NOT_TERMINATED_STATES = new int[]{
  633. ExecutionStatus.SUBMITTED_SUCCESS.ordinal(),
  634. ExecutionStatus.RUNNING_EXEUTION.ordinal(),
  635. ExecutionStatus.READY_PAUSE.ordinal(),
  636. ExecutionStatus.READY_STOP.ordinal(),
  637. ExecutionStatus.NEED_FAULT_TOLERANCE.ordinal(),
  638. ExecutionStatus.WAITTING_THREAD.ordinal(),
  639. ExecutionStatus.WAITTING_DEPEND.ordinal()
  640. };
  641. /**
  642. * status
  643. */
  644. public static final String STATUS = "status";
  645. /**
  646. * message
  647. */
  648. public static final String MSG = "msg";
  649. /**
  650. * data total
  651. */
  652. public static final String COUNT = "count";
  653. /**
  654. * page size
  655. */
  656. public static final String PAGE_SIZE = "pageSize";
  657. /**
  658. * current page no
  659. */
  660. public static final String PAGE_NUMBER = "pageNo";
  661. /**
  662. *
  663. */
  664. public static final String DATA_LIST = "data";
  665. public static final String TOTAL_LIST = "totalList";
  666. public static final String CURRENT_PAGE = "currentPage";
  667. public static final String TOTAL_PAGE = "totalPage";
  668. public static final String TOTAL = "total";
  669. /**
  670. * session user
  671. */
  672. public static final String SESSION_USER = "session.user";
  673. public static final String SESSION_ID = "sessionId";
  674. public static final String PASSWORD_DEFAULT = "******";
  675. /**
  676. * driver
  677. */
  678. public static final String ORG_POSTGRESQL_DRIVER = "org.postgresql.Driver";
  679. public static final String COM_MYSQL_JDBC_DRIVER = "com.mysql.jdbc.Driver";
  680. public static final String ORG_APACHE_HIVE_JDBC_HIVE_DRIVER = "org.apache.hive.jdbc.HiveDriver";
  681. public static final String COM_CLICKHOUSE_JDBC_DRIVER = "ru.yandex.clickhouse.ClickHouseDriver";
  682. public static final String COM_ORACLE_JDBC_DRIVER = "oracle.jdbc.driver.OracleDriver";
  683. public static final String COM_SQLSERVER_JDBC_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
  684. public static final String COM_DB2_JDBC_DRIVER = "com.ibm.db2.jcc.DB2Driver";
  685. /**
  686. * database type
  687. */
  688. public static final String MYSQL = "MYSQL";
  689. public static final String POSTGRESQL = "POSTGRESQL";
  690. public static final String HIVE = "HIVE";
  691. public static final String SPARK = "SPARK";
  692. public static final String CLICKHOUSE = "CLICKHOUSE";
  693. public static final String ORACLE = "ORACLE";
  694. public static final String SQLSERVER = "SQLSERVER";
  695. public static final String DB2 = "DB2";
  696. /**
  697. * jdbc url
  698. */
  699. public static final String JDBC_MYSQL = "jdbc:mysql://";
  700. public static final String JDBC_POSTGRESQL = "jdbc:postgresql://";
  701. public static final String JDBC_HIVE_2 = "jdbc:hive2://";
  702. public static final String JDBC_CLICKHOUSE = "jdbc:clickhouse://";
  703. public static final String JDBC_ORACLE = "jdbc:oracle:thin:@//";
  704. public static final String JDBC_SQLSERVER = "jdbc:sqlserver://";
  705. public static final String JDBC_DB2 = "jdbc:db2://";
  706. public static final String ADDRESS = "address";
  707. public static final String DATABASE = "database";
  708. public static final String JDBC_URL = "jdbcUrl";
  709. public static final String PRINCIPAL = "principal";
  710. public static final String OTHER = "other";
  711. /**
  712. * session timeout
  713. */
  714. public static final int SESSION_TIME_OUT = 7200;
  715. public static final int MAX_FILE_SIZE = 1024 * 1024 * 1024;
  716. public static final String UDF = "UDF";
  717. public static final String CLASS = "class";
  718. public static final String RECEIVERS = "receivers";
  719. public static final String RECEIVERS_CC = "receiversCc";
  720. /**
  721. * dataSource sensitive param
  722. */
  723. public static final String DATASOURCE_PASSWORD_REGEX = "(?<=(\"password\":\")).*?(?=(\"))";
  724. /**
  725. * default worker group
  726. */
  727. public static final String DEFAULT_WORKER_GROUP = "default";
  728. public static final Integer TASK_INFO_LENGTH = 5;
  729. }