Constants.java 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831
  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.plugin.task.api.enums.ExecutionStatus;
  19. import org.apache.commons.lang.StringUtils;
  20. import org.apache.commons.lang.SystemUtils;
  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. * common properties path
  31. */
  32. public static final String COMMON_PROPERTIES_PATH = "/common.properties";
  33. /**
  34. * registry properties
  35. */
  36. public static final String REGISTRY_DOLPHINSCHEDULER_MASTERS = "/nodes/master";
  37. public static final String REGISTRY_DOLPHINSCHEDULER_WORKERS = "/nodes/worker";
  38. public static final String REGISTRY_DOLPHINSCHEDULER_DEAD_SERVERS = "/dead-servers";
  39. public static final String REGISTRY_DOLPHINSCHEDULER_NODE = "/nodes";
  40. public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_MASTERS = "/lock/masters";
  41. public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_MASTERS = "/lock/failover/masters";
  42. public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_WORKERS = "/lock/failover/workers";
  43. public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_STARTUP_MASTERS = "/lock/failover/startup-masters";
  44. public static final String FORMAT_SS = "%s%s";
  45. public static final String FORMAT_S_S = "%s/%s";
  46. public static final String AWS_ACCESS_KEY_ID = "aws.access.key.id";
  47. public static final String AWS_SECRET_ACCESS_KEY = "aws.secret.access.key";
  48. public static final String AWS_REGION = "aws.region";
  49. public static final String FOLDER_SEPARATOR = "/";
  50. public static final String RESOURCE_TYPE_FILE = "resources";
  51. public static final String RESOURCE_TYPE_UDF = "udfs";
  52. public static final String STORAGE_S3 = "S3";
  53. public static final String STORAGE_HDFS = "HDFS";
  54. public static final String BUCKET_NAME = "dolphinscheduler-test";
  55. /**
  56. * fs.defaultFS
  57. */
  58. public static final String FS_DEFAULT_FS = "fs.defaultFS";
  59. /**
  60. * hadoop configuration
  61. */
  62. public static final String HADOOP_RM_STATE_ACTIVE = "ACTIVE";
  63. public static final String HADOOP_RESOURCE_MANAGER_HTTPADDRESS_PORT = "resource.manager.httpaddress.port";
  64. /**
  65. * yarn.resourcemanager.ha.rm.ids
  66. */
  67. public static final String YARN_RESOURCEMANAGER_HA_RM_IDS = "yarn.resourcemanager.ha.rm.ids";
  68. /**
  69. * yarn.application.status.address
  70. */
  71. public static final String YARN_APPLICATION_STATUS_ADDRESS = "yarn.application.status.address";
  72. /**
  73. * yarn.job.history.status.address
  74. */
  75. public static final String YARN_JOB_HISTORY_STATUS_ADDRESS = "yarn.job.history.status.address";
  76. /**
  77. * hdfs configuration
  78. * hdfs.root.user
  79. */
  80. public static final String HDFS_ROOT_USER = "hdfs.root.user";
  81. /**
  82. * hdfs/s3 configuration
  83. * resource.upload.path
  84. */
  85. public static final String RESOURCE_UPLOAD_PATH = "resource.upload.path";
  86. /**
  87. * data basedir path
  88. */
  89. public static final String DATA_BASEDIR_PATH = "data.basedir.path";
  90. /**
  91. * dolphinscheduler.env.path
  92. */
  93. public static final String DOLPHINSCHEDULER_ENV_PATH = "dolphinscheduler.env.path";
  94. /**
  95. * environment properties default path
  96. */
  97. public static final String ENV_PATH = "dolphinscheduler_env.sh";
  98. /**
  99. * resource.view.suffixs
  100. */
  101. public static final String RESOURCE_VIEW_SUFFIXES = "resource.view.suffixs";
  102. public static final String RESOURCE_VIEW_SUFFIXES_DEFAULT_VALUE = "txt,log,sh,bat,conf,cfg,py,java,sql,xml,hql,properties,json,yml,yaml,ini,js";
  103. /**
  104. * development.state
  105. */
  106. public static final String DEVELOPMENT_STATE = "development.state";
  107. /**
  108. * sudo enable
  109. */
  110. public static final String SUDO_ENABLE = "sudo.enable";
  111. /**
  112. * string true
  113. */
  114. public static final String STRING_TRUE = "true";
  115. /**
  116. * resource storage type
  117. */
  118. public static final String RESOURCE_STORAGE_TYPE = "resource.storage.type";
  119. public static final String AWS_END_POINT = "aws.endpoint";
  120. /**
  121. * comma ,
  122. */
  123. public static final String COMMA = ",";
  124. /**
  125. * COLON :
  126. */
  127. public static final String COLON = ":";
  128. /**
  129. * QUESTION ?
  130. */
  131. public static final String QUESTION = "?";
  132. /**
  133. * SPACE " "
  134. */
  135. public static final String SPACE = " ";
  136. /**
  137. * SINGLE_SLASH /
  138. */
  139. public static final String SINGLE_SLASH = "/";
  140. /**
  141. * DOUBLE_SLASH //
  142. */
  143. public static final String DOUBLE_SLASH = "//";
  144. /**
  145. * EQUAL SIGN
  146. */
  147. public static final String EQUAL_SIGN = "=";
  148. /**
  149. * AT SIGN
  150. */
  151. public static final String AT_SIGN = "@";
  152. /**
  153. * date format of yyyy-MM-dd HH:mm:ss
  154. */
  155. public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
  156. /**
  157. * date format of yyyyMMdd
  158. */
  159. public static final String YYYYMMDD = "yyyyMMdd";
  160. /**
  161. * date format of yyyyMMddHHmmss
  162. */
  163. public static final String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
  164. /**
  165. * date format of yyyyMMddHHmmssSSS
  166. */
  167. public static final String YYYYMMDDHHMMSSSSS = "yyyyMMddHHmmssSSS";
  168. /**
  169. * http connect time out
  170. */
  171. public static final int HTTP_CONNECT_TIMEOUT = 60 * 1000;
  172. /**
  173. * http connect request time out
  174. */
  175. public static final int HTTP_CONNECTION_REQUEST_TIMEOUT = 60 * 1000;
  176. /**
  177. * httpclient soceket time out
  178. */
  179. public static final int SOCKET_TIMEOUT = 60 * 1000;
  180. /**
  181. * registry session timeout
  182. */
  183. public static final int REGISTRY_SESSION_TIMEOUT = 10 * 1000;
  184. /**
  185. * http header
  186. */
  187. public static final String HTTP_HEADER_UNKNOWN = "unKnown";
  188. /**
  189. * http X-Forwarded-For
  190. */
  191. public static final String HTTP_X_FORWARDED_FOR = "X-Forwarded-For";
  192. /**
  193. * http X-Real-IP
  194. */
  195. public static final String HTTP_X_REAL_IP = "X-Real-IP";
  196. /**
  197. * UTF-8
  198. */
  199. public static final String UTF_8 = "UTF-8";
  200. /**
  201. * user name regex
  202. */
  203. public static final Pattern REGEX_USER_NAME = Pattern.compile("^[a-zA-Z0-9._-]{3,39}$");
  204. /**
  205. * read permission
  206. */
  207. public static final int READ_PERMISSION = 2;
  208. /**
  209. * write permission
  210. */
  211. public static final int WRITE_PERMISSION = 2 * 2;
  212. /**
  213. * execute permission
  214. */
  215. public static final int EXECUTE_PERMISSION = 1;
  216. /**
  217. * default admin permission
  218. */
  219. public static final int DEFAULT_ADMIN_PERMISSION = 7;
  220. /**
  221. * default hash map size
  222. */
  223. public static final int DEFAULT_HASH_MAP_SIZE = 16;
  224. /**
  225. * all permissions
  226. */
  227. public static final int ALL_PERMISSIONS = READ_PERMISSION | WRITE_PERMISSION | EXECUTE_PERMISSION;
  228. /**
  229. * max task timeout
  230. */
  231. public static final int MAX_TASK_TIMEOUT = 24 * 3600;
  232. /**
  233. * worker host weight
  234. */
  235. public static final int DEFAULT_WORKER_HOST_WEIGHT = 100;
  236. /**
  237. * time unit secong to minutes
  238. */
  239. public static final int SEC_2_MINUTES_TIME_UNIT = 60;
  240. /***
  241. *
  242. * rpc port
  243. */
  244. public static final String RPC_PORT = "rpc.port";
  245. /**
  246. * forbid running task
  247. */
  248. public static final String FLOWNODE_RUN_FLAG_FORBIDDEN = "FORBIDDEN";
  249. /**
  250. * normal running task
  251. */
  252. public static final String FLOWNODE_RUN_FLAG_NORMAL = "NORMAL";
  253. public static final String COMMON_TASK_TYPE = "common";
  254. public static final String DEFAULT = "default";
  255. public static final String PASSWORD = "password";
  256. public static final String XXXXXX = "******";
  257. public static final String NULL = "NULL";
  258. public static final String THREAD_NAME_MASTER_SERVER = "Master-Server";
  259. public static final String THREAD_NAME_WORKER_SERVER = "Worker-Server";
  260. public static final String THREAD_NAME_ALERT_SERVER = "Alert-Server";
  261. /**
  262. * command parameter keys
  263. */
  264. public static final String CMD_PARAM_RECOVER_PROCESS_ID_STRING = "ProcessInstanceId";
  265. public static final String CMD_PARAM_RECOVERY_START_NODE_STRING = "StartNodeIdList";
  266. public static final String CMD_PARAM_RECOVERY_WAITING_THREAD = "WaitingThreadInstanceId";
  267. public static final String CMD_PARAM_SUB_PROCESS = "processInstanceId";
  268. public static final String CMD_PARAM_EMPTY_SUB_PROCESS = "0";
  269. public static final String CMD_PARAM_SUB_PROCESS_PARENT_INSTANCE_ID = "parentProcessInstanceId";
  270. public static final String CMD_PARAM_SUB_PROCESS_DEFINE_CODE = "processDefinitionCode";
  271. public static final String CMD_PARAM_START_NODES = "StartNodeList";
  272. public static final String CMD_PARAM_START_PARAMS = "StartParams";
  273. public static final String CMD_PARAM_FATHER_PARAMS = "fatherParams";
  274. /**
  275. * complement data start date
  276. */
  277. public static final String CMDPARAM_COMPLEMENT_DATA_START_DATE = "complementStartDate";
  278. /**
  279. * complement data end date
  280. */
  281. public static final String CMDPARAM_COMPLEMENT_DATA_END_DATE = "complementEndDate";
  282. /**
  283. * complement date default cron string
  284. */
  285. public static final String DEFAULT_CRON_STRING = "0 0 0 * * ? *";
  286. /**
  287. * sleep 1000ms
  288. */
  289. public static final int SLEEP_TIME_MILLIS = 1000;
  290. /**
  291. * short sleep 100ms
  292. */
  293. public static final int SLEEP_TIME_MILLIS_SHORT = 100;
  294. /**
  295. * one second mils
  296. */
  297. public static final int SECOND_TIME_MILLIS = 1000;
  298. /**
  299. * master task instance cache-database refresh interval
  300. */
  301. public static final int CACHE_REFRESH_TIME_MILLIS = 20 * 1000;
  302. /**
  303. * heartbeat for zk info length
  304. */
  305. public static final int HEARTBEAT_FOR_ZOOKEEPER_INFO_LENGTH = 13;
  306. /**
  307. * jar
  308. */
  309. public static final String JAR = "jar";
  310. /**
  311. * hadoop
  312. */
  313. public static final String HADOOP = "hadoop";
  314. /**
  315. * -D <property>=<value>
  316. */
  317. public static final String D = "-D";
  318. /**
  319. * exit code success
  320. */
  321. public static final int EXIT_CODE_SUCCESS = 0;
  322. /**
  323. * exit code failure
  324. */
  325. public static final int EXIT_CODE_FAILURE = -1;
  326. /**
  327. * process or task definition failure
  328. */
  329. public static final int DEFINITION_FAILURE = -1;
  330. /**
  331. * process or task definition first version
  332. */
  333. public static final int VERSION_FIRST = 1;
  334. /**
  335. * date format of yyyyMMdd
  336. */
  337. public static final String PARAMETER_FORMAT_DATE = "yyyyMMdd";
  338. /**
  339. * date format of yyyyMMddHHmmss
  340. */
  341. public static final String PARAMETER_FORMAT_TIME = "yyyyMMddHHmmss";
  342. /**
  343. * system date(yyyyMMddHHmmss)
  344. */
  345. public static final String PARAMETER_DATETIME = "system.datetime";
  346. /**
  347. * system date(yyyymmdd) today
  348. */
  349. public static final String PARAMETER_CURRENT_DATE = "system.biz.curdate";
  350. /**
  351. * system date(yyyymmdd) yesterday
  352. */
  353. public static final String PARAMETER_BUSINESS_DATE = "system.biz.date";
  354. /**
  355. * ACCEPTED
  356. */
  357. public static final String ACCEPTED = "ACCEPTED";
  358. /**
  359. * SUCCEEDED
  360. */
  361. public static final String SUCCEEDED = "SUCCEEDED";
  362. /**
  363. * ENDED
  364. */
  365. public static final String ENDED = "ENDED";
  366. /**
  367. * NEW
  368. */
  369. public static final String NEW = "NEW";
  370. /**
  371. * NEW_SAVING
  372. */
  373. public static final String NEW_SAVING = "NEW_SAVING";
  374. /**
  375. * SUBMITTED
  376. */
  377. public static final String SUBMITTED = "SUBMITTED";
  378. /**
  379. * FAILED
  380. */
  381. public static final String FAILED = "FAILED";
  382. /**
  383. * KILLED
  384. */
  385. public static final String KILLED = "KILLED";
  386. /**
  387. * RUNNING
  388. */
  389. public static final String RUNNING = "RUNNING";
  390. /**
  391. * underline "_"
  392. */
  393. public static final String UNDERLINE = "_";
  394. /**
  395. * quartz job prifix
  396. */
  397. public static final String QUARTZ_JOB_PREFIX = "job";
  398. /**
  399. * quartz job group prifix
  400. */
  401. public static final String QUARTZ_JOB_GROUP_PREFIX = "jobgroup";
  402. /**
  403. * projectId
  404. */
  405. public static final String PROJECT_ID = "projectId";
  406. /**
  407. * processId
  408. */
  409. public static final String SCHEDULE_ID = "scheduleId";
  410. /**
  411. * schedule
  412. */
  413. public static final String SCHEDULE = "schedule";
  414. /**
  415. * application regex
  416. */
  417. public static final String APPLICATION_REGEX = "application_\\d+_\\d+";
  418. public static final String PID = SystemUtils.IS_OS_WINDOWS ? "handle" : "pid";
  419. /**
  420. * month_begin
  421. */
  422. public static final String MONTH_BEGIN = "month_begin";
  423. /**
  424. * add_months
  425. */
  426. public static final String ADD_MONTHS = "add_months";
  427. /**
  428. * month_end
  429. */
  430. public static final String MONTH_END = "month_end";
  431. /**
  432. * week_begin
  433. */
  434. public static final String WEEK_BEGIN = "week_begin";
  435. /**
  436. * week_end
  437. */
  438. public static final String WEEK_END = "week_end";
  439. /**
  440. * timestamp
  441. */
  442. public static final String TIMESTAMP = "timestamp";
  443. public static final char SUBTRACT_CHAR = '-';
  444. public static final char ADD_CHAR = '+';
  445. public static final char MULTIPLY_CHAR = '*';
  446. public static final char DIVISION_CHAR = '/';
  447. public static final char LEFT_BRACE_CHAR = '(';
  448. public static final char RIGHT_BRACE_CHAR = ')';
  449. public static final String ADD_STRING = "+";
  450. public static final String STAR = "*";
  451. public static final String DIVISION_STRING = "/";
  452. public static final String LEFT_BRACE_STRING = "(";
  453. public static final char P = 'P';
  454. public static final char N = 'N';
  455. public static final String SUBTRACT_STRING = "-";
  456. public static final String GLOBAL_PARAMS = "globalParams";
  457. public static final String LOCAL_PARAMS = "localParams";
  458. public static final String SUBPROCESS_INSTANCE_ID = "subProcessInstanceId";
  459. public static final String PROCESS_INSTANCE_STATE = "processInstanceState";
  460. public static final String PARENT_WORKFLOW_INSTANCE = "parentWorkflowInstance";
  461. public static final String CONDITION_RESULT = "conditionResult";
  462. public static final String SWITCH_RESULT = "switchResult";
  463. public static final String WAIT_START_TIMEOUT = "waitStartTimeout";
  464. public static final String DEPENDENCE = "dependence";
  465. public static final String TASK_LIST = "taskList";
  466. public static final String QUEUE = "queue";
  467. public static final String QUEUE_NAME = "queueName";
  468. public static final int LOG_QUERY_SKIP_LINE_NUMBER = 0;
  469. public static final int LOG_QUERY_LIMIT = 4096;
  470. public static final String BLOCKING_CONDITION = "blockingCondition";
  471. public static final String ALERT_WHEN_BLOCKING = "alertWhenBlocking";
  472. /**
  473. * master/worker server use for zk
  474. */
  475. public static final String MASTER_TYPE = "master";
  476. public static final String WORKER_TYPE = "worker";
  477. public static final String DELETE_OP = "delete";
  478. public static final String ADD_OP = "add";
  479. public static final String ALIAS = "alias";
  480. public static final String CONTENT = "content";
  481. public static final String DEPENDENT_SPLIT = ":||";
  482. public static final long DEPENDENT_ALL_TASK_CODE = 0;
  483. /**
  484. * preview schedule execute count
  485. */
  486. public static final int PREVIEW_SCHEDULE_EXECUTE_COUNT = 5;
  487. /**
  488. * kerberos
  489. */
  490. public static final String KERBEROS = "kerberos";
  491. /**
  492. * kerberos expire time
  493. */
  494. public static final String KERBEROS_EXPIRE_TIME = "kerberos.expire.time";
  495. /**
  496. * java.security.krb5.conf
  497. */
  498. public static final String JAVA_SECURITY_KRB5_CONF = "java.security.krb5.conf";
  499. /**
  500. * java.security.krb5.conf.path
  501. */
  502. public static final String JAVA_SECURITY_KRB5_CONF_PATH = "java.security.krb5.conf.path";
  503. /**
  504. * hadoop.security.authentication
  505. */
  506. public static final String HADOOP_SECURITY_AUTHENTICATION = "hadoop.security.authentication";
  507. /**
  508. * hadoop.security.authentication
  509. */
  510. public static final String HADOOP_SECURITY_AUTHENTICATION_STARTUP_STATE = "hadoop.security.authentication.startup.state";
  511. /**
  512. * com.amazonaws.services.s3.enableV4
  513. */
  514. public static final String AWS_S3_V4 = "com.amazonaws.services.s3.enableV4";
  515. /**
  516. * loginUserFromKeytab user
  517. */
  518. public static final String LOGIN_USER_KEY_TAB_USERNAME = "login.user.keytab.username";
  519. /**
  520. * loginUserFromKeytab path
  521. */
  522. public static final String LOGIN_USER_KEY_TAB_PATH = "login.user.keytab.path";
  523. /**
  524. * task log info format
  525. */
  526. public static final String TASK_LOG_INFO_FORMAT = "TaskLogInfo-%s";
  527. public static final int[] NOT_TERMINATED_STATES = new int[]{
  528. ExecutionStatus.SUBMITTED_SUCCESS.ordinal(),
  529. ExecutionStatus.DISPATCH.ordinal(),
  530. ExecutionStatus.RUNNING_EXECUTION.ordinal(),
  531. ExecutionStatus.DELAY_EXECUTION.ordinal(),
  532. ExecutionStatus.READY_PAUSE.ordinal(),
  533. ExecutionStatus.READY_STOP.ordinal(),
  534. ExecutionStatus.NEED_FAULT_TOLERANCE.ordinal(),
  535. ExecutionStatus.WAITING_THREAD.ordinal(),
  536. ExecutionStatus.WAITING_DEPEND.ordinal()
  537. };
  538. public static final int[] RUNNING_PROCESS_STATE = new int[]{
  539. ExecutionStatus.RUNNING_EXECUTION.ordinal(),
  540. ExecutionStatus.SUBMITTED_SUCCESS.ordinal(),
  541. ExecutionStatus.DISPATCH.ordinal(),
  542. ExecutionStatus.SERIAL_WAIT.ordinal()
  543. };
  544. /**
  545. * status
  546. */
  547. public static final String STATUS = "status";
  548. /**
  549. * message
  550. */
  551. public static final String MSG = "msg";
  552. /**
  553. * data total
  554. */
  555. public static final String COUNT = "count";
  556. /**
  557. * page size
  558. */
  559. public static final String PAGE_SIZE = "pageSize";
  560. /**
  561. * current page no
  562. */
  563. public static final String PAGE_NUMBER = "pageNo";
  564. /**
  565. *
  566. */
  567. public static final String DATA_LIST = "data";
  568. public static final String TOTAL_LIST = "totalList";
  569. public static final String CURRENT_PAGE = "currentPage";
  570. public static final String TOTAL_PAGE = "totalPage";
  571. public static final String TOTAL = "total";
  572. /**
  573. * workflow
  574. */
  575. public static final String WORKFLOW_LIST = "workFlowList";
  576. public static final String WORKFLOW_RELATION_LIST = "workFlowRelationList";
  577. /**
  578. * session user
  579. */
  580. public static final String SESSION_USER = "session.user";
  581. public static final String SESSION_ID = "sessionId";
  582. /**
  583. * locale
  584. */
  585. public static final String LOCALE_LANGUAGE = "language";
  586. /**
  587. * database type
  588. */
  589. public static final String MYSQL = "MYSQL";
  590. public static final String HIVE = "HIVE";
  591. public static final String ADDRESS = "address";
  592. public static final String DATABASE = "database";
  593. public static final String OTHER = "other";
  594. public static final String USER = "user";
  595. public static final String JDBC_URL = "jdbcUrl";
  596. /**
  597. * session timeout
  598. */
  599. public static final int SESSION_TIME_OUT = 7200;
  600. public static final int MAX_FILE_SIZE = 1024 * 1024 * 1024;
  601. public static final String UDF = "UDF";
  602. public static final String CLASS = "class";
  603. /**
  604. * dataSource sensitive param
  605. */
  606. public static final String DATASOURCE_PASSWORD_REGEX = "(?<=((?i)password((\\\\\":\\\\\")|(=')))).*?(?=((\\\\\")|(')))";
  607. /**
  608. * default worker group
  609. */
  610. public static final String DEFAULT_WORKER_GROUP = "default";
  611. /**
  612. * authorize writable perm
  613. */
  614. public static final int AUTHORIZE_WRITABLE_PERM = 7;
  615. /**
  616. * authorize readable perm
  617. */
  618. public static final int AUTHORIZE_READABLE_PERM = 4;
  619. public static final int NORMAL_NODE_STATUS = 0;
  620. public static final int ABNORMAL_NODE_STATUS = 1;
  621. public static final int BUSY_NODE_STATUE = 2;
  622. public static final String START_TIME = "start time";
  623. public static final String END_TIME = "end time";
  624. public static final String START_END_DATE = "startDate,endDate";
  625. /**
  626. * system line separator
  627. */
  628. public static final String SYSTEM_LINE_SEPARATOR = System.getProperty("line.separator");
  629. /**
  630. * datasource encryption salt
  631. */
  632. public static final String DATASOURCE_ENCRYPTION_SALT_DEFAULT = "!@#$%^&*";
  633. public static final String DATASOURCE_ENCRYPTION_ENABLE = "datasource.encryption.enable";
  634. public static final String DATASOURCE_ENCRYPTION_SALT = "datasource.encryption.salt";
  635. /**
  636. * network interface preferred
  637. */
  638. public static final String DOLPHIN_SCHEDULER_NETWORK_INTERFACE_PREFERRED = "dolphin.scheduler.network.interface.preferred";
  639. /**
  640. * network IP gets priority, default inner outer
  641. */
  642. public static final String DOLPHIN_SCHEDULER_NETWORK_PRIORITY_STRATEGY = "dolphin.scheduler.network.priority.strategy";
  643. /**
  644. * exec shell scripts
  645. */
  646. public static final String SH = "sh";
  647. /**
  648. * pstree, get pud and sub pid
  649. */
  650. public static final String PSTREE = "pstree";
  651. public static final Boolean KUBERNETES_MODE = !StringUtils.isEmpty(System.getenv("KUBERNETES_SERVICE_HOST")) && !StringUtils.isEmpty(System.getenv("KUBERNETES_SERVICE_PORT"));
  652. /**
  653. * dry run flag
  654. */
  655. public static final int DRY_RUN_FLAG_NO = 0;
  656. public static final int DRY_RUN_FLAG_YES = 1;
  657. /**
  658. * data.quality.error.output.path
  659. */
  660. public static final String DATA_QUALITY_ERROR_OUTPUT_PATH = "data-quality.error.output.path";
  661. public static final String CACHE_KEY_VALUE_ALL = "'all'";
  662. /**
  663. * use for k8s
  664. */
  665. public static final String NAMESPACE = "namespace";
  666. public static final String K8S = "k8s";
  667. public static final String LIMITS_CPU = "limitsCpu";
  668. public static final String LIMITS_MEMORY = "limitsMemory";
  669. public static final String K8S_LOCAL_TEST_CLUSTER = "ds_null_k8s";
  670. /**
  671. * schedule timezone
  672. */
  673. public static final String SCHEDULE_TIMEZONE = "schedule_timezone";
  674. public static final int RESOURCE_FULL_NAME_MAX_LENGTH = 128;
  675. /**
  676. * tenant
  677. */
  678. public static final int TENANT_FULL_NAME_MAX_LENGTH = 30;
  679. }