diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..bafd57195 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,103 @@ +name: Bug report +title: "[Bug] " +description: Problems and issues with code of Exchangis +labels: [bug, triage] +body: + - type: markdown + attributes: + value: | + Thank you for reporting the problem! + Please make sure what you are reporting is a bug with reproducible steps. To ask questions + or share ideas, pleae post on our [Discussion page](https://github.com/WeBankFinTech/Exchangis/discussions) instead. + + - type: checkboxes + attributes: + label: Search before asking + description: > + Please make sure to search in the [issues](https://github.com/WeBankFinTech/Exchangis/issues) first to see + whether the same issue was reported already. + options: + - label: > + I searched the [issues](https://github.com/WeBankFinTech/Exchangis/issues) and found no similar + issues. + required: true + + - type: dropdown + attributes: + label: Exchangis Component + description: | + What component are you using? Exchangis has many modules, please make sure to choose the module that + you found the bug. + multiple: true + options: + - "exchangis-datasource" + - "exchangis-job-launcher" + - "exchangis-job-server" + - "exchangis-job-builder" + - "exchangis-job-metrics" + - "exchangis-project" + - "exchangis-plugins" + - "exchangis-dao" + - "exchangis-web" + validations: + required: true + + - type: textarea + attributes: + label: What happened + What you expected to happen + description: Describe 1. the bug 2. expected behavior 3. useful information (e.g., logs) + placeholder: > + Please provide the context in which the problem occurred and explain what happened. Further, + To Reproduce Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '.... 4. See error + please also explain why you think the behaviour is erroneous. It is extremely helpful if you can + copy and paste the fragment of logs showing the exact error messages or wrong behaviour here. + + **NOTE**: Expected behavior A clear and concise description of what you expected to happen.Screenshots If applicable, add screenshots to help explain your problem. + validations: + required: true + + - type: textarea + attributes: + label: Relevent platform + description: The platform where you occurred this issue + placeholder: > + Please specify Desktop or Smartphone, Version / Dependencies / OS / Browser + validations: + required: true + + - type: textarea + attributes: + label: Reproduction script + description: > + Please provide a reproducible script. Providing a narrow reproduction (minimal / no external dependencies) will + help us triage and address issues in the timely manner! + placeholder: > + Please provide a short code snippet (less than 50 lines if possible) that can be copy-pasted to + reproduce the issue. The snippet should have **no external library dependencies** + (i.e., use fake or mock data / environments). + + **NOTE**: If the code snippet cannot be run by itself, the issue will be marked as "needs-repro-script" + until the repro instruction is updated. + validations: + required: true + + - type: textarea + attributes: + label: Anything else + description: Anything else we need to know? + placeholder: > + How often does this problem occur? (Once? Every time? Only when certain conditions are met?) + Any relevant logs to include? Are there other relevant issues? + + - type: checkboxes + attributes: + label: Are you willing to submit a PR? + description: > + This is absolutely not required, but we are happy to guide you in the contribution process + especially if you already have a good understanding of how to implement the fix. + options: + - label: Yes I am willing to submit a PR! + + - type: markdown + attributes: + value: "Thanks for completing our form!" diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..7c34114e9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: fasle +contact_links: + - name: Ask a question or get support + url: https://github.com/WeBankFinTech/Exchangis/discussions + about: Ask a question or request support for using Exchangis \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000..357f173ff --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,63 @@ +name: Exchangis feature request +description: Suggest an idea for Exchangis project +title: "[Feature] " +labels: [enhancement] +body: + - type: markdown + attributes: + value: | + Thank you for finding the time to propose a new feature! + We really appreciate the community efforts to improve Exchangis. + - type: checkboxes + attributes: + label: Search before asking + description: > + Please make sure to search in the [issues](https://github.com/WeBankFinTech/Exchangis/issues) first to see + whether the same feature was requested already. + options: + - label: > + I had searched in the [issues](https://github.com/WeBankFinTech/Exchangis/issues) and found no similar + feature requirement. + required: true + - type: textarea + attributes: + label: Problem Description + description: Is your feature request related to a problem? Please describe. + + - type: textarea + attributes: + label: Description + description: A short description of your feature + + - type: textarea + attributes: + label: Use case + description: > + Describe the use case of your feature request. + placeholder: > + Describe the solution you'd like A clear and concise description of what you want to happen. + + - type: textarea + attributes: + label: solutions + description: Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. + + - type: textarea + attributes: + label: Anything else + description: Anything else we need to know? + placeholder: > + Additional context Add any other context or screenshots about the feature request here. + + - type: checkboxes + attributes: + label: Are you willing to submit a PR? + description: > + This is absolutely not required, but we are happy to guide you in the contribution process + especially if you already have a good understanding of how to implement the feature. + options: + - label: Yes I am willing to submit a PR! + + - type: markdown + attributes: + value: "Thanks for completing our form!" diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..57e883bcd --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,28 @@ +### What is the purpose of the change +(For example: Exchangis-Job defines the core ability of Exchangis, it provides the abilities of job management, job transform, and job launch. +Related issues: #50. ) + +### Brief change log +(for example:) +- defines the job server module of Exchangis; +- defines the job launcher module of Exchangis; +- defines the job metrics module of Exchangis. + +### Verifying this change +(Please pick either of the following options) +This change is a trivial rework / code cleanup without any test coverage. +(or) +This change is already covered by existing tests, such as (please describe tests). +(or) +This change added tests and can be verified as follows: +(example:) +- Added tests for creating and execute the Exchangis jobs and verify the availability of different Exchangis Job, such as sqoop job, datax job. + +### Does this pull request potentially affect one of the following parts: +- Dependencies (does it add or upgrade a dependency): (yes / no) +- Anything that affects deployment: (yes / no / don't know) +- The Core framework, i.e., JobManager, Server.: (yes / no) + +### Documentation +- Does this pull request introduce a new feature? (yes / no) +- If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented) \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..5f93411ce --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,55 @@ +# +# Copyright 2019 WeBank. +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name: Exchangis CI Actions + +on: + push: + pull_request: + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.17.3] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: 8 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - name: Build backend by maven + run: | + mvn -N install + mvn clean package + - name: Build frontend by node.js + run: | + cd web + npm install + npm run build diff --git a/.github/workflows/check_license.yml b/.github/workflows/check_license.yml new file mode 100644 index 000000000..10e3f9fde --- /dev/null +++ b/.github/workflows/check_license.yml @@ -0,0 +1,48 @@ +# +# Copyright 2019 WeBank. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +name: Exchangis License check + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v2 + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + - name: mvn -N install + run: + mvn -N install + - name: License check with Maven + run: | + rat_file=`mvn apache-rat:check | { grep -oe "\\S\\+/rat.txt" || true; }` + echo "rat_file=$rat_file" + if [[ -n "$rat_file" ]];then echo "check error!" && cat $rat_file && exit 123;else echo "check success!" ;fi + - name: Upload the report + uses: actions/upload-artifact@v2 + with: + name: license-check-report + path: "**/target/rat.txt" diff --git a/.gitignore b/.gitignore index 90fdae240..46dec8ece 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ target ### IntelliJ IDEA ### .idea +*.log *.iws *.iml *.ipr @@ -26,3 +27,12 @@ target .mvn/wrapper/maven-wrapper.jar .mvn/wrapper/maven-wrapper.properties /packages/ +exchangis-server/exchangis-extds +/logs/ +/web/package-lock.json +package-lock.json +.DS_Store + +web/dist + +workspace/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..294e26a9e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM harbor.local.hching.com/library/jdk:8u301 + +ADD assembly-package/target/wedatasphere-exchangis-1.0.0-RC1.tar.gz /opt/wedatasphere-exchangis.tar.gz + +RUN cd /opt/wedatasphere-exchangis.tar.gz/packages/ && tar -zxf exchangis-server_1.0.0-RC1.tar.gz && cd /opt/wedatasphere-exchangis.tar.gz/sbin + +WORKDIR /opt/wedatasphere-exchangis.tar.gz/sbin + +ENTRYPOINT ["/bin/bash start.sh"] diff --git a/README-ZH.md b/README-ZH.md new file mode 100644 index 000000000..736279157 --- /dev/null +++ b/README-ZH.md @@ -0,0 +1,67 @@ +# Exchangis + +[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) + +[English](README.md) | 中文 + +## 介绍 + +Exchangis 1.0.0 是微众银行大数据平台 WeDataSphere 与社区用户共同研发的的新版数据交换工具,支持异构数据源之间的结构化和非结构化数据传输同步。 + +Exchangis 抽象了一套统一的数据源和同步作业定义插件,允许用户快速接入新的数据源,并只需在数据库中简单配置即可在页面中使用。 + +基于插件化的框架设计,及计算中间件 [Linkis](https://github.com/apache/incubator-linkis),Exchangis 可快速集成对接 Linkis 已集成的数据同步引擎,将 Exchangis 的同步作业转换成 Linkis 数据同步引擎的数据同步作业。 + +借助于 [Linkis](https://github.com/apache/incubator-linkis) 计算中间件的连接、复用与简化能力,Exchangis 天生便具备了高并发、高可用、多租户隔离和资源管控的金融级数据同步能力。 + +### 界面预览 + +![image](https://user-images.githubusercontent.com/27387830/171488936-2cea3ee9-4ef7-4309-93e1-e3b697bd3be1.png) + +## 核心特点 + +### 1. 轻量化的数据源管理 + +- 基于 Linkis DataSource,抽象了底层数据源在 Exchangis 作为一个同步作业的 Source 和 Sink 所必须的所有能力。只需简单配置即可完成一个数据源的创建。 + +- 特别数据源版本发布管理功能,支持历史版本数据源回滚,一键发布无需再次配置历史数据源。 + + +### 2. 高稳定,快响应的数据同步任务执行 + +- **近实时任务管控** +快速抓取传输任务日志以及传输速率等信息,对多任务包括CPU使用、内存使用、数据同步记录等各项指标进行监控展示,支持实时关闭任务; + +- **任务高并发传输** +多任务并发执行,并且支持复制子任务,实时展示每个任务的状态,多租户执行功能有效避免执行过程中任务彼此影响进行; + +- **任务状态自检** +监控长时间运行的任务和状态异常任务,中止任务并及时释放占用的资源。 + + +### 3. 与DSS工作流打通,一站式大数据开发的门户 + +- 实现DSS AppConn包括一级 SSO 规范,二级组织结构规范,三级开发流程规范在内的三级规范; + +- 作为DSS工作流的数据交换节点,是整个工作流链路中的门户流程,为后续的工作流节点运行提供稳固的数据基础; + +## 整体设计 + +### 架构设计 + +![架构设计](https://user-images.githubusercontent.com/27387830/173026793-f1475803-9f85-4478-b566-1ad1d002cd8a.png) + + +## 相关文档 +[安装部署文档](https://github.com/WeDataSphere/Exchangis/blob/dev-1.0.0-rc/docs/zh_CN/ch1/exchangis_deploy_cn.md) +[用户手册](https://github.com/WeDataSphere/Exchangis/blob/dev-1.0.0-rc/docs/zh_CN/ch1/exchangis_user_manual_cn.md) + +## 交流贡献 + +如果您想得到最快的响应,请给我们提 issue,或者扫码进群: + +![communication](images/zh_CN/ch1/communication.png) + +## License + +Exchangis is under the Apache 2.0 License. See the [License](../../../LICENSE) file for details. diff --git a/README.md b/README.md index d48f79fa6..2c8975105 100644 --- a/README.md +++ b/README.md @@ -1,62 +1,67 @@ [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) -English | [中文](docs/zh_CN/ch1/README.md) +English | [中文](README-ZH.md) ## Introduction -Exchangis is a lightweight,highly extensible data exchange platform that supports data transmission between structured and unstructured heterogeneous data sources. On the application layer, it has business features such as data permission management and control, high availability of node services and multi-tenant resource isolation. On the data layer, it also has architectural characteristics such as diversified transmission architecture, module plug-in and low coupling of components. -Exchnagis's transmission and exchange capabilities depend on its underlying aggregated transmission engines. It defines a unified parameter model for various data sources on the top layer. It maps and configures the parameter model for each transmission engine, and then converts it into the engine's input model. Each type of engine will add Exchangis features, and the enhancement of certain engine features will improve the Exchangis features. Exchangis's default engine aggregated and enhanced is Alibaba's DataX transmission engine. +Exchangis 1.0.0 is a new version of data exchange tool jointly developed by WeDataSphere, a big data platform of WeBank, and community users, which supports the synchronization of structured and unstructured data transmission between heterogeneous data sources. -## Features -- **Data Source Management** -Share your own data source in a bound project; -Set the external authority of the data source to control the inflow and outflow of data。 +Exchangis abstracts a unified set of data source and synchronization job definition plugins, allowing users to quickly access new data sources and use them on pages with simple configuration in the database. -- **Muti-transport Engine Support** -Transmission engine scales horizontally; -The current version fully aggregates the offline batch engine DataX and partially aggregates the big data batch derivative engine SQOOP +Based on the plugin framework design and the computing middleware [Linkis](https://github.com/apache/incubator-Linkis), Exchangis can quickly connect to the data synchronization engine in Linkis, and convert the data synchronization job of Exchangis into the job of Linkis. -- **Near Real-time Task Control** -Quickly capture the transmission task log, transmission rate and other information, close the task in real time; -Dynamically limit transmission rate based on bandwidth +With the help of [Linkis](https://github.com/apache/incubator-linkis) computing middleware's connection, reuse and simplification capabilities, Exchangia is inherently equipped with financial-grade data synchronization capabilities of high concurrency, high availability, multi-tenant isolation and resource control. -- **Support Unstructured Transmission** -Transform the DataX framework and build a binary stream fast channel separately, suitable for pure data synchronization scenarios without data conversion。 +### Interface preview -- **Task Status Self-check** -Monitor long-running tasks and tasks with abnormal status, release occupied resources in time and issue alarms。 +![image](https://user-images.githubusercontent.com/27387830/171488936-2cea3ee9-4ef7-4309-93e1-e3b697bd3be1.png) -## Comparison With Existing Systems -Comparison of some existing data exchange tools and platforms: +## Core characteristics -| Function module | Description | Exchangis | DataX | Sqoop | DataLink | DBus | -| :----: | :----: |-------|-------|-------|-------|-------| -| UI | Integrated the convenient management interface and monitoring window | Integrated | None | None | Integrated |Integrated | -| Installation and deployment | Ease of deployment and third-party dependencies | One-click deployment, no dependencies | No dependencies | Rely on Hadoop environment | Rely on Zookeeper | Rely on a large number of third-party components | -| Data authority management | Multi-tenant permission configuration and data source permission control | Support | Not support | Not support | Not support | Support | -| |Dynamic limit transmission | Support | Partially supported, unable to adjust dynamically | Partially supported, unable to adjust dynamically | Support | Support,with Kafka | -| Data transmission| Unstructured data binary transmission | Support, fast channel | Not support | Not support | Not support,only transport record | Not support,need to be converted to a unified message format| -| | Embed processing code | Support,dynamic compilation | Not support | Not support | Not support | Partial support | -| | Transmission breakpoint recovery | Support(Not open source) | Not support | Not support | Support | Support | -| High availability | Mutiple services, failure does not affect the use | Application high availability, transmission single point(Distributed architecture planning) | Single point service(Open source version) | Multipoint transmission | Application、transmission high availability | Application、transmission high availability | -| System Management | Nodes、resources management | Support | Not support | Not support | Support | Support | +### 1. Lightweight datasource management -## Overall Design +- Based on Linkis DataSource, Exchangis abstracts all the necessary capabilities of the underlying data source as the Source and Sink of a synchronization job. A data source can be created with simple configuration. -### Architecture +- Special datasource version publishing management function supports version history datasource rollback, and one-click publishing does not need to configure historical datasources again. + + +### 2. High-stability and fast-response data synchronization task execution + +- **Near-real-time task management** + Quickly capture information such as transmission task log and transmission rate, monitor and display various indicators of multi-task including CPU usage, memory usage, data synchronization record, etc., and support closing tasks in real time. + +- **Task high concurrent transmission** + Multi-tasks are executed concurrently, and sub-tasks can be copied to show the status of each task in real time. Multi-tenant execution function can effectively prevent tasks from affecting each other during execution. + +- **Self-check of task status** + Monitor long-running tasks and abnormal tasks, stop tasks and release occupied resources in time. + + +### 3. Integrate with DSS workflow, one-stop big data development portal + +- Realize DSS AppConn's three-level specification, including the first-level SSO specification, the second-level organizational structure specification and the third-level development process specification. + +- As the data exchange node of DSS workflow, it is the fundamental process in the whole workflow link, which provides a solid data foundation for the subsequent operation of workflow nodes. + +## Overall Design + +### Architecture Design + +![架构设计](images/en_US/ch1/architecture.png) -![Architecture](images/en_US/ch1/architecture.png) ## Documents -[Quick Deploy](docs/zh_CN/ch1/exchangis_deploy_cn.md) -[User Manual](docs/zh_CN/ch1/exchangis_user_manual_cn.md) -## Communication +[Quick Deploy](https://github.com/WeDataSphere/Exchangis/blob/dev-1.0.0-rc/docs/zh_CN/ch1/exchangis_deploy_cn.md) +[User Manual](https://github.com/WeDataSphere/Exchangis/blob/dev-1.0.0-rc/docs/zh_CN/ch1/exchangis_user_manual_cn.md) + +## Communication and contribution -If you desire immediate response, please kindly raise issues to us or scan the below QR code by WeChat and QQ to join our group: +If you want to get the fastest response, please mention issue to us, or scan the code into the group : -![Communication](images/communication.png) +![communication](images/en_US/ch1/communication.png) ## License -Exchangis is under the Apache 2.0 License. See the [License](LICENSE) file for details. \ No newline at end of file +Exchangis is under the Apache 2.0 License. See the [License](../../../LICENSE) file for details. + diff --git a/docs/en_US/ch1/exchangis_deploy.md b/assembly-package/config/application-eureka.yml similarity index 100% rename from docs/en_US/ch1/exchangis_deploy.md rename to assembly-package/config/application-eureka.yml diff --git a/assembly-package/config/application-exchangis.yml b/assembly-package/config/application-exchangis.yml new file mode 100644 index 000000000..f7247d4aa --- /dev/null +++ b/assembly-package/config/application-exchangis.yml @@ -0,0 +1,20 @@ +server: + port: 9321 +spring: + application: + name: exchangis-server +eureka: + client: + serviceUrl: + defaultZone: http://127.0.0.1:3306/eureka/ + instance: + metadata-map: + test: wedatasphere + +management: + endpoints: + web: + exposure: + include: refresh,info +logging: + config: classpath:log4j2.xml diff --git a/assembly-package/config/config.sh b/assembly-package/config/config.sh new file mode 100644 index 000000000..e65884fa2 --- /dev/null +++ b/assembly-package/config/config.sh @@ -0,0 +1,4 @@ +LINKIS_GATEWAY_HOST= +LINKIS_GATEWAY_PORT= +EXCHANGIS_PORT= +EUREKA_URL= \ No newline at end of file diff --git a/assembly-package/config/db.sh b/assembly-package/config/db.sh new file mode 100644 index 000000000..b86d3361d --- /dev/null +++ b/assembly-package/config/db.sh @@ -0,0 +1,9 @@ +# 设置数据库的连接信息 +# 包括IP地址、数据库名称、用户名、端口 +MYSQL_HOST= +MYSQL_PORT= +MYSQL_USERNAME= +MYSQL_PASSWORD= +DATABASE= + + diff --git a/assembly-package/config/exchangis-server.properties b/assembly-package/config/exchangis-server.properties new file mode 100644 index 000000000..dc55c3f9b --- /dev/null +++ b/assembly-package/config/exchangis-server.properties @@ -0,0 +1,69 @@ +# +# Copyright 2019 WeBank +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +#wds.linkis.test.mode=true +wds.linkis.test.mode=false + +wds.linkis.server.mybatis.datasource.url=jdbc:mysql://127.0.0.1:3306/exchangis?useSSL=false&characterEncoding=UTF-8&allowMultiQueries=true + +wds.linkis.server.mybatis.datasource.username=username + +wds.linkis.server.mybatis.datasource.password=password + +wds.linkis.gateway.ip=127.0.0.1 +wds.linkis.gateway.port=9001 +wds.linkis.gateway.url=http://127.0.0.1:9001/ + +wds.linkis.log.clear=true + +wds.linkis.server.version=v1 + +## datasource client +wds.exchangis.datasource.client.serverurl=http://127.0.0.1:9001 +wds.exchangis.datasource.client.authtoken.key=EXCHANGIS-AUTH +wds.exchangis.datasource.client.authtoken.value=EXCHANGIS-AUTH +wds.exchangis.datasource.client.dws.version=v1 + +# launcher client +wds.exchangis.client.linkis.server-url=http://127.0.0.1:9001 +wds.exchangis.client.linkis.token.value=EXCHANGIS-AUTH + +wds.exchangis.datasource.extension.dir=exchangis-extds + +##restful +wds.linkis.server.restful.scan.packages=com.webank.wedatasphere.exchangis.datasource.server.restful.api,\ + com.webank.wedatasphere.exchangis.project.server.restful,\ + com.webank.wedatasphere.exchangis.job.server.restful +wds.linkis.server.mybatis.mapperLocations=classpath*:com/webank/wedatasphere/dss/framework/appconn/dao/impl/*.xml,classpath*:com/webank/wedatasphere/dss/workflow/dao/impl/*.xml,\ +classpath*:com/webank/wedatasphere/exchangis/job/server/mapper/impl/*.xml,\ +classpath*:com/webank/wedatasphere/exchangis/project/server/mapper/impl/*.xml + +wds.linkis.server.mybatis.BasePackage=com.webank.wedatasphere.exchangis.dao,\ + com.webank.wedatasphere.exchangis.project.server.mapper,\ + com.webank.wedatasphere.linkis.configuration.dao,\ + com.webank.wedatasphere.dss.framework.appconn.dao,\ + com.webank.wedatasphere.dss.workflow.dao,\ + com.webank.wedatasphere.linkis.metadata.dao,\ + com.webank.wedatasphere.exchangis.job.server.mapper,\ + com.webank.wedatasphere.exchangis.job.server.dao + +wds.exchangis.job.task.scheduler.load-balancer.flexible.segments.min-occupy=0.25 +wds.exchangis.job.task.scheduler.load-balancer.flexible.segments.max-occupy=0.5 +#wds.exchangis.job.scheduler.group.max.running-jobs=4 + +wds.linkis.session.ticket.key=bdp-user-ticket-id + diff --git a/assembly-package/config/exchangis.properties b/assembly-package/config/exchangis.properties new file mode 100644 index 000000000..e69de29bb diff --git a/assembly-package/config/log4j2.xml b/assembly-package/config/log4j2.xml new file mode 100644 index 000000000..70da2f238 --- /dev/null +++ b/assembly-package/config/log4j2.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assembly-package/pom.xml b/assembly-package/pom.xml new file mode 100644 index 000000000..15aa169d8 --- /dev/null +++ b/assembly-package/pom.xml @@ -0,0 +1,75 @@ + + + + + exchangis + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + assembly-package + pom + + + + org.apache.maven.plugins + maven-install-plugin + + true + + + + org.apache.maven.plugins + maven-antrun-plugin + + + package + + run + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.1.0 + + + dist + package + + single + + + false + wedatasphere-exchangis-${exchangis.version} + false + false + + src/main/assembly/assembly.xml + + + + + + + + diff --git a/assembly-package/sbin/common.sh b/assembly-package/sbin/common.sh new file mode 100644 index 000000000..03d4e4666 --- /dev/null +++ b/assembly-package/sbin/common.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Copyright 2020 WeBank +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +declare -A MODULE_MAIN_CLASS +MODULE_MAIN_CLASS["exchangis-server"]="com.webank.wedatasphere.exchangis.server.boot.ExchangisServerApplication" diff --git a/assembly-package/sbin/configure.sh b/assembly-package/sbin/configure.sh new file mode 100644 index 000000000..e61c428da --- /dev/null +++ b/assembly-package/sbin/configure.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# +# Copyright 2020 WeBank +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# configure modules + +configure_main(){ + +} + +configure_server(){ + +} \ No newline at end of file diff --git a/assembly-package/sbin/daemon.sh b/assembly-package/sbin/daemon.sh new file mode 100644 index 000000000..40f64a78a --- /dev/null +++ b/assembly-package/sbin/daemon.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# +# Copyright 2020 WeBank +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +if [[ "x"${EXCHANGIS_HOME} != "x" ]]; then + source ${EXCHANGIS_HOME}/sbin/launcher.sh + source ${EXCHANGIS_HOME}/sbin/common.sh +else + source ./launcher.sh + source ./common.sh +fi + +MODULE_NAME="" +usage(){ + echo "Usage is [start|stop|restart {service}]" +} + +start(){ + # call launcher + launcher_start $1 $2 +} + +stop(){ + # call launcher + launcher_stop $1 $2 +} + +restart(){ + launcher_stop $1 $2 + if [[ $? -eq 0 ]]; then + sleep 2 + launcher_start $1 $2 + fi +} + +COMMAND=$1 +case $COMMAND in + start|stop|restart) + if [[ ! -z $2 ]]; then + MAIN_CLASS=${MODULE_MAIN_CLASS[${MODULE_DEFAULT_PREFIX}$2]} + if [[ "x"${MAIN_CLASS} != "x" ]]; then + $COMMAND ${MODULE_DEFAULT_PREFIX}$2 ${MAIN_CLASS} + else + LOG ERROR "Cannot find the main class for [ ${MODULE_DEFAULT_PREFIX}$2 ]" + fi + else + usage + exit 1 + fi + ;; + *) + usage + exit 1 + ;; +esac \ No newline at end of file diff --git a/assembly-package/sbin/env.properties b/assembly-package/sbin/env.properties new file mode 100644 index 000000000..e69de29bb diff --git a/assembly-package/sbin/install.sh b/assembly-package/sbin/install.sh new file mode 100644 index 000000000..16f453870 --- /dev/null +++ b/assembly-package/sbin/install.sh @@ -0,0 +1,247 @@ +#!/bin/bash +# +# Copyright 2020 WeBank +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +source ~/.bashrc +shellDir=`dirname $0` +workDir=`cd ${shellDir}/..;pwd` + +SOURCE_ROOT=${workDir} +#load config +source ${SOURCE_ROOT}/config/config.sh +source ${SOURCE_ROOT}/config/db.sh +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +SHELL_LOG="${DIR}/console.out" #console.out是什么文件? +export SQL_SOURCE_PATH="${DIR}/../db/exchangis_ddl.sql" +PACKAGE_DIR="${DIR}/../packages" +# Home Path +EXCHNGIS_HOME_PATH="${DIR}/../" + +CONF_FILE_PATH="bin/configure.sh" +FORCE_INSTALL=false +SKIP_PACKAGE=false +USER=`whoami` +SUDO_USER=false + +CONF_PATH=${DIR}/../config + +usage(){ + printf "\033[1m Install project, run directly\n\033[0m" +} + +function LOG(){ + currentTime=`date "+%Y-%m-%d %H:%M:%S.%3N"` + echo -e "$currentTime [${1}] ($$) $2" | tee -a ${SHELL_LOG} # tee -a 输出是追加到文件里面 +} + +abs_path(){ + SOURCE="${BASH_SOURCE[0]}" + while [ -h "${SOURCE}" ]; do + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "${SOURCE}")" + [[ ${SOURCE} != /* ]] && SOURCE="${DIR}/${SOURCE}" + done + echo "$( cd -P "$( dirname "${SOURCE}" )" && pwd )" +} + +BIN=`abs_path` + + +is_sudo_user(){ + sudo -v >/dev/null 2>&1 #因为 sudo 在第一次执行时或是在 N分钟内没有执行(N 预设为5)会问密码 + #这条命令的意思就是在后台执行这个程序,并将错误输出2重定向到标准输出1,然后将标准输出1全部放到/dev/null文件,也就是清空. + #所以可以看出" >/dev/null 2>&1 "常用来避免shell命令或者程序等运行中有内容输出。 +} + +uncompress_packages(){ + LOG INFO "\033[1m package dir is: [${PACKAGE_DIR}]\033[0m" + local list=`ls ${PACKAGE_DIR}` + LOG INFO "\033[1m package list is: [${list}]\033[0m" + for pack in ${list} + do + local uncompress=true + if [ ${#PACKAGE_NAMES[@]} -gt 0 ]; then + uncompress=false + for server in ${PACKAGE_NAMES[@]} + do + if [ ${server} == ${pack%%.tar.gz*} ] || [ ${server} == ${pack%%.zip*} ]; then + uncompress=true + break + fi + done + fi + if [ ${uncompress} == true ]; then + if [[ ${pack} =~ tar\.gz$ ]]; then + local do_uncompress=0 + #if [ ${FORCE_INSTALL} == false ]; then + # interact_echo "Do you want to decompress this package: [${pack}]?" + # do_uncompress=$? + #fi + if [ ${do_uncompress} == 0 ]; then + LOG INFO "\033[1m Uncompress package: [${pack}] to modules directory\033[0m" + tar --skip-old-files -zxf ${PACKAGE_DIR}/${pack} -C ../ + fi + elif [[ ${pack} =~ zip$ ]]; then + local do_uncompress=0 + #if [ ${FORCE_INSTALL} == false ]; then + # interact_echo "Do you want to decompress this package: [${pack}]?" + # do_uncompress=$? + #fi + if [ ${do_uncompress} == 0 ]; then + LOG INFO "\033[1m Uncompress package: [${pack}] to modules directory\033[0m" + unzip -nq ${PACKAGE_DIR}/${pack} -d # n 解压缩时不要覆盖原有的文件 + fi + fi + # skip other packages + fi + done +} + +interact_echo(){ + while [ 1 ]; do + read -p "$1 (Y/N)" yn + if [ "${yn}x" == "Yx" ] || [ "${yn}x" == "yx" ]; then + return 0 + elif [ "${yn}x" == "Nx" ] || [ "${yn}x" == "nx" ]; then + return 1 + else + echo "Unknown choise: [$yn], please choose again." + fi + done +} + +init_database(){ +BOOTSTRAP_PROP_FILE="${CONF_PATH}/exchangis-server.properties" +# Start to initalize database +if [ "x${SQL_SOURCE_PATH}" != "x" ] && [ -f "${SQL_SOURCE_PATH}" ]; then + `mysql --version >/dev/null 2>&1` + interact_echo "Do you want to initalize database with sql?" + if [ $? == 0 ]; then + LOG INFO "\033[1m Scan out mysql command, so begin to initalize the database\033[0m" + #interact_echo "Do you want to initalize database with sql: [${SQL_SOURCE_PATH}]?" + #if [ $? == 0 ]; then + DATASOURCE_URL="jdbc:mysql:\/\/${MYSQL_HOST}:${MYSQL_PORT}\/${DATABASE}\?useSSL=false\&characterEncoding=UTF-8\&allowMultiQueries=true" + mysql -h ${MYSQL_HOST} -P ${MYSQL_PORT} -u ${MYSQL_USERNAME} -p${MYSQL_PASSWORD} --default-character-set=utf8 -e \ + "CREATE DATABASE IF NOT EXISTS ${DATABASE}; USE ${DATABASE}; source ${SQL_SOURCE_PATH};" + #sed -ri "s![#]?(DB_HOST=)\S*!\1${HOST}!g" ${BOOTSTRAP_PROP_FILE} + #sed -ri "s![#]?(DB_PORT=)\S*!\1${PORT}!g" ${BOOTSTRAP_PROP_FILE} + sed -ri "s![#]?(wds.linkis.server.mybatis.datasource.username=)\S*!\1${MYSQL_USERNAME}!g" ${BOOTSTRAP_PROP_FILE} + sed -ri "s![#]?(wds.linkis.server.mybatis.datasource.password=)\S*!\1${MYSQL_PASSWORD}!g" ${BOOTSTRAP_PROP_FILE} + sed -ri "s![#]?(wds.linkis.server.mybatis.datasource.url=)\S*!\1${DATASOURCE_URL}!g" ${BOOTSTRAP_PROP_FILE} + #fi + fi +fi +} + +init_properties(){ +BOOTSTRAP_PROP_FILE="${CONF_PATH}/exchangis-server.properties" +APPLICATION_YML="${CONF_PATH}/application-exchangis.yml" +# Start to initalize propertis + #interact_echo "Do you want to initalize exchangis-server.properties?" + #if [ $? == 0 ]; then + + LINKIS_GATEWAY_URL="http:\/\/${LINKIS_GATEWAY_HOST}:${LINKIS_GATEWAY_PORT}\/" + + if [ "x${LINKIS_SERVER_URL}" == "x" ]; then + LINKIS_SERVER_URL="http://127.0.0.1:3306" + fi + if [ "x${LINKIS_SERVER_URL}" == "x" ]; then + LINKIS_SERVER_URL="http://127.0.0.1:3306" + fi + + sed -ri "s![#]?(wds.linkis.gateway.ip=)\S*!\1${LINKIS_GATEWAY_HOST}!g" ${BOOTSTRAP_PROP_FILE} + sed -ri "s![#]?(wds.linkis.gateway.port=)\S*!\1${LINKIS_GATEWAY_PORT}!g" ${BOOTSTRAP_PROP_FILE} + sed -ri "s![#]?(wds.linkis.gateway.url=)\S*!\1${LINKIS_GATEWAY_URL}!g" ${BOOTSTRAP_PROP_FILE} + sed -ri "s![#]?(wds.exchangis.datasource.client.serverurl=)\S*!\1${LINKIS_GATEWAY_URL}!g" ${BOOTSTRAP_PROP_FILE} + sed -ri "s![#]?(wds.exchangis.client.linkis.server-url=)\S*!\1${LINKIS_GATEWAY_URL}!g" ${BOOTSTRAP_PROP_FILE} + #sed -ri "s![#]?(wds.exchangis.datasource.client.authtoken.key=)\S*!\1${LINKIS_TOKEN}!g" ${BOOTSTRAP_PROP_FILE} + #sed -ri "s![#]?(wds.exchangis.datasource.client.authtoken.value=)\S*!\1${LINKIS_TOKEN}!g" ${BOOTSTRAP_PROP_FILE} + #sed -ri "s![#]?(wds.exchangis.client.linkis.token.value=)\S*!\1${LINKIS_TOKEN}!g" ${BOOTSTRAP_PROP_FILE} + sed -ri "s![#]?(wds.linkis.gateway.port=)\S*!\1${LINKIS_GATEWAY_PORT}!g" ${BOOTSTRAP_PROP_FILE} + sed -ri "s![#]?(port: )\S*!\1${EXCHANGIS_PORT}!g" ${APPLICATION_YML} + sed -ri "s![#]?(defaultZone: )\S*!\1${EUREKA_URL}!g" ${APPLICATION_YML} + #fi +} + +install_modules(){ + LOG INFO "\033[1m ####### Start To Install project ######\033[0m" + echo "" + if [ ${FORCE_INSTALL} == false ]; then + LOG INFO "\033[1m Install project ......\033[0m" + init_database + init_properties + else + LOG INFO "\033[1m Install project ......\033[0m" + init_database + fi + LOG INFO "\033[1m ####### Finish To Install Project ######\033[0m" +} + + +while [ 1 ]; do + case ${!OPTIND} in + -h|--help) + usage + exit 0 + ;; + "") + break + ;; + *) + echo "Argument error! " 1>&2 + exit 1 + ;; + esac +done + +is_sudo_user +if [ $? == 0 ]; then + SUDO_USER=true +fi + +MODULE_LIST_RESOLVED=() +c=0 +RESOLVED_DIR=${PACKAGE_DIR} + +server="exchangis-server" +LOG INFO "\033[1m ####### server is [${server}] ######\033[0m" +server_list=`ls ${RESOLVED_DIR} | grep -E "^(${server}|${server}_[0-9]+\\.[0-9]+\\.[0-9]+)" | grep -E "(\\.tar\\.gz|\\.zip|)$"` +LOG INFO "\033[1m ####### server_list is [${server_list}] ######\033[0m" +for _server in ${server_list} + do + # More better method to cut string? + _server=${_server%%.tar.gz*} + _server=${_server%%zip*} + MODULE_LIST_RESOLVED[$c]=${_server} + c=$(($c + 1)) + done +if [ ${SKIP_PACKAGE} == true ]; then + MODULE_LIST=${MODULE_LIST_RESOLVED} +else + PACKAGE_NAMES=${MODULE_LIST_RESOLVED} +fi + + +LOG INFO "\033[1m ####### Start To Uncompress Packages ######\033[0m" +LOG INFO "Uncompressing...." +uncompress_packages +LOG INFO "\033[1m ####### Finish To Umcompress Packages ######\033[0m" + + install_modules + + +exit 0 + diff --git a/assembly-package/sbin/launcher.sh b/assembly-package/sbin/launcher.sh new file mode 100644 index 000000000..ba9456329 --- /dev/null +++ b/assembly-package/sbin/launcher.sh @@ -0,0 +1,253 @@ +#!/bin/bash +# +# Copyright 2020 WeBank +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Launcher for modules, provided start/stop functions + +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +ENV_FILE="${DIR}/env.properties" +SHELL_LOG="${DIR}/command.log" +USER_DIR="${DIR}/../" +EXCHANGIS_CONF_PATH="${DIR}/../config" +EXCHANGIS_LIB_PATH="${DIR}/../lib" +EXCHANGIS_LOG_PATH="${DIR}/../logs" +EXCHANGIS_PID_PATH="${DIR}/../runtime" +MODULE_DEFAULT_PREFIX="exchangis-" +# Default +MAIN_CLASS="" +DEBUG_MODE=False +DEBUG_PORT="7006" +SPRING_PROFILE="exchangis" +SLEEP_TIMEREVAL_S=2 + +function LOG(){ + currentTime=`date "+%Y-%m-%d %H:%M:%S.%3N"` + echo -e "$currentTime [${1}] ($$) $2" | tee -a ${SHELL_LOG} +} + +abs_path(){ + SOURCE="${BASH_SOURCE[0]}" + while [ -h "${SOURCE}" ]; do + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "${SOURCE}")" + [[ ${SOURCE} != /* ]] && SOURCE="${DIR}/${SOURCE}" + done + echo "$( cd -P "$( dirname "${SOURCE}" )" && pwd )" +} + +verify_java_env(){ + if [[ "x${JAVA_HOME}" != "x" ]]; then + ${JAVA_HOME}/bin/java -version >/dev/null 2>&1 + else + java -version >/dev/null 2>&1 + fi + if [[ $? -ne 0 ]]; then + cat 1>&2 </dev/null` + if [ "x"${pid_in_file} != "x" ]; then + p=`${JPS} -q | grep ${pid_in_file} | awk '{print $1}'` + fi + fi + else + p=`${JPS} -l | grep "$2" | awk '{print $1}'` + fi + if [ -n "$p" ]; then + # echo "$1 ($2) is still running with pid $p" + return 0 + else + # echo "$1 ($2) does not appear in the java process table" + return 1 + fi +} + +wait_for_startup(){ + local now_s=`date '+%s'` + local stop_s=$((${now_s} + $1)) + while [ ${now_s} -le ${stop_s} ];do + status_class $2 $3 + if [ $? -eq 0 ]; then + return 0 + fi + sleep ${SLEEP_TIMEREVAL_S} + now_s=`date '+%s'` #计算当前时间时间戳 + done + return 1 +} + +wait_for_stop(){ + local now_s=`date '+%s'` + local stop_s=$((${now_s} + $1)) + while [ ${now_s} -le ${stop_s} ];do + status_class $2 $3 + if [ $? -eq 1 ]; then + return 0 + fi + sleep ${SLEEP_TIMEREVAL_S} + now_s=`date '+%s'` + done + return 1 +} + +# Input: $1:module_name, $2:main class +launcher_start(){ + load_env_definitions ${ENV_FILE} + LOG INFO "Launcher: launch to start server [ $1 ]" + status_class $1 $2 + if [[ $? -eq 0 ]]; then + LOG INFO "Launcher: [ $1 ] has been started in process" + return 0 + fi + construct_java_command $1 $2 + # Execute + LOG INFO ${EXEC_JAVA} + nohup ${EXEC_JAVA} >/dev/null 2>&1 & + LOG INFO "Launcher: waiting [ $1 ] to start complete ..." + wait_for_startup 20 $1 $2 + if [[ $? -eq 0 ]]; then + LOG INFO "Launcher: [ $1 ] start success" + LOG INFO "Please check exchangis server in EUREKA_ADDRESS: ${EUREKA_URL} " + else + LOG ERROR "Launcher: [ $1 ] start fail over 20 seconds, please retry it" + fi +} + +# Input: $1:module_name, $2:main class +launcher_stop(){ + load_env_definitions ${ENV_FILE} + LOG INFO "Launcher: stop the server [ $1 ]" + local p="" + local pid_file_path=${EXCHANGIS_PID_PATH}/$1.pid + if [ "x"${pid_file_path} != "x" ]; then + if [ -f ${pid_file_path} ]; then + local pid_in_file=`cat ${pid_file_path} 2>/dev/null` + if [ "x"${pid_in_file} != "x" ]; then + p=`${JPS} -q | grep ${pid_in_file} | awk '{print $1}'` + fi + fi + elif [[ "x"$2 != "x" ]]; then + p=`${JPS} -l | grep "$2" | awk '{print $1}'` + fi + if [[ -z ${p} ]]; then + LOG INFO "Launcher: [ $1 ] didn't start successfully, not found in the java process table" + return 0 + fi + case "`uname`" in + CYCGWIN*) taskkill /PID "${p}" ;; + *) kill -SIGTERM "${p}" ;; + esac + LOG INFO "Launcher: waiting [ $1 ] to stop complete ..." + wait_for_stop 20 + if [[ $? -eq 0 ]]; then + LOG INFO "Launcher: [ $1 ] stop success" + else + LOG ERROR "Launcher: [ $1 ] stop exceeded over 20s " >&2 + return 1 + fi +} \ No newline at end of file diff --git a/assembly-package/sbin/start-server.sh b/assembly-package/sbin/start-server.sh new file mode 100644 index 000000000..5889993c8 --- /dev/null +++ b/assembly-package/sbin/start-server.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# +# Copyright 2020 WeBank +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Start exchangis-server module +MODULE_NAME="exchangis-server" + +function LOG(){ + currentTime=`date "+%Y-%m-%d %H:%M:%S.%3N"` + echo -e "$currentTime [${1}] ($$) $2" | tee -a ${SHELL_LOG} +} + +abs_path(){ + SOURCE="${BASH_SOURCE[0]}" + while [ -h "${SOURCE}" ]; do + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "${SOURCE}")" + [[ ${SOURCE} != /* ]] && SOURCE="${DIR}/${SOURCE}" + done + echo "$( cd -P "$( dirname "${SOURCE}" )" && pwd )" +} + +BIN=`abs_path` +SHELL_LOG="${BIN}/console.out" + +interact_echo(){ + while [ 1 ]; do + read -p "$1 (Y/N)" yn + if [ "${yn}x" == "Yx" ] || [ "${yn}x" == "yx" ]; then + return 0 + elif [ "${yn}x" == "Nx" ] || [ "${yn}x" == "nx" ]; then + return 1 + else + echo "Unknown choise: [$yn], please choose again." + fi + done +} + +start_main(){ + +} +exit $? diff --git a/assembly-package/src/main/assembly/assembly.xml b/assembly-package/src/main/assembly/assembly.xml new file mode 100644 index 000000000..e873afe23 --- /dev/null +++ b/assembly-package/src/main/assembly/assembly.xml @@ -0,0 +1,77 @@ + + + exchangis + + tar.gz + + false + + + + ${basedir}/sbin + + * + + 0777 + sbin + unix + + + ${basedir}/bin + + * + + 0777 + bin + unix + + + ${basedir}/config + + * + + 0777 + config + unix + + + + ${basedir}/../db + + * + + 0777 + db + unix + + + + ${basedir}/../exchangis-server/target/packages + + *.tar.gz + *.zip + + 0755 + packages + + + + \ No newline at end of file diff --git a/assembly/package.xml b/assembly/package.xml deleted file mode 100644 index cef49a33c..000000000 --- a/assembly/package.xml +++ /dev/null @@ -1,41 +0,0 @@ - - main - - tar.gz - - true - - - ../packages - - exchangis* - - packages - - - unix - ../bin - bin - 0755 - - - ../docs - docs - - - ../images - images - - - ../ - unix - - README.md - LICENSE - - / - - - \ No newline at end of file diff --git a/assembly/pom.xml b/assembly/pom.xml deleted file mode 100644 index 9a8450e67..000000000 --- a/assembly/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - 4.0.0 - - - com.webank.wedatasphere.exchangis - exchangis - 0.5.0.RELEASE - ../pom.xml - - exchangis-assembly - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - ${basedir}/package.xml - - wedatasphere-${project.parent.artifactId}-${project.parent.version} - ../build - - - - - \ No newline at end of file diff --git a/bin/exchangis-init.sql b/bin/exchangis-init.sql deleted file mode 100644 index 0829c029a..000000000 --- a/bin/exchangis-init.sql +++ /dev/null @@ -1,510 +0,0 @@ - -CREATE TABLE IF NOT EXISTS `exchangis_data_source` ( - `id` bigint(13) NOT NULL AUTO_INCREMENT, - `source_name` varchar(100) NOT NULL COMMENT 'Data Source Name', - `source_type` varchar(50) DEFAULT NULL COMMENT 'Data Source Type', - `source_desc` varchar(200) DEFAULT NULL, - `owner` varchar(50) DEFAULT 'Exchangis' COMMENT 'Data Source Owner', - `create_user` varchar(50) DEFAULT NULL COMMENT 'Create User', - `parameter` text COMMENT 'Parameters', - `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `modify_user` varchar(50) DEFAULT NULL COMMENT 'Modify User', - `modify_time` datetime DEFAULT NULL COMMENT 'Modify Time', - `model_id` int(11) DEFAULT NULL, - `auth_entity` varchar(200) DEFAULT NULL COMMENT 'Auth Entity', - `auth_creden` varchar(200) DEFAULT NULL COMMENT 'Auth Credential', - `project_id` bigint(13) DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_data_source_model` ( - `id` bigint(13) NOT NULL AUTO_INCREMENT, - `model_name` varchar(100) NOT NULL COMMENT 'Model Name', - `source_type` varchar(50) DEFAULT NULL COMMENT 'Data Source Type', - `model_desc` varchar(200) DEFAULT NULL COMMENT 'Model Description', - `create_owner` varchar(50) DEFAULT '' COMMENT 'Create Owner', - `create_user` varchar(50) DEFAULT NULL COMMENT 'Create User', - `parameter` text NOT NULL COMMENT 'Parameters', - `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `modify_user` varchar(50) DEFAULT NULL COMMENT 'Modify User', - `modify_time` datetime DEFAULT NULL COMMENT 'Modify Time', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_data_source_owner` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `owner_name` varchar(50) NOT NULL COMMENT 'Owner Name', - `owner_desc` varchar(200) DEFAULT NULL COMMENT 'Owner Description', - `create_user` varchar(20) DEFAULT NULL COMMENT 'Create User', - `create_time` datetime DEFAULT NULL COMMENT 'Create Time', - `modify_user` varchar(20) DEFAULT NULL COMMENT 'Modify User', - `modify_time` datetime DEFAULT NULL COMMENT 'Modify Time', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_data_source_permissions` ( - `data_source_id` bigint(13) NOT NULL, - `access_readable` tinyint(1) DEFAULT '0', - `access_writable` tinyint(1) DEFAULT '0', - `access_editable` tinyint(1) DEFAULT '0', - `access_executable` tinyint(1) DEFAULT '0', - `modify_time` datetime DEFAULT NULL COMMENT 'Modify Time', - `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create Time', - PRIMARY KEY (`data_source_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_executor_node` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `address` varchar(20) NOT NULL COMMENT 'Address', - `heartbeat_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `status` int(11) NOT NULL DEFAULT '0' COMMENT 'Status:0-Up,1-Down', - `mem_rate` float DEFAULT '0' COMMENT 'Memory Usage', - `cpu_rate` float DEFAULT '0' COMMENT 'CPU Usage', - `default_node` tinyint(2) DEFAULT NULL COMMENT 'Default Node', - PRIMARY KEY (`id`), - KEY `addres_index` (`address`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_executor_node_tab` ( - `exec_node_id` int(11) NOT NULL COMMENT 'Excutor Node ID', - `tab_id` int(11) NOT NULL COMMENT 'Tab ID', - `tab_name` varchar(200) NOT NULL COMMENT 'Tab Name', - `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create Time', - PRIMARY KEY (`exec_node_id`,`tab_id`), - KEY `tab_name` (`tab_name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_executor_node_user` ( - `exec_node_id` int(11) NOT NULL COMMENT 'Excutor Node ID', - `exec_user` varchar(50) NOT NULL COMMENT 'Executive User', - `user_type` varchar(50) DEFAULT '' COMMENT 'User Type', - `relation_state` int(2) NOT NULL DEFAULT '0' COMMENT 'Relation State : 0-UnRelated, 1-Relate Success, 2-Relate Fail', - `uid` int(4) DEFAULT NULL COMMENT 'Machine User ID', - `gid` int(4) DEFAULT NULL COMMENT 'Machine Group ID', - `mark_del` tinyint(4) DEFAULT '0' COMMENT 'Mark Delete', - `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Update Time', - PRIMARY KEY (`exec_node_id`,`exec_user`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_executor_user` ( - `id` int(4) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `exec_user` varchar(50) NOT NULL COMMENT 'Executive User', - `description` varchar(200) DEFAULT '' COMMENT 'Description', - `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - UNIQUE KEY `exec_user` (`exec_user`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_group` ( - `id` bigint(13) NOT NULL AUTO_INCREMENT, - `group_name` varchar(50) NOT NULL COMMENT 'Group Name', - `group_desc` varchar(100) DEFAULT NULL, - `ref_project_id` bigint(13) DEFAULT '0', - `create_user` varchar(50) DEFAULT NULL, - `create_time` datetime NOT NULL, - `modify_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_job_exec` ( - `job_id` bigint(20) NOT NULL COMMENT 'Job ID', - `exec_id` int(11) NOT NULL COMMENT 'Executor Node ID', - `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`job_id`,`exec_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_job_info` ( - `id` bigint(13) NOT NULL AUTO_INCREMENT, - `job_name` varchar(100) NOT NULL COMMENT 'Job Name', - `job_cron` varchar(32) DEFAULT NULL COMMENT 'Corn Expression', - `job_desc` varchar(255) DEFAULT NULL COMMENT 'Desc', - `job_type` int(11) DEFAULT '1' COMMENT 'Job Type', - `create_user` varchar(50) DEFAULT NULL COMMENT 'Create User', - `alarm_user` varchar(255) DEFAULT NULL COMMENT 'Alarm User', - `alarm_level` int(11) DEFAULT '5' COMMENT 'Alarm Level', - `fail_retery_count` int(11) DEFAULT '0', - `project_id` bigint(13) DEFAULT NULL, - `data_src_id` bigint(13) DEFAULT NULL, - `data_dst_id` bigint(13) DEFAULT NULL, - `data_src_type` varchar(50) DEFAULT NULL, - `data_dst_type` varchar(50) DEFAULT NULL, - `data_src_owner` varchar(50) DEFAULT NULL , - `data_dest_owner` varchar(50) DEFAULT NULL, - `job_config` text NOT NULL COMMENT 'Job Conf', - `timeout` int(11) DEFAULT '0', - `exec_user` varchar(50) DEFAULT '', - `sync` varchar(45) DEFAULT NULL, - `modify_user` varchar(50) DEFAULT NULL COMMENT 'Modify User', - `create_time` datetime DEFAULT NULL, - `last_trigger_time` datetime DEFAULT NULL, - `engine_type` varchar(45) DEFAULT '', - `disposable` tinyint(2) DEFAULT '0', - `modify_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - KEY `index_user` (`create_user`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_job_info_params` ( - `job_id` bigint(13) NOT NULL, - `param_name` varchar(100) NOT NULL, - `param_val` varchar(200) DEFAULT '', - `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`job_id`,`param_name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_job_proc` ( - `job_id` bigint(13) NOT NULL, - `proc_src_code` text, - `language` varchar(20) NOT NULL DEFAULT 'java', - PRIMARY KEY (`job_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_job_report` ( - `id` bigint(13) NOT NULL, - `job_id` bigint(13) DEFAULT NULL, - `total_costs` double DEFAULT NULL COMMENT 'Cost Time', - `byte_speed_per_second` bigint(20) DEFAULT NULL , - `record_speed_per_second` bigint(20) DEFAULT NULL , - `total_read_records` bigint(20) DEFAULT NULL , - `total_read_bytes` bigint(20) DEFAULT NULL, - `total_error_records` bigint(20) DEFAULT NULL , - `transformer_total_records` bigint(20) DEFAULT NULL, - `transformer_failed_records` bigint(20) DEFAULT NULL, - `transformer_filter_records` bigint(20) DEFAULT NULL, - `create_time` datetime DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `job_id_index` (`job_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_job_task` ( - `id` bigint(13) NOT NULL, - `executer_address` varchar(100) DEFAULT NULL COMMENT 'Executor Address', - `job_id` bigint(13) DEFAULT NULL, - `job_name` varchar(100) DEFAULT NULL, - `job_create_user` varchar(50) DEFAULT NULL, - `job_alarm_user` varchar(255) DEFAULT NULL, - `trigger_type` varchar(20) DEFAULT NULL COMMENT 'Trigger Type', - `trigger_time` datetime NOT NULL COMMENT 'Trigger Time', - `trigger_status` varchar(20) DEFAULT NULL COMMENT 'Trigger Status', - `trigger_msg` varchar(255) DEFAULT NULL COMMENT 'Trigger Log', - `operater` varchar(50) DEFAULT NULL COMMENT 'Operator', - `status` varchar(50) DEFAULT NULL COMMENT 'Status ,such as: kill,sucess,failed', - `run_times` int(11) DEFAULT NULL COMMENT 'Run Times', - `execute_msg` varchar(1000) DEFAULT NULL COMMENT 'Execute Msg', - `complete_time` datetime DEFAULT NULL COMMENT 'Complete Time', - `disposable` tinyint(2) DEFAULT '0', - `version` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `exec_user` varchar(50) DEFAULT '', - `project_id` bigint(13) DEFAULT '0' COMMENT 'Project Related', - `state_speed` bigint(20) DEFAULT NULL, - `speed_limit_mb` int(12) DEFAULT '0', - PRIMARY KEY (`id`), - KEY `job_id` (`job_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_job_task_params` ( - `task_id` bigint(11) NOT NULL, - `param_name` varchar(100) NOT NULL, - `param_val` varchar(100) DEFAULT '', - `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`task_id`,`param_name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_project` ( - `id` bigint(13) NOT NULL AUTO_INCREMENT, - `project_name` varchar(100) NOT NULL COMMENT 'Project Name', - `project_desc` varchar(200) DEFAULT NULL COMMENT 'Desc', - `parent_id` bigint(13) DEFAULT NULL, - `create_user` varchar(20) DEFAULT NULL COMMENT 'Create User', - `create_time` datetime DEFAULT NULL COMMENT 'Create Time', - `modify_user` varchar(20) DEFAULT NULL COMMENT 'Modify User', - `modify_time` datetime DEFAULT NULL COMMENT 'Modify Time', - UNIQUE KEY `project_name_create_user` (`project_name`,`create_user`), - PRIMARY KEY (`id`), - KEY `index_user` (`create_user`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_queue_elements` ( - `sid` bigint(11) NOT NULL COMMENT 'Seq ID', - `qid` int(11) NOT NULL COMMENT 'Queue ID', - `status` int(11) NOT NULL COMMENT 'Element Status', - `enq_time` datetime DEFAULT NULL COMMENT 'Enque Time', - `poll_time` datetime DEFAULT NULL COMMENT 'Poll Time', - `enq_count` int(1) DEFAULT '1', - `delay_time` datetime DEFAULT NULL, - `delay_count` int(1) DEFAULT '0', - `version` int(2) DEFAULT '0' COMMENT 'Version', - `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`sid`), - KEY `enq_time` (`enq_time`), - KEY `poll_time` (`poll_time`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_queue_info` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `qname` varchar(50) NOT NULL COMMENT 'Queue Name', - `description` varchar(200) DEFAULT '', - `priority` int(11) NOT NULL DEFAULT '-1', - `is_lock` tinyint(1) DEFAULT '0', - `lock_host` varchar(50) DEFAULT NULL, - `lock_time` datetime DEFAULT NULL, - `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_tab` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(200) NOT NULL COMMENT 'Tab Name', - `description` varchar(200) DEFAULT '' COMMENT 'Desc', - `type` int(4) DEFAULT NULL COMMENT 'Tab Type', - `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create Time', - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_user_exec` ( - `app_user` varchar(50) NOT NULL COMMENT 'APP User', - `exec_user` varchar(50) NOT NULL COMMENT 'Executive User', - PRIMARY KEY (`app_user`,`exec_user`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_user_exec_node` ( - `app_user` varchar(50) NOT NULL COMMENT 'APP User', - `exec_node_id` int(11) NOT NULL COMMENT 'Executor Node ID', - `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`app_user`,`exec_node_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_user_group` ( - `user_name` varchar(50) NOT NULL COMMENT 'User Name', - `group_id` int(11) NOT NULL COMMENT 'Group ID', - `join_role` int(4) DEFAULT '0' COMMENT 'Join Role', - `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create Time', - PRIMARY KEY (`user_name`,`group_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_user_info` ( - `id` bigint(11) NOT NULL AUTO_INCREMENT, - `username` varchar(50) NOT NULL, - `password` varchar(200) DEFAULT '', - `user_type` int(11) DEFAULT '0', - `org_code` varchar(50) DEFAULT '', - `dept_code` varchar(50) DEFAULT '', - `update_time` datetime NOT NULL, - `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - UNIQUE KEY `username` (`username`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_job_func`( - `id` INT(11) PRIMARY KEY NOT NULL AUTO_INCREMENT, - `func_type` VARCHAR(50) NOT NULL, - `func_name` VARCHAR(100) NOT NULL, - `tab_name` VARCHAR(50) NOT NULL COMMENT 'Tab', - `name_dispaly` VARCHAR(100), - `param_num` INT(11) DEFAULT 0, - `ref_name` VARCHAR(100) DEFAULT NULL, - `description` VARCHAR(200), - `modify_time` DATETIME DEFAULT NULL, - `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - UNIQUE INDEX `job_func_tab_name_idx`(`tab_name`, `func_name`) -)Engine=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `exchangis_job_func_params`( - `func_id` INT(11) NOT NULL, - `param_name` VARCHAR(100) NOT NULL, - `order` INT(11) DEFAULT 0, - `name_display` VARCHAR(100), - `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY(`func_id`, `param_name`) -)Engine=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `EXCHANGIS_QRTZ_JOB_DETAILS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `JOB_NAME` varchar(190) NOT NULL, - `JOB_GROUP` varchar(190) NOT NULL, - `DESCRIPTION` varchar(250) DEFAULT NULL, - `JOB_CLASS_NAME` varchar(250) NOT NULL, - `IS_DURABLE` varchar(1) NOT NULL, - `IS_NONCONCURRENT` varchar(1) NOT NULL, - `IS_UPDATE_DATA` varchar(1) NOT NULL, - `REQUESTS_RECOVERY` varchar(1) NOT NULL, - `JOB_DATA` blob, - PRIMARY KEY (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), - KEY `IDX_QRTZ_J_REQ_RECOVERY` (`SCHED_NAME`,`REQUESTS_RECOVERY`), - KEY `IDX_QRTZ_J_GRP` (`SCHED_NAME`,`JOB_GROUP`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `EXCHANGIS_QRTZ_TRIGGERS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `TRIGGER_NAME` varchar(190) NOT NULL, - `TRIGGER_GROUP` varchar(190) NOT NULL, - `JOB_NAME` varchar(190) NOT NULL, - `JOB_GROUP` varchar(190) NOT NULL, - `DESCRIPTION` varchar(250) DEFAULT NULL, - `NEXT_FIRE_TIME` bigint(13) DEFAULT NULL, - `PREV_FIRE_TIME` bigint(13) DEFAULT NULL, - `PRIORITY` int(11) DEFAULT NULL, - `TRIGGER_STATE` varchar(16) NOT NULL, - `TRIGGER_TYPE` varchar(8) NOT NULL, - `START_TIME` bigint(13) NOT NULL, - `END_TIME` bigint(13) DEFAULT NULL, - `CALENDAR_NAME` varchar(190) DEFAULT NULL, - `MISFIRE_INSTR` smallint(2) DEFAULT NULL, - `JOB_DATA` blob, - PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), - KEY `IDX_QRTZ_T_J` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), - KEY `IDX_QRTZ_T_JG` (`SCHED_NAME`,`JOB_GROUP`), - KEY `IDX_QRTZ_T_C` (`SCHED_NAME`,`CALENDAR_NAME`), - KEY `IDX_QRTZ_T_G` (`SCHED_NAME`,`TRIGGER_GROUP`), - KEY `IDX_QRTZ_T_STATE` (`SCHED_NAME`,`TRIGGER_STATE`), - KEY `IDX_QRTZ_T_N_STATE` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), - KEY `IDX_QRTZ_T_N_G_STATE` (`SCHED_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), - KEY `IDX_QRTZ_T_NEXT_FIRE_TIME` (`SCHED_NAME`,`NEXT_FIRE_TIME`), - KEY `IDX_QRTZ_T_NFT_ST` (`SCHED_NAME`,`TRIGGER_STATE`,`NEXT_FIRE_TIME`), - KEY `IDX_QRTZ_T_NFT_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`), - KEY `IDX_QRTZ_T_NFT_ST_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_STATE`), - KEY `IDX_QRTZ_T_NFT_ST_MISFIRE_GRP` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), - CONSTRAINT `EXCHANGIS_QRTZ_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) REFERENCES `EXCHANGIS_QRTZ_JOB_DETAILS` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `EXCHANGIS_QRTZ_SIMPLE_TRIGGERS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `TRIGGER_NAME` varchar(190) NOT NULL, - `TRIGGER_GROUP` varchar(190) NOT NULL, - `REPEAT_COUNT` bigint(7) NOT NULL, - `REPEAT_INTERVAL` bigint(12) NOT NULL, - `TIMES_TRIGGERED` bigint(10) NOT NULL, - PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), - CONSTRAINT `EXCHANGIS_QRTZ_SIMPLE_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `EXCHANGIS_QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `EXCHANGIS_QRTZ_CRON_TRIGGERS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `TRIGGER_NAME` varchar(190) NOT NULL, - `TRIGGER_GROUP` varchar(190) NOT NULL, - `CRON_EXPRESSION` varchar(120) NOT NULL, - `TIME_ZONE_ID` varchar(80) DEFAULT NULL, - PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), - CONSTRAINT `EXCHANGIS_QRTZ_CRON_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `EXCHANGIS_QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `EXCHANGIS_QRTZ_SIMPROP_TRIGGERS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `TRIGGER_NAME` varchar(190) NOT NULL, - `TRIGGER_GROUP` varchar(190) NOT NULL, - `STR_PROP_1` varchar(512) DEFAULT NULL, - `STR_PROP_2` varchar(512) DEFAULT NULL, - `STR_PROP_3` varchar(512) DEFAULT NULL, - `INT_PROP_1` int(11) DEFAULT NULL, - `INT_PROP_2` int(11) DEFAULT NULL, - `LONG_PROP_1` bigint(20) DEFAULT NULL, - `LONG_PROP_2` bigint(20) DEFAULT NULL, - `DEC_PROP_1` decimal(13,4) DEFAULT NULL, - `DEC_PROP_2` decimal(13,4) DEFAULT NULL, - `BOOL_PROP_1` varchar(1) DEFAULT NULL, - `BOOL_PROP_2` varchar(1) DEFAULT NULL, - PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), - CONSTRAINT `EXCHANGIS_QRTZ_SIMPROP_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `EXCHANGIS_QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `EXCHANGIS_QRTZ_BLOB_TRIGGERS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `TRIGGER_NAME` varchar(190) NOT NULL, - `TRIGGER_GROUP` varchar(190) NOT NULL, - `BLOB_DATA` blob, - PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), - KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), - CONSTRAINT `EXCHANGIS_QRTZ_BLOB_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `EXCHANGIS_QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `EXCHANGIS_QRTZ_CALENDARS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `CALENDAR_NAME` varchar(190) NOT NULL, - `CALENDAR` blob NOT NULL, - PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `EXCHANGIS_QRTZ_PAUSED_TRIGGER_GRPS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `TRIGGER_GROUP` varchar(190) NOT NULL, - PRIMARY KEY (`SCHED_NAME`,`TRIGGER_GROUP`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `EXCHANGIS_QRTZ_FIRED_TRIGGERS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `ENTRY_ID` varchar(95) NOT NULL, - `TRIGGER_NAME` varchar(190) NOT NULL, - `TRIGGER_GROUP` varchar(190) NOT NULL, - `INSTANCE_NAME` varchar(190) NOT NULL, - `FIRED_TIME` bigint(13) NOT NULL, - `SCHED_TIME` bigint(13) NOT NULL, - `PRIORITY` int(11) NOT NULL, - `STATE` varchar(16) NOT NULL, - `JOB_NAME` varchar(190) DEFAULT NULL, - `JOB_GROUP` varchar(190) DEFAULT NULL, - `IS_NONCONCURRENT` varchar(1) DEFAULT NULL, - `REQUESTS_RECOVERY` varchar(1) DEFAULT NULL, - PRIMARY KEY (`SCHED_NAME`,`ENTRY_ID`), - KEY `IDX_QRTZ_FT_TRIG_INST_NAME` (`SCHED_NAME`,`INSTANCE_NAME`), - KEY `IDX_QRTZ_FT_INST_JOB_REQ_RCVRY` (`SCHED_NAME`,`INSTANCE_NAME`,`REQUESTS_RECOVERY`), - KEY `IDX_QRTZ_FT_J_G` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), - KEY `IDX_QRTZ_FT_JG` (`SCHED_NAME`,`JOB_GROUP`), - KEY `IDX_QRTZ_FT_T_G` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), - KEY `IDX_QRTZ_FT_TG` (`SCHED_NAME`,`TRIGGER_GROUP`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `EXCHANGIS_QRTZ_SCHEDULER_STATE` ( - `SCHED_NAME` varchar(120) NOT NULL, - `INSTANCE_NAME` varchar(190) NOT NULL, - `LAST_CHECKIN_TIME` bigint(13) NOT NULL, - `CHECKIN_INTERVAL` bigint(13) NOT NULL, - PRIMARY KEY (`SCHED_NAME`,`INSTANCE_NAME`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `EXCHANGIS_QRTZ_LOCKS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `LOCK_NAME` varchar(40) NOT NULL, - PRIMARY KEY (`SCHED_NAME`,`LOCK_NAME`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- Init Tab -INSERT INTO `exchangis_tab`(`name`, `description`, `type`) VALUES ('DATAX', 'Alibaba DataX Engine', 0) ON DUPLICATE KEY UPDATE `type` = 0; -INSERT INTO `exchangis_tab`(`name`, `description`, `type`) VALUES ('SQOOP', 'Apache Sqoop Engine', 0) ON DUPLICATE KEY UPDATE `type` = 0; - --- Init Queue -INSERT INTO `exchangis_queue_info`(`id`, `qname`, `description`) VALUES(1, 'public-queue-01','none') ON DUPLICATE KEY UPDATE `description` = 'none'; - --- Add Data Source Owner -INSERT INTO `exchangis_data_source_owner`(`id`, `owner_name`, `owner_desc`) VALUES(1, 'Exchangis', 'WeDataSphere Exchangis') ON DUPLICATE KEY UPDATE `owner_name` = 'Exchangis'; - --- Add Admin User -INSERT INTO `exchangis_user_info`(`username`, `password`, `user_type`, `update_time`) VALUES('admin', '3ef7164d1f6167cb9f2658c07d3c2f0a', 2, now()) ON DUPLICATE KEY UPDATE `user_type` = 2; - --- Add Job Function -INSERT INTO `exchangis_job_func`(`id`,`func_type`, `tab_name`, `func_name`, `param_num`) VALUES(1, 'TRANSFORM', 'DATAX', 'dx_substr', 2) ON DUPLICATE KEY UPDATE `func_type` = 'TRANSFROM'; -INSERT INTO `exchangis_job_func`(`id`,`func_type`, `tab_name`, `func_name`, `param_num`) VALUES(2, 'TRANSFORM', 'DATAX', 'dx_pad', 3) ON DUPLICATE KEY UPDATE `func_type` = 'TRANSFROM'; -INSERT INTO `exchangis_job_func`(`id`,`func_type`, `tab_name`, `func_name`, `param_num`) VALUES(3, 'TRANSFORM', 'DATAX', 'dx_replace', 3) ON DUPLICATE KEY UPDATE `func_type` = 'TRANSFROM'; -INSERT INTO `exchangis_job_func`(`id`,`func_type`, `tab_name`, `func_name`, `param_num`, `ref_name`) VALUES(4, 'VERIFY', 'DATAX', 'like', 1, 'dx_filter') ON DUPLICATE KEY UPDATE `func_type` = 'VERIFY'; -INSERT INTO `exchangis_job_func`(`id`,`func_type`, `tab_name`, `func_name`, `param_num`, `ref_name`) VALUES(5, 'VERIFY', 'DATAX', 'not like', 1, 'dx_filter') ON DUPLICATE KEY UPDATE `func_type` = 'VERIFY'; -INSERT INTO `exchangis_job_func`(`id`,`func_type`, `tab_name`, `func_name`, `param_num`, `ref_name`) VALUES(6, 'VERIFY', 'DATAX', '>', 1, 'dx_filter') ON DUPLICATE KEY UPDATE `func_type` = 'VERIFY'; -INSERT INTO `exchangis_job_func`(`id`,`func_type`, `tab_name`, `func_name`, `param_num`, `ref_name`) VALUES(7, 'VERIFY', 'DATAX', '<', 1, 'dx_filter') ON DUPLICATE KEY UPDATE `func_type` = 'VERIFY'; -INSERT INTO `exchangis_job_func`(`id`,`func_type`, `tab_name`, `func_name`, `param_num`, `ref_name`) VALUES(8, 'VERIFY', 'DATAX', '=', 1, 'dx_filter') ON DUPLICATE KEY UPDATE `func_type` = 'VERIFY'; -INSERT INTO `exchangis_job_func`(`id`,`func_type`, `tab_name`, `func_name`, `param_num`, `ref_name`) VALUES(9, 'VERIFY', 'DATAX', '!=', 1, 'dx_filter') ON DUPLICATE KEY UPDATE `func_type` = 'VERIFY'; -INSERT INTO `exchangis_job_func`(`id`,`func_type`, `tab_name`, `func_name`, `param_num`, `ref_name`) VALUES(10, 'VERIFY', 'DATAX', '>=', 1, 'dx_filter') ON DUPLICATE KEY UPDATE `func_type` = 'VERIFY'; - -INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(1, 'startIndex', 'startIndex', 0) ON DUPLICATE KEY UPDATE `name_display` = 'startIndex'; -INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(1, 'length', 'length', 1) ON DUPLICATE KEY UPDATE `name_display` = 'length'; -INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(2, 'padType', 'padType(r or l)', 0) ON DUPLICATE KEY UPDATE `name_display` = 'padType(r or l)'; -INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(2, 'length', 'length', 1) ON DUPLICATE KEY UPDATE `name_display` = 'length'; -INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(2, 'padString', 'padString', 2) ON DUPLICATE KEY UPDATE `name_display` = 'padString'; -INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(3, 'startIndex', 'startIndex', 0) ON DUPLICATE KEY UPDATE `name_display` = 'startIndex'; -INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(3, 'length', 'length', 1) ON DUPLICATE KEY UPDATE `name_display` = 'length'; -INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(3, 'replaceString', 'replaceString', 2) ON DUPLICATE KEY UPDATE `name_display` = 'replaceString'; -INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(4, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value'; -INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(5, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value'; -INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(6, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value'; -INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(7, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value'; -INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(8, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value'; -INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(9, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value'; -INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(10, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value'; \ No newline at end of file diff --git a/bin/install.sh b/bin/install.sh deleted file mode 100644 index 324954009..000000000 --- a/bin/install.sh +++ /dev/null @@ -1,283 +0,0 @@ -#!/bin/bash -# -# Copyright 2020 WeBank -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -export BASE_LOG_DIR="" -export BASE_CONF_DIR="" -export BASE_DATA_DIR="" -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -SHELL_LOG="${DIR}/console.out" -export SQL_SOURCE_PATH="${DIR}/exchangis-init.sql" -MODULES_DIR="${DIR}/../modules" -PACKAGE_DIR="${DIR}/../packages" -MODULE_LIST=() -CONF_FILE_PATH="bin/configure.sh" -FORCE_INSTALL=false -SKIP_PACKAGE=false -SAFE_MODE=true -UNSAFE_COMMAND="" -USER=`whoami` -SUDO_USER=false - -usage(){ - printf "\033[1m Install usage:\n\033[0m" - printf "\t%-15s %-15s %-2s \n" "-m|--modules" "modules to install" "Define the modules to install" - printf "\t%-15s %-15s %-2s \n" "-f|--force" "force install" "Force program to install modules" - printf "\t%-15s %-15s %-2s \n" "--skip-pack" "do not decompress" "Skip the phrase of decompressing packages" - printf "\t%-15s %-15s %-2s \n" "--unsafe" "unsafe mode" "Will clean the module directory existed" - printf "\t%-15s %-15s %-2s \n" "--safe" "safe mode" "Will not modify the module directory existed (Default)" - printf "\t%-15s %-15s %-2s \n" "-h|--help" "usage" "View command list" -} - -function LOG(){ - currentTime=`date "+%Y-%m-%d %H:%M:%S.%3N"` - echo -e "$currentTime [${1}] ($$) $2" | tee -a ${SHELL_LOG} -} - -is_sudo_user(){ - sudo -v >/dev/null 2>&1 -} - -clean_modules(){ - if [ ${#MODULE_LIST[@]} -gt 0 ]; then - for server in ${MODULE_LIST[@]} - do - rm -rf ${MODULES_DIR}/${server} - done - else - rm -rf ${MODULES_DIR}/* - fi -} - -uncompress_packages(){ - local list=`ls ${PACKAGE_DIR}` - for pack in ${list} - do - local uncompress=true - if [ ${#PACKAGE_NAMES[@]} -gt 0 ]; then - uncompress=false - for server in ${PACKAGE_NAMES[@]} - do - if [ ${server} == ${pack%%.tar.gz*} ] || [ ${server} == ${pack%%.zip*} ]; then - uncompress=true - break - fi - done - fi - if [ ${uncompress} == true ]; then - if [[ ${pack} =~ tar\.gz$ ]]; then - local do_uncompress=0 - if [ ${FORCE_INSTALL} == false ]; then - interact_echo "Do you want to decompress this package: [${pack}]?" - do_uncompress=$? - fi - if [ ${do_uncompress} == 0 ]; then - LOG INFO "\033[1m Uncompress package: [${pack}] to modules directory\033[0m" - tar --skip-old-files -zxf ${PACKAGE_DIR}/${pack} -C ${MODULES_DIR} - fi - elif [[ ${pack} =~ zip$ ]]; then - local do_uncompress=0 - if [ ${FORCE_INSTALL} == false ]; then - interact_echo "Do you want to decompress this package: [${pack}]?" - do_uncompress=$? - fi - if [ ${do_uncompress} == 0 ]; then - LOG INFO "\033[1m Uncompress package: [${pack}] to modules directory\033[0m" - unzip -nq ${PACKAGE_DIR}/${pack} -d ${MODULES_DIR} - fi - fi - # skip other packages - fi - done -} - -interact_echo(){ - while [ 1 ]; do - read -p "$1 (Y/N)" yn - if [ "${yn}x" == "Yx" ] || [ "${yn}x" == "yx" ]; then - return 0 - elif [ "${yn}x" == "Nx" ] || [ "${yn}x" == "nx" ]; then - return 1 - else - echo "Unknown choise: [$yn], please choose again." - fi - done -} - -install_modules(){ - LOG INFO "\033[1m ####### Start To Install Modules ######\033[0m" - LOG INFO "Module servers could be installed:" - for server in ${MODULE_LIST[@]} - do - printf "\\033[1m [${server}] \033[0m" - done - echo "" - for server in ${MODULE_LIST[@]} - do - if [ ${FORCE_INSTALL} == false ]; then - interact_echo "Do you want to confiugre and install [${server}]?" - if [ $? == 0 ]; then - LOG INFO "\033[1m Install module server: [${server}]\033[0m" - # Call configure.sh - ${MODULES_DIR}/${server}/${CONF_FILE_PATH} ${UNSAFE_COMMAND} - fi - else - LOG INFO "\033[1m Install module server: [${server}]\033[0m" - # Call configure.sh - ${MODULES_DIR}/${server}/${CONF_FILE_PATH} ${UNSAFE_COMMAND} - fi - done - LOG INFO "\033[1m ####### Finish To Install Modules ######\033[0m" -} - -scan_to_install_modules(){ - echo "Scan modules directory: [$1] to find server under exchangis" - let c=0 - ls_out=`ls $1` - for dir in ${ls_out} - do - if test -e "$1/${dir}/${CONF_FILE_PATH}"; then - MODULE_LIST[$c]=${dir} - ((c++)) - fi - done - install_modules -} - -while [ 1 ]; do - case ${!OPTIND} in - -h|--help) - usage - exit 0 - ;; - -m|--modules) - i=1 - if [ -z $2 ]; then - echo "Empty modules" - exit 1 - fi - while [ 1 ]; do - split=`echo $2|cut -d "," -f${i}` - if [ "$split" != "" ]; - then - c=$(($i - 1)) - MODULE_LIST[$c]=${split} - i=$(($i + 1)) - else - break - fi - if [ "`echo $2 |grep ","`" == "" ]; then - break - fi - done - shift 2 - ;; - -f|--force) - FORCE_INSTALL=true - shift 1 - ;; - --skip-pack) - SKIP_PACKAGE=true - shift 1 - ;; - --safe) - SAFE_MODE=true - UNSAFE_COMMAND="" - shift 1 - ;; - --unsafe) - SAFE_MODE=false - UNSAFE_COMMAND="--unsafe" - shift 1 - ;; - "") - break - ;; - *) - echo "Argument error! " 1>&2 - exit 1 - ;; - esac -done - -is_sudo_user -if [ $? == 0 ]; then - SUDO_USER=true -fi -MODULE_LIST_RESOLVED=() -if [ ${#MODULE_LIST[@]} -gt 0 ]; then - c=0 - RESOLVED_DIR=${PACKAGE_DIR} - if [ ${SKIP_PACKAGE} == true ]; then - RESOLVED_DIR=${MODULES_DIR} - fi - for server in ${MODULE_LIST[@]} - do - server_list=`ls ${RESOLVED_DIR} | grep -E "^(${server}|${server}_[0-9]+\\.[0-9]+\\.[0-9]+\\.RELEASE_[0-9]+)(\\.tar\\.gz|\\.zip|)$"` - for _server in ${server_list} - do - # More better method to cut string? - _server=${_server%%.tar.gz*} - _server=${_server%%zip*} - MODULE_LIST_RESOLVED[$c]=${_server} - c=$(($c + 1)) - done - done - if [ ${SKIP_PACKAGE} == true ]; then - MODULE_LIST=${MODULE_LIST_RESOLVED} - else - PACKAGE_NAMES=${MODULE_LIST_RESOLVED} - fi -fi - -if [ ! -d ${MODULES_DIR} ]; then - LOG INFO "Creating directory: ["${MODULES_DIR}"]." - mkdir -p ${MODULES_DIR} -fi - -if [ ${SAFE_MODE} == false ]; then - LOG INFO "\033[1m ####### Start To Clean Modules Directory ######\033[0m" - LOG INFO "Cleanning...." - if [ ${MODULES_DIR} == "" ] || [ ${MODULES_DIR} == "/" ]; then - LOG INFO "Illegal modules directory: ${MODULES_DIR}" 1>&2 - exit 1 - fi - clean_modules - LOG INFO "\033[1m ####### Finish To Clean Modules Directory ######\033[0m" -fi - -if [ ${SKIP_PACKAGE} == false ]; then - LOG INFO "\033[1m ####### Start To Uncompress Packages ######\033[0m" - LOG INFO "Uncompressing...." - uncompress_packages - LOG INFO "\033[1m ####### Finish To Umcompress Packages ######\033[0m" -fi - -if [ ${#MODULE_LIST[@]} -gt 0 ]; then - for server in ${MODULE_LIST} - do - if [ ! -f ${MODULES_DIR}/${server}/${CONF_FILE_PATH} ]; then - LOG INFO "Module [${server}] defined doesn't have configure.sh shell" 1>&2 - exit 1 - fi - done - install_modules -else - # Scan modules directory - scan_to_install_modules ${MODULES_DIR} -fi - -exit 0 - diff --git a/bin/start-all.sh b/bin/start-all.sh deleted file mode 100644 index 8e2abd368..000000000 --- a/bin/start-all.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# Copyright 2020 WeBank -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -START_MODULES=("exchangis-eureka" "exchangis-gateway" "exchangis-service" "exchangis-executor") - -function LOG(){ - currentTime=`date "+%Y-%m-%d %H:%M:%S.%3N"` - echo -e "$currentTime [${1}] ($$) $2" | tee -a ${SHELL_LOG} -} - -abs_path(){ - SOURCE="${BASH_SOURCE[0]}" - while [ -h "${SOURCE}" ]; do - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "${SOURCE}")" - [[ ${SOURCE} != /* ]] && SOURCE="${DIR}/${SOURCE}" - done - echo "$( cd -P "$( dirname "${SOURCE}" )" && pwd )" -} - -BIN=`abs_path` -SHELL_LOG="${BIN}/console.out" - -LOG INFO "\033[1m Try To Start Modules In Order \033[0m" -for module in ${START_MODULES[@]} -do - ${BIN}/start.sh -m ${module} - if [ $? != 0 ]; then - LOG ERROR "\033[1m Start Modules [${module}] Failed! \033[0m" - exit 1 - fi -done \ No newline at end of file diff --git a/bin/start.sh b/bin/start.sh deleted file mode 100644 index 8456d3a90..000000000 --- a/bin/start.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash -# -# Copyright 2020 WeBank -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -MODULE_NAME="" -MODULE_DEFAULT_PREFIX="exchangis-" -usage(){ - echo "Usage is [-m module will be started]" -} - -function LOG(){ - currentTime=`date "+%Y-%m-%d %H:%M:%S.%3N"` - echo -e "$currentTime [${1}] ($$) $2" | tee -a ${SHELL_LOG} -} - -abs_path(){ - SOURCE="${BASH_SOURCE[0]}" - while [ -h "${SOURCE}" ]; do - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "${SOURCE}")" - [[ ${SOURCE} != /* ]] && SOURCE="${DIR}/${SOURCE}" - done - echo "$( cd -P "$( dirname "${SOURCE}" )" && pwd )" -} - -BIN=`abs_path` -MODULE_DIR=${BIN}/../modules -SHELL_LOG="${BIN}/console.out" - -interact_echo(){ - while [ 1 ]; do - read -p "$1 (Y/N)" yn - if [ "${yn}x" == "Yx" ] || [ "${yn}x" == "yx" ]; then - return 0 - elif [ "${yn}x" == "Nx" ] || [ "${yn}x" == "nx" ]; then - return 1 - else - echo "Unknown choise: [$yn], please choose again." - fi - done -} - -start_single_module(){ - LOG INFO "\033[1m ####### Begin To Start Module: [$1] ######\033[0m" - if [ -f "${MODULE_DIR}/$1/bin/$1.sh" ]; then - ${MODULE_DIR}/$1/bin/$1.sh start - elif [[ $1 != ${MODULE_DEFAULT_PREFIX}* ]] && [ -f "${MODULE_DIR}/${MODULE_DEFAULT_PREFIX}$1/bin/${MODULE_DEFAULT_PREFIX}$1.sh" ]; then - interact_echo "Do you mean [${MODULE_DEFAULT_PREFIX}$1] ?" - if [ $? == 0 ]; then - ${MODULE_DIR}/${MODULE_DEFAULT_PREFIX}$1/bin/${MODULE_DEFAULT_PREFIX}$1.sh start - fi - else - LOG ERROR "Cannot find the startup script for module: [$1], please check your installation" - exit 1 - fi -} - -while [ 1 ]; do - case ${!OPTIND} in - -m|--modules) - if [ -z $2 ]; then - LOG ERROR "No module provided" - exit 1 - fi - MODULE_NAME=$2 - shift 2 - ;; - "") - break - ;; - *) - usage - exit 1 - ;; - esac -done - -if [ "x${MODULE_NAME}" == "x" ]; then - usage - exit 1 -fi - -start_single_module ${MODULE_NAME} -exit $? diff --git a/bin/stop-all.sh b/bin/stop-all.sh deleted file mode 100644 index 357b01d29..000000000 --- a/bin/stop-all.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# Copyright 2020 WeBank -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -STOP_MODULES=("exchangis-executor" "exchangis-service" "exchangis-gateway" "exchangis-eureka") - -function LOG(){ - currentTime=`date "+%Y-%m-%d %H:%M:%S.%3N"` - echo -e "$currentTime [${1}] ($$) $2" | tee -a ${SHELL_LOG} -} - -abs_path(){ - SOURCE="${BASH_SOURCE[0]}" - while [ -h "${SOURCE}" ]; do - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "${SOURCE}")" - [[ ${SOURCE} != /* ]] && SOURCE="${DIR}/${SOURCE}" - done - echo "$( cd -P "$( dirname "${SOURCE}" )" && pwd )" -} - -BIN=`abs_path` -SHELL_LOG="${BIN}/console.out" - -LOG INFO "\033[1m Try to Stop Modules In Order \033[0m" -for module in ${STOP_MODULES[@]} -do - ${BIN}/stop.sh -m ${module} - if [ $? != 0 ]; then - LOG ERROR "\033[1m Stop Modules [${module}] Failed! \033[0m" - exit 1 - fi -done \ No newline at end of file diff --git a/bin/stop.sh b/bin/stop.sh deleted file mode 100644 index d28c38cac..000000000 --- a/bin/stop.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash -# -# Copyright 2020 WeBank -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -MODULE_NAME="" -MODULE_DEFAULT_PREFIX="exchangis-" -usage(){ - echo "Usage is [-m module will be stoped]" -} - -function LOG(){ - currentTime=`date "+%Y-%m-%d %H:%M:%S.%3N"` - echo -e "$currentTime [${1}] ($$) $2" | tee -a ${SHELL_LOG} -} - -abs_path(){ - SOURCE="${BASH_SOURCE[0]}" - while [ -h "${SOURCE}" ]; do - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "${SOURCE}")" - [[ ${SOURCE} != /* ]] && SOURCE="${DIR}/${SOURCE}" - done - echo "$( cd -P "$( dirname "${SOURCE}" )" && pwd )" -} - -BIN=`abs_path` -MODULE_DIR=${BIN}/../modules -SHELL_LOG="${BIN}/console.out" - -interact_echo(){ - while [ 1 ]; do - read -p "$1 (Y/N)" yn - if [ "${yn}x" == "Yx" ] || [ "${yn}x" == "yx" ]; then - return 0 - elif [ "${yn}x" == "Nx" ] || [ "${yn}x" == "nx" ]; then - return 1 - else - echo "Unknown choise: [$yn], please choose again." - fi - done -} - -stop_single_module(){ - LOG INFO "\033[1m ####### Begin To Stop Module: [$1] ######\033[0m" - if [ -f "${MODULE_DIR}/$1/bin/$1.sh" ]; then - ${MODULE_DIR}/$1/bin/$1.sh stop - elif [[ $1 != ${MODULE_DEFAULT_PREFIX}* ]] && [ -f "${MODULE_DIR}/${MODULE_DEFAULT_PREFIX}$1/bin/${MODULE_DEFAULT_PREFIX}$1.sh" ]; then - interact_echo "Do you mean [${MODULE_DEFAULT_PREFIX}$1] ?" - if [ $? == 0 ]; then - ${MODULE_DIR}/${MODULE_DEFAULT_PREFIX}$1/bin/${MODULE_DEFAULT_PREFIX}$1.sh stop - fi - else - LOG ERROR "Cannot find the stop script for module: [$1], please check your installation" - exit 1 - fi -} - -while [ 1 ]; do - case ${!OPTIND} in - -m|--modules) - if [ -z $2 ]; then - LOG ERROR "No module provided" - exit 1 - fi - MODULE_NAME=$2 - shift 2 - ;; - "") - break - ;; - *) - usage - exit 1 - ;; - esac -done - -if [ "x${MODULE_NAME}" == "x" ]; then - usage - exit 1 -fi - -stop_single_module ${MODULE_NAME} -exit $? \ No newline at end of file diff --git a/db/exchangis_ddl.sql b/db/exchangis_ddl.sql new file mode 100644 index 000000000..826c511c4 --- /dev/null +++ b/db/exchangis_ddl.sql @@ -0,0 +1,170 @@ +-- exchangis_v4.exchangis_job_ds_bind definition + +CREATE TABLE `exchangis_job_ds_bind` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `job_id` bigint(20) NOT NULL, + `task_index` int(11) NOT NULL, + `source_ds_id` bigint(20) NOT NULL, + `sink_ds_id` bigint(20) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=59575 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + + +-- exchangis_v4.exchangis_job_entity definition + +CREATE TABLE `exchangis_job_entity` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime(3) DEFAULT NULL, + `engine_type` varchar(45) DEFAULT '', + `job_labels` varchar(255) DEFAULT NULL, + `create_user` varchar(100) DEFAULT NULL, + `job_content` mediumtext, + `execute_user` varchar(100) DEFAULT '', + `job_params` text, + `job_desc` varchar(255) DEFAULT NULL, + `job_type` varchar(50) DEFAULT NULL, + `project_id` bigint(13) DEFAULT NULL, + `source` text, + `modify_user` varchar(50) DEFAULT NULL COMMENT '修改用户', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5793 DEFAULT CHARSET=utf8; + + +-- exchangis_v4.exchangis_job_param_config definition + +CREATE TABLE `exchangis_job_param_config` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `config_key` varchar(64) NOT NULL, + `config_name` varchar(64) NOT NULL, + `config_direction` varchar(16) DEFAULT NULL, + `type` varchar(32) NOT NULL, + `ui_type` varchar(32) DEFAULT NULL, + `ui_field` varchar(64) DEFAULT NULL, + `ui_label` varchar(32) DEFAULT NULL, + `unit` varchar(32) DEFAULT NULL, + `required` bit(1) DEFAULT b'0', + `value_type` varchar(32) DEFAULT NULL, + `value_range` varchar(255) DEFAULT NULL, + `default_value` varchar(255) DEFAULT NULL, + `validate_type` varchar(64) DEFAULT NULL, + `validate_range` varchar(64) DEFAULT NULL, + `validate_msg` varchar(255) DEFAULT NULL, + `is_hidden` bit(1) DEFAULT NULL, + `is_advanced` bit(1) DEFAULT NULL, + `source` varchar(255) DEFAULT NULL, + `level` tinyint(4) DEFAULT NULL, + `treename` varchar(32) DEFAULT NULL, + `sort` int(11) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `status` tinyint(4) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8; + +-- exchangis_v4.exchangis_project_info definition + +CREATE TABLE `exchangis_project_info` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(64) NOT NULL, + `description` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime(3) DEFAULT NULL, + `create_user` varchar(64) DEFAULT NULL, + `last_update_user` varchar(64) DEFAULT NULL, + `project_labels` varchar(255) DEFAULT NULL, + `domain` varchar(32) DEFAULT NULL, + `exec_users` varchar(255) DEFAULT NULL, + `view_users` varchar(255) DEFAULT NULL, + `edit_users` varchar(255) DEFAULT NULL, + `source` text, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1497870871035973934 DEFAULT CHARSET=utf8; + +-- exchangis_v4.exchangis_job_entity definition + + +-- exchangis_v4.exchangis_launchable_task definition + +CREATE TABLE `exchangis_launchable_task` ( + `id` bigint(13) NOT NULL, + `name` varchar(100) NOT NULL, + `job_execution_id` varchar(64) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime(3) DEFAULT NULL, + `engine_type` varchar(45) DEFAULT '', + `execute_user` varchar(50) DEFAULT '', + `linkis_job_name` varchar(100) NOT NULL, + `linkis_job_content` text NOT NULL, + `linkis_params` varchar(255) DEFAULT NULL, + `linkis_source` varchar(64) DEFAULT NULL, + `labels` varchar(64) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- exchangis_v4.exchangis_launched_job_entity definition + +CREATE TABLE `exchangis_launched_job_entity` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime(3) DEFAULT NULL, + `job_id` bigint(20) DEFAULT NULL, + `launchable_task_num` int(20) DEFAULT '0', + `engine_type` varchar(100) DEFAULT NULL, + `execute_user` varchar(100) DEFAULT NULL, + `job_name` varchar(100) DEFAULT NULL, + `status` varchar(100) DEFAULT NULL, + `progress` varchar(100) DEFAULT NULL, + `error_code` varchar(64) DEFAULT NULL, + `error_msg` varchar(255) DEFAULT NULL, + `retry_num` bigint(10) DEFAULT NULL, + `job_execution_id` varchar(255) DEFAULT NULL, + `log_path` varchar(255) DEFAULT NULL, + `create_user` varchar(100) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `job_execution_id_UNIQUE` (`job_execution_id`) +) ENGINE=InnoDB AUTO_INCREMENT=8380 DEFAULT CHARSET=utf8; + +-- exchangis_v4.exchangis_launched_task_entity definition + +CREATE TABLE `exchangis_launched_task_entity` ( + `id` bigint(20) NOT NULL, + `name` varchar(100) NOT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime(3) DEFAULT NULL, + `job_id` bigint(20) DEFAULT NULL, + `engine_type` varchar(100) DEFAULT NULL, + `execute_user` varchar(100) DEFAULT NULL, + `job_name` varchar(100) DEFAULT NULL, + `progress` varchar(64) DEFAULT NULL, + `error_code` varchar(64) DEFAULT NULL, + `error_msg` varchar(255) DEFAULT NULL, + `retry_num` bigint(10) DEFAULT NULL, + `task_id` varchar(64) DEFAULT NULL, + `linkis_job_id` varchar(200) DEFAULT NULL, + `linkis_job_info` varchar(1000) DEFAULT NULL, + `job_execution_id` varchar(100) DEFAULT NULL, + `launch_time` datetime DEFAULT NULL, + `running_time` datetime DEFAULT NULL, + `metrics` text, + `status` varchar(64) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO exchangis_job_param_config (config_key,config_name,config_direction,`type`,ui_type,ui_field,ui_label,unit,required,value_type,value_range,default_value,validate_type,validate_range,validate_msg,is_hidden,is_advanced,source,`level`,treename,sort,description,status) VALUES +('setting.speed.bytes','作业速率限制','','DATAX','INPUT','setting.speed.bytes','作业速率限制','Mb/s',1,'NUMBER','','','REGEX','^[1-9]\\d*$','作业速率限制输入错误',0,0,'',1,'',1,'',1) +,('setting.speed.records','作业记录数限制','','DATAX','INPUT','setting.speed.records','作业记录数限制','条/s',1,'NUMBER','','','REGEX','^[1-9]\\d*$','作业记录数限制输入错误',0,0,'',1,'',2,'',1) +,('setting.max.parallelism','作业最大并行度','','DATAX','INPUT','setting.max.parallelism','作业最大并行度','个',1,'NUMBER','','1','REGEX','^[1-9]\\d*$','作业最大并行度输入错误',0,0,'',1,'',3,'',1) +,('setting.max.memory','作业最大使用内存','','DATAX','INPUT','setting.max.memory','作业最大使用内存','Mb',1,'NUMBER','','1024','REGEX','^[1-9]\\d*$','作业最大使用内存输入错误',0,0,'',1,'',4,'',1) +,('setting.errorlimit.record','最多错误记录数','','DATAX','INPUT','setting.errorlimit.record','最多错误记录数','条',1,'NUMBER','','','REGEX','^[1-9]\\d*$','最多错误记录数输入错误',0,0,'',1,'',5,'',1) +,('setting.max.parallelism','作业最大并行数','','SQOOP','INPUT','setting.max.parallelism','作业最大并行数','个',1,'NUMBER','','1','REGEX','^[1-9]\\d*$','作业最大并行数输入错误',0,0,'',1,'',1,'',1) +,('setting.max.memory','作业最大内存','','SQOOP','INPUT','setting.max.memory','作业最大内存','Mb',1,'NUMBER','','1024','REGEX','^[1-9]\\d*$','作业最大内存输入错误',0,0,'',1,'',2,'',1) +,('where','WHERE条件','SOURCE','MYSQL','INPUT','where','WHERE条件','',0,'VARCHAR','','','REGEX','^[\\s\\S]{0,500}$','WHERE条件输入过长',0,0,'',1,'',2,'',1) +,('writeMode','写入方式','SQOOP-SINK','HIVE','OPTION','writeMode','写入方式(OVERWRITE只对TEXT类型表生效)','',1,'OPTION','["OVERWRITE","APPEND"]','OVERWRITE','','','写入方式输入错误',0,0,'',1,'',1,'',1) +,('partition','分区信息','SINK','HIVE','MAP','partition','分区信息(文本)','',0,'VARCHAR','','','REGEX','^[\\s\\S]{0,50}$','分区信息过长',0,0,'/api/rest_j/v1/dss/exchangis/main/datasources/render/partition/element/map',1,'',2,'',1) +; +INSERT INTO exchangis_job_param_config (config_key,config_name,config_direction,`type`,ui_type,ui_field,ui_label,unit,required,value_type,value_range,default_value,validate_type,validate_range,validate_msg,is_hidden,is_advanced,source,`level`,treename,sort,description,status) VALUES +('partition','分区信息','SOURCE','HIVE','MAP','partition','分区信息(文本)',NULL,0,'VARCHAR',NULL,NULL,'REGEX','^[\\s\\S]{0,50}$','分区信息过长',0,0,'/api/rest_j/v1/dss/exchangis/main/datasources/render/partition/element/map',1,NULL,1,NULL,1) +,('writeMode','写入方式','SQOOP-SINK','MYSQL','OPTION','writeMode','写入方式',NULL,1,'OPTION','["INSERT","UPDATE"]','INSERT',NULL,NULL,'写入方式输入错误',0,0,NULL,1,NULL,1,NULL,1) +; \ No newline at end of file diff --git a/db/exchangis_dml.sql b/db/exchangis_dml.sql new file mode 100644 index 000000000..6ea326fb9 --- /dev/null +++ b/db/exchangis_dml.sql @@ -0,0 +1,17 @@ +-- 插入 job_param_config 记录 +INSERT INTO exchangis_job_param_config (config_key,config_name,config_direction,`type`,ui_type,ui_field,ui_label,unit,required,value_type,value_range,default_value,validate_type,validate_range,validate_msg,is_hidden,is_advanced,source,`level`,treename,sort,description,status) VALUES +('setting.speed.bytes','作业速率限制','','DATAX','INPUT','setting.speed.bytes','作业速率限制','Mb/s',1,'NUMBER','','','REGEX','^[1-9]\\d*$','作业速率限制输入错误',0,0,'',1,'',1,'',1) +,('setting.speed.records','作业记录数限制','','DATAX','INPUT','setting.speed.records','作业记录数限制','条/s',1,'NUMBER','','','REGEX','^[1-9]\\d*$','作业记录数限制输入错误',0,0,'',1,'',2,'',1) +,('setting.max.parallelism','作业最大并行度','','DATAX','INPUT','setting.max.parallelism','作业最大并行度','个',1,'NUMBER','','1','REGEX','^[1-9]\\d*$','作业最大并行度输入错误',0,0,'',1,'',3,'',1) +,('setting.max.memory','作业最大使用内存','','DATAX','INPUT','setting.max.memory','作业最大使用内存','Mb',1,'NUMBER','','1024','REGEX','^[1-9]\\d*$','作业最大使用内存输入错误',0,0,'',1,'',4,'',1) +,('setting.errorlimit.record','最多错误记录数','','DATAX','INPUT','setting.errorlimit.record','最多错误记录数','条',1,'NUMBER','','','REGEX','^[1-9]\\d*$','最多错误记录数输入错误',0,0,'',1,'',5,'',1) +,('setting.max.parallelism','作业最大并行数','','SQOOP','INPUT','setting.max.parallelism','作业最大并行数','个',1,'NUMBER','','1','REGEX','^[1-9]\\d*$','作业最大并行数输入错误',0,0,'',1,'',1,'',1) +,('setting.max.memory','作业最大内存','','SQOOP','INPUT','setting.max.memory','作业最大内存','Mb',1,'NUMBER','','1024','REGEX','^[1-9]\\d*$','作业最大内存输入错误',0,0,'',1,'',2,'',1) +,('where','WHERE条件','SOURCE','MYSQL','INPUT','where','WHERE条件','',0,'VARCHAR','','','REGEX','^[\\s\\S]{0,500}$','WHERE条件输入过长',0,0,'',1,'',2,'',1) +,('writeMode','写入方式','SQOOP-SINK','HIVE','OPTION','writeMode','写入方式(OVERWRITE只对TEXT类型表生效)','',1,'OPTION','["OVERWRITE","APPEND"]','OVERWRITE','','','写入方式输入错误',0,0,'',1,'',1,'',1) +,('partition','分区信息','SINK','HIVE','MAP','partition','分区信息(文本)','',0,'VARCHAR','','','REGEX','^[\\s\\S]{0,50}$','分区信息过长',0,0,'/api/rest_j/v1/dss/exchangis/main/datasources/render/partition/element/map',1,'',2,'',1) +; +INSERT INTO exchangis_job_param_config (config_key,config_name,config_direction,`type`,ui_type,ui_field,ui_label,unit,required,value_type,value_range,default_value,validate_type,validate_range,validate_msg,is_hidden,is_advanced,source,`level`,treename,sort,description,status) VALUES +('partition','分区信息','SOURCE','HIVE','MAP','partition','分区信息(文本)',NULL,0,'VARCHAR',NULL,NULL,'REGEX','^[\\s\\S]{0,50}$','分区信息过长',0,0,'/api/rest_j/v1/dss/exchangis/main/datasources/render/partition/element/map',1,NULL,1,NULL,1) +,('writeMode','写入方式','SQOOP-SINK','MYSQL','OPTION','writeMode','写入方式',NULL,1,'OPTION','["INSERT","UPDATE"]','INSERT',NULL,NULL,'写入方式输入错误',0,0,NULL,1,NULL,1,NULL,1) +; \ No newline at end of file diff --git a/db/job_content_example.json b/db/job_content_example.json new file mode 100644 index 000000000..5046a8ed4 --- /dev/null +++ b/db/job_content_example.json @@ -0,0 +1,76 @@ +{ + "dataSources": { + "source_id": "HIVE.10001.test_db.test_table", + "sink_id": "MYSQL.10002.mask_db.mask_table" + }, + "params": { + "sources": [ + { + "config_key": "exchangis.job.ds.params.hive.transform_type", + "config_name": "传输方式", + "config_value": "二进制", + "sort": 1 + }, + { + "config_key": "exchangis.job.ds.params.hive.partitioned_by", + "config_name": "分区信息", + "config_value": "2021-07-30", + "sort": 2 + }, + { + "config_key": "exchangis.job.ds.params.hive.empty_string", + "config_name": "空值字符", + "config_value": "", + "sort": 3 + } + ], + "sinks": [ + { + "config_key": "exchangis.job.ds.params.mysql.write_type", + "config_name": "写入方式", + "config_value": "insert", + "sort": 1 + }, + { + "config_key": "exchangis.job.ds.params.mysql.batch_size", + "config_name": "批量大小", + "config_value": 1000, + "sort": 2 + } + ] + }, + "transforms": [ + { + "source_field_name": "name", + "source_field_type": "VARCHAR", + "sink_field_name": "c_name", + "sink_field_type": "VARCHAR" + }, + { + "source_field_name": "year", + "source_field_type": "VARCHAR", + "sink_field_name": "d_year", + "sink_field_type": "VARCHAR" + } + ], + "settings": [ + { + "config_key": "rate_limit", + "config_name": "作业速率限制", + "config_value": 102400, + "sort": 1 + }, + { + "config_key": "record_limit", + "config_name": "作业记录数限制", + "config_value": 10000, + "sort": 2 + }, + { + "config_key": "max_errors", + "config_name": "最多错误记录数", + "config_value": 100, + "sort": 3 + } + ] +} \ No newline at end of file diff --git a/db/job_content_example_batch.json b/db/job_content_example_batch.json new file mode 100644 index 000000000..864bf89f0 --- /dev/null +++ b/db/job_content_example_batch.json @@ -0,0 +1,153 @@ +[{ + "subJobName": "job0001", + "dataSources": { + "source_id": "HIVE.10001.test_db.test_table", + "sink_id": "MYSQL.10002.mask_db.mask_table" + }, + "params": { + "sources": [ + { + "config_key": "exchangis.job.ds.params.hive.transform_type", + "config_name": "传输方式", + "config_value": "二进制", + "sort": 1 + }, + { + "config_key": "exchangis.job.ds.params.hive.partitioned_by", + "config_name": "分区信息", + "config_value": "2021-07-30", + "sort": 2 + }, + { + "config_key": "exchangis.job.ds.params.hive.empty_string", + "config_name": "空值字符", + "config_value": "", + "sort": 3 + } + ], + "sinks": [ + { + "config_key": "exchangis.job.ds.params.mysql.write_type", + "config_name": "写入方式", + "config_value": "insert", + "sort": 1 + }, + { + "config_key": "exchangis.job.ds.params.mysql.batch_size", + "config_name": "批量大小", + "config_value": 1000, + "sort": 2 + } + ] + }, + "transforms": { + "type": "MAPPING", + "mapping": [ + { + "source_field_name": "name", + "source_field_type": "VARCHAR", + "sink_field_name": "c_name", + "sink_field_type": "VARCHAR" + }, + { + "source_field_name": "year", + "source_field_type": "VARCHAR", + "sink_field_name": "d_year", + "sink_field_type": "VARCHAR" + } + ] + }, + "settings": [ + { + "config_key": "exchangis.datax.setting.speed.byte", + "config_name": "传输速率", + "config_value": 102400, + "sort": 1 + }, + { + "config_key": "exchangis.datax.setting.errorlimit.record", + "config_name": "脏数据最大记录数", + "config_value": 10000, + "sort": 2 + }, + { + "config_key": "exchangis.datax.setting.errorlimit.percentage", + "config_name": "脏数据占比阈值", + "config_value": 100, + "sort": 3 + } + ] +}, { + "subJobName": "job0002", + "dataSources": { + "source_id": "HIVE.10001.superman2_db.funny2_table", + "sink_id": "MYSQL.10002.ducky2_db.chicken2_table" + }, + "params": { + "sources": [ + { + "config_key": "exchangis.job.ds.params.hive.transform_type", + "config_name": "传输方式", + "config_value": "二进制", + "sort": 1 + }, + { + "config_key": "exchangis.job.ds.params.hive.partitioned_by", + "config_name": "分区信息", + "config_value": "2021-07-30", + "sort": 2 + }, + { + "config_key": "exchangis.job.ds.params.hive.empty_string", + "config_name": "空值字符", + "config_value": "", + "sort": 3 + } + ], + "sinks": [ + { + "config_key": "exchangis.job.ds.params.mysql.write_type", + "config_name": "写入方式", + "config_value": "insert", + "sort": 1 + }, + { + "config_key": "exchangis.job.ds.params.mysql.batch_size", + "config_name": "批量大小", + "config_value": 1000, + "sort": 2 + } + ] + }, + "transforms": { + "type": "MAPPING", + "mapping": [ + { + "source_field_name": "mid", + "source_field_type": "VARCHAR", + "sink_field_name": "c_mid", + "sink_field_type": "VARCHAR" + }, + { + "source_field_name": "maxcount", + "source_field_type": "INT", + "sink_field_name": "c_maxcount", + "sink_field_type": "INT" + } + ] + }, + "settings": [ + { + "config_key": "exchangis.datax.setting.speed.byte", + "config_name": "传输速率", + "config_value": 102400, + "sort": 1 + }, + { + "config_key": "exchangis.datax.setting.errorlimit.record", + "config_name": "脏数据最大记录数", + "config_value": 100, + "sort": 2 + } + ] +}] \ No newline at end of file diff --git a/db/job_content_example_stream.json b/db/job_content_example_stream.json new file mode 100644 index 000000000..264147849 --- /dev/null +++ b/db/job_content_example_stream.json @@ -0,0 +1,57 @@ +[{ + "subJobName": "streamjob0001", + "dataSources": { + "source_id": "HIVE.10001.test_db.test_table", + "sink_id": "MYSQL.10002.mask_db.mask_table" + }, + "params": {}, + "transforms": { + "type": "SQL", + "sql": "select * from aaa" + }, + "settings": [ + { + "config_key": "exchangis.datax.setting.speed.byte", + "config_name": "传输速率", + "config_value": 102400, + "sort": 1 + }, + { + "config_key": "exchangis.datax.setting.errorlimit.record", + "config_name": "脏数据最大记录数", + "config_value": 100, + "sort": 2 + } + ] +}, { + "subJobName": "streamjob0002", + "dataSources": { + "source_id": "HIVE.10001.test_db.test_table", + "sink_id": "MYSQL.10002.mask_db.mask_table" + }, + "params": {}, + "transforms": { + "type": "SQL", + "sql": "insert into xxx" + }, + "settings": [ + { + "config_key": "exchangis.datax.setting.speed.byte", + "config_name": "传输速率", + "config_value": 102400, + "sort": 1 + }, + { + "config_key": "exchangis.datax.setting.errorlimit.record", + "config_name": "脏数据最大记录数", + "config_value": 10000, + "sort": 2 + }, + { + "config_key": "exchangis.datax.setting.errorlimit.percentage", + "config_name": "脏数据占比阈值", + "config_value": 100, + "sort": 3 + } + ] +}] \ No newline at end of file diff --git a/docs/en_US/ch1/exchangis_appconn_deploy_en.md b/docs/en_US/ch1/exchangis_appconn_deploy_en.md new file mode 100644 index 000000000..dc7ed0d83 --- /dev/null +++ b/docs/en_US/ch1/exchangis_appconn_deploy_en.md @@ -0,0 +1,90 @@ +# ExchangisAppConn installation documentation + +This paper mainly introduces the deployment, configuration and installation of ExchangisAppConn in DSS(DataSphere Studio)1.0.1. + +### 1. Preparations for the deployment of ExchangisAppConn +Before you deploy ExchangisAppConn, please follow the [Exchangis1.0.0 to install the deployment document](https://github.com/WeDataSphere/Exchangis/blob/dev-1.0.0-rc/docs/zh_CN/ch1/exchangis_deploy_cn.md) to complete the installation of Exchangis1.0.0 and other related components, and ensure that the basic functions of the project are available. + +### 2. Download and compilation of the ExchangisAppConn plugin +#### 1) Download binary package + We provide ExchangisAppconn's material package, which you can download and use directly. [Click to jump to Release interface](https://github.com/WeBankFinTech/Exchangis/releases) +#### 2) Compile and package + +If you want to develop and compile ExchangisAppConn yourself, the specific compilation steps are as follows: +1.clone Exchangis's source code +2.In exchangis-plugins module, find exchangis-appconn, separate compilation exchangis-appconn + +``` +cd {EXCHANGIS_CODE_HOME}/exchangis-plugins/exchangis-appconn +mvn clean install +``` +The exchangis-appconn.zip installation package will be found in this path. +``` +{EXCHANGIS_CODE_HOME}\exchangis-plugins\exchangis-appconn\target\exchangis-appconn.zip +``` + +### 3. Overall steps for deployment and configuration of ExchangisAppConn +1、Get the packed exchangis-appconn.zip material package. + +2、Place it in the following directory and unzip it + +``` +cd {DSS_Install_HOME}/dss/dss-appconns +unzip exchangis-appconn.zip +``` + The extracted directory structure is: +``` +conf +db +lib +appconn.properties +``` + +3、 Execute scripts for automated installation + +```shell +cd {DSS_INSTALL_HOME}/dss/bin +./install-appconn.sh +# Script is an interactive installation scheme. You need to enter the string exchangis and the ip and port of exchangis service to complete the installation. +# Exchangis port here refers to the front-end port, which is configured in nginx. Rather than the back-end service port. +``` + +### 4. After the installation of Exchangis-AppConn is completed, the dss service needs to be re-installed to finally complete the plug-in update. + +#### 4.1) Make the deployed APPCONN effective +Make APPCONN effective by using DSS start-stop script, which is located in {DSS_INSTALL_HOME}/sbin, and execute the script by using the following commands in turn +``` +sh /sbin/dss-stop-all.sh +sh /sbin/dss-start-all.sh +``` +There may be startup failure or jam in the middle, so you can quit repeated execution. + +#### 4.2) Verify that exchangis-appconn is effective. + After the exchangis-appconn is installed and deployed, the following steps can be taken to preliminarily verify whether exchangis-appconn is successfully installed. +1. Create a new project in DSS workspace +![image](https://user-images.githubusercontent.com/27387830/169782142-b2fc2633-e605-4553-9433-67756135a6f1.png) + +2. Check whether the project is created synchronously on Exchangis. Successful creation means successful installation of appconn +![image](https://user-images.githubusercontent.com/27387830/169782337-678f2df0-080a-495a-b59f-a98c5a427cf8.png) + +For more operation, please refer to [Exchange IS 1.0 User Manual](https://user-images.githubusercontent.com/27387830/169782142-b2fc2633-e605-4553-9433-67756135a6f1.png) + +### 5.Exchangis AppConn installation principle + +The related configuration information of Exchangis inserted into the following table. By configuring the following table, you can complete the use configuration of Exchangis. When installing Exchangis AppConn, the script will replace init.sql under each AppConn and insert it into the table. (Note: If you only need to install APPCONN quickly, you don't need to pay too much attention to the following fields. Most of the provided init.sql are configured by default. Focus on the above operations) + +| Table name | Table function | Remark | +| :----: | :----: |-------| +| dss_application | The application table is mainly used to insert the basic information of Exchangis application | Required | +| dss_menu | Menu, which stores the displayed contents, such as icons, names, etc | Required | +| dss_onestop_menu_application| And menu and application, which are used for joint search | Required | +| dss_appconn |Basic information of appconn, used to load appconn | Required | +| dss_appconn_instance| Information of an instance of AppConn, including its own url information | Required | +| dss_workflow_node | Schedulis is the information that needs to be inserted as a workflow node | Required | + +Exchangis as a scheduling framework, which implements the first-level specification and the second-level specification. The micro-services of exchangis AppConn need to be used in the following table. + +| Table name | Table function | Remark | +| :----: | :----: |-------| +| dss-framework-project-server | Use exchangis-appconn to complete the project and unify the organization. | Required | +| dss-workflow-server | Scheduling AppConn is used to achieve workflow publishing and status acquisition. | Required | diff --git a/docs/en_US/ch1/exchangis_datasource_en.md b/docs/en_US/ch1/exchangis_datasource_en.md new file mode 100644 index 000000000..7dabbef01 --- /dev/null +++ b/docs/en_US/ch1/exchangis_datasource_en.md @@ -0,0 +1,304 @@ +# DataSource1.0 + +## 1、Background + +The earlier versions of **Exchangis0.x**and **Linkis0.x** have integrated data source modules, in which **linkis-datasource** is used as the blueprint (please refer to related documents) to reconstruct the data source module. + +## 2、Overall architecture desig + +In order to build a common data source module, the data source module is mainly divided into two parts: **datasource-client** and **datasource-server**, in which the server part is placed in the **linkis-datasource** module of **Linkis-1.0**, including the main logic of the service core; Client is placed under the **exchange is-data source** module of **exchange is-1.0**, which contains the calling logic of the client. Look at the overall architecture + +![linkis_datasource_structure](../../../images/zh_CN/ch1/datasource_structure.png) + +
+Figure 2-1 Overall Architecture Design +
+ +## 3、Detailed explanation of modules + +### 3.1 datasource-server + +**datasource-server**: As the name implies, it is a module that stores core services, and it follows the original architecture of **linkis-datasource** (split into **datasourcemanager** and **metadatamanager**) + +### 3.2 linkis-datasource + +Schematic diagram of current architecture : + +![linkis_datasource_structure](../../../images/zh_CN/ch1/linkis_datasource_structure.png) + +
+Figure 3-1 Schematic diagram of current architecture +
+ +It can be seen in the above figure that **linkis-datasource** decouples the related functions of data sources, the basic information part is managed by **datasourcemanager**, and the metadata part is managed by **metadatamanager**. The two sub-modules visit each other through RPC requests, and at the same time, they provide Restful entrances to the outside respectively. The external service requests are uniformly forwarded by **liniks-gateway** before they fall on the corresponding services. Furthermore, **metadatamanage** is connected to the sub-modules of **service** of different data sources in order to plug-in the metadata management platform of the third party. Each sub-module has its own implementation of metadata acquisition interface, such as **service/hive, service/elastic search and service/MySQL** + +#### 3.2.1 New demand + +##### Front end interface requirements + +The original **linkis-datasource** did not include the front-end interface, so now the original data source interface design of **exchangis 1.0** is merged. See **UI document** and **front-end interactive document** for details. Make a detailed description of the requirements involved: + +- Type of datasource-list acquisition [data source management] + +Description: + +Get all data source types accessed and show them + +- Datasource environment-list acquisition [data source management] + +Description: + +Get the preset data source environment parameters in the background and display them as a list + +- Add/Modify Datasource-Label Settings [Data Source Management] + +Description: + +Set the label information of the datasource + +- Connectivity detection [datasource management] + +Description: + +Check the connectivity of connected data sources, and click the Connectivity Monitor button in the data source list + +- Add/Modify Datasource-Configure and Load [Datasource Management] + +Description: + +In order to facilitate the introduction of new data sources or the attribute expansion of existing data sources, the form configuration of new/modified data sources is planned to adopt the method of background storage+front-end loading. The background will save the type, default value, loading address and simple cascading relationship of each attribute field, and the front-end will generate abstract data structures according to these, and then convert them into DOM operations. + +Process design: + +1. The user selects the datasource type, and the front end requests the background for the attribute configuration list of the data source with the datasource type as the parameter; + +2. When the front end gets the configuration list, it first judges the type, selects the corresponding control, then sets the default value and refreshes the interface DOM; + +3. After the basic configuration information is loaded and rendered, the values are preloaded and the cascading relationship is established; + +4. The configuration is completed, waiting for the user to fill it. + + Associated UI: + +![datasource_ui](../../../images/zh_CN/ch1/datasource_ui.png) + +
+Figure 3-2 Datasource UI +
+ +![datasource_ui_mysql](../../../images/zh_CN/ch1/datasource_ui_mysql.png) + +
+Figure 3-3 Creating MySQL Datasource +
+ +- Batch Processing-Batch Import/Export [Datasource Management] + +Description: + +Batch import and export of datasource configuration. + +##### Backstage demand + +**linkis-datasurce** at present, the background has integrated the relevant operation logic about the data source CRUD, and now the contents related to the label and version are added: + +- datasource permission setting [datasource management] + +Description: + +The background needs to integrate it with the labeling function of Linkis1.0, and give the datasource a labeling relationship. + +Process design: + +1. Users are allowed to set labels on datasources when they create and modify them; + +2. When saving, the tag information is sent to the back end as a character list, and the back end converts the tag characters into tag entities, and inserts and updates the tag; + +3. Save the datasource and establish the connection between the datasource and the label. + +- datasource version function [datasource management] + +Description: + +The concept of adding a version to a datasource, the function of which is to publish and update. When updating, a new version is added by default. When publishing, the datasource information of the version to be published covers the latest version and is marked as published. + +#### 3.2.2 Detailing + +Make some modifications and extensions to the entity objects contained in **linkis-datasource**, as follows: + +| Class Name | Role | +| -------------------------------- | ------------------------------------------------------------ | +| DataSourceType | Indicates the type of data source | +| DataSourceParamKeyDefinition | Declare data source attribute configuration definition | +| DataSourceScope[Add] | There are usually three fields for marking the scope of datasource attributes: datasource, data source environment and default (all) | +| DataSource | Datasource entity class, including label and attribute configuration definitions | +| DataSourceEnv | The datasource object entity class also contains attribute configuration definitions. | +| DataSourcePermissonLabel[Delete] | | +| DataSourceLabelRelation[Add] | Represents the relationship between datasources and permission labels | +| VersionInfo[Add] | Version information, including datasource version number information | + +2.1 Among them, **DataSourceParamKeyDefinition** keeps the original consistent structure, and adds some attributes to support interface rendering. The detailed structure is as follows: + +| **Field name** | **Field type** | **Remark** | +| -------------- | -------------- | ------------------------------------------------------------ | +| id | string | persistent ID | +| key | string | attribute name keyword | +| description | string | describe | +| name | string | attribute display name | +| defaultValue | string | attribute default value | +| valueType | string | attribute value type | +| require | boolean | is it a required attribute | +| refId | string | another attribute ID of the cascade | +| dataSrcTypId | string | the associated data source type ID | +| refMap[Add] | string | cascading relation table, format should be as follows: value1=refValue1, value2=refValue2 | +| loadUrl[Add] | string | upload URL, which is empty by default | + +2.2 The **DataSource** structure is similar, but it contains label information + +| **Field name** | **Field type** | **Remark** | +| ---------------- | -------------- | ------------------------------------------------------------ | +| serId | string | persistent ID | +| id | string | system ID | +| versions[Add] | list-obj | The associated version VersionInfo list | +| srcVersion[Add] | string | Version, indicating that the data source was created by version information. | +| datSourceName | string | Data source name | +| dataSourceDesc | string | Description of data source | +| dataSourceTypeId | integer | Data source type ID | +| connectParams | map | Connection parameter dictionary | +| parameter | string | Connection attribute parameters | +| createSystem | string | The created system is usually empty or (exchange is) | +| dataSourceEnvId | integer | The associated data source environment ID of | +| keyDefinitions | list-object | List of associated attribute configuration definitions. | +| labels[Add] | map | Tag string | +| readOnly[Add]] | boolean | Is it a read-only data source | +| expire[Add]] | boolean | Is it expired | +| isPub[Add] | boolean | Publish | + +2.3 **VersionInfo** version information. Different versions of data sources mainly have different connection parameters. The structure is as follows: + +| **Field name** | **Field type** | **Remark** | +| -------------- | -------------- | ----------------------------- | +| version | string | version number | +| source | long | The associated data source ID | +| connectParams | map | Version parameter dictionary | +| parameter | string | Version parameter string | + +2.4 **DataSourceType** and **DataSourceEnv** are also roughly the same as the original classes, in which **DataSourceType** needs to add **classifier** fields to classify different datasource types, and the others will not be described. + +The main service processing classes of **datasource-server** are as follows: + +| **Interface name** | **Interface role** | **Single realization** | +| ------------------------------- | ------------------------------------------------------------ | ---------------------- | +| DataSourceRelateService | The operation of declaring datasource association information includes enumerating all datasource types and attribute definition information under different types | Yes | +| DataSourceInfoService | Declare the basic operation of datasource/datasource environment | Yes | +| MetadataOperateService | Declare the operation of datasource metadatasource, which is generally used for connection test | Yes | +| BmlAppService | Declare the remote call to BML module to upload/download the key file of datasource | Yes | +| DataSourceVersionSupportService | Declare the operations supported by multiple versions of the datasource | Yes | +| MetadataAppService[Old] | Declare operations on metadata information | Yes | +| DataSourceBatchOpService[Add] | Declare batch operations on datasources | Yes | +| MetadataDatabaseService[Add] | Declare operations on metadata information of database classes | Yes | +| MetadataPropertiesService[Add] | Operation of declaring metadata information of attribute class | Yes | + +### 3.3 datasource-client + +**datasource-client**: contains the client-side calling logic, which can operate the data source and obtain relevant metadata in the client-side way. + +#### 3.3.1 Related demand + +##### Backstage demand + +As the requesting client, **datasource-client** has no front-end interface requirements, and its back-end requirements are relatively simple. It not only builds a stable, retryable and traceable client, but also directly interfaces with all interfaces supported by sever, and supports various access modes as much as possible. + +#### 3.3.2 Detailing + +Its organizational structure is generally designed as follows : + +![datasource_client_scructure](../../../images/zh_CN/ch1/datasource_client_scructure.png) + +
+Figure 3-4 Detailed Design of datasource-client +
+ +The class/interface information involved is as follows: + +| Class/interface name | Class/interface role | Single realization | +| ----------------------------- | ------------------------------------------------------------ | ------------------ | +| RemoteClient | The top-level interface of the Client declares the common interface methods of initialization, release and basic permission verification | No | +| RemoteClientBuilder | Client's construction class is constructed according to different implementation classes of RemoteClient | Yes | +| AbstractRemoteClient | The abstract implementation of remote involves logic such as retry, statistics and caching | Yes | +| DataSourceRemoteClient | Declare all operation portals of the data source client | No | +| MetaDataRemoteClient | Declare all operation portals of metadata client | No | +| LinkisDataSourceRemoteClient | Datasource client implementation of linkis-datasource | Yes | +| LinkisMetaDataRemoteClient | Metadata client implementation of linkis-datasource | Yes | +| MetadataRemoteAccessService | Declare the interface of the bottom layer to access the remote third-party metadata service. | Yes | +| DataSourceRemoteAccessService | Declare the interface of the bottom layer to access the remote third-party datasource service | Yes | + +The class relationship group diagram is as follows: + +![datasource_client_class_relation](../../../images/zh_CN/ch1/datasource_client_class_relation.png) + +
+Figure 3-5 datasource-client Class Relationship Group Diagram +
+ +##### Process sequence diagram: + +Next, combining all modules, the calling relationship between interfaces/classes in the business process is described in detail : + +- Create datasource + +Focus: + +1. Before creating a datasource, you need to pull the datasource type list and the attribute configuration definition list of the datasource corresponding to the type. In some cases, you also need to pull the datasource environment list ; + +2. There are two scenarios for creating datasources, one is created through the interface of **linkis-datasource**, and the other is created through the datasource-client of **exchangis**; + +3. Datasource type, attribute configuration definition and datasource environment can be added in the background library by themselves. Currently, there is no interface dynamic configuration method (to be provided). + +Now look at the timing diagram of creating a data source: + +![datasource_client_create](../../../images/zh_CN/ch1/datasource_client_create.png) + +
+Figure 3-6 Sequence diagram of datasource created datasource-client +
+ +Continue to look at creating data source interface through **datasource-client**: + +![datasource_client_create2](../../../images/zh_CN/ch1/datasource_client_create2.png) + +
+Figure 3-7 Sequence diagram of datasource created datasource-client call +
+ +Some additional methods, such as client connection authentication, request recording and life cycle monitoring, are omitted in the above figure, but the whole calling process is simplified + +- Update datasource + +Focus: + +1. There are two ways to update: version update and ordinary update. Version update will generate a new version of datasource (which can be deleted or published), while ordinary update will overwrite the current datasource and will not generate a new version; + +2. Only the creator and administrator users of the datasource can update the publication datasource. + +![datasource_client_update](../../../images/zh_CN/ch1/datasource_client_update.png) + +
+Figure 3-8 datasource-client Update Datasource Timing Diagram +
+ +- Query datasource + +Focus : + +1. When you get the datasource list through datasource-client, you need to attach the operating user information for permission filtering of the datasource + +Database design : + +![datasource_client_query](../../../images/zh_CN/ch1/datasource_client_query.png) + +
+Figure 3-9 datasource-client Query Datasource Sequence Diagram +
+ +Interface design: (refer to the existing interface of linkis-datasource for supplement) \ No newline at end of file diff --git a/docs/en_US/ch1/exchangis_deploy_en.md b/docs/en_US/ch1/exchangis_deploy_en.md new file mode 100644 index 000000000..42c3593f5 --- /dev/null +++ b/docs/en_US/ch1/exchangis_deploy_en.md @@ -0,0 +1,280 @@ +## Foreword + +Exchangis installation is mainly divided into the following four steps : + +1. Exchangis dependent on environmental preparation +2. Exchangis installation and deployment +3. DSS ExchangisAppConn installation and deployment +4. Linkis Sqoop engine installation and deployment + +## 1. Exchangis dependent on environmental preparation + +#### 1.1 Basic software installation + +| Dependent components | Must be installed | Install through train | +| -------------- | ------ | --------------- | +| MySQL (5.5+) | yes | [How to install mysql](https://www.runoob.com/mysql/mysql-install.html) | +| JDK (1.8.0_141) | yes | [How to install JDK](https://www.runoob.com/java/java-environment-setup.html) | +| Hadoop(2.7.2,Other versions of Hadoop need to compile Linkis by themselves.) | yes | [Hadoop stand-alone deployment](https://linkis.apache.org/zh-CN/docs/latest/deployment/quick_deploy) ;[Hadoop distributed deployment](https://linkis.apache.org/zh-CN/docs/latest/deployment/quick_deploy) | +| Hive(2.3.3,Other versions of Hive need to compile Linkis by themselves.) | yes | [Hive quick installation](https://linkis.apache.org/zh-CN/docs/latest/deployment/quick_deploy) | +| SQOOP (1.4.6) | yes | [How to install Sqoop](https://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html) | +| DSS1.0.1 | yes | [How to install DSS](https://github.com/WeBankFinTech/DataSphereStudio-Doc/blob/main/zh_CN/%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2/DSS%E5%8D%95%E6%9C%BA%E9%83%A8%E7%BD%B2%E6%96%87%E6%A1%A3.md) | +| Linkis1.1.0 | yes | [How to install Linkis](https://linkis.apache.org/zh-CN/docs/latest/deployment/quick_deploy) | +| Nginx | yes | [How to install Nginx](http://nginx.org/en/linux_packages.html) | + +Underlying component checking + +$\color{#FF0000}{Note: be sure to reinstall dss1.0.1, and the linkis version must be greater than 1.1.1. Please recompile linkis and use the package released on June 15th }$ + +[linkis1.1.1 code address ](https://github.com/apache/incubator-linkis/tree/release-1.1.1) + +[DSS1.0.1 code address ](https://github.com/WeBankFinTech/DataSphereStudio/tree/master) + +datasource enabled + +By default, two services related to datasources (ps-data-source-manager, ps-metadatamanager) will not be started in the startup script of linkis. If you want to use datasource services, you can start them by modifying the export enable _ metadata _ manager = true value in $ linkis_conf_dir/linkis-env.sh. When the service is started and stopped through linkis-start-all.sh/linkis-stop-all.sh, the datasource service will be started and stopped. For more details about data sources, please refer to [Data Source Function Usage](https://linkis.apache.org/zh-CN/docs/1.1.0/deployment/start_metadatasource) + +#### 1.2 Create Linux users + +Please keep the deployment user of Exchangis consistent with that of Linkis, for example, the deployment user is hadoop account. + +#### 1.3 在linkis中为exchangis加专用token + +Add special token to exchangis in linkis: + +```sql +INSERT INTO `linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`) VALUES ('EXCHANGIS-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS'); +``` + +Insert hive data source environment configuration by executing the following sql statement in linkis database. Note that ${HIVE_METADATA_IP} and ${HIVE_METADATA_PORT} in the statement need to be modified before execution, for example:${HIVE_METADATA_IP}=127.0.0.1,${HIVE_METADATA_PORT}=3306: + +```sql +INSERT INTO `linkis_ps_dm_datasource_env` (`env_name`, `env_desc`, `datasource_type_id`, `parameter`, `create_time`, `create_user`, `modify_time`, `modify_user`) VALUES ('开发环境SIT', '开发环境SIT', 4, '{"uris":"thrift://${HIVE_METADATA_IP}:${HIVE_METADATA_PORT}", "hadoopConf":{"hive.metastore.execute.setugi":"true"}}', now(), NULL, now(), NULL); +INSERT INTO `linkis_ps_dm_datasource_env` (`env_name`, `env_desc`, `datasource_type_id`, `parameter`, `create_time`, `create_user`, `modify_time`, `modify_user`) VALUES ('开发环境UAT', '开发环境UAT', 4, '{"uris":"thrift://${HIVE_METADATA_IP}:${HIVE_METADATA_PORT}", "hadoopConf":{"hive.metastore.execute.setugi":"true"}}', now(), NULL, now(), NULL); +``` + +#### 1.4 Underlying component checking + +Please ensure that DSS1.0.1 and Linkis1.1.0 are basically available. HiveQL scripts can be executed in the front-end interface of DSS, and DSS workflows can be created and executed normally. + +## 2. Exchangis installation and deployment + +### 2.1 Prepare installation package + +#### 2.1.1 Download binary package + +Download the latest installation package from the Released release of Exchangis [click to jump to the release interface](https://github.com/WeBankFinTech/Exchangis/releases). + +#### 2.1.2 Compile and package + + Execute the following command in the root directory of the project: + +```shell script + mvn clean install +``` + + After successful compilation, the installation package will be generated in the `assembly-package/target` directory of the project. + +### 2.2 Unzip the installation package + + Execute the following command to decompress: + +```shell script + tar -zxvf wedatasphere-exchangis-{VERSION}.tar.gz +``` + + The directory structure after decompression is as follows: + +```html +|-- config:One-click installation deployment parameter configuration directory +|-- db:Database initialization SQL directory +|-- exchangis-extds +|-- packages:Exchangis installation package directory +|-- sbin:Script storage directory +``` + +### 2.3 Modify configuration parameters + +```shell script + vim config/config.sh +``` + +```shell script +#IP of LINKIS_GATEWAY service address, which is used to find linkis-mg-gateway service. +LINKIS_GATEWAY_HOST= + +#The LINKIS_GATEWAY service address port is used to find linkis-mg-gateway service. +LINKIS_GATEWAY_PORT= + +#The URL of LINKIS_GATEWAY service address is composed of the above two parts. +LINKIS_SERVER_URL= + +#Token used to request verification of linkis service, which can be obtained in ${LINKIST_INSTALLED_HOME}/conf/token.propertis of linkis installation directory. +LINKIS_TOKEN= + +#Eureka service port +EUREKA_PORT= + +#Eureka service URL +DEFAULT_ZONE= +``` + +### 2.4 Modify database configuration + +```shell script + vim config/db.sh +``` + +```shell script +# Set the connection information of the database. +# Include IP address, port, user name, password and database name. +MYSQL_HOST= +MYSQL_PORT= +MYSQL_USERNAME= +MYSQL_PASSWORD= +DATABASE= +``` + +### 2.5 Installation and startup + +#### 2.5.1 Execute one-click installation script. + + Execute the install.sh script to complete the one-click installation and deployment: + +```shell script + sh sbin/install.sh +``` + +#### 2.5.2 Installation step + + This script is an interactive installation. After executing the install.sh script, the installation steps are divided into the following steps: + +1. Initialize database tables. + + When the reminder appears: Do you want to confiugre and install project? + + Enter `y` to start installing Exchange IS service, or `n` to not install it. + +#### 2.5.3 Start service + +Execute the following command to start Exchangis Server: + +```shell script + sh sbin/daemon.sh start server +``` + + You can also use the following command to restart Exchangis Server: + +```shell script +./sbin/daemon.sh restart server +``` + +After executing the startup script, the following prompt will appear, eureka address will also be typed in the console when starting the service: + +![企业微信截图_16532930262583](https://user-images.githubusercontent.com/27387830/169773764-1c5ed6fb-35e9-48cb-bac8-6fa7f738368a.png) + +### 2.6 Check whether the service started successfully. + +You can check the success of service startup in Eureka interface. Check the method: + +Use http://${EUREKA_INSTALL_IP}:${EUREKA_PORT}. It is recommended to open it in Chrome browser to see if the service is registered successfully. + +As shown in the figure below: + +![补充Eureka截图](../../../images/zh_CN/ch1/eureka_exchangis.png) + +### 2.7 Front-end installation and deployment + +#### 2.7.1 Get the front-end installation package + +Exchangis has provided compiled front-end installation package by default, which can be downloaded and used directly :[Click to jump to the Release interface](https://github.com/WeBankFinTech/Exchangis/releases) + +You can also compile the exchange front-end by yourself and execute the following command in the exchanise root directory: + +```shell script + cd web + npm i + npm run build +``` + +Get the compiled dist.zip front-end package from the `web/` path. + +The acquired front-end package can be placed anywhere on the server. Here, it is recommended that you keep the same directory as the back-end installation address, place it in the same directory and unzip it. + +#### 2.7.2 Front-end installation deployment + +1. Decompress front-end installation package + + If you plan to deploy Exchange is front-end package to the directory `/appcom/install/Exchange is/web`, please copy ` dist.zip to the directory and extract it: + +```shell script + # Please copy the exchange front-end package to `/appcom/install/exchange/web` directory first. + cd /appcom/Install/exchangis/web + unzip dist.zip +``` + + Execute the following command: + +```shell script + vim /etc/nginx/conf.d/exchangis.conf +``` + +``` + server { + listen 8098; # Access port If this port is occupied, it needs to be modified. + server_name localhost; + #charset koi8-r; + #access_log /var/log/nginx/host.access.log main; + location /dist { + root /appcom/Install/exchangis/web; # Exchangisfront-end deployment directory + autoindex on; + } + + location /api { + proxy_pass http://127.0.0.1:9020; # The address of the back-end Linkis needs to be modified. + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header x_real_ipP $remote_addr; + proxy_set_header remote_addr $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_http_version 1.1; + proxy_connect_timeout 4s; + proxy_read_timeout 600s; + proxy_send_timeout 12s; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection upgrade; + } + + #error_page 404 /404.html; + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + } +``` + +#### 2.7.3 Start nginx and visit the front page + + After the configuration is complete, use the following command to refresh the nginx configuration again: + +```shell script + nginx -s reload +``` + +Please visit the Exchange front-end page at http://${EXCHANGIS_INSTALL_IP}:8098/#/projectManage. The following interface appears, indicating that Exchangis successfully installed on the front end. If you really want to try Exchangis, you need to install dss and linkis, and log in secret-free through dss. As shown in the following figure : + +![image](https://user-images.githubusercontent.com/27387830/170417473-af0b4cbe-758e-4800-a58f-0972f83d87e6.png) + +## 3. DSS ExchangisAppConn installation and deployment + +If you want to use Exchangis1.0.0 front-end, you also need to install the DSS ExchangisAppConn plugin. Please refer to: [ExchangisAppConn installation documentation for plugins ](exchangis_appconn_deploy_cn.md) + +## 4. Linkis Sqoop engine installation and deployment + +If you want to execute the Sqoop operation of Exchangis1.0.0 normally, you also need to install the Linkis Sqoop engine. Please refer to: : [Linkis Sqoop engine installation documentation ](exchangis_sqoop_deploy_cn.md) + +## 5. How to log in and use Exchangis + + To be supplemented ! diff --git a/docs/en_US/ch1/exchangis_job_execute_en.md b/docs/en_US/ch1/exchangis_job_execute_en.md new file mode 100644 index 000000000..b6e62bec8 --- /dev/null +++ b/docs/en_US/ch1/exchangis_job_execute_en.md @@ -0,0 +1,201 @@ +# Exchangis synchronous job execution module detailed design document + +## 一、Overall flow chart + + ![img](../../../images/zh_CN/ch1/job_overall.png) + +
+Figure 1-1 General flow chart +
+ + Please note that : + +1. If the user directly submits a JSON of the synchronization task to be executed through the REST client, the JSON can be directly submitted to the TaskGenerator without step 2. + +2. Every time the front-end or REST client submits, it will generate a JobExecutionId to the front-end, and the subsequent front-end or REST client will obtain the execution status of synchronous job job through jobExecutionId. + +3. JobExecutionId is best generated and returned when the user submits it, that is, the TaskGenerator should be performed asynchronously. Generally, the TaskGenerator may take several seconds to several minutes (depending on the number of subJob), so if you wait for the TaskGenerator to finish before returning jobExecutionId, the front-end request will probably time out. + +4. Therefore, only the front-end or REST client generates a jobExecutionId for each submission, which is to support the repeated submission of the same ExchangisJob. Therefore, in principle, JobServer won't check that only one instance of ExchangisJob can be executed at the same time, but the Web front-end should ensure that only one instance of the same ExchangisJob is executed at the same time in the same browser. + +## 二、Front-background interaction + +![img](../../../images/zh_CN/ch1/job_frontend_backend.png) + +
+Figure 2-1 Interaction between foreground and background +
+ +### 1. The necessity of jobExecutionId + +Consider the scenario that REST client directly submits a JSON synchronization task that it wants to be executed, and in order to support the repeated submission of the same ExchangisJob, it is necessary to generate a jobExecutionId every time it is submitted. + +JobExecutionId is an execution voucher of ExchangisJob, which will be stored in the database. All subsequent requests about the execution of this ExchangisJob need to bring jobExecutionId. + +1. The necessity of TaskGenerator asynchrony + +Consider a scenario, that is, after the client submits the job, the client hangs up before Exchangis can return to jobExecutionId. In this case, because jobExecutionId is not printed in the log of the client, the submitting user thinks that the job was not submitted successfully, so there may be data confusion. Furthermore, it may take a long time for TaskGenerator to process an ExchangisJob (depending on the number of subJob), so if you wait for TaskGenerator to finish before returning jobExecutionId, the front-end request will probably time out. + +Therefore, once the JobServer receives the job execution request, it should immediately generate a jobExecutionId, and generate an execution record for this ExchangisJob in the database, and set the execution status as Inited. As long as the database is persisted successfully, it will asynchronously generate the task of TaskGenerator and immediately return to jobExecutionId. + +### 2. Statelessness of JobServer + +This paper discusses whether JobServer is stateless, that is, after the front end gets jobExecutionId, no matter which JobServer instance is requested, it can normally get the desired data in execution. + +Because there is no special information stored in the memory of JobServer, and the ExchangisJob execution status, progress and Metrics information will be stored in the database, when the front-end request is sent, you only need to go to the database to fetch the relevant data. Therefore, the JobServer is stateless. + +### 3. Multi-tenant function + +Considering the multi-tenant capability, we can split JobGenerator and JobExecution, that is, JobGenerator is used to receive job execution requests submitted by front-end /REST clients in a distributed manner, and JobGenerator generates task sets and stores them in the database. This microservice can be shared by all tenants; While JobExecution can be divided according to different tenants, so as to avoid mutual influence during execution. + +### 4. High availability + +TaskChooseRuler of JobExecution will scan all Exchange Tasks in the database. If an ExchangisTask has not been updated in status after more than a period of time, it will be taken over by the new JobServer. + +How to take over? + +A simple takeover means that the JobServer of all other inventories loads this ExchangisTask to the TaskScheduler at the same time. Because it updates the progress, status and Metrics information, although many of them are updated at the same time, it has no impact on the task. + +Complex takeover requires adding a field in the database table of ExchangisTask to identify the JobServer that is executing the ExchangisTask. At this time, multiple job servers will be triggered to grab the ownership of the Exchangistask. Because the scheme is complex, it will not be considered for the time being. + +## 三、Detailed explanation of front-end interaction + +### 1. Submit + +Before execution, the page is shown in the following figure: + +As the execution interface (with the link to the submission interface attached) needs to be provided with jobId, before actually submitting for execution, it needs to be saved and then submitted, and a basic check should be made before submission, that is, if no subtask or job fails to be saved, it cannot be submitted for execution. + +![img](../../../images/zh_CN/ch1/job_frontend_1.png) + +
+Figure 3-1 Task submission +
+ +Click execute, as shown in the figure below: + +Note that the job information desk will pop up at this moment, showing the running status by default, that is, the overall progress and the progress of all subtasks. + +There are two interfaces used in the front end. One is to use the [Execution Interface] first, submit the ExchangisJob for execution, and return the jobExecutionId; in the background; Second, call the [Get Job Progress] interface through jobExecutionId, which is used to get the progress information of Job&all task, and to show the progress of the following pages. + +![img](../../../images/zh_CN/ch1/job_frontend_2.png) + +
+Figure 3-2 Task Execution +
+ +### 2. Operation status of subtasks + +When the user clicks on a running/completed sub-job, the front end triggers the [Get Task Metrics Information] interface in the background of the request, and obtains the task Metrics information through jobExecutionId & taskId, showing the contents of the following page: + +![1655260735321](../../../images/zh_CN/ch1/job_frontend_3.png) + +
+Figure 3-3 Operation of subtasks +
+ +Show the main resource usage, flow rate and core indicators. + +![1655260937221](../../../images/zh_CN/ch1/job_frontend_4.png) + +
+Figure 3-4 Resource usage of subtasks +
+ +### 3. Real-time log + +When the user clicks the "Log" button in the lower right corner as shown in the figure below, the "Real-time Log" Tab will appear at the information desk, and the real-time log of Job will be displayed by default. When you click the "Log" button of the running status, the running log of the whole Job will be displayed by default at first. At this time, the front end will call the interface of "Get Job Real-time Log" by default, and get the job log through jobExecutionId and display it, as shown in the following figure: + +![img](../../../images/zh_CN/ch1/job_frontend_5.png) + +
+Figure 3-5 Task Real-time Log +
+ +As long as the user doesn't switch to other tabs of the information desk, the front end will constantly poll the background for real-time logs; + +The user can also select to view the log of a certain task through the select selection box, then trigger the request [Get task Real-time Log] interface, get the task log through jobExecutionId & taskId, and continuously poll the latest log. + +If the user switches the select box, the previous log will not be refreshed. + +It should be Inited here that the background also provides an interface of [Get task List of this Job Execution], which is used to help the front end to get all the task lists and display the contents of the select selection box. If the Job itself is still in the initiated or Scheduled state, but it has not been successfully turned into the Running state, the task list cannot be pulled at this time, so when the user drops down the select selection box, the user should be prompted that "the Job is still being scheduled. Please check the real-time log of subtasks after the Job is turned into the Running state." + +After the operation is completed, if the status is successful, the Tab will be switched back to the operation Tab page; If the status is failed, based on the information returned by the [Get Job Progress] interface, the log of the failed sub-job's task will be displayed by default, and the log of the first failed task will be displayed automatically when multiple tasks fail. + +## 四、Detailed explanation of background design + +### 1. Table structure design + +![img](../../../images/zh_CN/ch1/job_backend_datasource_design.png) + +
+Figure 4-1 Database Table Structure Design +
+ +### 2. Interface document + +Please refer to the interface document of Exchangis job execution module for details. + +### 3. Core module & Core class design + +#### 3.1 The UML class diagram of the Bean is as follows: + +![img](../../../images/zh_CN/ch1/job_backend_uml_1.png) + + + +
+Figure 4-2 UML class diagram of entity Bean +
+ +Please note that all non-interfaces ending in Entity need to be stored in the database and exist as a table. + +#### 3.2 The UML class diagram structure of TaskGenerator is as follows: + +![img](../../../images/zh_CN/ch1/job_backend_uml_2.png) + +
+Figure 4-3 UML class diagram of TaskGenerator +
+ +TaskGenerator is only responsible for converting the JSON of a Job into a task set that can be submitted to Linkis for execution (that is, all sub Jobs under the job are translated into an ExchangisTask set), and the translation is written into DB. + +It should be noted here that TaskGenerator is executed asynchronously, and we will encapsulate JobGenerationSchedulerTask in the Service layer for asynchronous submission to TaskExecution for execution. + +#### 3.3 The UML class diagram structure of TaskExecution system is as follows: + +![img](../../../images/zh_CN/ch1/job_backend_uml_3.png) + +
+Figure 4-4 UML class diagram of Task Execution system +
+ +1. TaskExecution is mainly composed of TaskConsumer, TaskManager, TaskScheduler and TaskSchedulerLoadBalancer. + +2. TaskManager,mainly used to manage all ExchangisTask; in the Running state under this JobServer; + +3. TaskConsumer consists of several thread groups with different functions, such as NewTaskCustomer and ReceiveTaskConsumer. Among them, NewTaskConsumer fetch all executable ExchangisTask lists in the initiated state from the database (ExchangisTask lists corresponding to multiple subJob that may include multiple jobs) and submits them to TaskScheduler in batches according to the actual load of Task Scheduler; Before submitting, the status of this task in the database will be updated to Scheduled;; The receiver is used to take over an ExchangisTask that is already in operation, but still has no updated status and Metrics information after a certain period of time, and put the ExchangisTask into the TaskManager to wait for the status to be updated by StatusUpdateSchedulerTask and MetricsUpdateSchedulerTask. TaskChooseRuler is a rule device used to help TaskConsumer filter and select the required ExchangisTask, such as judging whether ExchangisTask can take over, priority strategy and other rules. + +4. TaskScheduler is a thread pool for scheduling various types of SchedulerTask;; SubmitSchedulerTask is used to asynchronously submit tasks to Linkis for execution, and write key information returned by Linkis, such as Id and ECM information, into DB; StatusUpdateSchedulerTask and MetricsUpdateSchedulerTask are permanent polling tasks that will never stop. They will constantly get the SchedulerTask that is already in the Running state from TaskManager, request status and Metrics information from Linkis regularly, and update the database. + +5. TaskSchedulerLoadBalancer is a loader, which is used to detect the polling situation of Running tasks in TaskManager, the load situation of TaskScheduler and server in real time, and determine how many StatusUpdateSchedulerTask and MetricsUpdateSchedulerTask are finally instantiated by TaskScheduler to poll the status and Metrics information of all running tasks. + +#### 3.4 The UML class diagram of TaskScheduler system is as follows: + +![img](../../../images/zh_CN/ch1/job_backend_uml_4.png) + +
+Figure 4-5 UML class diagram of Task Scheduler system +
+ + TaskScheduler is implemented based on linkis-scheduler module. + +#### 3.5 The UML class diagram of the Listener system is as follows: + +![img](../../../images/zh_CN/ch1/job_backend_uml_5.png) + +
+Figure 4-6 UML class diagram of listener system +
+ +The Listener system is the core to ensure that all information can be updated to the database, and the implementation classes of these listeners should be all service classes. \ No newline at end of file diff --git a/docs/en_US/ch1/exchangis_job_execute_interface_en.md b/docs/en_US/ch1/exchangis_job_execute_interface_en.md new file mode 100644 index 000000000..27be74f00 --- /dev/null +++ b/docs/en_US/ch1/exchangis_job_execute_interface_en.md @@ -0,0 +1,361 @@ +# Exchangis job execution module interface document + +### 1、Submit the configured job for execution. + +Interface description : Submit ExchangisJob and return jobExecutionId in the background. + +Request URL:/api/rest_j/v1/exchangis/job/{id}/execute + +Request mode:POST + +Request parameters: + +| Name | Type | Remark | If required | Default value | +| --------------------- | ------- | ------------------------------------------------------------ | ----------- | ------------- | +| id | Long | Exchangis's ID | yes | / | +| permitPartialFailures | boolean | Whether partial failure is allowed. If true, even if some subtasks fail, the whole Job will continue to execute. After the execution is completed, the Job status is Partial_Success. This parameter is the requestBody parameter. | no | false | + +Return parameter : + +| Name | Type | Remark | If required | Default value | +| -------------- | ------ | ------------------------------------ | ----------- | ------------- | +| method | String | Called method (request path) | yes | / | +| status | int | Response status code | yes | / | +| message | String | Information of the response | no | / | +| data | Map | The returned data | yes | / | +| jobExecutionId | String | Returns the execution log of the Job | yes | / | + +Back to example : + +```json +{ + "method": "/api/rest_j/v1/exchangis/job/{id}/execute", + "status": 0, + "message": "Submitted succeed(Submit successfully)!", + "data": { + "jobExecutionId": "555node1node2node3execId1" +} + +``` + +### 2、Get the execution status of Job + +Interface description: Get the status of Job according to jobExecutionId + +Request URL:/api/rest_j/v1/exchangis/job/execution/{jobExecutionId}/status + +Request mode:GET + +Request parameters: + +| Name | Type | Remark | If required | Default value | +| -------------- | ------ | ---------------------------- | ----------- | ------------- | +| jobExecutionId | String | Execution ID of ExchangisJob | yes | / | + +Back to example : + +| Name | Type | Remark | If required | Default value | +| -------------- | ------ | ------------------------------------------------------------ | ----------- | ------------- | +| method | String | Called method (request path) | yes | / | +| status | int | Response status code | yes | / | +| message | String | Information of the response | no | / | +| data | Map | The returned data | yes | / | +| jobExecutionId | String | The status of the executed job, including: initiated, Scheduled, Running, WaitForRetry, Cancelled, Failed, Partial_Success, Success, Undefined, Timeout. Among them, the Running state indicates that it is running, and all of them are completed since Cancelled | yes | / | + +Back to example : + +```json +{ + "method": "/api/rest_j/v1/exchangis/job/execution/{id}/status", + "status": 0, + "message": "Submitted succeed(Submit successfully)!", + "data": { + "status": "Running", + "progress": 0.1 +} +``` + +### 3、Get the task list executed by this Job + +Interface description:Get the task list through jobExecutionId + +Prerequisite: the task list can only be obtained after the Job's execution status is Running, otherwise the returned task list is empty. + +Request URL:/api/rest_j/v1/exchangis/job/execution/{jobExecutionId}/tasklist + +Request mode:GET + +Request parameters: + +| Name | Type | Remark | If required | Default value | +| -------------- | ------ | ------ | ----------- | ------------- | +| jobExecutionId | String | string | yes | / | + +Back to example : + +| Name | Type | Remark | If required | Default value | +| -------------- | ------ | ------------------------------------------------------------ | ----------- | ------------- | +| method | String | Called method (request path) | yes | / | +| status | int | Response status code | yes | / | +| message | String | Information of the response | no | / | +| data | Map | The returned data | yes | / | +| jobExecutionId | String | Task list. The execution status of the Job must be Running before you can get the task list, otherwise the returned task list is empty. Please note: task has no Partial_Success status | yes | / | + +Back to example : + +```json +{ + "method": "/api/rest_j/v1/exchangis/job/execution/{jobExecutionId}/tasklist", + "status": 0, + "message": "Submitted succeed(Submit successfully)!", + "data": { + "tasks": [ + { + "taskId": 5, + "name": "test-1", + "status": "Inited", // There is no task Partial_Success status. + "createTime": "2022-01-03 09:00:00", + "launchTime": null, + "lastUpdateTime": "2022-01-03 09:00:00", + "engineType": "sqoop", + "linkisJobId": null, + "linkisJobInfo": null, + "executeUser": "enjoyyin" + } + ] + } +} + +``` + +### 4、Get the execution progress of Job & task + +Interface description: Get the execution progress through jobExecutionId + +Prerequisites: the execution status of the Job must be Running before you can get the progress of the task list. + +Request URL:/api/rest_j/v1/exchangis/job/execution/{jobExecutionId}/progress + +Request mode:GET + +Request parameters: + +| Name | Type | Remark | If required | Default value | +| -------------- | ------ | ---------------------------- | ----------- | ------------- | +| jobExecutionId | String | Execution ID of ExchangisJob | yes | / | + +Back to example : + +| Name | Type | Remark | If required | Default value | +| -------------- | ------ | ------------------------------------------------------------ | ----------- | ------------- | +| method | String | Called method (request path) | yes | / | +| status | int | Response status code | yes | / | +| message | String | Information of the response | no | / | +| data | Map | The returned data | yes | / | +| jobExecutionId | String | Task list. The execution status of the Job must be Running before you can get the task list, otherwise the returned task list is empty | yes | / | + +Back to example : + +```json +{ + "method": "/api/rest_j/v1/exchangis/job/execution/{jobExecutionId}/progress", + "status": 0, + "message": "Submitted succeed(Submit successfully)!", + "data": { + "job": { + "status": "Running", + "progress": 0.1, + "tasks": { + "running": [ + { + "taskId": 5, + "name": "test-1", + "status": "Running", + "progress": 0.1 + } + ], + "Inited": [ + { + "taskId": 5, + "name": "test-1", + "status": "Inited", + "progress": 0.1 + } + ], + "Scheduled": [], + "Success": [], + "Failed": [], // If there is a Failed task, the Job will fail directly. + "WaitForRetry": [], + "Cancelled": [], // If there is a Cancelled task, the Job will fail directly + "Undefined": [], // If there is a Undefined task, the Job will fail directly + "Timeout": [] + } + } + } +} + +``` + +### 5、Get the indicator information of task runtime + +Interface description:Through jobExecutionId and taskId, we can get the information of various indicators when task is running. + +Prerequisites: before you can get the indicator information of the task, the execution status of the task must be Running; otherwise, the returned information is empty. + +Request URL:/api/rest_j/v1/exchangis/task/execution/{taskId}/metrics + +Request mode:POST + +Request parameters: + +| Name | Type | Remark | If required | Default value | +| -------------- | ------ | --------------------------------------------------- | ----------- | ------------- | +| jobExecutionId | String | Execution ID of ExchangisJob,put it in requestBody | yes | / | +| taskId | String | Execution ID of task,put it in URI | yes | / | + +Back to example : + +| Name | Type | Remark | If required | Default value | +| -------------- | ------ | ------------------------------------------------------------ | ----------- | ------------- | +| method | String | Called method (request path) | yes | / | +| status | int | Response status code | yes | / | +| message | String | Information of the response | no | / | +| data | Map | The returned data | yes | / | +| jobExecutionId | String | Information of each task index. The execution status of task must be Running before you can get the indicator information of task | yes | / | + +Back to example : + +```json +{ + "method": "/api/rest_j/v1/exchangis/task/execution/{taskId}/metrics", + "status": 0, + "message": "Submitted succeed(Submit successfully)!", + "data": { + "task": { + "taskId": 5, + "name": "test-1", + "status": "running", + "metrics": { + "resourceUsed": { + "cpu": 10, // Unit:vcores + "memory": 20 // Unit:GB + }, + "traffic": { + "source": "mysql", + "sink": "hive", + "flow": 100 // Unit:Records/S + }, + "indicator": { + "exchangedRecords": 109345, // Unit:Records + "errorRecords": 5, + "ignoredRecords": 5 + } + } + } + } +} +``` + +### 6、Get the real-time log of Job + +Interface description:Get the real-time log of Job through jobExecutionId. + +Request URL:/api/rest_j/v1/exchangis/job/execution/{jobExecutionId}/log? fromLine=&pageSize=&ignoreKeywords=&onlyKeywords=&lastRows= + +Request mode:GET + +Request parameters: + +| Name | Type | Remark | If required | Default value | +| -------------- | ------ | ------------------------------------------------------------ | ----------- | ------------- | +| jobExecutionId | String | Execution ID of ExchangisJob | yes | / | +| fromLine | int | Read the starting line of | no | 0 | +| pageSize | int | Read the number of log lines this time | no | 100 | +| ignoreKeywords | String | Ignore which keywords are in the line, and multiple keywords are separated by English | no | / | +| onlyKeywords | String | Only the lines where keywords are located are selected, and multiple keywords are separated in English | no | / | +| lastRows | int | Read only the last few lines of the log, which is equivalent to tail -f log. When this parameter is greater than 0, all the above parameters will be invalid | no | / | + +Back to example : + +| Name | Type | Remark | If required | Default value | +| ------- | ------- | ------------------------------------------------------------ | ----------- | ------------- | +| method | String | Called method (request path) | yes | / | +| status | int | Response status code | yes | / | +| message | String | Information of the response | no | / | +| data | Map | The returned data | yes | / | +| endLine | int | The end line number of this reading, you can continue reading the log from endLine+1 next time | yes | / | +| isEnd | boolean | Have all the logs been read | no | / | +| logs | List | Returns the execution log of the Job | yes | / | + +Back to example : + +```json +{ + "method": "/api/rest_j/v1/exchangis/job/execution/{jobExecutionId}/log", + "status": 0, + "message": "Submitted succeed(Submit successfully)!", + "data": { + "endLine": 99, // The end line number of this reading, you can continue reading the log from endLine+1 next time + "isEnd": false, // Have all the logs been read + "logs": [ + "all": "", + "error": "", + "warn": "", + "info": "" + ] + } +} +``` + +### 7、Get the real-time log of task + +Interface description: Get the real-time log of task through jobExecutionId and taskId. + +Request URL:/api/rest_j/v1/exchangis/task/execution/{taskId}/log? jobExecutionId=&fromLine=&pageSize=&ignoreKeywords=&onlyKeywords=&lastRows= + +Request mode:GET + +Request parameters: + +| Name | Type | Remark | If required | Default value | +| -------------- | ------ | ------------------------------------------------------------ | ----------- | ------------- | +| taskId | String | Execution ID of task | yes | / | +| jobExecutionId | String | Execution ID of ExchangisJob | yes | / | +| fromLine | int | Read the starting line of | no | 0 | +| pageSize | int | Read the number of log lines this time | no | 100 | +| ignoreKeywords | String | Ignore which keywords are in the line, and multiple keywords are separated by English | no | / | +| onlyKeywords | String | Only the lines where keywords are located are selected, and multiple keywords are separated in English | no | / | +| lastRows | int | Read only the last few lines of the log, which is equivalent to tail -f log. When this parameter is greater than 0, all the above parameters will be invalid | no | / | + +Back to example : + +| Name | Type | Remark | If required | Default value | +| ------- | ------- | ------------------------------------------------------------ | ----------- | ------------- | +| method | String | Called method (request path) | yes | / | +| status | int | Response status code | yes | / | +| message | String | Information of the response | no | / | +| data | Map | The returned data | yes | / | +| endLine | int | The end line number of this reading, you can continue reading the log from endLine+1 next time. | yes | / | +| isEnd | boolean | Have all the logs been read | yes | / | +| logs | List | Returns the execution log of the Job | yes | / | + +Back to example : + +```json +{ + "method": "/api/rest_j/v1/exchangis/job/execution/{taskId}/log", + "status": 0, + "message": "Submitted succeed(Submit successfully)!", + "data": { + "endLine": 99, // The end line number of this reading, you can continue reading the log from endLine+1 next time. + "isEnd": false, // Have all the logs been read + "logs": [ + "all": "", + "error": "", + "warn": "", + "info": "" + ] + } +} +``` + diff --git a/docs/en_US/ch1/exchangis_sqoop_deploy_en.md b/docs/en_US/ch1/exchangis_sqoop_deploy_en.md new file mode 100644 index 000000000..d0bd79f35 --- /dev/null +++ b/docs/en_US/ch1/exchangis_sqoop_deploy_en.md @@ -0,0 +1,77 @@ +# Sqoop engine uses documentation +### Prepare the environment +Sqoop engine is an indispensable component to perform Exchange IS data synchronization task, and only after the installation and deployment of Sqoop engine can it successfully perform data synchronization task. At the same time, make sure sqoop is installed on the deployed machine. + +Before you install and deploy Sqoop engine, please follow [Exchangis1.0.0](https://github.com/wedisphere/exchange/blob/dev-1.0.0-rc/docs/zh _ cn/ch1/exchange _ deploy _ cn.md). + +Sqoop engine mainly depends on Hadoop basic environment. If this node needs to deploy Sqoop engine, it needs to deploy Hadoop client environment. + +It is strongly recommended that you use the native Sqoop to perform the test task on this node before performing the Sqoop task, so as to check whether the environment of this node is normal. + +| Environment variable name | Environment variable content | Remark | +| :----: | :----: |-------| +| JAVA_HOME | JDK installation path | Required | +| HADOOP_HOME | Hadoop installation path | Required | +| HADOOP_CONF_DIR | Hadoop config path | Required | +| SQOOP_HOME | Sqoop installation path | Not Required | +| SQOOP_CONF_DIR | Sqoop config path | Not Required | +| HCAT_HOME | HCAT config path | Not Required | +| HBASE_HOME | HBASE config path | Not Required | + + +| Linkis system params | Params | Remark | +| --------------------------- | -------------------------------------------------------- | ------------------------------------------------------------ | +| wds.linkis.hadoop.site.xml | Set the location where sqoop loads hadoop parameter file | Required, please refer to the example:"/etc/hadoop/conf/core-site.xml;/etc/hadoop/conf/hdfs-site.xml;/etc/hadoop/conf/yarn-site.xml;/etc/hadoop/conf/mapred-site.xml" | +| sqoop.fetch.status.interval | Set the interval for getting sqoop execution status | Not Required, the default value is 5s. | +### Prepare installation package +#### 1)Download binary package + +Exchangis1.0.0 and Linkis 1.1.0 support the mainstream Sqoop versions 1.4.6 and 1.4.7, and later versions may need to modify some codes for recompilation. + +[Click to jump to Release interface](https://github.com/WeBankFinTech/Exchangis/releases) + +#### 2)Compile and package +If you want to develop and compile sqoop engine yourself, the specific compilation steps are as follows: + +1.clone Exchangis's source code + +2.Under exchangis-plugins module, find sqoop engine and compile sqoop separately, as follows : + +``` +cd {EXCHANGIS_CODE_HOME}/exchangis-plugins/engine/sqoop +mvn clean install +``` +Then the sqoop engine installation package will be found in this path. +``` +{EXCHANGIS_CODE_HOME}\exchangis-plugins\sqoop\target\out\sqoop +``` + + +### Start deployment +#### 1)Sqoop engine installation +1、Get the packed sqoop.zip material package + +2、Place it in the following directory and unzip it + +``` +cd {LINKIS_HOME}/linkis/lib/linkis-engineconn-plugins +unzip.zip +``` +The extracted directory structure is: +``` +dist +plugin +``` +(Note, see which users the current sqoop engine has permissions on, not necessarily root) + + +#### 2)Restart linkis-engineplugin service to make sqoop engine take effect +New engines joining linkis will not take effect until the engineplugin service of linkis is restarted, and the restart script is. /linkis-daemon.sh in the Linkis installation directory. The specific steps are as follows : +``` +cd {LINKIS_INSTALL_HOME}/links/sbin/ +./linkis-daemon.sh restart cg-engineplugin +``` +After the service is successfully started, the installation and deployment of sqoop will be completed. + +For a more detailed introduction of engineplugin, please refer to the following article. +https://linkis.apache.org/zh-CN/docs/latest/deployment/engine_conn_plugin_installation \ No newline at end of file diff --git a/docs/en_US/ch1/exchangis_user_manual_en.md b/docs/en_US/ch1/exchangis_user_manual_en.md index e69de29bb..b7a19158b 100644 --- a/docs/en_US/ch1/exchangis_user_manual_en.md +++ b/docs/en_US/ch1/exchangis_user_manual_en.md @@ -0,0 +1,264 @@ +# Exchangis1.0 User Manual + +## 一、Product introduction + +   This article is a quick entry document of Exchangis 1.0, covering the basic usage process of Exchangis 1.0. Exchangis a lightweight data exchange service platform, which supports data synchronization between different types of data sources. The platform data exchange process is split, and the concepts of data source, data exchange task and task scheduling are abstracted, so as to achieve the purpose of visual management of data synchronization process. In the actual data transmission process, the characteristics of multiple transmission components can be integrated to achieve horizontal expansion of functions. + +## 二、Login Exchangis1.0 + +   Exchangis1.0 is currently a part of DSS**data exchange component**, and it can be accessed in the component list by logging in to DSS. Therefore, before using Exchangis 1.0, please make basic deployment of DSS, Exchange IS 1.0, Linkis and other related components to ensure that the components' functions are available. This article will not go into details. See for details:[exchangis_deploy_en](https://github.com/WeDataSphere/Exchangis/blob/dev-1.0.0-rc/docs/en_US/ch1/exchangis_deploy_en.md)和[exchangis-appconn_deploy_en](https://github.com/WeDataSphere/Exchangis/blob/dev-1.0.0-rc/docs/en_US/ch1/exchangis_appconn_deploy_en.md) + +### 1、Login DSS + +   By default, the system uses Linux deployment users of Linkis to log in to DSS. If users of hadoop deploy Linkis and DSS, they can log in directly through the account password: hadoop/hadoop. First log in to the webpage according to the front-end deployment address of DSS, and then enter the account password: hadoop/hadoop to enter DSS. + +### 2、Enter Exchangis + +   Exchangis is accessed through DSS. Click on the word: **Home ->DSS Application Components-> Data Exchange-> Enter Exchange**. + +![exchangis1.0_entrance](../../../images/zh_CN/ch1/exchangis1.0_entrance.png) +
+Pic2-1 Exchangis1.0 entrance +
+ +## 三、Datasource management + +  This module can configure and manage data sources. As the initial step of data synchronization, Exchangis1.0 currently supports direct data import between mysql and hive. +The main functions of data source are as follows : + +1. Create, edit and delete data sources; +2. Search data sources by type and name, and support quick positioning of data sources; +3. Data source connection test operation; +4. Release and record of historical data source version. + +![datasource_list](../../../images/zh_CN/ch1/datasource_list.png) + +
+Pic4-1 Datasource management list +
+ + +### 1、Create datasource + +   Click **Create Data Source** and select the data source you want to create. Currently, MySQL and Hive data sources can be created. + +![datasource_type](../../../images/zh_CN/ch1/datasource_type.png) + +
+Pic4-2 Datasource type +
+ + +  Select the MySQL data source and fill in the configuration parameters, among which the asterisk is required. Make sure that the Host, port number, user name and password connected to MySQL database are connected correctly. **Connection parameter** is in Json format, which is used to set the configuration information of MySQL. After filling it out, you can **test the connection**. + +![MySQL_datasource_config](../../../images/zh_CN/ch1/MySQL_datasource_config.png) + +
+Pic4-3 MySQL datasource config +
+ + +  For the configuration of Hive data source, it is different from MySQL. For the time being, it does not provide users with the function of configuring cluster parameters in the interface. For the cluster environment, it is completed by the back-end unified configuration. Users only need to select the required cluster environment and click OK to save it. + +![Hive_datasource_config](../../../images/zh_CN/ch1/Hive_datasource_config.png) + +
+Pic4-4 Hive datasource config +
+ + +### 2、Datasource function + +   The data source management module provides the function of **publishing** the version of the configured data source. Only the published data source can be used when configuring derivative tasks, otherwise, it will prompt that it is unavailable. As long as the data source is edited again, it will be regarded as a new version, and the latest version is in the first row. You can **view** the configuration of all historical data source versions in the version list, and you can refer to it whenever you need to roll back. + +![datasource_func](../../../images/zh_CN/ch1/datasource_func.png) + +
+Pic4-5 Datasource release +
+ +  The **expired ** function of data source management is used to indicate that this data source has been gradually replaced. Please change the task configuration using this data source in time to avoid the failure of the configured execution task caused by directly deleting the data source. +![datasource_timelimit](../../../images/zh_CN/ch1/datasource_timelimit.png) + +
+Pic4-6 Datasource expiration +
+ +## 四、Project management + +### 1、Project list + +   This module can create projects. In actual derivative tasks, there can be multiple derivative tasks under a project, and different projects do not affect each other. For ordinary users, they can only operate their own created projects. On the homepage of project management, you can manage projects, including **create**, **modify** and **delete** and **query and search**. Modification and deletion can only be performed on projects created in Exchangis. + +![item_list](../../../images/zh_CN/ch1/item_list.png) +
+Pic3-1 Project list +
+ + +### 2、Task list + +   You can manage the created Job data synchronization tasks in the task list, similar to projects, including **Create**, **Modify**, **Delete** and **Search**. + +![job_task_list](../../../images/zh_CN/ch1/job_task_list.png) +
+Pic3-2 Task list +
+ +   In addition, the **task supports copying**, which can increase the required tasks. The copied task contains all the information of its original task configuration. Click **Create Task** to select the task type and execution engine. **Currently, only offline tasks and SQOOP execution engine** are supported, and streaming tasks and DataX engines will be supported in the future. + +![task_type_and_engine](../../../images/zh_CN/ch1/task_type_and_engine.png) +
+Pic3-3 Task type and Engine config +
+ +### 3、Synchronize data task configuration and execution + +   Data synchronization task configuration and execution is the core function of Exchangis1.0. The basic configuration data synchronization process is: **Add subtasks-> Select source data source database table and destination data source database table (add data source in data source management module for selection)-> Field mapping (default)-> Process control (default)-> Configuration (default)-> Execute**. + +The main functions of task execution include: +1. Add, copy and delete subtask cards ; +2. Realize the import and export of data between two different types of data sources ; +3. Selection of library tables for source and destination data sources ; +4. Datasource field mapping ; +5. Maximum job concurrency and maximum job memory configuration ; +6. Data synchronization task execution status view ; +7. Log view of each main task and each subtask ; +8. Task execution history status view ; +9. Execute the task kill operation. + +### 4、Selecting and configuring data sources + +  Click **Add Sub-task** to start creating a data synchronization task. For the newly created data synchronization sub-task, you must first select the data source library table. The data source must be configured in advance in the **data source management module** before it will appear in the task configuration. Select the data source to support search, and the search method is to search the library first, and then search the table. + +![add_subtask](../../../images/zh_CN/ch1/add_subtask.png) +
+Pic3-4 Add sub-task +
+ +  When MySQL is the destination data source, it supports **insert** and **update** two writing methods; When it is the source data source, it supports **WHERE conditional statement query**. + +   When Hive is the destination data source, partition information configuration is supported, and the writing methods are **append data** and **overwrite**; When the source data source is **partition information configuration is supported**. + +### 5、Datasource field mapping + +   When the data source library table information is configured, Exchangis1.0 will automatically generate automatic field mapping between the original data source and the destination data source in the **field mapping** line, and you can choose the field you want to map; When HIVE is the destination data source, its mapping field cannot be modified, which should be noted. + +### 6、Process control + +   Task execution provides the configuration of the maximum parallel number of tasks and the maximum memory configuration of jobs, which can be changed according to actual needs. + +### 7、Job execution + +  Exchangis1.0 support the simultaneous execution of multiple subtasks. After the task configuration is completed, click Execute to start the data synchronization task, and the workbench will pop up at the bottom of the interface. The workbench mainly contains three functions: **running status, real-time log and execution history** . +   **Running Status** :You can view the overall progress of the current data synchronization task, including the number of successes and failures of the task, and click on the name of the task to display the information of various running indicators of each task. + +   **Real-time log** :The main display contents include two categories. One is the log of the whole derivative job, which can output the status log of each task, such as whether the task is scheduled or not, and whether it is running moderately; The second is the log of each task, and the output is the corresponding derivative log. In the real-time log, the log can be filtered according to keywords and ignored words, and the function of obtaining the last N lines of logs is provided separately; You can also screen and display different types of logs of Error, Warning and Info, just click the corresponding button. + +   **Execution History** :It can display the historical execution information of this derivative task and provide a preliminary overview of the historical execution process. If you want to further view the detailed historical information, click on the task name to jump to the synchronous history interface for viewing. + +   Data synchronization task execution needs to specify the execution user, which is the login user by default. The specific situation needs to be adjusted according to the configuration of the actual data source. + + +## 五、Synchronous history + +   This module can view all data synchronization tasks performed historically, and each user can only view the tasks created by himself. Different users are isolated from each other. + + The main functions are as follows: +1. Find the required historical task information according to the query conditions ; +2. For non-terminal tasks, the function of terminating tasks is provided, which can kill non-terminal tasks ; +3. Check the running status and real-time day of each task ; +4. View more detailed configuration information and update time of each synchronization task . + +![sync_history](../../../images/zh_CN/ch1/sync_history.png) + +
+Pic5-1 Synchronous history +
+ +## 六、Exchangis Appconn uses + +   At present, Exchangis1.0 supports docking with DSS in the form of Appconn, **on the DSS side**, data exchange sqoop workflow node can be created in the mode of workflow arrangement through **application development-> project list ** of DSS, where data synchronization tasks can be configured and executed. Exchangis projects and data exchange tasks created in DSS will be created in Exchangis at the same time. + +Exchangis Appconn mainly supports the following functions : + +1. **Project operation ** is the creation, deletion and modification of DSS projects, which will synchronously affect the projects on Exchangis; + +2. **Basic operation of workflow node **is the task of creating, deleting and modifying sqoop workflow nodes in DSS choreographer, which will be synchronized to Exchangis. + + It is the task of creating, deleting and modifying sqoop workflow nodes in DSS choreographer, which will be synchronized to Exchangis; + +3. **Workflow derivative operation ** support sqoop workflow node configuration to perform data synchronization tasks; + +4. **Workflow publishing operation ** support sqoop workflow nodes to publish to WTSS for task scheduling. + +### 1、Project operation + +   This module can create, modify and delete DSS projects, and the operations on the DSS side will be synchronized to the Exchange is side. Here, take the project created in DSS as an example, and the process of operation in Exchange is as follows: **Click Create Project-> Fill in project information-> Click Confirm-> Enter Exchange is side-> Click Project Management**, and you can view the synchronously created projects, as shown in the following figure: + +![appconn_pro_create](../../../images/zh_CN/ch1/appconn_pro_create.png) + +
+Pic6-1 Project operation +
+ +After the creation, you will see the synchronized project on the Exchange is side. + +![appconn_pro_sync](../../../images/zh_CN/ch1/appconn_pro_sync.jpg) + +
+Pic6-2 Synchronize the project into Exchangis +
+ +### 2、Basic operation of workflow node + +  Workflow nodes can be created, modified, deleted, and selected depending on each other, and can be associated with each other. Operations on DSS side will be synchronized to Exchangis side. Taking the creation of sqoop workflow node as an example, the operation process of the project in exchangis appconn is as follows: **Create a workflow-> Drag sqoop node from the left plug-in bar to the right canvas-> Click OK to create sqoop node task-> Enter Exchangis to view the synchronously created task**, as shown in the following figure, and the same is true for deleting and modifying sqoop node tasks. + +![appconn_pro_sqoop](../../../images/zh_CN/ch1/appconn_pro_sqoop.png) + +
+Pic6-3 Sqoop node function +
+ + You can see that the derivative task is also synchronized to Exchangis. ![](../../../images/zh_CN/ch1/appconn_pro_sqoop_sync.jpg) + +
+Pic6-4 Synchronize the sqoop node into Exchangis +
+ +### 3、Workflow derivative operation + +   Double-click the Sqoop node to operate the workflow node. sqoop workflow node configuration and data synchronization tasks are supported. Derivative task in the form of workflow nodes is the core function of Exchangis Appconn **Each sqoop node represents a data synchronization task**, and the specific operation process is as follows: **Double-click the sqoop node-> Task configuration interface pops up-> Configure task information-> Execute task**, as shown in the following figure: + +![sqoop_config](../../../images/zh_CN/ch1/sqoop_config.png) + +
+Pic6-5 Double-click the sqoop workflow node to enter the configuration interface. +
+ +![sqoop_user_config](../../../images/zh_CN/ch1/sqoop_user_config.png) + +
+Pic6-6 Configure workflow node information +
+ +  There are two execution methods here, one is to click the execute button in the pop-up task configuration interface to execute; The other is to click the **Execute button** of DSS choreographer or **select the Execute button** to execute. **Click Execute** to execute all the nodes in this workflow, and **click Select Execute** to execute only the selected workflow nodes, but not all the nodes. + +![sqoop_execute](../../../images/zh_CN/ch1/sqoop_execute.png) + +
+Pic6-7 Execute job +
+ +Note: For data synchronization tasks performed in sqoop node of DSS, relevant information can be viewed on Exchangis. + +### 4、Workflow publishing operation + +  The **publish** function of workflow tasks supports sqoop workflow nodes to publish to WTSS for task scheduling. The data exchange task information created and configured in the * * Development Center **can be published to WTSS, and the task can be scheduled in WTSS**. + +### 5、Production center + +  Click the drop-down box in the namespace and switch to **Production Center **, where you can see the workflow logs of all projects and check the scheduling status of each workflow. + +![production_center](../../../images/zh_CN/ch1/production_center.png) + diff --git a/docs/zh_CN/ch1/README.md b/docs/zh_CN/ch1/README.md deleted file mode 100644 index cc2d8ccb0..000000000 --- a/docs/zh_CN/ch1/README.md +++ /dev/null @@ -1,62 +0,0 @@ -[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) - -[English](../../../README.md) | 中文 - -## 项目简介 -Exchangis是一个轻量级的、高扩展性的数据交换平台,支持对结构化及无结构化的异构数据源之间的数据传输,在应用层上具有数据权限管控、节点服务高可用和多租户资源隔离等业务特性,而在数据层上又具有传输架构多样化、模块插件化和组件低耦合等架构特点。 - -Exchangis的传输交换能力依赖于其底层聚合的传输引擎,其顶层对各类数据源定义统一的参数模型,每种传输引擎对参数模型进行映射配置,转化为引擎的输入模型。每聚合一种引擎,都将增加Exchangis一类特性,对某类引擎的特性强化,都是对Exchangis特性的完善。默认聚合以及强化Alibaba的DataX传输引擎。 - -## 核心特点 -- **数据源管理** -以绑定项目的方式共享自己的数据源; -设置数据源对外权限,控制数据的流入和流出。 - -- **多传输引擎支持** -传输引擎可横向扩展; -当前版本完整聚合了离线批量引擎DataX、部分聚合了大数据批量导数引擎SQOOP - -- **近实时任务管控** -快速抓取传输任务日志以及传输速率等信息,实时关闭任务; -可根据带宽状况对任务进行动态限流 - -- **支持无结构化传输** -DataX框架改造,单独构建二进制流快速通道,适用于无数据转换的纯数据同步场景。 - -- **任务状态自检** -监控长时间运行的任务和状态异常任务,及时释放占用的资源并发出告警。 - -## 与现有的系统的对比 -对现有的一些数据交换工具和平台的对比: - -| 功能模组 | 描述 | Exchangis | DataX | Sqoop | DataLink | DBus | -| :----: | :----: |-------|-------|-------|-------|-------| -| UI | 集成便捷的管理界面和监控窗口| 已集成 | 无 | 无 | 已集成 |已集成 | -| 安装部署 | 部署难易程度和第三方依赖 | 一键部署,无依赖 | 无依赖 | 依赖Hadoop环境 | 依赖Zookeeper | 依赖大量第三方组件 | -| 数据权限管理| 多租户权限配置和数据源权限管控 | 支持 | 不支持 | 不支持 | 不支持 | 支持 | -| |动态限流传输 | 支持 | 部分支持,无法动态调整 | 部分支持,无法动态调整| 支持 | 支持,借助Kafka | -| 数据传输| 无结构数据二进制传输 | 支持,快速通道 | 不支持 | 不支持 | 不支持,都是记录 | 不支持,需要转化为统一消息格式| -| | 嵌入处理代码 | 支持,动态编译 | 不支持 | 不支持 | 不支持 | 部分支持 | -| | 传输断点恢复 | 支持(未开源) | 不支持,只能重试 | 不支持,只能重试 | 支持 | 支持 | -| 服务高可用 | 服务多点,故障不影响使用| 应用高可用,传输单点(分布式架构规划中) | 单点服务(开源版本) | 传输多点 | 应用、传输高可用 | 应用、传输高可用 | -| 系统管理 | 节点、资源管理 | 支持 | 不支持 | 不支持 | 支持 | 支持 | - -## 整体设计 - -### 架构设计 - -![架构设计](../../../images/zh_CN/ch1/architecture.png) - -## 相关文档 -[安装部署文档](exchangis_deploy_cn.md) -[用户手册](exchangis_user_manual_cn.md) - -## 交流贡献 - -如果您想得到最快的响应,请给我们提 issue,或者扫码进群: - -![communication](../../../images/communication.png) - -## License - -Exchangis is under the Apache 2.0 License. See the [License](../../../LICENSE) file for details. \ No newline at end of file diff --git a/docs/zh_CN/ch1/exchangis_appconn_deploy_cn.md b/docs/zh_CN/ch1/exchangis_appconn_deploy_cn.md new file mode 100644 index 000000000..aedf6db48 --- /dev/null +++ b/docs/zh_CN/ch1/exchangis_appconn_deploy_cn.md @@ -0,0 +1,87 @@ +ExchangisAppConn安装文档 +本文主要介绍在DSS(DataSphere Studio)1.0.1中ExchangisAppConn的部署、配置以及安装 +### 1.部署ExchangisAppConn的准备工作 +您在部署ExchangisAppConn之前,请按照[Exchangis1.0.0安装部署文档](https://github.com/WeDataSphere/Exchangis/blob/dev-1.0.0-rc/docs/zh_CN/ch1/exchangis_deploy_cn.md)安装完成Exchangis1.0.0及其他相关组件的安装,并确保工程基本功能可用。 + +### 2.ExchangisAppConn插件的下载和编译 +#### 1)下载二进制包 +我们提供ExchangisAppconn的物料包,您可直接下载使用。[点击跳转 Release 界面](https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeDatasphere/Exchangis/exchangis1.0.0-rc/exchangis-appconn.zip) +#### 2) 编译打包 + +如果您想自己开发和编译ExchangisAppConn,具体编译步骤如下: +1.clone Exchangis的代码 +2.在exchangis-plugins模块下,找到exchangis-appconn,单独编译exchangis-appconn +``` +cd {EXCHANGIS_CODE_HOME}/exchangis-plugins/exchangis-appconn +mvn clean install +``` +会在该路径下找到exchangis-appconn.zip安装包 +``` +{EXCHANGIS_CODE_HOME}\exchangis-plugins\exchangis-appconn\target\exchangis-appconn.zip +``` + +### 3.ExchangisAppConn插件的部署和配置总体步骤 +1.拿到打包出来的exchangis-appconn.zip物料包 + +2.放置到如下目录并进行解压 + +注意:第一次解压exchangis appconn后,确保当前文件夹下没有index_v0000XX.index文件,该文件在后面才会生成 + +``` +cd {DSS_Install_HOME}/dss/dss-appconns +unzip exchangis-appconn.zip +``` +解压出来的目录结构为: +``` +conf +db +lib +appconn.properties +``` + +3.执行脚本进行自动化安装 + +```shell +cd {DSS_INSTALL_HOME}/dss/bin +./install-appconn.sh +# 脚本是交互式的安装方案,您需要输入字符串exchangis以及exchangis服务的ip和端口,即可以完成安装 +# 这里的exchangis端口是指前端端口,在nginx进行配置。而不是后端的服务端口 +``` + +### 4.完成exchangis-appconn的安装后,需要重启dss服务,才能最终完成插件的更新 + +#### 4.1)使部署好的APPCONN生效 +使用DSS启停脚本使APPCONN生效,进入到脚本所在目录{DSS_INSTALL_HOME}/sbin中,依次使用如下命令执行脚本: +``` +sh ./dss-stop-all.sh +sh ./dss-start-all.sh +``` +#### 4.2)验证exchangis-appconn是否生效 +在安装部署完成exchangis-appconn之后,可通过以下步骤初步验证exchangis-appconn是否安装成功。 +1. 在DSS工作空间创建一个新的项目 +![image](https://user-images.githubusercontent.com/27387830/169782142-b2fc2633-e605-4553-9433-67756135a6f1.png) + +2. 在exchangis端查看是否同步创建项目,创建成功说明appconn安装成功 +![image](https://user-images.githubusercontent.com/27387830/169782337-678f2df0-080a-495a-b59f-a98c5a427cf8.png) + +更多使用操作可参照[Exchangis1.0用户手册](https://user-images.githubusercontent.com/27387830/169782142-b2fc2633-e605-4553-9433-67756135a6f1.png) + +### 5.Exchangis AppConn安装原理 + +Exchangis 的相关配置信息会插入到以下表中,通过配置下表,可以完成 Exchangis 的使用配置,安装 Exchangis AppConn 时,脚本会替换每个 AppConn 下的 init.sql,并插入到表中。(注:如果仅仅需要快速安装APPCONN,无需过分关注以下字段,提供的init.sql中大多以进行默认配置。重点关注以上操作即可) + +| 表名 | 表作用 | 备注 | +| :----: | :----: |-------| +| dss_application | 应用表,主要是插入 exchangis 应用的基本信息 | 必须 | +| dss_menu | 菜单表,存储对外展示的内容,如图标、名称等 | 必须 | +| dss_onestop_menu_application| menu 和 application 的关联表,用于联合查找 | 必须 | +| dss_appconn |appconn 的基本信息,用于加载 appconn | 必须 | +| dss_appconn_instance| AppConn 的实例的信息,包括自身的url信息 | 必须 | +| dss_workflow_node | schedulis 作为工作流节点需要插入的信息 | 必须 | + +Exchangis 作为调度框架,实现了一级规范和二级规范,需要使用 exchangis AppConn 的微服务如下表。 + +| 表名 | 表作用 | 备注 | +| :----: | :----: |-------| +| dss-framework-project-server | 使用 exchangis-appconn 完成工程以及组织的统一| 必须 | +| dss-workflow-server | 借用调度 AppConn 实现工作流发布,状态等获取 | 必须 | diff --git a/docs/zh_CN/ch1/exchangis_datasource_cn.md b/docs/zh_CN/ch1/exchangis_datasource_cn.md new file mode 100644 index 000000000..908f4f4c6 --- /dev/null +++ b/docs/zh_CN/ch1/exchangis_datasource_cn.md @@ -0,0 +1,306 @@ +# DataSource1.0 + +## 1、背景 + +早期版本中的**Exchangis0.x**和**Linkis0.x**都有整合数据源模块,其中以**linkis-datasource**为蓝本(可以参阅相关的文档),重构数据源模块。 + +## 2、整体架构设计 + +为了构建公共的数据源模块,数据源模块拆主要拆分成两大部分,**datasource-client**部分和**datasource-server**部分,其中server部分统一放在**Linkis-1.0**的**linkis-datasource**模块中,包含服务核心主逻辑; client部分放在**Exchangis-1.0**的**exchangis-datasource**模块下, 包含客户端的调用逻辑,看下整体架构。 + +![linkis_datasource_structure](../../../images/zh_CN/ch1/datasource_structure.png) + +
+图2-1 整体架构设计 +
+ +## 3、模块详解 + +### 3.1 datasource-server + +**datasource-server**: 顾名思义是保存核心服务的模块,沿用**linkis-datasource**原先的架构(拆分成**datasourcemanager** 和 **metadatamanager**)。 + +### 3.2 linkis-datasource + +目前的架构示意图: + +![linkis_datasource_structure](../../../images/zh_CN/ch1/linkis_datasource_structure.png) + +
+图3-1 目前架构示意图 +
+ +上图中可见**linkis-datasource**将数据源相关功能进行了解耦,基础信息部分由**datasourcemanager**进行管理,元数据部分由**metadatamanager**进行管理。两个子模块之间通过RPC请求互相访问,同时分别对外提供Restful入口,外部服务请求统一经过**liniks-gateway**进行转发才落到对应服务上。再者,**metadatamanage**在没有对接第三方元数据管理平台的情况,为了能插件化地支持不同数据源的元数据接入,下接不同数据源的**service**子模块,子模块里都有各自对元数据获取接口的实现,这些模块例如:**service/hive, service/elasticsearch, service/mysql** + +#### 3.2.1 新增需求 + +##### 前端界面需求 + +原先**linkis-datasource**并不包含前端界面部分,现将原先对**exchangis 1.0**的数据源界面设计合并进去,详见**UI文档**和**前端交互文档**。对其中涉及的需求做下详细描述: + +- 数据源类型-列表获取【数据源管理】 + +需求描述: + +获取接入的所有数据源类型并展示 + +- 数据源环境-列表获取【数据源管理】 + +需求描述: + +获取在后台预设的数据源环境参数并展示做列表展示 + +- 新增/修改数据源-标签设置【数据源管理】 + +需求描述: + +设置数据源的标签信息。 + +- 连接性检测【数据源管理】 + +需求描述: + +检查已经接入的数据源的连通性,通过点击数据源列表的连通性监测按钮。 + +- 新增/修改数据源-配置加载【数据源管理】 + +需求描述: + +为了方便引入新的数据源或对原有的数据源进行属性扩充,所以对于新建/修改数据源的表单配置,计划采用后台存储+前端加载的方式,后台会保存每条属性字段的类型、默认值、加载地址和简单的级联关系,前端根据这些生成抽象的数据结构,再将其转化成DOM操作 + +流程设计: + +1. 用户选择数据源类型,前端以数据源类型为参数向后台请求该数据源的属性配置列表; + +2. 前端拿到配置列表,首先判断类型,选用对应的控件,再设置默认的值,刷新界面DOM; + +3. 配置基本信息都加载渲染完成后,开始进行值的预加载和级联关系的建立; + +4. 配置加载完成,等待用户填充。 + +关联UI: + +![datasource_ui](../../../images/zh_CN/ch1/datasource_ui.png) + +
+图3-2 数据源UI +
+ +![datasource_ui_mysql](../../../images/zh_CN/ch1/datasource_ui_mysql.png) + +
+图3-3 创建MySQL数据源 +
+ +- 批处理-批量导入/导出 【数据源管理】 + +需求描述: + +对数据源配置的批量导入和导出。 + +##### 后台需求 + +**linkis-datasurce**后台目前已集成了关于数据源CRUD的相关操作逻辑,现增加和标签、版本相关的内容: + +- 数据源权限设置 【数据源管理】 + +需求描述: + +后台需要将其和Linkis1.0的标签功能相整合,为数据源赋予标签关系。 + +流程设计: + +1. 用户在创建和修改数据源的时候,允许对数据源进行设置标签; + +2. 保存修改时,把标签信息作为字符列表传给后端,后端将标签字符转换为标签实体,插入更新该标签; + +3. 保存数据源,建立数据源和标签的联系。 + +- 数据源版本功能 【数据源管理】 + +需求描述: + +为数据源添加版本的概念,版本的作用在于发布和更新,更新的时候默认添加新版本,发布的时候将要发布的版本的数据源信息覆盖最新版本,并标识为已发布。 + +#### 3.2.2 详细设计 + +对**linkis-datasource**包含的实体对象做一些修改和扩充,介绍如下: + +| **类名** | **作用** | +| -------------------------------- | ------------------------------------------------------------ | +| DataSourceType | 表示数据源的类型 | +| DataSourceParamKeyDefinition | 声明数据源属性配置定义 | +| DataSourceScope【新增】 | 标注数据源属性的作用域,通常有三种域,数据源、数据源环境和默认(全部) | +| DataSource | 数据源对象实体类,包含标签和属性配置定义 | +| DataSourceEnv | 数据源环境对象实体类,也包含属性配置定义 | +| DataSourcePermissonLabel【删除】 | | +| DataSourceLabelRelation【新增】 | 表示数据源和权限标签之间的关系 | +| VersionInfo【新增】 | 版本信息,包含数据源版本号信息 | + +2.1 其中**DataSourceParamKeyDefinition**保持原先一致的结构,新增一些支撑界面渲染的属性,结构详解如下: + +| **字段名称** | **字段类型** | **备注** | +| --------------- | ------------ | --------------------------------------------------------- | +| id | string | 持久化ID | +| key | string | 属性名称关键字 | +| description | string | 描述 | +| name | string | 属性显示名称 | +| defaultValue | string | 属性默认值 | +| valueType | string | 属性值类型 | +| require | boolean | 是否是必须属性 | +| refId | string | 级联的另一个属性ID | +| dataSrcTypId | string | 关联的数据源类型ID | +| 【新增】refMap | string | 级联关系表,格式应如: value1=refValue1, value2=refValue2 | +| 【新增】loadUrl | string | 加载URL, 默认为空 | + +2.2 **DataSource**结构也类似,但包含标签信息: + +| **字段名称** | **字段类型** | **备注** | +| ------------------ | ------------ | ------------------------------------------ | +| serId | string | 持久化ID | +| id | string | 系统内ID | +| 【新增】versions | list-obj | 关联的版本VersionInfo列表 | +| 【新增】srcVersion | string | 来源版本,标注该数据源是通过版本信息创建的 | +| datSourceName | string | 数据源名称 | +| dataSourceDesc | string | 数据源描述 | +| dataSourceTypeId | integer | 数据源类型ID | +| connectParams | map | 连接属性参数字典 | +| parameter | string | 连接属性参数串 | +| createSystem | string | 创建的系统,一般情况下都为空或(exchangis) | +| dataSourceEnvId | integer | 关联的数据源环境ID | +| keyDefinitions | list-object | 关联的属性配置定义列表 | +| 【新增】labels | map | 标签字符串 | +| 【新增】readOnly | boolean | 是否是只读数据源 | +| 【新增】expire | boolean | 是否过期 | +| 【去除】 isPub | boolean | 是否发布 | + +2.3 **VersionInfo**版本信息,不同的数据源版本主要是连接参数不同,结构如下: + +| **字段名称** | **字段类型** | **备注** | +| ------------- | ------------ | ---------------- | +| version | string | 版本号 | +| source | long | 关联的数据源ID | +| connectParams | map | 版本属性参数字典 | +| parameter | string | 版本属性参数串 | + +2.4 **DataSourceType**和**DataSourceEnv**也与原先的类大致相同,其中**DataSourceType**需要新增**classifier**字段来对不同数据源类型进行分类,其他就不展开描述。 + +**datasource-server**具有的主要服务处理类如下: + +| **接口名** | **接口作用** | **单一实现** | +| ---------------------------------- | ------------------------------------------------------------ | ------------ | +| DataSourceRelateService | 声明对数据源关联信息的操作,包括列举所有的数据源类型,列举不同类型下的属性定义信息 | 是 | +| DataSourceInfoService | 声明对数据源/数据源环境的基本操作 | 是 | +| MetadataOperateService | 声明对数据源元数据源的操作,一般用于连接测试 | 是 | +| BmlAppService | 声明对BML模块的远端调用,用于上传/下载数据源的密钥文件 | 是 | +| DataSourceVersionSupportService | 声明对数据源多版本支持的操作 | 是 | +| MetadataAppService【旧,需要拆分】 | 声明对元数据信息的操作 | 是 | +| DataSourceBatchOpService【新增】 | 声明对数据源的批处理操作 | 是 | +| MetadataDatabaseService【新增】 | 声明对数据库类元数据信息的操作 | 是 | +| MetadataPropertiesService【新增】 | 声明对属性类元数据信息的操作 | 是 | + +### 3.3 datasource-client + +**datasource-client**: 包含客户端调用逻辑,用客户端的方式去操作数据源以及获取相关的元数据。 + +#### 3.3.1 相关需求 + +##### 后台需求 + +作为请求客户端,**datasource-client**没有前端界面需求,后台需求比较单一,既构建稳定、可重试、容易溯源的客户端,直接对接sever端支持的所有接口,尽可能支持各种的接入方式 + +#### 3.3.2 详细设计 + +其包的组织架构大体设计如下: + +![datasource_client_scructure](../../../images/zh_CN/ch1/datasource_client_scructure.png) + +
+图3-4 datasource-client详细设计 +
+ +涉及到的类/接口信息如下: + +| 类/接口名 | 类/接口作用 | 单一实现 | +| ----------------------------- | ------------------------------------------------------------ | -------- | +| RemoteClient | Client对象的顶级接口,声明了初始化、释放以及基本权限验证的公共接口方法 | 否 | +| RemoteClientBuilder | Client的构造类,根据RemoteClient的不同实现类来构造 | 是 | +| AbstractRemoteClient | RemoteClient的抽象实现,涉及到重试、统计、缓存等逻辑 | 是 | +| DataSourceRemoteClient | 声明数据源客户端的所有操作入口 | 否 | +| MetaDataRemoteClient | 声明元数据客户端的所有操作入口 | 否 | +| LinkisDataSourceRemoteClient | linkis-datasource的数据源客户端实现 | 是 | +| LinkisMetaDataRemoteClient | linkis-datasource的元数据客户端实现 | 是 | +| MetadataRemoteAccessService | 声明底层访问远端第三方元数据服务的接口 | 是 | +| DataSourceRemoteAccessService | 声明底层访问远端第三方数据源服务的接口 | 是 | + +其类关系组图如下: + +![datasource_client_class_relation](../../../images/zh_CN/ch1/datasource_client_class_relation.png) + +
+图3-5 datasource-client类关系组图 +
+ +##### 流程时序图: + +下面再结合所有模块,详细描述下业务流程中接口/类之间的调用关系: + +- 创建数据源 + +关注点: + +1. 创建数据源前需要拉取数据源类型列表和类型对应的数据源的属性配置定义列表,有些情况下还需要拉取数据源环境列表; + +2. 创建数据源分两种情景,一种通过**linkis-datasource**的界面创建,一种通过**exchangis**的datasource-client创建; + +3. 数据源类型、属性配置定义、数据源环境,可以自行在后台库中添加,目前未提供界面动态配置的方式(待提供)。 + +现在看下创建数据源的时序图: + +![datasource_client_create](../../../images/zh_CN/ch1/datasource_client_create.png) + +
+图3-6 datasource-client创建数据源时序图 +
+ +继续看下通过**datasource-client**来调用创建数据源接口: + +![datasource_client_create2](../../../images/zh_CN/ch1/datasource_client_create2.png) + +
+图3-7 datasource-client调用创建数据源时序图 +
+ +上图中省略了一些客户端连接认证、请求记录以及生命周期监听等附加的方法,而是精简了整体调用流程。 + +- 更新数据源 + +关注点: + +1. 更新有两种方式:版本更新和普通更新,版本更新会产生一个新的数据源的版本(可删除,可发布),而普通更新则会覆盖当前的数据源,不会产生新版本; + +2. 只有数据源的创建用户以及管理员用户可以更新发布数据源。 + +![datasource_client_update](../../../images/zh_CN/ch1/datasource_client_update.png) + +
+图3-8 datasource-client更新数据源时序图 +
+ +- 查询数据源 + +关注点: + +1. 通过datasource-client获取数据源列表的时候,需要附带上操作用户信息,用于对数据源做权限过滤。 + +数据库设计: + +![datasource_client_query](../../../images/zh_CN/ch1/datasource_client_query.png) + +
+图3-9 datasource-client查询数据源时序图 +
+ +##### 接口设计: + +(参照linkis-datasource现有的接口做补充) \ No newline at end of file diff --git a/docs/zh_CN/ch1/exchangis_deploy_cn.md b/docs/zh_CN/ch1/exchangis_deploy_cn.md index 4fbc38c2a..e3716dba6 100644 --- a/docs/zh_CN/ch1/exchangis_deploy_cn.md +++ b/docs/zh_CN/ch1/exchangis_deploy_cn.md @@ -1,88 +1,279 @@ -### 环境准备 -#### 1)基础软件安装 -- MySQL (5.5+) 必选,对应客户端可以选装, Linux服务上若安装mysql的客户端可以通过部署脚本快速初始化数据库 -- JDK (1.8.0_141) 必选 -- Maven (3.6.1+) 必选 -- SQOOP (1.4.6) 可选,如果想要SQOOP做传输引擎,可以安装SQOOP,SQOOP安装依赖Hive,Hadoop环境,这里就不展开来讲 -- Python (2.x) 可选,主要用于调度执行底层DataX的启动脚本,默认的方式是以Java子进程方式执行DataX,用户可以选择以Python方式来做自定义的改造 +## 前言 -#### 2)选择用户 -如果选择有sudo权限的用户来执行安装部署脚本,并启动服务,对于不同的数据交换作业,服务将会切换用户来执行,否则将以当前服务所属用户来执行。 +Exchangis 的安装,主要分为以下四步: + +1. Exchangis 依赖环境准备 +2. Exchangis 安装部署 +3. DSS ExchangisAppConn 安装部署 +4. Linkis Sqoop 引擎安装部署 + +## 1. Exchangis 依赖环境准备 + +#### 1.1 基础软件安装 + +| 依赖的组件 | 是否必装 | 安装直通车 | +| -------------- | ------ | --------------- | +| MySQL (5.5+) | 必装 | [如何安装mysql](https://www.runoob.com/mysql/mysql-install.html) | +| JDK (1.8.0_141) | 必装 | [如何安装JDK](https://www.runoob.com/java/java-environment-setup.html) | +| Hadoop(2.7.2,Hadoop 其他版本需自行编译 Linkis) | 必装 | [Hadoop单机部署](https://linkis.apache.org/zh-CN/docs/latest/deployment/quick_deploy) ;[Hadoop分布式部署](https://linkis.apache.org/zh-CN/docs/latest/deployment/quick_deploy) | +| Hive(2.3.3,Hive 其他版本需自行编译 Linkis) | 必装 | [Hive快速安装](https://linkis.apache.org/zh-CN/docs/latest/deployment/quick_deploy) | +| SQOOP (1.4.6) | 必装 | [如何安装Sqoop](https://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html) | +| DSS1.0.1 | 必装 | [如何安装DSS](https://github.com/WeBankFinTech/DataSphereStudio-Doc/blob/main/zh_CN/%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2/DSS%E5%8D%95%E6%9C%BA%E9%83%A8%E7%BD%B2%E6%96%87%E6%A1%A3.md) | +| Linkis1.1.1 | 必装 | [如何安装Linkis](https://linkis.apache.org/zh-CN/docs/latest/deployment/quick_deploy) | +| Nginx | 必装 | [如何安装 Nginx](http://nginx.org/en/linux_packages.html) | + +底层依赖组件检查 + +$\color{#FF0000}{注意:一定要重新安装dss1.0.1,并且linkis版本必须大于1.1.1,请重新编译linkis,请使用6月15号发布的包}$。 + +[linkis1.1.1代码地址](https://github.com/apache/incubator-linkis/tree/release-1.1.1) + +[DSS1.0.1代码地址](https://github.com/WeBankFinTech/DataSphereStudio/tree/master) + +datasource启用 + +linkis的启动脚本中默认不会启动数据源相关的服务两个服务(ps-data-source-manager,ps-metadatamanager), 如果想使用数据源服务,可以通过如下方式进行开启: 修改$LINKIS_CONF_DIR/linkis-env.sh中的 export ENABLE_METADATA_MANAGER=true值为true。 通过linkis-start-all.sh/linkis-stop-all.sh 进行服务启停时,会进行数据源服务的启动与停止。关于数据源更多详情可参考[数据源功能使用](https://linkis.apache.org/zh-CN/docs/1.1.0/deployment/start_metadatasource) + +#### 1.2 创建 Linux 用户 + +请保持 Exchangis 的部署用户与 Linkis 的部署用户一致,例如:部署用户是hadoop账号。 + +#### 1.3 在linkis中为exchangis加专用token + +通过在linkis数据库中执行以下语句,为Exchangis分配专属token: -### 安装包准备 -#### 1)下载二进制包 -[点击跳转 Release 界面](https://github.com/WeBankFinTech/Exchangis/releases) -#### 2) 编译打包(二进制包跳过) -直接从Git上面获得源代码,在项目的根目录下执行如下命令 -``` -mvn clean install -``` -执行成功后将会在工程的build目录下生成安装包 ``` -build/wedatasphere-exchangis-{VERSION}.tar.gz +INSERT INTO `linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`) VALUES ('EXCHANGIS-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS'); ``` -### 开始部署 -#### 1)解压安装包 -在选定的安装目录,解压安装包 +通过在linkis数据库中执行以下sql语句,插入hive数据源环境配置,注意,执行前需要修改语句中的${HIVE_METADATA_IP}和${HIVE_METADATA_PORT},例如${HIVE_METADATA_IP}=127.0.0.1,${HIVE_METADATA_PORT}=3306: + ``` -tar -zxvf wedatasphere-exchangis-{VERSION}.tar.gz +INSERT INTO `linkis_ps_dm_datasource_env` (`env_name`, `env_desc`, `datasource_type_id`, `parameter`, `create_time`, `create_user`, `modify_time`, `modify_user`) VALUES ('开发环境SIT', '开发环境SIT', 4, '{"uris":"thrift://${HIVE_METADATA_IP}:${HIVE_METADATA_PORT}", "hadoopConf":{"hive.metastore.execute.setugi":"true"}}', now(), NULL, now(), NULL); +INSERT INTO `linkis_ps_dm_datasource_env` (`env_name`, `env_desc`, `datasource_type_id`, `parameter`, `create_time`, `create_user`, `modify_time`, `modify_user`) VALUES ('开发环境UAT', '开发环境UAT', 4, '{"uris":"thrift://${HIVE_METADATA_IP}:${HIVE_METADATA_PORT}", "hadoopConf":{"hive.metastore.execute.setugi":"true"}}', now(), NULL, now(), NULL); ``` -#### 2)执行一键安装脚本 -进入解压后的目录,找到bin目录下面的install.sh文件,如果选择交互式的安装,则直接执行 + +#### 1.4 底层依赖组件检查 + +**请确保 DSS1.0.1 与 Linkis1.1.1 基本可用,可在 DSS 前端界面执行 HiveQL 脚本,可正常创建并执行 DSS 工作流。** + + +## 2. Exchangis 安装部署 + +### 2.1 安装包准备 + +#### 2.1.1下载二进制包 + +从 Exchangis 已发布的 release 中 [点击下载exchangis安装包](https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeDatasphere/Exchangis/exchangis1.0.0-rc/wedatasphere-exchangis-1.0.0-RC1.tar.gz),下载最新的安装包。 + +#### 2.1.2 编译打包 + +在项目的根目录下执行如下命令: + +```shell script + mvn clean install ``` -./bin/install.sh + +编译成功后将会在项目的 `assembly-package/target` 目录下生成安装包。 + +### 2.2 解压安装包 + +执行以下命令进行解压: + +```shell script + tar -zxvf wedatasphere-exchangis-{VERSION}.tar.gz ``` -在交互模式下,对各个模块的package压缩包的解压以及configure配置脚本的调用,都会请求用户确认。 -如果不想使用交互模式,跳过确认过程,则执行以下命令安装 + +解压出来后的目录结构如下: + +```html +|-- config:一键安装部署参数配置目录 +|-- db:数据库表初始化 SQL 目录 +|-- exchangis-extds +|-- packages:Exchangis 安装包目录 +|-- sbin:脚本存放目录 ``` -./bin/install.sh --force + +### 2.3 修改配置参数 + +```shell script + vim config/config.sh ``` -#### 3)数据库初始化 -如果你的服务上安装有mysql命令,在执行安装脚本的过程中则会出现以下提醒: +```shell script +#LINKIS_GATEWAY服务地址IP,用于查找linkis-mg-gateway服务 +LINKIS_GATEWAY_HOST= + +#LINKIS_GATEWAY服务地址端口,用于查找linkis-mg-gateway服务 +LINKIS_GATEWAY_PORT= + +#用于请求校验 linkis 服务的 token,该字段可在 linkis 的数据库表linkis_mg_gateway_auth_token,token_name字段中找到 +LINKIS_TOKEN= + +#Exchangis服务端口 +EXCHANGIS_PORT= + +#Eureka服务URL +EUREKA_URL= ``` -Scan out mysql command, so begin to initalize the database -Do you want to initalize database with sql: [{INSTALL_PATH}/bin/exchangis-init.sql]? (Y/N)y -Please input the db host(default: 127.0.0.1): -Please input the db port(default: 3306): -Please input the db username(default: root): -Please input the db password(default: ): -Please input the db name(default: exchangis) + +### 2.4 修改数据库配置 + +```shell script + vim config/db.sh ``` -按照提示输入数据库地址,端口号,用户名,密码以及数据库名称,大部分情况下即可快速完成初始化。 -如果服务上并没有安装mysql命令,则可以取用目录下/bin/exchangis-init.sql脚本去手动执行,完成后修改相关配置文件 + +```shell script +# 设置数据库的连接信息 +# 包括IP地址、端口、用户名、密码和数据库名称 +MYSQL_HOST= +MYSQL_PORT= +MYSQL_USERNAME= +MYSQL_PASSWORD= +DATABASE= ``` -vi ./modules/exchangis-service/conf/bootstrap.properties + +### 2.5 安装和启动 + +#### 2.5.1 执行一键安装脚本 + +执行 `install.sh` 脚本,完成一键安装部署: + +```shell script + sh sbin/install.sh ``` + +#### 2.5.2 安装步骤 + +该脚本为交互式安装,开始执行install.sh脚本后,安装步骤依次分为以下几步: + +1. 初始化数据库表 + +当出现该提醒时:Do you want to initalize database with sql: [${SQL_SOURCE_PATH}]? + +输入 `y` 初始化数据库表,输入 `n` 跳过数据库表初始化步骤。 + +#### 2.5.3 启动服务 + +第一次启动,可以执行以下命令,启动 Exchangis Server: + +```shell script + sh sbin/daemon.sh start server ``` -#Database -#DB_HOST= -#DB_PORT= -#DB_USERNAME= -#DB_PASSWORD= -#DB_DATABASE= + +您也可以使用以下命令完成 Exchangis Server 的完成重启: + +```shell script +./sbin/daemon.sh restart server ``` -按照具体情况配置对应的值即可。 -#### 4)启动服务 -一键启动所有服务 +执行完成启动脚本后,会出现以下提示,eureka地址也会在启动服务时在控制台打出: + +![企业微信截图_16532930262583](https://user-images.githubusercontent.com/27387830/173892397-7cc7e988-0222-4f64-92ed-2cc58669770e.png) + +### 2.6 查看服务是否启动成功 + +可以在Eureka界面查看服务启动成功情况,查看方法: + +使用 http://${EUREKA_INSTALL_IP}:${EUREKA_INSTALL_PORT}, 建议在 Chrome 浏览器中打开,查看服务是否注册成功。 + +如下图所示: + +![补充Eureka截图](../../../images/zh_CN/ch1/eureka_exchangis.png) + +### 2.7 前端安装部署 + +#### 2.7.1 获取前端安装包 + +Exchangis 已默认提供了编译好的前端安装包,可直接下载使用:[点击下载前端安装包](https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeDatasphere/Exchangis/exchangis1.0.0-rc/dist.zip) + +您也可以自行编译 Exchangis 前端,在 Exchangis 根目录下执行如下命令: + +```shell script + cd web + npm i + npm run build ``` -./bin/start-all.sh + +从 `web/` 路径获取编译好的 dist.zip 前端包。 + +获取到的前端包,您可以放在服务器上的任意位置,这里建议您与后端安装地址目录保持一致,在同一目录下放置并解压。 + +#### 2.7.2 前端安装部署 + +1. 解压前端安装包 + +如您打算将 Exchangis 前端包部署到 `/appcom/Install/exchangis/web` 目录,请先将 `dist.zip` 拷贝到该目录并执行解压,注意,**请在安装dss的机器上安装exchangis前端**: + +```shell script + # 请先将 Exchangis 前端包拷贝到 `/appcom/Install/exchangis/web` 目录 + cd /appcom/Install/exchangis/web + unzip dist.zip ``` -中途可能发生部分模块启动失败或者卡住,可以退出重复执行,如果需要改变某一模块服务端口号,则: + + +执行如下命令: + +```shell script + vim /etc/nginx/conf.d/exchangis.conf ``` -vi ./modules/{module_name}/bin/env.properties + ``` -找到SERVER_PORT配置项,改变它的值即可。 -当然也可以单一地启动某一模块服务: + server { + listen 8098; # 访问端口 如果该端口被占用,则需要修改 + server_name localhost; + #charset koi8-r; + #access_log /var/log/nginx/host.access.log main; + location /dist { + root /appcom/Install/exchangis/web; # Exchangis 前端部署目录 + autoindex on; + } + + location /api { + proxy_pass http://127.0.0.1:9020; # 后端Linkis的地址,需要修改 + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header x_real_ipP $remote_addr; + proxy_set_header remote_addr $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_http_version 1.1; + proxy_connect_timeout 4s; + proxy_read_timeout 600s; + proxy_send_timeout 12s; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection upgrade; + } + + #error_page 404 /404.html; + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + } ``` -./bin/start.sh -m {module_name} + +#### 2.7.3 启动 nginx 及访问前端页面 + +配置完成之后,使用以下命令重新刷新 nginx 配置: + +```shell script + nginx -s reload ``` -#### 4)查看服务 -服务使用Eureka做注册中心,默认的Eureka端口是8500(可变), 可以在Eureka界面http://{EUREKA_IP}:{EUREKA_PORT}上观察服务是否正常启动。 -Exchangis的入口界面集成在Gateway中,Gateway的访问端口为9503(可变) --- +请通过 http://${EXCHANGIS_INSTALL_IP}:8098/#/projectManage 访问 Exchangis 前端页面,出现以下界面,说明exchangis安装前端成功,如果要真正试用exchangis,需要安装dss和linkis,通过dss进行免密登录,如下图所示: + +![image](https://user-images.githubusercontent.com/27387830/170417473-af0b4cbe-758e-4800-a58f-0972f83d87e6.png) + +## 3. DSS ExchangisAppConn 安装部署 + +如您想正常使用 Exchangis1.0.0 前端,还需安装 DSS ExchangisAppConn 插件,请参考: [ExchangisAppConn 插件安装文档](exchangis_appconn_deploy_cn.md) + +## 4. Linkis Sqoop 引擎安装部署 + +如您想正常执行 Exchangis1.0.0 的 Sqoop作业,还需安装 Linkis Sqoop 引擎,请参考: [Linkis Sqoop 引擎插件安装文档](https://linkis.staged.apache.org/zh-CN/docs/1.1.2/engine_usage/sqoop) + +## 5. 如何登录使用 Exchangis -Tips: 脚本使用的都是bash指令集,如若使用sh调用脚本,可能会有未知的错误 \ No newline at end of file +Exchangis1.0更多使用说明,请参考用户使用手册[Exchangis1.0 用户手册](exchangis_user_manual_cn.md) diff --git a/docs/zh_CN/ch1/exchangis_job_execute_cn.md b/docs/zh_CN/ch1/exchangis_job_execute_cn.md new file mode 100644 index 000000000..7fd147778 --- /dev/null +++ b/docs/zh_CN/ch1/exchangis_job_execute_cn.md @@ -0,0 +1,204 @@ +# Exchangis同步作业执行模块详细设计文档 + +## 一、总体流程图 + + ![img](../../../images/zh_CN/ch1/job_overall.png) + +
+图1-1 总体流程图 +
+ +请注意: + +1. 如果用户通过REST客户端直接提交一段希望被执行的同步任务JSON,则无需进行步骤二,直接将JSON提交给TaskGenerator即可。 + +2. 前端或REST客户端每次提交时,会产生一个jobExecutionId给前端,后续前端或REST客户端通过jobExecutionId获取同步作业Job的执行情况。 + +3. jobExecutionId最好是在用户提交过来时就产生且返回,即TaskGenerator应该是异步进行的。一般情况下,TaskGenerator的时间可能是几秒到几分钟(取决于subJob的个数),所以如果等TaskGenerator完成后才返回 jobExecutionId,则前端请求很可能超时。 + +4. 只所以前端或REST客户端每次提交都产生一个jobExecutionId,是为了支持同一个ExchangisJob的重复提交。所以JobServer原则上不会检查一个ExchangisJob只能同时有一个实例在执行,但是Web前端应该保证同一个浏览器同一时刻的同一个ExchangisJob只有一个在执行。 + +## 二、前后台交互 + +![img](../../../images/zh_CN/ch1/job_frontend_backend.png) + +
+图2-1 前后台交互 +
+ +### 1. jobExecutionId的必要性 + +考虑REST客户端直接提交一段希望被执行的同步任务JSON的场景,以及为了支持同一个ExchangisJob的重复提交,所以每次提交时,产生一个jobExecutionId就非常有必要。 + +jobExecutionId是一个ExchangisJob的执行凭证,会存储到数据库之中,后续关于本次ExchangisJob执行的所有请求,都需带上jobExecutionId。 + +1. TaskGenerator异步的必要性 + +考虑到一种场景,即客户端提交了作业后,在Exchangis还没来得及返回jobExecutionId时客户端挂掉了,这种情况下,由于客户端的日志中没有打印jobExecutionId,提交用户以为作业没有提交成功,则有可能会存在数据错乱的问题。而且, TaskGenerator 处理一个ExchangisJob的时间可能很长(取决于subJob的个数),所以如果等TaskGenerator完成后才返回 jobExecutionId,则前端请求很可能超时。 + +所以应该在JobServer接收到作业执行请求后,就立马生成一个jobExecutionId,并在数据库中为该ExchangisJob生成一条执行记录,且将该执行状态置位Inited,只要数据库持久化成功,就异步生成TaskGenerator的任务,并立马返回jobExecutionId。 + +### 2. JobServer的无状态性 + +这里讨论JobServer是否是无状态的,即前端拿到jobExecutionId之后,无论请求哪一个JobServer实例,都是能正常拿到想要的执行中数据。 + +由于JobServer的内存中没有存储特殊信息,且ExchangisJob执行状态、进度和Metrics信息都会存到数据库中,当前端请求发送过来时,只需去数据库拉取相关数据即可。 + +所以JobServer是无状态的。 + +### 3. 多租户功能 + +考虑到多租户能力,我们可以将JobGenerator和JobExecution进行拆分,即JobGenerator用于分布式接收前端/REST客户端提交过来的作业执行请求,JobGenerator生成任务集并存储到数据库中,这个微服务是可以所有租户共用的;而JobExecution则可以根据不同的租户进行划分,从而避免执行过程中彼此进行影响。 + +### 4. 高可用能力 + +JobExecution的TaskChooseRuler会去数据库中扫描所有的ExchangTask,如果一个ExchangisTask在超过一段时间后还没有状态更新,则会被新的JobServer进行接管。 + +如何接管? + +简单式的接管就是所有其他存货的JobServer同时加载这个ExchangisTask到TaskScheduler,由于是更新进度、状态和Metrics信息,虽然多个同时更新,但是对任务并无影响。 + +复杂接管则需在ExchangisTask的数据库表中增加一个字段,用于标识正在执行该ExchangisJob的JobServer,这时触发多个JobServer抢夺该ExchangisTask的所有权,由于该方案较复杂,暂不考虑。 + +## 三、前端交互详解 + +### 1. 提交 + +在没有执行前,页面如下图所示: + +由于执行接口(附上提交接口的链接)需带上jobId,实际提交执行之前,需先保存,再提交,且提交前需做基本检查,即如果没有一个子任务或作业保存失败,则不能提交执行。 + +![img](../../../images/zh_CN/ch1/job_frontend_1.png) + +
+图3-1 任务提交 +
+ +点击执行之后,如下图所示: + +需注意,这时会弹出作业信息台,默认展示运行情况,即总体进度和所有子任务的进度情况。 + +这里前端会用到两个接口,一是先使用【执行接口】,提交执行ExchangisJob,后台返回jobExecutionId;二是通过jobExecutionId调用【获取Job进度】接口,用于获取Job & 所有task的进度信息,用于展示如下页面的进度情况。 + +![img](../../../images/zh_CN/ch1/job_frontend_2.png) + +
+图3-2 任务执行 +
+ +### 2. 子任务的运行情况 + +当用户点击正在运行/已完成的某个子作业时,这时前端触发请求后台的【获取Task Metrics信息】接口,通过jobExecutionId & taskId来获取task Metrics信息,展示如下页面的内容: + +![1655260735321](../../../images/zh_CN/ch1/job_frontend_3.png) + +
+图3-3 子任务运行情况 +
+ +主要展示资源使用情况、流量情况和核心指标。 + +
+图3-4 子任务资源使用情况 +
+ +![1655260937221](../../../images/zh_CN/ch1/job_frontend_4.png) + +### 3. 实时日志 + +当用户点击如下图所示的右下角“日志”按钮时,信息台出现“实时日志”Tab,并默认展示Job的实时日志。当点击运行情况的“日志”按钮时,首先会默认展示整个作业的运行日志,这时前端默认调用【获取Job实时日志】的接口,通过jobExecutionId获取Job日志并进行展示,如下图: + +![img](../../../images/zh_CN/ch1/job_frontend_5.png) + +
+图3-5 任务实时日志 +
+ +只要用户不切到信息台的其他Tab,则前端会不断向后台轮询实时日志; + +用户也可以通过select选择框选择查看某一个task的日志,这时触发请求【获取task实时日志】接口,通过jobExecutionId & taskId获取task日志并不断轮询最新日志。 + +如果用户切换了select选择框,之前的那个日志不再刷新。 + +这里需要注意,后台还提供了一个【获取本次Job执行的task列表】接口,是为了协助前端拿到所有的task列表,用于展示select选择框的内容,如果Job本身还在Inited或Scheduled状态,还未成功转为Running状态,这时是拉不到task列表的,所以当用户下拉select选择框时,应该提示用户“Job还在调度中,请在Job转为Running状态后再查看子任务的实时日志”。 + +运行完成后,如果状态为成功,则将Tab切回运行情况Tab页面;如果状态为失败,则基于【获取Job进度】接口所返回的信息,默认跳转并展示失败的subJob所在的task的日志,多个task失败时自动展示第一个失败的task的日志。 + +## 四、后台设计详解 + +### 1. 数据库表结构设计 + +![img](../../../images/zh_CN/ch1/job_backend_datasource_design.png) + +
+图4-1 数据库表结构设计 +
+ +### 2. 接口文档 + +详见:Exchangis作业执行模块接口文档 + +### 3. 核心模块 & 核心类设计 + +#### 3.1 实体Bean的UML类图如下: + +![img](../../../images/zh_CN/ch1/job_backend_uml_1.png) + + + +
+图4-2 实体Bean的UML类图 +
+ +请注意:其中所有以Entity结尾的非接口,都是需要存储到数据库之中,作为一张表而存在。 + +#### 3.2 TaskGenerator的UML类图结构如下: + +![img](../../../images/zh_CN/ch1/job_backend_uml_2.png) + +
+图4-3 TaskGenerator的UML类图 +
+ +TaskGenerator只负责将一个Job的JSON转换成可以提交给Linkis执行的任务集(即将Job下面的所有subJob翻译成一个ExchangisTask集),翻译完成后写入DB。 + +这里需要注意,TaskGenerator是异步执行的,我们会在Service层封装出JobGenerationSchedulerTask用于异步提交给TaskExecution去执行。 + +#### 3.3 TaskExecution体系的UML类图结构如下: + +![img](../../../images/zh_CN/ch1/job_backend_uml_3.png) + +
+图4-4 TaskExecution体系的UML类图 +
+ +1. TaskExecution主要由TaskConsumer、TaskManager、TaskScheduler和TaskSchedulerLoadBalancer组成。 + +2. TaskManager,主要用于管理该JobServer下所有处于Running状态的ExchangisTask; + +3. TaskConsumer则由多个功能不同的线程组组成,如NewTaskConsumer和ReceiveTaskConsumer等;其中NewTaskConsumer每次从数据库中fetch所有可被执行的处于Inited状态的ExchangisTask列表(可能包含多个Job的多个subJob所对应的ExchangisTask列表),按照TaskScheduler的实际负载情况分批次提交给TaskScheduler;提交之前,会先更新数据库里这个task的状态为Scheduled;而ReceiveTaskConsumer用于接管一个已在运行中,但是超过一定时间后还是没有更新状态和Metrics信息的ExchangisTask,将该ExchangisTask放入TaskManager之中,等待被StatusUpdateSchedulerTask和MetricsUpdateSchedulerTask更新状态。而TaskChooseRuler则是用于协助TaskConsumer过滤和选择所需要的ExchangisTask的规则器,如判断是否ExchangisTask可以接手、优先级策略等规则。 + +4. TaskScheduler是一个线程池,用于调度各种类型的SchedulerTask;其中,SubmitSchedulerTask,用于异步将任务提交给Linkis去执行,并将Linkis返回的关键信息如Id、ECM信息等写入DB;StatusUpdateSchedulerTask和MetricsUpdateSchedulerTask是永远不会停止的常驻型轮询任务,会不断从TaskManager中拿到已经处于Running状态的SchedulerTask,不断定时向Linkis去请求状态和Metrics信息,并更新数据库。 + +5. TaskSchedulerLoadBalancer是一个负载器,用于实时检测TaskManager内的runningTask的轮询情况、TaskScheduler和服务器的负载情况,确定TaskScheduler最终实例化多少个StatusUpdateSchedulerTask和MetricsUpdateSchedulerTask去轮询所有处于Running状态的任务的状态和Metrics信息。 + +#### 3.4 TaskScheduler体系的UML类图如下: + +![img](../../../images/zh_CN/ch1/job_backend_uml_4.png) + +
+图4-5 TaskScheduler体系的UML类图 +
+ +TaskScheduler基于linkis-scheduler模块来实现。 + +#### 3.5 Listener体系的UML类图如下: + +![img](../../../images/zh_CN/ch1/job_backend_uml_5.png) + +
+图4-6 Listener体系的UML类图 +
+ +Listener体系是保证各信息能更新到数据库的核心,实现这些listener的实现类应该都是各个service类。 + diff --git a/docs/zh_CN/ch1/exchangis_job_execute_interface_cn.md b/docs/zh_CN/ch1/exchangis_job_execute_interface_cn.md new file mode 100644 index 000000000..9c71a68fc --- /dev/null +++ b/docs/zh_CN/ch1/exchangis_job_execute_interface_cn.md @@ -0,0 +1,362 @@ +# Exchangis作业执行模块接口文档 + +### 1、提交配置好的job进行执行 + +接口描述:提交执行ExchangisJob,后台返回jobExecutionId + +请求URL:/api/rest_j/v1/exchangis/job/{id}/execute + +请求方式:POST + +请求参数: + +| 名称 | 类型 | 备注 | 是否必须 | 默认值 | +| --------------------- | ------- | ------------------------------------------------------------ | -------- | ------ | +| id | Long | Exchangis的ID | 是 | 无 | +| permitPartialFailures | boolean | 是否允许部分失败。如果为true,就算 部分子任务失败,整个Job还是会继续 执行,执行完成后,Job状态为 Partial_Success。该参数为 requestBody参数。 | 否 | false | + +返回参数: + +| 名称 | 类型 | 是否必须 | 默认值 | 备注 | +| -------------- | ------ | -------- | ------ | -------------------- | +| method | String | 是 | | 调用的方法(请求路径) | +| status | int | 是 | | 响应状态码 | +| message | String | 否 | | 响应的信息 | +| data | Map | 是 | | 返回的数据 | +| jobExecutionId | String | 是 | | 执行job的执行id | + +返回示例: + +```json +{ + "method": "/api/rest_j/v1/exchangis/job/{id}/execute", + "status": 0, + "message": "Submitted succeed(提交成功)!", + "data": { + "jobExecutionId": "555node1node2node3execId1" +} + +``` + +### 2、获取Job的执行状态 + +接口描述:根据jobExecutionId获取Job的状态 + +请求URL:/api/rest_j/v1/exchangis/job/execution/{jobExecutionId}/status + +请求方式:GET + +请求参数: + +| 名称 | 类型 | 备注 | 是否必须 | 默认值 | +| -------------- | ------ | -------------------- | -------- | ------ | +| jobExecutionId | String | ExchangisJob的执行ID | 是 | 无 | + +返回参数: + +| 名称 | 类型 | 是否必须 | 默认值 | 备注 | +| -------------- | ------ | -------- | ------ | ------------------------------------------------------------ | +| method | String | 是 | | 调用的方法(请求路径) | +| status | int | 是 | | 响应状态码 | +| message | String | 否 | | 响应的信息 | +| data | Map | 是 | | 返回的数据 | +| jobExecutionId | String | 是 | | 执行job的状态,包含:Inited,Scheduled, Running,WaitForRetry,Cancelled,Failed, Partial_Success,Success,Undefined,Timeout。其 中,Running状态表示正在运行,从Cancelled开始,都 是已完成状态。 | + +返回示例: + +```json +{ + "method": "/api/rest_j/v1/exchangis/job/execution/{id}/status", + "status": 0, + "message": "Submitted succeed(提交成功)!", + "data": { + "status": "Running", + "progress": 0.1 +} +``` + +### 3、获取本次Job执行的task列表 + +接口描述:通过jobExecutionId,获取任务列表 + +前提条件:Job的执行状态必须为Running后,才可以拿到task列表,否则返回的task列表为空 + +请求URL:/api/rest_j/v1/exchangis/job/execution/{jobExecutionId}/tasklist + +请求方式:GET + +请求参数: + +| 名称 | 类型 | 备注 | 是否必须 | 默认值 | +| -------------- | ------ | ------ | -------- | ------ | +| jobExecutionId | String | string | 是 | 无 | + +返回参数: + +| 名称 | 类型 | 是否必须 | 默认值 | 备注 | +| -------------- | ------ | -------- | ------ | ------------------------------------------------------------ | +| method | String | 是 | | 调用的方法(请求路径) | +| status | int | 是 | | 响应状态码 | +| message | String | 否 | | 响应的信息 | +| data | Map | 是 | | 返回的数据 | +| jobExecutionId | String | 是 | | 任务列表。Job的执行状态必须为Running后,才可以 拿到task列表,否则返回的task列表为空。 请注意:task没有Partial_Success状态。 | + +返回示例: + +```json +{ + "method": "/api/rest_j/v1/exchangis/job/execution/{jobExecutionId}/tasklist", + "status": 0, + "message": "Submitted succeed(提交成功)!", + "data": { + "tasks": [ + { + "taskId": 5, + "name": "test-1", + "status": "Inited", // task没有Partial_Success状态 + "createTime": "2022-01-03 09:00:00", + "launchTime": null, + "lastUpdateTime": "2022-01-03 09:00:00", + "engineType": "sqoop", + "linkisJobId": null, + "linkisJobInfo": null, + "executeUser": "enjoyyin" + } + ] + } +} + +``` + +### 4、获取Job & task的执行进度 + +接口描述:通过jobExecutionId,获取执行进度 + +前提条件:Job的执行状态必须为Running后,才可以拿到task列表的进度 + +请求URL:/api/rest_j/v1/exchangis/job/execution/{jobExecutionId}/progress + +请求方式:GET + +请求参数: + +| 名称 | 类型 | 备注 | 是否必须 | 默认值 | +| -------------- | ------ | -------------------- | -------- | ------ | +| jobExecutionId | String | ExchangisJob的执行ID | 是 | 无 | + +返回参数: + +| 名称 | 类型 | 是否必须 | 默认值 | 备注 | +| -------------- | ------ | -------- | ------ | ------------------------------------------------------------ | +| method | String | 是 | | 调用的方法(请求路径) | +| status | int | 是 | | 响应状态码 | +| message | String | 否 | | 响应的信息 | +| data | Map | 是 | | 返回的数据 | +| jobExecutionId | String | 是 | | 任务列表。Job的执行状态必须为Running后,才可以 拿到task列表,否则返回的task列表为空。 | + +返回示例: + +```json +{ + "method": "/api/rest_j/v1/exchangis/job/execution/{jobExecutionId}/progress", + "status": 0, + "message": "Submitted succeed(提交成功)!", + "data": { + "job": { + "status": "Running", + "progress": 0.1, + "tasks": { + "running": [ + { + "taskId": 5, + "name": "test-1", + "status": "Running", + "progress": 0.1 + } + ], + "Inited": [ + { + "taskId": 5, + "name": "test-1", + "status": "Inited", + "progress": 0.1 + } + ], + "Scheduled": [], + "Success": [], + "Failed": [], // 如果存在Failed的task,则Job会直接失败 + "WaitForRetry": [], + "Cancelled": [], // 如果存在Cancelled的task,则Job会直接失败 + "Undefined": [], // 如果存在Undefined的task,则Job会直接失败 + "Timeout": [] + } + } + } +} + +``` + +### 5、获取task运行时的各项指标信息 + +接口描述:通过jobExecutionId和taskId,获取task运行时的各项指标信息 + +前提条件:task的执行状态必须为Running后,才可以拿到task的各项指标信息,否则返回的 为空 + +请求URL:/api/rest_j/v1/exchangis/task/execution/{taskId}/metrics + +请求方式:POST + +请求参数: + +| 名称 | 类型 | 备注 | 是否必须 | 默认值 | +| -------------- | ------ | ---------------------------------------- | -------- | ------ | +| jobExecutionId | String | ExchangisJob的执行ID,放入 requestBody中 | 是 | 无 | +| taskId | String | task的执行ID,放入URI中 | 是 | 无 | + +返回参数: + +| 名称 | 类型 | 是否必须 | 默认值 | 备注 | +| -------------- | ------ | -------- | ------ | ------------------------------------------------------------ | +| method | String | 是 | | 调用的方法(请求路径) | +| status | int | 是 | | 响应状态码 | +| message | String | 否 | | 响应的信息 | +| data | Map | 是 | | 返回的数据 | +| jobExecutionId | String | 是 | | 任务各项指标信息。task的执行状态必须为 Running后,才可以拿到task的各项指标信息。 | + +返回示例: + +```json +{ + "method": "/api/rest_j/v1/exchangis/task/execution/{taskId}/metrics", + "status": 0, + "message": "Submitted succeed(提交成功)!", + "data": { + "task": { + "taskId": 5, + "name": "test-1", + "status": "running", + "metrics": { + "resourceUsed": { + "cpu": 10, // 单位:vcores + "memory": 20 // 单位:GB + }, + "traffic": { + "source": "mysql", + "sink": "hive", + "flow": 100 // 单位:Records/S + }, + "indicator": { + "exchangedRecords": 109345, // 单位:Records + "errorRecords": 5, + "ignoredRecords": 5 + } + } + } + } +} +``` + +### 6、获取Job的实时日志 + +接口描述:通过jobExecutionId,获取Job的实时日志 + +请求URL:/api/rest_j/v1/exchangis/job/execution/{jobExecutionId}/log? fromLine=&pageSize=&ignoreKeywords=&onlyKeywords=&lastRows= + +请求方式:GET + +请求参数: + +| 名称 | 类型 | 备注 | 是否必须 | 默认值 | +| -------------- | ------ | ------------------------------------------------------------ | -------- | ------ | +| jobExecutionId | String | ExchangisJob的执行ID | 是 | 无 | +| fromLine | int | 读取的起始行 | 否 | 0 | +| pageSize | int | 本次读取日志行数 | 否 | 100 | +| ignoreKeywords | String | 忽略哪些关键字所在的行,多个关键字以英 文,分隔 | 否 | 无 | +| onlyKeywords | String | 只取哪些关键字所在的行,多个关键字以英 文,分隔 | 否 | 无 | +| lastRows | int | 只读取最后多少行的日志,相当于tail -f log。该参数大于0时,上面所有的参数都会 失效。 | 否 | 无 | + +返回参数: + +| 名称 | 类型 | 是否必须 | 默认值 | 备注 | +| ------- | ------- | -------- | ------ | ------------------------------------------------------ | +| method | String | 是 | | 调用的方法(请求路径) | +| status | int | 是 | | 响应状态码 | +| message | String | 否 | | 响应的信息 | +| data | Map | 是 | | 返回的数据 | +| endLine | int | 是 | | 本次读取的结束行号,下次可以从 endLine + 1 继续读取日志 | +| isEnd | boolean | | | 日志是否已经全部读完 | +| logs | List | 是 | | 返回Job的执行日志 | + +返回示例: + +```json +{ + "method": "/api/rest_j/v1/exchangis/job/execution/{jobExecutionId}/log", + "status": 0, + "message": "Submitted succeed(提交成功)!", + "data": { + "endLine": 99, // 本次读取的结束行号,下次可以从 endLine + 1 继续读取日志 + "isEnd": false, // 日志是否已经全部读完 + "logs": [ + "all": "", + "error": "", + "warn": "", + "info": "" + ] + } +} +``` + +### 7、获取task的实时日志 + +接口描述:通过jobExecutionId和taskId,获取task的实时日志 + +请求URL:/api/rest_j/v1/exchangis/task/execution/{taskId}/log? jobExecutionId=&fromLine=&pageSize=&ignoreKeywords=&onlyKeywords=&lastRows= + +请求方式:GET + +请求参数: + +| 名称 | 类型 | 备注 | 是否必须 | 默认值 | +| -------------- | ------ | ------------------------------------------------------------ | -------- | ------ | +| taskId | String | task的执行Id | 是 | 无 | +| jobExecutionId | String | ExchangisJob的执行ID | 是 | 无 | +| fromLine | int | 读取的起始行 | 否 | 0 | +| pageSize | int | 本次读取日志行数 | 否 | 100 | +| ignoreKeywords | String | 忽略哪些关键字所在的行,多个关键字以英 文,分隔 | 否 | 无 | +| onlyKeywords | String | 只取哪些关键字所在的行,多个关键字以英 文,分隔 | 否 | 无 | +| lastRows | int | 只读取最后多少行的日志,相当于tail -f log。该参数大于0时,上面所有的参数都会 失效。 | 否 | 无 | + +返回参数: + +| 名称 | 类型 | 是否必须 | 默认值 | 备注 | +| ------- | ------- | -------- | ------ | ------------------------------------------------------ | +| method | String | 是 | | 调用的方法(请求路径) | +| status | int | 是 | | 响应状态码 | +| message | String | 否 | | 响应的信息 | +| data | Map | 是 | | 返回的数据 | +| endLine | int | 是 | | 本次读取的结束行号,下次可以从 endLine + 1 继续读取日志 | +| isEnd | boolean | | | 日志是否已经全部读完 | +| logs | List | 是 | | 返回Job的执行日志 | + +返回示例: + +```json +{ + "method": "/api/rest_j/v1/exchangis/job/execution/{taskId}/log", + "status": 0, + "message": "Submitted succeed(提交成功)!", + "data": { + "endLine": 99, // 本次读取的结束行号,下次可以从 endLine + 1 继续读取日志 + "isEnd": false, // 日志是否已经全部读完 + "logs": [ + "all": "", + "error": "", + "warn": "", + "info": "" + ] + } +} +``` + +### \ No newline at end of file diff --git a/docs/zh_CN/ch1/exchangis_sqoop_deploy_cn.md b/docs/zh_CN/ch1/exchangis_sqoop_deploy_cn.md new file mode 100644 index 000000000..4eac188c8 --- /dev/null +++ b/docs/zh_CN/ch1/exchangis_sqoop_deploy_cn.md @@ -0,0 +1,75 @@ +# Sqoop 引擎使用文档 +### 环境准备 +Sqoop引擎是执行Exchangis数据同步任务不可或缺的组件,只有安装部署完成Sqoop引擎才能够成功执行数据同步任务。同时,确保所部署的机器上有安装sqoop。 + +您在安装部署Sqoop引擎之前,请按照[Exchangis1.0.0](https://github.com/WeDataSphere/Exchangis/blob/dev-1.0.0-rc/docs/zh_CN/ch1/exchangis_deploy_cn.md)安装部署文档安装完成Exchangis1.0.0及相关组件的安装,并确保工程基本功能可用。 + +Sqoop引擎主要依赖Hadoop基础环境,如果该节点需要部署Sqoop引擎,需要部署Hadoop客户端环境。 + +强烈建议您在执行Sqoop任务之前,先在该节点使用原生的Sqoop执行测试任务,以检测该节点环境是否正常。 + +| 环境变量名 | 环境变量内容 | 备注 | +| :----: | :----: |-------| +| JAVA_HOME | JDK安装路径 | 必须 | +| HADOOP_HOME | Hadoop安装路径 | 必须 | +| HADOOP_CONF_DIR | Hadoop配置路径 | 必须 | +| SQOOP_HOME | Sqoop安装路径 | 非必须 | +| SQOOP_CONF_DIR | Sqoop配置路径 | 非必须 | +| HCAT_HOME | HCAT配置路径 | 非必须 | +| HBASE_HOME | HBASE配置路径 | 非必须 | + + +| Linkis系统参数 | 参数 | 备注 | +| --------------------------- | ------------------------------- | ------------------------------------------------------------ | +| wds.linkis.hadoop.site.xml | 设置sqoop加载hadoop参数文件位置 | 必须,参考示例:"/etc/hadoop/conf/core-site.xml;/etc/hadoop/conf/hdfs-site.xml;/etc/hadoop/conf/yarn-site.xml;/etc/hadoop/conf/mapred-site.xml" | +| sqoop.fetch.status.interval | 设置获取sqoop执行状态的间隔时间 | 非必须,默认值为5s + +### 安装包准备 +#### 1)下载二进制包 + +Exchangis1.0.0和Linkis 1.1.0支持的主流Sqoop版本1.4.6与1.4.7,更高版本可能需要修改部分代码重新编译。 + +[点击跳转 Release 界面](https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeDatasphere/Exchangis/exchangis1.0.0-rc/sqoop.zip) +#### 2) 编译打包 +如果您想自己开发和编译sqoop引擎,具体编译步骤如下: + +1.clone Exchangis的代码 + +2.在exchangis-plugins模块下,找到sqoop引擎,单独编译sqoop,操作如下 +``` +cd {EXCHANGIS_CODE_HOME}/exchangis-plugins/engine/sqoop +mvn clean install +``` +然后会在该路径下找到sqoop引擎安装包 +``` +{EXCHANGIS_CODE_HOME}\exchangis-plugins\sqoop\target\out\sqoop +``` + + +### 开始部署 +#### 1)sqoop引擎安装 +1.拿到打包出来的sqoop.zip物料包 + +2.放置到如下目录并进行解压 +``` +cd {LINKIS_HOME}/linkis/lib/linkis-engineconn-plugins +unzip.zip +``` +解压出来的目录结构为: +``` +dist +plugin +``` +(注意,看当前sqoop引擎对哪些用户有权限,不一定是root) + + +#### 2)重启linkis-engineplugin服务使sqoop引擎生效 +新加入linkis的引擎都要重启linkis的engineplugin服务才会生效,重启脚本为linkis安装目录下的./linkis-daemon.sh,具体步骤如下 +``` +cd {LINKIS_INSTALL_HOME}/links/sbin/ +./linkis-daemon.sh restart cg-engineplugin +``` +待服务启动成功,至此,sqoop安装部署就完成了。 + +engineplugin更详细的介绍可以参看下面的文章。 +https://linkis.apache.org/zh-CN/docs/latest/deployment/engine_conn_plugin_installation diff --git a/docs/zh_CN/ch1/exchangis_user_manual_cn.md b/docs/zh_CN/ch1/exchangis_user_manual_cn.md index 210feeb23..de4053e7f 100644 --- a/docs/zh_CN/ch1/exchangis_user_manual_cn.md +++ b/docs/zh_CN/ch1/exchangis_user_manual_cn.md @@ -1,222 +1,262 @@ -- [产品简介](#产品简介) -- [使用接入](#使用接入) - - [界面接入](#界面接入) - - [主要界面介绍](#主要界面介绍) - - [1.数据源管理-连接模版](#1.数据源管理-数据源) - - [2.数据源管理-模板管理](#2.数据源管理-模板管理) - - [3.任务配置](#3.任务配置) - - [4.任务作业](#4.任务作业) - - [5.权限组管理](#5.权限组管理) - - [数据源模块](#数据源模块) - - [1.创建数据源模板](#1.创建数据源模板) - - [2.创建数据源](#2.创建数据源) - - [任务配置模块](#任务配置模块) - - [1.创建项目/权限组](#1.创建项目/权限组) - - [2.配置数据交换任务](#2.配置数据交换任务) - - [3.配置后置处理器](#3.配置后置处理器) - - [任务作业模块](#任务作业模块) - - [1.查看作业日志](#1.查看作业日志) - - [系统管理模块](#系统管理模块) - - [1.应用用户管理](#1.应用用户管理) - - [2.执行(代理)用户管理](#2.执行(代理)用户管理) - - [3.执行节点管理](#3.执行节点管理) - - [脚本接入(未开源)](#脚本接入(未开源)) - -### 产品简介 -Exchangis是一款轻量级的数据交换服务平台,支持结构化、半结构化以及无结构化的存储系统之间的数据同步。平台将数据交换流程进行拆分,抽象出数据源,交换任务,交换作业等概念,达到可视化管理数据同步流程的目的。而在实际数据传输过程中可集成多个传输组件特性,做到功能横向扩展。 - -### 使用接入 -### 界面接入 -#### 主要界面介绍 -##### 1.数据源管理-数据源 -分类列举了用户创建的所有数据源,提供常用的搜索,编辑,删除方法,在点击 `编辑` 出现的弹窗中可以对数据源进行 `连接性测试` 和 `对外权限设置`。 - -![数据源列表](../../../images/zh_CN/ch1/data_source_list.png "数据源列表") - -##### 2.数据源管理-模板管理 -管理数据源的连接信息,将这些信息生成模板。例如IP地址,端口,集群配置参数,认证方式等信息,根据不同数据源类型和环境分开存储成模板,创建数据源时可以复用这些已有的连接模板。 - -![数据源模板列表](../../../images/zh_CN/ch1/data_source_model_list.png "数据源模板列表") - -##### 3.任务配置 -以项目为集合,管理用户配置的任务,用户可以组合现有的数据源创建交换任务,创建的任务将挂载到对应的项目下。同时还提供任务 `定时执行` 和 `历史数据重跑` 等功能。 - -![任务配置](../../../images/zh_CN/ch1/job_config.png "任务配置") - -##### 4.任务作业 -列举了用户相关任务下所有的执行作业,包括作业调用时间、完成时间、执行参数、执行节点以及完成状态,可以点击详细日志查看具体的执行细节。 - -![任务作业](../../../images/zh_CN/ch1/task_list.png "任务作业") +# Exchangis1.0用户手册 -##### 5.权限组管理 -默认用户创建一个项目时自动生成对应的一个权限组,用户可以通过增删成员的方式管理自己创建的项目权限组,同一权限组内的用户可以做到共享数据源。 - -![权限组](../../../images/zh_CN/ch1/authority_group.png "权限组") - - -#### 数据源模块 -#### 1.创建数据源模板 -数据源模板包含各种形式的连接参数,持有模板可以快速创建数据源。进入`数据源管理-模板管理`界面,点击`+新建模板`,选择要创建的模板类型: - -![新建模板](../../../images/zh_CN/ch1/data_source_model_new.png "新建模板") +## 一、产品简介 -- 模板上一般可以选择认证方式,使用不同认证方式的模板创建数据源时,要求输入的认证信息不一样; -- 普通用户可以编辑自己创建的模板,可以浏览管理员创建的模板,但不可以编辑,暂时不同用户之间不能共享模板。 -各种类型模板的填写样例如下: -##### 1.1 HIVE、HDFS连接模板 -![HIVE连接模板](../../../images/zh_CN/ch1/hive_model_new.png "HIVE连接模板") +  本文是Exchangis1.0的快速入门文档,涵盖了Exchangis1.0的基本使用流程。Exchangis是一款轻量级的数据交换服务平台,支持不同类型数据源之间的数据同步。平台将数据交换流程进行拆分,抽象出数据源,数据交换任务,任务调度等概念,达到可视化管理数据同步流程的目的。而在实际数据传输过程中可集成多个传输组件特性,做到功能横向扩展。 -HIVE连接模板的必填项目: -``` -Metastore地址, HiveMetastore地址,格式形如: thrift://path。 -HDFS地址,格式形如: hdfs://path。 -Hadoop配置项,包括namenode的地址,rpc端口等Hadoop客户端连接配置。 -认证方式,有kerberos、LDAP和无权限三个选项,kerberos中realm为必填项 -``` -HDFS连接模板的内容和HIVE模板相似 - -##### 1.2 SFTP连接模版 -![SFTP连接模板](../../../images/zh_CN/ch1/sftp_model_new.png "SFTP连接模板") - -SFTP连接模版的必填项目: -``` -SFTP HOST地址 -SFTP PORT端口号 -认证方式,默认为用户密码认证,keyfile为密钥文件验证 -``` - -##### 1.3 ElasticSearch连接模版 -![ES连接模板](../../../images/zh_CN/ch1/es_model_new.png "ES连接模板") - -ElasticSearch连接模版的必填项目: -``` -Elastic Url (ElasticSerach连接地址),可以填写多个 -认证方式,默认为Basic Authentication -``` - -##### 1.4 MySQL连接模版 -![MySQL连接模板](../../../images/zh_CN/ch1/mysql_model_new.png "MySQL连接模板") - -TDSQL连接模版的必填项目: -``` -MySQL HST地址 -MySQL PORT端口号 -MySQL的连接参数,例如:useUnicode, characterEncoding, allowMultiQuery -``` +## 二、登录Exchangis1.0 -#### 2.创建数据源 -点击 `数据源管理界面` 上方的 `新增数据源`,选择对应的数据源类型,目前支持的类型有`HIVE`,`HDFS`, `SFTP`,`ElasticSearch`和`MySQL`, -选择后出现弹窗,开始新建数据源。其中必须要填写的项目有 `数据源名称` 和 `数据源属主`,以及 `连接模板`: +  Exchangis1.0目前作为DSS**数据交换组件**的一部分,通过登录DSS的方式在组件列表中免密进入。所以,在使用Exchangis1.0之前,请对DSS,Exchangis1.0,Linkis等相关组件进行基本部署,保证组件功能可用,本文不进行赘述,详情见[exchangis部署文档](https://github.com/WeDataSphere/Exchangis/blob/dev-1.0.0-rc/docs/zh_CN/ch1/exchangis_deploy_cn.md)和[exchangis-appconn部署文档](https://github.com/WeDataSphere/Exchangis/blob/dev-1.0.0-rc/docs/zh_CN/ch1/exchangis_appconn_deploy_cn.md) -![新建数据源](../../../images/zh_CN/ch1/data_source_new.png "新建数据源") +### 1、登录DSS -- 模板这里可以直接点击`创建模板`打开新标签页去创建对应的连接模板,创建完成后再点击`刷新`按钮加载新模板。 -- 数据源与项目存在绑定关系,一个数据源只能绑定一个项目,项目的成员可以浏览项目下绑定的所有数据源, -同时数据源创建者可以指定其对外权限,设置项目组其他成员对该数据源的`编辑`,`使用`,`读取`以及`写入`权限。 -- 最后填写完必要信息后,点击`连接测试`,检验数据源的可用性。 +  系统默认通过Linkis的Linux部署用户登录DSS,如使用hadoop用户部署Linkis和DSS,可以直接通过账号密码:hadoop/hadoop登录。 首先根据DSS的前端部署地址登录网页,接着输入账号密码:hadoop/hadoop进入DSS -#### 任务配置模块 -#### 1.创建项目/权限组 -项目是`Exchangis`划分数据权限的基础,数据交换任务都挂载在项目上,数据源、用户也和项目有绑定关联关系,点击`任务配置`界面左侧的`+ 新建`可快速创建。 -#### 2.配置数据交换任务 -选中对应要添加任务的项目后,点击 `增加任务` 按钮,弹出任务配置窗口,选择要使用的传输引擎。 -目前Exchangis底层完全集成DataX,部分支持SQOOP,选择引擎要注意以下几点: -- 是否已经安装了引擎依赖的环境,DataX默认使用服务的JAVA环境,SQOOP则依赖了Hive和HDFS环境. -- 选用SQOOP引擎执行任务,由于依赖的是具体执行机器的环境,任务配置的Hive/HDFS数据源相关的参数信息会被具体环境的覆盖,数据源的认证信息也会失效。 +### 2、进入Exchangis -选择成功后,开始如下步骤的操作: -##### 2.1 选择数据来源和数据目的 -数据交换任务的主要工作是在不同数据源之间传输数据,所以需要用户选择不同数据源和配置其具体的数据信息,数据信息就比如HIVE数据源的 `库`、`表`以及`表分区`,如下图: +  Exchangis通过DSS来进入,在DSS页面中一词点击:**首页->DSS应用组件->数据交换->进入Exchangis** -![数据来源](../../../images/zh_CN/ch1/job_config_source.png "数据来源") +![exchangis1.0_entrance](../../../images/zh_CN/ch1/exchangis1.0_entrance.png) +
+图2-1 Exchangis1.0入口 +
-此外除了数据源管理界面里面创建的数据源外,用户在配置交换任务的时候还可以选择一种`local_fs`数据源,代表执行任务的机器节点的本地文件系统(Linux): +## 三、数据源管理 -![本地数据源](../../../images/zh_CN/ch1/local_fs.png "本地数据源") +  该模块可以对数据源进行配置和管理,为进行数据同步作业的起始步骤,目前Exchangis1.0支持对mysql和hive直接数据的互相导入。 +数据源主要功能如下: -在最开始选择数据来源的时候,对于文件系统类的数据源可以选择不同的数据交换方式,有两种方式`二进制`和 `记录`: +1. 创建,编辑,删除数据源; +2. 根据类型和名称搜索数据源,支持对数据源快速定位; +3. 数据源连接测试操作; +4. 历史数据源版本发布及记录。 -![交换方式](../../../images/zh_CN/ch1/transport_type.png "交换方式") +![datasource_list](../../../images/zh_CN/ch1/datasource_list.png) -`二进制`方式下数据直接以流的形式传输,`记录`方式下数据将被解码并切割成多个记录实体来传递,适用于结构化数据库。 +
+图4-1 数据源管理列表 +
-##### 2.2 配置时间占位符 -在配置交换任务时候,用户可以在一些配置项例如路径或者分区值里面加入时间占位符,在任务执行的时候,会用任务绑定的时间参数(默认是**任务触发时间**)去替换这些占位符 -![时间占位符](../../../images/zh_CN/ch1/partition_value.png "时间占位符") +### 1、创建数据源 -支持的时间占位符有常见的:`yyyyMMdd`, `yyyy-MM-dd`,其他的具体含义见下表: +  点击**创建数据源**,选择自己想要创建的数据源,当前支持MySQL和Hive两种数据源的创建。 -| 占位符 | 含义 | 例子 | -| :------ | :------: | :-----: | -| run_date | 设置为当前时间的前一天,格式为yyyyMMdd | 20200129 | -| run_date_std | 设置为当前时间的前一天,格式为yyy-MM-dd | 2020-01-29 | -| run_month_begin | 设置为当前时间所在月的第一天,格式为yyyyMMdd| 20200101| -| run_month_begin_std | 设置为当前时间所在月的第一天,格式为yyyy-MM-dd | 2020-01-01| -| run_month_end | 设置为当前时间所在月的最后一天,格式为yyyyMMdd | 20200131| -| run_month_end_std| 设置为当前时间所在月的最后一天,格式为yyyy-MM-dd | 20200131| +![datasource_type](../../../images/zh_CN/ch1/datasource_type.png) +
+图4-2 数据源类型 +
-##### 2.3 字段映射 -在对记录类型的数据进行传输的情况下,用户可以组合源表字段和目标表字段的对应关系,校验源表字段的值是否符合要求,对源表的字段的值进行转换: -![字段映射](../../../images/zh_CN/ch1/job_task_mapping.png "字段映射") +  选择创建MySQL数据源,填写配置参数,其中,带星号的为必填项,务必保证连接MySQL数据库的Host,端口号,用户名和密码连接正确。**连接参数**为Json格式,用于设置MySQL的配置信息,填写完能够进行**测试连接**。 -##### 2.4 速度控制 -速度控制控制的是任务每秒全局传输数据的最大值,同时从字节和记录两个纬度进行限制;在速度控制选项卡下还可以控制并行数和最大使用内存数。 +![MySQL_datasource_config](../../../images/zh_CN/ch1/MySQL_datasource_config.png) -![速度控制](../../../images/zh_CN/ch1/job_limit.png "速度控制") +
+图4-3 MySQL数据源配置 +
-##### 2.5 基本信息 -交换任务的基本信息应包括如下几点: -``` -任务名称、任务描述 -提醒人:任务失败以及超时的时候提醒的关系人,多个关系人逗号分隔 【默认告警信息打在后台日志中】 -定时:设置任务定时的corn表达式 -执行用户:设定的实际执行任务的系统(Linux)用户 【默认拥有同名的执行用户,其他需要管理员绑定授权】 -执行节点:设定的实际执行任务的服务节点列表 【公用默认服务节点,其他需要管理员绑定授权】 -超时时间:任务超时时间,单位秒 -同步方式:全量同步、增量同步,默认为全量同步,增量方式目前只支持对文件类数据源 -``` -需要关注的点: -``` -执行用户相当于代理用户,作用是限定权限,在任务执行的过程中,会用执行用户去启新进程和申请资源; -而对于数据源连接,如果数据源有认证信息,则以数据源认证信息为主,如果没有,权限则会自动落到执行用户上(SQOOP引擎下HIVE/HDFS权限都落在执行用户上); -``` -![基本信息](../../../images/zh_CN/ch1/job_info.png "基本信息") -##### 3.配置后置处理器 -Exchangis支持内嵌基础的处理代码,目前界面仅对ElasticSearch相关任务提供入口。当数据交换任务的目的端为ElasticSearch的时候,可以选择使用后置处理器,后置处理器允许用户以编写代码的方式对要写入的记录数据做更加定制化的处理操作: +  对于Hive数据源的配置,与MySQL不太相同,暂时不提供用户自行在界面进行集群参数配置的功能,对于集群环境,由后端统一配置完成,用户只需要选择需要的集群环境即可,点击确定即可保存。 -![后置处理器](../../../images/zh_CN/ch1/job_es_processor.png "后置处理器") +![Hive_datasource_config](../../../images/zh_CN/ch1/Hive_datasource_config.png) -在后置处理器代码中,只可以读取作业进程工作目录下的文件,写入操作以及网络连接将被拦截禁止 +
+图4-4 Hive数据源配置 +
-#### 任务作业模块 -##### 1.查看作业日志 -在任务配置页面创建执行任务后,可以在任务作业界面找到对应的作业,点击`详细日志`后拿到执行端的日志,如果作业的状态是`执行中`则会对日志窗口持续刷新: -![作业日志](../../../images/zh_CN/ch1/job_task_log.png "作业日志") +### 2、数据源功能 -#### 系统管理模块 -##### 1.应用用户管理 -在`系统管理 - 用户管理`界面可以新增Exchangis平台的应用用户,并授权用户不同的角色,新用户可以预设密码: +  数据源管理模块提供对配置数据源版本的**发布**功能,只有经过发布的数据源才能在配置导数任务的时候被使用,否则会提示不可用,只要再次编辑的数据源就会被视为一个新的版本,最新的版本在第一行。在版本列表中可以**查看**所有历史数据源版本的配置,您可在随时需要回滚时进行参考。 -![应用用户](../../../images/zh_CN/ch1/system_appuser.png "应用用户") +![datasource_func](../../../images/zh_CN/ch1/datasource_func.png) -对于单个用户,可以绑定执行(代理)用户和执行服务节点: +
+图4-5 数据源发布功能 +
-![用户绑定](../../../images/zh_CN/ch1/system_appuser_bind.png "用户绑定") +  数据源管理的**过期**功能,用于提示此数据源已经逐渐要被替换,请及时更换使用该数据源的任务配置,避免直接删除数据源造成所配置的执行任务失效。 +![datasource_timelimit](../../../images/zh_CN/ch1/datasource_timelimit.png) -##### 2.执行(代理)用户管理 -单独的界面维护系统内的执行(代理)用户: +
+图4-6 数据源过期功能 +
-![执行用户](../../../images/zh_CN/ch1/system_executive_user.png "执行用户") +## 四、项目管理 -##### 3.执行节点管理 -在`执行节点`界面可以看到当前集群存在的所有执行节点,这些服务节点通过心跳的方式自动更新自己的信息,点击对应的节点的`管理节点`按钮,进入如下界面: +### 1、项目列表 -![执行节点](../../../images/zh_CN/ch1/executor_management.png "执行节点") +  该模块可以创建项目,在实际的导数任务中,一个项目下可以有多个导数任务,不同的项目之间互不影响,对于普通用户而言,可以操作的只有自己创建的项目。 +在项目管理首页,可以对项目进行管理,包括**创建**,**修改**和**删除**以及**查询搜索**,修改和删除只能对在Exchangis中创建的项目操作。 + +![item_list](../../../images/zh_CN/ch1/item_list.png) +
+图3-1 项目列表 +
+ + +### 2、任务列表 + +  任务列表中可以对创建的Job数据同步任务进行管理,与项目类似,包括**创建**,**修改**、**删除**和**搜索**。 + +![job_task_list](../../../images/zh_CN/ch1/job_task_list.png) +
+图3-2 任务列表 +
+ +  除此之外,**任务支持复制**,能够增加需要的任务,复制的任务包含其原任务配置的所有信息。点击**创建任务**,能够选择任务类型和执行引擎,**目前仅支持离线任务和SQOOP执行引擎**,未来将会支持流式任务和DataX引擎等。 + +![task_type_and_engine](../../../images/zh_CN/ch1/task_type_and_engine.png) +
+图3-3 任务类型和引擎配置 +
+ +### 3、数据同步任务配置和执行 + +  数据同步任务配置和执行是Exchangis1.0的核心功能,基本配置数据同步流程为:**添加子任务->选择源数据源库表和目的数据源库表(在数据源管理模块添加好数据源以供选择)->字段映射(可默认)->过程控制(可默认)->配置(可默认)->执行**。 + +任务执行主要功能包括: +1. 子任务卡片的添加,复制和删除; +2. 实现对两种不同类型数据源之间数据的导入导出; +3. 来源数据源和目的地数据源的库表选择; +4. 数据源字段映射; +5. 作业最大并发数和作业最大内存配置; +6. 数据同步任务执行情况查看; +7. 每个主任务和各个子任务的日志查看; +8. 任务执行历史状态查看; +9. 执行任务kill操作。 + +### 4、数据源选择和配置 + +  点击**添加子任务**开始创建一个数据同步任务,对于新创建的数据同步子任务,首先要进行数据源库表的选择,数据源要在**数据源管理模块**中提前配置好,才会在任务配置中出现。数据源选择支持搜索,搜索方式为先搜索库,再搜索表。 + +![add_subtask](../../../images/zh_CN/ch1/add_subtask.png) +
+图3-4 添加子任务 +
+ +  MySQL为目的地数据源时,支持**插入**和**更新**两种写入方式;为源数据源时,支持**WHERE条件语句查询**。 + +  Hive为目的地数据源时,支持分区信息配置,写入方式为**追加数据**和**覆盖**两种;为源数据源时,支持**分区信息配置**。 + +### 5、数据源字段映射 + +  当配置完成数据源库表信息时,Exchangis1.0会自动在**字段映射**一行生成原数据源和目的数据源的字段自动映射,并且可以自行选择想要映射的字段;当HIVE为目的地数据源时,其映射字段不可修改,这点要注意。 + +### 6、过程控制 + +  任务执行提供对任务的最大并行数配置,以及作业最大内存配置,可根据实际需要进行更改。 + +### 7、作业执行 + +  Exchangis1.0支持多个子任务同时执行,任务配置完成后,点击执行,即开始数据同步任务,界面下方会弹出工作台,工作台主要包含三个部分功能:**运行情况、实时日志和执行历史**; +  **运行情况**能够查看当前数据同步任务整体进度,包含task成功和失败的数量等,以及点击task的名字,能够展示每个task的各项运行指标信息。 + +  **实时日志**主要展示的内容包含两大类,一是整个导数job的日志,能够输出每个task的状态日志,例如task是否被调度,是否运行中等;二是每个task的日志,输出的是各自相应的导数日志。在实时日志中能够根据关键字和忽略字进行日志筛选,并别提供获取最后n行日志功能;还可以对Error、Warning和Info不同类型的日志进行筛选展示,只需点击相应的按钮即可。 + +  **执行历史**能够展示该导数任务的历史执行信息,对历史执行过程提供初步的概览,如果想进一步查看详细历史信息,点击任务名称,即可跳转到同步历史界面进行查看。 + +  数据同步任务执行需指定执行用户,默认为登录用户,具体情况需根据实际数据源的配置去调整。 + + +## 五、同步历史 + +  该模块可以查看到历史执行的所有数据同步任务,每个用户只能查看自己创建的任务,不同用户之间互相隔离。 + +主要功能如下: +1. 根据查询条件查找所需的历史任务信息; +2. 对于非终态的任务,提供终止任务的功能,能够kill掉非终态的任务; +3. 查看每个任务的运行情况和实时日志; +4. 查看每个同步任务的更细节配置信息和更新时间等。 + +![sync_history](../../../images/zh_CN/ch1/sync_history.png) + +
+图5-1 同步历史界面 +
+ +## 六、Exchangis Appconn使用 + +  目前,Exchangis1.0支持以Appconn形式与DSS对接,**在DSS端**,能够通过DSS的**应用开发->项目列表**,以工作流编排的模式创建数据交换**sqoop工作流节点**,在这里,能够进行数据同步任务的配置和执行。在DSS创建的Exchangis项目和数据交换任务,会同步在Exchangis中创建。 + +Exchangis Appconn主要支持以下功能: + +1. **项目操作**是对DSS项目的创建,删除,修改操作会同步影响Exchangis端的项目; +2. **工作流节点基本操作**是DSS编排器中对sqoop工作流节点创建,删除,修改操作会同步到Exchangis端的任务; +3. **工作流导数操作**支持sqoop工作流节点配置执行数据同步任务; +4. **工作流发布操作**支持sqoop工作流节点发布至WTSS进行任务调度。 + +### 1、项目操作 + +  该模块能够对DSS项目进行创建、修改和删除,在DSS端的操作会同步到Exchangis端,这里以在DSS创建的项目为例,在exchangis appconn操作的流程为:**点击创建项目->填写项目信息->点击确认->进入Exchangis端->点击项目管理**,即可查看到同步创建的项目,如下图所示: + +![appconn_pro_create](../../../images/zh_CN/ch1/appconn_pro_create.png) + +
+图6-1 项目操作 +
+ +创建完成后,会在Exchangis端看到同步过来的项目 + +![appconn_pro_sync](../../../images/zh_CN/ch1/appconn_pro_sync.jpg) + +
+图6-2 项目同步到Exchangis +
+ +### 2、工作流节点基本操作 + + 工作流节点能够进行创建、修改、删除和进行依赖选择,可以进行节点之间的关联,在DSS端的操作会同步到Exchangis端。这里以对sqoop工作流节点的创建操作为例,在exchangis appconn对项目的操作流程为:**创建一条工作流->从左侧插件栏拖动sqoop节点至右侧画布->点击确认创建sqoop节点任务->进入exchangis端查看同步创建的任务**,如下图所示,对sqoop节点任务的删除和修改同理。 + +![appconn_pro_sqoop](../../../images/zh_CN/ch1/appconn_pro_sqoop.png) + +
+图6-3 Sqoop节点功能 +
+ +可以看到导数任务也同步到Exchangis中了 + +![](../../../images/zh_CN/ch1/appconn_pro_sqoop_sync.jpg) + +
+图6-4 Sqoop节点同步到Exchangis +
+ +### 3、工作流导数操作 + +  双击Sqoop节点进行工作流节点进行操作,支持sqoop工作流节点配置与执行数据同步任务。以工作流节点形式进行导数任务是Exchangis Appconn的核心功能,**每一个sqoop节点代表一个数据同步任务**,具体操作流程如下:**双击sqoop节点->弹出任务配置界面->配置任务信息->执行任务**,如下图所示: + +![sqoop_config](../../../images/zh_CN/ch1/sqoop_config.png) + +
+图6-5 双击sqoop工作流节点进入配置界面 +
+ +![sqoop_user_config](../../../images/zh_CN/ch1/sqoop_user_config.png) + +
+图6-6 配置工作流节点信息 +
+ +  这里有两种执行方式,一种是在弹出的任务配置界面点击执行按钮进行执行;另一种是点击DSS编排器的**执行按钮**或者是**选中执行按钮**进行执行,**点击执行**会对该工作流中的所有节点执行,**点击选中执行**仅会执行选中的工作流节点,不会执行全部节点。 + +![sqoop_execute](../../../images/zh_CN/ch1/sqoop_execute.png) + +
+图6-7 执行任务 +
+ +注:在DSS的sqoop节点中执行的数据同步任务,均可在Exchangis端查看相关信息。 + +### 4、工作流发布操作 + +  工作流任务的**发布**功能,支持sqoop工作流节点发布至WTSS进行任务调度。在**开发中心**创建和配置的数据交换任务信息,通过发布,发布到WTSS,能够在WTSS中进行任务调度。 + +### 5、生产中心 + +  点击命名空间的下拉框,切换到**生产中心**,可以看到所有项目的工作流的日志,可以查看每个工作流调度的状态 + +![production_center](../../../images/zh_CN/ch1/production_center.png) -在该界面可以允许管理员绑定关联执行(代理)用户和执行节点,关联成功后,将会自动在节点机器上建立对应的系统帐号(目前只支持Linux发行版的系统) -#### 脚本接入(未开源) \ No newline at end of file diff --git a/exchangis-dao/pom.xml b/exchangis-dao/pom.xml new file mode 100644 index 000000000..9484df448 --- /dev/null +++ b/exchangis-dao/pom.xml @@ -0,0 +1,61 @@ + + + + exchangis + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-dao + + + 8 + 8 + 5.1.1.Final + + + + + org.apache.linkis + linkis-mybatis + ${linkis.version} + + + org.apache.linkis + linkis-module + ${linkis.version} + + + validation-api + javax.validation + + + + + org.hibernate + hibernate-validator + ${hibernate.validator} + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + net.alchim31.maven + scala-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + \ No newline at end of file diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/ValidatorConfiguration.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/ValidatorConfiguration.java new file mode 100644 index 000000000..882e71f50 --- /dev/null +++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/ValidatorConfiguration.java @@ -0,0 +1,21 @@ +package com.webank.wedatasphere.exchangis; + +import org.hibernate.validator.HibernateValidator; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.validation.Validation; +import javax.validation.Validator; + +/** + * Bean validator + */ +@Configuration +public class ValidatorConfiguration { + @Bean + public Validator validator(){ + return Validation.byProvider(HibernateValidator.class) + .configure().failFast(true) + .buildValidatorFactory().getValidator(); + } +} diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/pager/PageQuery.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/pager/PageQuery.java new file mode 100644 index 000000000..ba95c3d80 --- /dev/null +++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/pager/PageQuery.java @@ -0,0 +1,49 @@ +package com.webank.wedatasphere.exchangis.common.pager; + +import java.util.Objects; + +/** + * Query Vo + */ +public class PageQuery { + + protected Integer current = 1; + + protected Integer size = 10; + + protected Integer page; + + protected Integer pageSize; + + public Integer getCurrent() { + return current; + } + + public void setCurrent(Integer current) { + this.current = current; + } + + public Integer getSize() { + return size; + } + + public void setSize(Integer size) { + this.size = size; + } + + public Integer getPage() { + return Objects.nonNull(page) ? page : current; + } + + public void setPage(Integer page) { + this.page = page; + } + + public Integer getPageSize() { + return Objects.nonNull(pageSize) ? pageSize : size; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/pager/PageResult.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/pager/PageResult.java new file mode 100644 index 000000000..8774b54b4 --- /dev/null +++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/pager/PageResult.java @@ -0,0 +1,61 @@ +package com.webank.wedatasphere.exchangis.common.pager; + +import com.github.pagehelper.PageInfo; +import org.apache.linkis.server.Message; + +import java.util.List; + +/** + * Page result + * @param + */ +public class PageResult{ + /** + * Total + */ + private Long total; + + /** + * List + */ + private List list; + + public PageResult(){ + + } + + public PageResult(PageInfo pageInfo){ + this.total = pageInfo.getTotal(); + this.list = pageInfo.getList(); + } + /** + * To Message(in linkis-common) + * @return message + */ + public Message toMessage(String info){ + Message message = Message.ok(info); + message.data("total", total); + message.data("list", list); + return message; + } + + public Message toMessage(){ + return toMessage(""); + } + + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } +} diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/validator/groups/InsertGroup.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/validator/groups/InsertGroup.java new file mode 100644 index 000000000..1c05bc04d --- /dev/null +++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/validator/groups/InsertGroup.java @@ -0,0 +1,10 @@ +package com.webank.wedatasphere.exchangis.common.validator.groups; + +import javax.validation.groups.Default; + +/** + * Insert group for validator + */ +public interface InsertGroup extends Default { + +} diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/validator/groups/UpdateGroup.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/validator/groups/UpdateGroup.java new file mode 100644 index 000000000..ce05e3f7e --- /dev/null +++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/validator/groups/UpdateGroup.java @@ -0,0 +1,9 @@ +package com.webank.wedatasphere.exchangis.common.validator.groups; + +import javax.validation.groups.Default; + +/** + * Update group for validator + */ +public interface UpdateGroup extends Default { +} diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/domain/ExchangisJobDsBind.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/domain/ExchangisJobDsBind.java new file mode 100644 index 000000000..e21695e6d --- /dev/null +++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/domain/ExchangisJobDsBind.java @@ -0,0 +1,62 @@ +package com.webank.wedatasphere.exchangis.dao.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +@TableName("exchangis_job_ds_bind") +public class ExchangisJobDsBind { + + @TableId(type = IdType.AUTO) + private Long id; + + @TableField("job_id") + private Long jobId; + + private Integer taskIndex; + + private Long sourceDsId; + + private Long sinkDsId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getJobId() { + return jobId; + } + + public void setJobId(Long jobId) { + this.jobId = jobId; + } + + public Integer getTaskIndex() { + return taskIndex; + } + + public void setTaskIndex(Integer taskIndex) { + this.taskIndex = taskIndex; + } + + public Long getSourceDsId() { + return sourceDsId; + } + + public void setSourceDsId(Long sourceDsId) { + this.sourceDsId = sourceDsId; + } + + public Long getSinkDsId() { + return sinkDsId; + } + + public void setSinkDsId(Long sinkDsId) { + this.sinkDsId = sinkDsId; + } +} diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/domain/ExchangisJobParamConfig.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/domain/ExchangisJobParamConfig.java new file mode 100644 index 000000000..40ce6e138 --- /dev/null +++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/domain/ExchangisJobParamConfig.java @@ -0,0 +1,268 @@ +package com.webank.wedatasphere.exchangis.dao.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +@TableName("exchangis_job_param_config") +public class ExchangisJobParamConfig { + public static final String DIRECTION_SOURCE = "SOURCE"; + public static final String DIRECTION_SINK = "SINK"; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @TableField(value = "config_key") + private String configKey; + + @TableField(value = "config_name") + private String configName; + + @TableField(value = "config_direction") + private String configDirection; + + private String type; + + @TableField(value = "ui_type") + private String uiType; + + @TableField(value = "ui_field") + private String uiField; + + @TableField(value = "ui_label") + private String uiLabel; + + @TableField(value = "unit") + private String unit; + + @TableField(value = "required") + private Boolean required; + + @TableField(value = "value_type") + private String valueType; + + @TableField(value = "value_range") + private String valueRange; + + @TableField(value = "default_value") + private String defaultValue; + + @TableField(value = "validate_type") + private String validateType; + + @TableField(value = "validate_range") + private String validateRange; + + @TableField(value = "validate_msg") + private String validateMsg; + + @TableField(value = "is_hidden") + private Boolean hidden; + + @TableField(value = "is_advanced") + private Boolean advanced; + + /** + * store url exa. http://127.0.0.1/api/v1/dss/exchangis/main/xxx + */ + private String source; + + private Integer level; + + private String treename; + + private Integer sort; + + private String description; + + private Integer status; + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getConfigKey() { + return configKey; + } + + public void setConfigKey(String configKey) { + this.configKey = configKey; + } + + public String getConfigName() { + return configName; + } + + public void setConfigName(String configName) { + this.configName = configName; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getUiType() { + return uiType; + } + + public void setUiType(String uiType) { + this.uiType = uiType; + } + + public String getUiField() { + return uiField; + } + + public void setUiField(String uiField) { + this.uiField = uiField; + } + + public String getUiLabel() { + return uiLabel; + } + + public void setUiLabel(String uiLabel) { + this.uiLabel = uiLabel; + } + + public String getValueType() { + return valueType; + } + + public void setValueType(String valueType) { + this.valueType = valueType; + } + + public String getValueRange() { + return valueRange; + } + + public void setValueRange(String valueRange) { + this.valueRange = valueRange; + } + + public String getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + public String getValidateType() { + return validateType; + } + + public void setValidateType(String validateType) { + this.validateType = validateType; + } + + public String getValidateRange() { + return validateRange; + } + + public void setValidateRange(String validateRange) { + this.validateRange = validateRange; + } + + public String getValidateMsg() { return validateMsg; } + + public void setValidateMsg(String validateMsg) { this.validateMsg = validateMsg; } + + public Boolean getHidden() { + return hidden; + } + + public void setHidden(Boolean hidden) { + this.hidden = hidden; + } + + public Boolean getAdvanced() { + return advanced; + } + + public void setAdvanced(Boolean advanced) { + this.advanced = advanced; + } + + public Integer getLevel() { + return level; + } + + public void setLevel(Integer level) { + this.level = level; + } + + public String getTreename() { + return treename; + } + + public void setTreename(String treename) { + this.treename = treename; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getConfigDirection() { + return configDirection; + } + + public void setConfigDirection(String configDirection) { + this.configDirection = configDirection; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public Boolean getRequired() { + return required; + } + + public void setRequired(Boolean required) { + this.required = required; + } +} \ No newline at end of file diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/hook/MapperHook.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/hook/MapperHook.java new file mode 100644 index 000000000..ba0de2947 --- /dev/null +++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/hook/MapperHook.java @@ -0,0 +1,24 @@ +package com.webank.wedatasphere.exchangis.dao.hook; + +import com.webank.wedatasphere.exchangis.dao.mapper.ExchangisJobParamConfigMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class MapperHook { + + private ExchangisJobParamConfigMapper exchangisJobParamConfigMapper; + + @Autowired + public MapperHook(ExchangisJobParamConfigMapper exchangisJobParamConfigMapper) { + this.exchangisJobParamConfigMapper = exchangisJobParamConfigMapper; + } + + public ExchangisJobParamConfigMapper getExchangisJobParamConfigMapper() { + return exchangisJobParamConfigMapper; + } + + public void setExchangisJobParamConfigMapper(ExchangisJobParamConfigMapper exchangisJobParamConfigMapper) { + this.exchangisJobParamConfigMapper = exchangisJobParamConfigMapper; + } +} diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/mapper/ExchangisJobDsBindMapper.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/mapper/ExchangisJobDsBindMapper.java new file mode 100644 index 000000000..43522db61 --- /dev/null +++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/mapper/ExchangisJobDsBindMapper.java @@ -0,0 +1,10 @@ +package com.webank.wedatasphere.exchangis.dao.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.webank.wedatasphere.exchangis.dao.domain.ExchangisJobDsBind; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface ExchangisJobDsBindMapper extends BaseMapper { + +} diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/mapper/ExchangisJobParamConfigMapper.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/mapper/ExchangisJobParamConfigMapper.java new file mode 100644 index 000000000..03e6de5a8 --- /dev/null +++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/mapper/ExchangisJobParamConfigMapper.java @@ -0,0 +1,10 @@ +package com.webank.wedatasphere.exchangis.dao.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.webank.wedatasphere.exchangis.dao.domain.ExchangisJobParamConfig; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface ExchangisJobParamConfigMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/exchangis-datasource/exchangis-datasource-core/pom.xml b/exchangis-datasource/exchangis-datasource-core/pom.xml new file mode 100644 index 000000000..6083e160b --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/pom.xml @@ -0,0 +1,67 @@ + + + + exchangis-datasource + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-datasource-core + + + 8 + 8 + + + + + com.webank.wedatasphere.exchangis + exchangis-dao + 1.0.0-RC1 + + + + + org.apache.linkis + linkis-datasource-client + ${linkis.version} + + + org.apache.linkis + linkis-metadata + + + org.apache.linkis + linkis-publicservice + + + org.apache.linkis + linkis-bml + + + + + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + net.alchim31.maven + scala-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + \ No newline at end of file diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ExchangisDataSource.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ExchangisDataSource.java new file mode 100644 index 000000000..1b09ba1e6 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ExchangisDataSource.java @@ -0,0 +1,51 @@ +package com.webank.wedatasphere.exchangis.datasource.core; + +import com.webank.wedatasphere.exchangis.dao.domain.ExchangisJobParamConfig; +import com.webank.wedatasphere.exchangis.dao.hook.MapperHook; +import org.apache.linkis.datasource.client.impl.LinkisDataSourceRemoteClient; +import org.apache.linkis.datasource.client.impl.LinkisMetaDataRemoteClient; +import org.apache.linkis.datasource.client.request.GetAllDataSourceTypesAction; +import org.apache.linkis.datasource.client.response.GetAllDataSourceTypesResult; +import org.apache.linkis.datasourcemanager.common.domain.DataSourceType; + +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +public interface ExchangisDataSource { + + String id(); + + String name(); + + String description(); + + String option(); + + String classifier(); +// String type(); + + +// String category(); + + String icon(); + + List getDataSourceParamConfigs(); + + LinkisDataSourceRemoteClient getDataSourceRemoteClient(); + + LinkisMetaDataRemoteClient getMetaDataRemoteClient(); + + void setMapperHook(MapperHook mapperHook); + + default List getDataSourceTypes(String user) { + GetAllDataSourceTypesResult result = getDataSourceRemoteClient().getAllDataSourceTypes(GetAllDataSourceTypesAction.builder() + .setUser(user) + .build() + ); + + List allDataSourceType = result.getAllDataSourceType(); + if (Objects.isNull(allDataSourceType)) allDataSourceType = Collections.emptyList(); + return allDataSourceType; + } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ExchangisDataSourceConfiguration.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ExchangisDataSourceConfiguration.java new file mode 100644 index 000000000..77e94b12a --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ExchangisDataSourceConfiguration.java @@ -0,0 +1,19 @@ +package com.webank.wedatasphere.exchangis.datasource.core; + + +import org.apache.linkis.common.conf.CommonVars; + +public class ExchangisDataSourceConfiguration { + public static final CommonVars SERVER_URL = CommonVars.apply("wds.exchangis.datasource.client.serverurl", ""); + public static final CommonVars CONNECTION_TIMEOUT = CommonVars.apply("wds.exchangis.datasource.client.connection.timeout", 30000L); + public static final CommonVars DISCOVERY_ENABLED = CommonVars.apply("wds.exchangis.datasource.client.discovery.enabled", true); + public static final CommonVars DISCOVERY_FREQUENCY_PERIOD = CommonVars.apply("wds.exchangis.datasource.client.discoveryfrequency.period", 1L); + public static final CommonVars LOAD_BALANCER_ENABLED = CommonVars.apply("wds.exchangis.datasource.client.loadbalancer.enabled", true); + public static final CommonVars MAX_CONNECTION_SIZE = CommonVars.apply("wds.exchangis.datasource.client.maxconnection.size", 5); + public static final CommonVars RETRY_ENABLED = CommonVars.apply("wds.exchangis.datasource.client.retryenabled", false); + public static final CommonVars READ_TIMEOUT = CommonVars.apply("wds.exchangis.datasource.client.readtimeout", 30000L); + + public static final CommonVars AUTHTOKEN_KEY = CommonVars.apply("wds.exchangis.datasource.client.authtoken.key", ""); + public static final CommonVars AUTHTOKEN_VALUE = CommonVars.apply("wds.exchangis.datasource.client.authtoken.value", ""); + public static final CommonVars DWS_VERSION = CommonVars.apply("wds.exchangis.datasource.client.dws.version", ""); +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/context/DefaultExchangisDataSourceContext.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/context/DefaultExchangisDataSourceContext.java new file mode 100644 index 000000000..db43c030f --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/context/DefaultExchangisDataSourceContext.java @@ -0,0 +1,72 @@ +package com.webank.wedatasphere.exchangis.datasource.core.context; + + +import com.google.common.base.Strings; +import com.webank.wedatasphere.exchangis.datasource.core.ExchangisDataSource; +import com.webank.wedatasphere.exchangis.datasource.core.loader.ExchangisDataSourceLoader; + +import java.util.Collection; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +public class DefaultExchangisDataSourceContext implements ExchangisDataSourceContext { + + private final Map dataSources = new ConcurrentHashMap<>(24); + + @Override + public boolean registerDataSourceLoader(ExchangisDataSourceLoader loader) { + return false; + } + + @Override + public void addExchangisDataSource(ExchangisDataSource dataSource) { + Objects.requireNonNull(dataSource, "dataSource required"); + String name = dataSource.name(); + dataSources.put(name, dataSource); + } + + @Override + public ExchangisDataSource removeExchangisDataSource(String type) { + return null; + } + + @Override + public ExchangisDataSource updateExchangisDataSource(ExchangisDataSource dataSource) { + return null; + } + + @Override + public ExchangisDataSource getExchangisDataSource(String type) { + if (Strings.isNullOrEmpty(type)) { + return null; + } + return this.dataSources.get(type.trim().toUpperCase()); + } + + @Override + public ExchangisDataSource getExchangisDataSource(Long dataSourceTypeId) { + if (Objects.isNull(dataSourceTypeId)) { + return null; + } + Collection values = this.dataSources.values(); + for (ExchangisDataSource ds : values) { + if (ds.id().equalsIgnoreCase(dataSourceTypeId+"")) { + return ds; + } + } + + return null; + } + + @Override + public Collection all() { + return this.dataSources.values(); + } + + @Override + public Set keys() { + return this.dataSources.keySet(); + } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/context/ExchangisDataSourceContext.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/context/ExchangisDataSourceContext.java new file mode 100644 index 000000000..f15e614a0 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/context/ExchangisDataSourceContext.java @@ -0,0 +1,27 @@ +package com.webank.wedatasphere.exchangis.datasource.core.context; + +import com.webank.wedatasphere.exchangis.datasource.core.ExchangisDataSource; +import com.webank.wedatasphere.exchangis.datasource.core.loader.ExchangisDataSourceLoader; + +import java.util.Collection; +import java.util.Set; + +public interface ExchangisDataSourceContext { + + boolean registerDataSourceLoader(ExchangisDataSourceLoader loader); + + void addExchangisDataSource(ExchangisDataSource dataSource); + + ExchangisDataSource removeExchangisDataSource(String type); + + ExchangisDataSource updateExchangisDataSource(ExchangisDataSource dataSource); + + ExchangisDataSource getExchangisDataSource(String type); + + ExchangisDataSource getExchangisDataSource(Long dataSourceTypeId); + + Collection all(); + + Set keys(); + +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/domain/MetaColumn.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/domain/MetaColumn.java new file mode 100644 index 000000000..297a0333c --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/domain/MetaColumn.java @@ -0,0 +1,69 @@ +package com.webank.wedatasphere.exchangis.datasource.core.domain; + +/** + * Meta column + */ +public class MetaColumn { + + /** + * Column index + */ + private int index = -1; + + /** + * Is primary key + */ + private boolean primaryKey; + + /** + * Name + */ + private String name; + + /** + * Type symbol + */ + private String type; + + public MetaColumn(){ + + } + + public MetaColumn(int index, String name, String type, boolean primaryKey){ + this.index = index; + this.name = name; + this.type = type; + this.primaryKey = primaryKey; + } + public int getIndex() { + return index; + } + + public void setIndex(int index) { + this.index = index; + } + + public boolean isPrimaryKey() { + return primaryKey; + } + + public void setPrimaryKey(boolean primaryKey) { + this.primaryKey = primaryKey; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/exception/ExchangisDataSourceException.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/exception/ExchangisDataSourceException.java new file mode 100644 index 000000000..2486a3bb6 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/exception/ExchangisDataSourceException.java @@ -0,0 +1,34 @@ +package com.webank.wedatasphere.exchangis.datasource.core.exception; + + +import org.apache.linkis.common.exception.ErrorException; +import org.apache.linkis.common.exception.ExceptionLevel; +import org.apache.linkis.common.exception.LinkisRuntimeException; + +public class ExchangisDataSourceException extends ErrorException { + + public ExchangisDataSourceException(int errCode, String desc) { + super(errCode, desc); + } + + public ExchangisDataSourceException(int errCode, String desc, Throwable t) { + super(errCode, desc); + super.initCause(t); + } + public ExchangisDataSourceException(int errCode, String desc, String ip, int port, String serviceKind) { + super(errCode, desc, ip, port, serviceKind); + } + + public static class Runtime extends LinkisRuntimeException { + + public Runtime(int errCode, String desc, Throwable t) { + super(errCode, desc); + super.initCause(t); + } + + @Override + public ExceptionLevel getLevel() { + return ExceptionLevel.ERROR; + } + } +} \ No newline at end of file diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/exception/ExchangisDataSourceExceptionCode.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/exception/ExchangisDataSourceExceptionCode.java new file mode 100644 index 000000000..cf5e6083d --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/exception/ExchangisDataSourceExceptionCode.java @@ -0,0 +1,50 @@ +package com.webank.wedatasphere.exchangis.datasource.core.exception; + +// 31000 ~ 31999 +public enum ExchangisDataSourceExceptionCode { + + CLIENT_RPC_ERROR(31000), + CLIENT_QUERY_DATASOURCE_ERROR(31001), + CLIENT_GET_DATASOURCE_VERSION_ERROR(31002), + CLIENT_GET_DATASOURCE_ERROR(31003), + CLIENT_DATASOURCE_TEST_CONNECTION_ERROR(31004), + CLIENT_DATASOURCE_PUBLISH_VERSION_ERROR(31005), + CLIENT_DATASOURCE_PARAMS_GET_ERROR(31006), + CLIENT_DATASOURCE_EXPIRE_ERROR(31007), + CLIENT_METADATA_GET_COLUMNS_ERROR(31008), + CLIENT_METADATA_GET_TABLES_ERROR(31009), + CLIENT_METADATA_GET_DATABASES_ERROR(31010), + CLIENT_DATASOURCE_DELETE_ERROR(31011), + CLIENT_DATASOURCE_UPDATE_ERROR(31012), + CLIENT_DATASOURCE_UPDATE_PARAMS_VERSION_ERROR(31013), + CLIENT_DATASOURCE_CREATE_ERROR(31014), + CLIENT_DATASOURCE_GET_TYPES_ERROR(31015), + CLIENT_DATASOURCE_GET_KEY_DEFINES_ERROR(31016), + CLIENT_METADATA_GET_PARTITION_PROPS(31017), + CLIENT_METADATA_GET_PARTITION(31018), + // 其他错误 + PARSE_JSON_ERROR(39000), // Parse Json Error + CONTEXT_GET_DATASOURCE_NULL(39001), // DataSource Context Error + PARAMETER_INVALID(39002), // DataSource Context Error + DELETE_HISTORY_ERROR(39003), + UNSUPPORTED_DS_MAPPING(39004), + DS_MAPPING_MUST_CONTAIN_HIVE(39005), + DS_TYPE_MUST_DIFFERENT(39006), + UNSUPPORTEd_ENGINE(39007) + + ; + + private int code; + + ExchangisDataSourceExceptionCode(int code) { + this.code = code; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/exception/ExchangisServiceRpcException.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/exception/ExchangisServiceRpcException.java new file mode 100644 index 000000000..bb86ad58f --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/exception/ExchangisServiceRpcException.java @@ -0,0 +1,14 @@ +package com.webank.wedatasphere.exchangis.datasource.core.exception; + +import org.apache.linkis.common.exception.ErrorException; + +/** + * Rpc exception in client + */ +public class ExchangisServiceRpcException extends ErrorException { + + public ExchangisServiceRpcException(String desc, Throwable t) { + super(ExchangisDataSourceExceptionCode.CLIENT_RPC_ERROR.getCode(), desc); + super.initCause(t); + } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/loader/ExchangisDataSourceLoader.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/loader/ExchangisDataSourceLoader.java new file mode 100644 index 000000000..60400f70f --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/loader/ExchangisDataSourceLoader.java @@ -0,0 +1,34 @@ +package com.webank.wedatasphere.exchangis.datasource.core.loader; + + +import com.webank.wedatasphere.exchangis.dao.hook.MapperHook; +import com.webank.wedatasphere.exchangis.datasource.core.ExchangisDataSource; +import com.webank.wedatasphere.exchangis.datasource.core.context.ExchangisDataSourceContext; +import org.apache.linkis.common.conf.CommonVars; + +import java.util.Objects; + +public interface ExchangisDataSourceLoader { + +// String EXCHANGIS_DIR_NAME = "exchangis-extds"; + String EXCHANGIS_DIR_NAME = Objects.isNull(CommonVars.apply("wds.exchangis.datasource.extension.dir").getValue()) ? "exchangis-extds" : CommonVars.apply("wds.exchangis.datasource.extension.dir").getValue().toString(); + + String PROPERTIES_NAME = "extds.properties"; + + String LIB_NAME = "lib"; + + String JAR_SUF_NAME = ".jar"; + + String FILE_SCHEMA = "file://"; + + void setClassLoader(ClassLoader classLoader); + + void setContext(ExchangisDataSourceContext context); + + void init(MapperHook mapperHook) throws Exception; + + ExchangisDataSource load(String dataSourceType); + + ExchangisDataSource get(String dataSourceType, boolean reload); + +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/DataSourceInfoService.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/DataSourceInfoService.java new file mode 100644 index 000000000..c9ef6ada9 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/DataSourceInfoService.java @@ -0,0 +1,7 @@ +package com.webank.wedatasphere.exchangis.datasource.core.service; + +public interface DataSourceInfoService { + + + +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/MetadataInfoService.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/MetadataInfoService.java new file mode 100644 index 000000000..04b7d78f3 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/MetadataInfoService.java @@ -0,0 +1,60 @@ +package com.webank.wedatasphere.exchangis.datasource.core.service; + +import com.webank.wedatasphere.exchangis.datasource.core.domain.MetaColumn; +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisDataSourceException; +import com.webank.wedatasphere.exchangis.datasource.core.service.rpc.ServiceRpcClient; + +import java.util.List; +import java.util.Map; + +public interface MetadataInfoService extends ServiceRpcInf { + + /** + * Get properties of partition + * @param database database + * @param table table + * @param partition partition + * @return map + */ + Map getPartitionProps(String userName, Long dataSourceId, + String database, String table, String partition) throws ExchangisDataSourceException; + + Map getPartitionProps(ServiceRpcClient rpcClient, + String userName, Long dataSourceId, + String database, String table, String partition) throws ExchangisDataSourceException; + + /** + * Get properties of table + * @param database database + * @param table table + * @return map + * @throws ExchangisDataSourceException + */ + Map getTableProps(String userName, Long dataSourceId, + String database, String table) throws ExchangisDataSourceException; + + Map getTableProps(ServiceRpcClient rpcClient, String userName, Long dataSourceId, + String database, String table) throws ExchangisDataSourceException; + + /** + * Get partition keys + * @param userName userName + * @param dataSourceId data source id + * @param database database + * @param table table + * @return + * @throws ExchangisDataSourceException + */ + List getPartitionKeys(String userName, Long dataSourceId, String database, String table) throws ExchangisDataSourceException; + + /** + * Get columns + * @param userName userName + * @param dataSourceId data source id + * @param database database + * @param table table + * @return + * @throws ExchangisDataSourceException + */ + List getColumns(String userName, Long dataSourceId, String database, String table) throws ExchangisDataSourceException; +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/ServiceRpcInf.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/ServiceRpcInf.java new file mode 100644 index 000000000..b7c5ca7d8 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/ServiceRpcInf.java @@ -0,0 +1,9 @@ +package com.webank.wedatasphere.exchangis.datasource.core.service; + +/** + * RPC service + */ +public interface ServiceRpcInf { + + Class getClientClass(); +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/rpc/AbstractServiceRpcDispatcher.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/rpc/AbstractServiceRpcDispatcher.java new file mode 100644 index 000000000..ab8fae6eb --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/rpc/AbstractServiceRpcDispatcher.java @@ -0,0 +1,43 @@ +package com.webank.wedatasphere.exchangis.datasource.core.service.rpc; + + +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisServiceRpcException; + +import java.util.Objects; + +/** + * Abstract implements + */ +public abstract class AbstractServiceRpcDispatcher, T extends ServiceOperation> + implements ServiceRpcDispatcher { + + @Override + public U dispatch(T operation) throws ExchangisServiceRpcException { + return dispatch(getDefaultRemoteClient(), operation); + } + + @Override + public U dispatch(C remoteClient, T operation) throws ExchangisServiceRpcException { + if (Objects.isNull(remoteClient)){ + throw new ExchangisServiceRpcException("Remote client for service: [" + this.getClass().getSimpleName() + "] cannot be empty", null); + } + try { + return execute(remoteClient, operation); + }catch(Exception e){ + + if (e instanceof ExchangisServiceRpcException){ + throw e; + } + throw new ExchangisServiceRpcException("Unexpected exception in dispatching operation: [uri: " + operation.uri + ", timestamp: " + + operation.timestamp + "]", e); + } + } + + @Override + public C getDefaultRemoteClient() { + // Default client is Empty + return null; + } + + protected abstract U execute(C remoteClient, T operation) throws ExchangisServiceRpcException; +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/rpc/ServiceOperation.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/rpc/ServiceOperation.java new file mode 100644 index 000000000..e2dae2205 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/rpc/ServiceOperation.java @@ -0,0 +1,43 @@ +package com.webank.wedatasphere.exchangis.datasource.core.service.rpc; + + +/** + * Operation + */ +public class ServiceOperation { + /** + * Uri + */ + protected String uri; + /** + * Timestamp + */ + protected long timestamp; + + + public ServiceOperation(){ + + } + + public ServiceOperation(String uri){ + this.uri = uri; + this.timestamp = System.currentTimeMillis(); + } + + public String getUri() { + return uri; + } + + public void setUri(String uri) { + this.uri = uri; + } + + public long getTimestamp() { + return timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + } + +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/rpc/ServiceRpcClient.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/rpc/ServiceRpcClient.java new file mode 100644 index 000000000..b812fc447 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/rpc/ServiceRpcClient.java @@ -0,0 +1,13 @@ +package com.webank.wedatasphere.exchangis.datasource.core.service.rpc; + +/** + * Each remote client should implement this interface + */ +public interface ServiceRpcClient { + + default String getRemoteIp(){ + return "127.0.0.1"; + } + + C getClient(); +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/rpc/ServiceRpcDispatcher.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/rpc/ServiceRpcDispatcher.java new file mode 100644 index 000000000..e59c98def --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/rpc/ServiceRpcDispatcher.java @@ -0,0 +1,22 @@ +package com.webank.wedatasphere.exchangis.datasource.core.service.rpc; + +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisServiceRpcException; + +/** + * Dispatch the operation with remote client + */ +public interface ServiceRpcDispatcher, T extends ServiceOperation> { + + /** + * Dispatch entrance + * @param operation operation + */ + U dispatch(T operation) throws ExchangisServiceRpcException; + + U dispatch(C remoteClient, T operation) throws ExchangisServiceRpcException; + /** + * Get http client + * @return client + */ + C getDefaultRemoteClient(); +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/ElementUI.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/ElementUI.java new file mode 100644 index 000000000..5589218fd --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/ElementUI.java @@ -0,0 +1,51 @@ +package com.webank.wedatasphere.exchangis.datasource.core.ui; + +import java.util.Map; + +public interface ElementUI { + /** + * Type enum + */ + enum Type { + NONE, TEXTAREA, INPUT, OPTION, MAP + } + + /** + * Field name + * @return string + */ + String getField(); + + /** + * Label + * @return label string + */ + String getLabel(); + + /** + * Type name + * @return string + */ + String getType(); + + Integer getSort(); + + /** + * Value store + * @return + */ + T getValue(); + + /** + * Default value + * @return + */ + T getDefaultValue(); + + /** + * Get value from params + * @param params + * @return + */ + void setValue(Map params); +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/ExchangisDataSourceIdUI.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/ExchangisDataSourceIdUI.java new file mode 100644 index 000000000..817d51d45 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/ExchangisDataSourceIdUI.java @@ -0,0 +1,55 @@ +package com.webank.wedatasphere.exchangis.datasource.core.ui; + +// 任务数据源UI对象 +public class ExchangisDataSourceIdUI { + + private String type; + + private String id; + + private String ds; + + private String db; + + private String table; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getDs() { + return ds; + } + + public void setDs(String ds) { + this.ds = ds; + } + + public String getDb() { + return db; + } + + public void setDb(String db) { + this.db = db; + } + + public String getTable() { + return table; + } + + public void setTable(String table) { + this.table = table; + } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/ExchangisDataSourceIdsUI.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/ExchangisDataSourceIdsUI.java new file mode 100644 index 000000000..115005b1b --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/ExchangisDataSourceIdsUI.java @@ -0,0 +1,24 @@ +package com.webank.wedatasphere.exchangis.datasource.core.ui; + +public class ExchangisDataSourceIdsUI { + + private ExchangisDataSourceIdUI source; + + private ExchangisDataSourceIdUI sink; + + public ExchangisDataSourceIdUI getSource() { + return source; + } + + public void setSource(ExchangisDataSourceIdUI source) { + this.source = source; + } + + public ExchangisDataSourceIdUI getSink() { + return sink; + } + + public void setSink(ExchangisDataSourceIdUI sink) { + this.sink = sink; + } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/ExchangisDataSourceParamsUI.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/ExchangisDataSourceParamsUI.java new file mode 100644 index 000000000..71a2ca67d --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/ExchangisDataSourceParamsUI.java @@ -0,0 +1,36 @@ +package com.webank.wedatasphere.exchangis.datasource.core.ui; + +import java.util.Collections; +import java.util.List; + +public class ExchangisDataSourceParamsUI { + + private List> sources = Collections.emptyList(); + + private List> sinks = Collections.emptyList(); + + public List> getSources() { + return sources; + } + + public void setSources(List> sources) { + this.sources = sources; + } + + public List> getSinks() { + return sinks; + } + + public void setSinks(List> sinks) { + this.sinks = sinks; + } + + public void addSourceUI(ElementUI ui) { + this.sources.add(ui); + } + + public void addSinkUI(ElementUI ui) { + this.sinks.add(ui); + } + +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/InputElementUI.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/InputElementUI.java new file mode 100644 index 000000000..1c2585228 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/InputElementUI.java @@ -0,0 +1,124 @@ +package com.webank.wedatasphere.exchangis.datasource.core.ui; + +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; + +import java.util.Map; + +public class InputElementUI implements ElementUI { + private String key; + private String field; + private String label; + private Integer sort; + private String value; + private String defaultValue; + private String unit; + private Boolean required; + private String validateType; + private String validateRange; + private String validateMsg; + private String source; + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public void setField(String field) { + this.field = field; + } + + @Override + public String getField() { + return this.field; + } + + @Override + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + @Override + public String getType() { + return Type.INPUT.name(); + } + + @Override + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + @Override + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Override + public String getDefaultValue() { return defaultValue; } + + @Override + public void setValue(Map params) { + // Convert to json string directly + this.value = Json.toJson(params, null); + } + + public void setDefaultValue(String defaultValue) { this.defaultValue = defaultValue; } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public Boolean getRequired() { + return required; + } + + public void setRequired(Boolean required) { + this.required = required; + } + + public String getValidateType() { + return validateType; + } + + public void setValidateType(String validateType) { + this.validateType = validateType; + } + + public String getValidateRange() { + return validateRange; + } + + public void setValidateRange(String validateRange) { + this.validateRange = validateRange; + } + + public String getValidateMsg() { return validateMsg; } + + public void setValidateMsg(String validateMsg) { this.validateMsg = validateMsg; } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/MapElementUI.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/MapElementUI.java new file mode 100644 index 000000000..b8f5d8945 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/MapElementUI.java @@ -0,0 +1,125 @@ +package com.webank.wedatasphere.exchangis.datasource.core.ui; + +import org.apache.commons.lang.StringUtils; + +import java.util.Map; +import java.util.Objects; + +public class MapElementUI implements ElementUI> { + private String key; + private String field; + private String label; + private Integer sort; + private Map value; + private Map defaultValue; + private String unit; + private Boolean required; + private String validateType; + private String validateRange; + private String validateMsg; + private String source; + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public void setField(String field) { + this.field = field; + } + + @Override + public String getField() { + return this.field; + } + + @Override + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + @Override + public String getType() { + return Type.MAP.name(); + } + + @Override + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + @Override + public Map getValue() { + return value; + } + + + public void setValue(Map value) { + this.value = value; + } + + @Override + public Map getDefaultValue() { return defaultValue; } + + + public void setDefaultValue(Map defaultValue) { this.defaultValue = defaultValue; } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public Boolean getRequired() { + return required; + } + + public void setRequired(Boolean required) { + this.required = required; + } + + public String getValidateType() { + return validateType; + } + + public void setValidateType(String validateType) { + this.validateType = validateType; + } + + public String getValidateRange() { + return validateRange; + } + + public void setValidateRange(String validateRange) { + this.validateRange = validateRange; + } + + public String getValidateMsg() { return validateMsg; } + + public void setValidateMsg(String validateMsg) { this.validateMsg = validateMsg; } + + private boolean isBasicType(Class clz){ + return false; + } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/OptionElementUI.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/OptionElementUI.java new file mode 100644 index 000000000..93e2da083 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/OptionElementUI.java @@ -0,0 +1,99 @@ +package com.webank.wedatasphere.exchangis.datasource.core.ui; + +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; + +import java.util.Collection; +import java.util.Map; + +public class OptionElementUI implements ElementUI { + private String key; + private String field; + private String label; + private Collection values; + private String value; + private String defaultValue; + private Integer sort; + private String unit; + private Boolean required; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getField() { + return field; + } + + @Override + public String getType() { + return Type.OPTION.name(); + } + + public void setField(String field) { + this.field = field; + } + + @Override + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public Collection getValues() { + return values; + } + + public void setValues(Collection values) { + this.values = values; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Override + public String getDefaultValue() { return defaultValue; } + + @Override + public void setValue(Map params) { + this.value = Json.toJson(params.values(), null); + } + + public void setDefaultValue(String defaultValue) { this.defaultValue = defaultValue; } + + @Override + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public Boolean getRequired() { + return required; + } + + public void setRequired(Boolean required) { + this.required = required; + } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/builder/DefaultElementUIFactory.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/builder/DefaultElementUIFactory.java new file mode 100644 index 000000000..bc87979e2 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/builder/DefaultElementUIFactory.java @@ -0,0 +1,83 @@ +package com.webank.wedatasphere.exchangis.datasource.core.ui.builder; + +import com.webank.wedatasphere.exchangis.datasource.core.ui.ElementUI; +import com.webank.wedatasphere.exchangis.datasource.core.ui.InputElementUI; + +import java.lang.annotation.ElementType; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Function; + +/** + * Default element factory + */ +public class DefaultElementUIFactory implements ElementUIFactory{ + /** + * Element builders holder + */ + private Map>> builders = new HashMap<>(); + + + @Override + @SuppressWarnings("unchecked") + public void register(String type, Function> builder, Class inputType) { + builders.putIfAbsent(new Identify(type, inputType), (Function>) builder); + } + + @Override + @SuppressWarnings("unchecked") + public ElementUI createElement(String type, Object input, Class inputType) { + Identify identify = new Identify(type, inputType); + AtomicReference> elementUI = new AtomicReference<>(); + Optional.ofNullable(builders.get(identify)).ifPresent(builder -> { + elementUI.set((ElementUI) builder.apply(input)); + }); + return elementUI.get(); + } + + /** + * Identify for element builder + */ + private static class Identify{ + + /** + * Type + */ + private final String type; + + /** + * Input class + */ + private final Class inputClass; + + public Identify(String type, Class inputClass){ + this.type = type; + this.inputClass = inputClass; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Identify identify = (Identify) o; + return Objects.equals(type, identify.type) && Objects.equals(inputClass, identify.inputClass); + } + + @Override + public int hashCode() { + return Objects.hash(type, inputClass); + } + + @Override + public String toString() { + return "Identify{" + + "type='" + type + '\'' + + ", inputClass=" + inputClass.getCanonicalName() + + '}'; + } + } + +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/builder/ElementUIFactory.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/builder/ElementUIFactory.java new file mode 100644 index 000000000..62befc4dd --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/builder/ElementUIFactory.java @@ -0,0 +1,31 @@ +package com.webank.wedatasphere.exchangis.datasource.core.ui.builder; + +import com.webank.wedatasphere.exchangis.datasource.core.ui.ElementUI; + +import java.util.function.Function; + +/** + * Element factory + */ +public interface ElementUIFactory { + + /** + * Register the element builder + * @param type type + * @param builder builder + * @param inputType input type + * @param T + * @param R + */ + void register(String type, Function> builder, Class inputType); + + + /** + * Create element + * @param type type + * @param input input object + * @param element value type + * @return element + */ + ElementUI createElement(String type, Object input, Class inputType); +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/builder/SpringElementUIFactory.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/builder/SpringElementUIFactory.java new file mode 100644 index 000000000..15872ea3f --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/builder/SpringElementUIFactory.java @@ -0,0 +1,49 @@ +package com.webank.wedatasphere.exchangis.datasource.core.ui.builder; + +import com.webank.wedatasphere.exchangis.datasource.core.ui.ElementUI; +import com.webank.wedatasphere.exchangis.datasource.core.ui.InputElementUI; +import com.webank.wedatasphere.exchangis.datasource.core.ui.MapElementUI; +import com.webank.wedatasphere.exchangis.datasource.core.ui.OptionElementUI; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; + +/** + * Default element factory in spring + */ +@Component +public class SpringElementUIFactory extends DefaultElementUIFactory{ + + @PostConstruct + public void init(){ + super.register(ElementUI.Type.MAP.name(), (Function, MapElementUI>) params -> + setElementValue(new MapElementUI(), params), Map.class); + super.register(ElementUI.Type.INPUT.name(), (Function, InputElementUI>) params -> + setElementValue(new InputElementUI(), params), Map.class); + super.register(ElementUI.Type.OPTION.name(), (Function, OptionElementUI>) params -> + setElementValue(new OptionElementUI(), params), Map.class); + } + + /** + * Set the params into element and return + * @param element element + * @param params params Map + * @param R + * @return + */ + private >R setElementValue(R element, Map params){ + element.setValue(params); + return element; + } + + public static void main(String[] args){ + SpringElementUIFactory elementUIFactory = new SpringElementUIFactory(); + elementUIFactory.init(); + Map map = new HashMap<>(); + map.putIfAbsent("hello", "world"); + System.out.println(elementUIFactory.createElement(ElementUI.Type.MAP.name(), map, Map.class).getValue()); + } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/viewer/DefaultDataSourceUIViewer.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/viewer/DefaultDataSourceUIViewer.java new file mode 100644 index 000000000..f3394ad3a --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/viewer/DefaultDataSourceUIViewer.java @@ -0,0 +1,52 @@ +package com.webank.wedatasphere.exchangis.datasource.core.ui.viewer; + +import com.webank.wedatasphere.exchangis.datasource.core.ui.*; +import com.webank.wedatasphere.exchangis.datasource.core.vo.ExchangisJobTransformsContent; + +import java.util.List; + +public class DefaultDataSourceUIViewer implements ExchangisDataSourceUIViewer { + private String subJobName; + private final ExchangisDataSourceIdsUI dataSourceIds; + private final ExchangisDataSourceParamsUI params; +// private final ExchangisDataSourceTransformsUI transforms; + private final ExchangisJobTransformsContent transforms; + private final List> settings; + + public DefaultDataSourceUIViewer(String subJobName, ExchangisDataSourceIdsUI dataSourceIds, ExchangisDataSourceParamsUI params, ExchangisJobTransformsContent transforms, List> settings) { + this.subJobName = subJobName; + this.dataSourceIds = dataSourceIds; + this.params = params; + this.transforms = transforms; + this.settings = settings; + } + + @Override + public String getSubJobName() { + return subJobName; + } + + public void setSubJobName(String subJobName) { + this.subJobName = subJobName; + } + + @Override + public ExchangisDataSourceIdsUI getDataSourceIds() { + return this.dataSourceIds; + } + + @Override + public ExchangisDataSourceParamsUI getParams() { + return this.params; + } + + @Override + public ExchangisJobTransformsContent getTransforms() { + return this.transforms; + } + + @Override + public List> getSettings() { + return this.settings; + } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/viewer/ExchangisDataSourceUIViewer.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/viewer/ExchangisDataSourceUIViewer.java new file mode 100644 index 000000000..95dd61ad0 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/viewer/ExchangisDataSourceUIViewer.java @@ -0,0 +1,18 @@ +package com.webank.wedatasphere.exchangis.datasource.core.ui.viewer; + +import com.webank.wedatasphere.exchangis.datasource.core.ui.*; +import com.webank.wedatasphere.exchangis.datasource.core.vo.ExchangisJobTransformsContent; + +import java.util.List; + +public interface ExchangisDataSourceUIViewer { + String getSubJobName(); + + ExchangisDataSourceIdsUI getDataSourceIds(); + + ExchangisDataSourceParamsUI getParams(); + + ExchangisJobTransformsContent getTransforms(); + + List> getSettings(); +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/utils/Json.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/utils/Json.java new file mode 100644 index 000000000..a59822cec --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/utils/Json.java @@ -0,0 +1,124 @@ +package com.webank.wedatasphere.exchangis.datasource.core.utils; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.*; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Json { + public static final String PREFIX = "["; + public static final String SUFFIX = "]"; + + private static final ObjectMapper mapper; + + public static Logger logger = LoggerFactory.getLogger(Json.class); + static { + mapper = new ObjectMapper(); + //Custom the feature of serialization and deserialization + mapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true); + mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true); + mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true); + //Enum + mapper.configure(DeserializationFeature.READ_ENUMS_USING_TO_STRING, true); + mapper.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true); +// mapper.configure(JsonReadFeature.ALLOW_UNESCAPED_CONTROL_CHARS.mappedFeature(), true); + //Empty beans allowed + mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); + //Ignore unknown properties + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + //Cancel to scape no ascii +// mapper.configure(JsonWriteFeature.ESCAPE_NON_ASCII.mappedFeature(), false); + } + + public static ObjectMapper getMapper(){ + return mapper; + } + /** + * Generate json string + * + * @param simpleObj object + * @param viewModel model + * @return string + */ + public static String toJson(Object simpleObj, Class viewModel) { + ObjectWriter writer = mapper.writer(); + if (null != simpleObj) { + try { + if (null != viewModel) { + writer = writer.withView(viewModel); + } + return writer.writeValueAsString(simpleObj); + } catch (JsonProcessingException e) { + logger.warn("Fail to process method 'toJson(" + simpleObj + ": " + simpleObj.getClass() + + ", " + (viewModel != null ? viewModel.getSimpleName() : null) + ")'", e); + return null; + } + } + return null; + } + + @SuppressWarnings("unchecked") + public static T fromJson(String json, Class tClass, Class... parameters) { + if (StringUtils.isNotBlank(json)) { + try { + if (parameters.length > 0) { + return (T) mapper.readValue(json, mapper.getTypeFactory().constructParametricType(tClass, parameters)); + } + return (T) mapper.readValue(json, tClass); + } catch (Exception e) { + logger.warn("Fail to process method 'fromJson(" + + (json.length() > 5 ? json.substring(0, 5) + "..." : json) + ": " + json.getClass() + + ", " + tClass.getSimpleName() + ": "+ Class.class + ", ...: " + Class.class + ")", e); + return null; + } + } + return null; + } + + public static T fromJson(String json, JavaType javaType) { + if(StringUtils.isNotBlank(json)){ + try{ + return mapper.readValue(json, javaType); + }catch (Exception e){ + logger.warn("Fail to process method 'fromJson(" + + (json.length() > 5 ? json.substring(0, 5) + "..." : json) + ": " + json.getClass() + + ", " + javaType.getTypeName() + ": "+ JavaType.class + ")", e); + return null; + } + } + return null; + } + /** + * Convert object using serialization and deserialization + * + * @param simpleObj simpleObj + * @param tClass type class + * @param T + * @return result + */ + @SuppressWarnings("unchecked") + public static T convert(Object simpleObj, Class tClass, Class... parameters) { + try { + if (parameters.length > 0) { + return mapper.convertValue(simpleObj, mapper.getTypeFactory().constructParametricType(tClass, parameters)); + } + return (T) mapper.convertValue(simpleObj, tClass); + } catch (Exception e) { + logger.warn("Fail to process method 'convert(" + simpleObj + ": " + simpleObj.getClass().getSimpleName() + + ", " + tClass.getSimpleName() + ": "+ Class.class + ", ...: " + Class.class + ")", e); + return null; + } + } + + public static T convert(Object simpleObj, JavaType javaType){ + try { + return mapper.convertValue(simpleObj, javaType); + } catch (Exception e) { + logger.warn("Fail to process method 'convert(" + simpleObj + ": " + simpleObj.getClass().getSimpleName() + + ", " + javaType.getTypeName() + ": "+ JavaType.class + ")", e); + return null; + } + } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobDataSourcesContent.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobDataSourcesContent.java new file mode 100644 index 000000000..fc1618318 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobDataSourcesContent.java @@ -0,0 +1,30 @@ +package com.webank.wedatasphere.exchangis.datasource.core.vo; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ExchangisJobDataSourcesContent { + + // 唯一标识符 + // HIVE.ID.DB.TABLE + @JsonProperty("source_id") + private String sourceId; + + @JsonProperty("sink_id") + private String sinkId; + + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public String getSinkId() { + return sinkId; + } + + public void setSinkId(String sinkId) { + this.sinkId = sinkId; + } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobInfoContent.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobInfoContent.java new file mode 100644 index 000000000..25ef70e09 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobInfoContent.java @@ -0,0 +1,70 @@ +package com.webank.wedatasphere.exchangis.datasource.core.vo; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class ExchangisJobInfoContent { + + private String engine; + + private String subJobName; + + private ExchangisJobDataSourcesContent dataSources; + + private ExchangisJobParamsContent params; + +// private List transforms; + private ExchangisJobTransformsContent transforms; + + private List settings; + + public String getEngine() { + return engine; + } + + public void setEngine(String engine) { + this.engine = engine; + } + + public ExchangisJobDataSourcesContent getDataSources() { + return dataSources; + } + + public void setDataSources(ExchangisJobDataSourcesContent dataSources) { + this.dataSources = dataSources; + } + + public ExchangisJobParamsContent getParams() { + return params; + } + + public void setParams(ExchangisJobParamsContent params) { + this.params = params; + } + + public ExchangisJobTransformsContent getTransforms() { + return transforms; + } + + public void setTransforms(ExchangisJobTransformsContent transforms) { + this.transforms = transforms; + } + + public List getSettings() { + return settings; + } + + public void setSettings(List settings) { + this.settings = settings; + } + + public String getSubJobName() { + return subJobName; + } + + public void setSubJobName(String subJobName) { + this.subJobName = subJobName; + } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobParamsContent.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobParamsContent.java new file mode 100644 index 000000000..ef8dbcb57 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobParamsContent.java @@ -0,0 +1,73 @@ +package com.webank.wedatasphere.exchangis.datasource.core.vo; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class ExchangisJobParamsContent { + + private List sources; + private List sinks; + + public List getSources() { + return sources; + } + + public void setSources(List sources) { + this.sources = sources; + } + + public List getSinks() { + return sinks; + } + + public void setSinks(List sinks) { + this.sinks = sinks; + } + + public static class ExchangisJobParamsItem { + @JsonProperty("config_key") + private String configKey; + + @JsonProperty("config_name") + private String configName; + + @JsonProperty("config_value") + private Object configValue; + + private Integer sort; + + public String getConfigKey() { + return configKey; + } + + public void setConfigKey(String configKey) { + this.configKey = configKey; + } + + public String getConfigName() { + return configName; + } + + public void setConfigName(String configName) { + this.configName = configName; + } + + public Object getConfigValue() { + return configValue; + } + + public void setConfigValue(Object configValue) { + this.configValue = configValue; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + } + +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobTransformer.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobTransformer.java new file mode 100644 index 000000000..ee8961e51 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobTransformer.java @@ -0,0 +1,26 @@ +package com.webank.wedatasphere.exchangis.datasource.core.vo; + +import java.util.List; + +public class ExchangisJobTransformer { + + private String name; + + private List params; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List getParams() { + return params; + } + + public void setParams(List params) { + this.params = params; + } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobTransformsContent.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobTransformsContent.java new file mode 100644 index 000000000..c19df0838 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobTransformsContent.java @@ -0,0 +1,42 @@ +package com.webank.wedatasphere.exchangis.datasource.core.vo; + +import java.util.List; + +public class ExchangisJobTransformsContent { + private boolean addEnable; + private String type; + private String sql; + private List mapping; + + public boolean isAddEnable() { + return addEnable; + } + + public void setAddEnable(boolean addEnable) { + this.addEnable = addEnable; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getSql() { + return sql; + } + + public void setSql(String sql) { + this.sql = sql; + } + + public List getMapping() { + return mapping; + } + + public void setMapping(List mapping) { + this.mapping = mapping; + } +} diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobTransformsItem.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobTransformsItem.java new file mode 100644 index 000000000..d0ae8ede0 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/vo/ExchangisJobTransformsItem.java @@ -0,0 +1,122 @@ +package com.webank.wedatasphere.exchangis.datasource.core.vo; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ExchangisJobTransformsItem { + @JsonProperty("source_field_name") + private String sourceFieldName; + @JsonProperty("source_field_type") + private String sourceFieldType; + @JsonProperty("sink_field_name") + private String sinkFieldName; + @JsonProperty("sink_field_type") + private String sinkFieldType; + @JsonProperty("deleteEnable") + private boolean deleteEnable; + + @JsonProperty("source_field_index") + private Integer sourceFieldIndex; + + @JsonProperty("sink_field_index") + private Integer sinkFieldIndex; + + @JsonProperty("source_field_editable") + private boolean sourceFieldEditable; + + @JsonProperty("sink_field_editable") + private boolean sinkFieldEditable; + + private List validator; + + private ExchangisJobTransformer transformer; + + public String getSourceFieldName() { + return sourceFieldName; + } + + public void setSourceFieldName(String sourceFieldName) { + this.sourceFieldName = sourceFieldName; + } + + public String getSourceFieldType() { + return sourceFieldType; + } + + public void setSourceFieldType(String sourceFieldType) { + this.sourceFieldType = sourceFieldType; + } + + public String getSinkFieldName() { + return sinkFieldName; + } + + public void setSinkFieldName(String sinkFieldName) { + this.sinkFieldName = sinkFieldName; + } + + public String getSinkFieldType() { + return sinkFieldType; + } + + public void setSinkFieldType(String sinkFieldType) { + this.sinkFieldType = sinkFieldType; + } + + public List getValidator() { + return validator; + } + + public void setValidator(List validator) { + this.validator = validator; + } + + public ExchangisJobTransformer getTransformer() { + return transformer; + } + + public void setTransformer(ExchangisJobTransformer transformer) { + this.transformer = transformer; + } + + public Integer getSourceFieldIndex() { + return sourceFieldIndex; + } + + public void setSourceFieldIndex(Integer sourceFieldIndex) { + this.sourceFieldIndex = sourceFieldIndex; + } + + public Integer getSinkFieldIndex() { + return sinkFieldIndex; + } + + public void setSinkFieldIndex(Integer sinkFieldIndex) { + this.sinkFieldIndex = sinkFieldIndex; + } + + public boolean isDeleteEnable() { + return deleteEnable; + } + + public void setDeleteEnable(boolean deleteEnable) { + this.deleteEnable = deleteEnable; + } + + public boolean isSourceFieldEditable() { + return sourceFieldEditable; + } + + public void setSourceFieldEditable(boolean sourceFieldEditable) { + this.sourceFieldEditable = sourceFieldEditable; + } + + public boolean isSinkFieldEditable() { + return sinkFieldEditable; + } + + public void setSinkFieldEditable(boolean sinkFieldEditable) { + this.sinkFieldEditable = sinkFieldEditable; + } +} diff --git a/exchangis-datasource/exchangis-datasource-linkis/pom.xml b/exchangis-datasource/exchangis-datasource-linkis/pom.xml new file mode 100644 index 000000000..5a5881d16 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-linkis/pom.xml @@ -0,0 +1,44 @@ + + + + exchangis-datasource + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-datasource-linkis + + + 8 + 8 + + + + + com.webank.wedatasphere.exchangis + exchangis-datasource-core + 1.0.0-RC1 + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + net.alchim31.maven + scala-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + \ No newline at end of file diff --git a/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/ExchangisBatchDataSource.java b/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/ExchangisBatchDataSource.java new file mode 100644 index 000000000..38058e58c --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/ExchangisBatchDataSource.java @@ -0,0 +1,65 @@ +package com.webank.wedatasphere.exchangis.datasource.linkis; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.webank.wedatasphere.exchangis.dao.domain.ExchangisJobParamConfig; +import com.webank.wedatasphere.exchangis.dao.hook.MapperHook; +import com.webank.wedatasphere.exchangis.dao.mapper.ExchangisJobParamConfigMapper; +import com.webank.wedatasphere.exchangis.datasource.core.ExchangisDataSource; +import org.apache.linkis.datasource.client.impl.LinkisDataSourceRemoteClient; +import org.apache.linkis.datasource.client.impl.LinkisMetaDataRemoteClient; +import org.apache.linkis.datasourcemanager.common.domain.DataSourceType; + +import java.util.List; + +public abstract class ExchangisBatchDataSource implements ExchangisDataSource { + + protected MapperHook mapperHook; + protected String id; + + @Override + public void setMapperHook(MapperHook mapperHook) { + this.mapperHook = mapperHook; + } + + protected List getDataSourceParamConfigs(String type) { + ExchangisJobParamConfigMapper exchangisJobParamConfigMapper = this.mapperHook.getExchangisJobParamConfigMapper(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("type", type); + queryWrapper.eq("is_hidden", 0); + queryWrapper.eq("status", 1); + return exchangisJobParamConfigMapper.selectList(queryWrapper); + } + + protected List getDataSourceParamConfigs(String type, String dir) { + ExchangisJobParamConfigMapper exchangisJobParamConfigMapper = this.mapperHook.getExchangisJobParamConfigMapper(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("config_direction", dir); + queryWrapper.eq("type", type); + queryWrapper.eq("is_hidden", 0); + queryWrapper.eq("status", 1); + return exchangisJobParamConfigMapper.selectList(queryWrapper); + } + + @Override + public LinkisDataSourceRemoteClient getDataSourceRemoteClient() { + return ExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); + } + + @Override + public LinkisMetaDataRemoteClient getMetaDataRemoteClient() { + return ExchangisLinkisRemoteClient.getLinkisMetadataRemoteClient(); + } + + @Override + public String id() { + if (null == id || id.equalsIgnoreCase("")) { + List types = getDataSourceTypes("hdfs"); + for (DataSourceType type : types) { + if (type.getName().equalsIgnoreCase(name())) { + this.id = type.getId(); + } + } + } + return this.id; + } +} diff --git a/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/ExchangisDataSourceConfiguration.java b/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/ExchangisDataSourceConfiguration.java new file mode 100644 index 000000000..ad2e1deab --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/ExchangisDataSourceConfiguration.java @@ -0,0 +1,19 @@ +package com.webank.wedatasphere.exchangis.datasource.linkis; + + +import org.apache.linkis.common.conf.CommonVars; + +public class ExchangisDataSourceConfiguration { + public static final CommonVars SERVER_URL = CommonVars.apply("wds.exchangis.datasource.client.serverurl", ""); + public static final CommonVars CONNECTION_TIMEOUT = CommonVars.apply("wds.exchangis.datasource.client.connection.timeout", 30000L); + public static final CommonVars DISCOVERY_ENABLED = CommonVars.apply("wds.exchangis.datasource.client.discovery.enabled", false); + public static final CommonVars DISCOVERY_FREQUENCY_PERIOD = CommonVars.apply("wds.exchangis.datasource.client.discoveryfrequency.period", 1L); + public static final CommonVars LOAD_BALANCER_ENABLED = CommonVars.apply("wds.exchangis.datasource.client.loadbalancer.enabled", true); + public static final CommonVars MAX_CONNECTION_SIZE = CommonVars.apply("wds.exchangis.datasource.client.maxconnection.size", 5); + public static final CommonVars RETRY_ENABLED = CommonVars.apply("wds.exchangis.datasource.client.retryenabled", false); + public static final CommonVars READ_TIMEOUT = CommonVars.apply("wds.exchangis.datasource.client.readtimeout", 30000L); + + public static final CommonVars AUTHTOKEN_KEY = CommonVars.apply("wds.exchangis.datasource.client.authtoken.key", ""); + public static final CommonVars AUTHTOKEN_VALUE = CommonVars.apply("wds.exchangis.datasource.client.authtoken.value", ""); + public static final CommonVars DWS_VERSION = CommonVars.apply("wds.exchangis.datasource.client.dws.version", ""); +} diff --git a/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/service/LinkisDataSourceInfoService.java b/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/service/LinkisDataSourceInfoService.java new file mode 100644 index 000000000..e11bff3b6 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/service/LinkisDataSourceInfoService.java @@ -0,0 +1,32 @@ +/* + Copyright 2022 WeBank + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + +package com.webank.wedatasphere.exchangis.datasource.linkis.service; + +import com.webank.wedatasphere.exchangis.datasource.core.service.DataSourceInfoService; +import com.webank.wedatasphere.exchangis.datasource.core.service.rpc.ServiceRpcClient; +import com.webank.wedatasphere.exchangis.datasource.linkis.ExchangisLinkisRemoteClient; +import com.webank.wedatasphere.exchangis.datasource.linkis.service.rpc.LinkisDataSourceServiceRpcDispatcher; +import org.apache.linkis.datasource.client.impl.LinkisDataSourceRemoteClient; + +public class LinkisDataSourceInfoService extends LinkisDataSourceServiceRpcDispatcher implements DataSourceInfoService { + @Override + public ServiceRpcClient getDefaultRemoteClient() { + return ExchangisLinkisRemoteClient::getLinkisDataSourceRemoteClient; + } + +} diff --git a/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/service/LinkisMetadataInfoService.java b/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/service/LinkisMetadataInfoService.java new file mode 100644 index 000000000..610e063ba --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/service/LinkisMetadataInfoService.java @@ -0,0 +1,102 @@ +package com.webank.wedatasphere.exchangis.datasource.linkis.service; + +import com.webank.wedatasphere.exchangis.datasource.core.domain.MetaColumn; +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisDataSourceException; +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisServiceRpcException; +import com.webank.wedatasphere.exchangis.datasource.core.service.MetadataInfoService; +import com.webank.wedatasphere.exchangis.datasource.core.service.rpc.ServiceRpcClient; +import com.webank.wedatasphere.exchangis.datasource.linkis.ExchangisLinkisRemoteClient; +//import com.webank.wedatasphere.exchangis.datasource.linkis.partition.MetadataGetPartitionsResult; +import com.webank.wedatasphere.exchangis.datasource.linkis.request.MetadataGetPartitionPropsAction; +import com.webank.wedatasphere.exchangis.datasource.linkis.response.MetadataGetPartitionPropsResult; +import com.webank.wedatasphere.exchangis.datasource.linkis.service.rpc.LinkisDataSourceServiceOperation; +import com.webank.wedatasphere.exchangis.datasource.linkis.service.rpc.LinkisDataSourceServiceRpcDispatcher; +import org.apache.linkis.datasource.client.impl.LinkisMetaDataRemoteClient; +import org.apache.linkis.datasource.client.request.MetadataGetColumnsAction; +import org.apache.linkis.datasource.client.request.MetadataGetPartitionsAction; +import org.apache.linkis.datasource.client.request.MetadataGetTablePropsAction; +import org.apache.linkis.datasource.client.response.MetadataGetColumnsResult; +import org.apache.linkis.datasource.client.response.MetadataGetPartitionsResult; +import org.apache.linkis.datasource.client.response.MetadataGetTablePropsResult; +import org.apache.linkis.metadatamanager.common.domain.MetaColumnInfo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import static com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisDataSourceExceptionCode.*; + +/** + * Linkis to fetch metadata info + */ +public class LinkisMetadataInfoService extends LinkisDataSourceServiceRpcDispatcher + implements MetadataInfoService { + + @Override + public Class getClientClass() { + return LinkisMetaDataRemoteClient.class; + } + + @Override + public ServiceRpcClient getDefaultRemoteClient() { + return ExchangisLinkisRemoteClient::getLinkisMetadataRemoteClient; + } + + @Override + public Map getPartitionProps(String userName, Long dataSourceId, + String database, String table, String partition) throws ExchangisDataSourceException { + return getPartitionProps(getDefaultRemoteClient(), userName, dataSourceId, database, table, partition); + } + + @Override + @SuppressWarnings("unchecked") + public Map getPartitionProps(ServiceRpcClient rpcClient, + String userName, Long dataSourceId, + String database, String table, String partition) throws ExchangisDataSourceException { + MetadataGetPartitionPropsResult result = dispatch((ServiceRpcClient) rpcClient, new LinkisDataSourceServiceOperation(() -> { + MetadataGetPartitionPropsAction action = new MetadataGetPartitionPropsAction(dataSourceId, + database, table, partition, LINKIS_RPC_CLIENT_SYSTEM.getValue()); + action.setUser(userName); + return action; + }), CLIENT_METADATA_GET_PARTITION_PROPS.getCode(), "getPartitionProps"); + return result.props(); + } + + @Override + public Map getTableProps(String userName, Long dataSourceId, String database, String table) throws ExchangisDataSourceException { + return getTableProps(getDefaultRemoteClient(), userName, dataSourceId, database, table); + } + + @Override + @SuppressWarnings("unchecked") + public Map getTableProps(ServiceRpcClient rpcClient, String userName, Long dataSourceId, String database, String table) throws ExchangisDataSourceException { + MetadataGetTablePropsResult result = dispatch((ServiceRpcClient) rpcClient, new LinkisDataSourceServiceOperation(() -> MetadataGetTablePropsAction.builder() + .setDataSourceId(dataSourceId).setDatabase(database).setTable(table) + .setUser(userName).setSystem(LINKIS_RPC_CLIENT_SYSTEM.getValue()).build()), CLIENT_METADATA_GET_TABLES_ERROR.getCode(), "getTableProps"); + return result.props(); +} + + @Override + public List getPartitionKeys(String userName, Long dataSourceId, String database, String table) throws ExchangisDataSourceException { + MetadataGetPartitionsResult result = dispatch(getDefaultRemoteClient(), new LinkisDataSourceServiceOperation(() -> MetadataGetPartitionsAction.builder() + .setDataSourceId(dataSourceId).setDatabase(database).setTable(table) + .setUser(userName).setSystem(LINKIS_RPC_CLIENT_SYSTEM.getValue()).build()), CLIENT_METADATA_GET_PARTITION.getCode(), "getPartitionKeys"); + return result.getPartitionInfo().getPartKeys(); + } + + @Override + public List getColumns(String userName, Long dataSourceId, String database, String table) throws ExchangisDataSourceException { + MetadataGetColumnsResult result = dispatch(getDefaultRemoteClient(), new LinkisDataSourceServiceOperation(() -> MetadataGetColumnsAction.builder() + .setSystem(LINKIS_RPC_CLIENT_SYSTEM.getValue()) + .setDataSourceId(dataSourceId).setDatabase(database).setTable(table) + .setUser(userName).build()),CLIENT_METADATA_GET_PARTITION.getCode(), "getColumns"); + List columnInfoList = result.getAllColumns(); + List columns = new ArrayList<>(); + Optional.ofNullable(columnInfoList).ifPresent(infoList -> infoList.forEach(info -> + columns.add(new MetaColumn(info.getIndex(), info.getName(), info.getType(), info.isPrimaryKey())))); + return columns; + } + + +} diff --git a/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/service/rpc/LinkisDataSourceServiceOperation.java b/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/service/rpc/LinkisDataSourceServiceOperation.java new file mode 100644 index 000000000..d98928005 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/service/rpc/LinkisDataSourceServiceOperation.java @@ -0,0 +1,33 @@ +package com.webank.wedatasphere.exchangis.datasource.linkis.service.rpc; + +import com.webank.wedatasphere.exchangis.datasource.core.service.rpc.ServiceOperation; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.httpclient.dws.request.DWSHttpAction; +import org.apache.linkis.httpclient.request.Action; + +import java.util.Objects; +import java.util.function.Supplier; + +/** + * Operation contains request action + */ +public class LinkisDataSourceServiceOperation extends ServiceOperation { + + /** + * Action + */ + private Action requestAction; + + public LinkisDataSourceServiceOperation(Supplier actionBuilder){ + if (Objects.nonNull(actionBuilder)){ + requestAction = actionBuilder.get(); + if (requestAction instanceof DWSHttpAction){ + this.uri = (StringUtils.join(((DWSHttpAction) requestAction).suffixURLs(), "/")); + } + } + } + + public Action getRequestAction() { + return requestAction; + } +} diff --git a/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/service/rpc/LinkisDataSourceServiceRpcDispatcher.java b/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/service/rpc/LinkisDataSourceServiceRpcDispatcher.java new file mode 100644 index 000000000..9ecf2402d --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-linkis/src/main/java/com/webank/wedatasphere/exchangis/datasource/linkis/service/rpc/LinkisDataSourceServiceRpcDispatcher.java @@ -0,0 +1,58 @@ +package com.webank.wedatasphere.exchangis.datasource.linkis.service.rpc; + +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisDataSourceException; +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisServiceRpcException; +import com.webank.wedatasphere.exchangis.datasource.core.service.rpc.AbstractServiceRpcDispatcher; +import com.webank.wedatasphere.exchangis.datasource.core.service.rpc.ServiceRpcClient; +import org.apache.linkis.common.conf.CommonVars; +import org.apache.linkis.datasource.client.RemoteClient; +import org.apache.linkis.datasource.client.impl.LinkisMetaDataRemoteClient; +import org.apache.linkis.httpclient.dws.response.DWSResult; +import org.apache.linkis.httpclient.request.Action; +import org.apache.linkis.httpclient.response.Result; + +import java.util.Objects; + +public class LinkisDataSourceServiceRpcDispatcher extends + AbstractServiceRpcDispatcher, LinkisDataSourceServiceOperation> { + + public static final CommonVars LINKIS_RPC_CLIENT_SYSTEM = CommonVars.apply("wds.exchangis.datasource.linkis.client.system", "exchangis"); + @Override + @SuppressWarnings("unchecked") + protected U execute(ServiceRpcClient remoteClient, LinkisDataSourceServiceOperation operation) throws ExchangisServiceRpcException { + Action action = operation.getRequestAction(); + try { + Result result = remoteClient.getClient().execute(action); + if (Objects.isNull(result)){ + throw new ExchangisServiceRpcException("The return of client is empty, operation: [" + operation.getUri() + "]", null); + } + if (result instanceof DWSResult && ((DWSResult) result).getStatus() != 0){ + throw new ExchangisServiceRpcException("The status of result from client is: [" + + ((DWSResult) result).getStatus() + "], operation: [" + operation.getUri() + "]", null); + } + return (U)result; + }catch(ClassCastException e){ + throw new ExchangisServiceRpcException("The return of dispatcher should be suitable Result type", e); + } + } + + /** + * Dispatch with error resolver + * @param rpcClient rpc client + * @param operation operation + * @param errorCode error code + * @param method method + * @param return type + * @return + * @throws ExchangisDataSourceException + */ + protected R dispatch(ServiceRpcClient rpcClient, LinkisDataSourceServiceOperation operation, + int errorCode, String method) + throws ExchangisDataSourceException { + try{ + return dispatch(rpcClient, operation); + } catch (ExchangisServiceRpcException e){ + throw new ExchangisDataSourceException(errorCode, "Fail to invoke operation: [method: " + method + ", uri:" + operation.getUri() +"], reason: " + e.getMessage(), e); + } + } +} diff --git a/exchangis-datasource/exchangis-datasource-linkis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/linkis/ExchangisLinkisRemoteClient.scala b/exchangis-datasource/exchangis-datasource-linkis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/linkis/ExchangisLinkisRemoteClient.scala new file mode 100644 index 000000000..7c25d8728 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-linkis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/linkis/ExchangisLinkisRemoteClient.scala @@ -0,0 +1,175 @@ +package com.webank.wedatasphere.exchangis.datasource.linkis + +import org.apache.linkis.datasource.client.impl.{LinkisDataSourceRemoteClient, LinkisMetaDataRemoteClient} +import org.apache.linkis.datasource.client.request._ +import org.apache.linkis.datasource.client.response._ +import org.apache.linkis.datasourcemanager.common.domain.{DataSource, DataSourceType} +import org.apache.linkis.httpclient.dws.authentication.{StaticAuthenticationStrategy, TokenAuthenticationStrategy} +import org.apache.linkis.httpclient.dws.config.{DWSClientConfig, DWSClientConfigBuilder} + +import java.lang +import java.util.concurrent.TimeUnit + +object ExchangisLinkisRemoteClient { + //Linkis Datasource Client Config + val serverUrl: String = ExchangisDataSourceConfiguration.SERVER_URL.getValue + val connectionTimeout: lang.Long = ExchangisDataSourceConfiguration.CONNECTION_TIMEOUT.getValue + val discoveryEnabled: lang.Boolean = ExchangisDataSourceConfiguration.DISCOVERY_ENABLED.getValue + val discoveryFrequencyPeriod: lang.Long = ExchangisDataSourceConfiguration.DISCOVERY_FREQUENCY_PERIOD.getValue + val loadbalancerEnabled: lang.Boolean = ExchangisDataSourceConfiguration.LOAD_BALANCER_ENABLED.getValue + val maxConnectionSize: Integer = ExchangisDataSourceConfiguration.MAX_CONNECTION_SIZE.getValue + val retryEnabled: lang.Boolean = ExchangisDataSourceConfiguration.RETRY_ENABLED.getValue + val readTimeout: lang.Long = ExchangisDataSourceConfiguration.READ_TIMEOUT.getValue + val authTokenKey: String = ExchangisDataSourceConfiguration.AUTHTOKEN_KEY.getValue + val authTokenValue: String = ExchangisDataSourceConfiguration.AUTHTOKEN_VALUE.getValue + val dwsVersion: String = ExchangisDataSourceConfiguration.DWS_VERSION.getValue + + + // val clientConfig = DWSClientConfigBuilder.newBuilder() + // .addServerUrl(serverUrl) + // .connectionTimeout(connectionTimeout) + // .discoveryEnabled(discoveryEnabled) + // .discoveryFrequency(1,TimeUnit.MINUTES) + // .loadbalancerEnabled(loadbalancerEnabled) + // .maxConnectionSize(maxConnectionSize) + // .retryEnabled(retryEnabled) + // .readTimeout(readTimeout) + // .setAuthenticationStrategy(new StaticAuthenticationStrategy()) + // .setAuthTokenKey(authTokenKey) + // .setAuthTokenValue(authTokenValue) + // .setDWSVersion(dwsVersion) + // .build() + + val clientConfig: DWSClientConfig = DWSClientConfigBuilder.newBuilder() + .addServerUrl(serverUrl) + .connectionTimeout(connectionTimeout) + .discoveryEnabled(discoveryEnabled) + .discoveryFrequency(discoveryFrequencyPeriod, TimeUnit.MINUTES) + .loadbalancerEnabled(loadbalancerEnabled) + .maxConnectionSize(maxConnectionSize) + .retryEnabled(retryEnabled) + .readTimeout(readTimeout) + .setAuthenticationStrategy(new TokenAuthenticationStrategy()) + .setAuthTokenKey(authTokenKey) + .setAuthTokenValue(authTokenValue) + .setDWSVersion(dwsVersion) + .build() + + val dataSourceClient = new LinkisDataSourceRemoteClient(clientConfig) + + val metaDataClient = new LinkisMetaDataRemoteClient(clientConfig) + + def getLinkisDataSourceRemoteClient: LinkisDataSourceRemoteClient = { + dataSourceClient + } + + def getLinkisMetadataRemoteClient: LinkisMetaDataRemoteClient = { + metaDataClient + } + + def close(): Unit = { + dataSourceClient.close() + metaDataClient.close() + } + + def queryDataSource(linkisDatasourceName: String): QueryDataSourceResult = { + dataSourceClient.queryDataSource(QueryDataSourceAction.builder() + .setSystem("") + .setName(linkisDatasourceName) + .setTypeId(1) + .setIdentifies("") + .setCurrentPage(1) + .setUser("hadoop") + .setPageSize(1).build() + ) + } + +// def createDataSource() = { +// dataSourceClient.execute().asInstanceOf[] +// } + + /** + * get datasourceConnect information + * + * @param dataSourceId id + * @param system dssSystem + * @param user username + * @return + */ + def queryConnectParams(dataSourceId: Long, system: String, user: String): GetConnectParamsByDataSourceIdResult = { + dataSourceClient.getConnectParams(GetConnectParamsByDataSourceIdAction.builder() + .setDataSourceId(dataSourceId) + .setSystem(system) + .setUser(user) + .build() + ) + } + + /** + * get all DataSourceTypes + * + * @param user user + * @return + */ + def queryDataSourceTypes(user: String): java.util.List[DataSourceType] = { + dataSourceClient.getAllDataSourceTypes(GetAllDataSourceTypesAction.builder() + .setUser(user) + .build() + ).getAllDataSourceType + } + + + def queryClusterByDataSourceType(system: String, name: String, typeId: Long, user: String): java.util.List[DataSource] = { + dataSourceClient.queryDataSource(QueryDataSourceAction.builder() + .setSystem(system) + .setName(name) + .setTypeId(typeId) + .setIdentifies("") + .setCurrentPage(1) + .setPageSize(10) + .setUser(user) + .build() + ).getAllDataSource + } + + + /** + * get DataBases list + * + * @param system + * @param dataSourceId + * @param user + * @return list + */ + def queryDataBasesByCuster(system: String, dataSourceId: Long, user: String): MetadataGetDatabasesResult = { + metaDataClient.getDatabases(MetadataGetDatabasesAction.builder() + .setSystem(system) + .setDataSourceId(dataSourceId) + .setUser(user) + .build() + ) + } + + def queryTablesByDataBase(system: String, dataSourceId: Long, dataBase: String, user: String): MetadataGetTablesResult = { + metaDataClient.getTables(MetadataGetTablesAction.builder() + .setSystem(system) + .setDataSourceId(dataSourceId) + .setDatabase(dataBase) + .setUser(user) + .build() + ) + } + + def queryColumnsByTable(system: String, dataSourceId: Long, dataBase: String, table: String, user: String): MetadataGetColumnsResult = { + metaDataClient.getColumns(MetadataGetColumnsAction.builder() + .setSystem(system) + .setDataSourceId(dataSourceId) + .setDatabase(dataBase) + .setTable(table) + .setUser(user) + .build() + ) + } + + +} diff --git a/exchangis-datasource/exchangis-datasource-linkis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/linkis/request/MetadataGetPartitionPropsAction.scala b/exchangis-datasource/exchangis-datasource-linkis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/linkis/request/MetadataGetPartitionPropsAction.scala new file mode 100644 index 000000000..c8caa7ade --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-linkis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/linkis/request/MetadataGetPartitionPropsAction.scala @@ -0,0 +1,53 @@ +package com.webank.wedatasphere.exchangis.datasource.linkis.request + +import org.apache.linkis.datasource.client.config.DatasourceClientConfig.METADATA_SERVICE_MODULE +import org.apache.linkis.datasource.client.request.DataSourceAction +import org.apache.linkis.httpclient.request.GetAction + +class MetadataGetPartitionPropsAction extends GetAction with DataSourceAction{ + /** + * Data source id + */ + private var dataSourceId: Long = _ + + /** + * Database + */ + private var database: String = _ + + /** + * Table + */ + private var table: String = _ + + /** + * Partition + */ + private var partition: String = _ + + override def suffixURLs: Array[String] = Array(METADATA_SERVICE_MODULE.getValue, "props", dataSourceId.toString, "db", database, "table", table, "partition", partition) + + private var user: String = _ + + override def setUser(user: String): Unit = this.user = user + + override def getUser: String = this.user + + /** + * Just use the constructor instead of builder + * @param dataSourceId data source id + * @param database database + * @param table table + * @param partition partition + * @param system system + */ + def this(dataSourceId: Long, database: String, table: String, partition: String, + system: String){ + this() + this.dataSourceId = dataSourceId + this.database = database + this.table = table + this.partition = partition + setParameter("system", system) + } +} diff --git a/exchangis-datasource/exchangis-datasource-linkis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/linkis/request/ParamsTestConnectAction.scala b/exchangis-datasource/exchangis-datasource-linkis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/linkis/request/ParamsTestConnectAction.scala new file mode 100644 index 000000000..7461f63fb --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-linkis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/linkis/request/ParamsTestConnectAction.scala @@ -0,0 +1,39 @@ +package com.webank.wedatasphere.exchangis.datasource.linkis.request + +import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE +import org.apache.linkis.datasource.client.request.DataSourceAction +import org.apache.linkis.httpclient.dws.DWSHttpClient +import org.apache.linkis.httpclient.request.POSTAction + +import java.util +import scala.collection.JavaConverters.mapAsScalaMapConverter + +/** + * Connect test for the data source params + */ +class ParamsTestConnectAction extends POSTAction with DataSourceAction{ + + private var user: String = _ + + override def getRequestPayload: String = DWSHttpClient.jacksonJson.writeValueAsString(getRequestPayloads) + + override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, "op", "connect", "json") + + override def setUser(user: String): Unit = this.user = user + + override def getUser: String = this.user + + /** + * + * @param dataSource data source map + * @param user user + */ + def this(dataSource: util.Map[String, Any], user: String){ + this() + dataSource.asScala.foreach{ + case (key, value) => + this.addRequestPayload(key, value) + } + this.user = user + } +} diff --git a/exchangis-datasource/exchangis-datasource-linkis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/linkis/response/MetadataGetPartitionPropsResult.scala b/exchangis-datasource/exchangis-datasource-linkis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/linkis/response/MetadataGetPartitionPropsResult.scala new file mode 100644 index 000000000..4f56f5aed --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-linkis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/linkis/response/MetadataGetPartitionPropsResult.scala @@ -0,0 +1,12 @@ +package com.webank.wedatasphere.exchangis.datasource.linkis.response + +import org.apache.linkis.httpclient.dws.annotation.DWSHttpMessageResult +import org.apache.linkis.httpclient.dws.response.DWSResult + +import scala.beans.BeanProperty +import java.util + +@DWSHttpMessageResult("/api/rest_j/v\\d+/metadatamanager/props/(\\S+)/db/(\\S+)/table/(\\S+)/partition/(\\S+)") +class MetadataGetPartitionPropsResult extends DWSResult{ + @BeanProperty var props: util.Map[String, String] = _ +} diff --git a/exchangis-datasource/exchangis-datasource-linkis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/linkis/response/ParamsTestConnectResult.scala b/exchangis-datasource/exchangis-datasource-linkis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/linkis/response/ParamsTestConnectResult.scala new file mode 100644 index 000000000..1dc447082 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-linkis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/linkis/response/ParamsTestConnectResult.scala @@ -0,0 +1,12 @@ +package com.webank.wedatasphere.exchangis.datasource.linkis.response + +import org.apache.linkis.httpclient.dws.annotation.DWSHttpMessageResult +import org.apache.linkis.httpclient.dws.response.DWSResult + +import scala.beans.BeanProperty + +@DWSHttpMessageResult("/api/rest_j/v\\d+/data-source-manager/op/connect/json") +class ParamsTestConnectResult extends DWSResult{ + @BeanProperty var ok: Boolean = _ + +} diff --git a/exchangis-datasource/exchangis-datasource-loader/pom.xml b/exchangis-datasource/exchangis-datasource-loader/pom.xml new file mode 100644 index 000000000..98eb6f6a6 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-loader/pom.xml @@ -0,0 +1,44 @@ + + + + exchangis-datasource + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-datasource-loader + + + 8 + 8 + + + + + com.webank.wedatasphere.exchangis + exchangis-datasource-core + 1.0.0-RC1 + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + net.alchim31.maven + scala-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + \ No newline at end of file diff --git a/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/clazzloader/ExchangisDataSourceClassLoader.java b/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/clazzloader/ExchangisDataSourceClassLoader.java new file mode 100644 index 000000000..a55ddfd5a --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/clazzloader/ExchangisDataSourceClassLoader.java @@ -0,0 +1,43 @@ +/* + * + * * Copyright 2019 WeBank + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package com.webank.wedatasphere.exchangis.datasource.loader.clazzloader; + +import java.net.URL; +import java.net.URLClassLoader; + +/** + * 利用UrlClassLoader加载Jar文件到内存 + * */ +public class ExchangisDataSourceClassLoader extends URLClassLoader { + + public ExchangisDataSourceClassLoader(URL[] urls, ClassLoader parent) { + super(urls, parent); + } + + @Override + public Class loadClass(String name) throws ClassNotFoundException { + return super.loadClass(name); + } + + @Override + protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException { + return super.loadClass(name, resolve); + } + +} \ No newline at end of file diff --git a/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/exception/NoSuchExchangisExtDataSourceException.java b/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/exception/NoSuchExchangisExtDataSourceException.java new file mode 100644 index 000000000..464fe68d5 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/exception/NoSuchExchangisExtDataSourceException.java @@ -0,0 +1,14 @@ +package com.webank.wedatasphere.exchangis.datasource.loader.exception; + + +import org.apache.linkis.common.exception.ErrorException; + +public class NoSuchExchangisExtDataSourceException extends ErrorException { + public NoSuchExchangisExtDataSourceException(String errDecs) { + super(70059, errDecs); + } + + public NoSuchExchangisExtDataSourceException(int errCode, String desc) { + super(errCode, desc); + } +} diff --git a/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/loader/ExchangisDataSourceLoaderFactory.java b/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/loader/ExchangisDataSourceLoaderFactory.java new file mode 100644 index 000000000..58d6c29dc --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/loader/ExchangisDataSourceLoaderFactory.java @@ -0,0 +1,43 @@ +package com.webank.wedatasphere.exchangis.datasource.loader.loader; + +import com.webank.wedatasphere.exchangis.datasource.core.loader.ExchangisDataSourceLoader; +import org.apache.commons.lang.ClassUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.common.conf.CommonVars; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ExchangisDataSourceLoaderFactory { + + private static final Logger logger = LoggerFactory.getLogger(ExchangisDataSourceLoaderFactory.class); + + private static Class clazz = LocalExchangisDataSourceLoader.class; + private static ExchangisDataSourceLoader exchangisDataSourceLoader = null; + + public static ExchangisDataSourceLoader getLoader(){ + if (exchangisDataSourceLoader == null){ + synchronized (ExchangisDataSourceLoaderFactory.class){ + if (exchangisDataSourceLoader == null){ + // 可以通过配置自行加载对应的类 + CommonVars apply = CommonVars.apply("exchangis.extds.loader.classname", ""); + String className = apply.getValue(); + if (StringUtils.isNotBlank(className)){ + try{ + clazz = ClassUtils.getClass(className); + }catch(ClassNotFoundException e){ + logger.warn(String.format("Can not get ExchangisDataSourceLoader class %s, LocalExchangisDataSourceLoader will be used by default.", className), e); + } + } + try { + exchangisDataSourceLoader = clazz.newInstance(); + } catch (Exception e) { + logger.error(String.format("Can not initialize ExchangisDataSourceLoader class %s.", clazz.getSimpleName()), e); + } + logger.info("Use {} to load all Exchangis Extension DataSources.", clazz.getSimpleName()); + } + } + } + return exchangisDataSourceLoader; + } + +} diff --git a/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/loader/LocalExchangisDataSourceLoader.java b/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/loader/LocalExchangisDataSourceLoader.java new file mode 100644 index 000000000..7e147d16d --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/loader/LocalExchangisDataSourceLoader.java @@ -0,0 +1,81 @@ +package com.webank.wedatasphere.exchangis.datasource.loader.loader; + +import com.webank.wedatasphere.exchangis.dao.hook.MapperHook; +import com.webank.wedatasphere.exchangis.datasource.core.ExchangisDataSource; +import com.webank.wedatasphere.exchangis.datasource.core.context.ExchangisDataSourceContext; +import com.webank.wedatasphere.exchangis.datasource.core.loader.ExchangisDataSourceLoader; +import com.webank.wedatasphere.exchangis.datasource.loader.clazzloader.ExchangisDataSourceClassLoader; +import com.webank.wedatasphere.exchangis.datasource.loader.utils.ExceptionHelper; +import com.webank.wedatasphere.exchangis.datasource.loader.utils.ExtDsUtils; +import org.apache.linkis.common.exception.ErrorException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.net.URL; +import java.util.List; +import java.util.Objects; + +public class LocalExchangisDataSourceLoader implements ExchangisDataSourceLoader { + + private static final Logger LOGGER = LoggerFactory.getLogger(LocalExchangisDataSourceLoader.class); + + private ClassLoader classLoader; + private ExchangisDataSourceContext context; + + @Override + public void setClassLoader(ClassLoader classLoader) { + this.classLoader = classLoader; + } + + @Override + public void setContext(ExchangisDataSourceContext context) { + this.context = context; + } + + @Override + public void init(MapperHook mapperHook) throws Exception { + // 初始化磁盘扫描加载 + ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); + String loadClassPath = Objects.requireNonNull(currentClassLoader.getResource("")).getPath(); +// String libPathUrl = loadClassPath + ".." + File.separator + ".." + File.separator + EXCHANGIS_DIR_NAME; + String libPathUrl = loadClassPath + ".." + File.separator + EXCHANGIS_DIR_NAME; + LOGGER.info("libPath url is {}", libPathUrl); + List jars = ExtDsUtils.getJarsUrlsOfPath(libPathUrl); +// List jars = ExtDsUtils.getJarsUrlsOfPath(EXCHANGIS_DIR_NAME); + ClassLoader classLoader = new ExchangisDataSourceClassLoader(jars.toArray(new URL[1]), currentClassLoader); + + List classNames = ExtDsUtils.getExchangisExtDataSourceClassNames(libPathUrl, classLoader); + for (String clazzName: classNames) { + Class clazz = null; + try { + clazz = classLoader.loadClass(clazzName); + } catch (ClassNotFoundException e) { + Thread.currentThread().setContextClassLoader(currentClassLoader); + ExceptionHelper.dealErrorException(70062, clazzName + " class not found ", e, ErrorException.class); + } + + if (clazz == null) { + Thread.currentThread().setContextClassLoader(currentClassLoader); + } else { + ExchangisDataSource exchangisDataSource = (ExchangisDataSource) clazz.newInstance(); + exchangisDataSource.setMapperHook(mapperHook); + Thread.currentThread().setContextClassLoader(currentClassLoader); + LOGGER.info("ExchangisDataSource is {}", exchangisDataSource.getClass().toString()); + + context.addExchangisDataSource(exchangisDataSource); + } + } + + } + + @Override + public ExchangisDataSource load(String dataSourceType) { + return null; + } + + @Override + public ExchangisDataSource get(String dataSourceType, boolean reload) { + return null; + } +} diff --git a/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/utils/ExceptionHelper.java b/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/utils/ExceptionHelper.java new file mode 100644 index 000000000..5260e4cc4 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/utils/ExceptionHelper.java @@ -0,0 +1,47 @@ +/* + * + * * Copyright 2019 WeBank + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package com.webank.wedatasphere.exchangis.datasource.loader.utils; + + +import org.apache.linkis.common.exception.ErrorException; + +import java.lang.reflect.Constructor; + +public class ExceptionHelper { + public static void dealErrorException(int errorCode, String errorMsg, Throwable t) throws ErrorException { + ErrorException errorException = new ErrorException(errorCode, errorMsg); + errorException.initCause(t); + throw errorException; + } + + public static void dealErrorException(int errorCode, String errorDesc, Throwable throwable, + Class clazz) throws T{ + T errorException = null; + try { + Constructor constructor = clazz.getConstructor(int.class, String.class); + errorException = constructor.newInstance(errorCode, errorDesc); + errorException.setErrCode(errorCode); + errorException.setDesc(errorDesc); + } catch (Exception e) { + throw new RuntimeException(String.format("failed to instance %s", clazz.getName()), e); + } + errorException.initCause(throwable); + throw errorException; + } +} diff --git a/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/utils/ExtDsUtils.java b/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/utils/ExtDsUtils.java new file mode 100644 index 000000000..69db1da10 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-loader/src/main/java/com/webank/wedatasphere/exchangis/datasource/loader/utils/ExtDsUtils.java @@ -0,0 +1,177 @@ +/* + * + * * Copyright 2019 WeBank + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package com.webank.wedatasphere.exchangis.datasource.loader.utils; + +import com.webank.wedatasphere.exchangis.datasource.core.ExchangisDataSource; +import com.webank.wedatasphere.exchangis.datasource.core.loader.ExchangisDataSourceLoader; +import com.webank.wedatasphere.exchangis.datasource.loader.exception.NoSuchExchangisExtDataSourceException; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.lang.reflect.Modifier; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; + +public class ExtDsUtils { + + private static final Logger logger = LoggerFactory.getLogger(ExtDsUtils.class); + + private static Class PARENT_CLASS = ExchangisDataSource.class; + + + public static String getExchangisExtDataSourceClassName(String libPath, + ClassLoader classLoader) throws NoSuchExchangisExtDataSourceException { + //1.获取目录下面所有的jar包 + List jars = getJarsOfPath(libPath); + //2.从所有的jar中获取到ExchangisDataSource的子类 + for (String jar : jars) { + for (String clazzName : getClassNameFrom(jar)) { + //3. 再在对应的jar包中寻找是AppConn的子类 + if (isChildClass(clazzName, PARENT_CLASS, classLoader)) { + return clazzName; + } + } + } + throw new NoSuchExchangisExtDataSourceException("does not exist ExchangisDataSource child class"); + } + + public static List getExchangisExtDataSourceClassNames(String libPath, + ClassLoader classLoader) { + List classNames = new ArrayList<>(); + List jars = getJarsOfPath(libPath); + for (String jar : jars) { + for (String clazzName : getClassNameFrom(jar)) { + if (isChildClass(clazzName, PARENT_CLASS, classLoader)) { + classNames.add(clazzName); +// return clazzName; + } + } + } + return classNames; + } + + /** + * 获得需要实例化的AppConn的全限定名 + * */ + public static String getExchangisExtDataSourceClassName(String dataSourceName, String libPath, + ClassLoader classLoader) throws NoSuchExchangisExtDataSourceException { + //1.获取目录下面所有的jar包 + List jars = getJarsOfPath(libPath); + //2.从所有的jar中获取到ExchangisDataSource的子类 + for (String jar : jars) { + for (String clazzName : getClassNameFrom(jar)) { + //3. 再在对应的jar包中寻找是AppConn的子类 + if (isChildClass(clazzName, PARENT_CLASS, classLoader)) { + return clazzName; + } + } + } + throw new NoSuchExchangisExtDataSourceException(dataSourceName + " does not exist"); + } + + public static List getJarsOfPath(String path) { + File file = new File(path); + List jars = new ArrayList<>(); + if (file.listFiles() != null) { + for (File f : file.listFiles()) { + // exchangis-xxxxx.jar + if (!f.isDirectory() && f.getName().endsWith(ExchangisDataSourceLoader.JAR_SUF_NAME) && f.getName().startsWith("exchangis")) { + jars.add(f.getPath()); + } + } + } + return jars; + } + + + public static List getJarsUrlsOfPath(String path) { + File file = new File(path); + logger.info(file.getPath()); + logger.info(file.getAbsolutePath()); + List jars = new ArrayList<>(); + if (file.listFiles() != null) { + for (File f : file.listFiles()) { + if (!f.isDirectory() && f.getName().endsWith(ExchangisDataSourceLoader.JAR_SUF_NAME)) { + try { + jars.add(f.toURI().toURL()); + } catch (MalformedURLException e) { + logger.warn("url {} cannot be added", ExchangisDataSourceLoader.FILE_SCHEMA + f.getPath()); + } + } + } + } + return jars; + } + + + /** + * 从jar包读取所有的class文件名 + */ + private static List getClassNameFrom(String jarName) { + List fileList = new ArrayList<>(); + try { + JarFile jarFile = new JarFile(new File(jarName)); + Enumeration en = jarFile.entries(); + while (en.hasMoreElements()) { + String name1 = en.nextElement().getName(); + if (!name1.endsWith(".class")) { + continue; + } + String name2 = name1.substring(0, name1.lastIndexOf(".class")); + String name3 = name2.replaceAll("/", "."); + fileList.add(name3); + } + } catch (IOException e) { + e.printStackTrace(); + } + + return fileList; + } + + + private static boolean isChildClass(String className, Class parentClazz, ClassLoader classLoader) { + if (StringUtils.isEmpty(className)) { + return false; + } + Class clazz = null; + try { + clazz = classLoader.loadClass(className); + //忽略抽象类和接口 + if (Modifier.isAbstract(clazz.getModifiers())) { + return false; + } + if (Modifier.isInterface(clazz.getModifiers())) { + return false; + } + } catch (Throwable t) { + logger.error("className {} can not be instanced", className, t); + return false; + } + return parentClazz.isAssignableFrom(clazz); + } + +} diff --git a/exchangis-datasource/exchangis-datasource-server/pom.xml b/exchangis-datasource/exchangis-datasource-server/pom.xml new file mode 100644 index 000000000..3cd9a1705 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-server/pom.xml @@ -0,0 +1,80 @@ + + + + exchangis-datasource + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-datasource-server + + + 8 + 8 + + + + + com.webank.wedatasphere.exchangis + exchangis-datasource-service + 1.0.0-RC1 + + + + com.webank.wedatasphere.exchangis + exchangis-datasource-loader + 1.0.0-RC1 + + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + net.alchim31.maven + scala-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-assembly-plugin + 3.1.0 + false + + + make-assembly + package + + single + + + + src/main/assembly/distribution.xml + + + + + + false + exchangis-datasource-server + false + false + + src/main/assembly/distribution.xml + + + + + + \ No newline at end of file diff --git a/exchangis-datasource/exchangis-datasource-server/src/main/assembly/distribution.xml b/exchangis-datasource/exchangis-datasource-server/src/main/assembly/distribution.xml new file mode 100644 index 000000000..785dec1f4 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-server/src/main/assembly/distribution.xml @@ -0,0 +1,64 @@ + + + + exchangis-datasource-server + + dir + + false + + + ${basedir}/src/main/bin + + * + + 0755 + 0755 + bin + unix + + + ${basedir}/../extension-datasources/exchangis-datasource-ext-hive/target + + *.jar + + + *-javadoc.jar + + 0755 + 0755 + exchangis-extds + + + ${basedir}/../extension-datasources/exchangis-datasource-ext-mysql/target + + *.jar + + + *-javadoc.jar + + 0755 + 0755 + exchangis-extds + + + + diff --git a/exchangis-datasource/exchangis-datasource-server/src/main/java/com/webank/wedatasphere/exchangis/datasource/server/ExchangisDataSourceAutoConfiguration.java b/exchangis-datasource/exchangis-datasource-server/src/main/java/com/webank/wedatasphere/exchangis/datasource/server/ExchangisDataSourceAutoConfiguration.java new file mode 100644 index 000000000..2146c2595 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-server/src/main/java/com/webank/wedatasphere/exchangis/datasource/server/ExchangisDataSourceAutoConfiguration.java @@ -0,0 +1,20 @@ +package com.webank.wedatasphere.exchangis.datasource.server; + +import com.webank.wedatasphere.exchangis.datasource.core.service.MetadataInfoService; +import com.webank.wedatasphere.exchangis.datasource.linkis.service.LinkisMetadataInfoService; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Auto configure the core beans + */ +@Configuration +public class ExchangisDataSourceAutoConfiguration { + + @Bean + @ConditionalOnMissingBean(MetadataInfoService.class) + public MetadataInfoService metadataInfoService(){ + return new LinkisMetadataInfoService(); + } +} diff --git a/exchangis-datasource/exchangis-datasource-server/src/main/java/com/webank/wedatasphere/exchangis/datasource/server/configuration/ServerConfig.java b/exchangis-datasource/exchangis-datasource-server/src/main/java/com/webank/wedatasphere/exchangis/datasource/server/configuration/ServerConfig.java new file mode 100644 index 000000000..85a71ef80 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-server/src/main/java/com/webank/wedatasphere/exchangis/datasource/server/configuration/ServerConfig.java @@ -0,0 +1,29 @@ +package com.webank.wedatasphere.exchangis.datasource.server.configuration; + + +import com.webank.wedatasphere.exchangis.dao.hook.MapperHook; +import com.webank.wedatasphere.exchangis.datasource.core.context.DefaultExchangisDataSourceContext; +import com.webank.wedatasphere.exchangis.datasource.core.context.ExchangisDataSourceContext; +import com.webank.wedatasphere.exchangis.datasource.core.loader.ExchangisDataSourceLoader; +import com.webank.wedatasphere.exchangis.datasource.loader.loader.ExchangisDataSourceLoaderFactory; +import org.apache.linkis.common.exception.ErrorException; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class ServerConfig { + + @Bean + public ExchangisDataSourceContext context(MapperHook mapperHook) throws Exception { + DefaultExchangisDataSourceContext context = new DefaultExchangisDataSourceContext(); + ExchangisDataSourceLoader loader = ExchangisDataSourceLoaderFactory.getLoader(); + loader.setContext(context); + try { + loader.init(mapperHook); + } catch (Exception e) { + throw new ErrorException(70059, e.getMessage()); + } + return context; + } + +} diff --git a/exchangis-datasource/exchangis-datasource-server/src/main/java/com/webank/wedatasphere/exchangis/datasource/server/restful/api/ExchangisDataSourceRenderRestfulApi.java b/exchangis-datasource/exchangis-datasource-server/src/main/java/com/webank/wedatasphere/exchangis/datasource/server/restful/api/ExchangisDataSourceRenderRestfulApi.java new file mode 100644 index 000000000..00e6b5c2d --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-server/src/main/java/com/webank/wedatasphere/exchangis/datasource/server/restful/api/ExchangisDataSourceRenderRestfulApi.java @@ -0,0 +1,59 @@ +package com.webank.wedatasphere.exchangis.datasource.server.restful.api; + +import com.webank.wedatasphere.exchangis.datasource.core.service.MetadataInfoService; +import com.webank.wedatasphere.exchangis.datasource.core.ui.ElementUI; +import com.webank.wedatasphere.exchangis.datasource.core.ui.builder.ElementUIFactory; +import com.webank.wedatasphere.exchangis.datasource.service.DataSourceRenderService; +import org.apache.linkis.datasource.client.impl.LinkisDataSourceRemoteClient; +import org.apache.linkis.server.Message; +import org.apache.linkis.server.security.SecurityFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Locale; +import java.util.Objects; + +/** + * Expose the ui interface to front-end rendering + */ +@RestController +@RequestMapping(value = "dss/exchangis/main/datasources/render", produces = {"application/json;charset=utf-8"}) +public class ExchangisDataSourceRenderRestfulApi { + + private static final Logger LOG = LoggerFactory.getLogger(ExchangisDataSourceRenderRestfulApi.class); + + @Resource + private DataSourceRenderService renderService; + + @RequestMapping(value = "/partition/element/{elementType:\\w+}", method = RequestMethod.GET) + public Message partition(@PathVariable("elementType") String type, + @RequestParam("dataSourceId") Long dataSourceId, + @RequestParam("database") String database, + @RequestParam("table") String table, HttpServletRequest request){ + String userName = SecurityFilter.getLoginUsername(request); + ElementUI.Type uiType; + try { + uiType = ElementUI.Type.valueOf(type.toUpperCase(Locale.ROOT)); + } catch (Exception e){ + return Message.error("Element type: [" + type +"] is not support (不兼容的元素类型)"); + } + Message result = Message.ok(); + try{ + ElementUI elementUI = renderService.getPartitionAndRender(userName, dataSourceId, database, table, uiType); + result.data("type", uiType.name()); + if (Objects.nonNull(elementUI)){ + result.data("render", elementUI.getValue()); + } + }catch(Exception e){ + String uiMessage = "Load to render partition info Failed (加载渲染分区信息失败)"; + LOG.error(uiMessage + ", reason: " + e.getMessage(), e); + result = Message.error(uiMessage); + } + result.setMethod("/api/rest_j/v1/dss/exchangis/main/datasources/render/partition/element/" + type); + return result; + } + +} diff --git a/exchangis-datasource/exchangis-datasource-server/src/main/java/com/webank/wedatasphere/exchangis/datasource/server/restful/api/ExchangisDataSourceRestfulApi.java b/exchangis-datasource/exchangis-datasource-server/src/main/java/com/webank/wedatasphere/exchangis/datasource/server/restful/api/ExchangisDataSourceRestfulApi.java new file mode 100644 index 000000000..26803afb6 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-server/src/main/java/com/webank/wedatasphere/exchangis/datasource/server/restful/api/ExchangisDataSourceRestfulApi.java @@ -0,0 +1,419 @@ +package com.webank.wedatasphere.exchangis.datasource.server.restful.api; + +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisDataSourceException; +import com.webank.wedatasphere.exchangis.datasource.core.ui.ElementUI; +import com.webank.wedatasphere.exchangis.datasource.service.ExchangisDataSourceService; +import com.webank.wedatasphere.exchangis.datasource.vo.DataSourceCreateVO; +import com.webank.wedatasphere.exchangis.datasource.vo.DataSourceQueryVO; +import com.webank.wedatasphere.exchangis.datasource.vo.FieldMappingVO; +import org.apache.linkis.server.Message; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.BindingResult; +import org.springframework.validation.FieldError; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import javax.ws.rs.QueryParam; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +@RestController +@RequestMapping(value = "dss/exchangis/main/datasources", produces = {"application/json;charset=utf-8"}) +public class ExchangisDataSourceRestfulApi { + private static final Logger LOG = LoggerFactory.getLogger(ExchangisDataSourceRestfulApi.class); + + + private final ExchangisDataSourceService exchangisDataSourceService; + + private static Pattern p = Pattern.compile("(?<=\\[)[^]]+"); + + @Autowired + public ExchangisDataSourceRestfulApi(ExchangisDataSourceService exchangisDataSourceService) { + this.exchangisDataSourceService = exchangisDataSourceService; + } + + // list all datasource types + @RequestMapping( value = "/type", method = RequestMethod.GET) + public Message listDataSourceTypes(HttpServletRequest request) throws Exception { + Message message = null; + try{ + message = exchangisDataSourceService.listDataSources(request); + } catch (ExchangisDataSourceException e) { + String errorMessage = "Error occur while list datasource type"; + LOG.error(errorMessage, e); + + String errorNote = e.getMessage(); + Matcher matcher = p.matcher(errorNote); + if (matcher.find()) { + message = Message.error(matcher.group()); + } + else{ + message = Message.error("Getting datasource type list fail (获取数据源类型列表失败)"); + } + } + return message; + + } + + // query paged datasource + @RequestMapping( value = "/query", method = {RequestMethod.GET,RequestMethod.POST}) + public Message create(HttpServletRequest request, @RequestBody DataSourceQueryVO vo) throws Exception { + Message message = null; + try{ + message = exchangisDataSourceService.queryDataSources(request, vo); + } catch (ExchangisDataSourceException e) { + String errorMessage = "Error occur while query datasource"; + LOG.error(errorMessage, e); + message = Message.error("查询数据源失败"); + } + return message; + + } + + // list all datasources + @RequestMapping( value = "", method = RequestMethod.GET) + @Deprecated + public Message listAllDataSources( + HttpServletRequest request, + @RequestParam(value = "typeId", required = false) Long typeId, + @RequestParam(value = "typeName", required = false) String typeName, + @RequestParam(value = "page", required = false) Integer page, + @RequestParam(value = "size", required = false) Integer size + ) throws Exception { + Message message = null; + try{ + message = exchangisDataSourceService.listAllDataSources(request, typeName, typeId, page, size); + } catch (ExchangisDataSourceException e) { + String errorMessage = "Error occur while getting datasource list"; + LOG.error(errorMessage, e); + + String errorNote = e.getMessage(); + Matcher matcher = p.matcher(errorNote); + if (matcher.find()) { + message = Message.error(matcher.group()); + } + else{ + message = Message.error("Getting datasource list fail (获取数据源列表失败)"); + } + } + return message; + + } + + // get datasource key define + @RequestMapping( value = "/types/{dataSourceTypeId}/keydefines", method = RequestMethod.GET) + public Message getDataSourceKeyDefine( + HttpServletRequest request, + @PathVariable("dataSourceTypeId") Long dataSourceTypeId + ) throws Exception { + Message message = null; + try{ + message = exchangisDataSourceService.getDataSourceKeyDefine(request, dataSourceTypeId); + } catch (ExchangisDataSourceException e) { + String errorMessage = "Error occur while getting datasource key define"; + LOG.error(errorMessage, e); + message = Message.error("获取数据源主键定义失败"); + } + return message; + + } + + + // get datasource version list + @RequestMapping( value = "/{id}/versions", method = RequestMethod.GET) + public Message getDataSourceVersionsById(HttpServletRequest request, @PathVariable("id") Long id) throws Exception { + Message message = null; + try{ + message = exchangisDataSourceService.getDataSourceVersionsById(request, id); + } catch (ExchangisDataSourceException e) { + String errorMessage = "Error occur while getting datasource version"; + LOG.error(errorMessage, e); + + String errorNote = e.getMessage(); + Matcher matcher = p.matcher(errorNote); + if (matcher.find()) { + message = Message.error(matcher.group()); + } + else{ + message = Message.error("Getting datasource version fail (获取数据源版本失败)"); + } + } + return message; + + } + + // create datasource + @RequestMapping( value = "", method = RequestMethod.POST) + public Message create(/*@PathParam("type") String type, */@Valid @RequestBody DataSourceCreateVO dataSourceCreateVO, BindingResult bindingResult, HttpServletRequest request ) throws Exception { + Message message = new Message(); + LOG.info("dataSourceName: " + dataSourceCreateVO.getDataSourceName() + "dataSourceDesc: " + dataSourceCreateVO.getDataSourceDesc() + "label: " + dataSourceCreateVO.getLabels()); + if(bindingResult.hasErrors()){ + List fieldErrors = bindingResult.getFieldErrors(); + for(int i=0;i fieldErrors = bindingResult.getFieldErrors(); + for(int i=0;i> uis = this.exchangisDataSourceService.getDataSourceParamsUI(type, String.format("%s-%s", engine, dir)); + return Message.ok().data("uis", uis); + } + +} diff --git a/exchangis-datasource/exchangis-datasource-server/src/main/java/com/webank/wedatasphere/exchangis/datasource/server/restful/api/ExchangisJobDataSourceRestfulApi.java b/exchangis-datasource/exchangis-datasource-server/src/main/java/com/webank/wedatasphere/exchangis/datasource/server/restful/api/ExchangisJobDataSourceRestfulApi.java new file mode 100644 index 000000000..b019c1321 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-server/src/main/java/com/webank/wedatasphere/exchangis/datasource/server/restful/api/ExchangisJobDataSourceRestfulApi.java @@ -0,0 +1,58 @@ +package com.webank.wedatasphere.exchangis.datasource.server.restful.api; + +import com.webank.wedatasphere.exchangis.datasource.core.ui.ElementUI; +import com.webank.wedatasphere.exchangis.datasource.core.ui.viewer.ExchangisDataSourceUIViewer; +import com.webank.wedatasphere.exchangis.datasource.service.ExchangisDataSourceService; +import org.apache.linkis.server.Message; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +// TODO 这里仅仅为了测试,JOB的接口在另外的 Controller 中 +@RestController +@RequestMapping(value = "dss/exchangis/main", produces = {"application/json;charset=utf-8"}) +public class ExchangisJobDataSourceRestfulApi { + + private final ExchangisDataSourceService exchangisDataSourceService; + + @Autowired + public ExchangisJobDataSourceRestfulApi(ExchangisDataSourceService exchangisDataSourceService) { + this.exchangisDataSourceService = exchangisDataSourceService; + } + + // 根据 任务ID 获取该任务的数据源所有配置项 UI 数据 + @RequestMapping( value = "jobs/{jobId}/datasource/ui", method = RequestMethod.GET) + public Message getJobDataSourcesUI(HttpServletRequest request, @PathVariable("jobId")Long jobId) { +// ExchangisDataSourceUIViewer jobDataSourceUI = this.exchangisDataSourceService.getJobDataSourceUIs(jobId); + List ui = this.exchangisDataSourceService.getJobDataSourceUIs(request, jobId); + return Message.ok().data("ui", ui); + } + + // 根据 任务引擎类型 获取该引擎的配置项 UI 数据 + @RequestMapping( value = "jobs/engine/{engineType}/settings/ui", method = RequestMethod.GET) + public Message getJobEngineSettingsUI(HttpServletRequest request, @PathVariable("engineType")String engineType, @RequestParam(required = false)String labels) { + List> jobSettingsUI = this.exchangisDataSourceService.getJobEngineSettingsUI(engineType); + return Message.ok().data("ui", jobSettingsUI); + } + + // 根据 任务ID 获取该任务的数据源配置项 UI 数据 + @RequestMapping( value = "jobs/{jobId}/datasource/params/ui", method = RequestMethod.GET) + public Message getJobDataSourceParamsUI(HttpServletRequest request, @PathVariable("jobId")Long jobId) { + return this.exchangisDataSourceService.getJobDataSourceParamsUI(jobId); + } + + // 根据 任务ID 获取该任务的数据源字段映射 UI 数据 + @RequestMapping( value = "jobs/{jobId}/datasource/transforms/ui", method = RequestMethod.GET) + public Message getJobTransformsUI(HttpServletRequest request, @PathVariable("jobId")Long jobId) { + return this.exchangisDataSourceService.getJobDataSourceTransformsUI(jobId); + } + + // 根据 任务ID 获取该任务的数据源引擎配置项 UI 数据 + @RequestMapping( value = "jobs/{jobId}/{jobName}/datasource/settings/ui", method = RequestMethod.GET) + public Message getJobSettingsUI(HttpServletRequest request, @PathVariable("jobId")Long jobId, + @PathVariable("jobName")String jobName) throws Exception { + return this.exchangisDataSourceService.getJobDataSourceSettingsUI(jobId, jobName); + } +} diff --git a/exchangis-datasource/exchangis-datasource-service/pom.xml b/exchangis-datasource/exchangis-datasource-service/pom.xml new file mode 100644 index 000000000..0c692d791 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/pom.xml @@ -0,0 +1,60 @@ + + + + exchangis-datasource + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-datasource-service + + + 8 + 8 + + + + + + com.webank.wedatasphere.exchangis + exchangis-datasource-linkis + 1.0.0-RC1 + + + + + com.webank.wedatasphere.exchangis + exchangis-job-common + 1.0.0-RC1 + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + net.alchim31.maven + scala-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + + + + \ No newline at end of file diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/CreateDataSourceSuccessResultDTO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/CreateDataSourceSuccessResultDTO.java new file mode 100644 index 000000000..1398ecd32 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/CreateDataSourceSuccessResultDTO.java @@ -0,0 +1,29 @@ +package com.webank.wedatasphere.exchangis.datasource.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class CreateDataSourceSuccessResultDTO extends ResultDTO { + private InsertIdDTO data; + + + public InsertIdDTO getData() { + return data; + } + + public void setData(InsertIdDTO data) { + this.data = data; + } + + public static class InsertIdDTO { + @JsonProperty(value = "insertId") + private Long insertId; + + public Long getId() { + return insertId; + } + + public void setId(Long insertId) { + this.insertId = insertId; + } + } +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/DataSourceDTO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/DataSourceDTO.java new file mode 100644 index 000000000..246a6646b --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/DataSourceDTO.java @@ -0,0 +1,133 @@ +package com.webank.wedatasphere.exchangis.datasource.dto; + +import java.util.Date; + +public class DataSourceDTO { + + private Long id; + private String name; + private String type; + private Long dataSourceTypeId; + private String createIdentify; + private String createSystem; + private String desc; + private String createUser; + private String labels; + private String label; + private Long versionId; + private String modifyUser; + private Date modifyTime; + private boolean expire; + + public boolean isExpire() { + return expire; + } + + public void setExpire(boolean expire) { + this.expire = expire; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getCreateIdentify() { + return createIdentify; + } + + public void setCreateIdentify(String createIdentify) { + this.createIdentify = createIdentify; + } + + public Long getDataSourceTypeId() { + return dataSourceTypeId; + } + + public void setDataSourceTypeId(Long dataSourceTypeId) { + this.dataSourceTypeId = dataSourceTypeId; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getLabels() { + return labels; + } + + public void setLabels(String labels) { + this.labels = labels; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public Long getVersionId() { + return versionId; + } + + public void setVersionId(Long versionId) { + this.versionId = versionId; + } + + public String getModifyUser() { + return modifyUser; + } + + public void setModifyUser(String modifyUser) { + this.modifyUser = modifyUser; + } + + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + public String getCreateSystem() { + return createSystem; + } + + public void setCreateSystem(String createSystem) { + this.createSystem = createSystem; + } +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/DataSourceDbTableColumnDTO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/DataSourceDbTableColumnDTO.java new file mode 100644 index 000000000..08b232ac5 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/DataSourceDbTableColumnDTO.java @@ -0,0 +1,40 @@ +package com.webank.wedatasphere.exchangis.datasource.dto; + +public class DataSourceDbTableColumnDTO { + private String name; + private String type; + private int fieldIndex; + private boolean fieldEditable; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public int getFieldIndex() { + return fieldIndex; + } + + public void setFieldIndex(int fieldIndex) { + this.fieldIndex = fieldIndex; + } + + public boolean isFieldEditable() { + return fieldEditable; + } + + public void setFieldEditable(boolean fieldEditable) { + this.fieldEditable = fieldEditable; + } +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/DataSourceTestConnectResultDTO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/DataSourceTestConnectResultDTO.java new file mode 100644 index 000000000..581199646 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/DataSourceTestConnectResultDTO.java @@ -0,0 +1,18 @@ +package com.webank.wedatasphere.exchangis.datasource.dto; + +public class DataSourceTestConnectResultDTO extends ResultDTO { + + private TestConnectData data; + + public TestConnectData getData() { + return data; + } + + public void setData(TestConnectData data) { + this.data = data; + } + + public static class TestConnectData { + } + +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/DeleteDataSourceSuccessResultDTO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/DeleteDataSourceSuccessResultDTO.java new file mode 100644 index 000000000..a4a8d1b22 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/DeleteDataSourceSuccessResultDTO.java @@ -0,0 +1,28 @@ +package com.webank.wedatasphere.exchangis.datasource.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class DeleteDataSourceSuccessResultDTO extends ResultDTO { + private DeleteIdDTO data; + + public DeleteIdDTO getData() { + return data; + } + + public void setData(DeleteIdDTO data) { + this.data = data; + } + + public static class DeleteIdDTO { + @JsonProperty(value = "remove_id") + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + } +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/ExchangisDataSourceDTO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/ExchangisDataSourceDTO.java new file mode 100644 index 000000000..809ea11d2 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/ExchangisDataSourceDTO.java @@ -0,0 +1,52 @@ +package com.webank.wedatasphere.exchangis.datasource.dto; + +public class ExchangisDataSourceDTO { + private final String id; + private final String classifier; + private final String name; + private String option; + private String description; + private String icon; + + public ExchangisDataSourceDTO(String id, String classifier, String name) { + this.id = id; + this.classifier = classifier; + this.name = name; + } + + public String getId() { + return id; + } + + public String getClassifier() { + return classifier; + } + + public String getName() { + return name; + } + + public String getOption() { + return option; + } + + public void setOption(String option) { + this.option = option; + } + + public void setDescription(String description) { + this.description = description; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getDescription() { + return description; + } + + public String getIcon() { + return icon; + } +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/ExpireDataSourceSuccessResultDTO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/ExpireDataSourceSuccessResultDTO.java new file mode 100644 index 000000000..6a9688c0f --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/ExpireDataSourceSuccessResultDTO.java @@ -0,0 +1,29 @@ +package com.webank.wedatasphere.exchangis.datasource.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ExpireDataSourceSuccessResultDTO extends ResultDTO { + private ExpireIdDTO data; + + + public ExpireIdDTO getData() { + return data; + } + + public void setData(ExpireIdDTO data) { + this.data = data; + } + + public static class ExpireIdDTO { + @JsonProperty(value = "expire_id") + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + } +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/GetDataSourceConnectParamsResultDTO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/GetDataSourceConnectParamsResultDTO.java new file mode 100644 index 000000000..cd800a480 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/GetDataSourceConnectParamsResultDTO.java @@ -0,0 +1,16 @@ +package com.webank.wedatasphere.exchangis.datasource.dto; + +public class GetDataSourceConnectParamsResultDTO extends ResultDTO { + private ConnectParamsDTO data; + + public ConnectParamsDTO getData() { + return data; + } + + public void setData(ConnectParamsDTO data) { + this.data = data; + } + + public static class ConnectParamsDTO { + } +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/GetDataSourceInfoResultDTO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/GetDataSourceInfoResultDTO.java new file mode 100644 index 000000000..3bc542801 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/GetDataSourceInfoResultDTO.java @@ -0,0 +1,206 @@ +package com.webank.wedatasphere.exchangis.datasource.dto; + +import java.util.Map; + +public class GetDataSourceInfoResultDTO extends ResultDTO { + private DataSourceInfoDTO data; + + public DataSourceInfoDTO getData() { + return data; + } + + public void setData(DataSourceInfoDTO data) { + this.data = data; + } + + public static class DataSourceInfoDTO { + private DataSourceItemDTO info; + + public DataSourceItemDTO getInfo() { + return info; + } + + public void setInfo(DataSourceItemDTO info) { + this.info = info; + } + } + + public static class DataSourceItemDTO { + private Long id; + private String dataSourceName; + private String dataSourceDesc; + private Long dataSourceTypeId; + private String createIdentify; + private String createSystem; + private Map connectParams; + private Long createTime; + private String createUser; + private Long modifyTime; + private String modifyUser; + private String labels; + private String label; + private Long versionId; + private Integer publishedVersionId; + private Boolean expire; + private DataSourceItemDsTypeDTO dataSourceType; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDataSourceName() { + return dataSourceName; + } + + public void setDataSourceName(String dataSourceName) { + this.dataSourceName = dataSourceName; + } + + public String getDataSourceDesc() { + return dataSourceDesc; + } + + public void setDataSourceDesc(String dataSourceDesc) { + this.dataSourceDesc = dataSourceDesc; + } + + public Long getDataSourceTypeId() { + return dataSourceTypeId; + } + + public void setDataSourceTypeId(Long dataSourceTypeId) { + this.dataSourceTypeId = dataSourceTypeId; + } + + public String getCreateIdentify() { + return createIdentify; + } + + public void setCreateIdentify(String createIdentify) { + this.createIdentify = createIdentify; + } + + public String getCreateSystem() { + return createSystem; + } + + public void setCreateSystem(String createSystem) { + this.createSystem = createSystem; + } + + public Map getConnectParams() { + return connectParams; + } + + public void setConnectParams(Map connectParams) { + this.connectParams = connectParams; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getLabels() { + return labels; + } + + public void setLabels(String labels) { + this.labels = labels; + this.label = labels; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public Integer getPublishedVersionId() { + return publishedVersionId; + } + + public void setPublishedVersionId(Integer publishedVersionId) { + this.publishedVersionId = publishedVersionId; + } + + public Long getVersionId() { + return versionId; + } + + public void setVersionId(Long versionId) { + this.versionId = versionId; + } + + public Boolean getExpire() { + return expire; + } + + public void setExpire(Boolean expire) { + this.expire = expire; + } + + public DataSourceItemDsTypeDTO getDataSourceType() { + return dataSourceType; + } + + public void setDataSourceType(DataSourceItemDsTypeDTO dataSourceType) { + this.dataSourceType = dataSourceType; + } + + public Long getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Long modifyTime) { + this.modifyTime = modifyTime; + } + + public String getModifyUser() { + return modifyUser; + } + + public void setModifyUser(String modifyUser) { + this.modifyUser = modifyUser; + } + } + + public static class DataSourceItemDsTypeDTO { + private String name; + private Integer layers; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getLayers() { + return layers; + } + + public void setLayers(Integer layers) { + this.layers = layers; + } + } + +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/GetDataSourceTypeKeyDefinesSuccessResultDTO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/GetDataSourceTypeKeyDefinesSuccessResultDTO.java new file mode 100644 index 000000000..06977ec1b --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/GetDataSourceTypeKeyDefinesSuccessResultDTO.java @@ -0,0 +1,127 @@ +package com.webank.wedatasphere.exchangis.datasource.dto; + + +import org.apache.linkis.datasourcemanager.common.domain.DataSourceParamKeyDefinition; + +public class GetDataSourceTypeKeyDefinesSuccessResultDTO extends ResultDTO { + private DataSourceKeyDefinition data; + + public DataSourceKeyDefinition getData() { + return data; + } + + public void setData(DataSourceKeyDefinition data) { + this.data = data; + } + + public static class DataSourceKeyDefinition { + private Long id; + private String key; + private String description; + private String name; + private String defaultValue; + private DataSourceParamKeyDefinition.ValueType valueType; + private DataSourceParamKeyDefinition.Scope scope; + private boolean require; + private String valueRegex; + private Long refId; + private String refValue; + private String dataSource; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + public DataSourceParamKeyDefinition.ValueType getValueType() { + return valueType; + } + + public void setValueType(DataSourceParamKeyDefinition.ValueType valueType) { + this.valueType = valueType; + } + + public DataSourceParamKeyDefinition.Scope getScope() { + return scope; + } + + public void setScope(DataSourceParamKeyDefinition.Scope scope) { + this.scope = scope; + } + + public boolean isRequire() { + return require; + } + + public void setRequire(boolean require) { + this.require = require; + } + + public String getValueRegex() { + return valueRegex; + } + + public void setValueRegex(String valueRegex) { + this.valueRegex = valueRegex; + } + + public Long getRefId() { + return refId; + } + + public void setRefId(Long refId) { + this.refId = refId; + } + + public String getRefValue() { + return refValue; + } + + public void setRefValue(String refValue) { + this.refValue = refValue; + } + + public String getDataSource() { + return dataSource; + } + + public void setDataSource(String dataSource) { + this.dataSource = dataSource; + } + } +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/GetDataSourceVersionsResultDTO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/GetDataSourceVersionsResultDTO.java new file mode 100644 index 000000000..7c500534b --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/GetDataSourceVersionsResultDTO.java @@ -0,0 +1,87 @@ +package com.webank.wedatasphere.exchangis.datasource.dto; + +import java.util.List; +import java.util.Map; + +public class GetDataSourceVersionsResultDTO extends ResultDTO { + + private VersionDataDTO data; + + public VersionDataDTO getData() { + return data; + } + + public void setData(VersionDataDTO data) { + this.data = data; + } + + public static class VersionDataDTO { + private List versions; + + public List getVersions() { + return versions; + } + + public void setVersions(List versions) { + this.versions = versions; + } + } + + public static class VersionDTO { + private Long versionId; + private Long datasourceId; + private Map connectParams; + private String comment; + private String createUser; + private boolean published = false; + + public Long getVersionId() { + return versionId; + } + + public void setVersionId(Long versionId) { + this.versionId = versionId; + } + + public Long getDatasourceId() { + return datasourceId; + } + + public void setDatasourceId(Long datasourceId) { + this.datasourceId = datasourceId; + } + + public Map getConnectParams() { + return connectParams; + } + + public void setConnectParams(Map connectParams) { + this.connectParams = connectParams; + } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public boolean isPublished() { + return published; + } + + public void setPublished(boolean published) { + this.published = published; + } + } + +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/MetadataGetColumnsResultDTO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/MetadataGetColumnsResultDTO.java new file mode 100644 index 000000000..1837db063 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/MetadataGetColumnsResultDTO.java @@ -0,0 +1,72 @@ +package com.webank.wedatasphere.exchangis.datasource.dto; + +import java.util.List; + +public class MetadataGetColumnsResultDTO extends ResultDTO { + + private Data data; + + public Data getData() { + return data; + } + + public void setData(Data data) { + this.data = data; + } + + public static class Data { + + private List columns; + + public List getColumns() { + return columns; + } + + public void setColumns(List columns) { + this.columns = columns; + } + + } + + public static class Column { + + private int index; + private boolean primaryKey; + private String name; + private String type; + + public int getIndex() { + return index; + } + + public void setIndex(int index) { + this.index = index; + } + + public boolean isPrimaryKey() { + return primaryKey; + } + + public void setPrimaryKey(boolean primaryKey) { + this.primaryKey = primaryKey; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + } + +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/MetadataGetTablePropsResultDTO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/MetadataGetTablePropsResultDTO.java new file mode 100644 index 000000000..069e2109a --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/MetadataGetTablePropsResultDTO.java @@ -0,0 +1,30 @@ +package com.webank.wedatasphere.exchangis.datasource.dto; + +import java.util.Map; + +public class MetadataGetTablePropsResultDTO extends ResultDTO { + + private Data data; + + public Data getData() { + return data; + } + + public void setData(Data data) { + this.data = data; + } + + public static class Data { + + private Map props; + + public Map getProps() { + return props; + } + + public void setProps(Map props) { + this.props = props; + } + } + +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/ResultDTO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/ResultDTO.java new file mode 100644 index 000000000..bab2dbfef --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/ResultDTO.java @@ -0,0 +1,35 @@ +package com.webank.wedatasphere.exchangis.datasource.dto; + +public class ResultDTO { + + private String method; + + private Integer status; + + private String message; + + public String getMethod() { + return method; + } + + public void setMethod(String method) { + this.method = method; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/UpdateDataSourceSuccessResultDTO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/UpdateDataSourceSuccessResultDTO.java new file mode 100644 index 000000000..56d56c985 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/UpdateDataSourceSuccessResultDTO.java @@ -0,0 +1,29 @@ +package com.webank.wedatasphere.exchangis.datasource.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class UpdateDataSourceSuccessResultDTO extends ResultDTO { + private UpdateIdDTO data; + + + public UpdateIdDTO getData() { + return data; + } + + public void setData(UpdateIdDTO data) { + this.data = data; + } + + public static class UpdateIdDTO { + @JsonProperty(value = "update_id") + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + } +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/UpdateParamsVersionResultDTO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/UpdateParamsVersionResultDTO.java new file mode 100644 index 000000000..3225448fd --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/dto/UpdateParamsVersionResultDTO.java @@ -0,0 +1,25 @@ +package com.webank.wedatasphere.exchangis.datasource.dto; + +public class UpdateParamsVersionResultDTO extends ResultDTO { + private VersionDTO data; + + public VersionDTO getData() { + return data; + } + + public void setData(VersionDTO data) { + this.data = data; + } + + public static class VersionDTO { + private Long version; + + public Long getVersion() { + return version; + } + + public void setVersion(Long version) { + this.version = version; + } + } +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/service/AbstractDataSourceService.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/service/AbstractDataSourceService.java new file mode 100644 index 000000000..75faf4f12 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/service/AbstractDataSourceService.java @@ -0,0 +1,354 @@ +package com.webank.wedatasphere.exchangis.datasource.service; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.base.Strings; +import com.webank.wedatasphere.exchangis.dao.domain.ExchangisJobParamConfig; +import com.webank.wedatasphere.exchangis.dao.mapper.ExchangisJobParamConfigMapper; +import com.webank.wedatasphere.exchangis.datasource.core.ExchangisDataSource; +import com.webank.wedatasphere.exchangis.datasource.core.context.ExchangisDataSourceContext; +import com.webank.wedatasphere.exchangis.datasource.core.ui.*; +import com.webank.wedatasphere.exchangis.datasource.core.ui.viewer.DefaultDataSourceUIViewer; +import com.webank.wedatasphere.exchangis.datasource.core.ui.viewer.ExchangisDataSourceUIViewer; +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import com.webank.wedatasphere.exchangis.datasource.core.vo.ExchangisJobDataSourcesContent; +import com.webank.wedatasphere.exchangis.datasource.core.vo.ExchangisJobInfoContent; +import com.webank.wedatasphere.exchangis.datasource.core.vo.ExchangisJobParamsContent; +import com.webank.wedatasphere.exchangis.datasource.core.vo.ExchangisJobTransformsContent; +import com.webank.wedatasphere.exchangis.datasource.dto.GetDataSourceInfoResultDTO; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobEntity; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.datasource.client.impl.LinkisDataSourceRemoteClient; +import org.apache.linkis.datasource.client.request.GetInfoByDataSourceIdAction; +import org.apache.linkis.httpclient.response.Result; +import org.apache.linkis.server.security.SecurityFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.servlet.http.HttpServletRequest; +import java.util.*; +import java.util.stream.Collectors; + +public class AbstractDataSourceService { + protected final ObjectMapper mapper = new ObjectMapper(); + protected final ExchangisDataSourceContext context; + protected final ExchangisJobParamConfigMapper exchangisJobParamConfigMapper; + + private final static Logger LOG = LoggerFactory.getLogger(AbstractDataSourceService.class); + + + public AbstractDataSourceService(ExchangisDataSourceContext context, ExchangisJobParamConfigMapper exchangisJobParamConfigMapper) { + this.context = context; + this.exchangisJobParamConfigMapper = exchangisJobParamConfigMapper; + } + + protected List parseJobContent(String content) { + List jobInfoContents; + if (Strings.isNullOrEmpty(content)) { + jobInfoContents = new ArrayList<>(); + } else { + try { + jobInfoContents = this.mapper.readValue(content, new TypeReference>() { + }); + } catch (JsonProcessingException e) { + jobInfoContents = new ArrayList<>(); + } + } + return jobInfoContents; + } + + private ExchangisDataSourceIdsUI buildDataSourceIdsUI(ExchangisJobInfoContent content) { + return this.buildDataSourceIdsUI(null, content); + } + + private ExchangisDataSourceIdsUI buildDataSourceIdsUI(HttpServletRequest request, ExchangisJobInfoContent content) { + String loginUser = Optional.ofNullable(request).isPresent() ? SecurityFilter.getLoginUsername(request) : null; + ExchangisJobDataSourcesContent dataSources = content.getDataSources(); + if (Objects.isNull(dataSources)) { + return null; + } + + String sourceId = dataSources.getSourceId(); + String sinkId = dataSources.getSinkId(); + + if (Strings.isNullOrEmpty(sourceId) && Strings.isNullOrEmpty(sinkId)) { + return null; + } + + ExchangisDataSourceIdsUI ids = new ExchangisDataSourceIdsUI(); + if (!Strings.isNullOrEmpty(sourceId)) { + String[] split = sourceId.trim().split("\\."); + ExchangisDataSourceIdUI source = new ExchangisDataSourceIdUI(); + source.setType(split[0]); + source.setId(split[1]); + Optional.ofNullable(loginUser).ifPresent(u -> { + Optional.ofNullable(this.context.getExchangisDataSource(split[0])).ifPresent(o -> { + LinkisDataSourceRemoteClient dsClient = o.getDataSourceRemoteClient(); + GetInfoByDataSourceIdAction action = GetInfoByDataSourceIdAction.builder() + .setDataSourceId(Long.parseLong(split[1])) + .setUser(u) + .setSystem(split[0]) + .build(); + + Result execute = dsClient.execute(action); + String responseBody = execute.getResponseBody(); + GetDataSourceInfoResultDTO dsInfo = null; + dsInfo = Json.fromJson(responseBody, GetDataSourceInfoResultDTO.class); + assert dsInfo != null; + source.setDs(dsInfo.getData().getInfo().getDataSourceName()); + }); + }); + source.setDb(split[2]); + source.setTable(split[3]); + + ids.setSource(source); + } + + if (!Strings.isNullOrEmpty(sinkId)) { + String[] split = sinkId.trim().split("\\."); + ExchangisDataSourceIdUI sink = new ExchangisDataSourceIdUI(); + sink.setType(split[0]); + sink.setId(split[1]); + Optional.ofNullable(loginUser).ifPresent(u -> { + Optional.ofNullable(this.context.getExchangisDataSource(split[0])).ifPresent(o -> { + LinkisDataSourceRemoteClient dsClient = o.getDataSourceRemoteClient(); + GetInfoByDataSourceIdAction action = GetInfoByDataSourceIdAction.builder() + .setDataSourceId(Long.parseLong(split[1])) + .setUser(u) + .setSystem(split[0]) + .build(); + Result execute = dsClient.execute(action); + String responseBody = execute.getResponseBody(); + GetDataSourceInfoResultDTO dsInfo = null; + dsInfo = Json.fromJson(responseBody, GetDataSourceInfoResultDTO.class); + assert dsInfo != null; + sink.setDs(dsInfo.getData().getInfo().getDataSourceName()); + }); + }); + + sink.setDb(split[2]); + sink.setTable(split[3]); + + ids.setSink(sink); + } + return ids; + } + + protected ExchangisDataSourceParamsUI buildDataSourceParamsUI(ExchangisJobInfoContent content) { + ExchangisDataSourceIdsUI dataSourceIdsUI = buildDataSourceIdsUI(content); + + ExchangisJobParamsContent params = content.getParams(); + List sourceParamConfigs = Collections.emptyList(); + List sinkParamConfigs = Collections.emptyList(); + if (null != dataSourceIdsUI) { + ExchangisDataSourceIdUI source = dataSourceIdsUI.getSource(); + if (null != source) { + String type = source.getType(); + ExchangisDataSource exchangisSourceDataSource = this.context.getExchangisDataSource(type); + if (null != exchangisSourceDataSource) { + sourceParamConfigs = exchangisSourceDataSource.getDataSourceParamConfigs().stream().filter( + i -> i.getConfigDirection().equals(content.getEngine() + "-SOURCE") || "SOURCE".equalsIgnoreCase(i.getConfigDirection())).collect(Collectors.toList()); + } + } + + ExchangisDataSourceIdUI sink = dataSourceIdsUI.getSink(); + if (null != sink) { + String type = sink.getType(); + ExchangisDataSource exchangisSinkDataSource = this.context.getExchangisDataSource(type); + if (null != exchangisSinkDataSource) { + sinkParamConfigs = exchangisSinkDataSource.getDataSourceParamConfigs().stream().filter(i -> + i.getConfigDirection().equals(content.getEngine() + "-SINK") || "SINK".equalsIgnoreCase(i.getConfigDirection())).collect(Collectors.toList()); + } + } + } + + List sourceParamsItems = Collections.emptyList(); + List sinkParamsItems = Collections.emptyList(); + if (null != params && null != params.getSources()) { + sourceParamsItems = params.getSources(); + } + if (null != params && null != params.getSinks()) { + sinkParamsItems = params.getSinks(); + } + + List> jobDataSourceParamsUI1 = buildDataSourceParamsFilledValueUI(sourceParamConfigs, sourceParamsItems); + List> jobDataSourceParamsUI2 = buildDataSourceParamsFilledValueUI(sinkParamConfigs, sinkParamsItems); + ExchangisDataSourceParamsUI paramsUI = new ExchangisDataSourceParamsUI(); + paramsUI.setSources(jobDataSourceParamsUI1); + paramsUI.setSinks(jobDataSourceParamsUI2); + return paramsUI; + } + + protected ExchangisDataSourceUIViewer buildAllUI(HttpServletRequest request, ExchangisJobEntity job, ExchangisJobInfoContent content) { + // ----------- 构建 dataSourceIdsUI + ExchangisDataSourceIdsUI dataSourceIdsUI = buildDataSourceIdsUI(request, content); + + // ----------- 构建 dataSourceParamsUI + ExchangisDataSourceParamsUI paramsUI = buildDataSourceParamsUI(content); + + // ----------- 构建 dataSourceTransformsUI + ExchangisJobTransformsContent transforms = content.getTransforms(); + transforms.setAddEnable(!("HIVE".equals(dataSourceIdsUI.getSource().getType()) || "HIVE".equals(dataSourceIdsUI.getSink().getType()))); + +// ExchangisDataSourceTransformsUI dataSourceTransFormsUI = ExchangisDataSourceUIViewBuilder.getDataSourceTransFormsUI(transforms); + + List> jobDataSourceSettingsUI = this.buildJobSettingsUI(job.getEngineType(), content); + + return new DefaultDataSourceUIViewer(content.getSubJobName(), dataSourceIdsUI, paramsUI, transforms, jobDataSourceSettingsUI); + } + + + protected List> buildJobSettingsUI(String jobEngineType) { + if (Strings.isNullOrEmpty(jobEngineType)) { + return Collections.emptyList(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("type", jobEngineType); + queryWrapper.eq("is_hidden", 0); + queryWrapper.eq("status", 1); + List settingParamConfigs = exchangisJobParamConfigMapper.selectList(queryWrapper); + return buildDataSourceParamsFilledValueUI(settingParamConfigs, null); + } + + protected List> buildJobSettingsUI(String jobEngineType, ExchangisJobInfoContent content) { + if (Strings.isNullOrEmpty(jobEngineType)) { + return Collections.emptyList(); + } + List settings = content.getSettings(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("type", jobEngineType); + queryWrapper.eq("is_hidden", 0); + queryWrapper.eq("status", 1); + List settingParamConfigs = exchangisJobParamConfigMapper.selectList(queryWrapper); + return buildDataSourceParamsFilledValueUI(settingParamConfigs, settings); + } + + protected List> buildDataSourceParamsUI(List paramConfigs) { + List> uis = new ArrayList<>(); + if (!Objects.isNull(paramConfigs) && !paramConfigs.isEmpty()) { + for (ExchangisJobParamConfig cfg : paramConfigs) { + ElementUI ui = fillElementUIValue(cfg, ""); + uis.add(ui); + } + } + return uis; + } + + protected List> buildDataSourceParamsFilledValueUI(List paramConfigs, List paramsList) { + List> uis = new ArrayList<>(); + if (!Objects.isNull(paramConfigs) && !paramConfigs.isEmpty()) { + for (ExchangisJobParamConfig cfg : paramConfigs) { + if (Objects.isNull(paramsList) || paramsList.isEmpty()) { + uis.add(fillElementUIValue(cfg, "")); + continue; + } + ExchangisJobParamsContent.ExchangisJobParamsItem selectedParamItem = getJobParamsItem(cfg.getConfigKey(), paramsList); + if (Objects.isNull(selectedParamItem)) { + ElementUI ui = fillElementUIValue(cfg, ""); + uis.add(ui); + } else { + ElementUI ui = fillElementUIValue(cfg, selectedParamItem.getConfigValue()); + uis.add(ui); + } + } + } + return uis; + } + + private ExchangisJobParamsContent.ExchangisJobParamsItem getJobParamsItem(String configKey, List sources) { + for (ExchangisJobParamsContent.ExchangisJobParamsItem item : sources) { + if (item.getConfigKey().equalsIgnoreCase(configKey)) { + return item; + } + } + return null; + } + + private ElementUI fillElementUIValue(ExchangisJobParamConfig config, Object value) { + String uiType = config.getUiType(); + ElementUI.Type uiTypeEnum; + try { + uiTypeEnum = StringUtils.isNotBlank(uiType)? + ElementUI.Type.valueOf(uiType.toUpperCase(Locale.ROOT)) : ElementUI.Type.NONE; + }catch (Exception e){ + uiTypeEnum = ElementUI.Type.NONE; + } + switch (uiTypeEnum) { + case OPTION: + return fillOptionElementUIValue(config, String.valueOf(value)); + case INPUT: + return fillInputElementUIValue(config, String.valueOf(value)); + case MAP: + Map mapElement = null; + try { + mapElement = Json.fromJson(Json.toJson(value, null), + Map.class, String.class, Object.class); + } catch (Exception e) { + LOG.info("Exception happened while parse json"+ "Config value: " + value + "message: " + e.getMessage(), e); + } + return fillMapElementUIValue(config, mapElement); + default: + return null; + } + } + + + private OptionElementUI fillOptionElementUIValue(ExchangisJobParamConfig config, String value) { + String valueRange = config.getValueRange(); + List values = Collections.emptyList(); + try { + values = mapper.readValue(valueRange, List.class); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + + OptionElementUI ui = new OptionElementUI(); + ui.setKey(config.getConfigKey()); + ui.setField(config.getUiField()); + ui.setLabel(config.getUiLabel()); + ui.setValues(values); + ui.setValue(value); + ui.setDefaultValue(config.getDefaultValue()); + ui.setSort(config.getSort()); + ui.setRequired(config.getRequired()); + ui.setUnit(config.getUnit()); + return ui; + } + + private InputElementUI fillInputElementUIValue(ExchangisJobParamConfig config, String value) { + InputElementUI ui = new InputElementUI(); + ui.setKey(config.getConfigKey()); + ui.setField(config.getUiField()); + ui.setLabel(config.getUiLabel()); + ui.setValue(value); + ui.setDefaultValue(config.getDefaultValue()); + ui.setSort(config.getSort()); + ui.setRequired(config.getRequired()); + ui.setUnit(config.getUnit()); + ui.setSource(config.getSource()); + ui.setValidateType(config.getValidateType()); + ui.setValidateRange(config.getValidateRange()); + ui.setValidateMsg(config.getValidateMsg()); + return ui; + } + + private MapElementUI fillMapElementUIValue(ExchangisJobParamConfig config, Map value) { + MapElementUI ui = new MapElementUI(); + ui.setKey(config.getConfigKey()); + ui.setField(config.getUiField()); + ui.setLabel(config.getUiLabel()); + ui.setValue(value); + //ui.setDefaultValue(config.getDefaultValue()); + ui.setSort(config.getSort()); + ui.setRequired(config.getRequired()); + ui.setUnit(config.getUnit()); + ui.setSource(config.getSource()); + ui.setValidateType(config.getValidateType()); + ui.setValidateRange(config.getValidateRange()); + ui.setValidateMsg(config.getValidateMsg()); + return ui; + } + +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/service/DataSourceRenderService.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/service/DataSourceRenderService.java new file mode 100644 index 000000000..8e237fa48 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/service/DataSourceRenderService.java @@ -0,0 +1,16 @@ +package com.webank.wedatasphere.exchangis.datasource.service; + +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisDataSourceException; +import com.webank.wedatasphere.exchangis.datasource.core.ui.ElementUI; + +public interface DataSourceRenderService { + + /** + * Get the partition info and render to element + * @param userName userName + * @return element ui + */ + ElementUI getPartitionAndRender(String userName, + Long dataSourceId, String database, String table, ElementUI.Type uiType) throws ExchangisDataSourceException; + +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/service/DataSourceUIGetter.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/service/DataSourceUIGetter.java new file mode 100644 index 000000000..1b0897518 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/service/DataSourceUIGetter.java @@ -0,0 +1,20 @@ +package com.webank.wedatasphere.exchangis.datasource.service; + +import com.webank.wedatasphere.exchangis.datasource.core.ui.ElementUI; +import com.webank.wedatasphere.exchangis.datasource.core.ui.viewer.ExchangisDataSourceUIViewer; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +public interface DataSourceUIGetter { + + // 根据已经创建的 Job 来获取该 Job DataSource 的配置信息 + List getJobDataSourceUIs(HttpServletRequest request, Long jobId); + + // 在新建 Job 的时候,右侧需要根据选择的数据源类型来获取参数设置项 + List> getDataSourceParamsUI(String dsType, String dir); + + // 在新建 Job 的时候,右侧需要根据选择的引擎类型来获取参数设置项 + List> getJobEngineSettingsUI(String engineType); + +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/service/ExchangisDataSourceService.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/service/ExchangisDataSourceService.java new file mode 100644 index 000000000..7a3c4e599 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/service/ExchangisDataSourceService.java @@ -0,0 +1,1280 @@ +package com.webank.wedatasphere.exchangis.datasource.service; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.google.common.base.Strings; +import com.webank.wedatasphere.exchangis.dao.domain.ExchangisJobDsBind; +import com.webank.wedatasphere.exchangis.dao.domain.ExchangisJobParamConfig; +import com.webank.wedatasphere.exchangis.dao.mapper.ExchangisJobDsBindMapper; +import com.webank.wedatasphere.exchangis.dao.mapper.ExchangisJobParamConfigMapper; +import com.webank.wedatasphere.exchangis.datasource.GetDataSourceInfoByIdAndVersionIdAction; +import com.webank.wedatasphere.exchangis.datasource.core.ExchangisDataSource; +import com.webank.wedatasphere.exchangis.datasource.core.context.ExchangisDataSourceContext; +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisDataSourceException; +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisDataSourceExceptionCode; +import com.webank.wedatasphere.exchangis.datasource.core.ui.ElementUI; +import com.webank.wedatasphere.exchangis.datasource.core.ui.ExchangisDataSourceParamsUI; +import com.webank.wedatasphere.exchangis.datasource.core.ui.viewer.ExchangisDataSourceUIViewer; +import com.webank.wedatasphere.exchangis.datasource.core.vo.ExchangisJobInfoContent; +import com.webank.wedatasphere.exchangis.datasource.core.vo.ExchangisJobTransformsContent; +import com.webank.wedatasphere.exchangis.datasource.dto.*; +import com.webank.wedatasphere.exchangis.datasource.linkis.ExchangisLinkisRemoteClient; +import com.webank.wedatasphere.exchangis.datasource.linkis.request.ParamsTestConnectAction; +import com.webank.wedatasphere.exchangis.datasource.linkis.response.ParamsTestConnectResult; +import com.webank.wedatasphere.exchangis.datasource.vo.DataSourceCreateVO; +import com.webank.wedatasphere.exchangis.datasource.vo.DataSourceQueryVO; +import com.webank.wedatasphere.exchangis.datasource.vo.FieldMappingVO; +import com.webank.wedatasphere.exchangis.job.api.ExchangisJobOpenService; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobEntity; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import org.apache.linkis.common.exception.ErrorException; +import org.apache.linkis.datasource.client.impl.LinkisDataSourceRemoteClient; +import org.apache.linkis.datasource.client.impl.LinkisMetaDataRemoteClient; +import org.apache.linkis.datasource.client.request.*; +import org.apache.linkis.datasource.client.response.*; +import org.apache.linkis.datasourcemanager.common.domain.DataSource; +import org.apache.linkis.datasourcemanager.common.domain.DataSourceType; +import org.apache.linkis.datasourcemanager.common.exception.JsonErrorException; +import org.apache.linkis.datasourcemanager.common.util.json.Json; +import org.apache.linkis.httpclient.response.Result; +import org.apache.linkis.metadatamanager.common.domain.MetaColumnInfo; +import org.apache.linkis.server.Message; +import org.apache.linkis.server.security.SecurityFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.*; + +import static com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisDataSourceExceptionCode.*; + +@Service +public class ExchangisDataSourceService extends AbstractDataSourceService implements DataSourceUIGetter{ + + private static final Logger LOGGER = LoggerFactory.getLogger(ExchangisDataSourceService.class); + + + @Autowired + public ExchangisDataSourceService(ExchangisDataSourceContext context, + ExchangisJobParamConfigMapper exchangisJobParamConfigMapper) { + super(context, exchangisJobParamConfigMapper); + mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + } + + @Resource + private ExchangisJobOpenService jobOpenService; + + @Autowired + private ExchangisJobDsBindMapper exchangisJobDsBindMapper; + @Override + public List getJobDataSourceUIs(HttpServletRequest request, Long jobId) { + if (Objects.isNull(jobId)) { + return null; + } + + ExchangisJobEntity job; + try { + job = this.jobOpenService.getJobById(jobId, false); + } catch (ExchangisJobException e) { + throw new ExchangisDataSourceException + .Runtime(CONTEXT_GET_DATASOURCE_NULL.getCode(), "Fail to get job entity (获得任务信息失败)", e); + } + if (Objects.isNull(job)) { + return null; + } + + List jobInfoContents = this.parseJobContent(job.getJobContent()); + List uis = new ArrayList<>(); + for (ExchangisJobInfoContent cnt : jobInfoContents) { + cnt.setEngine(job.getEngineType()); + ExchangisDataSourceUIViewer viewer = buildAllUI(request, job, cnt); + uis.add(viewer); + } + + return uis; + } + + // 根据数据源类型获取参数 + @Override + public List> getDataSourceParamsUI(String dsType, String engineAndDirection) { + + ExchangisDataSource exchangisDataSource = this.context.getExchangisDataSource(dsType); + List paramConfigs = exchangisDataSource.getDataSourceParamConfigs(); + List filteredConfigs = new ArrayList<>(); + String[] engineDirect = engineAndDirection.split("-"); + String direction = engineDirect[1]; + for (ExchangisJobParamConfig paramConfig : paramConfigs) { + Optional.ofNullable(paramConfig.getConfigDirection()).ifPresent(configDirection -> { + if (configDirection.equalsIgnoreCase(engineAndDirection) || configDirection.equalsIgnoreCase(direction)){ + filteredConfigs.add(paramConfig); + } + }); + } + return this.buildDataSourceParamsUI(filteredConfigs); + } + + @Override + public List> getJobEngineSettingsUI(String engineType) { + return this.buildJobSettingsUI(engineType); + } + + /** + * 根据 LocalExchangisDataSourceLoader 加载到的本地的数据源与 Linkis 支持的数据源 + * 做比较,筛选出可以给前端展示的数据源类型 + */ + public Message listDataSources(HttpServletRequest request) throws Exception { + Collection all = this.context.all(); + List dtos = new ArrayList<>(); + + String userName = SecurityFilter.getLoginUsername(request); + LOGGER.info("listDataSources userName: {}" + userName); + // 通过 datasourcemanager 获取的数据源类型和context中的数据源通过 type 和 name 比较 + // 以 exchangis 中注册了的数据源集合为准 + + LinkisDataSourceRemoteClient linkisDataSourceRemoteClient = ExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); + GetAllDataSourceTypesResult result; + try { + result = linkisDataSourceRemoteClient.getAllDataSourceTypes(GetAllDataSourceTypesAction.builder() + .setUser(userName) + .build() + ); + } catch (Exception e) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_GET_TYPES_ERROR.getCode(), e.getMessage()); + } + + if (Objects.isNull(result)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_GET_TYPES_ERROR.getCode(), "datasource get types null or empty"); + } + + List allDataSourceType = result.getAllDataSourceType(); + if (Objects.isNull(allDataSourceType)) allDataSourceType = Collections.emptyList(); + + for (DataSourceType type : allDataSourceType) { + for (ExchangisDataSource item : all) { + if (item.name().equalsIgnoreCase(type.getName())) { + ExchangisDataSourceDTO dto = new ExchangisDataSourceDTO( + type.getId(), + type.getClassifier(), +// item.classifier(), + item.name() + ); +// dto.setDescription(item.description()); +// dto.setIcon(item.icon()); +// dto.setOption(item.option()); + // use linkis datasource table field to fill the dto bean + dto.setIcon(type.getIcon()); + dto.setDescription(type.getDescription()); + dto.setOption(type.getOption()); + dtos.add(dto); + } + } + } + + return Message.ok().data("list", dtos); + } + + @Transactional + public Message create(HttpServletRequest request, /*String type, */DataSourceCreateVO vo) throws Exception { + //DataSourceCreateVO vo; + Map json; + try { + json = mapper.readValue(mapper.writeValueAsString(vo), Map.class); + json.put("labels",json.get("label")); + } catch (JsonProcessingException e) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.PARSE_JSON_ERROR.getCode(), e.getMessage()); + } + String comment = vo.getComment(); + String createSystem = vo.getCreateSystem(); + if (Objects.isNull(comment)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.PARAMETER_INVALID.getCode(), "parameter comment should not be null"); + } + + if (Strings.isNullOrEmpty(createSystem)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.PARAMETER_INVALID.getCode(), "parameter createSystem should not be empty"); + } + + + String user = SecurityFilter.getLoginUsername(request); + LOGGER.info("createDatasource userName:" + user); + + ExchangisDataSource exchangisDataSource = context.getExchangisDataSource(vo.getDataSourceTypeId()); + if (Objects.isNull(exchangisDataSource)) { + throw new ExchangisDataSourceException(CONTEXT_GET_DATASOURCE_NULL.getCode(), "exchangis context get datasource null"); + } + + LinkisDataSourceRemoteClient client = exchangisDataSource.getDataSourceRemoteClient(); + LOGGER.info("create datasource json as follows"); + Set> entries = json.entrySet(); + for (Map.Entry entry : entries) { + LOGGER.info("key {} : value {}", entry.getKey(), entry.getValue()); + } +// CreateDataSourceResult result; + String responseBody; + try { + + Result execute = client.execute(CreateDataSourceAction.builder() + .setUser(user) + .addRequestPayloads(json) + .build() + ); + responseBody = execute.getResponseBody(); + } catch (Exception e) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_CREATE_ERROR.getCode(), e.getMessage()); + } + +// if (Objects.isNull(result)) { + if (Strings.isNullOrEmpty(responseBody)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_CREATE_ERROR.getCode(), "datasource create response null or empty"); + } + + CreateDataSourceSuccessResultDTO result = Json.fromJson(responseBody, CreateDataSourceSuccessResultDTO.class); + if (result.getStatus() != 0) { + throw new ExchangisDataSourceException(result.getStatus(), result.getMessage()); + } +// Long dataSourceId = result.getInsert_id(); + Long dataSourceId = result.getData().getId(); + UpdateDataSourceParameterResult updateDataSourceParameterResult; + try { + // 创建完成后发布数据源参数,形成一个版本 + updateDataSourceParameterResult = client.updateDataSourceParameter( + UpdateDataSourceParameterAction.builder() + .setUser(user) + .setDataSourceId(Long.parseLong(dataSourceId + "")) + .addRequestPayloads(json) + .build() + ); + } catch (Exception e) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_UPDATE_PARAMS_VERSION_ERROR.getCode(), e.getMessage()); + } + + if (Objects.isNull(updateDataSourceParameterResult)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_UPDATE_PARAMS_VERSION_ERROR.getCode(), "datasource update params version null or empty"); + } + + if (updateDataSourceParameterResult.getStatus() != 0) { + throw new ExchangisDataSourceException(updateDataSourceParameterResult.getStatus(), updateDataSourceParameterResult.getMessage()); + } + return Message.ok().data("id", dataSourceId); + } + + @Transactional + public Message updateDataSource(HttpServletRequest request,/* String type,*/ Long id, DataSourceCreateVO vo) throws Exception { + + Map json; + try { + json = mapper.readValue(mapper.writeValueAsString(vo), Map.class); + json.put("labels",json.get("label")); + } catch (JsonProcessingException e) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.PARSE_JSON_ERROR.getCode(), e.getMessage()); + } + String comment = vo.getComment(); + String createSystem = vo.getCreateSystem(); + if (Objects.isNull(comment)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.PARAMETER_INVALID.getCode(), "parameter comment should not be null"); + } + + if (Strings.isNullOrEmpty(createSystem)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.PARAMETER_INVALID.getCode(), "parameter createSystem should not be empty"); + } + String user = SecurityFilter.getLoginUsername(request); + LOGGER.info("updateDataSource userName:" + user); + + LOGGER.info("DataSourceTypeId:" + vo.getDataSourceTypeId()); + ExchangisDataSource exchangisDataSource = context.getExchangisDataSource(vo.getDataSourceTypeId()); + if (Objects.isNull(exchangisDataSource)) { + throw new ExchangisDataSourceException(30401, "exchangis.datasource.null"); + } + + LinkisDataSourceRemoteClient client = exchangisDataSource.getDataSourceRemoteClient(); +// UpdateDataSourceResult updateDataSourceResult; + String responseBody; + try { + Result execute = client.execute(UpdateDataSourceAction.builder() + .setUser(user) + .setDataSourceId(Long.parseLong(id + "")) + .addRequestPayloads(json) + .build() + ); + responseBody = execute.getResponseBody(); + } catch (Exception e) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_UPDATE_ERROR.getCode(), e.getMessage()); + } + +// if (Objects.isNull(updateDataSourceResult)) { + if (Strings.isNullOrEmpty(responseBody)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_UPDATE_ERROR.getCode(), "datasource update null or empty"); + } + + UpdateDataSourceSuccessResultDTO updateDataSourceResult = Json.fromJson(responseBody, UpdateDataSourceSuccessResultDTO.class); + + if (updateDataSourceResult.getStatus() != 0) { + throw new ExchangisDataSourceException(updateDataSourceResult.getStatus(), updateDataSourceResult.getMessage()); + } + + UpdateDataSourceParameterResult updateDataSourceParameterResult; + try { + updateDataSourceParameterResult = client.updateDataSourceParameter( + UpdateDataSourceParameterAction.builder() + .setDataSourceId(Long.parseLong(id + "")) + .setUser(user) + .addRequestPayloads(json) + .build() + ); + } catch (Exception e) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_UPDATE_PARAMS_VERSION_ERROR.getCode(), e.getMessage()); + } + + if (Objects.isNull(updateDataSourceParameterResult)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_UPDATE_PARAMS_VERSION_ERROR.getCode(), "datasource update params version null or empty"); + } + + if (updateDataSourceParameterResult.getStatus() != 0) { + throw new ExchangisDataSourceException(updateDataSourceParameterResult.getStatus(), updateDataSourceParameterResult.getMessage()); + } + + return Message.ok(); + } + + @Transactional + public Message deleteDataSource(HttpServletRequest request, /*String type,*/ Long id) throws Exception { + + QueryWrapper condition = new QueryWrapper<>(); + condition.eq("source_ds_id", id).or().eq("sink_ds_id", id); + Integer inUseCount = this.exchangisJobDsBindMapper.selectCount(condition); + if (inUseCount > 0) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_DELETE_ERROR.getCode(), "目前存在引用依赖"); + } + + LinkisDataSourceRemoteClient dataSourceRemoteClient = ExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); + // DeleteDataSourceResult result; + + String responseBody; + try { + String user = SecurityFilter.getLoginUsername(request); + LOGGER.info("deleteDataSource userName:" + user); +// result = dataSourceRemoteClient.deleteDataSource( +// new DeleteDataSourceAction.Builder().setUser(user).setResourceId(id+"").builder() +// ); + + Result execute = dataSourceRemoteClient.execute( + new DeleteDataSourceAction.Builder().setUser(user).setDataSourceId(Long.parseLong(id + "")).builder() + ); + responseBody = execute.getResponseBody(); + + } catch (Exception e) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_DELETE_ERROR.getCode(), e.getMessage()); + } + +// if (Objects.isNull(result)) { + if (Strings.isNullOrEmpty(responseBody)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_DELETE_ERROR.getCode(), "datasource delete null or empty"); + } + + DeleteDataSourceSuccessResultDTO result = Json.fromJson(responseBody, DeleteDataSourceSuccessResultDTO.class); + + if (result.getStatus() != 0) { + throw new ExchangisDataSourceException(result.getStatus(), result.getMessage()); + } +// return Message.ok().data("id", result.getRemove_id()); + return Message.ok().data("id", result.getData().getId()); + } + + public Message queryDataSourceDBs(HttpServletRequest request, String type, Long id) throws Exception { + ExchangisDataSource exchangisDataSource = context.getExchangisDataSource(type); + LinkisMetaDataRemoteClient metaDataRemoteClient = exchangisDataSource.getMetaDataRemoteClient(); + + String userName = SecurityFilter.getLoginUsername(request); + LOGGER.info("queryDataSourceDBs userName:" + userName); + MetadataGetDatabasesResult databases; + try { + databases = metaDataRemoteClient.getDatabases(MetadataGetDatabasesAction.builder() +// .setSystem("system") + .setSystem(type) + .setDataSourceId(id) + .setUser(userName) + .build()); + } catch (Exception e) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_METADATA_GET_DATABASES_ERROR.getCode(), e.getMessage()); + } + + if (Objects.isNull(databases)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_METADATA_GET_DATABASES_ERROR.getCode(), "metadata get databases null or empty"); + } + + List dbs = Optional.ofNullable(databases.getDbs()).orElse(new ArrayList<>()); + + return Message.ok().data("dbs", dbs); + } + + public Message queryDataSourceDBTables(HttpServletRequest request, String type, Long id, String dbName) throws Exception { + String user = SecurityFilter.getLoginUsername(request); + LOGGER.info("queryDataSourceDBTables userName:" + user); + + ExchangisDataSource exchangisDataSource = context.getExchangisDataSource(type); + MetadataGetTablesResult tables; + try { + LinkisMetaDataRemoteClient metaDataRemoteClient = exchangisDataSource.getMetaDataRemoteClient(); + tables = metaDataRemoteClient.getTables(MetadataGetTablesAction.builder() + .setSystem(type) + .setDataSourceId(id) + .setDatabase(dbName) + .setUser(user) + .build() + ); + } catch (Exception e) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_METADATA_GET_TABLES_ERROR.getCode(), e.getMessage()); + } + + if (Objects.isNull(tables)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_METADATA_GET_TABLES_ERROR.getCode(), "metadata get tables null or empty"); + } + + List tbs = Optional.ofNullable(tables.getTables()).orElse(new ArrayList<>()); + + return Message.ok().data("tbs", tbs); + } + + public Message getJobDataSourceParamsUI(Long jobId) { + if (Objects.isNull(jobId)) { + return null; + } + + ExchangisJobEntity job; + try { + job = this.jobOpenService.getJobById(jobId, false); + } catch (ExchangisJobException e) { + throw new ExchangisDataSourceException + .Runtime(CONTEXT_GET_DATASOURCE_NULL.getCode(), "Fail to get job entity (获得任务信息失败)", e); + } + + if (Objects.isNull(job)) { + return null; + } + + List jobInfoContents = this.parseJobContent(job.getJobContent()); + List uis = new ArrayList<>(); + for (ExchangisJobInfoContent cnt : jobInfoContents) { + uis.add(this.buildDataSourceParamsUI(cnt)); + } + + return Message.ok().data("ui", uis); + } + + public Message getJobDataSourceTransformsUI(Long jobId) { + if (Objects.isNull(jobId)) { + return null; + } + + ExchangisJobEntity job; + try { + job = this.jobOpenService.getJobById(jobId, false); + } catch (ExchangisJobException e) { + throw new ExchangisDataSourceException + .Runtime(CONTEXT_GET_DATASOURCE_NULL.getCode(), "Fail to get job entity (获得任务信息失败)", e); + } + if (Objects.isNull(job)) { + return null; + } + + String jobContent = job.getJobContent(); + ExchangisJobInfoContent content; + // 转换 content + if (Strings.isNullOrEmpty(jobContent)) { + content = new ExchangisJobInfoContent(); + } else { + try { + content = this.mapper.readValue(jobContent, ExchangisJobInfoContent.class); + } catch (JsonProcessingException e) { + content = new ExchangisJobInfoContent(); + } + } + + // ----------- 构建 dataSourceTransformsUI + ExchangisJobTransformsContent transforms = content.getTransforms(); + + return Message.ok().data("ui", transforms); + } + + public Message getJobDataSourceSettingsUI(Long jobId, String jobName) throws Exception { + if (Objects.isNull(jobId) || Strings.isNullOrEmpty(jobName)) { + return null; + } + + ExchangisJobEntity job; + try { + job = this.jobOpenService.getJobById(jobId, false); + } catch (ExchangisJobException e) { + throw new ExchangisDataSourceException + .Runtime(CONTEXT_GET_DATASOURCE_NULL.getCode(), "Fail to get job entity (获得任务信息失败)", e); + } + if (Objects.isNull(job)) { + return null; + } + + List contents = this.parseJobContent(job.getJobContent()); + + for (ExchangisJobInfoContent content : contents) { + if (content.getSubJobName().equalsIgnoreCase(jobName)) { + List> uis = this.buildJobSettingsUI(job.getEngineType(), content); + return Message.ok().data("uis", uis); + } + } + + return Message.ok().data("ui", Collections.emptyList()); + + } + + public Message queryDataSourceDBTableFields(HttpServletRequest request, String type, Long id, String dbName, String tableName) throws Exception { + ExchangisDataSource exchangisDataSource = context.getExchangisDataSource(type); + LinkisMetaDataRemoteClient metaDataRemoteClient = exchangisDataSource.getMetaDataRemoteClient(); + + String user = SecurityFilter.getLoginUsername(request); + LOGGER.info("queryDataSourceDBTableFields userName:" + user); + List allColumns; + try { + MetadataGetColumnsResult columns = metaDataRemoteClient.getColumns(MetadataGetColumnsAction.builder() + .setSystem(type) + .setDataSourceId(id) + .setDatabase(dbName) + .setTable(tableName) + .setUser(user) + .build()); + + allColumns = columns.getAllColumns(); + } catch (Exception e) { + throw new ExchangisDataSourceException(CLIENT_METADATA_GET_COLUMNS_ERROR.getCode(), e.getMessage()); + } + + if (Objects.isNull(allColumns)) { + throw new ExchangisDataSourceException(CLIENT_METADATA_GET_COLUMNS_ERROR.getCode(), "metadata get columns null or empty"); + } + + List list = new ArrayList<>(); + allColumns.forEach(col -> { + DataSourceDbTableColumnDTO item = new DataSourceDbTableColumnDTO(); + item.setName(col.getName()); + item.setType(col.getType()); + list.add(item); + }); + + return Message.ok().data("columns", list); + } + + public Message queryDataSources(HttpServletRequest request, DataSourceQueryVO vo) throws Exception { + if (null == vo) { + vo = new DataSourceQueryVO(); + } + String username = SecurityFilter.getLoginUsername(request); + LOGGER.info("queryDataSources userName:" + username); + Integer page = Objects.isNull(vo.getPage()) ? 1 : vo.getPage(); + Integer pageSize = Objects.isNull(vo.getPageSize()) ? 100 : vo.getPageSize(); + + String dataSourceName = Objects.isNull(vo.getName()) ? "" : vo.getName(); + LinkisDataSourceRemoteClient linkisDataSourceRemoteClient = ExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); + QueryDataSourceResult result; + try { + QueryDataSourceAction.Builder builder = QueryDataSourceAction.builder() + .setSystem("system") + .setName(dataSourceName) + .setIdentifies("") + .setCurrentPage(page) + .setUser(username) + .setPageSize(pageSize); + + Long typeId = vo.getTypeId(); + if (!Objects.isNull(typeId)) { + builder.setTypeId(typeId); + } +// if (!Strings.isNullOrEmpty(dataSourceName)) { +// builder.setName(dataSourceName); +// } + if (!Strings.isNullOrEmpty(vo.getTypeName())) { + builder.setSystem(vo.getTypeName()); + } + + QueryDataSourceAction action = builder.build(); + result = linkisDataSourceRemoteClient.queryDataSource(action); + } catch (Exception e) { + if (e instanceof ErrorException) { + ErrorException ee = (ErrorException) e; + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_QUERY_DATASOURCE_ERROR.getCode(), e.getMessage(), ee.getIp(), ee.getPort(), ee.getServiceKind()); + } else { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_QUERY_DATASOURCE_ERROR.getCode(), e.getMessage()); + } + } + if (Objects.isNull(result)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_QUERY_DATASOURCE_ERROR.getCode(), "datasource query response body null or empty"); + } + + List allDataSource = result.getAllDataSource(); + + List dataSources = new ArrayList<>(); + allDataSource.forEach(ds -> { + DataSourceDTO item = new DataSourceDTO(); + item.setId(ds.getId()); + item.setCreateIdentify(ds.getCreateIdentify()); + item.setName(ds.getDataSourceName()); + item.setType(ds.getCreateSystem()); + item.setCreateSystem(ds.getCreateSystem()); + item.setDataSourceTypeId(ds.getDataSourceTypeId()); + item.setLabels(ds.getLabels()); + item.setLabel(ds.getLabels()); + item.setDesc(ds.getDataSourceDesc()); + item.setCreateUser(ds.getCreateUser()); + item.setModifyUser(ds.getModifyUser()); + item.setModifyTime(ds.getModifyTime()); + item.setVersionId(ds.getVersionId()); + item.setExpire(ds.isExpire()); + dataSources.add(item); + }); + + Message message = Message.ok(); + message.data("list", dataSources); + message.data("total", result.getTotalPage()); + return message; + //return Message.ok().data("list", dataSources); + } + + public Message listAllDataSources(HttpServletRequest request, String typeName, Long typeId, Integer page, Integer pageSize) throws ExchangisDataSourceException { + String userName = SecurityFilter.getLoginUsername(request); + LOGGER.info("listAllDataSources userName:" + userName); + + LinkisDataSourceRemoteClient linkisDataSourceRemoteClient = ExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); + QueryDataSourceAction.Builder builder = QueryDataSourceAction.builder() + .setSystem("system") + .setIdentifies("") + .setUser(userName); + + if (!Strings.isNullOrEmpty(typeName)) { + builder.setName(typeName); + } + if (!Objects.isNull(typeId)) { + builder.setTypeId(typeId); + } + if (!Objects.isNull(page)) { + builder.setCurrentPage(page); + } else { + builder.setCurrentPage(1); + } + if (!Objects.isNull(pageSize)) { + builder.setPageSize(pageSize); + } else { + builder.setPageSize(200); + } + + List allDataSource; + try { + QueryDataSourceResult result = linkisDataSourceRemoteClient.queryDataSource(builder.build()); + allDataSource = result.getAllDataSource(); + } catch (Exception e) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_QUERY_DATASOURCE_ERROR.getCode(), e.getMessage()); + } + List dataSources = new ArrayList<>(); + if (!Objects.isNull(allDataSource)) { + allDataSource.forEach(ds -> { + DataSourceDTO item = new DataSourceDTO(); + item.setId(ds.getId()); + item.setCreateIdentify(ds.getCreateIdentify()); + item.setName(ds.getDataSourceName()); + item.setType(ds.getDataSourceType().getName()); + item.setDataSourceTypeId(ds.getDataSourceTypeId()); + item.setModifyTime(ds.getModifyTime()); + item.setModifyUser(ds.getModifyUser()); + item.setCreateSystem(ds.getCreateSystem()); + item.setCreateIdentify(ds.getCreateIdentify()); + item.setCreateUser(ds.getCreateUser()); + item.setExpire(ds.isExpire()); + item.setLabels(ds.getLabels()); + item.setDesc(ds.getDataSourceDesc()); + item.setVersionId(ds.getVersionId()); + dataSources.add(item); + }); + } + return Message.ok().data("list", dataSources); + } + + public Message getDataSource(HttpServletRequest request, Long id, String versionId) throws ErrorException { + String userName = SecurityFilter.getLoginUsername(request); + LOGGER.info("getDataSource userName:" + userName); + GetDataSourceInfoResultDTO result; + if (Strings.isNullOrEmpty(versionId)) { + result = getDataSource(userName, id); + } else { + result = getDataSourceByIdAndVersionId(userName, id, versionId); + } +// GetDataSourceInfoResultDTO result = getDataSource(userName, id); + return Message.ok().data("info", result.getData().getInfo()); + } + + public GetDataSourceInfoResultDTO getDataSourceByIdAndVersionId(String userName, Long id, String versionId) throws ErrorException { + LinkisDataSourceRemoteClient linkisDataSourceRemoteClient = ExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); + try { + Result execute = linkisDataSourceRemoteClient.execute( + GetDataSourceInfoByIdAndVersionIdAction.builder().setSystem("system").setUser(userName).setDataSourceId(id).setVersionId(versionId).build() + ); + String responseBody = execute.getResponseBody(); + GetDataSourceInfoResultDTO result = Json.fromJson(responseBody, GetDataSourceInfoResultDTO.class); + if (result.getStatus() != 0) { + throw new ExchangisDataSourceException(result.getStatus(), result.getMessage()); + } + return result; + } catch (Exception e) { + if (e instanceof ErrorException) { + ErrorException ee = (ErrorException) e; + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_QUERY_DATASOURCE_ERROR.getCode(), e.getMessage(), ee.getIp(), ee.getPort(), ee.getServiceKind()); + } else { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_QUERY_DATASOURCE_ERROR.getCode(), e.getMessage()); + } + } + + } + + + public GetDataSourceInfoResultDTO getDataSource(String userName, Long id) throws ErrorException { + LinkisDataSourceRemoteClient linkisDataSourceRemoteClient = ExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); + try { + Result execute = linkisDataSourceRemoteClient.execute( + GetInfoByDataSourceIdAction.builder().setSystem("system").setUser(userName).setDataSourceId(id).build() + ); + String responseBody = execute.getResponseBody(); + GetDataSourceInfoResultDTO result = Json.fromJson(responseBody, GetDataSourceInfoResultDTO.class); + if (result.getStatus() != 0) { + throw new ExchangisDataSourceException(result.getStatus(), result.getMessage()); + } + return result; + } catch (Exception e) { + if (e instanceof ErrorException) { + ErrorException ee = (ErrorException) e; + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_QUERY_DATASOURCE_ERROR.getCode(), e.getMessage(), ee.getIp(), ee.getPort(), ee.getServiceKind()); + } else { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_QUERY_DATASOURCE_ERROR.getCode(), e.getMessage()); + } + } + } + + public Map getMetadata(String username, Long id, String type, String database, String table) throws ErrorException { + Map metas = new HashMap<>(); + GetDataSourceInfoResultDTO datasource = this.getDataSource(username, id); + Optional.ofNullable(datasource).ifPresent(ds -> { + Optional.ofNullable(ds.getData()).ifPresent(data -> { + Optional.ofNullable(data.getInfo()).ifPresent(info -> { + Optional.of(info.getConnectParams()).ifPresent(metas::putAll); + }); + }); + }); + + MetadataGetColumnsResultDTO columns = this.getDatasourceColumns(username, id, database, table); + + StringBuilder primaryKeys = new StringBuilder(); + Optional.ofNullable(columns).ifPresent(c -> { + Optional.ofNullable(c.getData()).ifPresent(data -> { + Optional.ofNullable(data.getColumns()).ifPresent(_cs -> { + _cs.stream().filter(MetadataGetColumnsResultDTO.Column::isPrimaryKey).forEach(_c -> { + primaryKeys.append(_c.getName()).append(","); + }); + }); + }); + }); + if (primaryKeys.length() > 0) { + metas.put("primary-keys", primaryKeys.toString().substring(0, primaryKeys.length() - 1)); + } + + MetadataGetTablePropsResultDTO metadata = this.getDatasourceMetadata(username, id, database, table); + Optional.ofNullable(metadata).ifPresent(meta -> { + Optional.ofNullable(meta.getData()).ifPresent(data -> { + Optional.ofNullable(data.getProps()).ifPresent(props -> { + props.forEach((k, v) -> { + switch (k) { + case "columns.types": + metas.put("columns-types", v); + break; + case "transient_lastDdlTime": + metas.put("transient-last-ddl-time", v); + break; + case "partition_columns.types": + metas.put("partition-columns-types", v); + break; + case "columns.comments": + metas.put("columns-comments", v); + break; + case "bucket_count": + metas.put("bucket-count", v); + break; + case "serialization.ddl": + metas.put("serialization-ddl", v); + break; + case "file.outputformat": + metas.put("file-outputformat", v); + break; + case "partition_columns": + metas.put("partition-columns", v); + break; + case "serialization.lib": + metas.put("serialization-lib", v); + break; + case "file.inputformat": + metas.put("file-inputformat", v); + break; + case "serialization.format": + metas.put("serialization-format", v); + break; + case "column.name.delimiter": + metas.put("column-name-delimiter", v); + break; + default: + metas.put(k, v); + } + }); + }); + }); + }); + + return metas; + } + + private MetadataGetColumnsResultDTO getDatasourceColumns(String username, Long id, String database, String table) throws ExchangisDataSourceException { + LinkisDataSourceRemoteClient linkisDataSourceRemoteClient = ExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); + Result execute = linkisDataSourceRemoteClient.execute( + MetadataGetColumnsAction.builder() + .setSystem("system") + .setUser(username) + .setDataSourceId(id) + .setDatabase(database) + .setTable(table) + .build() + ); + String responseBody = execute.getResponseBody(); + + MetadataGetColumnsResultDTO result = null; + try { + result = Json.fromJson(responseBody, MetadataGetColumnsResultDTO.class); + if (result.getStatus() != 0) { + throw new ExchangisDataSourceException(result.getStatus(), result.getMessage()); + } + } catch (JsonErrorException e) { + throw new ExchangisDataSourceException(CLIENT_METADATA_GET_COLUMNS_ERROR.getCode(), + "Fail to deserialize the columns resultSet", e); + } + + return result; + } + + private MetadataGetTablePropsResultDTO getDatasourceMetadata(String username, Long id, String database, String table) throws ExchangisDataSourceException { + + LinkisDataSourceRemoteClient linkisDataSourceRemoteClient = ExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); + Result execute = linkisDataSourceRemoteClient.execute( + MetadataGetTablePropsAction.builder() + .setSystem("system") + .setUser(username) + .setDataSourceId(id) + .setDatabase(database) + .setTable(table) + .build() + ); + String responseBody = execute.getResponseBody(); + + MetadataGetTablePropsResultDTO result = null; + try { + result = Json.fromJson(responseBody, MetadataGetTablePropsResultDTO.class); + if (result.getStatus() != 0) { + throw new ExchangisDataSourceException(result.getStatus(), result.getMessage()); + } + } catch (JsonErrorException e) { + throw new ExchangisDataSourceException(CLIENT_METADATA_GET_TABLES_ERROR.getCode(), + "Fail to deserialize the properties resultSet of table: [" + table + "], database: [" + database +"]", e); + } + return result; + + } + + public Message getDataSourceVersionsById(HttpServletRequest request, Long id) throws ErrorException { + LinkisDataSourceRemoteClient linkisDataSourceRemoteClient = ExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); + String userName = SecurityFilter.getLoginUsername(request); + LOGGER.info("getDataSourceVersionsById userName:" + userName); +// GetInfoByDataSourceIdResult result; + GetDataSourceInfoResultDTO result; + try { + // 先根据ID获取数据源详情 +// result = linkisDataSourceRemoteClient.getInfoByDataSourceId( +// GetInfoByDataSourceIdAction.builder().setSystem("system").setUser(userName).setDataSourceId(id).build() +// ); + + Result execute = linkisDataSourceRemoteClient.execute( + GetInfoByDataSourceIdAction.builder().setSystem("system").setUser(userName).setDataSourceId(id).build() + ); + String responseBody = execute.getResponseBody(); + + result = Json.fromJson(responseBody, GetDataSourceInfoResultDTO.class); + +// GetInfoByDataSourceIdResult result = linkisDataSourceRemoteClient.getInfoByDataSourceId( +// GetInfoByDataSourceIdAction.builder().setSystem("system").setUser(userName).setDataSourceId(id).build() +// ); + if (result.getStatus() != 0) { + throw new ExchangisDataSourceException(result.getStatus(), result.getMessage()); + } +// return Message.ok().data("info", result.getData().getInfo()); + + } catch (Exception e) { + if (e instanceof ErrorException) { + ErrorException ee = (ErrorException) e; + throw new ExchangisDataSourceException(CLIENT_GET_DATASOURCE_ERROR.getCode(), e.getMessage(), ee.getIp(), ee.getPort(), ee.getServiceKind()); + } else { + throw new ExchangisDataSourceException(CLIENT_GET_DATASOURCE_ERROR.getCode(), e.getMessage()); + } + } +// if (Objects.isNull(result)) { +// throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_GET_DATASOURCE_ERROR.getCode(), "response body null or empty"); +// } + + if (result.getStatus() != 0) { + throw new ExchangisDataSourceException(result.getStatus(), result.getMessage()); + } + + GetDataSourceInfoResultDTO.DataSourceItemDTO info = result.getData().getInfo(); + Integer publishedVersionId = info.getPublishedVersionId(); +// Long publishedVersionId = null; +// Map info = result.getInfo(); + +// if (!Objects.isNull(info)) { +// publishedVersionId = Long.parseLong(info.getOrDefault("publishedVersionId", "-1").toString()); +// } + + GetDataSourceVersionsResult versionsResult; + try { + versionsResult = linkisDataSourceRemoteClient.getDataSourceVersions( + new GetDataSourceVersionsAction.Builder().setUser(userName).setDataSourceId(Long.parseLong(id + "")).build() + ); + } catch (Exception e) { + if (e instanceof ErrorException) { + ErrorException ee = (ErrorException) e; + throw new ExchangisDataSourceException(CLIENT_GET_DATASOURCE_VERSION_ERROR.getCode(), e.getMessage(), ee.getIp(), ee.getPort(), ee.getServiceKind()); + } else { + throw new ExchangisDataSourceException(CLIENT_GET_DATASOURCE_VERSION_ERROR.getCode(), e.getMessage()); + } + } + if (Objects.isNull(versionsResult)) { + throw new ExchangisDataSourceException(CLIENT_GET_DATASOURCE_VERSION_ERROR.getCode(), "datasource version response body null or empty"); + } + + if (versionsResult.getStatus() != 0) { + throw new ExchangisDataSourceException(versionsResult.getStatus(), versionsResult.getMessage()); + } + + + List> versions = versionsResult.getVersions(); + + if (!Objects.isNull(versions) && !Objects.isNull(publishedVersionId)) { + for (Map version : versions) { + Object versionId = version.get("versionId"); + if (Objects.isNull(versionId)) { + continue; + } + int vid = Integer.parseInt(versionId.toString()); + if (vid == publishedVersionId) { + version.put("published", true); + } + } + } + + versions.sort((o1, o2) -> { + Object vid1 = o1.get("versionId"); + Object vid2 = o2.get("versionId"); + int a1 = 0, a2 = 0; + if (Objects.nonNull(vid1)) { + a1 = Integer.parseInt(vid1.toString()); + } + if (Objects.nonNull(vid2)) { + a2 = Integer.parseInt(vid2.toString()); + } + return a2 - a1; + }); + return Message.ok().data("versions", versions); + } + + public Message testConnect(HttpServletRequest request, Long id, Long version) throws ErrorException { + LinkisDataSourceRemoteClient linkisDataSourceRemoteClient = ExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); + String userName = SecurityFilter.getLoginUsername(request); + LOGGER.info("testConnect userName:" + userName); + DataSourceTestConnectResult result; + try { + result = linkisDataSourceRemoteClient.getDataSourceTestConnect( + new DataSourceTestConnectAction.Builder().setUser(userName).setDataSourceId(Long.parseLong(id + "")).setVersion(version + "").build() + ); + } catch (Exception e) { + if (e instanceof ErrorException) { + ErrorException ee = (ErrorException) e; + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_TEST_CONNECTION_ERROR.getCode(), e.getMessage(), ee.getIp(), ee.getPort(), ee.getServiceKind()); + } else { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_TEST_CONNECTION_ERROR.getCode(), e.getMessage()); + } + } + + if (Objects.isNull(result)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_TEST_CONNECTION_ERROR.getCode(), "datasource test connection response body null or empty"); + } + + if (result.getStatus() != 0) { + throw new ExchangisDataSourceException(result.getStatus(), result.getMessage()); + } + + return Message.ok(); + } + + public Message testConnectByVo(HttpServletRequest request, DataSourceCreateVO vo) throws ErrorException { + LinkisDataSourceRemoteClient linkisDataSourceRemoteClient = ExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); + String userName = SecurityFilter.getLoginUsername(request); + LOGGER.info("testConnect userName:" + userName); + + Map json; + try { + json = mapper.readValue(mapper.writeValueAsString(vo), Map.class); + json.put("labels",json.get("label")); + } catch (JsonProcessingException e) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.PARSE_JSON_ERROR.getCode(), e.getMessage()); + } + ParamsTestConnectResult result; + try { + result = (ParamsTestConnectResult) linkisDataSourceRemoteClient.execute( + new ParamsTestConnectAction(json, userName) + ); + } catch (Exception e) { + if (e instanceof ErrorException) { + ErrorException ee = (ErrorException) e; + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_TEST_CONNECTION_ERROR.getCode(), e.getMessage(), ee.getIp(), ee.getPort(), ee.getServiceKind()); + } else { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_TEST_CONNECTION_ERROR.getCode(), e.getMessage()); + } + } + + if (Objects.isNull(result)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_TEST_CONNECTION_ERROR.getCode(), "datasource test connection response body null or empty"); + } + + if (result.getStatus() != 0) { + throw new ExchangisDataSourceException(result.getStatus(), result.getMessage()); + } + + return Message.ok(); + } + + public Message publishDataSource(HttpServletRequest request, Long id, Long version) throws ErrorException { + LinkisDataSourceRemoteClient linkisDataSourceRemoteClient = ExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); + + String userName = SecurityFilter.getLoginUsername(request); + LOGGER.info("publishDataSource userName:" + userName); + PublishDataSourceVersionResult result; + try { + result = linkisDataSourceRemoteClient.publishDataSourceVersion( + new PublishDataSourceVersionAction.Builder().setUser(userName).setDataSourceId(Long.parseLong(id + "")).setVersion(Long.parseLong(version + "")).build() + ); + } catch (Exception e) { + if (e instanceof ErrorException) { + ErrorException ee = (ErrorException) e; + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_PUBLISH_VERSION_ERROR.getCode(), e.getMessage(), ee.getIp(), ee.getPort(), ee.getServiceKind()); + } else { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_PUBLISH_VERSION_ERROR.getCode(), e.getMessage()); + } + } + if (Objects.isNull(result)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_PUBLISH_VERSION_ERROR.getCode(), "datasource publish version response body null or empty"); + } + + if (result.getStatus() != 0) { + throw new ExchangisDataSourceException(result.getStatus(), result.getMessage()); + } + + return Message.ok(); + } + + public Message getDataSourceConnectParamsById(HttpServletRequest request, Long id) throws ErrorException { + String userName = SecurityFilter.getLoginUsername(request); + LOGGER.info("getDataSourceConnectParamsById userName:" + userName); + GetConnectParamsByDataSourceIdResult result = getDataSourceConnectParamsById(userName, id); + return Message.ok().data("info", Objects.isNull(result.getConnectParams()) ? null : result.getConnectParams()); + } + + @Transactional + public Message expireDataSource(HttpServletRequest request, Long id) throws ErrorException { + LinkisDataSourceRemoteClient linkisDataSourceRemoteClient = ExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); + + String responseBody; + String userName = SecurityFilter.getLoginUsername(request); + LOGGER.info("getDataSourceConnectParamsById userName:" + userName); +// ExpireDataSourceResult result; + try { +// result = linkisDataSourceRemoteClient.expireDataSource( +// new ExpireDataSourceAction.Builder().setUser(userName).setDataSourceId(id+"").build() +// ); + + Result execute = linkisDataSourceRemoteClient.execute( + new ExpireDataSourceAction.Builder().setUser(userName).setDataSourceId(Long.parseLong(id + "")).build() + ); + responseBody = execute.getResponseBody(); + } catch (Exception e) { + if (e instanceof ErrorException) { + ErrorException ee = (ErrorException) e; + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_EXPIRE_ERROR.getCode(), e.getMessage(), ee.getIp(), ee.getPort(), ee.getServiceKind()); + } else { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_EXPIRE_ERROR.getCode(), e.getMessage()); + } + } +// if (Objects.isNull(result)) { + if (Strings.isNullOrEmpty(responseBody)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_EXPIRE_ERROR.getCode(), "datasource expire response body null or empty"); + } + + ExpireDataSourceSuccessResultDTO result = Json.fromJson(responseBody, ExpireDataSourceSuccessResultDTO.class); + + if (result.getStatus() != 0) { + throw new ExchangisDataSourceException(result.getStatus(), result.getMessage()); + } + + return Message.ok(); + } + + public GetConnectParamsByDataSourceIdResult getDataSourceConnectParamsById(String userName, Long id) throws ErrorException{ + LinkisDataSourceRemoteClient linkisDataSourceRemoteClient = ExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); + LOGGER.info("getDataSourceConnectParamsById userName:" + userName); + GetConnectParamsByDataSourceIdResult result; + try { + result = linkisDataSourceRemoteClient.getConnectParams( + GetConnectParamsByDataSourceIdAction.builder().setSystem("system").setUser(userName).setDataSourceId(id).build() + ); + } catch (Exception e) { + if (e instanceof ErrorException) { + ErrorException ee = (ErrorException) e; + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_PARAMS_GET_ERROR.getCode(), e.getMessage(), ee.getIp(), ee.getPort(), ee.getServiceKind()); + } else { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_PARAMS_GET_ERROR.getCode(), e.getMessage()); + } + } + if (Objects.isNull(result)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_PARAMS_GET_ERROR.getCode(), "datasource params get response body null or empty"); + } + + if (result.getStatus() != 0) { + throw new ExchangisDataSourceException(result.getStatus(), result.getMessage()); + } + return result; + } + public Message getDataSourceKeyDefine(HttpServletRequest request, Long dataSourceTypeId) throws ErrorException { + if (Objects.isNull(dataSourceTypeId)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.PARAMETER_INVALID.getCode(), "dataSourceType id should not be null"); + } + LinkisDataSourceRemoteClient linkisDataSourceRemoteClient = ExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); + + String userName = SecurityFilter.getLoginUsername(request); + LOGGER.info("getDataSourceKeyDefine userName:" + userName); + GetKeyTypeDatasourceResult result; + try { + GetKeyTypeDatasourceAction action = new GetKeyTypeDatasourceAction.Builder().setUser(userName).setDataSourceTypeId(dataSourceTypeId).build(); + result = linkisDataSourceRemoteClient.getKeyDefinitionsByType(action); + } catch (Exception e) { + if (e instanceof ErrorException) { + ErrorException ee = (ErrorException) e; + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_GET_KEY_DEFINES_ERROR.getCode(), e.getMessage(), ee.getIp(), ee.getPort(), ee.getServiceKind()); + } else { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_GET_KEY_DEFINES_ERROR.getCode(), e.getMessage()); + } + } + + if (Objects.isNull(result)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.CLIENT_DATASOURCE_GET_KEY_DEFINES_ERROR.getCode(), "get datasource type key defines response body null or empty"); + } + + if (result.getStatus() != 0) { + throw new ExchangisDataSourceException(result.getStatus(), result.getMessage()); + } + + return Message.ok().data("list", Objects.isNull(result.getKeyDefine()) ? null : result.getKeyDefine()); + } + + public void checkDSSupportDegree(String engine, String sourceDsType, String sinkDsType) throws ExchangisDataSourceException { + switch (engine) { + case "SQOOP": + this.checkSqoopDSSupportDegree(sourceDsType, sinkDsType); + break; + case "DATAX": + this.checkDataXDSSupportDegree(sourceDsType, sinkDsType); + break; + default: + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.UNSUPPORTEd_ENGINE.getCode(), "不支持的引擎"); + } + } + + private void checkSqoopDSSupportDegree(String sourceDsType, String sinkDsType) throws ExchangisDataSourceException { + if (!("HIVE".equals(sourceDsType) || "HIVE".equals(sinkDsType))) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.DS_MAPPING_MUST_CONTAIN_HIVE.getCode(), "SQOOP引擎输入/输出数据源必须包含HIVE"); + } + if (sourceDsType.equals(sinkDsType)) { + throw new ExchangisDataSourceException(ExchangisDataSourceExceptionCode.DS_TYPE_MUST_DIFFERENT.getCode(), "SQOOP引擎读写类型不可相同"); + } + } + + private void checkDataXDSSupportDegree(String sourceDsType, String sinkDsType) throws ExchangisDataSourceException { + + } + + /** + * TODO: the mapping function is defined by the rule of Hive directly, we should abstract to support all the types + * @param request + * @param vo + * @return + * @throws Exception + */ + @SuppressWarnings("unchecked") + public Message queryDataSourceDBTableFieldsMapping(HttpServletRequest request, FieldMappingVO vo) throws Exception { + + this.checkDSSupportDegree(vo.getEngine(), vo.getSourceTypeId(), vo.getSinkTypeId()); + boolean containHive = "HIVE".equals(vo.getSourceTypeId()) || "HIVE".equals(vo.getSinkTypeId()); + + Message message = Message.ok(); + message.data("addEnable", !containHive); + + Message sourceMessage = this.queryDataSourceDBTableFields(request, vo.getSourceTypeId(), vo.getSourceDataSourceId(), vo.getSourceDataBase(), vo.getSourceTable()); + List sourceFields = (List) sourceMessage.getData().get("columns"); + for (int i = 0; i < sourceFields.size(); i++) { + DataSourceDbTableColumnDTO field = sourceFields.get(i); + field.setFieldIndex(i); + field.setFieldEditable(!"HIVE".equals(vo.getSourceTypeId())); + } + message.data("sourceFields", sourceFields); + + Message sinkMessage = this.queryDataSourceDBTableFields(request, vo.getSinkTypeId(), vo.getSinkDataSourceId(), vo.getSinkDataBase(), vo.getSinkTable()); + List sinkFields = (List) sinkMessage.getData().get("columns"); + for (int i = 0; i < sinkFields.size(); i++) { + DataSourceDbTableColumnDTO field = sinkFields.get(i); +// field.setFieldIndex(i); + field.setFieldEditable(!"HIVE".equals(vo.getSinkTypeId())); + } + message.data("sinkFields", sinkFields); + // field mapping deduction + List> deductions = new ArrayList<>(); + List left = sourceFields; + List right = sinkFields; + boolean exchanged = false; + if (containHive && "HIVE".equals(vo.getSinkTypeId())) { + left = sinkFields; + right = sourceFields; + exchanged = true; + } + for (int i = 0; i < left.size(); i ++){ + DataSourceDbTableColumnDTO leftElement = left.get(i); + DataSourceDbTableColumnDTO rightElement = right.get(i % right.size()); + Map deduction = new HashMap<>(); + deduction.put("source", exchanged ? rightElement : leftElement); + deduction.put("sink", exchanged ? leftElement : rightElement); + deduction.put("deleteEnable", true); + deductions.add(deduction); + } + message.data("deductions", deductions); + + return message; + } + +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/service/impl/DefaultDataSourceRenderService.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/service/impl/DefaultDataSourceRenderService.java new file mode 100644 index 000000000..397cadc5c --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/service/impl/DefaultDataSourceRenderService.java @@ -0,0 +1,49 @@ +package com.webank.wedatasphere.exchangis.datasource.service.impl; + +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisDataSourceException; +import com.webank.wedatasphere.exchangis.datasource.core.service.MetadataInfoService; +import com.webank.wedatasphere.exchangis.datasource.core.ui.ElementUI; +import com.webank.wedatasphere.exchangis.datasource.core.ui.builder.ElementUIFactory; +import com.webank.wedatasphere.exchangis.datasource.service.DataSourceRenderService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Default render service + */ +@Service +public class DefaultDataSourceRenderService implements DataSourceRenderService { + + /** + * Default placeholder stored in system + */ + private final static String[] DEFAULT_PLACEHOLDER = + new String[]{"${timestamp}", "${yyyyMMdd}","${yyyy-MM-dd}", "${run_date}", "${run_date-1}", "${run_month_begin}", "${run_month_begin-1}"}; + + /** + * Metadata info service + */ + @Resource + private MetadataInfoService metadataInfoService; + + /** + * Element Factory + */ + @Resource + private ElementUIFactory elementUIFactory; + + @Override + public ElementUI getPartitionAndRender(String userName, + Long dataSourceId, String database, String table, ElementUI.Type uiType) throws ExchangisDataSourceException { + List partitionKeys = metadataInfoService.getPartitionKeys(userName, dataSourceId, database, table); + Map renderParams = new HashMap<>(); + List placeHolder = Arrays.asList(DEFAULT_PLACEHOLDER); + partitionKeys.forEach(partition -> renderParams.putIfAbsent(partition, placeHolder)); + return elementUIFactory.createElement(uiType.name(), renderParams, Map.class); + } +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/vo/DataSourceCreateVO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/vo/DataSourceCreateVO.java new file mode 100644 index 000000000..0b3e34b1a --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/vo/DataSourceCreateVO.java @@ -0,0 +1,188 @@ +package com.webank.wedatasphere.exchangis.datasource.vo; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +//import javax.validation.constraints.NotBlank; +//import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.Date; +import java.util.Map; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class DataSourceCreateVO { + @Size(min=0,max=100,message="Length of dataSource name should between 0 and 100(数据源名字的长度应该在0和100之间)") + private String dataSourceName; + + private Long dataSourceTypeId; + + @Size(min=0,max=200,message="Length of dataSource description should between 0 and 200(数据源描述的长度应该在0和200之间)") + private String dataSourceDesc; + + private String createIdentify; + + private String createSystem; + + private String createUser; + + private String modifyUser; + + private Date createTime; + + private Date modifyTime; + + private Long versionId; + + @Size(min=0,max=200,message="Length of labels should between 0 and 200(标签的长度应该在0和200之间)") + private String label; + + private Map labels; + + private Long publishedVersionId; + + private Boolean expire = false; + + private String comment; + + private Map connectParams; + +// private Map parameters; +// +// public Map getParameters() { +// return parameters; +// } +// +// public void setParameters(Map parameters) { +// this.parameters = parameters; +// } + + public String getDataSourceName() { + return dataSourceName; + } + + public void setDataSourceName(String dataSourceName) { + this.dataSourceName = dataSourceName; + } + + public Long getDataSourceTypeId() { + return dataSourceTypeId; + } + + public void setDataSourceTypeId(Long dataSourceTypeId) { + this.dataSourceTypeId = dataSourceTypeId; + } + + public String getDataSourceDesc() { + return dataSourceDesc; + } + + public void setDataSourceDesc(String dataSourceDesc) { + this.dataSourceDesc = dataSourceDesc; + } + + public String getCreateIdentify() { + return createIdentify; + } + + public void setCreateIdentify(String createIdentify) { + this.createIdentify = createIdentify; + } + + public String getCreateSystem() { + return createSystem; + } + + public void setCreateSystem(String createSystem) { + this.createSystem = createSystem; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getModifyUser() { + return modifyUser; + } + + public void setModifyUser(String modifyUser) { + this.modifyUser = modifyUser; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + public Long getVersionId() { + return versionId; + } + + public void setVersionId(Long versionId) { + this.versionId = versionId; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public Long getPublishedVersionId() { + return publishedVersionId; + } + + public void setPublishedVersionId(Long publishedVersionId) { + this.publishedVersionId = publishedVersionId; + } + + public Boolean getExpire() { + return expire; + } + + public void setExpire(Boolean expire) { + this.expire = expire; + } + + + + public Map getConnectParams() { + return connectParams; + } + + public void setConnectParams(Map connectParams) { + this.connectParams = connectParams; + } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public Map getLabels() { + return labels; + } + + public void setLabels(Map labels) { + this.labels = labels; + } +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/vo/DataSourceQueryVO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/vo/DataSourceQueryVO.java new file mode 100644 index 000000000..f603609bc --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/vo/DataSourceQueryVO.java @@ -0,0 +1,60 @@ +package com.webank.wedatasphere.exchangis.datasource.vo; + +import java.util.Map; + +public class DataSourceQueryVO { + private Integer page; + private Integer pageSize; + private Long typeId; + private String typeName; + private String name; + private Map labels; + + public Map getLabels() { + return labels; + } + + public void setLabels(Map labels) { + this.labels = labels; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public Long getTypeId() { + return typeId; + } + + public void setTypeId(Long typeId) { + this.typeId = typeId; + } +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/vo/DataSourceUpdateVO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/vo/DataSourceUpdateVO.java new file mode 100644 index 000000000..c401c1ef1 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/vo/DataSourceUpdateVO.java @@ -0,0 +1,167 @@ +package com.webank.wedatasphere.exchangis.datasource.vo; + +import java.util.Date; +import java.util.Map; + +public class DataSourceUpdateVO { + + private Long id; + + private String dataSourceName; + + private Long dataSourceTypeId; + + private String dataSourceDesc; + + private String createIdentify; + + private String createSystem; + + private String createUser; + + private String modifyUser; + + private Date createTime; + + private Date modifyTime; + + private Long versionId; + + private String labels; + + private Long publishedVersionId; + + private Boolean expire = false; + + private String comment; + + public String getDataSourceName() { + return dataSourceName; + } + + public void setDataSourceName(String dataSourceName) { + this.dataSourceName = dataSourceName; + } + + public Long getDataSourceTypeId() { + return dataSourceTypeId; + } + + public void setDataSourceTypeId(Long dataSourceTypeId) { + this.dataSourceTypeId = dataSourceTypeId; + } + + public String getDataSourceDesc() { + return dataSourceDesc; + } + + public void setDataSourceDesc(String dataSourceDesc) { + this.dataSourceDesc = dataSourceDesc; + } + + public String getCreateIdentify() { + return createIdentify; + } + + public void setCreateIdentify(String createIdentify) { + this.createIdentify = createIdentify; + } + + public String getCreateSystem() { + return createSystem; + } + + public void setCreateSystem(String createSystem) { + this.createSystem = createSystem; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getModifyUser() { + return modifyUser; + } + + public void setModifyUser(String modifyUser) { + this.modifyUser = modifyUser; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + public Long getVersionId() { + return versionId; + } + + public void setVersionId(Long versionId) { + this.versionId = versionId; + } + + public String getLabels() { + return labels; + } + + public void setLabels(String labels) { + this.labels = labels; + } + + public Long getPublishedVersionId() { + return publishedVersionId; + } + + public void setPublishedVersionId(Long publishedVersionId) { + this.publishedVersionId = publishedVersionId; + } + + public Boolean getExpire() { + return expire; + } + + public void setExpire(Boolean expire) { + this.expire = expire; + } + + private Map connectParams; + + public Map getConnectParams() { + return connectParams; + } + + public void setConnectParams(Map connectParams) { + this.connectParams = connectParams; + } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/vo/FieldMappingVO.java b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/vo/FieldMappingVO.java new file mode 100644 index 000000000..1170df09c --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/java/com/webank/wedatasphere/exchangis/datasource/vo/FieldMappingVO.java @@ -0,0 +1,99 @@ +package com.webank.wedatasphere.exchangis.datasource.vo; + +import java.util.Map; + +public class FieldMappingVO { + + private String engine; + + private String sourceTypeId; + private Long sourceDataSourceId; + private String sourceDataBase; + private String sourceTable; + + private String sinkTypeId; + private Long sinkDataSourceId; + private String sinkDataBase; + private String sinkTable; + private Map labels; + + public Map getLabels() { + return labels; + } + + public void setLabels(Map labels) { + this.labels = labels; + } + + public String getEngine() { + return engine; + } + + public void setEngine(String engine) { + this.engine = engine; + } + + public String getSourceTypeId() { + return sourceTypeId; + } + + public void setSourceTypeId(String sourceTypeId) { + this.sourceTypeId = sourceTypeId; + } + + public Long getSourceDataSourceId() { + return sourceDataSourceId; + } + + public void setSourceDataSourceId(Long sourceDataSourceId) { + this.sourceDataSourceId = sourceDataSourceId; + } + + public String getSourceDataBase() { + return sourceDataBase; + } + + public void setSourceDataBase(String sourceDataBase) { + this.sourceDataBase = sourceDataBase; + } + + public String getSourceTable() { + return sourceTable; + } + + public void setSourceTable(String sourceTable) { + this.sourceTable = sourceTable; + } + + public String getSinkTypeId() { + return sinkTypeId; + } + + public void setSinkTypeId(String sinkTypeId) { + this.sinkTypeId = sinkTypeId; + } + + public Long getSinkDataSourceId() { + return sinkDataSourceId; + } + + public void setSinkDataSourceId(Long sinkDataSourceId) { + this.sinkDataSourceId = sinkDataSourceId; + } + + public String getSinkDataBase() { + return sinkDataBase; + } + + public void setSinkDataBase(String sinkDataBase) { + this.sinkDataBase = sinkDataBase; + } + + public String getSinkTable() { + return sinkTable; + } + + public void setSinkTable(String sinkTable) { + this.sinkTable = sinkTable; + } +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/main/scala/com/webank/wedatasphere/exchangis/datasource/GetDataSourceInfoByIdAndVersionIdAction.scala b/exchangis-datasource/exchangis-datasource-service/src/main/scala/com/webank/wedatasphere/exchangis/datasource/GetDataSourceInfoByIdAndVersionIdAction.scala new file mode 100644 index 000000000..b4329f88e --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/main/scala/com/webank/wedatasphere/exchangis/datasource/GetDataSourceInfoByIdAndVersionIdAction.scala @@ -0,0 +1,65 @@ +package com.webank.wedatasphere.exchangis.datasource + +import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE +import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException +import org.apache.linkis.datasource.client.request.DataSourceAction +import org.apache.linkis.httpclient.request.GetAction + + +class GetDataSourceInfoByIdAndVersionIdAction extends GetAction with DataSourceAction { + private var user: String = _ + private var dataSourceId: Long = _ + private var versionId: String = _ + + override def setUser(user: String): Unit = this.user = user + + override def getUser: String = this.user + + override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, "info", dataSourceId.toString, versionId) +} + + +object GetDataSourceInfoByIdAndVersionIdAction { + def builder(): Builder = new Builder + + class Builder private[GetDataSourceInfoByIdAndVersionIdAction]() { + private var dataSourceId: Long = _ + private var versionId: String = _ + private var system:String = _ + private var user: String = _ + + def setUser(user: String): Builder = { + this.user = user + this + } + + def setDataSourceId(dataSourceId: Long): Builder = { + this.dataSourceId = dataSourceId + this + } + + def setSystem(system: String): Builder = { + this.system = system + this + } + + def setVersionId(versionId: String): Builder = { + this.versionId = versionId + this + } + + def build(): GetDataSourceInfoByIdAndVersionIdAction = { + if(dataSourceId == null) throw new DataSourceClientBuilderException("dataSourceId is needed!") + if(versionId == null) throw new DataSourceClientBuilderException("versionId is needed!") + if(system == null) throw new DataSourceClientBuilderException("system is needed!") + if(user == null) throw new DataSourceClientBuilderException("user is needed!") + + val GetDataSourceInfoByIdAndVersionIdAction = new GetDataSourceInfoByIdAndVersionIdAction + GetDataSourceInfoByIdAndVersionIdAction.dataSourceId = this.dataSourceId + GetDataSourceInfoByIdAndVersionIdAction.setParameter("system", system) + GetDataSourceInfoByIdAndVersionIdAction.versionId = this.versionId + GetDataSourceInfoByIdAndVersionIdAction.setUser(user) + GetDataSourceInfoByIdAndVersionIdAction + } + } +} \ No newline at end of file diff --git a/exchangis-datasource/exchangis-datasource-service/src/test/java/com/webank/wedatasphere/exchangis/TestDataSourceClient.java b/exchangis-datasource/exchangis-datasource-service/src/test/java/com/webank/wedatasphere/exchangis/TestDataSourceClient.java new file mode 100644 index 000000000..7a0b2b888 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/test/java/com/webank/wedatasphere/exchangis/TestDataSourceClient.java @@ -0,0 +1,35 @@ +package com.webank.wedatasphere.exchangis; + + +import org.apache.linkis.datasource.client.impl.LinkisDataSourceRemoteClient; +import org.apache.linkis.datasource.client.request.QueryDataSourceAction; +import org.apache.linkis.datasource.client.response.QueryDataSourceResult; + +public class TestDataSourceClient { + + public static void main(String[] args) { + LinkisDataSourceRemoteClient linkisDataSourceRemoteClient = TestExchangisLinkisRemoteClient.getLinkisDataSourceRemoteClient(); +// String responseBody; +// try { +// Result execute = linkisDataSourceRemoteClient.execute( +// new DeleteDataSourceAction.Builder().setUser("hdfs").setResourceId("12").builder() +// ); +// responseBody = execute.getResponseBody(); +// System.out.println(responseBody); +// } catch (Exception e) { +// e.printStackTrace(); +// } + + QueryDataSourceAction.Builder builder = QueryDataSourceAction.builder() + .setSystem("system") + .setIdentifies("") + .setCurrentPage(1) + .setPageSize(500); + QueryDataSourceAction action = builder.build(); + QueryDataSourceResult result = linkisDataSourceRemoteClient.queryDataSource(action); + System.out.println(result.getResponseBody()); + System.out.println(result.getAllDataSource()); + + } + +} diff --git a/exchangis-datasource/exchangis-datasource-service/src/test/scala/com/webank/wedatasphere/exchangis/TestExchangisLinkisRemoteClient.scala b/exchangis-datasource/exchangis-datasource-service/src/test/scala/com/webank/wedatasphere/exchangis/TestExchangisLinkisRemoteClient.scala new file mode 100644 index 000000000..d8f0889f1 --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-service/src/test/scala/com/webank/wedatasphere/exchangis/TestExchangisLinkisRemoteClient.scala @@ -0,0 +1,162 @@ +package com.webank.wedatasphere.exchangis + + +import java.util.concurrent.TimeUnit + +import org.apache.linkis.datasource.client.impl.{LinkisDataSourceRemoteClient, LinkisMetaDataRemoteClient} +import org.apache.linkis.datasource.client.request.{GetAllDataSourceTypesAction, GetConnectParamsByDataSourceIdAction, MetadataGetColumnsAction, MetadataGetDatabasesAction, MetadataGetTablesAction, QueryDataSourceAction} +import org.apache.linkis.datasource.client.response.{GetConnectParamsByDataSourceIdResult, MetadataGetColumnsResult, MetadataGetDatabasesResult, MetadataGetTablesResult, QueryDataSourceResult} +import org.apache.linkis.datasourcemanager.common.domain.{DataSource, DataSourceType} +import org.apache.linkis.httpclient.dws.authentication.StaticAuthenticationStrategy +import org.apache.linkis.httpclient.dws.config.{DWSClientConfig, DWSClientConfigBuilder} + +object TestExchangisLinkisRemoteClient { + //Linkis Datasource Client Config + // val clientConfig = DWSClientConfigBuilder.newBuilder() + // .addServerUrl(serverUrl) + // .connectionTimeout(connectionTimeout) + // .discoveryEnabled(discoveryEnabled) + // .discoveryFrequency(1,TimeUnit.MINUTES) + // .loadbalancerEnabled(loadbalancerEnabled) + // .maxConnectionSize(maxConnectionSize) + // .retryEnabled(retryEnabled) + // .readTimeout(readTimeout) + // .setAuthenticationStrategy(new StaticAuthenticationStrategy()) + // .setAuthTokenKey(authTokenKey) + // .setAuthTokenValue(authTokenValue) + // .setDWSVersion(dwsVersion) + // .build() + + val clientConfig: DWSClientConfig = DWSClientConfigBuilder.newBuilder() + .addServerUrl("http://dss.shineweng.com:20088") + .connectionTimeout(30000L) + .discoveryEnabled(true) + .discoveryFrequency(1L, TimeUnit.MINUTES) + .loadbalancerEnabled(true) + .maxConnectionSize(5) + .retryEnabled(false) + .readTimeout(30000L) + .setAuthenticationStrategy(new StaticAuthenticationStrategy()) + .setAuthTokenKey("hdfs") + .setAuthTokenValue("hdfs") + .setDWSVersion("v1") + .build() + + val dataSourceClient = new LinkisDataSourceRemoteClient(clientConfig) + + val metaDataClient = new LinkisMetaDataRemoteClient(clientConfig) + + def getLinkisDataSourceRemoteClient: LinkisDataSourceRemoteClient = { + dataSourceClient + } + + def getLinkisMetadataRemoteClient: LinkisMetaDataRemoteClient = { + metaDataClient + } + + def close(): Unit = { + dataSourceClient.close() + metaDataClient.close() + } + + def queryDataSource(linkisDatasourceName: String): QueryDataSourceResult = { + dataSourceClient.queryDataSource(QueryDataSourceAction.builder() + .setSystem("") + .setName(linkisDatasourceName) + .setTypeId(1) + .setIdentifies("") + .setCurrentPage(1) + .setUser("hadoop") + .setPageSize(1).build() + ) + } + +// def createDataSource() = { +// dataSourceClient.execute().asInstanceOf[] +// } + + /** + * get datasourceConnect information + * + * @param dataSourceId id + * @param system dssSystem + * @param user username + * @return + */ + def queryConnectParams(dataSourceId: Long, system: String, user: String): GetConnectParamsByDataSourceIdResult = { + dataSourceClient.getConnectParams(GetConnectParamsByDataSourceIdAction.builder() + .setDataSourceId(dataSourceId) + .setSystem(system) + .setUser(user) + .build() + ) + } + + /** + * get all DataSourceTypes + * + * @param user user + * @return + */ + def queryDataSourceTypes(user: String): java.util.List[DataSourceType] = { + dataSourceClient.getAllDataSourceTypes(GetAllDataSourceTypesAction.builder() + .setUser(user) + .build() + ).getAllDataSourceType + } + + + def queryClusterByDataSourceType(system: String, name: String, typeId: Long, user: String): java.util.List[DataSource] = { + dataSourceClient.queryDataSource(QueryDataSourceAction.builder() + .setSystem(system) + .setName(name) + .setTypeId(typeId) + .setIdentifies("") + .setCurrentPage(1) + .setPageSize(10) + .setUser(user) + .build() + ).getAllDataSource + } + + + /** + * get DataBases list + * + * @param system + * @param dataSourceId + * @param user + * @return list + */ + def queryDataBasesByCuster(system: String, dataSourceId: Long, user: String): MetadataGetDatabasesResult = { + metaDataClient.getDatabases(MetadataGetDatabasesAction.builder() + .setSystem(system) + .setDataSourceId(dataSourceId) + .setUser(user) + .build() + ) + } + + def queryTablesByDataBase(system: String, dataSourceId: Long, dataBase: String, user: String): MetadataGetTablesResult = { + metaDataClient.getTables(MetadataGetTablesAction.builder() + .setSystem(system) + .setDataSourceId(dataSourceId) + .setDatabase(dataBase) + .setUser(user) + .build() + ) + } + + def queryColumnsByTable(system: String, dataSourceId: Long, dataBase: String, table: String, user: String): MetadataGetColumnsResult = { + metaDataClient.getColumns(MetadataGetColumnsAction.builder() + .setSystem(system) + .setDataSourceId(dataSourceId) + .setDatabase(dataBase) + .setTable(table) + .setUser(user) + .build() + ) + } + + +} diff --git a/exchangis-datasource/exchangis-datasource-streamis/pom.xml b/exchangis-datasource/exchangis-datasource-streamis/pom.xml new file mode 100644 index 000000000..099fc4e6a --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-streamis/pom.xml @@ -0,0 +1,45 @@ + + + + exchangis-datasource + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-datasource-streamis + + + 8 + 8 + + + + + com.webank.wedatasphere.exchangis + exchangis-datasource-core + 1.0.0-RC1 + + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + net.alchim31.maven + scala-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + \ No newline at end of file diff --git a/exchangis-datasource/exchangis-datasource-streamis/src/main/java/com/webank/wedatasphere/exchangis/datasource/streamis/ExchangisStreamisDataSource.java b/exchangis-datasource/exchangis-datasource-streamis/src/main/java/com/webank/wedatasphere/exchangis/datasource/streamis/ExchangisStreamisDataSource.java new file mode 100644 index 000000000..a47a040ca --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-streamis/src/main/java/com/webank/wedatasphere/exchangis/datasource/streamis/ExchangisStreamisDataSource.java @@ -0,0 +1,40 @@ +package com.webank.wedatasphere.exchangis.datasource.streamis; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.webank.wedatasphere.exchangis.dao.domain.ExchangisJobParamConfig; +import com.webank.wedatasphere.exchangis.dao.hook.MapperHook; +import com.webank.wedatasphere.exchangis.dao.mapper.ExchangisJobParamConfigMapper; +import com.webank.wedatasphere.exchangis.datasource.core.ExchangisDataSource; +import org.apache.linkis.datasource.client.impl.LinkisDataSourceRemoteClient; +import org.apache.linkis.datasource.client.impl.LinkisMetaDataRemoteClient; + +import java.util.List; + +public abstract class ExchangisStreamisDataSource implements ExchangisDataSource { + + protected MapperHook mapperHook; + + @Override + public void setMapperHook(MapperHook mapperHook) { + this.mapperHook = mapperHook; + } + + protected List getDataSourceParamConfigs(String type) { + ExchangisJobParamConfigMapper exchangisJobParamConfigMapper = this.mapperHook.getExchangisJobParamConfigMapper(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("type", type); + queryWrapper.eq("is_hidden", 0); + queryWrapper.eq("status", 1); + return exchangisJobParamConfigMapper.selectList(queryWrapper); + } + + @Override + public LinkisDataSourceRemoteClient getDataSourceRemoteClient() { + return ExchangisStreamisRemoteClient.getStreamisDataSourceRemoteClient(); + } + + @Override + public LinkisMetaDataRemoteClient getMetaDataRemoteClient() { + return ExchangisStreamisRemoteClient.getStreamisMetadataRemoteClient(); + } +} diff --git a/exchangis-datasource/exchangis-datasource-streamis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/streamis/ExchangisStreamisRemoteClient.scala b/exchangis-datasource/exchangis-datasource-streamis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/streamis/ExchangisStreamisRemoteClient.scala new file mode 100644 index 000000000..0085608bb --- /dev/null +++ b/exchangis-datasource/exchangis-datasource-streamis/src/main/scala/com/webank/wedatasphere/exchangis/datasource/streamis/ExchangisStreamisRemoteClient.scala @@ -0,0 +1,172 @@ +package com.webank.wedatasphere.exchangis.datasource.streamis + +import com.webank.wedatasphere.exchangis.datasource.core.ExchangisDataSourceConfiguration +import java.lang +import java.util.concurrent.TimeUnit + +import org.apache.linkis.datasource.client.impl.{LinkisDataSourceRemoteClient, LinkisMetaDataRemoteClient} +import org.apache.linkis.datasource.client.request.{GetAllDataSourceTypesAction, GetConnectParamsByDataSourceIdAction, MetadataGetColumnsAction, MetadataGetDatabasesAction, MetadataGetTablesAction, QueryDataSourceAction} +import org.apache.linkis.datasource.client.response.{GetConnectParamsByDataSourceIdResult, MetadataGetColumnsResult, MetadataGetDatabasesResult, MetadataGetTablesResult, QueryDataSourceResult} +import org.apache.linkis.datasourcemanager.common.domain.{DataSource, DataSourceType} +import org.apache.linkis.httpclient.dws.authentication.StaticAuthenticationStrategy +import org.apache.linkis.httpclient.dws.config.{DWSClientConfig, DWSClientConfigBuilder} + +object ExchangisStreamisRemoteClient { + //Linkis Datasource Client Config + val serverUrl: String = ExchangisDataSourceConfiguration.SERVER_URL.getValue + val connectionTimeout: lang.Long = ExchangisDataSourceConfiguration.CONNECTION_TIMEOUT.getValue + val discoveryEnabled: lang.Boolean = ExchangisDataSourceConfiguration.DISCOVERY_ENABLED.getValue + val discoveryFrequencyPeriod: lang.Long = ExchangisDataSourceConfiguration.DISCOVERY_FREQUENCY_PERIOD.getValue + val loadbalancerEnabled: lang.Boolean = ExchangisDataSourceConfiguration.LOAD_BALANCER_ENABLED.getValue + val maxConnectionSize: Integer = ExchangisDataSourceConfiguration.MAX_CONNECTION_SIZE.getValue + val retryEnabled: lang.Boolean = ExchangisDataSourceConfiguration.RETRY_ENABLED.getValue + val readTimeout: lang.Long = ExchangisDataSourceConfiguration.READ_TIMEOUT.getValue + val authTokenKey: String = ExchangisDataSourceConfiguration.AUTHTOKEN_KEY.getValue + val authTokenValue: String = ExchangisDataSourceConfiguration.AUTHTOKEN_VALUE.getValue + val dwsVersion: String = ExchangisDataSourceConfiguration.DWS_VERSION.getValue + + + // val clientConfig = DWSClientConfigBuilder.newBuilder() + // .addServerUrl(serverUrl) + // .connectionTimeout(connectionTimeout) + // .discoveryEnabled(discoveryEnabled) + // .discoveryFrequency(1,TimeUnit.MINUTES) + // .loadbalancerEnabled(loadbalancerEnabled) + // .maxConnectionSize(maxConnectionSize) + // .retryEnabled(retryEnabled) + // .readTimeout(readTimeout) + // .setAuthenticationStrategy(new StaticAuthenticationStrategy()) + // .setAuthTokenKey(authTokenKey) + // .setAuthTokenValue(authTokenValue) + // .setDWSVersion(dwsVersion) + // .build() + + val clientConfig: DWSClientConfig = DWSClientConfigBuilder.newBuilder() + .addServerUrl(serverUrl) + .connectionTimeout(connectionTimeout) + .discoveryEnabled(discoveryEnabled) + .discoveryFrequency(discoveryFrequencyPeriod, TimeUnit.MINUTES) + .loadbalancerEnabled(loadbalancerEnabled) + .maxConnectionSize(maxConnectionSize) + .retryEnabled(retryEnabled) + .readTimeout(readTimeout) + .setAuthenticationStrategy(new StaticAuthenticationStrategy()) + .setAuthTokenKey(authTokenKey) + .setAuthTokenValue(authTokenValue) + .setDWSVersion(dwsVersion) + .build() + + val dataSourceClient = new LinkisDataSourceRemoteClient(clientConfig) + + val metaDataClient = new LinkisMetaDataRemoteClient(clientConfig) + + def getStreamisDataSourceRemoteClient: LinkisDataSourceRemoteClient = { + dataSourceClient + } + + def getStreamisMetadataRemoteClient: LinkisMetaDataRemoteClient = { + metaDataClient + } + + def close(): Unit = { + dataSourceClient.close() + metaDataClient.close() + } + + def queryDataSource(linkisDatasourceName: String): QueryDataSourceResult = { + dataSourceClient.queryDataSource(QueryDataSourceAction.builder() + .setSystem("") + .setName(linkisDatasourceName) + .setTypeId(1) + .setIdentifies("") + .setCurrentPage(1) + .setUser("hadoop") + .setPageSize(1).build() + ) + } + + /** + * get datasourceConnect information + * + * @param dataSourceId id + * @param system dssSystem + * @param user username + * @return + */ + def queryConnectParams(dataSourceId: Long, system: String, user: String): GetConnectParamsByDataSourceIdResult = { + dataSourceClient.getConnectParams(GetConnectParamsByDataSourceIdAction.builder() + .setDataSourceId(dataSourceId) + .setSystem(system) + .setUser(user) + .build() + ) + } + + /** + * get all DataSourceTypes + * + * @param user user + * @return + */ + def queryDataSourceTypes(user: String): java.util.List[DataSourceType] = { + dataSourceClient.getAllDataSourceTypes(GetAllDataSourceTypesAction.builder() + .setUser(user) + .build() + ).getAllDataSourceType + } + + + def queryClusterByDataSourceType(system: String, name: String, typeId: Long, user: String): java.util.List[DataSource] = { + dataSourceClient.queryDataSource(QueryDataSourceAction.builder() + .setSystem(system) + .setName(name) + .setTypeId(typeId) + .setIdentifies("") + .setCurrentPage(1) + .setPageSize(10) + .setUser(user) + .build() + ).getAllDataSource + } + + + /** + * get DataBases list + * + * @param system + * @param dataSourceId + * @param user + * @return list + */ + def queryDataBasesByCuster(system: String, dataSourceId: Long, user: String): MetadataGetDatabasesResult = { + metaDataClient.getDatabases(MetadataGetDatabasesAction.builder() + .setSystem(system) + .setDataSourceId(dataSourceId) + .setUser(user) + .build() + ) + } + + def queryTablesByDataBase(system: String, dataSourceId: Long, dataBase: String, user: String): MetadataGetTablesResult = { + metaDataClient.getTables(MetadataGetTablesAction.builder() + .setSystem(system) + .setDataSourceId(dataSourceId) + .setDatabase(dataBase) + .setUser(user) + .build() + ) + } + + def queryColumnsByTable(system: String, dataSourceId: Long, dataBase: String, table: String, user: String): MetadataGetColumnsResult = { + metaDataClient.getColumns(MetadataGetColumnsAction.builder() + .setSystem(system) + .setDataSourceId(dataSourceId) + .setDatabase(dataBase) + .setTable(table) + .setUser(user) + .build() + ) + } + + +} diff --git a/exchangis-datasource/extension-datasources/exchangis-datasource-ext-hive/pom.xml b/exchangis-datasource/extension-datasources/exchangis-datasource-ext-hive/pom.xml new file mode 100644 index 000000000..d38360b2c --- /dev/null +++ b/exchangis-datasource/extension-datasources/exchangis-datasource-ext-hive/pom.xml @@ -0,0 +1,56 @@ + + + + exchangis-datasource + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../../pom.xml + + 4.0.0 + + exchangis-datasource-ext-hive + + + 8 + 8 + + + + + + com.webank.wedatasphere.exchangis + exchangis-dao + 1.0.0-RC1 + + + com.webank.wedatasphere.exchangis + exchangis-datasource-linkis + 1.0.0-RC1 + + + com.webank.wedatasphere.exchangis + exchangis-dao + 1.0.0-RC1 + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + net.alchim31.maven + scala-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + \ No newline at end of file diff --git a/exchangis-datasource/extension-datasources/exchangis-datasource-ext-hive/src/main/java/com/webank/wedatasphere/exchangis/extension/datasource/hive/ExchangisHiveDataSource.java b/exchangis-datasource/extension-datasources/exchangis-datasource-ext-hive/src/main/java/com/webank/wedatasphere/exchangis/extension/datasource/hive/ExchangisHiveDataSource.java new file mode 100644 index 000000000..d2547a1a6 --- /dev/null +++ b/exchangis-datasource/extension-datasources/exchangis-datasource-ext-hive/src/main/java/com/webank/wedatasphere/exchangis/extension/datasource/hive/ExchangisHiveDataSource.java @@ -0,0 +1,45 @@ +package com.webank.wedatasphere.exchangis.extension.datasource.hive; + +import com.webank.wedatasphere.exchangis.dao.domain.ExchangisJobParamConfig; +import com.webank.wedatasphere.exchangis.datasource.linkis.ExchangisBatchDataSource; + +import java.util.List; + +public class ExchangisHiveDataSource extends ExchangisBatchDataSource { + private static final String DATASOURCE_TYPE = "HIVE"; + +// @Override +// public String id() { +// return null; +// } + + @Override + public String name() { + return DATASOURCE_TYPE; + } + + @Override + public String classifier() { + return "大数据存储"; + } + + @Override + public String description() { + return "Hive Description"; + } + + @Override + public String option() { + return "hive"; + } + + @Override + public String icon() { + return "icon-hive"; + } + + @Override + public List getDataSourceParamConfigs() { + return super.getDataSourceParamConfigs(DATASOURCE_TYPE); + } +} diff --git a/exchangis-datasource/extension-datasources/exchangis-datasource-ext-mysql/pom.xml b/exchangis-datasource/extension-datasources/exchangis-datasource-ext-mysql/pom.xml new file mode 100644 index 000000000..9d2145fc6 --- /dev/null +++ b/exchangis-datasource/extension-datasources/exchangis-datasource-ext-mysql/pom.xml @@ -0,0 +1,55 @@ + + + + exchangis-datasource + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../../pom.xml + + 4.0.0 + + exchangis-datasource-ext-mysql + + + 8 + 8 + + + + + com.webank.wedatasphere.exchangis + exchangis-dao + 1.0.0-RC1 + + + com.webank.wedatasphere.exchangis + exchangis-datasource-linkis + 1.0.0-RC1 + + + com.webank.wedatasphere.exchangis + exchangis-datasource-core + 1.0.0-RC1 + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + net.alchim31.maven + scala-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + \ No newline at end of file diff --git a/exchangis-datasource/extension-datasources/exchangis-datasource-ext-mysql/src/main/java/com/webank/wedatasphere/exchangis/extension/datasource/mysql/ExchangisMySQLDataSource.java b/exchangis-datasource/extension-datasources/exchangis-datasource-ext-mysql/src/main/java/com/webank/wedatasphere/exchangis/extension/datasource/mysql/ExchangisMySQLDataSource.java new file mode 100644 index 000000000..49ca54d59 --- /dev/null +++ b/exchangis-datasource/extension-datasources/exchangis-datasource-ext-mysql/src/main/java/com/webank/wedatasphere/exchangis/extension/datasource/mysql/ExchangisMySQLDataSource.java @@ -0,0 +1,53 @@ +package com.webank.wedatasphere.exchangis.extension.datasource.mysql; + +import com.webank.wedatasphere.exchangis.dao.domain.ExchangisJobParamConfig; +import com.webank.wedatasphere.exchangis.datasource.linkis.ExchangisBatchDataSource; + +import java.util.List; + +public class ExchangisMySQLDataSource extends ExchangisBatchDataSource { + private static final String DATASOURCE_TYPE = "MYSQL"; + +// @Override +// public String id() { +// if (null == id || id.equalsIgnoreCase("")) { +// List types = super.getDataSourceTypes("hdfs"); +// for (DataSourceType type : types) { +// if (type.getName().equalsIgnoreCase(DATASOURCE_TYPE)) { +// this.id = type.getId(); +// } +// } +// } +// return this.id; +// } + + @Override + public String name() { + return DATASOURCE_TYPE; + } + + @Override + public String classifier() { + return "关系型数据库"; + } + + @Override + public String description() { + return "MYSQL description"; + } + + @Override + public String option() { + return "mysql数据库"; + } + + @Override + public String icon() { + return "icon-mysql"; + } + + @Override + public List getDataSourceParamConfigs() { + return super.getDataSourceParamConfigs(DATASOURCE_TYPE); + } +} \ No newline at end of file diff --git a/exchangis-datasource/extension-datasources/exchangis-datasource-ext-sftp/pom.xml b/exchangis-datasource/extension-datasources/exchangis-datasource-ext-sftp/pom.xml new file mode 100644 index 000000000..93f94390c --- /dev/null +++ b/exchangis-datasource/extension-datasources/exchangis-datasource-ext-sftp/pom.xml @@ -0,0 +1,55 @@ + + + + exchangis-datasource + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../../pom.xml + + 4.0.0 + + exchangis-datasource-ext-sftp + + + 8 + 8 + + + + + com.webank.wedatasphere.exchangis + exchangis-dao + 1.0.0-RC1 + + + com.webank.wedatasphere.exchangis + exchangis-datasource-linkis + 1.0.0-RC1 + + + com.webank.wedatasphere.exchangis + exchangis-datasource-core + 1.0.0-RC1 + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + net.alchim31.maven + scala-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + \ No newline at end of file diff --git a/exchangis-datasource/extension-datasources/exchangis-datasource-ext-sftp/src/main/java/com/webank/wedatasphere/exchangis/extension/datasource/sftp/ExchangisSftpDataSource.java b/exchangis-datasource/extension-datasources/exchangis-datasource-ext-sftp/src/main/java/com/webank/wedatasphere/exchangis/extension/datasource/sftp/ExchangisSftpDataSource.java new file mode 100644 index 000000000..bdfe439b4 --- /dev/null +++ b/exchangis-datasource/extension-datasources/exchangis-datasource-ext-sftp/src/main/java/com/webank/wedatasphere/exchangis/extension/datasource/sftp/ExchangisSftpDataSource.java @@ -0,0 +1,40 @@ +package com.webank.wedatasphere.exchangis.extension.datasource.sftp; + +import com.webank.wedatasphere.exchangis.dao.domain.ExchangisJobParamConfig; +import com.webank.wedatasphere.exchangis.datasource.linkis.ExchangisBatchDataSource; + +import java.util.List; + +public class ExchangisSftpDataSource extends ExchangisBatchDataSource { + private static final String DATASOURCE_TYPE = "SFTP"; + + @Override + public String name() { + return DATASOURCE_TYPE; + } + + @Override + public String description() { + return "sftp连接"; + } + + @Override + public String option() { + return "SFTP"; + } + + @Override + public String classifier() { + return "SFTP"; + } + + @Override + public String icon() { + return "icon-sftp"; + } + + @Override + public List getDataSourceParamConfigs() { + return super.getDataSourceParamConfigs(DATASOURCE_TYPE); + } +} diff --git a/exchangis-datasource/pom.xml b/exchangis-datasource/pom.xml new file mode 100644 index 000000000..3bcb95f6b --- /dev/null +++ b/exchangis-datasource/pom.xml @@ -0,0 +1,33 @@ + + + + exchangis + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-datasource + pom + 1.0.0-RC1 + + + exchangis-datasource-core + exchangis-datasource-loader + exchangis-datasource-streamis + exchangis-datasource-linkis + exchangis-datasource-service + extension-datasources/exchangis-datasource-ext-mysql + extension-datasources/exchangis-datasource-ext-hive + extension-datasources/exchangis-datasource-ext-sftp + exchangis-datasource-server + + + + 8 + 8 + + + \ No newline at end of file diff --git a/exchangis-job/exchangis-job-builder/pom.xml b/exchangis-job/exchangis-job-builder/pom.xml new file mode 100644 index 000000000..2abd4c673 --- /dev/null +++ b/exchangis-job/exchangis-job-builder/pom.xml @@ -0,0 +1,33 @@ + + + + exchangis-job + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-job-builder + + + + com.webank.wedatasphere.exchangis + exchangis-job-common + 1.0.0-RC1 + + + com.google.code.gson + gson + 2.8.8 + + + com.webank.wedatasphere.exchangis + exchangis-datasource-service + 1.0.0-RC1 + compile + + + + \ No newline at end of file diff --git a/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/ExchangisJobBuilderContext.java b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/ExchangisJobBuilderContext.java new file mode 100644 index 000000000..e6aee9968 --- /dev/null +++ b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/ExchangisJobBuilderContext.java @@ -0,0 +1,72 @@ +package com.webank.wedatasphere.exchangis.job.builder; + + +import com.webank.wedatasphere.exchangis.job.builder.api.ExchangisJobBuilder; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; + +import java.util.HashMap; +import java.util.Map; + +/** + * Builder context + */ +public class ExchangisJobBuilderContext { + + /** + * Origin job + */ + protected ExchangisJobInfo originalJob; + + /** + * Current builder + */ + protected ExchangisJobBuilder currentBuilder; + + private Map env = new HashMap<>(); + + private Map> datasourceParams = new HashMap<>(); + + public ExchangisJobBuilderContext() { + + } + + public ExchangisJobBuilderContext(ExchangisJobInfo originalJob){ + this.originalJob = originalJob; + } + + + public ExchangisJobInfo getOriginalJob() { + return originalJob; + } + + public void setOriginalJob(ExchangisJobInfo originalJob) { + this.originalJob = originalJob; + } + + public void putDatasourceParam(String datasourceId, Map datasourceParams) { + this.datasourceParams.put(datasourceId, datasourceParams); + } + public Map getDatasourceParam(String datasourceId) { + return this.datasourceParams.get(datasourceId); + } + + public void putEnv(String name, Object value) { + this.env.put(name, value); + } + + public Object getEnv (String name) { + return this.env.get(name); + } + + public boolean containsEnv(String name) { + return this.env.containsKey(name); + } + + public ExchangisJobBuilder getCurrentBuilder() { + return currentBuilder; + } + + public void setCurrentBuilder(ExchangisJobBuilder currentBuilder) { + this.currentBuilder = currentBuilder; + } +} diff --git a/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/api/AbstractExchangisJobBuilder.java b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/api/AbstractExchangisJobBuilder.java new file mode 100644 index 000000000..9f8fa61d8 --- /dev/null +++ b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/api/AbstractExchangisJobBuilder.java @@ -0,0 +1,67 @@ +package com.webank.wedatasphere.exchangis.job.builder.api; + +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisBase; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJob; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParamDefine; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParamSet; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.utils.TypeGenericUtils; + +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.lang.reflect.TypeVariable; +import java.util.*; + +public abstract class AbstractExchangisJobBuilder implements ExchangisJobBuilder { + + private static final ThreadLocal contextThreadLocal = new ThreadLocal<>(); + + @Override + @SuppressWarnings("unchecked") + public Class inputJob() { + return (Class) TypeGenericUtils.getActualTypeFormGenericClass(this.getClass(), AbstractExchangisJobBuilder.class, 0); + } + + @Override + @SuppressWarnings("unchecked") + public Class outputJob() { + return (Class) TypeGenericUtils.getActualTypeFormGenericClass(this.getClass(), AbstractExchangisJobBuilder.class, 1); + } + + @Override + public int priority() { + return Integer.MAX_VALUE; + } + + @Override + public boolean canBuild(T inputJob) { + return true; + } + + + @Override + public E build(T inputJob, E expectOut, ExchangisJobBuilderContext ctx) throws ExchangisJobException { + ExchangisJobBuilder beforeJoBuilder = ctx.getCurrentBuilder(); + JobParamDefine.defaultParam.set(new JobParamSet()); + contextThreadLocal.set(ctx); + ctx.setCurrentBuilder(this); + try { + return buildJob(inputJob, expectOut, ctx); + } finally{ + ctx.setCurrentBuilder(beforeJoBuilder); + contextThreadLocal.remove(); + JobParamDefine.defaultParam.remove(); + } + } + + public abstract E buildJob(T inputJob, E expectOut, ExchangisJobBuilderContext ctx) throws ExchangisJobException; + + /** + * Get current job builder context + * @return + */ + protected static ExchangisJobBuilderContext getCurrentBuilderContext(){ + return contextThreadLocal.get(); + } +} diff --git a/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/api/ExchangisJobBuilder.java b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/api/ExchangisJobBuilder.java new file mode 100644 index 000000000..cdcf9c989 --- /dev/null +++ b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/api/ExchangisJobBuilder.java @@ -0,0 +1,48 @@ +package com.webank.wedatasphere.exchangis.job.builder.api; + +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisBase; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJob; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; + +/** + * Builder interface + * @param input job + * @param output job + */ +public interface ExchangisJobBuilder { + + /** + * Input job class + * @return class type + */ + Class inputJob(); + + /** + * Output job class + * @return class type + */ + Class outputJob(); + + /** + * Priority + * @return value + */ + int priority(); + + /** + * If the input job can be built + * @param inputJob input job entity + * @return boolean + */ + boolean canBuild(T inputJob); + + /** + * Main entrance of building + * @param inputJob input job + * @param expectOut expect output entity (can be null or get from output of early builder) + * @param ctx context + * @return outputJob + */ + E build(T inputJob, E expectOut, ExchangisJobBuilderContext ctx) throws ExchangisJobException; +} diff --git a/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/api/ExchangisJobBuilderChain.java b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/api/ExchangisJobBuilderChain.java new file mode 100644 index 000000000..b6ca29e8e --- /dev/null +++ b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/api/ExchangisJobBuilderChain.java @@ -0,0 +1,37 @@ +package com.webank.wedatasphere.exchangis.job.builder.api; + +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisBase; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJob; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; + +/** + * Builder chain + */ +public interface ExchangisJobBuilderChain { + + /** + * Register builder + * @param jobBuilder builder + * @return boolean + */ + boolean registerBuilder(ExchangisJobBuilder jobBuilder); + + /** + * Build method + * @param inputJob input job + * @param ctx context + * @return output entity + */ + E build(T inputJob, ExchangisJobBuilderContext ctx) throws ExchangisJobException; + + /** + * Init method + */ + void initialize(); + + /** + * Clean method + */ + void clean(); +} diff --git a/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/api/GenericExchangisJobBuilderChain.java b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/api/GenericExchangisJobBuilderChain.java new file mode 100644 index 000000000..2f17a73e0 --- /dev/null +++ b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/api/GenericExchangisJobBuilderChain.java @@ -0,0 +1,63 @@ +package com.webank.wedatasphere.exchangis.job.builder.api; + +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisBase; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJob; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; + +import java.util.*; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.atomic.AtomicReference; + +/** + * Generic implement + * @param input job + * @param output job + */ +public class GenericExchangisJobBuilderChain implements ExchangisJobBuilderChain{ + + /** + * Chain list + */ + private List> builderChain = new CopyOnWriteArrayList<>(); + + @Override + public boolean registerBuilder(ExchangisJobBuilder jobBuilder) { + //Need to have inputClass and outputClass + if (Objects.nonNull(jobBuilder.inputJob()) && Objects.nonNull(jobBuilder.outputJob())){ + builderChain.add(jobBuilder); + return true; + } + return false; + } + + @Override + public E build(T inputJob, ExchangisJobBuilderContext ctx) throws ExchangisJobException { + final AtomicReference expectJob = new AtomicReference<>(null); + if (Objects.nonNull(inputJob)){ + for( ExchangisJobBuilder builder : builderChain){ + if(builder.canBuild(inputJob)){ + expectJob.set(builder.build(inputJob, expectJob.get(), ctx)); + } + } + } + return expectJob.get(); + } + + @Override + public void initialize() { + doInnerSort(); + } + + @Override + public void clean() { + builderChain.clear(); + } + + /** + * Sort method + */ + public synchronized void doInnerSort(){ + builderChain.sort(Comparator.comparingInt(ExchangisJobBuilder::priority)); + } +} diff --git a/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/manager/DefaultExchangisJobBuilderManager.java b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/manager/DefaultExchangisJobBuilderManager.java new file mode 100644 index 000000000..9b97a088f --- /dev/null +++ b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/manager/DefaultExchangisJobBuilderManager.java @@ -0,0 +1,106 @@ +package com.webank.wedatasphere.exchangis.job.builder.manager; + +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.builder.api.ExchangisJobBuilder; +import com.webank.wedatasphere.exchangis.job.builder.api.ExchangisJobBuilderChain; +import com.webank.wedatasphere.exchangis.job.builder.api.GenericExchangisJobBuilderChain; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisBase; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJob; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; + +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Default implement + */ +public class DefaultExchangisJobBuilderManager implements ExchangisJobBuilderManager{ + + /** + * Builder chains + */ + @SuppressWarnings("rawtypes") + private Map jobBuilderChains = new ConcurrentHashMap<>(); + + @Override + @SuppressWarnings("unchecked") + public E doBuild(T originJob, Class expectJobClass, + ExchangisJobBuilderContext ctx) throws ExchangisJobException { + return doBuild(originJob, (Class)originJob.getClass(), expectJobClass, ctx); + } + + @Override + @SuppressWarnings("unchecked") + public E doBuild(T originJob, Class inputJobClass, Class expectJobClass, ExchangisJobBuilderContext ctx) throws ExchangisJobException { + BuilderDirection direction = new BuilderDirection(inputJobClass, expectJobClass); + ExchangisJobBuilderChain chain = (ExchangisJobBuilderChain) jobBuilderChains.get(direction); + if(Objects.nonNull(chain)) { + return chain.build(originJob, ctx); + } + return null; + } + + @Override + @SuppressWarnings("unchecked") + public void addJobBuilder(ExchangisJobBuilder jobBuilder) { + BuilderDirection direction = new BuilderDirection(jobBuilder.inputJob(), jobBuilder.outputJob()); + + jobBuilderChains.compute(direction, (key, value) -> { + if(Objects.isNull(value)){ + value = new GenericExchangisJobBuilderChain<>(); + } + value.registerBuilder(jobBuilder); + return value; + }); + } + + @Override + @SuppressWarnings("unchecked") + public ExchangisJobBuilderChain getJobBuilderChain(Class inputJob, Class outputJob) { + BuilderDirection direction = new BuilderDirection(inputJob, outputJob); + return jobBuilderChains.get(direction); + } + + @Override + public void resetJobBuilder(Class inputJob, Class outputJob) { + BuilderDirection direction = new BuilderDirection(inputJob, outputJob); + jobBuilderChains.compute(direction, (key, value) ->{ + if(Objects.nonNull(value)){ + value.clean(); + } + return value; + }); + } + + @Override + public void initBuilderChains() { + jobBuilderChains.values().forEach(ExchangisJobBuilderChain::initialize); + } + + private static class BuilderDirection { + + private Class inputJobClass; + + private Class outputJobClass; + + public BuilderDirection(Class inputJobClass, Class outputJobClass){ + this.inputJobClass = inputJobClass; + this.outputJobClass = outputJobClass; + } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + BuilderDirection that = (BuilderDirection) o; + return Objects.equals(inputJobClass, that.inputJobClass) && + Objects.equals(outputJobClass, that.outputJobClass); + } + + @Override + public int hashCode() { + return Objects.hash(inputJobClass, outputJobClass); + } + } + +} diff --git a/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/manager/ExchangisJobBuilderManager.java b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/manager/ExchangisJobBuilderManager.java new file mode 100644 index 000000000..262d30033 --- /dev/null +++ b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/manager/ExchangisJobBuilderManager.java @@ -0,0 +1,57 @@ +package com.webank.wedatasphere.exchangis.job.builder.manager; + +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.builder.api.ExchangisJobBuilder; +import com.webank.wedatasphere.exchangis.job.builder.api.ExchangisJobBuilderChain; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisBase; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJob; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; + +/** + * Define the builder manager interface + */ +public interface ExchangisJobBuilderManager { + + /** + * + * @param originJob origin job + * @param expectEntityClass expect entity class + * @param input class + * @param output class + * @return output + */ + E doBuild(T originJob, Class expectEntityClass, + ExchangisJobBuilderContext ctx) throws ExchangisJobException; + + E doBuild(T originJob, Class inputJobClass, Class expectEntityClass, + ExchangisJobBuilderContext ctx) throws ExchangisJobException; + /** + * + * @param jobBuilder job builder + */ + void addJobBuilder(ExchangisJobBuilder jobBuilder); + + /** + * + * @param inputJob input job + * @param outputEntity output entity + * @param + * @param + * @return + */ + ExchangisJobBuilderChain getJobBuilderChain(Class inputJob, Class outputEntity); + + /** + * Reset builder chain + * @param inputJob input job + * @param outputEntity output entity + * @param + * @param + */ + void resetJobBuilder(Class inputJob, Class outputEntity); + + /** + * Invoke the 'initialize' method of chains + */ + void initBuilderChains(); +} diff --git a/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/utils/Utils.java b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/utils/Utils.java new file mode 100644 index 000000000..90cb9b9c0 --- /dev/null +++ b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/utils/Utils.java @@ -0,0 +1,112 @@ +package com.webank.wedatasphere.exchangis.job.utils; + +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisDataSourceException; + +import java.io.File; +import java.net.JarURLConnection; +import java.net.URL; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; + +public class Utils { + + private static final String CLASS_SUFFIX = ".class"; + private static final String CLASS_FILE_PREFIX = File.separator + "classes" + File.separator; + private static final String PACKAGE_SEPARATOR = "."; + + public static List getClazzName(String packageName, boolean showChildPackageFlag) throws ExchangisDataSourceException { + + List result = new ArrayList<>(); + String suffixPath = packageName.replaceAll("\\.", "/"); + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + + try { + Enumeration urls = loader.getResources(suffixPath); + while (urls.hasMoreElements()) { + URL url = urls.nextElement(); + if (url != null) { + String protocol = url.getProtocol(); + if ("file".equals(protocol)) { + String path = url.getPath(); + result.addAll(getAllClassNameByFile(new File(path), showChildPackageFlag)); + } else if ("jar".equals(protocol)) { + JarFile jarFile = null; + jarFile = ((JarURLConnection) url.openConnection()).getJarFile(); + if (jarFile != null) { + result.addAll(getAllClassNameByJar(jarFile, packageName, showChildPackageFlag)); + } + } + } + } + } catch (Exception e) { + throw new ExchangisDataSourceException(23001, e.getLocalizedMessage()); + } + return result; + } + + private static List getAllClassNameByFile(File file, boolean flag) { + List result = new ArrayList<>(); + if (!file.exists()) { + return result; + } + if (file.isFile()) { + String path = file.getPath(); + if (path.endsWith(CLASS_SUFFIX)) { + path = path.replace(CLASS_SUFFIX, ""); + String clazzName = path.substring(path.indexOf(CLASS_FILE_PREFIX) + CLASS_FILE_PREFIX.length()) + .replace(File.separator, PACKAGE_SEPARATOR); + if (-1 == clazzName.indexOf("$")) { + result.add(clazzName); + } + } + return result; + } else { + File[] listFiles = file.listFiles(); + if (listFiles != null && listFiles.length > 0) { + for (File f : listFiles) { + if (flag) { + result.addAll(getAllClassNameByFile(f, flag)); + } else { + if (f.isFile()) { + String path = f.getPath(); + if (path.endsWith(CLASS_SUFFIX)) { + path = path.replace(CLASS_SUFFIX, ""); + String clazzName = path.substring(path.indexOf(CLASS_FILE_PREFIX) + CLASS_FILE_PREFIX.length()) + .replace(File.separator, PACKAGE_SEPARATOR); + if (-1 == clazzName.indexOf("$")) { + result.add(clazzName); + } + } + } + } + } + } + return result; + } + } + + private static List getAllClassNameByJar(JarFile jarFile, String packageName, boolean flag) { + List result = new ArrayList<>(); + Enumeration entries = jarFile.entries(); + while (entries.hasMoreElements()) { + JarEntry jarEntry = entries.nextElement(); + String name = jarEntry.getName(); + if (name.endsWith(CLASS_SUFFIX)) { + name = name.replace(CLASS_SUFFIX, "").replace("/", "."); + if (flag) { + if (name.startsWith(packageName) && -1 == name.indexOf("$")) { + result.add(name); + } + } else { + if (packageName.equals(name.substring(0, name.lastIndexOf("."))) && -1 == name.indexOf("$")) { + result.add(name); + } + } + } + } + return result; + } +} diff --git a/exchangis-job/exchangis-job-common/pom.xml b/exchangis-job/exchangis-job-common/pom.xml new file mode 100644 index 000000000..a7b31de93 --- /dev/null +++ b/exchangis-job/exchangis-job-common/pom.xml @@ -0,0 +1,32 @@ + + + + exchangis-job + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-job-common + + + + com.webank.wedatasphere.exchangis + exchangis-dao + 1.0.0-RC1 + + + org.apache.linkis + linkis-label-common + ${linkis.version} + + + org.apache.linkis + linkis-protocol + ${linkis.version} + + + + \ No newline at end of file diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/api/ExchangisJobOpenService.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/api/ExchangisJobOpenService.java new file mode 100644 index 000000000..484fc58ce --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/api/ExchangisJobOpenService.java @@ -0,0 +1,35 @@ +package com.webank.wedatasphere.exchangis.job.api; + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobEntity; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobQueryVo; + +import java.util.List; + +/** + * Open for the other module to invoke + */ +public interface ExchangisJobOpenService { + + /** + * Get job entity by id + * @param id + * @return + */ + ExchangisJobEntity getJobById(Long id, boolean basic) throws ExchangisJobException; + + /** + * Query job entity + * @param queryVo query vo + * @param inPage if in page + * @return + */ + List queryJobs(ExchangisJobQueryVo queryVo, boolean inPage) + throws ExchangisJobException; + + /** + * Delete the job entities + * @param idList id list + */ + void deleteJobBatch(List idList) throws ExchangisJobException; +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/constraints/LabelSerializeConstraints.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/constraints/LabelSerializeConstraints.java new file mode 100644 index 000000000..0effb14f5 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/constraints/LabelSerializeConstraints.java @@ -0,0 +1,16 @@ +package com.webank.wedatasphere.exchangis.job.constraints; + +/** + * Constraint for label serialization + */ +public class LabelSerializeConstraints { + /** + * Splitter symbol + */ + public static final String LABEL_ENTITY_SPLITTER_SYMBOL = ","; + + /** + * Combine symbol + */ + public static final String LABEL_KV_COMBINE_SYMBOL = "="; +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisBase.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisBase.java new file mode 100644 index 000000000..f83fcc3d7 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisBase.java @@ -0,0 +1,42 @@ +package com.webank.wedatasphere.exchangis.job.domain; + +import java.util.Date; + +/** + * Basic method of entity + */ +public interface ExchangisBase { + + /** + * ID + * @return LONG + */ + Long getId(); + + void setId(Long id); + + + /** + * Name + * @return STRING + */ + String getName(); + + void setName(String name); + + /** + * Create time + * @return DATE + */ + Date getCreateTime(); + + void setCreateTime(Date createTime); + + /** + * Last update time + * @return DATE + */ + Date getLastUpdateTime(); + + void setLastUpdateTime(Date lastUpdateTime); +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisEngineJob.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisEngineJob.java new file mode 100644 index 000000000..2354018ce --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisEngineJob.java @@ -0,0 +1,76 @@ +package com.webank.wedatasphere.exchangis.job.domain; + + +import com.webank.wedatasphere.exchangis.job.utils.MemUtils; + +import java.util.HashMap; +import java.util.Map; + +/** + * EngineJob + */ +public class ExchangisEngineJob extends GenericExchangisJob { + + + /** + * Job content + */ + private Map jobContent = new HashMap<>(); + + /** + * Job runtime params(defined by user) + */ + private Map runtimeParams = new HashMap<>(); + + /** + * Memory used in engine job + */ + private Long memoryUsed; + + private String memoryUnit = MemUtils.StoreUnit.MB.name(); + + /** + * Cpu used in engine job + */ + private Long cpuUsed; + + public Map getJobContent() { + return jobContent; + } + + public void setJobContent(Map jobContent) { + this.jobContent = jobContent; + } + + public Map getRuntimeParams() { + return runtimeParams; + } + + public void setRuntimeParams(Map runtimeParams) { + this.runtimeParams = runtimeParams; + } + + public Long getMemoryUsed() { + return memoryUsed; + } + + public void setMemoryUsed(Long memoryUsed) { + this.memoryUsed = memoryUsed; + } + + public Long getCpuUsed() { + return cpuUsed; + } + + public void setCpuUsed(Long cpuUsed) { + this.cpuUsed = cpuUsed; + } + + public String getMemoryUnit() { + return memoryUnit; + } + + public void setMemoryUnit(String memoryUnit) { + this.memoryUnit = memoryUnit; + } +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisJob.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisJob.java new file mode 100644 index 000000000..3107b81ed --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisJob.java @@ -0,0 +1,51 @@ +package com.webank.wedatasphere.exchangis.job.domain; + + +import java.util.Map; + +/** + * Basic job interface + */ +public interface ExchangisJob extends ExchangisBase{ + + /** + * Engine type + * @return type value + */ + String getEngineType(); + + void setEngineType(String engineType); + + /** + * Label String + * @return Label value + */ + String getJobLabel(); + + void setJobLabel(String engineType); + + /** + * Label map + * @return entities + */ + Map getJobLabels(); + + /** + * Set label Json + * @param labels + */ + void setJobLabels(String labels); + + /** + * Set label Map + * @param jobLabels + */ + void setJobLabels(Map jobLabels); + /** + * Create user + * @return user name + */ + String getCreateUser(); + + void setCreateUser(String createUser); +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisJobEntity.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisJobEntity.java new file mode 100644 index 000000000..67c84efb1 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisJobEntity.java @@ -0,0 +1,39 @@ +package com.webank.wedatasphere.exchangis.job.domain; + + +/** + * + */ +public class ExchangisJobEntity extends ExchangisJobInfo{ + + private Long projectId; + + private String source; + + private String modifyUser; + + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public String getModifyUser() { + return modifyUser; + } + + public void setModifyUser(String modifyUser) { + this.modifyUser = modifyUser; + } + +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisJobInfo.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisJobInfo.java new file mode 100644 index 000000000..ffb854643 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisJobInfo.java @@ -0,0 +1,92 @@ +package com.webank.wedatasphere.exchangis.job.domain; + +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobVo; + +/** + * Contain the content and parameters + */ +public class ExchangisJobInfo extends GenericExchangisJob { + /** + * Job content (JSON) + */ + protected String jobContent; + + /** + * Execute user + */ + protected String executeUser; + + /** + * Job params (JSON) + */ + protected String jobParams; + + /** + * Job description + */ + protected String jobDesc; + + /** + * Job type + */ + protected String jobType; + /** + * Convert from view object + * @param jobVo vo + */ + public ExchangisJobInfo(ExchangisJobVo jobVo){ + this.id = jobVo.getId(); + this.name = jobVo.getJobName(); + this.engineType = jobVo.getEngineType(); + this.jobLabel = jobVo.getJobLabels(); + this.createTime = jobVo.getCreateTime(); + this.createUser = jobVo.getCreateUser(); + this.lastUpdateTime = jobVo.getModifyTime(); + this.jobContent = jobVo.getContent(); + this.executeUser = jobVo.getExecuteUser(); + this.jobParams = jobVo.getJobParams(); + } + + public ExchangisJobInfo(){ + + } + public String getJobContent() { + return jobContent; + } + + public void setJobContent(String jobContent) { + this.jobContent = jobContent; + } + + public String getExecuteUser() { + return executeUser; + } + + public void setExecuteUser(String executeUser) { + this.executeUser = executeUser; + } + + public String getJobParams() { + return jobParams; + } + + public void setJobParams(String jobParams) { + this.jobParams = jobParams; + } + + public String getJobDesc() { + return jobDesc; + } + + public void setJobDesc(String jobDesc) { + this.jobDesc = jobDesc; + } + + public String getJobType() { + return jobType; + } + + public void setJobType(String jobType) { + this.jobType = jobType; + } +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisJobPageQuery.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisJobPageQuery.java new file mode 100644 index 000000000..babfe84bc --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisJobPageQuery.java @@ -0,0 +1,50 @@ +package com.webank.wedatasphere.exchangis.job.domain; + +import com.webank.wedatasphere.exchangis.common.pager.PageQuery; + +/** + * For querying page + */ +public class ExchangisJobPageQuery extends PageQuery { + + /** + * Project id + */ + protected Long projectId; + + /** + * Job type + */ + protected String jobType; + + /** + * Job name + */ + protected String jobName; + + protected String createUser; + + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + public String getJobType() { + return jobType; + } + + public void setJobType(String jobType) { + this.jobType = jobType; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisTask.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisTask.java new file mode 100644 index 000000000..e6f0f6b0a --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisTask.java @@ -0,0 +1,23 @@ +package com.webank.wedatasphere.exchangis.job.domain; + +/** + * Basic task interface + */ +public interface ExchangisTask extends ExchangisBase { + + /** + * Engine type + * @return type value + */ + String getEngineType(); + + void setEngineType(String engineType); + + /** + * Execute user + * @return + */ + String getExecuteUser(); + + void setExecuteUser(String executeUser); +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/GenericExchangisJob.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/GenericExchangisJob.java new file mode 100644 index 000000000..7493ce4ed --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/GenericExchangisJob.java @@ -0,0 +1,116 @@ +package com.webank.wedatasphere.exchangis.job.domain; + +import com.webank.wedatasphere.exchangis.job.utils.LabelConvertUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; + +/** + * Generic implement + */ +public class GenericExchangisJob implements ExchangisJob { + + private static final Logger LOG = LoggerFactory.getLogger(GenericExchangisJob.class); + + protected Long id; + + protected String name; + + protected String engineType; + + protected String jobLabel; + + private Map labelHolder = new HashMap<>(); + + protected Date createTime; + + protected Date lastUpdateTime; + + protected String createUser; + + @Override + public Long getId() { + return id; + } + + @Override + public void setId(Long id) { + this.id = id; + } + + @Override + public String getName() { + return name; + } + + @Override + public void setName(String name) { + this.name = name; + } + + @Override + public Date getCreateTime() { + return createTime; + } + + @Override + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + @Override + public Date getLastUpdateTime() { + return lastUpdateTime; + } + + @Override + public void setLastUpdateTime(Date lastUpdateTime) { + this.lastUpdateTime = lastUpdateTime; + } + + @Override + public String getEngineType() { + return this.engineType; + } + + @Override + public void setEngineType(String engineType) { + this.engineType = engineType; + } + + @Override + public String getJobLabel() { + return jobLabel; + } + + @Override + public void setJobLabel(String jobLabel) { + this.jobLabel = jobLabel; + } + + @Override + public Map getJobLabels() { + return labelHolder; + } + + @Override + public void setJobLabels(String labels) { + this.labelHolder = LabelConvertUtils.stringToLabelMap(labels); + } + + @Override + public void setJobLabels(Map jobLabels) { + this.labelHolder = jobLabels; + } + + @Override + public String getCreateUser() { + return createUser; + } + + @Override + public void setCreateUser(String createUser) { + this.createUser = createUser; + } +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/SubExchangisJob.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/SubExchangisJob.java new file mode 100644 index 000000000..be89f6e07 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/SubExchangisJob.java @@ -0,0 +1,97 @@ +package com.webank.wedatasphere.exchangis.job.domain; + +import com.webank.wedatasphere.exchangis.job.domain.params.JobParam; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParamSet; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +/** + * For each sub job entity, + * will have parameter set which divided into different realm + */ +public class SubExchangisJob extends GenericExchangisJob { + + + protected String sourceType; + + protected String sinkType; + + public static final String REALM_JOB_SETTINGS = "job.realm.settings"; + + public static final String REALM_JOB_DATA_SOURCE = "job.realm.data-source"; + + public static final String REALM_JOB_CONTENT_SINK = "job.realm.content.sink"; + + public static final String REALM_JOB_CONTENT_SOURCE = "job.realm.content.source"; + + public static final String REALM_JOB_COLUMN_MAPPING = "job.realm.column-mappings"; + + /** + * Realm params set + */ + private Map realmParamSet = new ConcurrentHashMap<>(); + + public String getSourceType() { + return sourceType; + } + + public void setSourceType(String sourceType) { + this.sourceType = sourceType; + } + + public String getSinkType() { + return sinkType; + } + + public void setSinkType(String sinkType) { + this.sinkType = sinkType; + } + + + /** + * Add + * @param realm realm info + * @param paramSet param set + */ + public void addRealmParams(String realm, JobParamSet paramSet){ + realmParamSet.put(realm, paramSet); + } + + /** + * Get + * @param realm realm info + * @return param set + */ + public JobParamSet getRealmParams(String realm){ + return realmParamSet.get(realm); + } + + /** + * Get and convert to map + * @param realm realm info + * @return map + */ + public Map getParamsToMap(String realm, boolean isTemp){ + JobParamSet jobParamSet = getRealmParams(realm); + return jobParamSet.toList(isTemp).stream().collect( + Collectors.toMap(JobParam::getStrKey, JobParam::getValue)); + } + + /** + * Get all and convert to map + * @return map + */ + public Map getParamsToMap(){ + return realmParamSet.values().stream().flatMap(realmParam -> realmParam.toList().stream()) + .collect(Collectors.toMap(JobParam::getStrKey, JobParam::getValue)); + } + + public Map getParamsToMap(boolean isTemp){ + return realmParamSet.values().stream().flatMap(realmParam -> realmParam.toList(isTemp).stream()) + .collect(Collectors.toMap(JobParam::getStrKey, JobParam::getValue, (left, right) -> right)); + } + + +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/DefaultJobParam.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/DefaultJobParam.java new file mode 100644 index 000000000..78d6e3304 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/DefaultJobParam.java @@ -0,0 +1,99 @@ +package com.webank.wedatasphere.exchangis.job.domain.params; + +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode; + +import java.util.Objects; +import java.util.function.BiFunction; + +public class DefaultJobParam implements JobParam { + private String key; + + private T value; + + private BiFunction valueLoader; + + private Object sourceReference = null; + + private boolean isTemp = false; + + private Class sourceType = Object.class; + + DefaultJobParam(){ + + } + + DefaultJobParam(String key, BiFunction valueLoader){ + this.key = key; + setValueLoader(valueLoader); + } + @Override + public String getStrKey() { + return key; + } + + @Override + public T getValue() { + return value; + } + + @Override + public T getValue(Object source) { + if(Objects.nonNull(source)) { + if (!Objects.equals(sourceReference, source) && + Objects.nonNull(valueLoader) && + sourceType.isAssignableFrom(source.getClass())) { + try { + this.value = this.valueLoader.apply(key, source); + } catch (Exception e){ + throw new ExchangisJobException.Runtime(ExchangisJobExceptionCode.TASK_PARM_ERROR.getCode(), + "Exception in loading param: [" + key + "]", e); + } + this.sourceReference = source; + } + } + return value; + } + + @Override + public JobParam loadValue(Object source){ + if(Objects.nonNull(source) && + Objects.nonNull(valueLoader) && + sourceType.isAssignableFrom(source.getClass())){ + try { + this.value = this.valueLoader.apply(key, source); + } catch (Exception e){ + throw new ExchangisJobException.Runtime(ExchangisJobExceptionCode.TASK_PARM_ERROR.getCode(), + "Exception in loading param: [" + key + "]", e); + } + this.sourceReference = source; + } + return this; + } + @Override + public void setKey(String key) { + this.key = key; + } + + @Override + public void setValue(T value) { + this.value = value; + } + + @Override + @SuppressWarnings("unchecked") + public void setValueLoader(BiFunction valueLoader) { + Class obj = null; + this.valueLoader = (BiFunction) valueLoader; + } + + @Override + public boolean isTemp() { + return isTemp; + } + + @Override + public void setTemp(boolean isTemp) { + this.isTemp = isTemp; + } +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParam.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParam.java new file mode 100644 index 000000000..52850007f --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParam.java @@ -0,0 +1,60 @@ +package com.webank.wedatasphere.exchangis.job.domain.params; + +import java.util.function.BiFunction; + +/** + * Define param entity + * @param + */ +public interface JobParam { + + /** + * Key of parameter, always string + * @return nullable + */ + String getStrKey(); + + /** + * Value of parameter + * @return nullable + */ + T getValue(); + + /** + * Get value of parameter form source obj + * @param source + * @return + */ + T getValue(Object source); + /** + * Set string key + * @param key nullable + */ + void setKey(String key); + + /** + * Set value + * @param value nullable + */ + void setValue(T value); + + JobParam loadValue(Object source); + /** + * Value loader + * @param valueLoader + * @param + */ + void setValueLoader(BiFunction valueLoader); + + /** + * Is temporary + * @return + */ + default boolean isTemp(){ + return false; + } + + default void setTemp(boolean isTemp){ + //Empty + } +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParamDefine.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParamDefine.java new file mode 100644 index 000000000..055cbc8c5 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParamDefine.java @@ -0,0 +1,63 @@ +package com.webank.wedatasphere.exchangis.job.domain.params; + + +import java.util.Objects; +import java.util.function.BiFunction; + +/** + * Definition of job params + * @param + */ +public class JobParamDefine{ + + public static ThreadLocal defaultParam = new ThreadLocal<>(); + + private String key; + + private BiFunction valueLoader; + + @SuppressWarnings("unchecked") + JobParamDefine(String key, BiFunction valueLoader){ + this.key = key; + this.valueLoader = (BiFunction)valueLoader; + } + + public String getKey() { + return key; + } + + public BiFunction getValueLoader() { + return valueLoader; + } + + /** + * New one param + * @param source source + * @return + */ + public JobParam newParam(Object source){ + JobParam jobParam = new DefaultJobParam<>(key, valueLoader); + return jobParam.loadValue(source); + } + + public T newValue(Object source){ + return newParam(source).getValue(); + } + /** + * Get param from source (if param has been exist,it will not invoke the loadValue method) + * @param source source + * @return + */ + public JobParam get(Object source){ + JobParamSet paramSet = defaultParam.get(); + if (Objects.nonNull(paramSet)){ + return paramSet.load(this, source); + } + return newParam(source); + } + + public T getValue(Object source){ + return get(source).getValue(); + } + +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParamSet.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParamSet.java new file mode 100644 index 000000000..e81470598 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParamSet.java @@ -0,0 +1,116 @@ +package com.webank.wedatasphere.exchangis.job.domain.params; + +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +/** + * Collection of JobParam + */ +public class JobParamSet { + + /** + * Param set + */ + private Map> jobParamStore = new ConcurrentHashMap<>(); + + + public JobParamSet add(JobParam jobParam){ + jobParamStore.put(jobParam.getStrKey(), jobParam); + return this; + } + + + public JobParamSet add(JobParamDefine jobParamDefine){ + return add(prepare(jobParamDefine, this)); + } + + public JobParamSet addNonNull(JobParamDefine jobParamDefine){ + JobParam prepared = prepare(jobParamDefine, this); + if(Objects.nonNull(prepared.getValue())){ + return add(prepared); + } + return null; + } + /** + * Append + * @param key custom key + * @param jobParam job parameter + */ + public JobParamSet add(String key, JobParam jobParam){ + jobParamStore.put(key, jobParam); + return this; + } + + public JobParamSet add(String key, JobParamDefine jobParamDefine){ + return add(key, prepare(jobParamDefine, this)); + } + + public JobParam load(JobParamDefine jobParamDefine){ + return load(jobParamDefine, this); + } + + @SuppressWarnings("unchecked") + public JobParam load(JobParamDefine jobParamDefine, Object source){ + // Avoid the deadlock problem in nested call, we should not use compute/computeIfAbsent method + JobParam jobParam = this.jobParamStore.get(jobParamDefine.getKey()); + if (Objects.isNull(jobParam)){ + jobParam = prepare(jobParamDefine, source); + this.jobParamStore.put(jobParamDefine.getKey(),jobParam); + } + return (JobParam) jobParam; + } + + public JobParamSet combine(JobParamSet paramSet){ + Map> other = paramSet.jobParamStore; + this.jobParamStore.putAll(other); + return this; + } + /** + * Get + * @param key param key + * @return param entity + */ + @SuppressWarnings("unchecked") + public JobParam get(String key){ + return (JobParam)jobParamStore.get(key); + } + + @SuppressWarnings("unchecked") + public JobParam get(String key, Class type){ + return (JobParam)jobParamStore.get(key); + } + /** + * Remove + * @param key param key + * @return removed param entity + */ + @SuppressWarnings("unchecked") + public JobParam remove(String key){ + return (JobParam) jobParamStore.remove(key); + } + + /** + * To List + * @return param list + */ + public List> toList(){ + return new ArrayList<>(jobParamStore.values()); + } + + public List> toList(boolean isTemp){ + return jobParamStore.values().stream().filter(param -> isTemp == param.isTemp()).collect(Collectors.toList()); + } + + /** + * New param from definition + * @param jobParam + */ + private JobParam prepare(JobParamDefine jobParam, Object source){ + return jobParam.newParam(source); + } + + public static void main(String[] args){ + JobParam ok = new JobParamSet().get("ok"); + } +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParams.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParams.java new file mode 100644 index 000000000..5f8047092 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParams.java @@ -0,0 +1,113 @@ +package com.webank.wedatasphere.exchangis.job.domain.params; + + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.BiFunction; +import java.util.function.Supplier; + +/** + * Util class + */ +public class JobParams { + + /** + * Define default job param + * @param key key + * @param valueLoader value loader + * @param + * @param + * @return + */ + public static JobParamDefine define(String key, BiFunction valueLoader){ + return new JobParamDefine<>(key, valueLoader); + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + public static JobParamDefine define(String key){ + return new JobParamDefine<>(key, (paramKey, source) -> { + if(Objects.nonNull(source)){ + if(source instanceof JobParamSet) { + JobParam result = ((JobParamSet)source).get(key); + return Objects.nonNull(result)? (U)result.getValue() : null; + }else if (source instanceof Map){ + return (U) ((Map)source).get(key); + } + } + return null; + }); + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + public static JobParamDefine define(String key, Class valueType){ + return new JobParamDefine<>(key,(paramKey, source) -> { + if(Objects.nonNull(source)){ + if(source instanceof JobParamSet) { + JobParam result = ((JobParamSet)source).get(key); + return Objects.nonNull(result)? (T)result.getValue() : null; + }else if (source instanceof Map){ + return (T) ((Map)source).get(key); + } + } + return null; + }); + } + /** + * Use default value loader: (string, JobParamSet) -> ? + * @param key key + * @param mappingKey mapping key + * @return + */ + @SuppressWarnings({"unchecked", "rawtypes"}) + public static JobParamDefine define(String key, String mappingKey){ + return new JobParamDefine<>(key, (paramKey, source) -> { + if(Objects.nonNull(source)){ + if(source instanceof JobParamSet) { + JobParam result = ((JobParamSet)source).remove(mappingKey); + return Objects.nonNull(result)? (U)result.getValue() : null; + }else if (source instanceof Map){ + return (U) ((Map)source).remove(mappingKey); + } + } + return null; + }); + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + public static JobParamDefine define(String key, String mappingKey, Class valueType){ + return new JobParamDefine(key, (paramKey, source) -> { + if(Objects.nonNull(source)){ + if(source instanceof JobParamSet) { + JobParam result = ((JobParamSet)source).remove(mappingKey); + return Objects.nonNull(result)? (T)result.getValue() : null; + }else if (source instanceof Map){ + return (T) ((Map)source).remove(mappingKey); + } + } + return null; + }); + } + + /** + * Use operator instead of value loader + * @param key + * @param operator + * @param + * @return + */ + public static JobParamDefine define(String key, Supplier operator){ + return new JobParamDefine<>(key, (paramKey, source) -> operator.get()); + } + + public static JobParam newOne(String key, T value){ + return newOne(key, value, false); + } + + public static JobParam newOne(String key, T value, boolean isTemp){ + JobParamDefine result = define(key, () -> value); + JobParam param = result.newParam(value); + param.setTemp(isTemp); + return param; + } +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/enums/EngineTypeEnum.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/enums/EngineTypeEnum.java new file mode 100644 index 000000000..89902f901 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/enums/EngineTypeEnum.java @@ -0,0 +1,5 @@ +package com.webank.wedatasphere.exchangis.job.enums; + +public enum EngineTypeEnum { + DATAX, SQOOP, DICTCOPY; +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/enums/JobTypeEnum.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/enums/JobTypeEnum.java new file mode 100644 index 000000000..fcd9b083b --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/enums/JobTypeEnum.java @@ -0,0 +1,12 @@ +package com.webank.wedatasphere.exchangis.job.enums; + +public enum JobTypeEnum { + /* + 离线同步 + */ + OFFLINE, + /* + 流式同步 + */ + STREAM; +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/exception/ExchangisJobException.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/exception/ExchangisJobException.java new file mode 100644 index 000000000..e770a1ea4 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/exception/ExchangisJobException.java @@ -0,0 +1,43 @@ +package com.webank.wedatasphere.exchangis.job.exception; + + +import org.apache.linkis.common.exception.ErrorException; +import org.apache.linkis.common.exception.ExceptionLevel; +import org.apache.linkis.common.exception.LinkisRuntimeException; + +import static com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode.JOB_EXCEPTION_CODE; + +/** + * Exchangis Job Exception + */ +public class ExchangisJobException extends ErrorException { + + public ExchangisJobException(int errCode, String desc) { + super(errCode, desc); + } + + public ExchangisJobException(String desc, Throwable t){ + this(JOB_EXCEPTION_CODE.getCode(), desc, t); + } + public ExchangisJobException(int errCode, String desc, Throwable t) { + super(errCode, desc); + this.initCause(t); + } + + public ExchangisJobException(int errCode, String desc, String ip, int port, String serviceKind) { + super(errCode, desc, ip, port, serviceKind); + } + + public static class Runtime extends LinkisRuntimeException { + + public Runtime(int errCode, String desc, Throwable t) { + super(errCode, desc); + super.initCause(t); + } + + @Override + public ExceptionLevel getLevel() { + return ExceptionLevel.ERROR; + } + } +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/exception/ExchangisJobExceptionCode.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/exception/ExchangisJobExceptionCode.java new file mode 100644 index 000000000..9e08768be --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/exception/ExchangisJobExceptionCode.java @@ -0,0 +1,35 @@ +package com.webank.wedatasphere.exchangis.job.exception; + +/** + * Exception code, range:(31000 ~ 31999), the same as "ExchangisDataSourceExceptionCode" + */ +public enum ExchangisJobExceptionCode { + METRICS_OP_ERROR(31886), + TASK_LAUNCH_NOT_EXIST(31887), + TASK_LAUNCH_ERROR(31888), + TASK_PARM_ERROR(31889), + LOG_OP_ERROR(31990), + TASK_EXECUTE_ERROR(31991), + TASK_OBSERVER_ERROR(31992), + ON_EVENT_ERROR(31993), + SCHEDULER_ERROR(31994), + TASK_BUILDER_ERROR(31995), + UNSUPPORTED_TASK_LAUNCH_ENGINE(31996), + TASK_GENERATE_ERROR(31997), + JOB_EXCEPTION_CODE(31999), + ENGINE_JOB_ERROR(31998), + TRANSFORM_JOB_ERROR(31998); + private int code; + + ExchangisJobExceptionCode(int code) { + this.code = code; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/exception/ExchangisOnEventException.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/exception/ExchangisOnEventException.java new file mode 100644 index 000000000..04b3cd9a5 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/exception/ExchangisOnEventException.java @@ -0,0 +1,14 @@ +package com.webank.wedatasphere.exchangis.job.exception; + +import org.apache.linkis.common.exception.ErrorException; + +import static com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode.ON_EVENT_ERROR; +/** + * Exception happened in listener + */ +public class ExchangisOnEventException extends ErrorException { + public ExchangisOnEventException(String desc, Throwable t) { + super(ON_EVENT_ERROR.getCode(), desc); + } + +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/listener/ExchangisEvent.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/listener/ExchangisEvent.java new file mode 100644 index 000000000..afe9c3af0 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/listener/ExchangisEvent.java @@ -0,0 +1,17 @@ +package com.webank.wedatasphere.exchangis.job.listener; + + +/** + * Event between different modules + */ +public interface ExchangisEvent { + + String eventId(); + + void setEventId(String eventId); + + long getEventTime(); + + void setEventTime(long timestamp); + +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/listener/ExchangisListener.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/listener/ExchangisListener.java new file mode 100644 index 000000000..983e5443d --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/listener/ExchangisListener.java @@ -0,0 +1,35 @@ +package com.webank.wedatasphere.exchangis.job.listener; + + +import com.webank.wedatasphere.exchangis.job.exception.ExchangisOnEventException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Listener + */ +public interface ExchangisListener{ + + default Logger getLogger(){ + return LoggerFactory.getLogger(ExchangisListener.class); + } + /** + * Listen the event + * @param event + */ + default void onEvent(T event) throws ExchangisOnEventException { + getLogger().info("Event: [id: {}, type: {}] in listener [{}]", event.eventId(), event.getClass().getSimpleName(), + this.getClass().getSimpleName()); + } + + default void onAsyncEvent(T event){ + try { + onEvent(event); + } catch (Exception e) { + if (e instanceof ExchangisOnEventException){ + getLogger().warn("OnEvent exception: [{}]", e.getMessage(), e); + } + getLogger().warn("Exception occurred in listen event: {} in listener [{}]", event.eventId(), this.getClass().getSimpleName(), e); + } + } +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/listener/JobLogListener.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/listener/JobLogListener.java new file mode 100644 index 000000000..15e8d92d3 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/listener/JobLogListener.java @@ -0,0 +1,12 @@ +package com.webank.wedatasphere.exchangis.job.listener; + + +import com.webank.wedatasphere.exchangis.job.listener.events.JobLogEvent; + +/** + * Job Log listener for ExchangisJobLogEvent + */ +public interface JobLogListener extends ExchangisListener { + + +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/listener/events/JobLogEvent.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/listener/events/JobLogEvent.java new file mode 100644 index 000000000..61b2669f0 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/listener/events/JobLogEvent.java @@ -0,0 +1,96 @@ +package com.webank.wedatasphere.exchangis.job.listener.events; + +import com.webank.wedatasphere.exchangis.job.listener.ExchangisEvent; +import org.apache.commons.lang.StringUtils; + +import java.util.Objects; + +public class JobLogEvent implements ExchangisEvent { + + public enum Level{ + TRACE, INFO, WARN, ERROR + } + private String jobExecutionId; + + private String message; + + private Level level = Level.INFO; + + private Object[] args; + + private Throwable throwable; + + private long eventTime; + + private String tenancy = "default"; + + public JobLogEvent(Level level, String tenancy, String jobExecutionId, String message, Object... args){ + if (StringUtils.isNotBlank(tenancy)){ + this.tenancy = tenancy; + } + this.jobExecutionId = jobExecutionId; + this.message = message; + this.eventTime = System.currentTimeMillis(); + if (Objects.nonNull(level)){ + this.level = level; + } + if (args != null && args.length > 0){ + Object lastEntry = args[args.length - 1]; + if (lastEntry instanceof Throwable ){ + this.throwable = (Throwable)lastEntry; + this.level = Level.ERROR; + } + this.args = args; + } + } + + public JobLogEvent(String tenancy, String jobExecutionId, String message, Object... args){ + this(Level.INFO, tenancy, jobExecutionId, jobExecutionId, message, args); + } + public JobLogEvent(String jobExecutionId, String message, Object... args){ + this(Level.INFO, null, jobExecutionId, message, args); + } + @Override + public String eventId() { + return jobExecutionId; + } + + @Override + public void setEventId(String eventId) { + //null + } + + @Override + public long getEventTime() { + return this.eventTime; + } + + @Override + public void setEventTime(long timestamp) { + this.eventTime = timestamp; + } + + public String getJobExecutionId() { + return jobExecutionId; + } + + public String getMessage() { + return message; + } + + public Object[] getArgs() { + return args; + } + + public Throwable getThrowable() { + return throwable; + } + + public String getTenancy() { + return tenancy; + } + + public Level getLevel() { + return level; + } +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/log/LogQuery.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/log/LogQuery.java new file mode 100644 index 000000000..0ab7780b9 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/log/LogQuery.java @@ -0,0 +1,91 @@ +package com.webank.wedatasphere.exchangis.job.log; + +import org.apache.commons.lang.StringUtils; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +/** + * Query task Log + */ +public class LogQuery { + + private int fromLine = 1; + + private int pageSize = 100; + + private String ignoreKeywords; + + private String onlyKeywords; + + private Integer lastRows; + + public LogQuery(){ + + } + + public LogQuery(int fromLine, int pageSize){ + this.fromLine = fromLine; + this.pageSize = pageSize; + } + public LogQuery(int fromLine, int pageSize, String ignoreKeywords, String onlyKeywords, Integer lastRows){ + this.fromLine = fromLine; + this.pageSize = pageSize; + this.ignoreKeywords = ignoreKeywords; + this.onlyKeywords = onlyKeywords; + this.lastRows = lastRows; + } + public Integer getLastRows() { + return lastRows; + } + + public void setLastRows(Integer lastRows) { + this.lastRows = lastRows; + } + + public int getFromLine() { + return fromLine; + } + + public void setFromLine(int fromLine) { + this.fromLine = fromLine; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public String getIgnoreKeywords() { + return ignoreKeywords; + } + + public List getIgnoreKeywordsList(){ + if (StringUtils.isNotBlank(this.ignoreKeywords)){ + return Arrays.asList(this.ignoreKeywords.split(",")); + } + return Collections.emptyList(); + } + public void setIgnoreKeywords(String ignoreKeywords) { + this.ignoreKeywords = ignoreKeywords; + } + + public String getOnlyKeywords() { + return onlyKeywords; + } + + public List getOnlyKeywordsList(){ + if (StringUtils.isNotBlank(this.onlyKeywords)){ + return Arrays.asList(this.onlyKeywords.split(",")); + } + return Collections.emptyList(); + } + + public void setOnlyKeywords(String onlyKeywords) { + this.onlyKeywords = onlyKeywords; + } +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/log/LogResult.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/log/LogResult.java new file mode 100644 index 000000000..e65192459 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/log/LogResult.java @@ -0,0 +1,55 @@ +package com.webank.wedatasphere.exchangis.job.log; + +import java.util.ArrayList; +import java.util.List; + +/** + * Task log + */ +public class LogResult { + + /** + * End line + */ + private int endLine; + + /** + * If is end + */ + private boolean isEnd; + + /** + * Log content + */ + private List logs = new ArrayList<>(); + + public LogResult(int endLine, boolean isEnd, List logs){ + this.endLine = endLine; + this.isEnd = isEnd; + this.logs = logs; + } + + public int getEndLine() { + return endLine; + } + + public void setEndLine(int endLine) { + this.endLine = endLine; + } + + public boolean isEnd() { + return isEnd; + } + + public void setEnd(boolean end) { + isEnd = end; + } + + public List getLogs() { + return logs; + } + + public void setLogs(List logs) { + this.logs = logs; + } +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/utils/LabelConvertUtils.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/utils/LabelConvertUtils.java new file mode 100644 index 000000000..c781122dc --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/utils/LabelConvertUtils.java @@ -0,0 +1,49 @@ +package com.webank.wedatasphere.exchangis.job.utils; + +import com.webank.wedatasphere.exchangis.job.constraints.LabelSerializeConstraints; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.manager.label.entity.SerializableLabel; + +import java.util.HashMap; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * Label converter + */ +public class LabelConvertUtils { + + /** + * Convert labels to string + * @param labels Map of label entities + */ + public static String labelsToString(Map labels){ + return labels.entrySet().stream().map( entry -> { + String labelKey = entry.getKey(); + Object entryValue = entry.getValue(); + return labelKey + LabelSerializeConstraints.LABEL_KV_COMBINE_SYMBOL + + (entryValue instanceof SerializableLabel? ((SerializableLabel)entryValue).getStringValue() : entryValue.toString()); + }).collect(Collectors.joining(LabelSerializeConstraints.LABEL_ENTITY_SPLITTER_SYMBOL)); + } + + /** + * Convert string to label map + * @param labelStr label string + * @return label map + */ + public static Map stringToLabelMap(String labelStr){ + if (StringUtils.isNotBlank(labelStr)) { + Map candidateLabels = new HashMap<>(); + String[] labelEntities = labelStr.split(LabelSerializeConstraints.LABEL_ENTITY_SPLITTER_SYMBOL); + for (String labelEntity : labelEntities) { + String[] kvContent = labelEntity.split(LabelSerializeConstraints.LABEL_KV_COMBINE_SYMBOL); + String key = kvContent[0]; + String value = kvContent.length > 1 ? kvContent[1] : null; + candidateLabels.put(key, value); + } + return candidateLabels; + } + return null; + } + +} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/MemUtils.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/utils/MemUtils.java old mode 100755 new mode 100644 similarity index 84% rename from modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/MemUtils.java rename to exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/utils/MemUtils.java index 81a23d48b..5c3af8b64 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/MemUtils.java +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/utils/MemUtils.java @@ -1,253 +1,234 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.util; - - -import org.apache.commons.lang3.StringUtils; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author davidhua - * 2020/1/3 - */ -public class MemUtils { - private static final Map UNIT_MAP = new HashMap<>(); - static{ - UNIT_MAP.put("G", StoreUnit.GB); - UNIT_MAP.put("GB", StoreUnit.GB); - UNIT_MAP.put("B", StoreUnit.B); - UNIT_MAP.put("M", StoreUnit.MB); - UNIT_MAP.put("MB", StoreUnit.MB); - UNIT_MAP.put("K", StoreUnit.KB); - UNIT_MAP.put("KB", StoreUnit.KB); - } - public static long convertToGB(long size, String unitFlag){ - if(size < 0){ - return -1L; - } - if(StringUtils.isNotBlank(unitFlag)){ - StoreUnit storeUnit = UNIT_MAP.get(unitFlag.trim().toUpperCase()); - if(null != storeUnit){ - return storeUnit.toGB(size); - } - } - return -1L; - } - - public static long convertToMB(long size, String unitFlag){ - if(size < 0){ - return -1L; - } - if(StringUtils.isNotBlank(unitFlag)){ - StoreUnit storeUnit = UNIT_MAP.get(unitFlag.trim().toUpperCase()); - if(null != storeUnit){ - return storeUnit.toMB(size); - } - } - return -1L; - } - - public static long convertToByte(long size, String unitFlag){ - if(size < 0){ - return -1L; - } - if(StringUtils.isNotBlank(unitFlag)){ - StoreUnit storeUnit = UNIT_MAP.get(unitFlag.trim().toUpperCase()); - if(null != storeUnit){ - return storeUnit.toB(size); - } - } - return -1L; - } - public enum StoreUnit { - /** - * byte - */ - B { - @Override - public long toB(long s){ - return s; - } - - @Override - public long toKB(long s){ - return s/(C1/C0); - } - - @Override - public long toMB(long s) { - return s/(C2/C0); - } - - @Override - public long toGB(long s) { - return s/(C3/C0); - } - - @Override - public long toTB(long s) { - return s/(C4/C0); - } - }, - /** - * kb - */ - KB{ - @Override - public long toB(long s){ - return x(s, C1/C0, Long.MAX_VALUE/(C1/C0)); - } - - @Override - public long toKB(long s){ - return s; - } - - @Override - public long toMB(long s) { - return s/(C2/C1); - } - - @Override - public long toGB(long s) { - return s/(C3/C1); - } - - @Override - public long toTB(long s) { - return s/(C4/C0); - } - }, - MB{ - @Override - public long toB(long s){ - return x(s, C2/C0, Long.MAX_VALUE/(C2/C0)); - } - - @Override - public long toKB(long s){ - return x(s, C2/C1, Long.MAX_VALUE/(C2/C1)); - } - - @Override - public long toMB(long s) { - return s; - } - - @Override - public long toGB(long s) { - return s/(C3/C2); - } - - @Override - public long toTB(long s) { - return s/(C4/C2); - } - }, - GB{ - @Override - public long toB(long s){ - return x(s, C3/C0, Long.MAX_VALUE/(C3/C0)); - } - - @Override - public long toKB(long s){ - return x(s, C3/C1, Long.MAX_VALUE/(C3/C1)); - } - - @Override - public long toMB(long s) { - return x(s, C3/C2, Long.MAX_VALUE/(C3/C2)); - } - - @Override - public long toGB(long s) { - return s; - } - - @Override - public long toTB(long s) { - return s/(C4/C3); - } - }, - TB{ - @Override - public long toB(long s){ - return x(s, C4/C0, Long.MAX_VALUE/(C4/C0)); - } - - @Override - public long toKB(long s){ - return x(s, C4/C1, Long.MAX_VALUE/(C4/C1)); - } - - @Override - public long toMB(long s) { - return x(s, C4/C2, Long.MAX_VALUE/(C4/C2)); - } - - @Override - public long toGB(long s) { - return x(s, C4/C3, Long.MAX_VALUE/(C4/C3)); - } - - @Override - public long toTB(long s) { - return s; - } - }; - - public long toB(long s){ - throw new AbstractMethodError(); - } - - public long toKB(long s){ - throw new AbstractMethodError(); - } - - public long toMB(long s){ - throw new AbstractMethodError(); - } - - public long toGB(long s){ - throw new AbstractMethodError(); - } - - public long toTB(long s){ - throw new AbstractMethodError(); - } - } - - static long x(long d, long m, long over){ - if(d > over){ - return Long.MAX_VALUE; - } - if(d < -over){ - return Long.MIN_VALUE; - } - return d * m; - } - static final long C0 = 1L; - static final long C1 = C0 * 1024L; - static final long C2 = C1 * 1024L; - static final long C3 = C2 * 1024L; - static final long C4 = C3 * 1024L; - -} +package com.webank.wedatasphere.exchangis.job.utils; + +import org.apache.commons.lang.StringUtils; + +import java.util.HashMap; +import java.util.Map; + +/** + * Mem utils + */ +public class MemUtils { + private static final Map UNIT_MAP = new HashMap<>(); + static{ + UNIT_MAP.put("G", StoreUnit.GB); + UNIT_MAP.put("GB", StoreUnit.GB); + UNIT_MAP.put("B", StoreUnit.B); + UNIT_MAP.put("M", StoreUnit.MB); + UNIT_MAP.put("MB", StoreUnit.MB); + UNIT_MAP.put("K", StoreUnit.KB); + UNIT_MAP.put("KB", StoreUnit.KB); + } + public static long convertToGB(long size, String unitFlag){ + if(size < 0){ + return -1L; + } + if(StringUtils.isNotBlank(unitFlag)){ + StoreUnit storeUnit = UNIT_MAP.get(unitFlag.trim().toUpperCase()); + if(null != storeUnit){ + return storeUnit.toGB(size); + } + } + return -1L; + } + + public static long convertToMB(long size, String unitFlag){ + if(size < 0){ + return -1L; + } + if(StringUtils.isNotBlank(unitFlag)){ + StoreUnit storeUnit = UNIT_MAP.get(unitFlag.trim().toUpperCase()); + if(null != storeUnit){ + return storeUnit.toMB(size); + } + } + return -1L; + } + + public static long convertToByte(long size, String unitFlag){ + if(size < 0){ + return -1L; + } + if(StringUtils.isNotBlank(unitFlag)){ + StoreUnit storeUnit = UNIT_MAP.get(unitFlag.trim().toUpperCase()); + if(null != storeUnit){ + return storeUnit.toB(size); + } + } + return -1L; + } + public enum StoreUnit { + /** + * byte + */ + B { + @Override + public long toB(long s){ + return s; + } + + @Override + public long toKB(long s){ + return s/(C1/C0); + } + + @Override + public long toMB(long s) { + return s/(C2/C0); + } + + @Override + public long toGB(long s) { + return s/(C3/C0); + } + + @Override + public long toTB(long s) { + return s/(C4/C0); + } + }, + /** + * kb + */ + KB{ + @Override + public long toB(long s){ + return x(s, C1/C0, Long.MAX_VALUE/(C1/C0)); + } + + @Override + public long toKB(long s){ + return s; + } + + @Override + public long toMB(long s) { + return s/(C2/C1); + } + + @Override + public long toGB(long s) { + return s/(C3/C1); + } + + @Override + public long toTB(long s) { + return s/(C4/C0); + } + }, + MB{ + @Override + public long toB(long s){ + return x(s, C2/C0, Long.MAX_VALUE/(C2/C0)); + } + + @Override + public long toKB(long s){ + return x(s, C2/C1, Long.MAX_VALUE/(C2/C1)); + } + + @Override + public long toMB(long s) { + return s; + } + + @Override + public long toGB(long s) { + return s/(C3/C2); + } + + @Override + public long toTB(long s) { + return s/(C4/C2); + } + }, + GB{ + @Override + public long toB(long s){ + return x(s, C3/C0, Long.MAX_VALUE/(C3/C0)); + } + + @Override + public long toKB(long s){ + return x(s, C3/C1, Long.MAX_VALUE/(C3/C1)); + } + + @Override + public long toMB(long s) { + return x(s, C3/C2, Long.MAX_VALUE/(C3/C2)); + } + + @Override + public long toGB(long s) { + return s; + } + + @Override + public long toTB(long s) { + return s/(C4/C3); + } + }, + TB{ + @Override + public long toB(long s){ + return x(s, C4/C0, Long.MAX_VALUE/(C4/C0)); + } + + @Override + public long toKB(long s){ + return x(s, C4/C1, Long.MAX_VALUE/(C4/C1)); + } + + @Override + public long toMB(long s) { + return x(s, C4/C2, Long.MAX_VALUE/(C4/C2)); + } + + @Override + public long toGB(long s) { + return x(s, C4/C3, Long.MAX_VALUE/(C4/C3)); + } + + @Override + public long toTB(long s) { + return s; + } + }; + + public long toB(long s){ + throw new AbstractMethodError(); + } + + public long toKB(long s){ + throw new AbstractMethodError(); + } + + public long toMB(long s){ + throw new AbstractMethodError(); + } + + public long toGB(long s){ + throw new AbstractMethodError(); + } + + public long toTB(long s){ + throw new AbstractMethodError(); + } + } + + static long x(long d, long m, long over){ + if(d > over){ + return Long.MAX_VALUE; + } + if(d < -over){ + return Long.MIN_VALUE; + } + return d * m; + } + static final long C0 = 1L; + static final long C1 = C0 * 1024L; + static final long C2 = C1 * 1024L; + static final long C3 = C2 * 1024L; + static final long C4 = C3 * 1024L; + +} \ No newline at end of file diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/SnowFlake.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/utils/SnowFlake.java old mode 100755 new mode 100644 similarity index 79% rename from modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/SnowFlake.java rename to exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/utils/SnowFlake.java index bbf46bb17..b16987e4c --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/SnowFlake.java +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/utils/SnowFlake.java @@ -1,105 +1,86 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.util; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * snowflake - * @author davidhua - * 2019/6/4 - */ -public class SnowFlake { - private static final Logger logger = LoggerFactory.getLogger(SnowFlake.class); - - private static long workerIdBits = 5L; - private static long dataCenterIdBits = 5L; - - /** - * Counter - */ - private static long sequenceBits = 12L; - /** - * Shift left - */ - private static long workerIdShift = sequenceBits; - private static long dataCenterIdShift = sequenceBits + workerIdBits; - private static long timestampLeftShift = sequenceBits + workerIdBits + dataCenterIdBits; - private static long sequenceMask = -1L ^ (-1L << sequenceBits); - private static long maxWorkerId = -1L ^ (-1L << workerIdBits); - private static long maxDataCenterId = -1L ^ (-1L << dataCenterIdBits); - private long lastTimeStamp = -1L; - - private long workerId; - private long dataCenterId; - private long sequence=0L; - - private long startTime = 1238434978657L; - public SnowFlake(long dataCenterId, long workerId, long startTime){ - //check - if(workerId > maxWorkerId || workerId < 0){ - throw new IllegalArgumentException("worker Id can't be greater than " + maxWorkerId + " or less than 0"); - } - if(dataCenterId > maxDataCenterId || dataCenterId < 0){ - throw new IllegalArgumentException("dataCenter Id can't be greater than " + maxDataCenterId + " or less than 0"); - } - this.workerId = workerId; - this.startTime = startTime; - this.dataCenterId = dataCenterId; - } - - public static long generateId(long timestamp, long startTime , long dataCenterId, long workerId){ - return ((timestamp - startTime) << timestampLeftShift) | (dataCenterId << dataCenterIdShift) | (workerId << workerIdShift); - } - - public static long generateId(long timestamp, long startTime){ - return ((timestamp - startTime) << timestampLeftShift) | (maxDataCenterId << dataCenterIdShift) | (maxWorkerId << workerIdShift); - } - /** - * Application lock - */ - public synchronized long nextId(){ - long timestamp = timeGen(); - if(timestamp < lastTimeStamp){ - logger.info("clock is moving backwards.Rejecting request until " + lastTimeStamp); - } - if(lastTimeStamp == timestamp){ - sequence = (sequence + 1) & sequenceMask; - if(sequence == 0){ - timestamp = tillNextMills(lastTimeStamp); - } - }else{ - sequence = 0L; - } - lastTimeStamp = timestamp; - return ((timestamp - startTime) << timestampLeftShift)|(dataCenterId << dataCenterIdShift) | (workerId << workerIdShift) | sequence; - } - - private long tillNextMills(long lastTimeStamp){ - long timestamp = timeGen(); - while(timestamp <= lastTimeStamp){ - timestamp = timeGen(); - } - return timestamp; - } - private long timeGen(){ - return System.currentTimeMillis(); - } - -} +package com.webank.wedatasphere.exchangis.job.utils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * snowflake + */ +public class SnowFlake { + private static final Logger logger = LoggerFactory.getLogger(SnowFlake.class); + + private static long workerIdBits = 5L; + private static long dataCenterIdBits = 5L; + + /** + * Counter + */ + private static long sequenceBits = 12L; + /** + * Shift left + */ + private static long workerIdShift = sequenceBits; + private static long dataCenterIdShift = sequenceBits + workerIdBits; + private static long timestampLeftShift = sequenceBits + workerIdBits + dataCenterIdBits; + private static long sequenceMask = -1L ^ (-1L << sequenceBits); + private static long maxWorkerId = -1L ^ (-1L << workerIdBits); + private static long maxDataCenterId = -1L ^ (-1L << dataCenterIdBits); + private long lastTimeStamp = -1L; + + private long workerId; + private long dataCenterId; + private long sequence=0L; + + private long startTime = 1238434978657L; + public SnowFlake(long dataCenterId, long workerId, long startTime){ + //check + if(workerId > maxWorkerId || workerId < 0){ + throw new IllegalArgumentException("worker Id can't be greater than " + maxWorkerId + " or less than 0"); + } + if(dataCenterId > maxDataCenterId || dataCenterId < 0){ + throw new IllegalArgumentException("dataCenter Id can't be greater than " + maxDataCenterId + " or less than 0"); + } + this.workerId = workerId; + this.startTime = startTime; + this.dataCenterId = dataCenterId; + } + + public static long generateId(long timestamp, long startTime , long dataCenterId, long workerId){ + return ((timestamp - startTime) << timestampLeftShift) | (dataCenterId << dataCenterIdShift) | (workerId << workerIdShift); + } + + public static long generateId(long timestamp, long startTime){ + return ((timestamp - startTime) << timestampLeftShift) | (maxDataCenterId << dataCenterIdShift) | (maxWorkerId << workerIdShift); + } + /** + * Application lock + */ + public synchronized long nextId(){ + long timestamp = timeGen(); + if(timestamp < lastTimeStamp){ + logger.info("clock is moving backwards.Rejecting request until " + lastTimeStamp); + } + if(lastTimeStamp == timestamp){ + sequence = (sequence + 1) & sequenceMask; + if(sequence == 0){ + timestamp = tillNextMills(lastTimeStamp); + } + }else{ + sequence = 0L; + } + lastTimeStamp = timestamp; + return ((timestamp - startTime) << timestampLeftShift)|(dataCenterId << dataCenterIdShift) | (workerId << workerIdShift) | sequence; + } + + private long tillNextMills(long lastTimeStamp){ + long timestamp = timeGen(); + while(timestamp <= lastTimeStamp){ + timestamp = timeGen(); + } + return timestamp; + } + private long timeGen(){ + return System.currentTimeMillis(); + } + +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/utils/TypeGenericUtils.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/utils/TypeGenericUtils.java new file mode 100644 index 000000000..801079d0d --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/utils/TypeGenericUtils.java @@ -0,0 +1,56 @@ +package com.webank.wedatasphere.exchangis.job.utils; + +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.lang.reflect.TypeVariable; +import java.util.*; + +/** + * Utils of type generic + */ +public class TypeGenericUtils { + + public static Class getActualTypeFormGenericClass(Class genericClass, Class abstractClass, + int position){ + Map typeVariableReflect = new HashMap<>(); + Map, Type[]> classTypeVariableMap = new HashMap<>(); + Queue> traverseQueue = new LinkedList<>(); + Type[] classTypes = null; + Class currentClass; + traverseQueue.offer(genericClass); + while (!traverseQueue.isEmpty()) { + currentClass = traverseQueue.poll(); + Type[] typeParameters = currentClass.getTypeParameters(); + if (typeParameters.length > 0) { + classTypes = classTypeVariableMap.get(currentClass); + //Ignore the builder which has the parameterType (not resolved) + if (null == classTypes) { + return null; + } + for (int i = 0; i < classTypes.length; i++) { + typeVariableReflect.put(typeParameters[i].getTypeName(), classTypes[i]); + } + } + if (Objects.equals(currentClass, abstractClass)){ + break; + } + //Just traverse the superclass ignore interfaces + Type superclassType = currentClass.getGenericSuperclass(); + if (Objects.nonNull(superclassType) && superclassType instanceof ParameterizedType) { + Type[] actualTypes = ((ParameterizedType) superclassType).getActualTypeArguments(); + for (int i = 0 ; i < actualTypes.length; i++){ + Type actualType = actualTypes[i]; + if (actualType instanceof TypeVariable){ + actualTypes[i] = typeVariableReflect.getOrDefault(actualType.getTypeName(), actualType); + } + } + classTypeVariableMap.put(currentClass.getSuperclass(), actualTypes); + } + Optional.ofNullable(currentClass.getSuperclass()).ifPresent(traverseQueue::offer); + } + if (Objects.nonNull(classTypes) && classTypes.length > position){ + return (Class)classTypes[position]; + } + return null; + } +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/vo/ExchangisJobQueryVo.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/vo/ExchangisJobQueryVo.java new file mode 100644 index 000000000..d0ba5d4f9 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/vo/ExchangisJobQueryVo.java @@ -0,0 +1,19 @@ +package com.webank.wedatasphere.exchangis.job.vo; + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobPageQuery; + +public class ExchangisJobQueryVo extends ExchangisJobPageQuery { + + public ExchangisJobQueryVo(){ + + } + + public ExchangisJobQueryVo(Long projectId, String jobType, + String name, Integer current, Integer size){ + this.projectId = projectId; + this.jobType = jobType; + this.jobName = name; + this.current = current; + this.size = size; + } +} diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/vo/ExchangisJobVo.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/vo/ExchangisJobVo.java new file mode 100644 index 000000000..b616880e2 --- /dev/null +++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/vo/ExchangisJobVo.java @@ -0,0 +1,287 @@ +package com.webank.wedatasphere.exchangis.job.vo; + + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.webank.wedatasphere.exchangis.common.validator.groups.InsertGroup; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import org.hibernate.validator.constraints.NotBlank; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.*; + +/** + * + */ +//@JsonInclude(JsonInclude.Include.NON_EMPTY) +public class ExchangisJobVo { + + /** + * Job id + */ + private Long id; + + /** + * Project id + */ + @NotNull(groups = InsertGroup.class, message = "Project id cannot be null (工程ID不能为空)") + private Long projectId; + + /** + * Job type + */ + @NotBlank(message = "Job type cannot be null (任务类型不能为空)") + @Size(max = 50, message= "Length of job type should be less than 50 (任务类型长度不超过50)") + private String jobType; + + /** + * Engine type + */ + @NotBlank(message = "Engine type cannot be null (引擎类型不能为空)") + @Size(max = 50, message = "Length of engine type should be less than 50 (引擎类型长度不超过50)") + private String engineType; + + /** + * Job labels + */ + @Size(max = 200, message = "Length of labels should be less than 200 (标签长度不能超过200)") + private String jobLabels; + + /** + * Job name + */ + @Size(max = 100, message = "Length of name should be less than 100 (名称长度不超过100)") + @NotBlank(message = "Job name cannot be null (任务名不能为空)") + private String jobName; + + /** + * Job desc + */ + @Size(max = 200, message = "Length of desc should be less than 200 (描述长度不超过200)") + private String jobDesc; + + /** + * Content + */ + private String content; + + /** + * Execute user + */ + //@JsonProperty("proxyUser") + private String executeUser; + + /** + * Execute node + */ + @Deprecated + private String executeNode; + + /** + * Job params + */ + private String jobParams; + + /** + * Create time + */ + private Date createTime; + + /** + * Create user + */ + private String createUser; + + /** + * Modify time (last_update_time) + */ + private Date modifyTime; + + /** + * Modify user + */ + private String modifyUser; + + /** + * Source map + */ + private Map source = new HashMap(); + + private Map labels; + + private String proxyUser; + + public ExchangisJobVo(){ + + } + + public ExchangisJobVo(ExchangisJobInfo jobInfo){ + if (Objects.nonNull(jobInfo)) { + this.id = jobInfo.getId(); + this.engineType = jobInfo.getEngineType(); + this.jobDesc = jobInfo.getJobDesc(); + this.jobLabels = jobInfo.getJobLabel(); + this.jobName = jobInfo.getName(); + this.jobType = jobInfo.getJobType(); + this.createTime = jobInfo.getCreateTime(); + this.createUser = jobInfo.getCreateUser(); + this.modifyTime = jobInfo.getLastUpdateTime(); + this.jobParams = jobInfo.getJobParams(); + this.executeUser = jobInfo.getExecuteUser(); + this.proxyUser = jobInfo.getExecuteUser(); + } + } + + public String getProxyUser() { + return proxyUser; + } + + public void setProxyUser(String proxyUser) { + this.proxyUser = proxyUser; + } + + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + + public String getJobName() { + return jobName; + } + + public void setJobName(String jobName) { + this.jobName = jobName; + } + + public String getJobDesc() { + return jobDesc; + } + + public void setJobDesc(String jobDesc) { + this.jobDesc = jobDesc; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + public String getJobType() { + return jobType; + } + + public void setJobType(String jobType) { + this.jobType = jobType; + } + + public String getEngineType() { + return engineType; + } + + public void setEngineType(String engineType) { + this.engineType = engineType; + } + + public String getJobLabels() { + return jobLabels; + } + + public void setJobLabels(String jobLabel) { + this.jobLabels = jobLabel; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getExecuteNode() { + Object executeNode = source.get("executeNode"); + return Objects.nonNull(executeNode)? String.valueOf(executeNode) : null; + } + + + public void setExecuteNode(String executeNode) { + source.put("executeNode", executeNode); + } + + public String getSyncType() { + Object syncType = source.get("syncType"); + return Objects.nonNull(syncType)? String.valueOf(syncType) : null; + } + + public void setSyncType(String syncType) { + source.put("syncType", syncType); + } + + public String getJobParams() { + return jobParams; + } + + public void setJobParams(String jobParams) { + this.jobParams = jobParams; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getModifyUser() { + return modifyUser; + } + + public void setModifyUser(String modifyUser) { + this.modifyUser = modifyUser; + } + + public String getExecuteUser() { + return executeUser; + } + + public void setExecuteUser(String executeUser) { + this.executeUser = executeUser; + } + + public Map getSource() { + return source; + } + + public void setSource(Map source) { + this.source.putAll(source); + } + + public Map getLabels() { + return labels; + } + + public void setLabels(Map labels) { + this.labels = labels; + } +} diff --git a/exchangis-job/exchangis-job-launcher/pom.xml b/exchangis-job/exchangis-job-launcher/pom.xml new file mode 100644 index 000000000..af6b4e3ab --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/pom.xml @@ -0,0 +1,32 @@ + + + + exchangis-job + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-job-launcher + + + + com.webank.wedatasphere.exchangis + exchangis-job-common + 1.0.0-RC1 + + + com.webank.wedatasphere.exchangis + exchangis-job-builder + 1.0.0-RC1 + + + org.apache.linkis + linkis-computation-client + ${linkis.version} + + + + \ No newline at end of file diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/AccessibleLauncherTask.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/AccessibleLauncherTask.java new file mode 100644 index 000000000..45fa2785e --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/AccessibleLauncherTask.java @@ -0,0 +1,54 @@ +package com.webank.wedatasphere.exchangis.job.launcher; + +import com.webank.wedatasphere.exchangis.job.launcher.exception.ExchangisTaskLaunchException; +import com.webank.wedatasphere.exchangis.job.log.LogResult; +import com.webank.wedatasphere.exchangis.job.log.LogQuery; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskProgressInfo; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; + +import java.util.Map; + +/** + * Define the operation method of launched task + */ +public interface AccessibleLauncherTask { + + + /** + * Call the status interface + * @return task status + * @throws ExchangisTaskLaunchException + */ + TaskStatus getStatus() throws ExchangisTaskLaunchException; + + TaskStatus getLocalStatus(); + /** + * Call the metric interface + * @return map + */ + Map getMetricsInfo() throws ExchangisTaskLaunchException; + + /** + * Call the progress info interface + * @return double + */ + TaskProgressInfo getProgressInfo() throws ExchangisTaskLaunchException; + + /** + * Kill the task + */ + void kill() throws ExchangisTaskLaunchException; + + /** + * Query log + * @param query query + * @return + */ + LogResult queryLogs(LogQuery query) throws ExchangisTaskLaunchException; + + /** + * Submit + * @throws ExchangisTaskLaunchException exception + */ + void submit() throws ExchangisTaskLaunchException; +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/ExchangisLauncherConfiguration.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/ExchangisLauncherConfiguration.java new file mode 100644 index 000000000..3ba907a48 --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/ExchangisLauncherConfiguration.java @@ -0,0 +1,28 @@ +package com.webank.wedatasphere.exchangis.job.launcher; + + +import org.apache.linkis.common.conf.CommonVars; + +// TODO Unified management of the linkis configuration +public class ExchangisLauncherConfiguration { + + public static final String TASK_NOT_EXIST = "Not exists EngineConn"; + + public static final String LAUNCHER_LINKIS_RUNTIME_PARAM_NAME = "runtimeParams"; + + public static final String LAUNCHER_LINKIS_STARTUP_PARAM_NAME = "startUpParams"; + + public static final String LAUNCHER_LINKIS_REQUEST_MEMORY = "wds.linkis.engineconn.java.driver.memory"; + + public static final CommonVars LAUNCHER_LINKIS_CREATOR = CommonVars.apply("wds.exchangis.job.task.launcher.linkis.creator", "exchangis"); + + public static final CommonVars LAUNCHER_LINKIS_ENGINE_CONN_MODE = CommonVars.apply("wds.exchangis.job.task.launcher.linkis.engineConn.mode", "once"); + + public static final CommonVars LAUNCHER_LINKIS_MAX_SUBMIT = CommonVars.apply("wds.exchangis.job.task.launcher.linkis.max.submit", 30000L); + + public static final CommonVars LAUNCHER_LINKIS_MAX_ERROR = CommonVars.apply("wds.exchangis.job.task.launcher.linkis.max.error", 3); + + public static final CommonVars LINKIS_SERVER_URL = CommonVars.apply("wds.exchangis.client.linkis.server-url", "http://127.0.0.1:9001"); + + public static final CommonVars LINKIS_TOKEN_VALUE = CommonVars.apply("wds.exchangis.client.linkis.token.value", "EXCHANGIS-TOKEN"); +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/ExchangisTaskLaunchManager.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/ExchangisTaskLaunchManager.java new file mode 100644 index 000000000..c400e6ffe --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/ExchangisTaskLaunchManager.java @@ -0,0 +1,18 @@ +package com.webank.wedatasphere.exchangis.job.launcher; + + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; + +/** + * Task(Sub job) launcher + */ +public interface ExchangisTaskLaunchManager { + + void registerTaskLauncher(ExchangisTaskLauncher taskLauncher); + + void unRegisterTaskLauncher(String launcherName); + + ExchangisTaskLauncher getTaskLauncher(String launcherName); + +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/ExchangisTaskLauncher.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/ExchangisTaskLauncher.java new file mode 100644 index 000000000..7cde995c2 --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/ExchangisTaskLauncher.java @@ -0,0 +1,33 @@ +package com.webank.wedatasphere.exchangis.job.launcher; + +import com.webank.wedatasphere.exchangis.job.launcher.exception.ExchangisTaskLaunchException; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; + +import java.util.Map; + +/** + * Launcher interface + * @param + */ +public interface ExchangisTaskLauncher { + + String name(); + + default void init(ExchangisTaskLaunchManager jobLaunchManager){} + + /** + * Build launcher task (accessible) form launched task entity + * @param launchedTask launched task + * @return + */ + AccessibleLauncherTask launcherTask(U launchedTask) throws ExchangisTaskLaunchException; + /** + * Launch method + * @param launchableTask launchable task + * @return launched task + * @throws ExchangisTaskLaunchException exception in launching + */ + LaunchedExchangisTask launch(T launchableTask) throws ExchangisTaskLaunchException; + +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/builder/LinkisExchangisLauncherJobBuilder.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/builder/LinkisExchangisLauncherJobBuilder.java new file mode 100644 index 000000000..8b6fda944 --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/builder/LinkisExchangisLauncherJobBuilder.java @@ -0,0 +1,47 @@ +package com.webank.wedatasphere.exchangis.job.launcher.builder; + +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.builder.api.AbstractExchangisJobBuilder; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisEngineJob; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.utils.MemUtils; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static com.webank.wedatasphere.exchangis.job.launcher.ExchangisLauncherConfiguration.*; + +/** + * Launcher job builder + */ + +public class LinkisExchangisLauncherJobBuilder extends AbstractExchangisJobBuilder { + + private static final String LAUNCHER_NAME = "Linkis"; + + @Override + public LaunchableExchangisTask buildJob(ExchangisEngineJob inputJob, LaunchableExchangisTask expectOut, ExchangisJobBuilderContext ctx) throws ExchangisJobException { + LaunchableExchangisTask launchableTask = new LaunchableExchangisTask(); + launchableTask.setName(inputJob.getName()); + launchableTask.setJobId(inputJob.getId()); + launchableTask.setExecuteUser(inputJob.getCreateUser()); +// launcherJob.setExecuteNode(exchangisJob.getExecuteNode()); + launchableTask.setLinkisContentMap(inputJob.getJobContent()); + Map linkisParams = new HashMap<>(); + Map startUpParams = new HashMap<>(); + linkisParams.put(LAUNCHER_LINKIS_RUNTIME_PARAM_NAME, inputJob.getRuntimeParams()); + linkisParams.put(LAUNCHER_LINKIS_STARTUP_PARAM_NAME, startUpParams); + long memoryUsed = Objects.nonNull(inputJob.getMemoryUsed())? MemUtils.convertToGB(inputJob.getMemoryUsed(), + inputJob.getMemoryUnit()) : 0; + startUpParams.put(LAUNCHER_LINKIS_REQUEST_MEMORY, String.valueOf(memoryUsed <= 0 ? 1 : memoryUsed)); + launchableTask.setLinkisParamsMap(linkisParams); + launchableTask.setEngineType(inputJob.getEngineType()); + launchableTask.setLabels(inputJob.getJobLabel()); + launchableTask.setName(inputJob.getName()); + // Use launcher name placeholder + launchableTask.setLinkisJobName(LAUNCHER_NAME); + return launchableTask; + } +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/LaunchableExchangisJob.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/LaunchableExchangisJob.java new file mode 100644 index 000000000..78c918810 --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/LaunchableExchangisJob.java @@ -0,0 +1,62 @@ +package com.webank.wedatasphere.exchangis.job.launcher.domain; + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.domain.GenericExchangisJob; + +import java.util.ArrayList; +import java.util.List; + +/** + * Job could be executed + */ +public class LaunchableExchangisJob extends GenericExchangisJob { + + /** + * Job info + */ + private ExchangisJobInfo exchangisJobInfo; + + /** + * Execution id + */ + private String jobExecutionId; + + /** + * Execute user + */ + private String execUser; + + private List launchableExchangisTasks = new ArrayList<>(); + + public ExchangisJobInfo getExchangisJobInfo() { + return exchangisJobInfo; + } + + public void setExchangisJobInfo(ExchangisJobInfo exchangisJobInfo) { + this.exchangisJobInfo = exchangisJobInfo; + } + + public String getJobExecutionId() { + return jobExecutionId; + } + + public void setJobExecutionId(String jobExecutionId) { + this.jobExecutionId = jobExecutionId; + } + + public List getLaunchableExchangisTasks() { + return launchableExchangisTasks; + } + + public void setLaunchableExchangisTasks(List launchableExchangisTasks) { + this.launchableExchangisTasks = launchableExchangisTasks; + } + + public String getExecUser() { + return execUser; + } + + public void setExecUser(String execUser) { + this.execUser = execUser; + } +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/LaunchableExchangisTask.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/LaunchableExchangisTask.java new file mode 100644 index 000000000..bd5158e76 --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/LaunchableExchangisTask.java @@ -0,0 +1,233 @@ +package com.webank.wedatasphere.exchangis.job.launcher.domain; + +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import com.webank.wedatasphere.exchangis.job.constraints.LabelSerializeConstraints; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisTask; +import com.webank.wedatasphere.exchangis.job.utils.LabelConvertUtils; + +import java.util.*; + +/** + * Task could be executed + */ +public class LaunchableExchangisTask implements ExchangisTask { + + private Long id; + + private String name; + + private Date createTime; + + private Date lastUpdateTime; + + private String engineType; + + private String executeUser; + + private String linkisJobName; + + private Long jobId; + + private String jobExecutionId; + + /** + * Job content in Linkis + */ + private String linkisJobContent; + + /** + * Job params in Linkis + */ + private String linkisParams; + + /** + * Source message in Linkis + */ + private String linkisSource; + + /** + * Labels string value + */ + private String labels; + + private Map linkisContentMap; + + private Map linkisParamsMap; + + private Map linkisSourceMap; + + private Map labelsMap; + + @Override + public String getEngineType() { + return this.engineType; + } + + @Override + public void setEngineType(String engineType) { + this.engineType = engineType; + } + + @Override + public String getExecuteUser() { + return this.executeUser; + } + + @Override + public void setExecuteUser(String executeUser) { + this.executeUser = executeUser; + } + + @Override + public Long getId() { + return this.id; + } + + @Override + public void setId(Long id) { + this.id = id; + } + + @Override + public String getName() { + return this.name; + } + + @Override + public void setName(String name) { + this.name = name; + } + + @Override + public Date getCreateTime() { + return createTime; + } + + @Override + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + @Override + public Date getLastUpdateTime() { + return this.lastUpdateTime; + } + + @Override + public void setLastUpdateTime(Date lastUpdateTime) { + this.lastUpdateTime = lastUpdateTime; + } + + public Long getJobId() { + return jobId; + } + + public void setJobId(Long jobId) { + this.jobId = jobId; + } + + public String getJobExecutionId() { + return jobExecutionId; + } + + public void setJobExecutionId(String jobExecutionId) { + this.jobExecutionId = jobExecutionId; + } + + public void setLinkisContentMap(Map linkisContentMap) { + Optional.ofNullable(linkisContentMap).ifPresent(value -> this.linkisContentMap = value); + } + + public void setLinkisParamsMap(Map linkisParamsMap) { + Optional.ofNullable(linkisParamsMap).ifPresent(value -> this.linkisParamsMap = value); + } + + public void setLinkisSourceMap(Map linkisSourceMap) { + Optional.ofNullable(linkisSourceMap).ifPresent(value -> this.linkisSourceMap = value); + } + + public Map getLinkisContentMap() { + if(Objects.isNull(this.linkisContentMap) && Objects.nonNull(this.linkisJobContent)){ + this.linkisContentMap = Json.fromJson(this.linkisJobContent, Map.class); + } + return linkisContentMap; + } + + public Map getLinkisParamsMap() { + if(Objects.isNull(this.linkisParamsMap) && Objects.nonNull(this.linkisParams)){ + this.linkisParamsMap = Json.fromJson(this.linkisParams, Map.class); + } + return linkisParamsMap; + } + + public Map getLinkisSourceMap() { + if(Objects.isNull(this.linkisSourceMap) && Objects.nonNull(this.linkisSource)){ + this.linkisSourceMap = Json.fromJson(this.linkisParams, Map.class); + } + return linkisSourceMap; + } + + public Map getLabelsMap() { + if(Objects.isNull(this.labelsMap) && Objects.nonNull(this.labels)){ + this.labelsMap = LabelConvertUtils.stringToLabelMap(this.labels); + } + return labelsMap; + } + + public void setLabelsMap(Map labelsMap) { + this.labelsMap = labelsMap; + } + + public String getLinkisJobName() { + return linkisJobName; + } + + public void setLinkisJobName(String linkisJobName) { + this.linkisJobName = linkisJobName; + } + + public String getLinkisJobContent() { + if (Objects.isNull(this.linkisJobContent) && Objects.nonNull(this.linkisContentMap)){ + this.linkisJobContent = Json.toJson(this.linkisContentMap, null); + } + return linkisJobContent; + } + + public void setLinkisJobContent(String linkisJobContent) { + this.linkisJobContent = linkisJobContent; + } + + public String getLinkisParams() { + if (Objects.isNull(this.linkisParams) && Objects.nonNull(this.linkisParamsMap)){ + this.linkisParams = Json.toJson(this.linkisParamsMap, null); + } + return linkisParams; + } + + public void setLinkisParams(String linkisParams) { + this.linkisParams = linkisParams; + } + + public String getLinkisSource() { + if (Objects.isNull(this.linkisSource) && Objects.nonNull(this.linkisSourceMap)){ + this.linkisSource = Json.toJson(this.linkisSourceMap, null); + } + return linkisSource; + } + + public void setLinkisSource(String linkisSource) { + this.linkisSource = linkisSource; + } + + public String getLabels() { + if (Objects.isNull(this.linkisParams) && Objects.nonNull(this.linkisParamsMap)){ + this.linkisParams = Json.toJson(this.linkisParamsMap, null); + } + return labels; + } + + public void setLabels(String labels) { + this.labels = labels; + } + +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/LaunchedExchangisTask.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/LaunchedExchangisTask.java new file mode 100644 index 000000000..48a7c3b45 --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/LaunchedExchangisTask.java @@ -0,0 +1,33 @@ +package com.webank.wedatasphere.exchangis.job.launcher.domain; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.webank.wedatasphere.exchangis.job.launcher.AccessibleLauncherTask; +import com.webank.wedatasphere.exchangis.job.launcher.entity.LaunchedExchangisTaskEntity; + +/** + * To be hold by top level + */ +@JsonInclude(JsonInclude.Include.NON_EMPTY) +public class LaunchedExchangisTask extends LaunchedExchangisTaskEntity{ + public LaunchedExchangisTask(LaunchableExchangisTask launchableExchangisTask) { + super(launchableExchangisTask); + } + + @JsonIgnore + private AccessibleLauncherTask launcherTask; + + public LaunchedExchangisTask(){ + + } + + public AccessibleLauncherTask getLauncherTask() { + return launcherTask; + } + + public void setLauncherTask(AccessibleLauncherTask launcherTask) { + this.launcherTask = launcherTask; + } + + +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/LaunchedJobHistory.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/LaunchedJobHistory.java new file mode 100644 index 000000000..f42a21485 --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/LaunchedJobHistory.java @@ -0,0 +1,114 @@ +package com.webank.wedatasphere.exchangis.job.launcher.domain; + +import java.util.Date; + +/** + * + * @Date 2022/1/25 14:36 + */ +public class LaunchedJobHistory { + + private String jobExecutionId; + + private String executeNode; + + private String name; + + private Date createTime; + + private Long flow; + + private String executeUser; + + private String status; + + private double progress; + + private Date lastUpdateTime; + + public LaunchedJobHistory(String jobExecutionId, String executeNode, String name, Date createTime, Long flow, String executeUser, String status, double progress, Date lastUpdateTime){ + this.jobExecutionId = jobExecutionId; + this.executeNode = executeNode; + this.name = name; + this.status = status; + this.createTime = createTime; + this.flow = flow; + this.lastUpdateTime = lastUpdateTime; + this.progress = progress; + this.lastUpdateTime = lastUpdateTime; + this.executeUser = executeUser; + } + + public String getJobExecutionId() { + return jobExecutionId; + } + + public void setJobExecutionId(String jobExecutionId) { + this.jobExecutionId = jobExecutionId; + } + + public String getExecuteNode() { + return executeNode; + } + + public void setExecuteNode(String executeNode) { + this.executeNode = executeNode; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Long getFlow() { + return flow; + } + + public void setFlow(Long flow) { + this.flow = flow; + } + + public String getExecuteUser() { + return executeUser; + } + + public void setExecuteUser(String executeUser) { + this.executeUser = executeUser; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public double getProgress() { + return progress; + } + + public void setProgress(double progress) { + this.progress = progress; + } + + public Date getLastUpdateTime() { + return lastUpdateTime; + } + + public void setLastUpdateTime(Date lastUpdateTime) { + this.lastUpdateTime = lastUpdateTime; + } + +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/task/TaskProgressInfo.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/task/TaskProgressInfo.java new file mode 100644 index 000000000..e474d4c4d --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/task/TaskProgressInfo.java @@ -0,0 +1,92 @@ +package com.webank.wedatasphere.exchangis.job.launcher.domain.task; + +public class TaskProgressInfo { + /** + * Total sub tasks + */ + private int total; + + /** + * Running sub tasks + */ + private int running; + + /** + * Failed sub tasks + */ + private int failed; + + /** + * Succeed sub tasks + */ + private int succeed; + + /** + * Progress value + */ + private float progress; + + /** + * Whole status + */ + private TaskStatus status = TaskStatus.Undefined; + + public TaskProgressInfo(int total, int running, int failed, int succeed, float progress){ + this.total = total; + this.running = running; + this.failed = failed; + this.succeed = succeed; + this.progress = progress; + } + public TaskProgressInfo(){ + + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public int getRunning() { + return running; + } + + public void setRunning(int running) { + this.running = running; + } + + public int getFailed() { + return failed; + } + + public void setFailed(int failed) { + this.failed = failed; + } + + public int getSucceed() { + return succeed; + } + + public void setSucceed(int succeed) { + this.succeed = succeed; + } + + public TaskStatus getStatus() { + return status; + } + + public void setStatus(TaskStatus status) { + this.status = status; + } + + public float getProgress() { + return progress; + } + + public void setProgress(float progress) { + this.progress = progress; + } +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/task/TaskStatus.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/task/TaskStatus.java new file mode 100644 index 000000000..1862929e4 --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/domain/task/TaskStatus.java @@ -0,0 +1,17 @@ +package com.webank.wedatasphere.exchangis.job.launcher.domain.task; + +/** + * Status of task + */ +public enum TaskStatus { + Inited, Scheduled, Running, WaitForRetry, Cancelled, Failed, Success, Undefined, Timeout; + + /** + * Is completed status + * @param status status + * @return boolean + */ + public static boolean isCompleted(TaskStatus status){ + return null == status || status.equals(Cancelled) || status.equals(Failed) || status.equals(Success); + } +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/entity/ExchangisLaunchTask.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/entity/ExchangisLaunchTask.java new file mode 100644 index 000000000..9ec1c79e0 --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/entity/ExchangisLaunchTask.java @@ -0,0 +1,166 @@ +package com.webank.wedatasphere.exchangis.job.launcher.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +/** + *

+ * 执行任务表. + *

+ * + * @author yuxin.yuan + * @since 2021-08-10 + */ +@TableName("exchangis_launch_task") +public class ExchangisLaunchTask { + + @TableId(type = IdType.AUTO) + private Long id; + + private String taskName; + + private Long jobId; + + private String jobName; + + private String content; + + private String executeNode; + + private Date createTime; + + private String createUser; + + private Date launchTime; + + private String proxyUser; + + private String paramsJson; + + private String launchId; + + private String status; + + private Date completeTime; + + private String engineType; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getTaskName() { + return taskName; + } + + public void setTaskName(String taskName) { + this.taskName = taskName; + } + + public Long getJobId() { + return jobId; + } + + public void setJobId(Long jobId) { + this.jobId = jobId; + } + + public String getJobName() { + return jobName; + } + + public void setJobName(String jobName) { + this.jobName = jobName; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getExecuteNode() { + return executeNode; + } + + public void setExecuteNode(String executeNode) { + this.executeNode = executeNode; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public Date getLaunchTime() { + return launchTime; + } + + public void setLaunchTime(Date launchTime) { + this.launchTime = launchTime; + } + + public String getProxyUser() { + return proxyUser; + } + + public void setProxyUser(String proxyUser) { + this.proxyUser = proxyUser; + } + + public String getParamsJson() { + return paramsJson; + } + + public void setParamsJson(String paramsJson) { + this.paramsJson = paramsJson; + } + + public String getLaunchId() { return launchId; } + + public void setLaunchId(String launchId) { this.launchId = launchId; } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Date getCompleteTime() { + return completeTime; + } + + public void setCompleteTime(Date completeTime) { + this.completeTime = completeTime; + } + + public String getEngineType() { + return engineType; + } + + public void setEngineType(String engineType) { + this.engineType = engineType; + } +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/entity/ExchangisTaskEntity.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/entity/ExchangisTaskEntity.java new file mode 100644 index 000000000..b4ca5996b --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/entity/ExchangisTaskEntity.java @@ -0,0 +1,68 @@ +package com.webank.wedatasphere.exchangis.job.launcher.entity; + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; + +/** + * Task entity (could be persisted) + */ +public interface ExchangisTaskEntity extends ExchangisTask { + + /** + * Job id + * @return long value + */ + Long getJobId(); + + void setJobId(Long jobId); + + /** + * Job name + * @return string value + */ + String jobName(); + + void setJobName(String jobName); + + + /** + * Task status + * @return status enum + */ + TaskStatus getStatus(); + + + void setStatus(TaskStatus status); + + /** + * Progress + * @return 0.0 to 1.0, default 0.0 + */ + double getProgress(); + + void setProgress(double progress); + + /** + * Error code + * @return default null + */ + Integer getErrorCode(); + + void setErrorCode(Integer code); + + /** + * Error message + * @return default null + */ + String getErrorMessage(); + + void setErrorMessage(String errorMessage); + + /** + * Retry number + * @return default 0 + */ + Integer getRetryNum(); + + void setRetryNum(Integer retryNum); +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/entity/GenericExchangisTaskEntity.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/entity/GenericExchangisTaskEntity.java new file mode 100644 index 000000000..8b804a34c --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/entity/GenericExchangisTaskEntity.java @@ -0,0 +1,177 @@ +package com.webank.wedatasphere.exchangis.job.launcher.entity; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; + +import java.util.Date; + +/** + * Inheritable task entity + */ +public class GenericExchangisTaskEntity implements ExchangisTaskEntity{ + + protected Long id; + + protected String name; + + protected Date createTime; + + protected Date lastUpdateTime; + + protected String engineType; + + protected String executeUser; + + protected Long jobId; + + protected String jobName; + + protected TaskStatus status = TaskStatus.Inited; + + protected double progress = 0.0; + + protected Integer errorCode; + + protected String errorMessage; + + protected Integer retryNum = 0; + + protected String createUser; + + @Override + public Long getJobId() { + return this.jobId; + } + + @Override + public void setJobId(Long jobId) { + this.jobId = jobId; + } + + @Override + public String jobName() { + return this.jobName; + } + + @Override + public void setJobName(String jobName) { + this.jobName = jobName; + } + + @Override + public TaskStatus getStatus() { + return this.status; + } + + @Override + public void setStatus(TaskStatus status) { + this.status = status; + } + + @Override + public double getProgress() { + return this.progress; + } + + @Override + public void setProgress(double progress) { + this.progress = progress; + } + + @Override + public Integer getErrorCode() { + return this.errorCode; + } + + @Override + public void setErrorCode(Integer code) { + this.errorCode = code; + } + + @Override + public String getErrorMessage() { + return this.errorMessage; + } + + @Override + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + @Override + public Integer getRetryNum() { + return this.retryNum; + } + + @Override + public void setRetryNum(Integer retryNum) { + this.retryNum = retryNum; + } + + @Override + public String getEngineType() { + return engineType; + } + + @Override + public void setEngineType(String engineType) { + this.engineType = engineType; + } + + @Override + public String getExecuteUser() { + return this.executeUser; + } + + @Override + public void setExecuteUser(String executeUser) { + this.executeUser = executeUser; + } + + @Override + public Long getId() { + return this.id; + } + + @Override + public void setId(Long id) { + this.id = id; + } + + @Override + public String getName() { + return this.name; + } + + @Override + public void setName(String name) { + this.name = name; + } + + @Override + public Date getCreateTime() { + return this.createTime; + } + + @Override + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + @Override + public Date getLastUpdateTime() { + return this.lastUpdateTime; + } + + @Override + public void setLastUpdateTime(Date lastUpdateTime) { + this.lastUpdateTime = lastUpdateTime; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/entity/LaunchedExchangisJobEntity.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/entity/LaunchedExchangisJobEntity.java new file mode 100644 index 000000000..59b991cd5 --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/entity/LaunchedExchangisJobEntity.java @@ -0,0 +1,89 @@ +package com.webank.wedatasphere.exchangis.job.launcher.entity; + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobEntity; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisJob; +import org.apache.commons.io.IOUtils; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +/** + * Entity to persist the launched job + */ +public class LaunchedExchangisJobEntity extends GenericExchangisTaskEntity{ + + /** + * Execution id + */ + private String jobExecutionId; + + /** + * ExchangisJobEntity + */ + + private ExchangisJobEntity exchangisJobEntity; + + /** + * Log path, could be a uri + */ + private String logPath; + + /** + * Number of launchable task + */ + private int launchableTaskNum = 0; + + public ExchangisJobEntity getExchangisJobEntity() { + return exchangisJobEntity; + } + + public void setExchangisJobEntity(ExchangisJobEntity exchangisJobEntity) { + this.exchangisJobEntity = exchangisJobEntity; + } + + + public LaunchedExchangisJobEntity(){ + + } + public LaunchedExchangisJobEntity(LaunchableExchangisJob job){ + this.name = job.getName(); + this.engineType = job.getEngineType(); + this.jobId = job.getId(); + this.jobName = job.getName(); + this.executeUser = job.getExecUser(); + this.createUser = job.getCreateUser(); + this.createTime = job.getCreateTime(); + this.lastUpdateTime = job.getLastUpdateTime(); + this.jobExecutionId = job.getJobExecutionId(); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); + this.logPath = this.executeUser + IOUtils.DIR_SEPARATOR_UNIX + + simpleDateFormat.format(new Date()) + IOUtils.DIR_SEPARATOR_UNIX + this.jobExecutionId; + } + public String getJobExecutionId() { + return jobExecutionId; + } + + public void setJobExecutionId(String jobExecutionId) { + this.jobExecutionId = jobExecutionId; + } + + public String getLogPath() { + return logPath; + } + + public void setLogPath(String logPath) { + this.logPath = logPath; + } + + public int getLaunchableTaskNum() { + return launchableTaskNum; + } + + public void setLaunchableTaskNum(int launchableTaskNum) { + this.launchableTaskNum = launchableTaskNum; + } + + +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/entity/LaunchedExchangisTaskEntity.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/entity/LaunchedExchangisTaskEntity.java new file mode 100644 index 000000000..f894c0fda --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/entity/LaunchedExchangisTaskEntity.java @@ -0,0 +1,157 @@ +package com.webank.wedatasphere.exchangis.job.launcher.entity; + + +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; + +import java.util.Calendar; +import java.util.Date; +import java.util.Map; +import java.util.Objects; + +/** + * Entity to persist the launched task + */ +public class LaunchedExchangisTaskEntity extends GenericExchangisTaskEntity { + + /** + * Default, the task id has the same value with id + */ + private String taskId; + + private String linkisJobId; + + private String linkisJobInfo; + + /** + * Execution id + */ + private String jobExecutionId; + + private Date launchTime; + + private Date runningTime; + + private String metrics; + + private LaunchableExchangisTask launchableExchangisTask; + + private Map linkisJobInfoMap; + + private Map metricsMap; + + public LaunchedExchangisTaskEntity(){ + + } + + public LaunchedExchangisTaskEntity(LaunchableExchangisTask launchableExchangisTask){ + Calendar calendar = Calendar.getInstance(); + this.launchableExchangisTask = launchableExchangisTask; + this.id = launchableExchangisTask.getId(); + this.name = launchableExchangisTask.getName(); + this.createTime = calendar.getTime(); + this.lastUpdateTime = calendar.getTime(); + this.engineType = launchableExchangisTask.getEngineType(); + this.executeUser = launchableExchangisTask.getExecuteUser(); + this.jobId = launchableExchangisTask.getJobId(); + // jobName + this.jobExecutionId = launchableExchangisTask.getJobExecutionId(); + this.status = TaskStatus.Scheduled; + this.lastUpdateTime = Calendar.getInstance().getTime(); + } + public String getTaskId(){ + if (Objects.isNull(taskId) && Objects.nonNull(getId())){ + this.taskId = String.valueOf(getId()); + } + return this.taskId; + } + + public void setTaskId(String taskId){ + this.taskId = taskId; + } + + public String getLinkisJobId() { + return linkisJobId; + } + + public void setLinkisJobId(String linkisJobId) { + this.linkisJobId = linkisJobId; + } + + public String getLinkisJobInfo() { + if (Objects.isNull(this.linkisJobInfo) && Objects.nonNull(this.linkisJobInfoMap)){ + this.linkisJobInfo = Json.toJson(this.linkisJobInfoMap, null); + } + return linkisJobInfo; + } + + public void setLinkisJobInfo(String linkisJobInfo) { + this.linkisJobInfo = linkisJobInfo; + } + + public String getJobExecutionId() { + return jobExecutionId; + } + + public void setJobExecutionId(String jobExecutionId) { + this.jobExecutionId = jobExecutionId; + } + + public Date getLaunchTime() { + return launchTime; + } + + public void setLaunchTime(Date launchTime) { + this.launchTime = launchTime; + } + + public Date getRunningTime() { + return runningTime; + } + + public void setRunningTime(Date runningTime) { + this.runningTime = runningTime; + } + + public String getMetrics() { + if (Objects.isNull(this.metrics) && Objects.nonNull(this.metricsMap)){ + this.metrics = Json.toJson(this.metricsMap, null); + } + return metrics; + } + + public void setMetrics(String metrics) { + this.metrics = metrics; + } + + public Map getLinkisJobInfoMap() { + if (Objects.isNull(this.linkisJobInfoMap) && Objects.nonNull(this.linkisJobInfo)){ + this.linkisJobInfoMap = Json.fromJson(this.linkisJobInfo, Map.class); + } + return linkisJobInfoMap; + } + + public void setLinkisJobInfoMap(Map linkisJobInfoMap) { + this.linkisJobInfoMap = linkisJobInfoMap; + } + + public Map getMetricsMap() { + if (Objects.isNull(this.metricsMap) && Objects.nonNull(this.metrics)){ + this.metricsMap = Json.fromJson(this.metrics, Map.class); + } + return metricsMap; + } + + public void setMetricsMap(Map metricsMap) { + this.metricsMap = metricsMap; + } + + public LaunchableExchangisTask getLaunchableExchangisTask() { + return launchableExchangisTask; + } + + public void setLaunchableExchangisTask(LaunchableExchangisTask launchableExchangisTask) { + this.launchableExchangisTask = launchableExchangisTask; + } +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/exception/ExchangisTaskLaunchException.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/exception/ExchangisTaskLaunchException.java new file mode 100644 index 000000000..206cd8fff --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/exception/ExchangisTaskLaunchException.java @@ -0,0 +1,15 @@ +package com.webank.wedatasphere.exchangis.job.launcher.exception; + +import org.apache.linkis.common.exception.ErrorException; + +import static com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode.TASK_LAUNCH_ERROR; + +/** + * Launch exception + */ +public class ExchangisTaskLaunchException extends ErrorException { + public ExchangisTaskLaunchException(String desc, Throwable t) { + super(TASK_LAUNCH_ERROR.getCode(), desc); + super.initCause(t); + } +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/exception/ExchangisTaskNotExistException.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/exception/ExchangisTaskNotExistException.java new file mode 100644 index 000000000..44ce9870e --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/exception/ExchangisTaskNotExistException.java @@ -0,0 +1,13 @@ +package com.webank.wedatasphere.exchangis.job.launcher.exception; + +import static com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode.TASK_LAUNCH_NOT_EXIST; + +/** + * Task not exist + */ +public class ExchangisTaskNotExistException extends ExchangisTaskLaunchException{ + public ExchangisTaskNotExistException(String desc, Throwable t) { + super(desc, t); + this.setErrCode(TASK_LAUNCH_NOT_EXIST.getCode()); + } +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/linkis/LinkisExchangisTaskLauncher.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/linkis/LinkisExchangisTaskLauncher.java new file mode 100644 index 000000000..d719b8c67 --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/linkis/LinkisExchangisTaskLauncher.java @@ -0,0 +1,83 @@ +package com.webank.wedatasphere.exchangis.job.launcher.linkis; + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisTask; +import com.webank.wedatasphere.exchangis.job.enums.EngineTypeEnum; +import com.webank.wedatasphere.exchangis.job.launcher.AccessibleLauncherTask; +import com.webank.wedatasphere.exchangis.job.launcher.exception.ExchangisTaskLaunchException; +import com.webank.wedatasphere.exchangis.job.launcher.ExchangisLauncherConfiguration; +import com.webank.wedatasphere.exchangis.job.launcher.ExchangisTaskLaunchManager; +import com.webank.wedatasphere.exchangis.job.launcher.ExchangisTaskLauncher; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.computation.client.LinkisJobBuilder; +import org.apache.linkis.computation.client.LinkisJobClient; + +import java.util.*; + +/** + * Linkis task launcher + */ +public class LinkisExchangisTaskLauncher implements ExchangisTaskLauncher { + + private final String[] STORE_INFO = new String[]{"ecmServiceInstance"}; + /** + * Engine versions + */ + private Map engineVersions = new HashMap<>(); + + @Override + public String name() { + return "Linkis"; + } + + @Override + public void init(ExchangisTaskLaunchManager jobLaunchManager) { + this.engineVersions.put(EngineTypeEnum.SQOOP.name().toLowerCase(), "1.4.6"); + this.engineVersions.put(EngineTypeEnum.DATAX.name().toLowerCase(), "3.0.0"); + LinkisJobClient.config().setDefaultAuthToken(ExchangisLauncherConfiguration.LINKIS_TOKEN_VALUE.getValue()); + LinkisJobClient.config().setDefaultServerUrl(ExchangisLauncherConfiguration.LINKIS_SERVER_URL.getValue()); + } + + @Override + public AccessibleLauncherTask launcherTask(LaunchedExchangisTask launchedTask) throws ExchangisTaskLaunchException { + String linkisJobId = launchedTask.getLinkisJobId(); + String execUser = launchedTask.getExecuteUser(); + Map jobInfoMap = launchedTask.getLinkisJobInfoMap(); + try { + return LinkisLauncherTask.init(linkisJobId, execUser, jobInfoMap, launchedTask.getEngineType()); + }catch (Exception e){ + throw new ExchangisTaskLaunchException("Unable to build accessible launcher task from launched task: [" + launchedTask.getTaskId() + "]", e); + } + } + + @Override + public LaunchedExchangisTask launch(LaunchableExchangisTask launchableTask) throws ExchangisTaskLaunchException { + String engineType = launchableTask.getEngineType(); + if (StringUtils.isBlank(engineType)) { + throw new ExchangisTaskLaunchException("Unsupported job execution engine: '" + launchableTask.getEngineType() + "'.", null); + } + LaunchedExchangisTask launchedExchangisTask = new LaunchedExchangisTask(launchableTask); + LinkisLauncherTask launcherTask = LinkisLauncherTask.init(launchableTask, this.engineVersions); + launcherTask.submit(); + launchedExchangisTask.setLinkisJobId(launcherTask.getJobId()); + launchedExchangisTask.setLinkisJobInfoMap(convertJobInfoToStore(launcherTask.getJobInfo(false))); + launchedExchangisTask.setLauncherTask(launcherTask); + return launchedExchangisTask; + } + + /** + * Convert to store job information + * @param jobInfo job info + * @return + */ + private Map convertJobInfoToStore(Map jobInfo){ + Map storeInfo = new HashMap<>(); + Optional.ofNullable(jobInfo).ifPresent( info -> { + for (String infoKey : STORE_INFO){ + Optional.ofNullable(info.get(infoKey)).ifPresent(infoItem -> storeInfo.put(infoKey,infoItem)); + } + }); + return storeInfo; + } +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/linkis/LinkisLauncherTask.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/linkis/LinkisLauncherTask.java new file mode 100644 index 000000000..19c0e3a5f --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/linkis/LinkisLauncherTask.java @@ -0,0 +1,327 @@ +package com.webank.wedatasphere.exchangis.job.launcher.linkis; + +import com.webank.wedatasphere.exchangis.job.launcher.exception.ExchangisTaskLaunchException; +import com.webank.wedatasphere.exchangis.job.launcher.exception.ExchangisTaskNotExistException; +import com.webank.wedatasphere.exchangis.job.launcher.AccessibleLauncherTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.log.LogResult; +import com.webank.wedatasphere.exchangis.job.log.LogQuery; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskProgressInfo; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.common.utils.Utils; +import org.apache.linkis.computation.client.LinkisJobBuilder; +import org.apache.linkis.computation.client.LinkisJobClient; +import org.apache.linkis.computation.client.once.SubmittableOnceJob; +import org.apache.linkis.computation.client.once.simple.SimpleOnceJob; +import org.apache.linkis.computation.client.once.simple.SubmittableSimpleOnceJob; +import org.apache.linkis.computation.client.operator.impl.*; +import org.apache.linkis.computation.client.utils.LabelKeyUtils; +import org.apache.linkis.protocol.engine.JobProgressInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; + +import static com.webank.wedatasphere.exchangis.job.launcher.ExchangisLauncherConfiguration.*; + +/** + * Linkis launcher task + */ +public class LinkisLauncherTask implements AccessibleLauncherTask { + + private static final Logger LOG = LoggerFactory.getLogger(LinkisLauncherTask.class); + + /** + * Engine versions + */ + private Map engineVersions = new HashMap<>(); + + /** + * Linkis Job information + */ + private Map jobInfo = new HashMap<>(); + + /** + * Linkis job id + */ + private String jobId; + + /** + * Engine Conn type + */ + private String engineConn; + /** + * Refer to linkis job status + */ + private TaskStatus status = TaskStatus.Undefined; + + /** + * Progress + */ + private TaskProgressInfo progressInfo; + /** + * Hold the once job instance + */ + private SimpleOnceJob onceJob; + + /** + * Progress operator + */ + private EngineConnProgressOperator progressOperator; + + /** + * Metrics operator + */ + private EngineConnMetricsOperator metricsOperator; + + /** + * Request error count + */ + private AtomicInteger reqError = new AtomicInteger(0); + + static{ + + } + public static LinkisLauncherTask init(LaunchableExchangisTask task, Map engineVersions){ + return new LinkisLauncherTask(task, engineVersions); + } + + public static LinkisLauncherTask init(String jobId, String user, Map jobInfo, String engineConn){ + return new LinkisLauncherTask(jobId, user, jobInfo, engineConn); + } + + private LinkisLauncherTask(LaunchableExchangisTask task, Map engineVersions){ + this.engineVersions = engineVersions; + this.onceJob = toSubmittableJob(task); + } + + private LinkisLauncherTask(String jobId, String user, Map jobInfo, String engineConn){ + // Build existing job + this.onceJob = LinkisJobClient.once().simple().build(jobId, user); + this.jobId = jobId; + this.jobInfo = jobInfo; + if (StringUtils.isNotBlank(engineConn)){ + // To lower case + engineConn = engineConn.toLowerCase(); + } + this.engineConn = engineConn; + prepareOperators(this.onceJob); + } + + @Override + public TaskStatus getStatus() throws ExchangisTaskLaunchException { + if (Objects.nonNull(this.onceJob)) { + if (TaskStatus.isCompleted(this.status)){ + return status; + } + try { + // Fetch the latest info + getJobInfo(true); + String linkisJobStatus = this.onceJob.getStatus(this.jobInfo); + if ("success".equalsIgnoreCase(linkisJobStatus)) { + this.status = TaskStatus.Success; + } else if ("failed".equalsIgnoreCase(linkisJobStatus)) { + this.status = TaskStatus.Failed; + } else { + this.status = TaskStatus.Running; + } + } catch (Exception e){ + try { + dealException(e); + } catch (ExchangisTaskNotExistException ne){ + this.status = TaskStatus.Failed; + } + } + } + return this.status; + } + + @Override + public TaskStatus getLocalStatus() { + return this.status; + } + + @Override + public Map getMetricsInfo() throws ExchangisTaskLaunchException { + if (Objects.nonNull(this.metricsOperator)){ + try{ + // Invoke getStatus() to get real time status + if(!TaskStatus.isCompleted(getStatus())){ + return (Map)this.metricsOperator.apply(); + } + }catch(Exception e){ + dealException(e); + } + } + return null; + } + + @Override + public TaskProgressInfo getProgressInfo() throws ExchangisTaskLaunchException { + if (Objects.nonNull(this.progressOperator)){ + try { + // invoke getStatus() to get real time status + TaskStatus taskStatus = getStatus(); + if (!TaskStatus.isCompleted(taskStatus)){ + EngineConnProgressInfo progressInfo = (EngineConnProgressInfo)this.progressOperator.apply(); + JobProgressInfo[] progressInfoArray = progressInfo.progressInfo(); + TaskProgressInfo taskProgressInfo = new TaskProgressInfo(); + if (progressInfoArray.length > 1){ + taskProgressInfo.setTotal(progressInfoArray[0].totalTasks()); + taskProgressInfo.setFailed(progressInfoArray[0].failedTasks()); + taskProgressInfo.setRunning(progressInfoArray[0].runningTasks()); + taskProgressInfo.setSucceed(progressInfoArray[0].succeedTasks()); + } + taskProgressInfo.setProgress(progressInfo.progress()); + this.progressInfo = taskProgressInfo; + } else if (taskStatus == TaskStatus.Success){ + if (Objects.isNull(this.progressInfo)){ + this.progressInfo = new TaskProgressInfo(); + } + this.progressInfo.setProgress(1.0f); + } + } catch(Exception e){ + dealException(e); + } + } + return this.progressInfo; + } + + @Override + public void kill() throws ExchangisTaskLaunchException { + if (Objects.nonNull(this.onceJob)){ + try{ + this.onceJob.kill(); + this.status = TaskStatus.Cancelled; + }catch(Exception e){ + dealException(e); + } + } + } + + @Override + public LogResult queryLogs(LogQuery query) throws ExchangisTaskLaunchException { + // The logOperator is not thread safe, so create it each time + if (Objects.nonNull(this.onceJob)){ + try{ + EngineConnLogOperator logOperator = (EngineConnLogOperator) this.onceJob.getOperator(EngineConnLogOperator.OPERATOR_NAME()); + logOperator.setFromLine(query.getFromLine()); + logOperator.setPageSize(query.getPageSize()); + logOperator.setEngineConnType(this.engineConn); + logOperator.setECMServiceInstance(this.onceJob.getECMServiceInstance(this.jobInfo)); + logOperator.setIgnoreKeywords(query.getIgnoreKeywords()); + logOperator.setOnlyKeywords(query.getOnlyKeywords()); + if (Objects.nonNull(query.getLastRows())){ + logOperator.setLastRows(query.getLastRows()); + } + EngineConnLogs logs = (EngineConnLogs)logOperator.apply(); + boolean isEnd = logs.logs().size() <= 0; + if (isEnd){ + isEnd = TaskStatus.isCompleted(getStatus()); + } + return new LogResult(logs.endLine(), isEnd, logs.logs()); + } catch (Exception e){ + dealException(e); + } + } + + return null; + } + + @Override + public synchronized void submit() throws ExchangisTaskLaunchException { + if (Objects.isNull(this.onceJob) || !(this.onceJob instanceof SubmittableOnceJob)){ + throw new ExchangisTaskLaunchException("Unsupported 'submit' method", null); + } + try { + ((SubmittableOnceJob) this.onceJob).submit(); + // New the operators for job + prepareOperators(this.onceJob); + Map jobInfo = getJobInfo(false); + jobInfo.put("ecmServiceInstance", ((SubmittableSimpleOnceJob)this.onceJob).getECMServiceInstance()); + } catch (Exception e){ + dealException(e); + } + } + + /** + * Convert launchable task to once job + * @param task task + * @return once job + */ + @SuppressWarnings("unchecked") + private SimpleOnceJob toSubmittableJob(LaunchableExchangisTask task){ + //TODO deal the start up params + LinkisJobBuilder jobBuilder = LinkisJobClient.once().simple().builder().setCreateService(LAUNCHER_LINKIS_CREATOR.getValue()) + .setMaxSubmitTime(LAUNCHER_LINKIS_MAX_SUBMIT.getValue()) + .addLabel(LabelKeyUtils.ENGINE_TYPE_LABEL_KEY(), task.getEngineType().toLowerCase() + "-" + + engineVersions.getOrDefault(task.getEngineType().toLowerCase(), "0.0.0")) + .addLabel(LabelKeyUtils.USER_CREATOR_LABEL_KEY(), task.getExecuteUser() + "-" + LAUNCHER_LINKIS_CREATOR.getValue()) + .addLabel(LabelKeyUtils.ENGINE_CONN_MODE_LABEL_KEY(), LAUNCHER_LINKIS_ENGINE_CONN_MODE.getValue()) + .addExecuteUser(task.getExecuteUser()); + Optional.ofNullable(task.getLinkisContentMap()).ifPresent(params -> params.forEach(jobBuilder::addJobContent)); + Optional.ofNullable(task.getLinkisParamsMap()).ifPresent(params -> { + Object runtimeParams = params.get(LAUNCHER_LINKIS_RUNTIME_PARAM_NAME); + if (Objects.nonNull(runtimeParams) && runtimeParams instanceof Map){ + jobBuilder.setRuntimeParams((Map) runtimeParams); + } + Object startupParams = params.get(LAUNCHER_LINKIS_STARTUP_PARAM_NAME); + if (Objects.nonNull(startupParams) && startupParams instanceof Map){ + jobBuilder.setStartupParams((Map) startupParams); + } + }); + return jobBuilder.build(); + } + + private void prepareOperators(SimpleOnceJob onceJob){ + this.progressOperator = (EngineConnProgressOperator) onceJob.getOperator(EngineConnProgressOperator.OPERATOR_NAME()); + this.metricsOperator = (EngineConnMetricsOperator) onceJob.getOperator(EngineConnMetricsOperator.OPERATOR_NAME()); + } + /** + * Deal exception + * @param e exception entity + * @throws ExchangisTaskLaunchException + */ + private void dealException(Exception e) throws ExchangisTaskLaunchException { + String message = e.getMessage(); + if (reqError.incrementAndGet() > LAUNCHER_LINKIS_MAX_ERROR.getValue()){ + this.status = TaskStatus.Failed; + LOG.info("Error to connect to the linkis server over {} times, linkis_id: {}, now to mark the task status: {}", LAUNCHER_LINKIS_CREATOR.getValue(), this.jobId, this.status, e); + return; + } + if (StringUtils.isNotBlank(message) && message.contains(TASK_NOT_EXIST)){ + throw new ExchangisTaskNotExistException("It seems that the linkis job: [ linkis_id: " + getJobId() + "] cannot be found in linkis server", e); + } else{ + throw new ExchangisTaskLaunchException("Unexpected exception in communicating with linkis server", e); + } + } + /** + * Get the linkis's job information + * @return info map + */ + public Map getJobInfo(boolean refresh){ + if (Objects.nonNull(onceJob)){ + if (Objects.isNull(this.jobInfo) || refresh){ + this.jobInfo = this.onceJob.getNodeInfo(); + } + } + return this.jobInfo; + } + + /** + * Get the linkis's job id + * @return id + */ + public String getJobId(){ + if (Objects.nonNull(onceJob)){ + this.jobId = onceJob.getId(); + } + return this.jobId; + } + + public void setStatus(TaskStatus status) { + this.status = status; + } +} diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/manager/LinkisExchangisTaskLaunchManager.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/manager/LinkisExchangisTaskLaunchManager.java new file mode 100644 index 000000000..734cbf740 --- /dev/null +++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/manager/LinkisExchangisTaskLaunchManager.java @@ -0,0 +1,42 @@ +package com.webank.wedatasphere.exchangis.job.launcher.manager; + +import com.webank.wedatasphere.exchangis.job.launcher.ExchangisTaskLaunchManager; +import com.webank.wedatasphere.exchangis.job.launcher.ExchangisTaskLauncher; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.linkis.LinkisExchangisTaskLauncher; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import java.util.Locale; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +@Component +public class LinkisExchangisTaskLaunchManager implements ExchangisTaskLaunchManager { + + private final Map> launchers = new ConcurrentHashMap<>(); + + @PostConstruct + public void init() { + LinkisExchangisTaskLauncher linkisExchangisJobLauncher = new LinkisExchangisTaskLauncher(); + linkisExchangisJobLauncher.init(this); + this.registerTaskLauncher(linkisExchangisJobLauncher); + } + + + @Override + public void registerTaskLauncher(ExchangisTaskLauncher taskLauncher) { + this.launchers.put(taskLauncher.name().toUpperCase(Locale.ROOT), taskLauncher); + } + + @Override + public void unRegisterTaskLauncher(String launcherName) { + this.launchers.remove(launcherName.toUpperCase(Locale.ROOT)); + } + + @Override + public ExchangisTaskLauncher getTaskLauncher(String launcherName) { + return this.launchers.get(launcherName.toUpperCase(Locale.ROOT)); + } +} diff --git a/exchangis-job/exchangis-job-metrics/pom.xml b/exchangis-job/exchangis-job-metrics/pom.xml new file mode 100644 index 000000000..22f8018dc --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/pom.xml @@ -0,0 +1,59 @@ + + + + exchangis-job + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-job-metrics + + + 8 + 8 + + + + + org.apache.linkis + linkis-module + ${linkis.version} + + + + org.apache.linkis + linkis-mybatis + ${linkis.version} + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + net.alchim31.maven + scala-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + + src/main/java + + **/*.xml + + + + + + \ No newline at end of file diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/CacheGuageMetric.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/CacheGuageMetric.java new file mode 100644 index 000000000..d9f6f5562 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/CacheGuageMetric.java @@ -0,0 +1,4 @@ +package com.webank.wedatasphere.exchangis.metrics; + +public interface CacheGuageMetric extends Metric { +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/GraphMetric.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/GraphMetric.java new file mode 100644 index 000000000..749e798b2 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/GraphMetric.java @@ -0,0 +1,4 @@ +package com.webank.wedatasphere.exchangis.metrics; + +public interface GraphMetric extends Metric { +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/GuageMetric.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/GuageMetric.java new file mode 100644 index 000000000..02b38d9d9 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/GuageMetric.java @@ -0,0 +1,7 @@ +package com.webank.wedatasphere.exchangis.metrics; + +public interface GuageMetric extends Metric { + + void setValue(T value); + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/Metric.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/Metric.java new file mode 100644 index 000000000..377edc92e --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/Metric.java @@ -0,0 +1,21 @@ +package com.webank.wedatasphere.exchangis.metrics; + +import com.webank.wedatasphere.exchangis.metrics.api.MetricName; + +import java.util.Date; + +public interface Metric { + +// String getMetricTitle(); +// +// String getMetricNorm(); +// +// T getMetricValue(); +// +// Date getMetricTime(); + + long lastUpdateTime(); + + MetricName getMetricName(); + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/MetricBuilder.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/MetricBuilder.java new file mode 100644 index 000000000..f8eb4d3e8 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/MetricBuilder.java @@ -0,0 +1,9 @@ +package com.webank.wedatasphere.exchangis.metrics; + +import com.webank.wedatasphere.exchangis.metrics.api.MetricName; + +public interface MetricBuilder> { + + T build(MetricName name); + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/PersistableMetric.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/PersistableMetric.java new file mode 100644 index 000000000..f3c6869c5 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/PersistableMetric.java @@ -0,0 +1,7 @@ +package com.webank.wedatasphere.exchangis.metrics; + +public interface PersistableMetric extends PersistenceMetric { + + PersistableMetric toPersistenceMetric(); + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/PersistenceMetric.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/PersistenceMetric.java new file mode 100644 index 000000000..4640a233d --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/PersistenceMetric.java @@ -0,0 +1,9 @@ +package com.webank.wedatasphere.exchangis.metrics; + +public interface PersistenceMetric extends Metric { + + String getMetricSeq(); + + String getMetricValueType(); + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/Scope.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/Scope.java new file mode 100644 index 000000000..14ea26513 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/Scope.java @@ -0,0 +1,5 @@ +package com.webank.wedatasphere.exchangis.metrics; + +public enum Scope { + SINGLETON, PROTOTYPE +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/Counter.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/Counter.java new file mode 100644 index 000000000..0e1fa3eb9 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/Counter.java @@ -0,0 +1,23 @@ +package com.webank.wedatasphere.exchangis.metrics.api; + +import com.webank.wedatasphere.exchangis.metrics.Metric; + +/** + *
+ * An incrementing and decrementing counter metric.
+ *
+ * 计数器型指标,适用于记录调用总量等类型的数据
+ * 
+ */ +public interface Counter extends Metric { + + void inc(); + + void inc(long n); + + void dec(); + + void dec(long n); + + long getCount(); +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/ExchangisMetricManager.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/ExchangisMetricManager.java new file mode 100644 index 000000000..e6f1e40de --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/ExchangisMetricManager.java @@ -0,0 +1,46 @@ +package com.webank.wedatasphere.exchangis.metrics.api; + +import com.webank.wedatasphere.exchangis.metrics.Metric; +import com.webank.wedatasphere.exchangis.metrics.impl.ExchangisMetricRegistry; + +public class ExchangisMetricManager implements IMetricManager { + + private volatile boolean enabled; + private final ExchangisMetricRegistry exchangisMetricRegistry; + + public ExchangisMetricManager() { + this.exchangisMetricRegistry = new ExchangisMetricRegistry(); + enabled = true; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + @Override + public Counter getCounter(MetricName name) { + if (!this.enabled) { + return MetricManager.NOP_METRIC_MANAGER.getCounter(name); + } + + return this.exchangisMetricRegistry.counter(name); + } + + @Override + public Counter getJdbcCounter(MetricName name) { + if (!this.enabled) { + return MetricManager.NOP_METRIC_MANAGER.getJdbcCounter(name); + } + + return this.exchangisMetricRegistry.jdbcCounter(name); + } + + @Override + public void register(MetricName name, Metric metric) { + if (!this.enabled) { + return; + } + this.exchangisMetricRegistry.register(name, metric); + } + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/IMetricManager.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/IMetricManager.java new file mode 100644 index 000000000..31ecaf563 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/IMetricManager.java @@ -0,0 +1,24 @@ +package com.webank.wedatasphere.exchangis.metrics.api; + +import com.webank.wedatasphere.exchangis.metrics.Metric; + +public interface IMetricManager { + + /** + * Create a {@link Counter} metric in given group, and name. + * if not exist, an instance will be created. + * + * @param name the name of the metric + * @return an instance of counter + */ + Counter getCounter(MetricName name); + + Counter getJdbcCounter(MetricName name); + + /** + * Register a customized metric to specified group. + * @param metric the metric to register + */ + void register(MetricName name, Metric metric); + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/MetricManager.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/MetricManager.java new file mode 100644 index 000000000..159976c9d --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/MetricManager.java @@ -0,0 +1,76 @@ +package com.webank.wedatasphere.exchangis.metrics.api; + +import com.webank.wedatasphere.exchangis.metrics.Metric; + +import java.lang.reflect.Method; + +/** + * The design concept is heavily borrowed from alibaba metrics. + * + * alibaba metrics + * ==================================== + * The design concept is heavily borrowed from SLF4j (http://www.slf4j.org/), the logging framework. + * The application only depends on the metrics api. + * The implementation will be dynamically bound. + * If the implementation if not found in classpath, by default the {@link NOPMetricManager} will be bound. + * + * 这里采用了 alibaba metrics 代码,在其之上做了一些简化,取消了 group 分组,目前只考虑针对 exchangis 的服务做一些监控 + */ +public class MetricManager { + + private static final String BINDER_CLASS = "com.webank.wedatasphere.exchangis.metrics.api.MetricManagerBinder"; + public static final IMetricManager NOP_METRIC_MANAGER = new NOPMetricManager(); + + private static volatile IMetricManager iMetricManager; + + /** + * Create a {@link Counter} metric in given group, and name. + * if not exist, an instance will be created. + * 根据给定的group和name, 获取一个Counter实例,如果不存在则会创建 + * Counter(计数器), 主要用于用于计数,支持+1, -1, +n, -n等操作 + * + * @param name the name of the metric + * @return an instance of counter + */ + public static Counter getCounter(MetricName name) { + IMetricManager manager = getIMetricManager(); + return manager.getCounter(name); + } + + public static Counter getJdbcCounter(MetricName name) { + IMetricManager manager = getIMetricManager(); + return manager.getJdbcCounter(name); + } + + /** + * Register a customized metric to specified group. + * @param metric the metric to register + */ + public static void register(MetricName name, Metric metric) { + IMetricManager manager = getIMetricManager(); + manager.register(name, metric); + } + + /** + * get dynamically bound {@link IMetricManager} instance + * @return the {@link IMetricManager} instance bound + */ + public static IMetricManager getIMetricManager() { + if (iMetricManager == null) { + synchronized (MetricManager.class) { + if (iMetricManager == null) { + try { + Class binderClazz = MetricManager.class.getClassLoader().loadClass(BINDER_CLASS); + Method getSingleton = binderClazz.getMethod("getSingleton"); + Object binderObject = getSingleton.invoke(null); + Method getMetricManager = binderClazz.getMethod("getMetricManager"); + iMetricManager = (IMetricManager) getMetricManager.invoke(binderObject); + } catch (Exception e) { + iMetricManager = NOP_METRIC_MANAGER; + } + } + } + } + return iMetricManager; + } +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/MetricManagerBinder.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/MetricManagerBinder.java new file mode 100644 index 000000000..b4851fd5f --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/MetricManagerBinder.java @@ -0,0 +1,21 @@ +package com.webank.wedatasphere.exchangis.metrics.api; + +public class MetricManagerBinder { + + private static final MetricManagerBinder instance = new MetricManagerBinder(); + + private final IMetricManager manager; + + private MetricManagerBinder() { + manager = new ExchangisMetricManager(); + } + + public static MetricManagerBinder getSingleton() { + return instance; + } + + public IMetricManager getMetricManager() { + return manager; + } + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/MetricName.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/MetricName.java new file mode 100644 index 000000000..cf56cfb25 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/MetricName.java @@ -0,0 +1,87 @@ +package com.webank.wedatasphere.exchangis.metrics.api; + +/** + * A metric name with the ability to include semantic tags. + * + * This replaces the previous style where metric names where strictly + * dot-separated strings. + * + */ +public class MetricName { + public static final String SEPARATOR = "."; + public static final MetricName EMPTY = new MetricName(); + + private String norm; + + private String title; + + public MetricName() { + this(null, null); + } + + public MetricName(String norm) { + this(norm, null); + } + + public MetricName(String norm, String title) { + this.norm = norm; + this.title = title; + } + + /** + * Build a new metric name using the specific path components. + * + * @param parts Path of the new metric name. + * @return A newly created metric name with the specified path. + **/ + public static MetricName build(String... parts) { + if (parts == null || parts.length == 0) + return MetricName.EMPTY; + + if (parts.length == 1) + return new MetricName(parts[0]); + + return new MetricName(buildName(parts)); + } + + public MetricName withTitle(String title) { + this.title = title; + return this; + } + + private static String buildName(String... names) { + final StringBuilder builder = new StringBuilder(); + boolean first = true; + + for (String name : names) { + if (name == null || name.isEmpty()) + continue; + + if (first) { + first = false; + } else { + builder.append(SEPARATOR); + } + + builder.append(name); + } + + return builder.toString(); + } + + public String getNorm() { + return norm; + } + + public void setNorm(String norm) { + this.norm = norm; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/MetricRegistry.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/MetricRegistry.java new file mode 100644 index 000000000..c937a99bb --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/MetricRegistry.java @@ -0,0 +1,27 @@ +package com.webank.wedatasphere.exchangis.metrics.api; + +import com.webank.wedatasphere.exchangis.metrics.Metric; +import com.webank.wedatasphere.exchangis.metrics.MetricBuilder; + +import java.util.List; +import java.util.Map; + +public interface MetricRegistry { + + Map>> getMetrics(); + + List> getMetrics(String norm); + + void addMetricBuilder(MetricBuilder> builder); + + > T register(String norm, T metric); + + > T register(MetricName name, T metric); + + Metric register(String norm, Class> metricCls); + + > T newMetric(String norm); + + > T removeMetric(String norm); + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/MetricRegistyListener.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/MetricRegistyListener.java new file mode 100644 index 000000000..0d20a93ab --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/MetricRegistyListener.java @@ -0,0 +1,145 @@ +//package com.webank.wedatasphere.exchangis.metrics.api; +// +//import java.util.EventListener; +// +//public interface MetricRegistyListener extends EventListener { +// +// abstract class Base implements MetricRegistryListener { +// @Override +// public void onGaugeAdded(MetricName name, Gauge gauge) { +// } +// +// @Override +// public void onGaugeRemoved(MetricName name) { +// } +// +// @Override +// public void onCounterAdded(MetricName name, Counter counter) { +// } +// +// @Override +// public void onCounterRemoved(MetricName name) { +// } +// +// @Override +// public void onHistogramAdded(MetricName name, Histogram histogram) { +// } +// +// @Override +// public void onHistogramRemoved(MetricName name) { +// } +// +// @Override +// public void onMeterAdded(MetricName name, Meter meter) { +// } +// +// @Override +// public void onMeterRemoved(MetricName name) { +// } +// +// @Override +// public void onTimerAdded(MetricName name, Timer timer) { +// } +// +// @Override +// public void onTimerRemoved(MetricName name) { +// } +// +// @Override +// public void onCompassAdded(MetricName name, Compass compass) { +// +// } +// +// @Override +// public void onCompassRemoved(MetricName name) { +// +// } +// +// @Override +// public void onFastCompassAdded(MetricName name, FastCompass compass) { +// +// } +// +// @Override +// public void onFastCompassRemoved(MetricName name) { +// +// } +// } +// +// +// /** +// * Called when a {@link Gauge} is added to the registry. +// * +// * @param name the gauge's name +// * @param gauge the gauge +// */ +// void onGaugeAdded(String name, Gauge gauge); +// +// /** +// * Called when a {@link Gauge} is removed from the registry. +// * +// * @param name the gauge's name +// */ +// void onGaugeRemoved(MetricName name); +// +// /** +// * Called when a {@link Counter} is added to the registry. +// * +// * @param name the counter's name +// * @param counter the counter +// */ +// void onCounterAdded(MetricName name, Counter counter); +// +// /** +// * Called when a {@link Counter} is removed from the registry. +// * +// * @param name the counter's name +// */ +// void onCounterRemoved(MetricName name); +// +// /** +// * Called when a {@link Histogram} is added to the registry. +// * +// * @param name the histogram's name +// * @param histogram the histogram +// */ +// void onHistogramAdded(MetricName name, Histogram histogram); +// +// /** +// * Called when a {@link Histogram} is removed from the registry. +// * +// * @param name the histogram's name +// */ +// void onHistogramRemoved(MetricName name); +// +// /** +// * Called when a {@link Meter} is added to the registry. +// * +// * @param name the meter's name +// * @param meter the meter +// */ +// void onMeterAdded(MetricName name, Meter meter); +// +// /** +// * Called when a {@link Meter} is removed from the registry. +// * +// * @param name the meter's name +// */ +// void onMeterRemoved(MetricName name); +// +// /** +// * Called when a {@link Timer} is added to the registry. +// * +// * @param name the timer's name +// * @param timer the timer +// */ +// void onTimerAdded(MetricName name, Timer timer); +// +// /** +// * Called when a {@link Timer} is removed from the registry. +// * +// * @param name the timer's name +// */ +// void onTimerRemoved(MetricName name); +// +//} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/NOPMetricManager.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/NOPMetricManager.java new file mode 100644 index 000000000..70d611703 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/api/NOPMetricManager.java @@ -0,0 +1,58 @@ +package com.webank.wedatasphere.exchangis.metrics.api; + + +import com.webank.wedatasphere.exchangis.metrics.Metric; + +public class NOPMetricManager implements IMetricManager { + @Override + public Counter getCounter(MetricName name) { + return NOP_COUNTER; + } + + @Override + public Counter getJdbcCounter(MetricName name) { + return NOP_COUNTER; + } + + @Override + public void register(MetricName name, Metric metric) { + + } + + public static final Counter NOP_COUNTER = new Counter() { + @Override + public void inc() { + + } + + @Override + public void inc(long n) { + + } + + @Override + public void dec() { + + } + + @Override + public void dec(long n) { + + } + + @Override + public long getCount() { + return 0; + } + + @Override + public long lastUpdateTime() { + return 0; + } + + @Override + public MetricName getMetricName() { + return MetricName.build("nop.counter"); + } + }; +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dao/entity/ExchangisMetric.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dao/entity/ExchangisMetric.java new file mode 100644 index 000000000..2abc057eb --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dao/entity/ExchangisMetric.java @@ -0,0 +1,72 @@ +package com.webank.wedatasphere.exchangis.metrics.dao.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +@TableName("exchangis_metric") +public class ExchangisMetric { + + @TableId(type = IdType.AUTO) + private Long id; + + private String title; + + private String norm; + + private String value; + + private Date ts; + + private Long version; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getNorm() { + return norm; + } + + public void setNorm(String norm) { + this.norm = norm; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public Date getTs() { + return ts; + } + + public void setTs(Date ts) { + this.ts = ts; + } + + public Long getVersion() { + return version; + } + + public void setVersion(Long version) { + this.version = version; + } +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dao/mapper/ExchangisMetricMapper.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dao/mapper/ExchangisMetricMapper.java new file mode 100644 index 000000000..437246794 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dao/mapper/ExchangisMetricMapper.java @@ -0,0 +1,17 @@ +package com.webank.wedatasphere.exchangis.metrics.dao.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.webank.wedatasphere.exchangis.metrics.dao.entity.ExchangisMetric; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.Optional; + +@Mapper +public interface ExchangisMetricMapper extends BaseMapper { + + @Select("select * from exchangis_metric where norm = #{norm}") + Optional getByNorm(@Param("norm") String norm); + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dto/ExchangisDataSourceFlowMetricsDTO.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dto/ExchangisDataSourceFlowMetricsDTO.java new file mode 100644 index 000000000..81fc85317 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dto/ExchangisDataSourceFlowMetricsDTO.java @@ -0,0 +1,47 @@ +package com.webank.wedatasphere.exchangis.metrics.dto; + +// 数据源流量指标对象 +// datasource flow metrics pojo +public class ExchangisDataSourceFlowMetricsDTO { + + private String dataSourceTitle; + + private Long dataSourceId; + + // 监控的维度(秒、分钟、小时) + private String dimension; + + private String flow; + + public String getDataSourceTitle() { + return dataSourceTitle; + } + + public void setDataSourceTitle(String dataSourceTitle) { + this.dataSourceTitle = dataSourceTitle; + } + + public Long getDataSourceId() { + return dataSourceId; + } + + public void setDataSourceId(Long dataSourceId) { + this.dataSourceId = dataSourceId; + } + + public String getDimension() { + return dimension; + } + + public void setDimension(String dimension) { + this.dimension = dimension; + } + + public String getFlow() { + return flow; + } + + public void setFlow(String flow) { + this.flow = flow; + } +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dto/ExchangisEngineResourceMetricsDTO.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dto/ExchangisEngineResourceMetricsDTO.java new file mode 100644 index 000000000..a7da75f41 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dto/ExchangisEngineResourceMetricsDTO.java @@ -0,0 +1,34 @@ +package com.webank.wedatasphere.exchangis.metrics.dto; + +public class ExchangisEngineResourceMetricsDTO { + + private String engine; + + private String cpu; + + private String mem; + + public String getEngine() { + return engine; + } + + public void setEngine(String engine) { + this.engine = engine; + } + + public String getCpu() { + return cpu; + } + + public void setCpu(String cpu) { + this.cpu = cpu; + } + + public String getMem() { + return mem; + } + + public void setMem(String mem) { + this.mem = mem; + } +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dto/ExchangisTaskProcessMetricsDTO.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dto/ExchangisTaskProcessMetricsDTO.java new file mode 100644 index 000000000..0456f8adf --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dto/ExchangisTaskProcessMetricsDTO.java @@ -0,0 +1,64 @@ +package com.webank.wedatasphere.exchangis.metrics.dto; + +public class ExchangisTaskProcessMetricsDTO { + + private String key; + + private String title; + + private Integer running; + + private Integer initialized; + + private Integer total; + + private String percentOfComplete; + + public Integer getRunning() { + return running; + } + + public void setRunning(Integer running) { + this.running = running; + } + + public Integer getInitialized() { + return initialized; + } + + public void setInitialized(Integer initialized) { + this.initialized = initialized; + } + + public Integer getTotal() { + return total; + } + + public void setTotal(Integer total) { + this.total = total; + } + + public String getPercentOfComplete() { + return percentOfComplete; + } + + public void setPercentOfComplete(String percentOfComplete) { + this.percentOfComplete = percentOfComplete; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dto/ExchangisTaskStatusMetricsDTO.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dto/ExchangisTaskStatusMetricsDTO.java new file mode 100644 index 000000000..b006a4ff3 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/dto/ExchangisTaskStatusMetricsDTO.java @@ -0,0 +1,29 @@ +package com.webank.wedatasphere.exchangis.metrics.dto; + +public class ExchangisTaskStatusMetricsDTO { + + private String status; + + private long num; + + public ExchangisTaskStatusMetricsDTO(String status, long num) { + this.status = status; + this.num = num; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public long getNum() { + return num; + } + + public void setNum(long num) { + this.num = num; + } +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/Collector.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/Collector.java new file mode 100644 index 000000000..eaf8e36d7 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/Collector.java @@ -0,0 +1,10 @@ +package com.webank.wedatasphere.exchangis.metrics.impl; + +import com.webank.wedatasphere.exchangis.metrics.api.Counter; +import com.webank.wedatasphere.exchangis.metrics.api.MetricName; + +public interface Collector { + + void collect(MetricName name, Counter counter, long timestamp); + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/CounterImpl.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/CounterImpl.java new file mode 100644 index 000000000..9a8cb1d3b --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/CounterImpl.java @@ -0,0 +1,51 @@ +package com.webank.wedatasphere.exchangis.metrics.impl; + +import com.webank.wedatasphere.exchangis.metrics.api.Counter; +import com.webank.wedatasphere.exchangis.metrics.api.MetricName; + +import java.util.Date; +import java.util.Optional; + +public class CounterImpl implements Counter { + + private final MetricName name; + + @Override + public MetricName getMetricName() { + return name; + } + + public CounterImpl(MetricName name) { + this.name = name; + } + + @Override + public long lastUpdateTime() { + return 0; + } + + @Override + public void inc() { + + } + + @Override + public void inc(long n) { + + } + + @Override + public void dec() { + + } + + @Override + public void dec(long n) { + + } + + @Override + public long getCount() { + return 0; + } +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/ExchangisMetricRegistry.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/ExchangisMetricRegistry.java new file mode 100644 index 000000000..d030bd08e --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/ExchangisMetricRegistry.java @@ -0,0 +1,141 @@ +package com.webank.wedatasphere.exchangis.metrics.impl; + +import com.webank.wedatasphere.exchangis.metrics.Metric; +import com.webank.wedatasphere.exchangis.metrics.MetricBuilder; +import com.webank.wedatasphere.exchangis.metrics.api.Counter; +import com.webank.wedatasphere.exchangis.metrics.api.MetricName; +import com.webank.wedatasphere.exchangis.metrics.api.MetricRegistry; +import com.webank.wedatasphere.exchangis.metrics.api.NOPMetricManager; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +@Component +public class ExchangisMetricRegistry implements MetricRegistry { + + private static final int DEFAULT_MAX_METRIC_COUNT = Integer.getInteger("exchangis.maxMetricCountPerRegistry", 5000); + + private final ConcurrentMap>> metricBuilders; + private final ConcurrentMap> metrics; + private final int maxMetricCount; + + public ExchangisMetricRegistry() { + this(DEFAULT_MAX_METRIC_COUNT); + } + + public ExchangisMetricRegistry(int maxMetricCount) { + this.metrics = new ConcurrentHashMap<>(); + this.metricBuilders = new ConcurrentHashMap<>(); + this.maxMetricCount = maxMetricCount; + } + + /** + * Return the {@link Counter} registered under this name; or create and register + * a new {@link Counter} if none is registered. + * + * @param name the name of the metric + * @return a new or pre-existing {@link Counter} + */ + public Counter counter(MetricName name) { + Counter counter = getOrAdd(name, COUNTER_BUILDER); + if (counter == null) { + return NOPMetricManager.NOP_COUNTER; + } + return counter; + } + + public Counter jdbcCounter(MetricName name) { + Counter counter = getOrAdd(name, JDBC_COUNTER_BUILDER); + if (counter == null) { + return NOPMetricManager.NOP_COUNTER; + } + return counter; + } + + @Override + public Map>> getMetrics() { + return null; + } + + @Override + public List> getMetrics(String norm) { + // TODO + return null; + } + + @Override + public void addMetricBuilder(MetricBuilder> builder) { + // TODO + } + + @Override + public > T register(String norm, T metric) { + Metric existing = metrics.putIfAbsent(norm, metric); + if (null == existing) { + onMetricAdded(norm, metric); + } else { + throw new IllegalArgumentException("A metric named " + norm + " already exists"); + } + return metric; + } + + @Override + public > T register(MetricName name, T metric) { + return register(name.getNorm(), metric); + } + + @Override + public Metric register(String norm, Class> metricCls) { + return null; + } + + @Override + public > T newMetric(String norm) { + return null; + } + + @Override + public > T removeMetric(String norm) { + return null; + } + + private void onMetricAdded(String norm, Metric metric) { + // TODO + } + + @SuppressWarnings("unchecked") + private > T getOrAdd(MetricName name, MetricBuilder metricBuilder) { + final Metric metric = metrics.get(name.getNorm()); + if (metric == null) { + try { + T newMetric = metricBuilder.build(name); + if (newMetric == null) return null; + return register(name, newMetric); + } catch (IllegalArgumentException e) { + throw e; + } + } + return (T) metric; +// throw new IllegalArgumentException(name + " is already used for a different type of metric"); + } + + /** + * A quick and easy way of capturing the notion of default metrics. + */ + private final MetricBuilder COUNTER_BUILDER = new MetricBuilder() { + @Override + public Counter build(MetricName name) { + return new CounterImpl(name); + } + }; + + private final MetricBuilder JDBC_COUNTER_BUILDER = new MetricBuilder() { + @Override + public JdbcCounterImpl build(MetricName name) { + return new JdbcCounterImpl(name); + } + }; +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/JdbcCounterImpl.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/JdbcCounterImpl.java new file mode 100644 index 000000000..7d8455384 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/JdbcCounterImpl.java @@ -0,0 +1,131 @@ +package com.webank.wedatasphere.exchangis.metrics.impl; + +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.webank.wedatasphere.exchangis.metrics.api.Counter; +import com.webank.wedatasphere.exchangis.metrics.api.MetricName; +import com.webank.wedatasphere.exchangis.metrics.dao.entity.ExchangisMetric; +import com.webank.wedatasphere.exchangis.metrics.dao.mapper.ExchangisMetricMapper; +import com.webank.wedatasphere.exchangis.metrics.support.SpringContextHolder; +import org.springframework.context.ApplicationContext; + +import java.util.Date; +import java.util.Optional; +import java.util.concurrent.TimeUnit; + +public class JdbcCounterImpl implements Counter { + private static final long MAX_LOCK_WAIT = 60 * 1000; + private final MetricName name; + private final ExchangisMetricMapper mapper; + private long ts; + + @Override + public MetricName getMetricName() { + return name; + } + + public JdbcCounterImpl(MetricName name) { + this.name = name; + + ApplicationContext ctx = SpringContextHolder.getApplicationContext(); + this.mapper = ctx.getBean(ExchangisMetricMapper.class); + } + + @Override + public long lastUpdateTime() { + return ts; + } + + @Override + public void inc() { + update(1); + } + + @Override + public void inc(long n) { + update(n); + } + + @Override + public void dec() { + update(-1); + } + + @Override + public void dec(long n) { + update(-n); + } + + @Override + public long getCount() { + Optional metricOptional = mapper.getByNorm(name.getNorm()); + if (metricOptional.isPresent()) { + ExchangisMetric metric = metricOptional.get(); + String value = metric.getValue(); + return Long.parseLong(value); + } + return 0; + } + + private void update(long n) { + String norm = name.getNorm(); + String title = name.getTitle(); + // TODO 是否要做锁超时处理 +// long lockWaitStartMs = System.currentTimeMillis(); + ApplicationContext ctx = SpringContextHolder.getApplicationContext(); + ExchangisMetricMapper mapper = ctx.getBean(ExchangisMetricMapper.class); + Optional metricOptional = mapper.getByNorm(norm); + if (metricOptional.isPresent()) { + ExchangisMetric metric = metricOptional.get(); + long metricId = metric.getId(); + int update; + ExchangisMetric dblCheckMetric; + do { + long ts = System.currentTimeMillis(); + dblCheckMetric = mapper.selectById(metricId); + if (null == dblCheckMetric) { + break; + } + // update + Long oldVersion = dblCheckMetric.getVersion(); + String value = dblCheckMetric.getValue(); + long longVal; + try { + longVal = Long.parseLong(value); + } catch (Exception e) { + longVal = 0; + } + + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.eq("id", dblCheckMetric.getId()); + updateWrapper.eq("version", oldVersion); + + ExchangisMetric updateBean = new ExchangisMetric(); + updateBean.setValue((longVal + n) + ""); + updateBean.setVersion(oldVersion + 1); + updateBean.setTs(new Date(ts)); + update = mapper.update(updateBean, updateWrapper); + if (1 != update) { + try { + TimeUnit.MILLISECONDS.sleep(30); + } catch (InterruptedException e) { + // ignore + } + } + this.ts = ts; + } while (update != 1); + } else { + long ts = System.currentTimeMillis(); + + // new create + ExchangisMetric metric = new ExchangisMetric(); + metric.setNorm(norm); + metric.setTitle(title); + metric.setValue(n+""); + metric.setVersion(1L); + metric.setTs(new Date(ts)); + mapper.insert(metric); + + this.ts = ts; + } + } +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/MetricNames.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/MetricNames.java new file mode 100644 index 000000000..77106a12a --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/MetricNames.java @@ -0,0 +1,14 @@ +package com.webank.wedatasphere.exchangis.metrics.impl; + +import com.webank.wedatasphere.exchangis.metrics.api.MetricName; + +public class MetricNames { + + public static final MetricName TASK_RUNNING_COUNT_METRIC_NAME = MetricName.build("RUNNING").withTitle("运行中的任务数"); + public static final MetricName TASK_SUCCESS_COUNT_METRIC_NAME = MetricName.build("SUCCESS").withTitle("成功的任务数"); + public static final MetricName TASK_FAILED_COUNT_METRIC_NAME = MetricName.build("FAILED").withTitle("失败的任务数"); + public static final MetricName TASK_IDLE_COUNT_METRIC_NAME = MetricName.build("IDLE").withTitle("等待中的任务数"); + public static final MetricName TASK_BUSY_COUNT_METRIC_NAME = MetricName.build("BUSY").withTitle("慢任务任务数"); + public static final MetricName TASK_UNLOCK_COUNT_METRIC_NAME = MetricName.build("UNLOCK").withTitle("等待重试的任务数"); + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/MetricObject.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/MetricObject.java new file mode 100644 index 000000000..d99bec752 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/MetricObject.java @@ -0,0 +1,46 @@ +package com.webank.wedatasphere.exchangis.metrics.impl; + +import java.util.HashMap; +import java.util.Map; + +public class MetricObject { + + private MetricObject() { + + } + + public static Builder named(String name) { + return new Builder(name); + } + + private String metric; + + private Long timestamp; + + private Object value; + + public static class Builder { + + private final MetricObject metric; + + public Builder(String name) { + this.metric = new MetricObject(); + metric.metric = name; + } + + public MetricObject build() { + return metric; + } + + public Builder withValue(Object value) { + metric.value = value; + return this; + } + + public Builder withTimestamp(Long timestamp) { + metric.timestamp = timestamp; + return this; + } + } + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/MetricsCollector.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/MetricsCollector.java new file mode 100644 index 000000000..2b9109cc2 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/MetricsCollector.java @@ -0,0 +1,18 @@ +package com.webank.wedatasphere.exchangis.metrics.impl; + +import java.util.List; + +public abstract class MetricsCollector implements Collector { + + protected final List metrics; + + + MetricsCollector() { + this.metrics = null; + } + + public List build() { + return metrics; + } + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/MetricsCollectorFactory.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/MetricsCollectorFactory.java new file mode 100644 index 000000000..d33ddf16b --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/MetricsCollectorFactory.java @@ -0,0 +1,9 @@ +package com.webank.wedatasphere.exchangis.metrics.impl; + +public class MetricsCollectorFactory { + + public static MetricsCollector create() { + return new NormalMetricsCollector(); + } + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/NormalMetricsCollector.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/NormalMetricsCollector.java new file mode 100644 index 000000000..8183ade2a --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/impl/NormalMetricsCollector.java @@ -0,0 +1,11 @@ +package com.webank.wedatasphere.exchangis.metrics.impl; + +import com.webank.wedatasphere.exchangis.metrics.api.Counter; +import com.webank.wedatasphere.exchangis.metrics.api.MetricName; + +public class NormalMetricsCollector extends MetricsCollector { + @Override + public void collect(MetricName name, Counter counter, long timestamp) { + + } +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/service/ExchangisMetricsService.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/service/ExchangisMetricsService.java new file mode 100644 index 000000000..d1a68bf65 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/service/ExchangisMetricsService.java @@ -0,0 +1,20 @@ +package com.webank.wedatasphere.exchangis.metrics.service; + + +import org.apache.linkis.server.Message; + +import javax.servlet.http.HttpServletRequest; + +public interface ExchangisMetricsService { + Message getTaskStatusMetrics(HttpServletRequest request); + + Message getTaskProcessMetrics(HttpServletRequest request); + + Message getDataSourceFlowMetrics(HttpServletRequest request); + + Message getEngineResourceCpuMetrics(HttpServletRequest request); + + Message getEngineResourceMemMetrics(HttpServletRequest request); + + Message getEngineResourceMetrics(HttpServletRequest request); +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/service/impl/ExchangisMetricsServiceImpl.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/service/impl/ExchangisMetricsServiceImpl.java new file mode 100644 index 000000000..8ce15f72e --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/service/impl/ExchangisMetricsServiceImpl.java @@ -0,0 +1,387 @@ +package com.webank.wedatasphere.exchangis.metrics.service.impl; + +import com.webank.wedatasphere.exchangis.metrics.api.Counter; +import com.webank.wedatasphere.exchangis.metrics.api.IMetricManager; +import com.webank.wedatasphere.exchangis.metrics.api.MetricManager; +import com.webank.wedatasphere.exchangis.metrics.dto.ExchangisEngineResourceMetricsDTO; +import com.webank.wedatasphere.exchangis.metrics.dto.ExchangisTaskProcessMetricsDTO; +import com.webank.wedatasphere.exchangis.metrics.dto.ExchangisTaskStatusMetricsDTO; +import com.webank.wedatasphere.exchangis.metrics.impl.MetricNames; +import com.webank.wedatasphere.exchangis.metrics.service.ExchangisMetricsService; +import org.apache.linkis.server.Message; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletRequest; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +@Service +public class ExchangisMetricsServiceImpl implements ExchangisMetricsService { + + private static final IMetricManager manager = MetricManager.getIMetricManager(); + +// private final ExchangisLaunchTaskMapper exchangisLaunchTaskMapper; +// +// @Autowired +// public ExchangisMetricsServiceImpl(ExchangisLaunchTaskMapper exchangisLaunchTaskMapper) { +// this.exchangisLaunchTaskMapper = exchangisLaunchTaskMapper; +// } +// +// @Override +// public Message getTaskStateMetrics(HttpServletRequest request) { +// List metrices = new ArrayList<>(); +// // TODO hard code +// ExchangisTaskStatusMetricsDTO success = exchangisLaunchTaskMapper.getTaskMetricsByStatus("SUCCESS"); +// ExchangisTaskStatusMetricsDTO failed = exchangisLaunchTaskMapper.getTaskMetricsByStatus("FAILED"); +// ExchangisTaskStatusMetricsDTO running = exchangisLaunchTaskMapper.getTaskMetricsByStatus("RUNNING"); +// ExchangisTaskStatusMetricsDTO busy = exchangisLaunchTaskMapper.getTaskMetricsByStatus("BUSY"); +// ExchangisTaskStatusMetricsDTO idle = exchangisLaunchTaskMapper.getTaskMetricsByStatus("IDLE"); +// ExchangisTaskStatusMetricsDTO unlock = exchangisLaunchTaskMapper.getTaskMetricsByStatus("UNLOCK"); +// +// Optional.ofNullable(success).ifPresent(metrices::add); +// Optional.ofNullable(failed).ifPresent(metrices::add); +// Optional.ofNullable(running).ifPresent(metrices::add); +// Optional.ofNullable(busy).ifPresent(metrices::add); +// Optional.ofNullable(idle).ifPresent(metrices::add); +// Optional.ofNullable(unlock).ifPresent(metrices::add); +// +// Message message = Message.ok(); +// message.setMethod("/dss/exchangis/main/metrics/taskstate"); +// message.data("metrices", metrices); +// return message; +// } + + @Override + public Message getTaskStatusMetrics(HttpServletRequest request) { + List metrices = new ArrayList<>(); + Counter successCounter = manager.getJdbcCounter(MetricNames.TASK_SUCCESS_COUNT_METRIC_NAME); + ExchangisTaskStatusMetricsDTO success = new ExchangisTaskStatusMetricsDTO(successCounter.getMetricName().getNorm(), successCounter.getCount()); + metrices.add(success); + + Counter runningCounter = manager.getJdbcCounter(MetricNames.TASK_RUNNING_COUNT_METRIC_NAME); + ExchangisTaskStatusMetricsDTO running = new ExchangisTaskStatusMetricsDTO(runningCounter.getMetricName().getNorm(), runningCounter.getCount()); + metrices.add(running); + + Counter failedCounter = manager.getJdbcCounter(MetricNames.TASK_FAILED_COUNT_METRIC_NAME); + ExchangisTaskStatusMetricsDTO failed = new ExchangisTaskStatusMetricsDTO(failedCounter.getMetricName().getNorm(), failedCounter.getCount()); + metrices.add(failed); + + Counter busyCounter = manager.getJdbcCounter(MetricNames.TASK_BUSY_COUNT_METRIC_NAME); + ExchangisTaskStatusMetricsDTO busy = new ExchangisTaskStatusMetricsDTO(busyCounter.getMetricName().getNorm(), busyCounter.getCount()); + metrices.add(busy); + + Counter idleCounter = manager.getJdbcCounter(MetricNames.TASK_IDLE_COUNT_METRIC_NAME); + ExchangisTaskStatusMetricsDTO idle = new ExchangisTaskStatusMetricsDTO(idleCounter.getMetricName().getNorm(), idleCounter.getCount()); + metrices.add(idle); + + Counter unlockCounter = manager.getJdbcCounter(MetricNames.TASK_UNLOCK_COUNT_METRIC_NAME); + ExchangisTaskStatusMetricsDTO unlock = new ExchangisTaskStatusMetricsDTO(unlockCounter.getMetricName().getNorm(), unlockCounter.getCount()); + metrices.add(unlock); + + Message message = Message.ok(); + message.setMethod("/dss/exchangis/main/metrics/taskstate"); + message.data("metrices", metrices); + return message; + } + + @Override + public Message getTaskProcessMetrics(HttpServletRequest request) { + // TODO mock data for process metrics + List list = new ArrayList<>(); + + // total + ExchangisTaskProcessMetricsDTO total = new ExchangisTaskProcessMetricsDTO(); + total.setKey("total"); + total.setTitle("总进度"); + total.setRunning(50); + total.setInitialized(10); + total.setTotal(120); + total.setPercentOfComplete("48%"); + list.add(total); + + // bdp + ExchangisTaskProcessMetricsDTO bdp = new ExchangisTaskProcessMetricsDTO(); + bdp.setKey("bdp"); + bdp.setTitle("BDP"); + bdp.setRunning(20); + bdp.setInitialized(10); + bdp.setTotal(60); + bdp.setPercentOfComplete("33%"); + list.add(bdp); + + // es + ExchangisTaskProcessMetricsDTO es = new ExchangisTaskProcessMetricsDTO(); + es.setKey("es"); + es.setTitle("ES"); + es.setRunning(20); + es.setInitialized(0); + es.setTotal(40); + es.setPercentOfComplete("50%"); + list.add(es); + + // fps + ExchangisTaskProcessMetricsDTO fps = new ExchangisTaskProcessMetricsDTO(); + fps.setKey("fps"); + fps.setTitle("FPS"); + fps.setRunning(10); + fps.setInitialized(0); + fps.setTotal(20); + fps.setPercentOfComplete("50%"); + list.add(fps); + + Message message = Message.ok(); + message.setMethod("/dss/exchangis/main/metrics/taskprocess"); + message.data("list", list); + return message; + } + + // mock data for echarts + + /** + * + * dataset: { + * source: [ + * ['datasource', '2021-10-25 15:00', '2021-10-25 15:01', '2021-10-25 15:02', '2021-10-25 15:03', '2021-10-25 15:04'], + * ['ds1', 41.1, 30.4, 65.1, 53.3, 44.2], + * ['ds2', 86.5, 92.1, 85.7, 83.1, 93.2], + * ['ds3', 24.1, 67.2, 79.5, 86.4, 76.2] + * ] + * }, + */ + @Override + public Message getDataSourceFlowMetrics(HttpServletRequest request) { + // TODO + // make last past 4 hours data, dimension is min + String fromDateTime = "2021-10-25 15:00"; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + Date parsedFrom; + try { + parsedFrom = sdf.parse(fromDateTime); + } catch (Exception e) { + parsedFrom = new Date(); + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(parsedFrom); + + List> dataset = new ArrayList<>(); + List header = new ArrayList<>(); + int loopNum = 4 * 60; + + // 添加第一行,头信息 +// header.add("数据源"); +// for (int i = 1; i <= loopNum; i++) { +// header.add(sdf.format(calendar.getTime())); +// calendar.add(Calendar.MINUTE, 1); +// } + header.add("时间"); + header.add("ds1"); + header.add("ds2"); + header.add("ds3"); + dataset.add(header); + + List realData; + int max = 10240; + int min = 512; + for (int i = 1; i <= loopNum; i++) { + realData = new ArrayList<>(); + realData.add(sdf.format(calendar.getTime())); + calendar.add(Calendar.MINUTE, 1); + realData.add(Math.random() * (max - min) + min); + realData.add(Math.random() * (max - min) + min); + realData.add( Math.random() * (max - min) + min); + dataset.add(realData); + } + + // 添加数据信息 +// List ds1Data = new ArrayList<>(); +// ds1Data.add("ds1"); +// +// List ds2Data = new ArrayList<>(); +// ds2Data.add("ds2"); +// +// List ds3Data = new ArrayList<>(); +// ds3Data.add("ds3"); +// for (int i = 1; i <= loopNum; i++) { +// ds1Data.add(i * RandomUtils.nextInt(1024)); +// ds2Data.add(i * RandomUtils.nextInt(512)); +// ds3Data.add(i * RandomUtils.nextInt(2048)); +// } +// dataset.add(ds1Data); +// dataset.add(ds2Data); +// dataset.add(ds3Data); + Message message = Message.ok(); + message.setMethod("/dss/exchangis/main/metrics/datasourceflow"); + message.data("dataset", dataset); + return message; + } + + @Override + public Message getEngineResourceCpuMetrics(HttpServletRequest request) { + // make last past 4 hours data, dimension is min + String fromDateTime = "2021-10-25 15:00"; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + Date parsedFrom; + try { + parsedFrom = sdf.parse(fromDateTime); + } catch (Exception e) { + parsedFrom = new Date(); + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(parsedFrom); + + List> dataset = new ArrayList<>(); + List header = new ArrayList<>(); + int loopNum = 4 * 60; + + // 添加第一行,头信息 + header.add("时间"); + header.add("datax"); + header.add("sqoop"); + header.add("linkis"); +// for (int i = 1; i <= loopNum; i++) { +// header.add(sdf.format(calendar.getTime())); +// calendar.add(Calendar.MINUTE, 1); +// } + dataset.add(header); + + // 添加数据信息 + List realData; +// ds1Data.add("datax"); + +// List ds2Data = new ArrayList<>(); +// ds2Data.add("sqoop"); +// +// List ds3Data = new ArrayList<>(); +// ds3Data.add("linkis"); + int min = 1; + int max = 8; + for (int i = 1; i <= loopNum; i++) { + realData = new ArrayList<>(); + realData.add(sdf.format(calendar.getTime())); + calendar.add(Calendar.MINUTE, 1); + realData.add(Math.random() * (max - min) + min); + realData.add(Math.random() * (max - min) + min); + realData.add( Math.random() * (max - min) + min); + dataset.add(realData); + } +// dataset.add(ds1Data); +// dataset.add(ds2Data); +// dataset.add(ds3Data); +// dataset.add(realData); + Message message = Message.ok(); + message.setMethod("/dss/exchangis/main/metrics/engineresourcecpu"); + message.data("dataset", dataset); + return message; + + + } + + @Override + public Message getEngineResourceMemMetrics(HttpServletRequest request) { + // make last past 4 hours data, dimension is min + String fromDateTime = "2021-10-25 15:00"; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + Date parsedFrom; + try { + parsedFrom = sdf.parse(fromDateTime); + } catch (Exception e) { + parsedFrom = new Date(); + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(parsedFrom); + + List> dataset = new ArrayList<>(); + List header = new ArrayList<>(); + int loopNum = 4 * 60; + + // 添加第一行,头信息 +// header.add("引擎"); +// for (int i = 1; i <= loopNum; i++) { +// header.add(sdf.format(calendar.getTime())); +// calendar.add(Calendar.MINUTE, 1); +// } +// dataset.add(header); +// +// // 添加数据信息 +// List ds1Data = new ArrayList<>(); +// ds1Data.add("datax"); +// +// List ds2Data = new ArrayList<>(); +// ds2Data.add("sqoop"); +// +// List ds3Data = new ArrayList<>(); +// ds3Data.add("linkis"); +// for (int i = 1; i <= loopNum; i++) { +// ds1Data.add(i * RandomUtils.nextInt(4192)); +// ds2Data.add(i * RandomUtils.nextInt(2048)); +// ds3Data.add(i * RandomUtils.nextInt(1024)); +// } + + // 添加第一行,头信息 + header.add("时间"); + header.add("datax"); + header.add("sqoop"); + header.add("linkis"); +// for (int i = 1; i <= loopNum; i++) { +// header.add(sdf.format(calendar.getTime())); +// calendar.add(Calendar.MINUTE, 1); +// } + dataset.add(header); + + // 添加数据信息 + List realData; + int max = 8192; + int min = 1024; + for (int i = 1; i <= loopNum; i++) { + realData = new ArrayList<>(); + realData.add(sdf.format(calendar.getTime())); + calendar.add(Calendar.MINUTE, 1); + realData.add(Math.random() * (max - min) + min); + realData.add(Math.random() * (max - min) + min); + realData.add( Math.random() * (max - min) + min); +// realData.add(i * RandomUtils.nextInt(4)); +// realData.add(i * RandomUtils.nextInt(4)); +// realData.add(i * RandomUtils.nextInt(4)); + dataset.add(realData); + } +// dataset.add(ds1Data); +// dataset.add(ds2Data); +// dataset.add(ds3Data); + Message message = Message.ok(); + message.setMethod("/dss/exchangis/main/metrics/engineresourcemem"); + message.data("dataset", dataset); + return message; + } + + @Override + public Message getEngineResourceMetrics(HttpServletRequest request) { + List list = new ArrayList<>(); + ExchangisEngineResourceMetricsDTO sqoop = new ExchangisEngineResourceMetricsDTO(); + sqoop.setEngine("sqoop"); + sqoop.setCpu("45%"); + sqoop.setMem("1782Mi"); + list.add(sqoop); + + ExchangisEngineResourceMetricsDTO datax = new ExchangisEngineResourceMetricsDTO(); + datax.setEngine("datax"); + datax.setCpu("32%"); + datax.setMem("512Mi"); + list.add(datax); + + ExchangisEngineResourceMetricsDTO linkis = new ExchangisEngineResourceMetricsDTO(); + linkis.setEngine("linkis"); + linkis.setCpu("78%"); + linkis.setMem("4196Mi"); + list.add(linkis); + + Message message = Message.ok(); + message.setMethod("/dss/exchangis/main/metrics/engineresource"); + message.data("list", list); + return message; + } + + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/support/SpringContextHolder.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/support/SpringContextHolder.java new file mode 100644 index 000000000..b7fbe930e --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/support/SpringContextHolder.java @@ -0,0 +1,38 @@ +/** + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + */ +package com.webank.wedatasphere.exchangis.metrics.support; + +import org.springframework.beans.factory.DisposableBean; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +@Component +public class SpringContextHolder implements ApplicationContextAware, DisposableBean { + + private static ApplicationContext applicationContext = null; + + public static ApplicationContext getApplicationContext() { + return applicationContext; + } + + public static T getBean(Class requiredType) { + return applicationContext.getBean(requiredType); + } + + @Override + public void setApplicationContext(ApplicationContext applicationContext) { + if (SpringContextHolder.applicationContext == null) { + SpringContextHolder.applicationContext = applicationContext; + } + } + + @Override + public void destroy() throws Exception { + applicationContext = null; + } + +} diff --git a/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/web/ExchangisMetricController.java b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/web/ExchangisMetricController.java new file mode 100644 index 000000000..8cfd2dd56 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/main/java/com/webank/wedatasphere/exchangis/metrics/web/ExchangisMetricController.java @@ -0,0 +1,89 @@ +package com.webank.wedatasphere.exchangis.metrics.web; + +import com.webank.wedatasphere.exchangis.metrics.api.Counter; +import com.webank.wedatasphere.exchangis.metrics.api.MetricManager; +import com.webank.wedatasphere.exchangis.metrics.impl.MetricNames; +import org.apache.linkis.server.Message; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; + +@RestController +@RequestMapping(value = "exchangis", produces = {"application/json;charset=utf-8"}) +public class ExchangisMetricController { + private static final Counter metricTaskRunningCounter = MetricManager.getJdbcCounter(MetricNames.TASK_RUNNING_COUNT_METRIC_NAME); + +// @Resource +// private ExchangisMetricRegistry exchangisMetricsRegister; +// +// @Resource +// private ExchangisMetricsService exchangisMetricsService; +// +// @GET +// @Path("metric/{norm}") +// public Response getMetric( +// @Context HttpServletRequest request, +// @PathParam(value = "norm") String norm +// ) { +// List> metrics = this.exchangisMetricsRegister.getMetrics(norm); +// Message message = Message.ok().data("metrics", metrics); +// return Message.messageToResponse(message); +// } + + @RequestMapping( value = "metric/test", method = RequestMethod.GET) + @Deprecated + public Message test(HttpServletRequest request + ) { + metricTaskRunningCounter.inc(); + return Message.ok().data("count", metricTaskRunningCounter.getCount()); + } + + // get task state metrics +// @GET +// @Path("metrics/taskstate") +// public Response getTaskStateMetrics(@Context HttpServletRequest request) throws Exception { +// Message message = this.exchangisMetricsService.getTaskStatusMetrics(request); +// return Message.messageToResponse(message); +// } +// +// // get task process metrics +// @GET +// @Path("metrics/taskprocess") +// public Response getTaskProcessMetrics(@Context HttpServletRequest request) throws Exception { +// Message message = this.exchangisMetricsService.getTaskProcessMetrics(request); +// return Message.messageToResponse(message); +// } +// +// // get datasource flow metrics +// @GET +// @Path("metrics/datasourceflow") +// public Response getDataSourceFlowMetrics(@Context HttpServletRequest request) throws Exception { +// Message message = this.exchangisMetricsService.getDataSourceFlowMetrics(request); +// return Message.messageToResponse(message); +// } +// +// // get engine (sqoop datax linkis etc.) resource metrics +// @GET +// @Path("metrics/engineresource") +// public Response getEngineResourceMetrics(@Context HttpServletRequest request) throws Exception { +// Message message = this.exchangisMetricsService.getEngineResourceMetrics(request); +// return Message.messageToResponse(message); +// } +// +// @GET +// @Path("metrics/engineresourcecpu") +// public Response getEngineResourceCpuMetrics(@Context HttpServletRequest request) throws Exception { +// Message message = this.exchangisMetricsService.getEngineResourceCpuMetrics(request); +// return Message.messageToResponse(message); +// } +// +// @GET +// @Path("metrics/engineresourcemem") +// public Response getEngineResourceMemMetrics(@Context HttpServletRequest request) throws Exception { +// Message message = this.exchangisMetricsService.getEngineResourceMemMetrics(request); +// return Message.messageToResponse(message); +// } + +} diff --git a/exchangis-job/exchangis-job-metrics/src/test/resources/application.yml b/exchangis-job/exchangis-job-metrics/src/test/resources/application.yml new file mode 100644 index 000000000..2315ce303 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/test/resources/application.yml @@ -0,0 +1,13 @@ +server: + port: 9322 +spring: + application: + name: exchangis-server + +management: + endpoints: + web: + exposure: + include: refresh,info +logging: + config: classpath:log4j2.xml diff --git a/exchangis-job/exchangis-job-metrics/src/test/resources/linkis.properties b/exchangis-job/exchangis-job-metrics/src/test/resources/linkis.properties new file mode 100644 index 000000000..db04266c0 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/test/resources/linkis.properties @@ -0,0 +1,47 @@ +# +# Copyright 2019 WeBank +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +wds.linkis.test.mode=true +#wds.linkis.test.mode=false + +wds.linkis.server.mybatis.datasource.url=jdbc:mysql://localhost:3306/exchangis_v3?useSSL=false&characterEncoding=UTF-8 + +wds.linkis.server.mybatis.datasource.username=root + +wds.linkis.server.mybatis.datasource.password=123456 + +wds.linkis.log.clear=true + +wds.linkis.server.version=v1 + +## datasource client +wds.exchangis.datasource.client.serverurl=http://dss.shineweng.com:8088 +wds.exchangis.datasource.client.authtoken.key=hdfs +wds.exchangis.datasource.client.authtoken.value=hdfs +wds.exchangis.datasource.client.dws.version=v1 + +wds.exchangis.datasource.extension.dir=exchangis-extds + +##restful +wds.linkis.server.restful.scan.packages=com.webank.wedatasphere.exchangis.metrics.web +wds.linkis.server.mybatis.mapperLocations=classpath*:com/webank/wedatasphere/exchangis/metrics/mapper/impl/*.xml + +wds.linkis.server.mybatis.BasePackage=com.webank.wedatasphere.exchangis.metrics.dao + + + + diff --git a/exchangis-job/exchangis-job-metrics/src/test/resources/log4j.properties b/exchangis-job/exchangis-job-metrics/src/test/resources/log4j.properties new file mode 100644 index 000000000..0807e6087 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/test/resources/log4j.properties @@ -0,0 +1,37 @@ +# +# Copyright 2019 WeBank +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +### set log levels ### + +log4j.rootCategory=INFO,console + +log4j.appender.console=org.apache.log4j.ConsoleAppender +log4j.appender.console.Threshold=INFO +log4j.appender.console.layout=org.apache.log4j.PatternLayout +#log4j.appender.console.layout.ConversionPattern= %d{ISO8601} %-5p (%t) [%F:%M(%L)] - %m%n +log4j.appender.console.layout.ConversionPattern= %d{ISO8601} %-5p (%t) %p %c{1} - %m%n + + +log4j.appender.com.webank.bdp.ide.core=org.apache.log4j.DailyRollingFileAppender +log4j.appender.com.webank.bdp.ide.core.Threshold=INFO +log4j.additivity.com.webank.bdp.ide.core=false +log4j.appender.com.webank.bdp.ide.core.layout=org.apache.log4j.PatternLayout +log4j.appender.com.webank.bdp.ide.core.Append=true +log4j.appender.com.webank.bdp.ide.core.File=logs/linkis.log +log4j.appender.com.webank.bdp.ide.core.layout.ConversionPattern= %d{ISO8601} %-5p (%t) [%F:%M(%L)] - %m%n + +log4j.logger.org.springframework=INFO diff --git a/exchangis-job/exchangis-job-metrics/src/test/resources/log4j2.xml b/exchangis-job/exchangis-job-metrics/src/test/resources/log4j2.xml new file mode 100644 index 000000000..5ae60f144 --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/test/resources/log4j2.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/exchangis-job/exchangis-job-metrics/src/test/scala/ExchangisMetricBoot.scala b/exchangis-job/exchangis-job-metrics/src/test/scala/ExchangisMetricBoot.scala new file mode 100644 index 000000000..e1c99922c --- /dev/null +++ b/exchangis-job/exchangis-job-metrics/src/test/scala/ExchangisMetricBoot.scala @@ -0,0 +1,7 @@ +import org.apache.linkis.DataWorkCloudApplication + +object ExchangisMetricBoot { + def main(args: Array[String]): Unit = { + DataWorkCloudApplication.main(args) + } +} diff --git a/exchangis-job/exchangis-job-server/pom.xml b/exchangis-job/exchangis-job-server/pom.xml new file mode 100644 index 000000000..9885c5574 --- /dev/null +++ b/exchangis-job/exchangis-job-server/pom.xml @@ -0,0 +1,83 @@ + + + + exchangis-job + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-job-server + + + 8 + 8 + + + + + + com.webank.wedatasphere.exchangis + exchangis-job-common + 1.0.0-RC1 + + + + com.webank.wedatasphere.exchangis + exchangis-datasource-service + 1.0.0-RC1 + + + com.webank.wedatasphere.exchangis + exchangis-job-launcher + 1.0.0-RC1 + + + + org.apache.linkis + linkis-scheduler + ${linkis.version} + + + + mysql + mysql-connector-java + 5.1.49 + + + com.webank.wedatasphere.exchangis + exchangis-project-server + 1.0.0-RC1 + compile + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + net.alchim31.maven + scala-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + + src/main/java + + **/*.xml + + + + + + \ No newline at end of file diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/ExchangisJobExecuteAutoConfiguration.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/ExchangisJobExecuteAutoConfiguration.java new file mode 100644 index 000000000..6faa97ceb --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/ExchangisJobExecuteAutoConfiguration.java @@ -0,0 +1,179 @@ +package com.webank.wedatasphere.exchangis.job.server; + +import com.webank.wedatasphere.exchangis.datasource.core.service.MetadataInfoService; +import com.webank.wedatasphere.exchangis.job.builder.manager.ExchangisJobBuilderManager; +import com.webank.wedatasphere.exchangis.job.launcher.ExchangisTaskLaunchManager; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.manager.LinkisExchangisTaskLaunchManager; +import com.webank.wedatasphere.exchangis.job.listener.JobLogListener; +import com.webank.wedatasphere.exchangis.job.server.builder.SpringExchangisJobBuilderManager; +import com.webank.wedatasphere.exchangis.job.server.execution.*; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.*; +import com.webank.wedatasphere.exchangis.job.server.execution.loadbalance.AbstractTaskSchedulerLoadBalancer; +import com.webank.wedatasphere.exchangis.job.server.execution.loadbalance.FlexibleTenancyLoadBalancer; +import com.webank.wedatasphere.exchangis.job.server.execution.loadbalance.TaskSchedulerLoadBalancer; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.ExchangisSchedulerExecutorManager; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.ExchangisGenericScheduler; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.TenancyParallelConsumerManager; +import com.webank.wedatasphere.exchangis.job.server.execution.subscriber.MaxUsageTaskChooseRuler; +import com.webank.wedatasphere.exchangis.job.server.execution.subscriber.TaskChooseRuler; +import com.webank.wedatasphere.exchangis.job.server.execution.subscriber.TaskObserver; +import com.webank.wedatasphere.exchangis.job.server.log.DefaultRpcJobLogger; +import com.webank.wedatasphere.exchangis.job.server.log.JobLogService; +import com.webank.wedatasphere.exchangis.job.server.log.service.LocalSimpleJobLogService; +import org.apache.linkis.scheduler.Scheduler; +import org.apache.linkis.scheduler.executer.ExecutorManager; +import org.apache.linkis.scheduler.queue.ConsumerManager; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; + +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +/** + * Auto configure the beans in job execution + */ +@Configuration +public class ExchangisJobExecuteAutoConfiguration { + + @Bean + @ConditionalOnMissingBean(JobLogListener.class) + public JobLogListener logListener(){ + return new DefaultRpcJobLogger(); + } + + @Bean + @ConditionalOnMissingBean(JobLogService.class) + public JobLogService jobLogService(){ + return new LocalSimpleJobLogService(); + } + + /** + * Job builder manager + * @return builder manager + */ + @Bean(initMethod = "init") + @ConditionalOnMissingBean(ExchangisJobBuilderManager.class) + public ExchangisJobBuilderManager jobBuilderManager(){ + return new SpringExchangisJobBuilderManager(); + } + + @Bean + @ConditionalOnMissingBean(TaskGeneratorContext.class) + public TaskGeneratorContext taskGeneratorContext(JobLogListener jobLogListener, + MetadataInfoService metadataInfoService){ + return new DefaultTaskGeneratorContext(jobLogListener, metadataInfoService); + } + + /** + * Task generator + * @param taskGeneratorContext generator context + * @param jobBuilderManager job builder manager + * @return generator + */ + @Bean(initMethod = "init") + @ConditionalOnMissingBean(TaskGenerator.class) + public AbstractTaskGenerator taskGenerator(TaskGeneratorContext taskGeneratorContext, + ExchangisJobBuilderManager jobBuilderManager, List generateListeners){ + AbstractTaskGenerator taskGenerator = new DefaultTaskGenerator(taskGeneratorContext, jobBuilderManager); + Optional.ofNullable(generateListeners).ifPresent(listeners -> listeners.forEach(taskGenerator::addListener)); + return taskGenerator; + } + + @Bean + @ConditionalOnMissingBean(ExecutorManager.class) + public ExecutorManager executorManagerInScheduler(){ + return new ExchangisSchedulerExecutorManager(); + } + + @Bean + @ConditionalOnMissingBean(ConsumerManager.class) + public ConsumerManager consumerManager(){ + return new TenancyParallelConsumerManager(); + } + + /** + * Task manager + * @param jobLogListener log listener + * @return + */ + @Bean + @ConditionalOnMissingBean(TaskManager.class) + public AbstractTaskManager taskManager(JobLogListener jobLogListener){ + return new DefaultTaskManager(jobLogListener); + } + + /** + * Task scheduler + * @param executorManager executor manager + * @param consumerManager consumer manage + * @return scheduler + */ + @Bean(initMethod = "init") + @ConditionalOnMissingBean(Scheduler.class) + public Scheduler scheduler(ExecutorManager executorManager, ConsumerManager consumerManager){ + return new ExchangisGenericScheduler(executorManager, consumerManager); + } + + /** + * Flexible tenancy load balancer + * @param scheduler scheduler + * @param taskManager task manager + * @return + */ + @Bean + @ConditionalOnMissingBean(TaskSchedulerLoadBalancer.class) + public AbstractTaskSchedulerLoadBalancer taskSchedulerLoadBalancer(Scheduler scheduler, + TaskManager taskManager){ + return new FlexibleTenancyLoadBalancer(scheduler, taskManager); + } + + /** + * Task launch manager + * @return + */ + @Bean(initMethod = "init") + @ConditionalOnMissingBean(ExchangisTaskLaunchManager.class) + public ExchangisTaskLaunchManager taskLaunchManager(){ + return new LinkisExchangisTaskLaunchManager(); + } + + /** + * Choose rule + * @return + */ + @Bean + @ConditionalOnMissingBean(TaskChooseRuler.class) + public TaskChooseRuler taskChooseRuler(){ + return new MaxUsageTaskChooseRuler(); + } + /** + * Task execution + * @param scheduler scheduler + * @param launchManager launch manager + * @param taskManager task manager + * @param observers observers + * @param loadBalancer load balancer + * @param taskChooseRuler ruler + * @return task execution + */ + @Bean(initMethod = "start", destroyMethod = "stop") + @ConditionalOnMissingBean(TaskExecution.class) + public AbstractTaskExecution taskExecution(Scheduler scheduler, ExchangisTaskLaunchManager launchManager, + TaskManager taskManager, List> observers, + TaskSchedulerLoadBalancer loadBalancer, + TaskChooseRuler taskChooseRuler, List executionListeners){ + AbstractTaskExecution taskExecution = new DefaultTaskExecution(scheduler, launchManager, taskManager, observers, loadBalancer, taskChooseRuler); + ConsumerManager consumerManager = scheduler.getSchedulerContext().getOrCreateConsumerManager(); + if (consumerManager instanceof TenancyParallelConsumerManager){ + ((TenancyParallelConsumerManager) consumerManager).setInitResidentThreads(observers.size() + + (Objects.nonNull(loadBalancer)? 1: 0)); + } + Optional.ofNullable(executionListeners).ifPresent(listeners -> listeners.forEach(taskExecution::addListener)); + return taskExecution; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/JobParamConstraints.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/JobParamConstraints.java new file mode 100644 index 000000000..b5a65807d --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/JobParamConstraints.java @@ -0,0 +1,32 @@ +package com.webank.wedatasphere.exchangis.job.server.builder; + +/** + * Contains the common name of job parameters + */ +public class JobParamConstraints { + + public static final String DATA_SOURCE_ID = "data_source_id"; + + public static final String USERNAME = "username"; + + public static final String PASSWORD = "password"; + + public static final String DATABASE = "database"; + + public static final String CONNECT_PARAMS = "params"; + + public static final String TABLE = "table"; + + public static final String HOST = "host"; + + public static final String PORT = "port"; + + public static final String WHERE = "where"; + + public static final String WRITE_MODE = "writeMode"; + + public static final String PARTITION = "partition"; + + public static final String SETTINGS_MAX_PARALLEL = "setting.max.parallelism"; + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/ServiceInExchangisJobBuilderContext.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/ServiceInExchangisJobBuilderContext.java new file mode 100644 index 000000000..2f73f7ca0 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/ServiceInExchangisJobBuilderContext.java @@ -0,0 +1,76 @@ +package com.webank.wedatasphere.exchangis.job.server.builder; + +import com.webank.wedatasphere.exchangis.datasource.core.service.MetadataInfoService; +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.builder.api.ExchangisJobBuilder; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.listener.JobLogListener; +import com.webank.wedatasphere.exchangis.job.listener.events.JobLogEvent; +import com.webank.wedatasphere.exchangis.job.server.log.JobServerLogging; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Objects; + +/** + * Service in job builder context + */ +public class ServiceInExchangisJobBuilderContext extends ExchangisJobBuilderContext { + + /** + * Meta info service + */ + private MetadataInfoService metadataInfoService; + + /** + * Job execution id + */ + private String jobExecutionId; + + /** + * Logging + */ + private JobServerLogging> logging; + + public ServiceInExchangisJobBuilderContext(ExchangisJobInfo originalJob, + JobLogListener jobLogListener) { + super(originalJob); + this.logging = new JobServerLogging>() { + @Override + public Logger getLogger() { + return Objects.nonNull(currentBuilder)? + LoggerFactory.getLogger(currentBuilder.getClass()) : null; + } + + @Override + public JobLogListener getJobLogListener() { + return jobLogListener; + } + + @Override + public JobLogEvent getJobLogEvent(JobLogEvent.Level level, ExchangisJobBuilder builder, String message, Object... args) { + return new JobLogEvent(level, originalJob.getExecuteUser(), jobExecutionId, message, args); + } + }; + } + + public String getJobExecutionId() { + return jobExecutionId; + } + + public void setJobExecutionId(String jobExecutionId) { + this.jobExecutionId = jobExecutionId; + } + + public MetadataInfoService getMetadataInfoService() { + return metadataInfoService; + } + + public void setMetadataInfoService(MetadataInfoService metadataInfoService) { + this.metadataInfoService = metadataInfoService; + } + + public JobServerLogging> getLogging() { + return logging; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/SpringExchangisJobBuilderManager.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/SpringExchangisJobBuilderManager.java new file mode 100644 index 000000000..2ce3aec40 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/SpringExchangisJobBuilderManager.java @@ -0,0 +1,37 @@ +package com.webank.wedatasphere.exchangis.job.server.builder; + +import com.webank.wedatasphere.exchangis.job.builder.manager.DefaultExchangisJobBuilderManager; +import com.webank.wedatasphere.exchangis.job.launcher.builder.LinkisExchangisLauncherJobBuilder; +import com.webank.wedatasphere.exchangis.job.server.builder.engine.DataxExchangisEngineJobBuilder; +import com.webank.wedatasphere.exchangis.job.server.builder.engine.DefaultExchangisEngineJobBuilder; +import com.webank.wedatasphere.exchangis.job.server.builder.engine.SqoopExchangisEngineJobBuilder; +import com.webank.wedatasphere.exchangis.job.server.builder.transform.GenericExchangisTransformJobBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Builder manager of spring context + */ +public class SpringExchangisJobBuilderManager extends DefaultExchangisJobBuilderManager { + + private static final Logger LOG = LoggerFactory.getLogger(SpringExchangisJobBuilderManager.class); + + public void init(){ + //TransformJobBuilder + GenericExchangisTransformJobBuilder transformJobBuilder = new GenericExchangisTransformJobBuilder(); + LOG.info("Init to load job handlers in [" + transformJobBuilder.getClass().getSimpleName() + "]"); + transformJobBuilder.initHandlers(); + //EngineJobBuilder + DefaultExchangisEngineJobBuilder engineJobBuilder = new DefaultExchangisEngineJobBuilder(); + DataxExchangisEngineJobBuilder dataxExchangisEngineJobBuilder = new DataxExchangisEngineJobBuilder(); + SqoopExchangisEngineJobBuilder sqoopExchangisEngineJobBuilder = new SqoopExchangisEngineJobBuilder(); + //LaunchJobBuilder + LinkisExchangisLauncherJobBuilder linkisExchangisLauncherJobBuilder = new LinkisExchangisLauncherJobBuilder(); + super.addJobBuilder(transformJobBuilder); + super.addJobBuilder(engineJobBuilder); + super.addJobBuilder(dataxExchangisEngineJobBuilder); + super.addJobBuilder(sqoopExchangisEngineJobBuilder); + super.addJobBuilder(linkisExchangisLauncherJobBuilder); + super.initBuilderChains(); + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/AbstractLoggingExchangisJobBuilder.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/AbstractLoggingExchangisJobBuilder.java new file mode 100644 index 000000000..26b1bc672 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/AbstractLoggingExchangisJobBuilder.java @@ -0,0 +1,52 @@ +package com.webank.wedatasphere.exchangis.job.server.builder.engine; + +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.builder.api.AbstractExchangisJobBuilder; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisBase; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJob; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.server.builder.ServiceInExchangisJobBuilderContext; + +/** + * Abstract implement for engine job builder + */ +public abstract class AbstractLoggingExchangisJobBuilder extends + AbstractExchangisJobBuilder { + + /** + * Get builder context + * @return context + * @throws ExchangisJobException.Runtime exception + */ + protected static ServiceInExchangisJobBuilderContext getServiceInBuilderContext() throws ExchangisJobException.Runtime{ + ExchangisJobBuilderContext context = getCurrentBuilderContext(); + if (!(context instanceof ServiceInExchangisJobBuilderContext)) { + throw new ExchangisJobException.Runtime(-1, "The job builder context cannot not be casted to " + ServiceInExchangisJobBuilderContext.class.getCanonicalName(), null); + } + return (ServiceInExchangisJobBuilderContext)context; + } + + /** + * Warn message + * @param message message + */ + public static void warn(String message, Object... args){ + getServiceInBuilderContext().getLogging().warn(null, message, args); + } + + public static void warn(String message, Throwable t){ + getServiceInBuilderContext().getLogging().warn(null, message, t); + } + + /** + * Info message + * @param message message + */ + public static void info(String message, Object... args){ + getServiceInBuilderContext().getLogging().info(null, message, args); + } + + public static void info(String message, Throwable t){ + getServiceInBuilderContext().getLogging().info(null, message, t); + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DataxExchangisEngineJob.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DataxExchangisEngineJob.java new file mode 100644 index 000000000..89934dd2e --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DataxExchangisEngineJob.java @@ -0,0 +1,20 @@ +package com.webank.wedatasphere.exchangis.job.server.builder.engine; + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisEngineJob; + +/** + * Datax engine job + */ +public class DataxExchangisEngineJob extends ExchangisEngineJob { + + private static final String CODE_NAME = "code"; + + + public String getCode() { + return String.valueOf(super.getJobContent().get(CODE_NAME)); + } + + public void setCode(String code) { + super.getJobContent().put(CODE_NAME, code); + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DataxExchangisEngineJobBuilder.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DataxExchangisEngineJobBuilder.java new file mode 100644 index 000000000..97026d83e --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DataxExchangisEngineJobBuilder.java @@ -0,0 +1,720 @@ +package com.webank.wedatasphere.exchangis.job.server.builder.engine; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.builder.api.AbstractExchangisJobBuilder; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisEngineJob; +import com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParam; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParamDefine; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParamSet; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParams; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode; +import com.webank.wedatasphere.exchangis.job.server.utils.JsonEntity; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.manager.label.utils.LabelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.*; +import java.util.function.BiFunction; + +import static com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob.*; + +public class DataxExchangisEngineJobBuilder extends AbstractExchangisJobBuilder { + + private static final Logger LOG = LoggerFactory.getLogger(DataxExchangisEngineJob.class); + + /** + * Mapping params + */ + private static final JobParamDefine>> TRANSFORM_MAPPING = JobParams.define("mapping"); + + /** + * Source params for column + */ + private static final JobParamDefine SOURCE_FIELD_NAME = JobParams.define("name", "source_field_name", String.class); + private static final JobParamDefine SOURCE_FIELD_TYPE = JobParams.define("type", "source_field_type", String.class); + private static final JobParamDefine SOURCE_FIELD_INDEX = JobParams.define("index", "source_field_index", Integer.class); + + /** + * Sink params for column + */ + private static final JobParamDefine SINK_FIELD_NAME = JobParams.define("name", "sink_field_name", String.class); + private static final JobParamDefine SINK_FIELD_TYPE = JobParams.define("type", "sink_field_type", String.class); + private static final JobParamDefine SINK_FIELD_INDEX = JobParams.define("index", "sink_field_index", Integer.class); + + private static final JobParamDefine>> SOURCE_COLUMN = JobParams.define("column", (BiFunction>>) (key, paramSet) -> { + + List> columns = new ArrayList<>(); + List> mappings = TRANSFORM_MAPPING.newParam(paramSet).getValue(); + if (Objects.nonNull(mappings)) { + mappings.forEach(mapping -> { + Map _mapping = new HashMap<>(mapping); + Map column = new HashMap<>(); + columns.add(column); + column.put(SOURCE_FIELD_NAME.getKey(), SOURCE_FIELD_NAME.newParam(_mapping).getValue()); + column.put(SOURCE_FIELD_TYPE.getKey(), SOURCE_FIELD_TYPE.newParam(_mapping).getValue()); + column.put(SOURCE_FIELD_INDEX.getKey(), SOURCE_FIELD_INDEX.newParam(_mapping).getValue()); + }); + } + return columns; + }); + + private static final JobParamDefine>> SINK_COLUMN = JobParams.define("column", (BiFunction>>) (key, paramSet) -> { + List> columns = new ArrayList<>(); + List> mappings = TRANSFORM_MAPPING.newParam(paramSet).getValue(); + if (Objects.nonNull(mappings)) { + mappings.forEach(mapping -> { + Map _mapping = new HashMap<>(mapping); + Map column = new HashMap<>(); + columns.add(column); + column.put(SINK_FIELD_NAME.getKey(), SINK_FIELD_NAME.newParam(_mapping).getValue()); + column.put(SINK_FIELD_TYPE.getKey(), SINK_FIELD_TYPE.newParam(_mapping).getValue()); + column.put(SINK_FIELD_INDEX.getKey(), SINK_FIELD_INDEX.newParam(_mapping).getValue()); + }); + } + return columns; + }); + + private static final JobParamDefine> TRANSFORMER = JobParams.define("column", (BiFunction>) (key, paramSet) -> { + List transformers = new ArrayList<>(); + List> mappings = TRANSFORM_MAPPING.newParam(paramSet).getValue(); + if (Objects.nonNull(mappings)) { + mappings.forEach(mapping -> { + Map _mapping = new HashMap<>(mapping); + int fieldIndex = SOURCE_FIELD_INDEX.newParam(_mapping).getValue(); + Object validator = mapping.get("validator"); + if (null != validator) { + List params = (List) validator; + if (params.size() > 0) { + Transformer transformer = new Transformer(); + transformer.setName("dx_filter"); + TransformerParameter parameter = new TransformerParameter(); + parameter.setColumnIndex(fieldIndex); + parameter.setParas(params.toArray(new String[0])); + transformer.setParameter(parameter); + transformers.add(transformer); + } + } + + Object transfomer = mapping.get("transformer"); + if (null != transfomer) { + Map define = (Map) transfomer; + if (null != define.get("name") && !StringUtils.isBlank(define.get("name").toString())) { + Transformer transformer = new Transformer(); + transformer.setName(define.get("name").toString()); + TransformerParameter parameter = new TransformerParameter(); + parameter.setColumnIndex(fieldIndex); + parameter.setParas(new String[0]); + Object params = define.get("params"); + if (null != params) { + List paramsDefine = (List) params; + if (null != paramsDefine && paramsDefine.size() > 0) { + parameter.setParas(paramsDefine.toArray(new String[0])); + } + } + transformer.setParameter(parameter); + transformers.add(transformer); + } + } + }); + } + return transformers; + }); + + @Override + public int priority() { + return 1; + } + + @Override + public boolean canBuild(SubExchangisJob inputJob) { + return "datax".equalsIgnoreCase(inputJob.getEngineType()); + } + + @Override + public DataxExchangisEngineJob buildJob(SubExchangisJob inputJob, ExchangisEngineJob expectOut, ExchangisJobBuilderContext ctx) throws ExchangisJobException { + + try { + DataxExchangisEngineJob engineJob = new DataxExchangisEngineJob(); + engineJob.setId(inputJob.getId()); + + DataxCode dataxCode = buildDataxCode(inputJob, ctx); + + engineJob.setCode(Json.toJson(dataxCode, null)); + try { + LOG.info("Datax-code built complete, output: " + Json.getMapper().writerWithDefaultPrettyPrinter().writeValueAsString(dataxCode)); + } catch (JsonProcessingException e) { + //Ignore + } + if (Objects.nonNull(expectOut)) { + engineJob.setName(expectOut.getName()); + engineJob.setEngineType(expectOut.getEngineType()); + } + + engineJob.setRuntimeParams(inputJob.getParamsToMap(SubExchangisJob.REALM_JOB_SETTINGS, false)); + engineJob.setName(inputJob.getName()); + if (Objects.nonNull(expectOut)) { + engineJob.setName(expectOut.getName()); + engineJob.setEngineType(expectOut.getEngineType()); + } + engineJob.setCreateUser(inputJob.getCreateUser()); + return engineJob; + + } catch (Exception e) { + throw new ExchangisJobException(ExchangisJobExceptionCode.ENGINE_JOB_ERROR.getCode(), + "Fail to build datax engine job, message:[" + e.getMessage() + "]", e); + } + } + + /** + * Datax code + * + * @param inputJob input job + * @return code + */ + private DataxCode buildDataxCode(SubExchangisJob inputJob, ExchangisJobBuilderContext ctx) { + + DataxCode code = new DataxCode(); + String sourceType = inputJob.getSourceType(); + String sinkType = inputJob.getSinkType(); + Content content = new Content(); + if (sourceType.equalsIgnoreCase("mysql")) { + content.getReader().putAll(this.buildMySQLReader(inputJob, ctx)); + } + if (sourceType.equalsIgnoreCase("hive")) { + content.getReader().putAll(this.buildHiveReader(inputJob, ctx)); + } + if (sinkType.equalsIgnoreCase("mysql")) { + content.getWriter().putAll(this.buildMySQLWriter(inputJob, ctx)); + } + if (sinkType.equalsIgnoreCase("hive")) { + content.getWriter().putAll(this.buildHiveWriter(inputJob, ctx)); + } + + content.getTransformer().addAll(this.buildTransformer(inputJob, ctx)); + + code.getContent().add(content); + code.getSetting().putAll(this.buildSettings(inputJob, ctx)); + + //To construct settings +// JobParamSet paramSet = inputJob.getRealmParams(SubExchangisJob.REALM_JOB_SETTINGS); +// if (Objects.nonNull(paramSet)) { +// JsonConfiguration setting = JsonConfiguration.from(code.getSetting()); +// paramSet.toList().forEach(param -> setting.set(param.getStrKey(), param.getValue())); +// code.setSetting(setting.toMap()); +// } + +// //To construct content +// Content content1 = new Content(); +// JobParamSet transformJobParamSet = inputJob.getRealmParams(SubExchangisJob.REALM_JOB_COLUMN_MAPPING); +// paramSet = inputJob.getRealmParams(SubExchangisJob.REALM_JOB_CONTENT_SOURCE); +// JsonConfiguration reader = JsonConfiguration.from(content1.getReader()); +// if(Objects.nonNull(paramSet)){ +// if (StringUtils.isNotBlank(inputJob.getSourceType())){ +// reader.set("name", inputJob.getSourceType().toLowerCase() + "reader"); +// reader.set("parameter", buildContentParam(paramSet, transformJobParamSet, SOURCE_COLUMN)); +// content1.setReader(reader.toMap()); +// } +// } +// paramSet = inputJob.getRealmParams(SubExchangisJob.REALM_JOB_CONTENT_SINK); +// JsonConfiguration writer = JsonConfiguration.from(content1.getReader()); +// if(Objects.nonNull(paramSet)){ +// if (StringUtils.isNotBlank(inputJob.getSinkType())){ +// writer.set("name", inputJob.getSinkType().toLowerCase() + "writer"); +// writer.set("parameter", buildContentParam(paramSet, transformJobParamSet, SINK_COLUMN)); +// content1.setWriter(writer.toMap()); +// } +// } + return code; + } + + private Map buildContentParam(JobParamSet paramSet, JobParamSet transformJobParamSet, + JobParamDefine>> columnJobParamDefine) { + JsonEntity item = JsonEntity.from("{}"); + //Ignore temp params + paramSet.toList(false).forEach(param -> item.set(param.getStrKey(), param.getValue())); + if (Objects.nonNull(transformJobParamSet)) { + item.set(columnJobParamDefine.getKey(), columnJobParamDefine.newParam(transformJobParamSet).getValue()); + } + return item.toMap(); + } + + private Map buildMySQLReader(SubExchangisJob inputJob, ExchangisJobBuilderContext ctx) { + Map reader = new HashMap<>(); + reader.put("name", "mysqlreader"); + + JobParamSet sourceSettings = inputJob.getRealmParams(REALM_JOB_CONTENT_SOURCE); + + Map parameter = new HashMap<>(); + parameter.put("connParams", new HashMap()); + parameter.put("haveKerberos", false); + parameter.put("datasource", Integer.parseInt(sourceSettings.get("datasource").getValue().toString())); + + parameter.put("username", ctx.getDatasourceParam(sourceSettings.get("datasource").getValue().toString()).get("username")); + String password = ctx.getDatasourceParam(sourceSettings.get("datasource").getValue().toString()).get("password").toString(); + parameter.put("password", password); + List> columns = SOURCE_COLUMN.newParam(inputJob.getRealmParams(REALM_JOB_COLUMN_MAPPING)).getValue(); + parameter.put("column_i", columns); + parameter.put("alias", "[\"A\"]"); + + List> connections = new ArrayList<>(1); + Map connection = new HashMap<>(); + Object host = ctx.getDatasourceParam(sourceSettings.get("datasource").getValue().toString()).get("host"); + Object port = ctx.getDatasourceParam(sourceSettings.get("datasource").getValue().toString()).get("port"); + Object database = sourceSettings.get("database").getValue(); + List> jdbcUrls = new ArrayList<>(); + Map jdbcUrl = new HashMap<>(); + jdbcUrl.put("host", host); + jdbcUrl.put("port", port); + jdbcUrl.put("database", database); + jdbcUrls.add(jdbcUrl); + connection.put("jdbcUrl", jdbcUrls); + + parameter.put("authType", "DEFAULT"); + + List tables = new ArrayList<>(); + tables.add(sourceSettings.get("table").getValue().toString()); + // connection.put("table", tables); + parameter.put("table", LabelUtils.Jackson.toJson(tables, String.class)); + + StringBuilder sql = new StringBuilder("SELECT "); + for (Iterator> iterator = columns.iterator(); iterator.hasNext(); ) { + Map field = iterator.next(); + sql.append("A.").append(field.get("name")); + if (iterator.hasNext()) { + sql.append(", "); + } else { + sql.append(" "); + } + } + + sql.append("FROM ").append(sourceSettings.get("table").getValue().toString()).append(" A"); + + if (null != sourceSettings.get("exchangis.job.ds.params.datax.mysql.r.where_condition") + && null != sourceSettings.get("exchangis.job.ds.params.datax.mysql.r.where_condition").getValue() + && StringUtils.isNotBlank(sourceSettings.get("exchangis.job.ds.params.datax.mysql.r.where_condition").getValue().toString())) { + sql.append(" WHERE ").append(sourceSettings.get("exchangis.job.ds.params.datax.mysql.r.where_condition").getValue().toString()); + } + + List querySql = new ArrayList<>(); + querySql.add(sql.toString()); + connection.put("querySql", querySql); + + connections.add(connection); + parameter.put("connection", connections); + + reader.put("parameter", parameter); + return reader; + } + + private Map buildMySQLWriter(SubExchangisJob inputJob, ExchangisJobBuilderContext ctx) { + Map writer = new HashMap<>(); + writer.put("name", "mysqlwriter"); + Map parameter = new HashMap<>(); + parameter.put("haveKerberos", false); + parameter.put("connParams", new HashMap()); + + JobParamSet sinkSettings = inputJob.getRealmParams(REALM_JOB_CONTENT_SINK); + parameter.put("datasource", Integer.parseInt(sinkSettings.get("datasource").getValue().toString())); + parameter.put("authType", "DEFAULT"); + parameter.put("username", ctx.getDatasourceParam(sinkSettings.get("datasource").getValue().toString()).get("username")); + String password = ctx.getDatasourceParam(sinkSettings.get("datasource").getValue().toString()).get("password").toString(); + // parameter.put("password", Base64.getEncoder().encodeToString(password.getBytes(StandardCharsets.UTF_8))); + parameter.put("password", password); + + List> columns = SINK_COLUMN.newParam(inputJob.getRealmParams(REALM_JOB_COLUMN_MAPPING)).getValue(); + parameter.put("column_i", columns); + parameter.put("column", columns.stream().map(map -> map.get("name")).toArray()); + + List> connections = new ArrayList<>(1); + Map connection = new HashMap<>(); + String connectProtocol = "jdbc:mysql://"; + Object host = ctx.getDatasourceParam(sinkSettings.get("datasource").getValue().toString()).get("host"); + Object port = ctx.getDatasourceParam(sinkSettings.get("datasource").getValue().toString()).get("port"); + Object database = sinkSettings.get("database").getValue(); + Map jdbcUrl = new HashMap<>(); + jdbcUrl.put("host", host); + jdbcUrl.put("port", port); + jdbcUrl.put("database", database); + connection.put("jdbcUrl", jdbcUrl); + List tables = new ArrayList<>(); + tables.add(sinkSettings.get("table").getValue().toString()); + connection.put("table", tables); + connections.add(connection); + parameter.put("connection", connections); + + parameter.put("writeMode", sinkSettings.get("exchangis.job.ds.params.datax.mysql.w.write_type").getValue().toString().toLowerCase(Locale.ROOT)); + + writer.put("parameter", parameter); + return writer; + } + + private Map buildHiveReader(SubExchangisJob inputJob, ExchangisJobBuilderContext ctx) { + Map reader = new HashMap<>(); + reader.put("name", "hdfsreader"); + + Map parameter = new HashMap<>(); + parameter.put("nullFormat", "\\\\N"); + parameter.put("haveKerberos", false); + parameter.put("hadoopConfig", new HashMap()); + parameter.put("authType", "NONE"); + + JobParamSet sourceSettings = inputJob.getRealmParams(REALM_JOB_CONTENT_SOURCE); + parameter.put("hiveTable", sourceSettings.get("table").getValue().toString()); + parameter.put("hiveDatabase", sourceSettings.get("database").getValue()); + parameter.put("encoding", "UTF-8"); + parameter.put("datasource", Integer.parseInt(sourceSettings.get("datasource").getValue().toString())); + try { + String location = ctx.getDatasourceParam(sourceSettings.get("datasource").getValue().toString()).get("location").toString(); + URI uri = new URI(location); + if (uri.getPort() != -1) { + parameter.put("defaultFS", String.format("%s://%s:%d", uri.getScheme(), uri.getHost(), uri.getPort())); + } else { + parameter.put("defaultFS", String.format("%s://%s", uri.getScheme(), uri.getHost())); + } + parameter.put("path", uri.getPath()); + + } catch (URISyntaxException e) { + e.printStackTrace(); + } + + List> columns = SOURCE_COLUMN.newParam(inputJob.getRealmParams(REALM_JOB_COLUMN_MAPPING)).getValue(); + + // column +// List> columns = new ArrayList<>(); +// String[] columnsType = ctx.getDatasourceParam(sourceSettings.get("datasource").getValue().toString()).get("columns-types").toString().split(":"); +// for (int i = 0; i < columnsType.length; i++) { +// Map column = new HashMap<>(); +// column.put("index", i); +// column.put("type", columnsType[i]); +// columns.add(column); +// } + parameter.put("column", columns); + + + String inputFormat = ctx.getDatasourceParam(sourceSettings.get("datasource").getValue().toString()).get("file-inputformat").toString().toLowerCase(Locale.ROOT); + // org.apache.hadoop.mapred.TextInputFormat + if (inputFormat.contains("text")) { + parameter.put("fileType", "TEXT"); + parameter.put("fieldDelimiter", ctx.getDatasourceParam(sourceSettings.get("datasource").getValue().toString()).get("column-name-delimiter").toString()); + } + if (inputFormat.contains("orc")) { + parameter.put("fileType", "ORC"); + } + if (inputFormat.contains("parquet")) { + parameter.put("fileType", "PARQUET"); + } + if (inputFormat.contains("rcfile")) { + parameter.put("fileType", "RCFILE"); + } + if (inputFormat.contains("sequencefile")) { + parameter.put("fileType", "SEQ"); + parameter.put("fieldDelimiter", ctx.getDatasourceParam(sourceSettings.get("datasource").getValue().toString()).get("column-name-delimiter").toString()); + } + + parameter.put("hiveMetastoreUris", ctx.getDatasourceParam(sourceSettings.get("datasource").getValue().toString()).get("uris").toString()); + + reader.put("parameter", parameter); + return reader; + } + + private Map buildHiveWriter(SubExchangisJob inputJob, ExchangisJobBuilderContext ctx) { + Map writer = new HashMap<>(); + writer.put("name", "hdfswriter"); + Map parameter = new HashMap<>(); + + JobParamSet sinkSettings = inputJob.getRealmParams(REALM_JOB_CONTENT_SINK); + parameter.put("nullFormat", "\\\\N"); + parameter.put("encoding", "UTF-8"); + parameter.put("hiveTable", sinkSettings.get("table").getValue().toString()); + parameter.put("hiveDatabase", sinkSettings.get("database").getValue().toString()); + parameter.put("authType", "NONE"); + parameter.put("hadoopConfig", new HashMap()); + parameter.put("haveKerberos", false); + parameter.put("fileName", "exchangis_hive_w"); + parameter.put("datasource", Integer.parseInt(sinkSettings.get("datasource").getValue().toString())); + try { + String location = ctx.getDatasourceParam(sinkSettings.get("datasource").getValue().toString()).get("location").toString(); + URI uri = new URI(location); + if (uri.getPort() != -1) { + parameter.put("defaultFS", String.format("%s://%s:%d", uri.getScheme(), uri.getHost(), uri.getPort())); + } else { + parameter.put("defaultFS", String.format("%s://%s", uri.getScheme(), uri.getHost())); + } + parameter.put("path", uri.getPath()); + } catch (URISyntaxException e) { + e.printStackTrace(); + } + + parameter.put("compress", "GZIP"); + + List> columns = SINK_COLUMN.newParam(inputJob.getRealmParams(REALM_JOB_COLUMN_MAPPING)).getValue(); + + // column +// List> columns = new ArrayList<>(); +// String[] columnsType = ctx.getDatasourceParam(sinkSettings.get("datasource").getValue().toString()).get("columns-types").toString().split(":"); +// for (int i = 0; i < columnsType.length; i++) { +// Map column = new HashMap<>(); +// column.put("index", i); +// column.put("type", columnsType[i]); +// columns.add(column); +// } + parameter.put("column", columns); + + String inputFormat = ctx.getDatasourceParam(sinkSettings.get("datasource").getValue().toString()).get("file-inputformat").toString().toLowerCase(Locale.ROOT); + // org.apache.hadoop.mapred.TextInputFormat + if (inputFormat.contains("text")) { + parameter.put("fileType", "text"); + parameter.put("fieldDelimiter", ctx.getDatasourceParam(sinkSettings.get("datasource").getValue().toString()).get("column-name-delimiter").toString()); + } + if (inputFormat.contains("orc")) { + parameter.put("fileType", "orc"); + } + if (inputFormat.contains("parquet")) { + parameter.put("fileType", "parquet"); + } + if (inputFormat.contains("rcfile")) { + parameter.put("fileType", "rcfile"); + } + if (inputFormat.contains("sequencefile")) { + parameter.put("fileType", "seq"); + parameter.put("fieldDelimiter", ctx.getDatasourceParam(sinkSettings.get("datasource").getValue().toString()).get("column-name-delimiter").toString()); + } + + parameter.put("fileName", sinkSettings.get("table").getValue().toString()); + + String writeMdoe = sinkSettings.get("exchangis.job.ds.params.datax.hive.w.write_type").getValue().toString(); + if (writeMdoe.equals("清空目录")) { + parameter.put("writeMode", "truncate"); + } else { + parameter.put("writeMode", "append"); + } + + parameter.put("hiveMetastoreUris", ctx.getDatasourceParam(sinkSettings.get("datasource").getValue().toString()).get("uris").toString()); + + writer.put("parameter", parameter); + return writer; + } + + private List buildTransformer(SubExchangisJob inputJob, ExchangisJobBuilderContext ctx) { + List transformers = TRANSFORMER.newParam(inputJob.getRealmParams(REALM_JOB_COLUMN_MAPPING)).getValue(); + return transformers; + } + + private Map buildSettings(SubExchangisJob inputJob, ExchangisJobBuilderContext ctx) { + Map settings = new HashMap<>(); + settings.put("useProcessor", "false"); + + JobParamSet sourceSettings = inputJob.getRealmParams(REALM_JOB_CONTENT_SOURCE); + JobParamSet sinkSettings = inputJob.getRealmParams(REALM_JOB_CONTENT_SINK); + if (inputJob.getSinkType().equalsIgnoreCase("hive")) { + if (null != sinkSettings.get("exchangis.job.ds.params.datax.hive.w.sync_meta") + && null != sinkSettings.get("exchangis.job.ds.params.datax.hive.w.sync_meta").getValue() + && "是".equals(sinkSettings.get("exchangis.job.ds.params.datax.hive.w.sync_meta").getValue().toString())) { + settings.put("syncMeta", "true"); + } else { + settings.put("syncMeta", "false"); + } + } + + if (inputJob.getSourceType().equalsIgnoreCase("hive")) { + Map transport = new HashMap<>(); + if (null != sinkSettings.get("exchangis.job.ds.params.datax.hive.r.trans_proto") + && null != sinkSettings.get("exchangis.job.ds.params.datax.hive.r.trans_proto").getValue() + && "二进制".equals(sinkSettings.get("exchangis.job.ds.params.datax.hive.r.trans_proto").getValue().toString())) { + transport.put("type", "stream"); + } else { + transport.put("type", "record"); + } + settings.put("transport", transport); + } + + JobParamSet jobSettings = inputJob.getRealmParams(SubExchangisJob.REALM_JOB_SETTINGS); + if (Objects.nonNull(jobSettings)) { + Map errorLimit = new HashMap<>(); + errorLimit.put("record", "0"); + if (null != jobSettings.get("exchangis.datax.setting.errorlimit.record")) { + JobParam _errorLimit = jobSettings.get("exchangis.datax.setting.errorlimit.record"); + if (null != _errorLimit && null != _errorLimit.getValue()) { + String value = _errorLimit.getValue().toString(); + if (StringUtils.isNotBlank(value)) { + errorLimit.put("record", value); + } + } + } + settings.put("errorLimit", errorLimit); + + Map advance = new HashMap<>(); + advance.put("mMemory", "1g"); + if (null != jobSettings.get("exchangis.datax.setting.max.memory")) { + JobParam _maxMemory = jobSettings.get("exchangis.datax.setting.max.memory"); + if (null != _maxMemory && null != _maxMemory.getValue()) { + String value = _maxMemory.getValue().toString(); + if (StringUtils.isNotBlank(value)) { + advance.put("mMemory", value + "m"); + } + } + } + + settings.put("advance", advance); + + Map speed = new HashMap<>(); + speed.put("byte", "10485760"); + speed.put("record", "0"); + speed.put("channel", "0"); + + if (null != jobSettings.get("exchangis.datax.setting.speed.bytes")) { + JobParam _byteSpeed = jobSettings.get("exchangis.datax.setting.speed.bytes"); + if (null != _byteSpeed && null != _byteSpeed.getValue()) { + String value = _byteSpeed.getValue().toString(); + if (StringUtils.isNotBlank(value)) { + speed.put("byte", String.valueOf(Integer.parseInt(value) * 1024)); + } + } + } + + if (null != jobSettings.get("exchangis.datax.setting.speed.records")) { + JobParam _recordSpeed = jobSettings.get("exchangis.datax.setting.speed.records"); + if (null != _recordSpeed && null != _recordSpeed.getValue()) { + String value = _recordSpeed.getValue().toString(); + if (StringUtils.isNotBlank(value)) { + speed.put("record", value); + } + } + } + + if (null != jobSettings.get("exchangis.datax.setting.max.parallelism")) { + JobParam _channel = jobSettings.get("exchangis.datax.setting.max.parallelism"); + if (null != _channel && null != _channel.getValue()) { + String value = _channel.getValue().toString(); + if (StringUtils.isNotBlank(value)) { + speed.put("channel", value); + } + } + } + + settings.put("speed", speed); + + } + + return settings; + } + + public static class DataxCode { + /** + * Setting + */ + private Map setting = new HashMap<>(); + + /** + * Content list + */ + private List content = new ArrayList<>(); + + public Map getSetting() { + return setting; + } + + public void setSetting(Map setting) { + this.setting = setting; + } + + public List getContent() { + return content; + } + + public void setContent(List content) { + this.content = content; + } + } + + public static class Content { + /** + * Reader + */ + private Map reader = new HashMap<>(); + /** + * Writer + */ + private Map writer = new HashMap<>(); + + private List transformer = new ArrayList<>(); + + public Map getReader() { + return reader; + } + + public void setReader(Map reader) { + this.reader = reader; + } + + public Map getWriter() { + return writer; + } + + public void setWriter(Map writer) { + this.writer = writer; + } + + + public List getTransformer() { + return transformer; + } + + public void setTransformer(List transformer) { + this.transformer = transformer; + } + } + + public static class Transformer { + + private TransformerParameter parameter; + private String name; + + public TransformerParameter getParameter() { + return parameter; + } + + public void setParameter(TransformerParameter parameter) { + this.parameter = parameter; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + } + + public static class TransformerParameter { + + private int columnIndex; + private String[] paras; + + public int getColumnIndex() { + return columnIndex; + } + + public void setColumnIndex(int columnIndex) { + this.columnIndex = columnIndex; + } + + public String[] getParas() { + return paras; + } + + public void setParas(String[] paras) { + this.paras = paras; + } + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DefaultExchangisEngineJobBuilder.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DefaultExchangisEngineJobBuilder.java new file mode 100644 index 000000000..152e058bd --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DefaultExchangisEngineJobBuilder.java @@ -0,0 +1,45 @@ +package com.webank.wedatasphere.exchangis.job.server.builder.engine; + + +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.builder.api.AbstractExchangisJobBuilder; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisEngineJob; +import com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import org.apache.commons.lang.StringUtils; + +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +/** + * Default implements + */ +public class DefaultExchangisEngineJobBuilder extends AbstractExchangisJobBuilder { + + private static final String ENGINE_JOB_MEMORY_USED = "setting.max.memory"; + @Override + public int priority() { + return Integer.MIN_VALUE; + } + + @Override + public ExchangisEngineJob buildJob(SubExchangisJob inputJob, ExchangisEngineJob expectOut, ExchangisJobBuilderContext ctx) throws ExchangisJobException { + String paramsString = ctx.getOriginalJob().getJobParams(); + ExchangisEngineJob exchangisEngineJob = new ExchangisEngineJob(); + if (StringUtils.isNotBlank(paramsString)){ + Map jobParams = Json.fromJson(paramsString, Map.class); + if (Objects.nonNull(jobParams)){ + exchangisEngineJob.getJobContent().putAll(jobParams); + } + } + Map settings = inputJob.getParamsToMap(SubExchangisJob.REALM_JOB_SETTINGS, false); + Optional.ofNullable(settings.get(ENGINE_JOB_MEMORY_USED)).ifPresent(memoryUsed -> exchangisEngineJob.setMemoryUsed(Long.valueOf(String.valueOf(memoryUsed)))); + exchangisEngineJob.setRuntimeParams(settings); + exchangisEngineJob.setEngineType(ctx.getOriginalJob().getEngineType()); + exchangisEngineJob.setName(inputJob.getName()); + exchangisEngineJob.setJobLabel(ctx.getOriginalJob().getJobLabel()); + return exchangisEngineJob; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/SqoopExchangisEngineJob.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/SqoopExchangisEngineJob.java new file mode 100644 index 000000000..1ab5241d9 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/SqoopExchangisEngineJob.java @@ -0,0 +1,26 @@ +package com.webank.wedatasphere.exchangis.job.server.builder.engine; + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisEngineJob; + +import java.util.Objects; + +/** + * Sqoop engine job + */ +public class SqoopExchangisEngineJob extends ExchangisEngineJob { + //Empty + + public SqoopExchangisEngineJob(){ + + } + + public SqoopExchangisEngineJob(ExchangisEngineJob engineJob){ + if (Objects.nonNull(engineJob)) { + setName(engineJob.getName()); + setEngineType(engineJob.getEngineType()); + getJobContent().putAll(engineJob.getJobContent()); + getRuntimeParams().putAll(engineJob.getRuntimeParams()); + setMemoryUsed(engineJob.getMemoryUsed()); + } + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/SqoopExchangisEngineJobBuilder.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/SqoopExchangisEngineJobBuilder.java new file mode 100644 index 000000000..7ab5e2fd7 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/SqoopExchangisEngineJobBuilder.java @@ -0,0 +1,620 @@ +package com.webank.wedatasphere.exchangis.job.server.builder.engine; + +import com.webank.wedatasphere.exchangis.datasource.core.domain.MetaColumn; +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisDataSourceException; +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisEngineJob; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParam; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParamDefine; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParamSet; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParams; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode; +import com.webank.wedatasphere.exchangis.job.server.builder.JobParamConstraints; +import com.webank.wedatasphere.exchangis.job.server.builder.ServiceInExchangisJobBuilderContext; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.*; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.BiFunction; +import java.util.stream.Collectors; + +import static com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob.REALM_JOB_CONTENT_SINK; +import static com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob.REALM_JOB_CONTENT_SOURCE; +import static com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob.REALM_JOB_SETTINGS; +import static com.webank.wedatasphere.exchangis.job.server.builder.engine.SqoopExchangisEngineJobBuilder.MODE_TYPE.EXPORT; +import static com.webank.wedatasphere.exchangis.job.server.builder.engine.SqoopExchangisEngineJobBuilder.MODE_TYPE.IMPORT; + +public class SqoopExchangisEngineJobBuilder extends AbstractLoggingExchangisJobBuilder { + + private static final Logger LOG = LoggerFactory.getLogger(SqoopExchangisEngineJobBuilder.class); + + private static final List SUPPORT_BIG_DATA_TYPES = Arrays.asList("HIVE", "HBASE"); + + private static final List SUPPORT_RDBMS_TYPES = Arrays.asList("MYSQL", "ORACLE"); + + private static final String META_INPUT_FORMAT = "file.inputformat"; + + private static final String META_OUTPUT_FORMAT = "file.outputformat"; + + private static final String META_FIELD_DELIMITER = "field.delim"; + + /** + * //TODO To support different hadoop version + */ + private static final List HADOOP_TEXT_INPUT_FORMAT = Collections.singletonList("org.apache.hadoop.mapred.TextInputFormat"); + + private static final List HADOOP_TEXT_OUTPUT_FORMAT = Arrays.asList("org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat", + "org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat"); + + public enum MODE_TYPE { IMPORT, EXPORT} + /** + * Verbose, default null (means not open verbose) + */ + private static final JobParamDefine VERBOSE = JobParams.define("sqoop.args.verbose", (BiFunction) (k, job) -> null); + /** + * Sqoop mode + */ + private static final JobParamDefine MODE = JobParams.define("sqoop.mode", (BiFunction) (k, job) -> SUPPORT_BIG_DATA_TYPES.contains(job.getSourceType().toUpperCase())? "export": "import"); + + private static final JobParamDefine MODE_ENUM = JobParams.define("sqoop.mode.enum", (BiFunction) (k, job) -> SUPPORT_BIG_DATA_TYPES.contains(job.getSourceType().toUpperCase())? EXPORT: IMPORT); + /** + * Sqoop RDBMS mode params + */ + private static final JobParamDefine MODE_RDBMS_PARAMS = JobParams.define("sqoop.mode.rdbms.params", (BiFunction) (k, job) -> { + MODE_TYPE modeParam = MODE_ENUM.getValue(job); + return modeParam.equals(IMPORT)? job.getRealmParams(REALM_JOB_CONTENT_SOURCE) : job.getRealmParams(REALM_JOB_CONTENT_SINK); + }); + + /** + * Sqoop hadoop mode params + */ + private static final JobParamDefine MODE_HADOOP_PARAMS = JobParams.define("sqoop.mode.hadoop.params", (BiFunction) (k, job) -> { + MODE_TYPE modeParam = MODE_ENUM.getValue(job); + return modeParam.equals(IMPORT)? job.getRealmParams(REALM_JOB_CONTENT_SINK) : job.getRealmParams(REALM_JOB_CONTENT_SOURCE); + }); + + /** + * Hive-partition-map + */ + @SuppressWarnings("unchecked") + private static final JobParamDefine> PARTITION_MAP = JobParams.define("sqoop.partition.map", (BiFunction>) (k, job) -> { + if ("hive".equalsIgnoreCase(job.getSinkType()) || "hive".equalsIgnoreCase(job.getSourceType())){ + JobParam partitionParam = MODE_HADOOP_PARAMS.getValue(job).get(JobParamConstraints.PARTITION); + if (Objects.nonNull(partitionParam)) { + Object partition = partitionParam.getValue(); + if (partition instanceof Map) { + return (Map) partition; + } else { + String partitionStr = String.valueOf(partition); + if (StringUtils.isNotBlank(partitionStr)){ + Map partitionMap = new HashMap<>(); + String[] partValues = partitionStr.split(","); + for (String partValue : partValues){ + String[] parts = partValue.split("="); + if (parts.length == 2){ + partitionMap.put(parts[0], parts[1]); + } + } + return partitionMap; + } + } + } + } + return null; + }); + + /** + * Meta columns + */ + private static final JobParamDefine> META_COLUMNS = JobParams.define("sqoop.meta.table.columns", (BiFunction>) (k, paramSet) -> { + ServiceInExchangisJobBuilderContext context = getServiceInBuilderContext(); + JobParam dataSourceId = paramSet.get(JobParamConstraints.DATA_SOURCE_ID); + JobParam database = paramSet.get(JobParamConstraints.DATABASE, String.class); + JobParam table = paramSet.get(JobParamConstraints.TABLE, String.class); + try { + return context.getMetadataInfoService().getColumns(context.getOriginalJob().getCreateUser(), + Long.valueOf(dataSourceId.getValue()), database.getValue(), table.getValue()); + } catch (ExchangisDataSourceException e) { + throw new ExchangisJobException.Runtime(e.getErrCode(), e.getMessage(), e.getCause()); + } + }); + + /** + * Meta hadoop columns + */ + private static final JobParamDefine> META_HADOOP_COLUMNS = JobParams.define("sqoop.meta.hadoop.table.columns", (BiFunction>) (k, job) -> META_COLUMNS.newValue(MODE_HADOOP_PARAMS.getValue(job))); + + /** + * Meta rdbms columns + */ + private static final JobParamDefine> META_RDBMS_COLUMNS = JobParams.define("sqoop.meta.rdbms.table.columns", (BiFunction>) (k, job) -> META_COLUMNS.newValue(MODE_RDBMS_PARAMS.getValue(job))); + /** + * Meta table/partition props + */ + private static final JobParamDefine> META_HADOOP_TABLE_PROPS = JobParams.define("sqoop.meta.hadoop.table.props", (BiFunction>) (k, job) ->{ + ServiceInExchangisJobBuilderContext context = getServiceInBuilderContext(); + ExchangisJobInfo jobInfo = context.getOriginalJob(); + // Use the creator as userName + String userName = jobInfo.getCreateUser(); + JobParamSet hadoopParamSet = MODE_HADOOP_PARAMS.getValue(job); + JobParam dataSourceId = hadoopParamSet.get(JobParamConstraints.DATA_SOURCE_ID); + JobParam database = hadoopParamSet.get(JobParamConstraints.DATABASE, String.class); + JobParam table = hadoopParamSet.get(JobParamConstraints.TABLE, String.class); + Map partition = PARTITION_MAP.getValue(job); + try { + if (Objects.isNull(partition)) { + return context.getMetadataInfoService().getTableProps(userName, Long.valueOf(dataSourceId.getValue()), + database.getValue(), table.getValue()); + } else { + return context.getMetadataInfoService().getPartitionProps(userName, Long.valueOf(dataSourceId.getValue()), + database.getValue(), table.getValue(), URLEncoder.encode(partition.entrySet().stream().map(entry -> + entry.getKey() + "=" + entry.getValue() + ).collect(Collectors.joining(",")), "UTF-8")); + } + } catch (ExchangisDataSourceException e) { + throw new ExchangisJobException.Runtime(e.getErrCode(), e.getMessage(), e.getCause()); + } catch (UnsupportedEncodingException e) { + throw new ExchangisJobException.Runtime(-1, e.getMessage(), e); + } + }); + + private static final JobParamDefine IS_TEXT_FILE_TYPE = JobParams.define("sqoop.file.is.text", (BiFunction)(k, job) -> { + Map tableProps = META_HADOOP_TABLE_PROPS.getValue(job); + return HADOOP_TEXT_INPUT_FORMAT.contains(tableProps.getOrDefault(META_INPUT_FORMAT, "")) || + HADOOP_TEXT_OUTPUT_FORMAT.contains(tableProps.getOrDefault(META_OUTPUT_FORMAT, "")); + }); + /** + * + * Whether hcatalog + */ + private static final JobParamDefine IS_USE_HCATALOG = JobParams.define("sqoop.use.hcatalog", (BiFunction)(k, job) -> MODE_ENUM.getValue(job) == EXPORT || !IS_TEXT_FILE_TYPE.getValue(job)); + + /** + * Driver default 'com.mysql.jdbc.Driver' + */ + private static final JobParamDefine CONNECT_DRIVER = JobParams.define("sqoop.args.driver", (BiFunction)(k, job) -> "com.mysql.jdbc.Driver"); + + /** + * Protocol + */ + private static final JobParamDefine CONNECT_PROTOCOL = JobParams.define("sqoop.args.protocol", () -> "jdbc:mysql://%s:%s/%s"); + + /** + * Number of mapper + */ + private static final JobParamDefine NUM_MAPPERS = JobParams.define("sqoop.args.num.mappers", (BiFunction) (k, job) -> { + int numMappers = 1; + JobParamSet settings = job.getRealmParams(REALM_JOB_SETTINGS); + JobParam parallel = settings.get(JobParamConstraints.SETTINGS_MAX_PARALLEL); + if (Objects.nonNull(parallel)){ + Object value = parallel.getValue(); + try { + return Integer.parseInt(String.valueOf(value)); + }catch( NumberFormatException exception){ + //Ignore + } + } + return numMappers; + }); + + /** + * Connect string + */ + private static final JobParamDefine CONNECT_STRING = JobParams.define("sqoop.args.connect", (BiFunction) (k, job) -> { + JobParamSet paramSet = MODE_RDBMS_PARAMS.getValue(job); + String host = paramSet.get(JobParamConstraints.HOST, String.class).getValue(); + String database = paramSet.get(JobParamConstraints.DATABASE, String.class).getValue(); + JobParam connectParams = paramSet.get(JobParamConstraints.CONNECT_PARAMS, String.class); + Map paramsMap = null; + if (Objects.nonNull(connectParams)){ + paramsMap = Json.fromJson(connectParams.getValue(), Map.class); + } + Integer port = Integer.parseInt(String.valueOf(paramSet.get(JobParamConstraints.PORT).getValue())); + String connectStr = String.format(CONNECT_PROTOCOL.getValue(job), host, port, database); + if (Objects.nonNull(paramsMap) && !paramsMap.isEmpty()){ + connectStr += "?" + paramsMap.entrySet().stream().map(entry -> { + try { + return entry.getKey() + "=" + URLEncoder.encode(entry.getValue(), "UTF-8" ); + } catch (UnsupportedEncodingException e) { + return null; + } + }).filter(StringUtils::isNotBlank).collect(Collectors.joining("&")); + } + return connectStr; + }); + + /** + * Username + */ + private static final JobParamDefine USERNAME = JobParams.define("sqoop.args.username", (BiFunction) (k, job) -> + MODE_RDBMS_PARAMS.getValue(job).get(JobParamConstraints.USERNAME, String.class).getValue()); + + /** + * Password + */ + private static final JobParamDefine PASSWORD = JobParams.define("sqoop.args.password", (BiFunction) (k, job) -> + MODE_RDBMS_PARAMS.getValue(job).get(JobParamConstraints.PASSWORD, String.class).getValue()); + + /** + * Table + */ + private static final JobParamDefine TABLE = JobParams.define("sqoop.args.table", (BiFunction) (k, job) -> + MODE_RDBMS_PARAMS.getValue(job).get(JobParamConstraints.TABLE, String.class).getValue()); + + /** + * Import: Query string in params, //TODO where to use query + */ + private static final JobParamDefine QUERY_STRING = JobParams.define("sqoop.args.query", "query"); + + /** + * Import: Where + */ + private static final JobParamDefine WHERE_CLAUSE = JobParams.define("sqoop.args.where", (BiFunction) (k, job) -> { + if (MODE_ENUM.getValue(job) == MODE_TYPE.IMPORT){ + JobParam where = MODE_RDBMS_PARAMS.getValue(job).get(JobParamConstraints.WHERE); + if (Objects.nonNull(where) && StringUtils.isNotBlank(where.getValue())){ + return where.getValue(); + } + } + return null; + }); + + + /** + * Import: Hive-import + */ + private static final JobParamDefine HIVE_IMPORT = JobParams.define("sqoop.args.hive.import", (BiFunction) (k, job) -> { + if (MODE_ENUM.getValue(job) == IMPORT && job.getSinkType().equalsIgnoreCase("hive") && !IS_USE_HCATALOG.getValue(job)){ + return ""; + } + return null; + }); + + /** + * Export: Hive-export + */ + private static final JobParamDefine HIVE_EXPORT = JobParams.define("sqoop.hive.export", (BiFunction) (k, job) -> { + if (MODE_ENUM.getValue(job) == EXPORT && job.getSourceType().equalsIgnoreCase("hive") && !IS_USE_HCATALOG.getValue(job)){ + return ""; + } + return null; + }); + + /** + * Import: Hive-overwrite + */ + private static final JobParamDefine HIVE_OVERWRITE = JobParams.define("sqoop.args.hive.overwrite", (BiFunction) (k, job) -> { + if (Objects.nonNull(HIVE_IMPORT.getValue(job))){ + JobParam writeMode = MODE_HADOOP_PARAMS.getValue(job).get(JobParamConstraints.WRITE_MODE); + if (Objects.nonNull(writeMode) && "overwrite".equalsIgnoreCase(writeMode.getValue())){ + return ""; + } + } + return null; + }); + + + + /** + * Import: Hive-database + */ + private static final JobParamDefine HIVE_DATABASE = JobParams.define("sqoop.args.hive.database", (BiFunction) (k, job) -> { + if (Objects.nonNull(HIVE_IMPORT.getValue(job))){ + return MODE_HADOOP_PARAMS.getValue(job).get(JobParamConstraints.DATABASE, String.class).getValue(); + } + return null; + }); + + /** + * Import: Hive-table + */ + private static final JobParamDefine HIVE_TABLE = JobParams.define("sqoop.args.hive.table", (BiFunction) (k, job) -> { + if (Objects.nonNull(HIVE_DATABASE.getValue(job))) { + return MODE_HADOOP_PARAMS.getValue(job).get(JobParamConstraints.TABLE, String.class).getValue(); + } + return null; + }); + + /** + * Import: Hive-partition-key + */ + private static final JobParamDefine HIVE_PARTITION_KEY = JobParams.define("sqoop.args.hive.partition.key", (BiFunction) (k, job) -> { + AtomicReference keys = new AtomicReference<>(null); + if (Objects.nonNull(HIVE_TABLE.getValue(job))){ + Optional.ofNullable(PARTITION_MAP.getValue(job)).ifPresent(partitionMap -> keys.set(StringUtils.join(partitionMap.keySet(), ","))); + } + return keys.get(); + }); + + /** + * Import: Hive-partition-values + */ + private static final JobParamDefine HIVE_PARTITION_VALUE = JobParams.define("sqoop.args.hive.partition.value", (BiFunction) (k, job) -> { + if (Objects.nonNull(HIVE_PARTITION_KEY.getValue(job))){ + return StringUtils.join(PARTITION_MAP.getValue(job).values(), ","); + } + return null; + }); + + /** + * Import: Hive-append + */ + private static final JobParamDefine HIVE_APPEND = JobParams.define("sqoop.args.append", (BiFunction) (k, job) -> { +// if (Objects.nonNull(HIVE_IMPORT.getValue(job))){ +// JobParam writeMode = MODE_HADOOP_PARAMS.getValue(job).get(JobParamConstraints.WRITE_MODE); +// if (Objects.nonNull(writeMode) && "append".equalsIgnoreCase(writeMode.getValue())){ +// return ""; +// } +// } + return null; + }); + /** + * Import: Hive-target-dir\] + */ + private static final JobParamDefine HIVE_TARGET_DIR = JobParams.define("sqoop.args.target.dir", (BiFunction) (k, job) -> { + if (Objects.nonNull(HIVE_IMPORT.getValue(job)) && Objects.nonNull(QUERY_STRING.getValue(job))){ + return "/user/linkis/exchangis/sqoop/" + HIVE_TABLE.getValue(job) + "/"; + } + return null; + }); + + /** + * Import: Hive-delete-target-dir + */ + private static final JobParamDefine HIVE_DELETE_TARGET = JobParams.define("sqoop.args.delete.target.dir", (BiFunction) (k, job) -> { + if (Objects.nonNull(HIVE_IMPORT.getValue(job))){ + return ""; + } + return null; + }); + + /** + * Import: Hive-fields-terminated-by + */ + private static final JobParamDefine HIVE_FIELDS_TERMINATED_BY = JobParams.define("sqoop.args.fields.terminated.by", (BiFunction) (k, job) -> { + if (MODE_ENUM.getValue(job) == IMPORT && "hive".equalsIgnoreCase(job.getSinkType())){ + return META_HADOOP_TABLE_PROPS.getValue(job).getOrDefault(META_FIELD_DELIMITER, "\u0001"); + } + return null; + }); + + /** + * TODO get the properties from hive + * Import: Hive-null-string + */ + private static final JobParamDefine HIVE_NULL_STRING = JobParams.define("sqoop.args.null.string", (BiFunction) (k, job) -> { + if (MODE_ENUM.getValue(job) == IMPORT && "hive".equalsIgnoreCase(job.getSinkType())){ + return "\\\\N"; + } + return null; + }); + + /** + * TODO get the properties from hive + * Import: Hive-null-non-string + */ + private static final JobParamDefine HIVE_NULL_NON_STRING = JobParams.define("sqoop.args.null.non.string", (BiFunction) (k, job) -> { + if (MODE_ENUM.getValue(job) == IMPORT && "hive".equalsIgnoreCase(job.getSinkType())){ + return "\\\\N"; + } + return null; + }); + + /** + * TODO get the properties from hive to build the export directory + * Export: Export-dir + */ + private static final JobParamDefine EXPORT_DIR = JobParams.define("sqoop.args.export.dir", (BiFunction) (k, job) -> { + if (Objects.nonNull(HIVE_EXPORT.getValue(job))){ + + } + return null; + }); + + /** + * Export: Update-key + */ + private static final JobParamDefine UPDATE_KEY = JobParams.define("sqoop.args.update.key", (BiFunction) (k, job) -> { + if (MODE_ENUM.getValue(job) == EXPORT ){ + JobParam writeMode = MODE_RDBMS_PARAMS.getValue(job).get(JobParamConstraints.WRITE_MODE, String.class); + if (Objects.nonNull(writeMode) && StringUtils.isNotBlank(writeMode.getValue()) && !"insert".equalsIgnoreCase(writeMode.getValue())){ + return META_RDBMS_COLUMNS.getValue(job).stream().filter(MetaColumn::isPrimaryKey) + .map(MetaColumn::getName).collect(Collectors.joining(",")); + } + } + return null; + }); + + /** + * Export: Update mode + */ + private static final JobParamDefine UPDATE_MODE = JobParams.define("sqoop.args.update.mode", (BiFunction) (k, job) -> { + if (StringUtils.isNotBlank(UPDATE_KEY.getValue(job))){ + JobParam writeMode = MODE_RDBMS_PARAMS.getValue(job).get(JobParamConstraints.WRITE_MODE, String.class); + return "update".equals(writeMode.getValue())? "allowinsert" : "updateonly"; + } + return null; + }); + + /** + * Export: Hcatalog-database + */ + private static final JobParamDefine HCATALOG_DATABASE = JobParams.define("sqoop.args.hcatalog.database", (BiFunction) (k, job) ->{ + if (IS_USE_HCATALOG.getValue(job)){ + return MODE_HADOOP_PARAMS.getValue(job).get(JobParamConstraints.DATABASE, String.class).getValue(); + } + return null; + }); + + /** + * Export: Hcatalog-table + */ + private static final JobParamDefine HCATALOG_TABLE = JobParams.define("sqoop.args.hcatalog.table", (BiFunction) (k, job) ->{ + if (Objects.nonNull(HCATALOG_DATABASE.getValue(job))){ + return MODE_HADOOP_PARAMS.getValue(job).get(JobParamConstraints.TABLE, String.class).getValue(); + } + return null; + }); + + /** + * Export: Hcatalog-partition-key + */ + private static final JobParamDefine HCATALOG_PARTITION_KEY = JobParams.define("sqoop.args.hcatalog.partition.keys", (BiFunction) (k, job) -> { + AtomicReference keys = new AtomicReference<>(null); + if (Objects.nonNull(HCATALOG_TABLE.getValue(job))){ + Optional.ofNullable(PARTITION_MAP.getValue(job)).ifPresent(partitionMap -> keys.set(StringUtils.join(partitionMap.keySet(), ","))); + } + return keys.get(); + }); + + /** + * Export: Hcatalog-partition-values + */ + private static final JobParamDefine HCATALOG_PARTITION_VALUE = JobParams.define("sqoop.args.hcatalog.partition.values", (BiFunction) (k, job) -> { + if (Objects.nonNull(HCATALOG_PARTITION_KEY.getValue(job))){ + return StringUtils.join(PARTITION_MAP.getValue(job).values(), ","); + } + return null; + }); + + /** + * TODO get the properties from hive + * Export: Hive-input-fields-terminated-by + */ + private static final JobParamDefine HIVE_INPUT_FIELDS_TERMINATED_KEY = JobParams.define("sqoop.args.input.fields.terminated.by", (BiFunction) (k, job) -> { + if (MODE_ENUM.getValue(job) == EXPORT && "hive".equalsIgnoreCase(job.getSourceType())){ + return META_HADOOP_TABLE_PROPS.getValue(job).getOrDefault(META_FIELD_DELIMITER, "\u0001"); + } + return null; + }); + + /** + * TODO get the properties from hive + * Export: Hive-input-null-string + */ + private static final JobParamDefine HIVE_INPUT_NULL_STRING = JobParams.define("sqoop.args.input.null.string", (BiFunction) (k, job) -> { + if (MODE_ENUM.getValue(job) == EXPORT && "hive".equalsIgnoreCase(job.getSourceType())){ + return "\\\\N"; + } + return null; + }); + + /** + * TODO get the properties from hive + * Export: Hive-input-null-non-string + */ + private static final JobParamDefine HIVE_INPUT_NULL_NON_STRING = JobParams.define("sqoop.args.input.null.non.string", (BiFunction) (k, job) -> { + if (MODE_ENUM.getValue(job) == EXPORT && "hive".equalsIgnoreCase(job.getSourceType())){ + return "\\\\N"; + } + return null; + }); + + + /** + * Mapping params (ExchangisJobContent -> transforms -> mapping) + */ + private static final JobParamDefine>> TRANSFORM_MAPPING = JobParams.define("sqoop.transform.mapping", "mapping"); + /** + * Source field name in mapping + */ + private static final JobParamDefine SOURCE_FIELD_NAME = JobParams.define("sqoop.source.name", "source_field_name", String.class); + /** + * Sink field name in mapping + */ + private static final JobParamDefine SINK_FIELD_NAME = JobParams.define("sqoop.sink.name", "sink_field_name", String.class); + + /** + * Column serializer + */ + private static final JobParamDefine COLUMN_SERIAL = JobParams.define("sqoop.args.columns", (BiFunction) (key, job) -> { + List> mappings = TRANSFORM_MAPPING.getValue(job.getRealmParams(SubExchangisJob.REALM_JOB_COLUMN_MAPPING)); + List columnSerial = new ArrayList<>(); + if (Objects.nonNull(mappings)) { + if (SUPPORT_RDBMS_TYPES.contains(job.getSourceType().toUpperCase())) { + mappings.forEach(mapping -> Optional.ofNullable(SOURCE_FIELD_NAME.newParam(mapping).getValue()).ifPresent(columnSerial::add)); + } else if (SUPPORT_RDBMS_TYPES.contains(job.getSinkType().toUpperCase())) { + mappings.forEach(mapping -> Optional.ofNullable(SINK_FIELD_NAME.newParam(mapping).getValue()).ifPresent(columnSerial::add)); + } + } + return StringUtils.join(columnSerial, ","); + }); + + /** + * Inspection of the definitions above + */ + private static final JobParamDefine DEFINE_INSPECTION = JobParams.define("", (BiFunction) (key, job) -> { + List rdbmsColumns = new ArrayList<>(Arrays.asList(COLUMN_SERIAL.getValue(job).split(","))); + List hadoopColumns = META_HADOOP_COLUMNS.getValue(job).stream().map(MetaColumn::getName) + .collect(Collectors.toList()); + if (IS_USE_HCATALOG.getValue(job)){ + rdbmsColumns.removeAll(hadoopColumns); + if (!rdbmsColumns.isEmpty()){ + warn("NOTE: task:[name:{}, id:{}] 在使用Hcatalog方式下,关系型数据库字段 [" + StringUtils.join(rdbmsColumns, ",") + "] 在hive/hbase表中未查询到对应字段", + job.getName(), job.getId()); + } + }else { + warn("NOTE: task:[name: {}, id:{}] 将使用非Hcatalog方式(原生)导数, 将顺序匹配关系型数据库字段和hive/hbase字段,否则请改变写入方式为APPEND追加", + job.getName(), job.getId()); + } + return null; + }); + @Override + public int priority() { + return 1; + } + + @Override + public ExchangisEngineJob buildJob(SubExchangisJob inputJob, ExchangisEngineJob expectOut, ExchangisJobBuilderContext ctx) throws ExchangisJobException { + try { + SqoopExchangisEngineJob engineJob = new SqoopExchangisEngineJob(expectOut); + engineJob.setId(inputJob.getId()); + JobParamDefine[] definitions = getParamDefinitions(); + Map jobContent = engineJob.getJobContent(); + for (JobParamDefine definition : definitions){ + Object paramValue = definition.getValue(inputJob); + if (Objects.nonNull(paramValue)){ + jobContent.put(definition.getKey(), String.valueOf(paramValue)); + } + } + engineJob.setName(inputJob.getName()); + engineJob.setCreateUser(inputJob.getCreateUser()); + return engineJob; + } catch (Exception e) { + throw new ExchangisJobException(ExchangisJobExceptionCode.ENGINE_JOB_ERROR.getCode(), + "Fail to build sqoop engine job, message:[" + e.getMessage() + "]", e); + } + } + + @Override + public boolean canBuild(SubExchangisJob inputJob) { + return "sqoop".equalsIgnoreCase(inputJob.getEngineType()); + } + + /** + * Definition list + * @return list + */ + private JobParamDefine[] getParamDefinitions(){ + return new JobParamDefine[]{ + VERBOSE, MODE, CONNECT_DRIVER, CONNECT_STRING, NUM_MAPPERS, + USERNAME, PASSWORD, TABLE, WHERE_CLAUSE, HIVE_IMPORT, HIVE_OVERWRITE, + HIVE_DATABASE, HIVE_TABLE, HIVE_PARTITION_KEY, HIVE_PARTITION_VALUE, HIVE_APPEND, + HIVE_TARGET_DIR, HIVE_DELETE_TARGET, HIVE_FIELDS_TERMINATED_BY, HIVE_NULL_STRING, HIVE_NULL_NON_STRING, + EXPORT_DIR, UPDATE_KEY, UPDATE_MODE, + HCATALOG_DATABASE, HCATALOG_TABLE, HCATALOG_PARTITION_KEY, HCATALOG_PARTITION_VALUE, + HIVE_INPUT_FIELDS_TERMINATED_KEY, HIVE_INPUT_NULL_STRING, HIVE_INPUT_NULL_NON_STRING, + COLUMN_SERIAL,DEFINE_INSPECTION + }; + } + + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/GenericExchangisTransformJobBuilder.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/GenericExchangisTransformJobBuilder.java new file mode 100644 index 000000000..b9f66b5c5 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/GenericExchangisTransformJobBuilder.java @@ -0,0 +1,187 @@ +package com.webank.wedatasphere.exchangis.job.server.builder.transform; + +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import com.webank.wedatasphere.exchangis.datasource.core.vo.ExchangisJobInfoContent; +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.builder.api.AbstractExchangisJobBuilder; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode; +import com.webank.wedatasphere.exchangis.job.server.builder.transform.handlers.SubExchangisJobHandler; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.common.exception.ErrorException; +import org.apache.linkis.common.utils.ClassUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.lang.reflect.Modifier; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +/** + * TransformJob builder + */ +public class GenericExchangisTransformJobBuilder extends AbstractExchangisJobBuilder { + + private static final Logger LOG = LoggerFactory.getLogger(GenericExchangisTransformJobBuilder.class); + + /** + * Handlers + */ + private static final Map handlerHolders = new ConcurrentHashMap<>(); + + public synchronized void initHandlers() { + //Should define wds.linkis.reflect.scan.package in properties + Set> jobHandlerSet = ClassUtils.reflections().getSubTypesOf(SubExchangisJobHandler.class); + List reflectedHandlers = jobHandlerSet.stream().map(handlerClass -> { + if (!Modifier.isAbstract(handlerClass.getModifiers()) && + !Modifier.isInterface(handlerClass.getModifiers()) && !handlerClass.equals(SubExchangisJobHandler.class)) { + try { + return handlerClass.newInstance(); + } catch (InstantiationException | IllegalAccessException e) { + LOG.warn("Cannot create the instance of handler: [{}], message: [{}]", handlerClass.getCanonicalName(), e.getMessage(), e); + } + } + return null; + }).filter(handler -> Objects.nonNull(handler) && Objects.nonNull(handler.dataSourceType())).collect(Collectors.toList()); + reflectedHandlers.forEach(reflectedHandler -> handlerHolders.compute(reflectedHandler.dataSourceType(), (type, handlerChain) -> { + if (Objects.isNull(handlerChain)){ + handlerChain = new SubExchangisJobHandlerChain(type); + } + handlerChain.addHandler(reflectedHandler); + return handlerChain; + })); + LOG.trace("Sort the handler chain"); + handlerHolders.values().forEach(SubExchangisJobHandlerChain::sort); + LOG.trace("Add the default handlerChain to the head"); + //Add the default handlerChain to the head + Optional.ofNullable(handlerHolders.get(SubExchangisJobHandler.DEFAULT_DATA_SOURCE_TYPE)).ifPresent(defaultHandlerChain -> + handlerHolders.forEach( (s, handlerChain) -> {if(!Objects.equals(handlerChain, defaultHandlerChain)){ + handlerChain.addFirstHandler(defaultHandlerChain); + }})); + } + @Override + public TransformExchangisJob buildJob(ExchangisJobInfo inputJob, TransformExchangisJob expectOut, ExchangisJobBuilderContext ctx) throws ExchangisJobException { + LOG.trace("Start to build exchangis transform job, name: [{}], id: [{}], engine: [{}], content: [{}]", + inputJob.getName(), inputJob.getId(), inputJob.getEngineType(), inputJob.getJobContent()); + //First to convert content to "ExchangisJobInfoContent" + TransformExchangisJob outputJob = new TransformExchangisJob(); + outputJob.setCreateUser(Optional.ofNullable(inputJob.getExecuteUser()).orElse(String.valueOf(ctx.getEnv("USER_NAME")))); + try { + if (StringUtils.isNotBlank(inputJob.getJobContent())) { + //First to convert content to "ExchangisJobInfoContent" + List contents = Json.fromJson(inputJob.getJobContent(), List.class, ExchangisJobInfoContent.class); + if (Objects.nonNull(contents) ) { + LOG.info("To parse content ExchangisJob: id: [{}], name: [{}], expect subJobs: [{}]", + inputJob.getId(), inputJob.getName(), contents.size()); + //Second to new SubExchangisJob instances + List subExchangisJobs = contents.stream().map(job -> { + TransformExchangisJob.SubExchangisJobAdapter jobAdapter = new TransformExchangisJob.SubExchangisJobAdapter(job); + jobAdapter.setId(inputJob.getId()); + jobAdapter.setCreateUser(outputJob.getCreateUser()); + return jobAdapter; + }) + .collect(Collectors.toList()); + outputJob.setSubJobSet(subExchangisJobs); + outputJob.setId(inputJob.getId()); + outputJob.setName(inputJob.getName()); + LOG.info("Invoke job handlers to handle the subJobs, ExchangisJob: id: [{}], name: [{}]", inputJob.getId(), inputJob.getName()); + //Do handle of the sub jobs + for (SubExchangisJob subExchangisJob : subExchangisJobs){ + if(StringUtils.isBlank(subExchangisJob.getEngineType())){ + subExchangisJob.setEngineType(inputJob.getEngineType()); + } + SubExchangisJobHandler sourceHandler = handlerHolders.get( StringUtils + .isNotBlank(subExchangisJob.getSourceType())? subExchangisJob.getSourceType().toLowerCase():""); + if(Objects.isNull(sourceHandler)){ + LOG.warn("Not find source handler for subJob named: [{}], sourceType: [{}], " + + "ExchangisJob: id: [{}], name: [{}], use default instead", + subExchangisJob.getName(), subExchangisJob.getSourceType(), inputJob.getId(), inputJob.getName()); + sourceHandler = handlerHolders.get(SubExchangisJobHandler.DEFAULT_DATA_SOURCE_TYPE); + } + SubExchangisJobHandler sinkHandler = handlerHolders.get( StringUtils + .isNotBlank(subExchangisJob.getSinkType())? subExchangisJob.getSinkType().toLowerCase():""); + if(Objects.isNull(sinkHandler)){ + LOG.warn("Not find sink handler for subJob named: [{}], sinkType: [{}], ExchangisJob: id: [{}], name: [{}], use default instead", + subExchangisJob.getName(), subExchangisJob.getSourceType(), inputJob.getId(), inputJob.getName()); + sinkHandler = handlerHolders.get(SubExchangisJobHandler.DEFAULT_DATA_SOURCE_TYPE); + } + LOG.trace("Invoke handles for subJob: [{}], sourceHandler: [{}], sinkHandler: [{}]", subExchangisJob.getName(), sourceHandler, sinkHandler); + //TODO Handle the subExchangisJob parallel + if (Objects.nonNull(sourceHandler)) { + sourceHandler.handleSource(subExchangisJob, ctx); + } + if (Objects.nonNull(sinkHandler)){ + sinkHandler.handleSink(subExchangisJob, ctx); + } + } + }else{ + throw new ExchangisJobException(ExchangisJobExceptionCode.TRANSFORM_JOB_ERROR.getCode(), + "Illegal content string: [" + inputJob.getJobContent() + "] in job, please check", null); + } + }else{ + LOG.warn("It looks like an empty job ? id: [{}], name: [{}]", inputJob.getId(), inputJob.getName()); + } + }catch(Exception e){ + throw new ExchangisJobException(ExchangisJobExceptionCode.TRANSFORM_JOB_ERROR.getCode(), + "Fail to build transformJob from input job, message: [" + e.getMessage() + "]", e); + } + return outputJob; + } + + /** + * Chain + */ + private static class SubExchangisJobHandlerChain implements SubExchangisJobHandler{ + + private String dataSourceType; + + private LinkedList handlers = new LinkedList<>(); + + public SubExchangisJobHandlerChain(){} + public SubExchangisJobHandlerChain(String dataSourceType){ + this.dataSourceType = dataSourceType; + } + public void addFirstHandler(SubExchangisJobHandler handler){ + handlers.addFirst(handler); + } + + public void addHandler(SubExchangisJobHandler handler){ + handlers.add(handler); + } + public void sort(){ + handlers.sort(Comparator.comparingInt(SubExchangisJobHandler::order)); + } + @Override + public String dataSourceType() { + return dataSourceType; + } + + @Override + public void handleSource(SubExchangisJob subExchangisJob, ExchangisJobBuilderContext ctx) throws ErrorException { + for(SubExchangisJobHandler handler : handlers){ + if(handler.acceptEngine(subExchangisJob.getEngineType())) { + handler.handleSource(subExchangisJob, ctx); + } + } + } + + @Override + public void handleSink(SubExchangisJob subExchangisJob, ExchangisJobBuilderContext ctx) throws ErrorException { + for(SubExchangisJobHandler handler : handlers){ + if(handler.acceptEngine(subExchangisJob.getEngineType())) { + handler.handleSink(subExchangisJob, ctx); + } + } + } + } + + public static void main(String[] args) { + String code = "[{\"subJobs\":[{\"subJobName\":\"Copy ID\",\"dataSourceIds\":{\"source\":{\"type\":\"MYSQL\",\"id\":\"111\",\"ds\":\"MYSQL_LIU\",\"db\":\"ide_gz_bdap_sit_01\",\"table\":\"dss_project_publish_history\"},\"sink\":{\"type\":\"HIVE\",\"id\":\"113\",\"ds\":\"hive_uat\",\"db\":\"hduser05db\",\"table\":\"dss_project_publish_history\"}},\"params\":{\"sources\":[{\"key\":\"where\",\"field\":\"where\",\"label\":\"WHERE条件\",\"sort\":2,\"value\":\"\",\"defaultValue\":\"\",\"unit\":\"\",\"required\":false,\"validateType\":\"REGEX\",\"validateRange\":\"^[\\\\s\\\\S]{0,500}$\",\"validateMsg\":\"WHERE条件输入过长\",\"source\":\"\",\"type\":\"INPUT\"}],\"sinks\":[{\"key\":\"writeMode\",\"field\":\"writeMode\",\"label\":\"写入方式(OVERWRITE只对TEXT类型表生效)\",\"values\":[\"OVERWRITE\",\"APPEND\"],\"value\":\"OVERWRITE\",\"defaultValue\":\"OVERWRITE\",\"sort\":1,\"unit\":\"\",\"required\":true,\"type\":\"OPTION\"},{\"key\":\"partition\",\"field\":\"partition\",\"label\":\"分区信息(文本)\",\"sort\":2,\"value\":null,\"defaultValue\":null,\"unit\":\"\",\"required\":false,\"validateType\":\"REGEX\",\"validateRange\":\"^[\\\\s\\\\S]{0,50}$\",\"validateMsg\":\"分区信息过长\",\"source\":\"/api/rest_j/v1/exchangis/datasources/render/partition/element/map\",\"type\":\"MAP\"}]},\"transforms\":{\"addEnable\":false,\"type\":\"MAPPING\",\"sql\":null,\"mapping\":[{\"validator\":null,\"transformer\":null,\"source_field_name\":\"id\",\"source_field_type\":\"BIGINT\",\"sink_field_name\":\"id\",\"sink_field_type\":\"int\",\"deleteEnable\":false,\"source_field_index\":0,\"sink_field_index\":0,\"source_field_editable\":true,\"sink_field_editable\":false},{\"validator\":null,\"transformer\":null,\"source_field_name\":\"project_version_id\",\"source_field_type\":\"BIGINT\",\"sink_field_name\":\"project_version_id\",\"sink_field_type\":\"int\",\"deleteEnable\":false,\"source_field_index\":1,\"sink_field_index\":0,\"source_field_editable\":true,\"sink_field_editable\":false},{\"validator\":null,\"transformer\":null,\"source_field_name\":\"creator_id\",\"source_field_type\":\"BIGINT\",\"sink_field_name\":\"creator_id\",\"sink_field_type\":\"int\",\"deleteEnable\":false,\"source_field_index\":2,\"sink_field_index\":0,\"source_field_editable\":true,\"sink_field_editable\":false},{\"validator\":null,\"transformer\":null,\"source_field_name\":\"create_time\",\"source_field_type\":\"DATETIME\",\"sink_field_name\":\"create_time\",\"sink_field_type\":\"date\",\"deleteEnable\":false,\"source_field_index\":3,\"sink_field_index\":0,\"source_field_editable\":true,\"sink_field_editable\":false},{\"validator\":null,\"transformer\":null,\"source_field_name\":\"state\",\"source_field_type\":\"TINYINT\",\"sink_field_name\":\"state\",\"sink_field_type\":\"boolean\",\"deleteEnable\":false,\"source_field_index\":4,\"sink_field_index\":0,\"source_field_editable\":true,\"sink_field_editable\":false}]},\"settings\":[{\"key\":\"setting.max.parallelism\",\"field\":\"setting.max.parallelism\",\"label\":\"作业最大并行数\",\"sort\":1,\"value\":\"1\",\"defaultValue\":\"1\",\"unit\":\"个\",\"required\":true,\"validateType\":\"REGEX\",\"validateRange\":\"^[1-9]\\\\d*$\",\"validateMsg\":\"作业最大并行数输入错误\",\"source\":\"\",\"type\":\"INPUT\"},{\"key\":\"setting.max.memory\",\"field\":\"setting.max.memory\",\"label\":\"作业最大内存\",\"sort\":2,\"value\":\"1048\",\"defaultValue\":\"1024\",\"unit\":\"Mb\",\"required\":true,\"validateType\":\"REGEX\",\"validateRange\":\"^[1-9]\\\\d*$\",\"validateMsg\":\"作业最大内存输入错误\",\"source\":\"\",\"type\":\"INPUT\"}]},{\"subJobName\":\"tTFeeaPBfbZJ\",\"dataSourceIds\":{\"source\":{\"type\":\"MYSQL\",\"id\":\"111\",\"ds\":\"MYSQL_LIU\",\"db\":\"ide_gz_bdap_sit_01\",\"table\":\"dss_project_publish_history\"},\"sink\":{\"type\":\"HIVE\",\"id\":\"113\",\"ds\":\"hive_uat\",\"db\":\"hduser05db\",\"table\":\"dss_project_publish_history_text\"}},\"params\":{\"sources\":[{\"key\":\"where\",\"field\":\"where\",\"label\":\"WHERE条件\",\"sort\":2,\"value\":\"\",\"defaultValue\":\"\",\"unit\":\"\",\"required\":false,\"validateType\":\"REGEX\",\"validateRange\":\"^[\\\\s\\\\S]{0,500}$\",\"validateMsg\":\"WHERE条件输入过长\",\"source\":\"\",\"type\":\"INPUT\"}],\"sinks\":[{\"key\":\"writeMode\",\"field\":\"writeMode\",\"label\":\"写入方式(OVERWRITE只对TEXT类型表生效)\",\"values\":[\"OVERWRITE\",\"APPEND\"],\"value\":\"OVERWRITE\",\"defaultValue\":\"OVERWRITE\",\"sort\":1,\"unit\":\"\",\"required\":true,\"type\":\"OPTION\"},{\"key\":\"partition\",\"field\":\"partition\",\"label\":\"分区信息(文本)\",\"sort\":2,\"value\":null,\"defaultValue\":null,\"unit\":\"\",\"required\":false,\"validateType\":\"REGEX\",\"validateRange\":\"^[\\\\s\\\\S]{0,50}$\",\"validateMsg\":\"分区信息过长\",\"source\":\"/api/rest_j/v1/exchangis/datasources/render/partition/element/map\",\"type\":\"MAP\"}]},\"transforms\":{\"addEnable\":false,\"type\":\"MAPPING\",\"sql\":null,\"mapping\":[{\"validator\":null,\"transformer\":null,\"source_field_name\":\"id\",\"source_field_type\":\"BIGINT\",\"sink_field_name\":\"id\",\"sink_field_type\":\"int\",\"deleteEnable\":true,\"source_field_index\":0,\"sink_field_index\":0,\"source_field_editable\":true,\"sink_field_editable\":false},{\"validator\":null,\"transformer\":null,\"source_field_name\":\"project_version_id\",\"source_field_type\":\"BIGINT\",\"sink_field_name\":\"project_version_id\",\"sink_field_type\":\"int\",\"deleteEnable\":true,\"source_field_index\":1,\"sink_field_index\":0,\"source_field_editable\":true,\"sink_field_editable\":false},{\"validator\":null,\"transformer\":null,\"source_field_name\":\"create_time\",\"source_field_type\":\"DATETIME\",\"sink_field_name\":\"creator_id\",\"sink_field_type\":\"int\",\"deleteEnable\":true,\"source_field_index\":2,\"sink_field_index\":0,\"source_field_editable\":true,\"sink_field_editable\":false},{\"validator\":null,\"transformer\":null,\"source_field_name\":\"creator_id\",\"source_field_type\":\"BIGINT\",\"sink_field_name\":\"create_time\",\"sink_field_type\":\"string\",\"deleteEnable\":true,\"source_field_index\":3,\"sink_field_index\":0,\"source_field_editable\":true,\"sink_field_editable\":false},{\"validator\":null,\"transformer\":null,\"source_field_name\":\"update_time\",\"source_field_type\":\"DATETIME\",\"sink_field_name\":\"state\",\"sink_field_type\":\"string\",\"deleteEnable\":true,\"source_field_index\":4,\"sink_field_index\":0,\"source_field_editable\":true,\"sink_field_editable\":false}]},\"settings\":[{\"key\":\"setting.max.parallelism\",\"field\":\"setting.max.parallelism\",\"label\":\"作业最大并行数\",\"sort\":1,\"value\":\"1\",\"defaultValue\":\"1\",\"unit\":\"个\",\"required\":true,\"validateType\":\"REGEX\",\"validateRange\":\"^[1-9]\\\\d*$\",\"validateMsg\":\"作业最大并行数输入错误\",\"source\":\"\",\"type\":\"INPUT\"},{\"key\":\"setting.max.memory\",\"field\":\"setting.max.memory\",\"label\":\"作业最大内存\",\"sort\":2,\"value\":\"1024\",\"defaultValue\":\"1024\",\"unit\":\"Mb\",\"required\":true,\"validateType\":\"REGEX\",\"validateRange\":\"^[1-9]\\\\d*$\",\"validateMsg\":\"作业最大内存输入错误\",\"source\":\"\",\"type\":\"INPUT\"}]}]}]"; + List contents = Json.fromJson(code, List.class, ExchangisJobInfoContent.class); + System.out.println(contents.get(0).getSubJobName()); + System.out.println(contents); + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/TransformExchangisJob.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/TransformExchangisJob.java new file mode 100644 index 000000000..7d1d24d6c --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/TransformExchangisJob.java @@ -0,0 +1,188 @@ +package com.webank.wedatasphere.exchangis.job.server.builder.transform; + +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import com.webank.wedatasphere.exchangis.datasource.core.vo.ExchangisJobInfoContent; +import com.webank.wedatasphere.exchangis.datasource.core.vo.ExchangisJobParamsContent; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.domain.GenericExchangisJob; +import com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParamSet; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParams; +import com.webank.wedatasphere.exchangis.job.server.builder.JobParamConstraints; +import com.webank.wedatasphere.exchangis.job.server.builder.engine.DataxExchangisEngineJob; +import com.webank.wedatasphere.exchangis.job.server.builder.transform.handlers.GenericSubExchangisJobHandler; +import com.webank.wedatasphere.exchangis.job.server.utils.JobUtils; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +/** + * Transform job + */ +public class TransformExchangisJob extends GenericExchangisJob { + + private static final Logger LOG = LoggerFactory.getLogger(TransformExchangisJob.class); + + private ExchangisJobInfo exchangisJobInfo; + /** + * Set of sub jobs + */ + private List subJobSet = new ArrayList<>(); + + public ExchangisJobInfo getExchangisJobInfo() { + return exchangisJobInfo; + } + + public void setExchangisJobInfo(ExchangisJobInfo exchangisJobInfo) { + this.exchangisJobInfo = exchangisJobInfo; + } + + public List getSubJobSet() { + return subJobSet; + } + + public void setSubJobSet(List subJobSet) { + this.subJobSet = subJobSet; + } + + /** + * Wrap entity of 'ExchangisJobInfoContent' + */ + public static class SubExchangisJobAdapter extends SubExchangisJob{ + + /** + * Content VO + */ + private ExchangisJobInfoContent jobInfoContent; + + public SubExchangisJobAdapter(ExchangisJobInfoContent jobInfoContent){ + if(Objects.nonNull(jobInfoContent)) { + this.jobInfoContent = jobInfoContent; + this.engineType = jobInfoContent.getEngine(); + this.name = jobInfoContent.getSubJobName(); + convertContentToParams(jobInfoContent); + } + } + + public ExchangisJobInfoContent getJobInfoContent() { + return jobInfoContent; + } + + public void setJobInfoContent(ExchangisJobInfoContent jobInfoContent) { + this.jobInfoContent = jobInfoContent; + } + + private void convertContentToParams(ExchangisJobInfoContent content){ + setIntoParams(REALM_JOB_DATA_SOURCE, () -> Json.convert(content.getDataSources(), Map.class, String.class, String.class)); + setIntoParams(REALM_JOB_COLUMN_MAPPING, () -> Json.convert(content.getTransforms(), Map.class, String.class, Object.class)); + if(Objects.nonNull(content.getParams())){ + if(Objects.nonNull(content.getParams().getSources())) { + List items = content.getParams().getSources(); + + timePlaceHolderConvert(items); + + JobParamSet paramSet = setIntoParams(REALM_JOB_CONTENT_SOURCE, () -> { + //List items = content.getParams().getSources(); + return items.stream().filter(item -> StringUtils.isNotBlank(item.getConfigKey()) && Objects.nonNull(item.getConfigValue())).collect + (Collectors.toMap(ExchangisJobParamsContent.ExchangisJobParamsItem::getConfigKey, + ExchangisJobParamsContent.ExchangisJobParamsItem::getConfigValue)); + }); + if(Objects.nonNull(paramSet)) { + this.sourceType = resolveDataSourceId(content.getDataSources().getSourceId(), paramSet); + } + } + + if(Objects.nonNull(content.getParams().getSinks())) { + List items = content.getParams().getSinks(); + timePlaceHolderConvert(items); + + JobParamSet paramSet = setIntoParams(REALM_JOB_CONTENT_SINK, () -> { + //List items = content.getParams().getSinks(); + return items.stream().filter(item -> StringUtils.isNotBlank(item.getConfigKey()) && Objects.nonNull(item.getConfigValue())).collect + (Collectors.toMap(ExchangisJobParamsContent.ExchangisJobParamsItem::getConfigKey, + ExchangisJobParamsContent.ExchangisJobParamsItem::getConfigValue)); + }); + if(Objects.nonNull(paramSet)) { + this.sinkType = resolveDataSourceId(content.getDataSources().getSinkId(), paramSet); + } + } + } + if (Objects.nonNull(content.getSettings())){ + setIntoParams(REALM_JOB_SETTINGS, () -> { + List items = content.getSettings(); + return items.stream().filter(item -> StringUtils.isNotBlank(item.getConfigKey())).collect + (Collectors.toMap(ExchangisJobParamsContent.ExchangisJobParamsItem::getConfigKey, + ExchangisJobParamsContent.ExchangisJobParamsItem::getConfigValue)); + }); + } + } + + private JobParamSet setIntoParams(String realm, Supplier> paramsSupplier){ + Optional> dataSourceMap = Optional.ofNullable(paramsSupplier.get()); + dataSourceMap.ifPresent( map -> { + JobParamSet paramSet = map.entrySet().stream().map(entry -> JobParams.newOne(entry.getKey(), entry.getValue())) + .reduce(new JobParamSet(), JobParamSet::add, JobParamSet::combine); + LOG.trace("Set params into sub exchangis job, realm: [{}], paramSet: [{}]", realm, paramSet.toString()); + super.addRealmParams(realm, paramSet); + }); + return getRealmParams(realm); + } + + /** + * + * @param dataSourceId + * @param paramSet + * @return return data source type + */ + private String resolveDataSourceId(String dataSourceId, JobParamSet paramSet){ + AtomicReference result = new AtomicReference<>(new String[]{}); + Optional.ofNullable(dataSourceId).ifPresent( id -> + result.set(id.split(GenericSubExchangisJobHandler.ID_SPLIT_SYMBOL))); + String[] idSerial = result.get(); + if(idSerial.length > 0){ + if(idSerial.length >= 4){ + paramSet.add(JobParams.newOne(JobParamConstraints.DATA_SOURCE_ID, idSerial[1], true)); + paramSet.add(JobParams.newOne(JobParamConstraints.DATABASE, idSerial[2], true)); + paramSet.add(JobParams.newOne(JobParamConstraints.TABLE, idSerial[3], true)); + } + return idSerial[0]; + } + return null; + } + + /** + * + * @param items + * @return 用于转换时间分区 + */ + + private void timePlaceHolderConvert(List items) { + for (ExchangisJobParamsContent.ExchangisJobParamsItem exchangisJobParamsItem : items) { + if (("partition".equals(exchangisJobParamsItem.getConfigKey()) ) && exchangisJobParamsItem.getConfigValue() != null) { + Map partitionValue = (Map) exchangisJobParamsItem.getConfigValue(); + assert partitionValue != null; + Calendar calendar = Calendar.getInstance(); + if (!partitionValue.get("ds").isEmpty()) { + partitionValue.put("ds", JobUtils.renderDt(partitionValue.get("ds"), calendar)); + } + LOG.info("Time placeholder transform value: {}", partitionValue.get("ds")); + exchangisJobParamsItem.setConfigValue(partitionValue); + } + else if ("where".equals(exchangisJobParamsItem.getConfigKey())) { + String partitionValue = exchangisJobParamsItem.getConfigValue().toString(); + assert partitionValue != null; + Calendar calendar = Calendar.getInstance(); + partitionValue = JobUtils.renderDt(partitionValue, calendar); + LOG.info("Time placeholder transform value: {}", partitionValue); + exchangisJobParamsItem.setConfigValue(partitionValue); + } + } + } + + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/handlers/GenericSubExchangisJobHandler.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/handlers/GenericSubExchangisJobHandler.java new file mode 100644 index 000000000..51e50fba1 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/handlers/GenericSubExchangisJobHandler.java @@ -0,0 +1,91 @@ +package com.webank.wedatasphere.exchangis.job.server.builder.transform.handlers; + +import com.webank.wedatasphere.exchangis.datasource.service.ExchangisDataSourceService; +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParam; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParamDefine; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParamSet; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParams; +import com.webank.wedatasphere.exchangis.job.server.utils.SpringContextHolder; +import org.apache.linkis.common.exception.ErrorException; +import org.apache.linkis.datasource.client.response.GetConnectParamsByDataSourceIdResult; + +import java.util.Objects; +import java.util.Optional; + +/** + * Abstract implement, to fetch the data source params of job + */ +public class GenericSubExchangisJobHandler implements SubExchangisJobHandler{ + + public static final String ID_SPLIT_SYMBOL = "\\."; + + private static final JobParamDefine SOURCE_ID = JobParams.define("source_id", String.class); + + private static final JobParamDefine SINK_ID = JobParams.define("sink_id", String.class); + + @Override + public String dataSourceType() { + return DEFAULT_DATA_SOURCE_TYPE; + } + + @Override + public void handleSource(SubExchangisJob subExchangisJob, ExchangisJobBuilderContext ctx) throws ErrorException { + ExchangisJobInfo originJob = ctx.getOriginalJob(); + JobParamSet idParamSet = subExchangisJob.getRealmParams(SubExchangisJob.REALM_JOB_DATA_SOURCE); + JobParamSet sourceParamSet = subExchangisJob.getRealmParams(SubExchangisJob.REALM_JOB_CONTENT_SOURCE); + if (Objects.nonNull(idParamSet) && Objects.nonNull(sourceParamSet)){ + appendDataSourceParams(idParamSet.load(SOURCE_ID), sourceParamSet, originJob.getCreateUser()); + } + + } + + @Override + public void handleSink(SubExchangisJob subExchangisJob, ExchangisJobBuilderContext ctx) throws ErrorException{ + ExchangisJobInfo originJob = ctx.getOriginalJob(); + JobParamSet idParamSet = subExchangisJob.getRealmParams(SubExchangisJob.REALM_JOB_DATA_SOURCE); + JobParamSet sinkParamSet = subExchangisJob.getRealmParams(SubExchangisJob.REALM_JOB_CONTENT_SINK); + if (Objects.nonNull(idParamSet) && Objects.nonNull(sinkParamSet)){ + appendDataSourceParams(idParamSet.load(SINK_ID), sinkParamSet, originJob.getCreateUser()); + } + } + + /** + * Append data source params + * @param idParam param + * @param paramSet param set + * @param userName username + * @throws ErrorException + */ + private void appendDataSourceParams(JobParam idParam, JobParamSet paramSet, String userName) throws ErrorException { + ExchangisDataSourceService dataSourceService = DataSourceService.instance; + String sourceId = idParam.getValue(); + if(Objects.nonNull(sourceId)){ + // {TYPE}.{ID}.{DB}.{TABLE} + String[] idSerial = sourceId.split(ID_SPLIT_SYMBOL); + if (idSerial.length >= 2){ + GetConnectParamsByDataSourceIdResult infoResult = dataSourceService.getDataSourceConnectParamsById(userName, Long.valueOf(idSerial[1])); + Optional.ofNullable(infoResult.connectParams()).ifPresent(connectParams -> + connectParams.forEach((key, value) -> paramSet.add(JobParams.newOne(key, value, true)))); + } + } + } + public static class DataSourceService{ + + /** + * Lazy load data source service + */ + public static ExchangisDataSourceService instance; + + static{ + instance = SpringContextHolder.getBean(ExchangisDataSourceService.class); + } + } + + @Override + public String toString() { + return this.getClass().getSimpleName() + "(" + dataSourceType() + ")"; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/handlers/SubExchangisJobHandler.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/handlers/SubExchangisJobHandler.java new file mode 100644 index 000000000..195755e78 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/handlers/SubExchangisJobHandler.java @@ -0,0 +1,49 @@ +package com.webank.wedatasphere.exchangis.job.server.builder.transform.handlers; + +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob; +import org.apache.linkis.common.exception.ErrorException; + +/** + * JobHandler + */ +public interface SubExchangisJobHandler { + + String DEFAULT_DATA_SOURCE_TYPE = "default"; + /** + * Associated data source type + * @return string + */ + String dataSourceType(); + + /** + * If accept engine type + * @param engineType engine type + * @return boolean + */ + default boolean acceptEngine(String engineType){ + return true; + } + /** + * Handle source + * @param subExchangisJob sub job + * @param ctx context + */ + void handleSource(SubExchangisJob subExchangisJob, ExchangisJobBuilderContext ctx) throws ErrorException; + + + /** + * Handle sink + * @param subExchangisJob + * @param ctx + */ + void handleSink(SubExchangisJob subExchangisJob, ExchangisJobBuilderContext ctx) throws ErrorException; + + /** + * Order + * @return value + */ + default int order(){ + return Integer.MAX_VALUE; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/mappings/AbstractExchangisJobParamsMapping.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/mappings/AbstractExchangisJobParamsMapping.java new file mode 100644 index 000000000..aa14f0ebf --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/mappings/AbstractExchangisJobParamsMapping.java @@ -0,0 +1,47 @@ +package com.webank.wedatasphere.exchangis.job.server.builder.transform.mappings; + +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParamDefine; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParamSet; +import com.webank.wedatasphere.exchangis.job.server.builder.transform.handlers.SubExchangisJobHandler; +import org.apache.linkis.common.exception.ErrorException; + +import java.util.Arrays; +import java.util.Objects; +import java.util.Optional; + +/** + * Implement "SubExchangisJobHandler", only handle the params of job + */ +public abstract class AbstractExchangisJobParamsMapping implements SubExchangisJobHandler { + + @Override + public void handleSource(SubExchangisJob subExchangisJob, ExchangisJobBuilderContext ctx) throws ErrorException { + JobParamSet paramSet = subExchangisJob.getRealmParams(SubExchangisJob.REALM_JOB_CONTENT_SOURCE); + if (Objects.nonNull(paramSet)){ + Optional.ofNullable(sourceMappings()).ifPresent(jobParamDefines -> Arrays.asList(jobParamDefines).forEach(paramSet::addNonNull)); + } + } + + @Override + public void handleSink(SubExchangisJob subExchangisJob, ExchangisJobBuilderContext ctx) throws ErrorException { + JobParamSet paramSet = subExchangisJob.getRealmParams(SubExchangisJob.REALM_JOB_CONTENT_SINK); + if (Objects.nonNull(paramSet)){ + Optional.ofNullable(sourceMappings()).ifPresent(jobParamDefines -> Arrays.asList(jobParamDefines).forEach(paramSet::addNonNull)); + } + } + + /** + * Get param definition of source mapping + * @return definitions + */ + public abstract JobParamDefine[] sourceMappings(); + + + /** + * Get param definition of sink mapping + * @return + */ + public abstract JobParamDefine[] sinkMappings(); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/mappings/HiveDataxParamsMapping.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/mappings/HiveDataxParamsMapping.java new file mode 100644 index 000000000..5ffb6caa8 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/mappings/HiveDataxParamsMapping.java @@ -0,0 +1,25 @@ +package com.webank.wedatasphere.exchangis.job.server.builder.transform.mappings; + +import com.webank.wedatasphere.exchangis.job.domain.params.JobParamDefine; + +public class HiveDataxParamsMapping extends AbstractExchangisJobParamsMapping{ + @Override + public JobParamDefine[] sourceMappings() { + return new JobParamDefine[0]; + } + + @Override + public JobParamDefine[] sinkMappings() { + return new JobParamDefine[0]; + } + + @Override + public String dataSourceType() { + return "hive"; + } + + @Override + public boolean acceptEngine(String engineType) { + return "datax".equalsIgnoreCase(engineType); + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/mappings/HiveSqoopParamsMapping.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/mappings/HiveSqoopParamsMapping.java new file mode 100644 index 000000000..5cd5a00ab --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/mappings/HiveSqoopParamsMapping.java @@ -0,0 +1,41 @@ +package com.webank.wedatasphere.exchangis.job.server.builder.transform.mappings; + +import com.webank.wedatasphere.exchangis.job.domain.params.JobParamDefine; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParamSet; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParams; + +import java.util.function.BiFunction; + +/** + * Mapping of Hive in Sqoop + */ +public class HiveSqoopParamsMapping extends AbstractExchangisJobParamsMapping { + + @Override + public String dataSourceType() { + return "hive"; + } + + @Override + public boolean acceptEngine(String engineType) { + return "sqoop".equalsIgnoreCase(engineType); + } + + @Override + public JobParamDefine[] sourceMappings() { + return new JobParamDefine[]{ + //Unit test + JobParams.define("version", "source.version"), + JobParams.define("version", () -> "1.4.7"), + JobParams.define("tab", (BiFunction)(key, paramSet)->{ + JobParams.define("version").newParam(paramSet).getValue(); + return null; + }) + }; + } + + @Override + public JobParamDefine[] sinkMappings() { + return new JobParamDefine[0]; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/mappings/MySQLSqoopParamsMapping.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/mappings/MySQLSqoopParamsMapping.java new file mode 100644 index 000000000..c799a7751 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/mappings/MySQLSqoopParamsMapping.java @@ -0,0 +1,26 @@ +package com.webank.wedatasphere.exchangis.job.server.builder.transform.mappings; + +import com.webank.wedatasphere.exchangis.job.domain.params.JobParamDefine; +import com.webank.wedatasphere.exchangis.job.domain.params.JobParams; + +public class MySQLSqoopParamsMapping extends AbstractExchangisJobParamsMapping{ + @Override + public JobParamDefine[] sourceMappings() { + return new JobParamDefine[0]; + } + + @Override + public JobParamDefine[] sinkMappings() { + return new JobParamDefine[0]; + } + + @Override + public String dataSourceType() { + return "mysql"; + } + + @Override + public boolean acceptEngine(String engineType) { + return "sqoop".equalsIgnoreCase(engineType); + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/config/ModelMapperConfig.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/config/ModelMapperConfig.java new file mode 100644 index 000000000..ada40ed13 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/config/ModelMapperConfig.java @@ -0,0 +1,18 @@ +package com.webank.wedatasphere.exchangis.job.server.config; + +import org.modelmapper.ModelMapper; +import org.modelmapper.convention.MatchingStrategies; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class ModelMapperConfig { + + @Bean + public ModelMapper getModelMapper() { + ModelMapper modelMapper = new ModelMapper(); + modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT); + return modelMapper; + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisDataSourceFlowMetricsDTO.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisDataSourceFlowMetricsDTO.java new file mode 100644 index 000000000..f99a7184e --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisDataSourceFlowMetricsDTO.java @@ -0,0 +1,47 @@ +package com.webank.wedatasphere.exchangis.job.server.dto; + +// 数据源流量指标对象 +// datasource flow metrics pojo +public class ExchangisDataSourceFlowMetricsDTO { + + private String dataSourceTitle; + + private Long dataSourceId; + + // 监控的维度(秒、分钟、小时) + private String dimension; + + private String flow; + + public String getDataSourceTitle() { + return dataSourceTitle; + } + + public void setDataSourceTitle(String dataSourceTitle) { + this.dataSourceTitle = dataSourceTitle; + } + + public Long getDataSourceId() { + return dataSourceId; + } + + public void setDataSourceId(Long dataSourceId) { + this.dataSourceId = dataSourceId; + } + + public String getDimension() { + return dimension; + } + + public void setDimension(String dimension) { + this.dimension = dimension; + } + + public String getFlow() { + return flow; + } + + public void setFlow(String flow) { + this.flow = flow; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisEngineResourceMetricsDTO.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisEngineResourceMetricsDTO.java new file mode 100644 index 000000000..da95594f6 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisEngineResourceMetricsDTO.java @@ -0,0 +1,34 @@ +package com.webank.wedatasphere.exchangis.job.server.dto; + +public class ExchangisEngineResourceMetricsDTO { + + private String engine; + + private String cpu; + + private String mem; + + public String getEngine() { + return engine; + } + + public void setEngine(String engine) { + this.engine = engine; + } + + public String getCpu() { + return cpu; + } + + public void setCpu(String cpu) { + this.cpu = cpu; + } + + public String getMem() { + return mem; + } + + public void setMem(String mem) { + this.mem = mem; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisJobBasicInfoDTO.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisJobBasicInfoDTO.java new file mode 100644 index 000000000..ece45b5e8 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisJobBasicInfoDTO.java @@ -0,0 +1,121 @@ +package com.webank.wedatasphere.exchangis.job.server.dto; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import com.webank.wedatasphere.exchangis.job.enums.JobTypeEnum; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class ExchangisJobBasicInfoDTO { + + private int id; + + private Long projectId; + + private Long dssProjectId; + + private String dssProjectName; + + private String nodeId; + + private String nodeName; + + private String name; + + private JobTypeEnum jobType; + + private String engineType; + + private String jobLabels; + + private String jobDesc; + + private String jobName; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getJobName() { + return jobName; + } + + public void setJobName(String jobName) { + this.jobName = jobName; + } + + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + public Long getDssProjectId() { return dssProjectId; } + + public void setDssProjectId(Long dssProjectId) { this.dssProjectId = dssProjectId; } + + public String getNodeId() { + return nodeId; + } + + public void setNodeId(String nodeId) { + this.nodeId = nodeId; + } + + public String getNodeName() { return nodeName; } + + public void setNodeName(String nodeName) { this.nodeName = nodeName; } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public JobTypeEnum getJobType() { + return jobType; + } + + public void setJobType(JobTypeEnum jobType) { + this.jobType = jobType; + } + + public String getEngineType() { + return engineType; + } + + public void setEngineType(String engineType) { + this.engineType = engineType; + } + + public String getJobLabels() { + return jobLabels; + } + + public void setJobLabels(String jobLabels) { + this.jobLabels = jobLabels; + } + + public String getJobDesc() { + return jobDesc; + } + + public void setJobDesc(String jobDesc) { + this.jobDesc = jobDesc; + } + + public String getDssProjectName() { + return dssProjectName; + } + + public void setDssProjectName(String dssProjectName) { + this.dssProjectName = dssProjectName; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisJobContentDTO.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisJobContentDTO.java new file mode 100644 index 000000000..258f0de57 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisJobContentDTO.java @@ -0,0 +1,55 @@ +package com.webank.wedatasphere.exchangis.job.server.dto; + +public class ExchangisJobContentDTO { + + private String content; + + private String proxyUser; + + private String executeNode; + + private String syncType; + + private String jobParams; + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getProxyUser() { + return proxyUser; + } + + public void setProxyUser(String proxyUser) { + this.proxyUser = proxyUser; + } + + public String getExecuteNode() { + return executeNode; + } + + public void setExecuteNode(String executeNode) { + this.executeNode = executeNode; + } + + public String getSyncType() { + return syncType; + } + + public void setSyncType(String syncType) { + this.syncType = syncType; + } + + public String getJobParams() { + return jobParams; + } + + public void setJobParams(String jobParams) { + this.jobParams = jobParams; + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskIndicatorMetricsDTO.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskIndicatorMetricsDTO.java new file mode 100644 index 000000000..f380f73de --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskIndicatorMetricsDTO.java @@ -0,0 +1,38 @@ +package com.webank.wedatasphere.exchangis.job.server.dto; + +/** + * + * @Date 2022/1/8 19:48 + */ +public class ExchangisTaskIndicatorMetricsDTO { + + private Long exchangedRecords; + + private Long errorRecords; + + private Long ignoredRecords; + + public Long getExchangedRecords() { + return exchangedRecords; + } + + public void setExchangedRecords(Long exchangedRecords) { + this.exchangedRecords = exchangedRecords; + } + + public Long getErrorRecords() { + return errorRecords; + } + + public void setErrorRecords(Long errorRecords) { + this.errorRecords = errorRecords; + } + + public Long getIgnoredRecords() { + return ignoredRecords; + } + + public void setIgnoredRecords(Long ignoredRecords) { + this.ignoredRecords = ignoredRecords; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskMetricsDTO.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskMetricsDTO.java new file mode 100644 index 000000000..c4aa09471 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskMetricsDTO.java @@ -0,0 +1,42 @@ +package com.webank.wedatasphere.exchangis.job.server.dto; + +/** + * + * @Date 2022/1/8 19:33 + */ +public class ExchangisTaskMetricsDTO { + + private ExchangisTaskResourceUsedMetricsDTO resourceUsed; + + private ExchangisTaskTrafficMetricsDTO traffic; + + private ExchangisTaskIndicatorMetricsDTO indicator; + + public ExchangisTaskResourceUsedMetricsDTO getResourceUsed() { + return resourceUsed; + } + + public void setResourceUsed(ExchangisTaskResourceUsedMetricsDTO resourceUsed) { + this.resourceUsed = resourceUsed; + } + + public ExchangisTaskTrafficMetricsDTO getTraffic() { + return traffic; + } + + public void setTraffic(ExchangisTaskTrafficMetricsDTO traffic) { + this.traffic = traffic; + } + + public ExchangisTaskIndicatorMetricsDTO getIndicator() { + return indicator; + } + + public void setIndicator(ExchangisTaskIndicatorMetricsDTO indicator) { + this.indicator = indicator; + } + + /*public static class ExchangisTaskResourceUsedMetricsDTO{ + + }*/ +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskProcessMetricsDTO.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskProcessMetricsDTO.java new file mode 100644 index 000000000..f991d4368 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskProcessMetricsDTO.java @@ -0,0 +1,64 @@ +package com.webank.wedatasphere.exchangis.job.server.dto; + +public class ExchangisTaskProcessMetricsDTO { + + private String key; + + private String title; + + private Integer running; + + private Integer initialized; + + private Integer total; + + private String percentOfComplete; + + public Integer getRunning() { + return running; + } + + public void setRunning(Integer running) { + this.running = running; + } + + public Integer getInitialized() { + return initialized; + } + + public void setInitialized(Integer initialized) { + this.initialized = initialized; + } + + public Integer getTotal() { + return total; + } + + public void setTotal(Integer total) { + this.total = total; + } + + public String getPercentOfComplete() { + return percentOfComplete; + } + + public void setPercentOfComplete(String percentOfComplete) { + this.percentOfComplete = percentOfComplete; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskResourceUsedMetricsDTO.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskResourceUsedMetricsDTO.java new file mode 100644 index 000000000..7c1e5e6bd --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskResourceUsedMetricsDTO.java @@ -0,0 +1,28 @@ +package com.webank.wedatasphere.exchangis.job.server.dto; + +/** + * + * @Date 2022/1/8 19:43 + */ +public class ExchangisTaskResourceUsedMetricsDTO { + + private double cpu; + + private Long memory; + + public double getCpu() { + return cpu; + } + + public void setCpu(double cpu) { + this.cpu = cpu; + } + + public Long getMemory() { + return memory; + } + + public void setMemory(Long memory) { + this.memory = memory; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskStatusMetricsDTO.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskStatusMetricsDTO.java new file mode 100644 index 000000000..b3ba60b87 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskStatusMetricsDTO.java @@ -0,0 +1,64 @@ +package com.webank.wedatasphere.exchangis.job.server.dto; + +public class ExchangisTaskStatusMetricsDTO { + + private String jobName; + + private String taskName; + + private String status; + + private Integer num; + + private String createUser; + + private String proxyUser; + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Integer getNum() { + return num; + } + + public void setNum(Integer num) { + this.num = num; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getJobName() { + return jobName; + } + + public void setJobName(String jobName) { + this.jobName = jobName; + } + + public String getTaskName() { + return taskName; + } + + public void setTaskName(String taskName) { + this.taskName = taskName; + } + + public String getProxyUser() { + return proxyUser; + } + + public void setProxyUser(String proxyUser) { + this.proxyUser = proxyUser; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskTrafficMetricsDTO.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskTrafficMetricsDTO.java new file mode 100644 index 000000000..c04aad9f0 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExchangisTaskTrafficMetricsDTO.java @@ -0,0 +1,38 @@ +package com.webank.wedatasphere.exchangis.job.server.dto; + +/** + * + * @Date 2022/1/8 19:45 + */ +public class ExchangisTaskTrafficMetricsDTO { + + private String source; + + private String sink; + + private Long flow; + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public String getSink() { + return sink; + } + + public void setSink(String sink) { + this.sink = sink; + } + + public Long getFlow() { + return flow; + } + + public void setFlow(Long flow) { + this.flow = flow; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExportedProject.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExportedProject.java new file mode 100644 index 000000000..71b2fda58 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/ExportedProject.java @@ -0,0 +1,39 @@ +package com.webank.wedatasphere.exchangis.job.server.dto; + +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobVo; + +import java.util.List; + +/** + * @author tikazhang + * @Date 2022/3/14 12:22 + */ +public class ExportedProject { + String name; + List sqoops; + List dataxes; + + public List getSqoops() { + return sqoops; + } + + public void setSqoops(List sqoops) { + this.sqoops = sqoops; + } + + public List getDataxes() { + return dataxes; + } + + public void setDataxes(List dataxes) { + this.dataxes = dataxes; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/IdCatalog.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/IdCatalog.java new file mode 100644 index 000000000..8ba12b551 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/dto/IdCatalog.java @@ -0,0 +1,32 @@ +package com.webank.wedatasphere.exchangis.job.server.dto; + +import com.google.common.collect.Maps; + +import java.util.Map; + +/** + * @author tikazhang + * @Date 2022/3/15 10:33 + */ +public class IdCatalog { + + private Map sqoop = Maps.newHashMap(); + + private Map datax = Maps.newHashMap(); + + public Map getSqoop() { + return sqoop; + } + + public void setSqoop(Map sqoop) { + this.sqoop = sqoop; + } + + public Map getDatax() { + return datax; + } + + public void setDatax(Map datax) { + this.datax = datax; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisJobServerException.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisJobServerException.java new file mode 100644 index 000000000..bff9aa6f4 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisJobServerException.java @@ -0,0 +1,33 @@ + +package com.webank.wedatasphere.exchangis.job.server.exception; + + +import org.apache.linkis.common.exception.ErrorException; +import org.apache.linkis.common.exception.ExceptionLevel; +import org.apache.linkis.common.exception.LinkisRuntimeException; + + +public class ExchangisJobServerException extends ErrorException { + + public ExchangisJobServerException(int errCode, String desc) { + super(errCode, desc); + } + + public ExchangisJobServerException(int errorCode, String desc, Throwable throwable) { + super(errorCode, desc); + this.initCause(throwable); + } + + public static class Runtime extends LinkisRuntimeException { + + public Runtime(int errCode, String desc, Throwable t) { + super(errCode, desc); + super.initCause(t); + } + + @Override + public ExceptionLevel getLevel() { + return ExceptionLevel.ERROR; + } + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisSchedulerException.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisSchedulerException.java new file mode 100644 index 000000000..57f6bdd2d --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisSchedulerException.java @@ -0,0 +1,30 @@ +package com.webank.wedatasphere.exchangis.job.server.exception; + +import org.apache.linkis.common.exception.ErrorException; +import org.apache.linkis.common.exception.ExceptionLevel; +import org.apache.linkis.common.exception.LinkisRuntimeException; + +import static com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode.SCHEDULER_ERROR; + +/** + * Exception in scheduling + */ +public class ExchangisSchedulerException extends ErrorException { + public ExchangisSchedulerException(String desc, Throwable t) { + super(SCHEDULER_ERROR.getCode(), desc); + super.initCause(t); + } + + public static class Runtime extends LinkisRuntimeException{ + + public Runtime(String desc, Throwable t) { + super(SCHEDULER_ERROR.getCode(), desc); + super.initCause(t); + } + + @Override + public ExceptionLevel getLevel() { + return ExceptionLevel.ERROR; + } + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisSchedulerRetryException.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisSchedulerRetryException.java new file mode 100644 index 000000000..0339fbaaf --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisSchedulerRetryException.java @@ -0,0 +1,25 @@ +package com.webank.wedatasphere.exchangis.job.server.exception; + +import org.apache.linkis.common.exception.LinkisRetryException; + +import static com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode.SCHEDULER_ERROR; + +/** + * Exception in scheduling (could be retried in limit) + */ +public class ExchangisSchedulerRetryException extends LinkisRetryException { + private int retryNum = 0; + + public int getRetryNum() { + return retryNum; + } + + public void setRetryNum(int retryNum) { + this.retryNum = retryNum; + } + + public ExchangisSchedulerRetryException(String desc, Throwable t) { + super(SCHEDULER_ERROR.getCode(), desc); + super.initCause(t); + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisTaskExecuteException.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisTaskExecuteException.java new file mode 100644 index 000000000..a7cdff332 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisTaskExecuteException.java @@ -0,0 +1,26 @@ +package com.webank.wedatasphere.exchangis.job.server.exception; + +import org.apache.linkis.common.exception.ErrorException; +import org.apache.linkis.common.exception.ExceptionLevel; +import org.apache.linkis.common.exception.LinkisRuntimeException; + +import static com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode.TASK_EXECUTE_ERROR; + +public class ExchangisTaskExecuteException extends ErrorException { + public ExchangisTaskExecuteException(String desc, Throwable t) { + super(TASK_EXECUTE_ERROR.getCode(), desc); + super.initCause(t); + } + public static class Runtime extends LinkisRuntimeException { + + public Runtime(String desc, Throwable t) { + super(TASK_EXECUTE_ERROR.getCode(), desc); + super.initCause(t); + } + + @Override + public ExceptionLevel getLevel() { + return ExceptionLevel.ERROR; + } + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisTaskGenerateException.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisTaskGenerateException.java new file mode 100644 index 000000000..2cf8832a5 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisTaskGenerateException.java @@ -0,0 +1,15 @@ +package com.webank.wedatasphere.exchangis.job.server.exception; + +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; + +import static com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode.TASK_GENERATE_ERROR; + +/** + * Exception in generating tasks of job + */ +public class ExchangisTaskGenerateException extends ExchangisJobException { + public ExchangisTaskGenerateException(String desc, Throwable t) { + super(TASK_GENERATE_ERROR.getCode(), desc); + super.initCause(t); + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisTaskObserverException.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisTaskObserverException.java new file mode 100644 index 000000000..6a9275318 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/exception/ExchangisTaskObserverException.java @@ -0,0 +1,44 @@ +package com.webank.wedatasphere.exchangis.job.server.exception; + +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import org.apache.linkis.common.exception.ExceptionLevel; +import org.apache.linkis.common.exception.LinkisRuntimeException; + +import static com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode.TASK_OBSERVER_ERROR; + +/** + * Exception in subscribing task + */ +public class ExchangisTaskObserverException extends ExchangisJobException { + + private String methodName; + public ExchangisTaskObserverException(String methodName, String desc, Throwable t) { + this(desc, t); + this.methodName = methodName; + } + public ExchangisTaskObserverException(String desc, Throwable t) { + super(TASK_OBSERVER_ERROR.getCode(), desc); + super.initCause(t); + } + + public String getMethodName() { + return methodName; + } + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + public static class Runtime extends LinkisRuntimeException { + + public Runtime(String desc, Throwable t) { + super(TASK_OBSERVER_ERROR.getCode(), desc); + super.initCause(t); + } + + @Override + public ExceptionLevel getLevel() { + return ExceptionLevel.ERROR; + } + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/AbstractTaskExecution.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/AbstractTaskExecution.java new file mode 100644 index 000000000..3be6df394 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/AbstractTaskExecution.java @@ -0,0 +1,204 @@ +package com.webank.wedatasphere.exchangis.job.server.execution; + + +import com.webank.wedatasphere.exchangis.job.exception.ExchangisOnEventException; +import com.webank.wedatasphere.exchangis.job.launcher.ExchangisTaskLaunchManager; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskExecuteException; +import com.webank.wedatasphere.exchangis.job.server.execution.events.*; +import com.webank.wedatasphere.exchangis.job.server.execution.loadbalance.TaskSchedulerLoadBalancer; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.ExchangisSchedulerTask; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.SchedulerThread; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks.AbstractLoadBalanceSchedulerTask; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks.SubmitSchedulerTask; +import com.webank.wedatasphere.exchangis.job.server.execution.subscriber.TaskChooseRuler; +import com.webank.wedatasphere.exchangis.job.server.execution.subscriber.TaskObserver; +import com.webank.wedatasphere.exchangis.job.utils.TypeGenericUtils; +import org.apache.linkis.scheduler.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +/** + * Contains: + * 1) TaskManager to manager running task. + * 2) TaskObserver to observe initial task. + * 3) TaskScheduler to submit scheduler task. + */ +public abstract class AbstractTaskExecution implements TaskExecution { + + private static final Logger LOG = LoggerFactory.getLogger(AbstractTaskExecution.class); + private boolean initial = false; + + /** + * Execution listeners + */ + private List listeners = new ArrayList<>(); + + @Override + public void submit(LaunchableExchangisTask task) throws ExchangisTaskExecuteException{ + SubmitSchedulerTask submitSchedulerTask = new SubmitSchedulerTask(task); + try { + submit(submitSchedulerTask); + } catch (ExchangisSchedulerException e) { + throw new ExchangisTaskExecuteException("Submit task [" + task.getId() + "] to schedule occurred error", e); + } + } + + @Override + @SuppressWarnings("unchecked") + public void submit(ExchangisSchedulerTask schedulerTask) throws ExchangisSchedulerException { + try{ + preSubmit(schedulerTask); + if (schedulerTask instanceof AbstractLoadBalanceSchedulerTask){ + try { + ((AbstractLoadBalanceSchedulerTask) schedulerTask) + .setSchedulerLoadBalancer(getTaskSchedulerLoadBalancer()); + }catch (Exception e){ + //Ignore the exception + LOG.warn("Load balance scheduler task [" + schedulerTask.getClass().getSimpleName() + "] doesn't match the load balancer", e); + } + } + getScheduler().submit(schedulerTask); + }catch (Exception e){ + throw new ExchangisSchedulerException("Submit scheduler task [id: " + schedulerTask.getId() + ", type: " + schedulerTask.getClass().getName() + "] occurred error", e); + } + } + + @Override + public void start() throws ExchangisTaskExecuteException { + if (!initial){ + init(); + } + // Start the scheduler + getScheduler().start(); + // Start the observers + Optional.ofNullable(getTaskObservers()).ifPresent(taskObservers -> taskObservers.forEach(TaskObserver::start)); + // Start the loadBalancer + TaskSchedulerLoadBalancer loadBalancer = getTaskSchedulerLoadBalancer(); + if (Objects.nonNull(loadBalancer) && loadBalancer instanceof SchedulerThread){ + ((SchedulerThread) loadBalancer).start(); + } + } + + @Override + public void stop() { + // Stop the observers + Optional.ofNullable(getTaskObservers()).ifPresent(taskObservers -> taskObservers.forEach(TaskObserver::stop)); + // Stop the loadBalancer + TaskSchedulerLoadBalancer loadBalancer = getTaskSchedulerLoadBalancer(); + if (Objects.nonNull(loadBalancer) && loadBalancer instanceof SchedulerThread){ + ((SchedulerThread) loadBalancer).stop(); + } + // Stop the scheduler + getScheduler().shutdown(); + } + + + @SuppressWarnings("unchecked") + protected synchronized void init() throws ExchangisTaskExecuteException{ + if (!initial){ + Scheduler scheduler = getScheduler(); + if (Objects.isNull(scheduler)){ + throw new ExchangisTaskExecuteException("Scheduler cannot be empty in task execution", null); + } + TaskManager taskManager = getTaskManager(); + if (Objects.nonNull(taskManager) && taskManager instanceof AbstractTaskManager){ + ((AbstractTaskManager) taskManager).setExecutionListener(new CombinedTaskExecutionListener()); + } + List> observers = getTaskObservers(); + Optional.ofNullable(observers).ifPresent(taskObservers -> taskObservers.forEach(observer -> { + observer.setScheduler(scheduler); + Class subType = TypeGenericUtils.getActualTypeFormGenericClass(observer.getClass(), null, 0); + if (LaunchedExchangisTask.class.equals(subType)){ + ((TaskObserver)observer).setTaskManager(taskManager); + } else if (LaunchableExchangisTask.class.equals(subType)){ + ((TaskObserver)observer).setTaskExecution(this); + ((TaskObserver)observer).setTaskChooseRuler(getTaskChooseRuler()); + } + })); + initial = true; + } + } + + @Override + public void addListener(TaskExecutionListener listener) { + this.listeners.add(listener); + } + + private class CombinedTaskExecutionListener implements TaskExecutionListener{ + + @Override + public void onEvent(TaskExecutionEvent taskExecutionEvent) throws ExchangisOnEventException { + for(TaskExecutionListener listener : listeners){ + listener.onEvent(taskExecutionEvent); + } + } + + @Override + public void onMetricsUpdate(TaskMetricsUpdateEvent metricsUpdateEvent) { + // Ignore + } + + @Override + public void onStatusUpdate(TaskStatusUpdateEvent statusUpdateEvent) { + // Ignore + } + + @Override + public void onLaunch(TaskLaunchEvent infoUpdateEvent) { + // Ignore + } + + @Override + public void onDelete(TaskDeleteEvent deleteEvent) { + // Ignore + } + + @Override + public void onProgressUpdate(TaskProgressUpdateEvent updateEvent) { + // Ignore + } + } + + /** + * Pre hook of submitting + * @param schedulerTask scheduler task + */ + public void preSubmit(ExchangisSchedulerTask schedulerTask){ + // Do nothing + } + /** + * TaskManager of launchedExchangisTask + * @return task Manager + */ + protected abstract TaskManager getTaskManager(); + + /** + * TaskObserver + * @return list + */ + protected abstract List> getTaskObservers(); + + /** + * Scheduler + * @return Scheduler + */ + protected abstract Scheduler getScheduler(); + + protected abstract TaskChooseRuler getTaskChooseRuler(); + /** + * Launch manager + * @return launch manager + */ + protected abstract ExchangisTaskLaunchManager getExchangisLaunchManager(); + + protected abstract TaskSchedulerLoadBalancer getTaskSchedulerLoadBalancer(); + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/AbstractTaskManager.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/AbstractTaskManager.java new file mode 100644 index 000000000..332ac0de7 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/AbstractTaskManager.java @@ -0,0 +1,250 @@ +package com.webank.wedatasphere.exchangis.job.server.execution; + +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskProgressInfo; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; +import com.webank.wedatasphere.exchangis.job.listener.events.JobLogEvent; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskExecuteException; +import com.webank.wedatasphere.exchangis.job.server.execution.events.*; +import com.webank.wedatasphere.exchangis.job.server.log.JobServerLogging; +import com.webank.wedatasphere.exchangis.job.server.log.cache.JobLogCacheUtils; + +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * Launched task manager + */ +public abstract class AbstractTaskManager implements TaskManager { + + /** + * Execution listener + */ + private TaskExecutionListener executionListener; + + /** + * Contains the job_execution_id + */ + private List jobExecutionIds = new CopyOnWriteArrayList<>(); + + /** + * Task id => Running task + */ + private ConcurrentHashMap runningTasks = new ConcurrentHashMap<>(); + + /** + * job_execution_id => List(Running tasks) + */ + private ConcurrentHashMap jobWrappers = new ConcurrentHashMap<>(); + + /** + * Collect the job_execution_id from running tasks + * @return list + */ + public List getJobExecutionIds(){ + return jobExecutionIds; + } + + @Override + public List getRunningTasks() { + return new ArrayList<>(runningTasks.values()); + } + + @Override + public void cancelRunningTask(String taskId) { + LaunchedExchangisTask task = runningTasks.get(taskId); + if (Objects.nonNull(task)){ + onEvent(new TaskStatusUpdateEvent(task, TaskStatus.Cancelled)); + info(task, "Status of task: [name: {}, id: {}] change {} => {}", + task.getName(), task.getTaskId(), task.getStatus(), TaskStatus.Cancelled); + JobLogCacheUtils.flush(task.getJobExecutionId(), false); + runningTasks.remove(taskId); + JobWrapper wrapper = jobWrappers.get(task.getJobExecutionId()); + if (Objects.nonNull(wrapper)){ + wrapper.removeTask(task); + } + } + } + + @Override + public void addRunningTask(LaunchedExchangisTask task) { + task.setStatus(TaskStatus.Running); + task.setRunningTime(Calendar.getInstance().getTime()); + onEvent(new TaskLaunchEvent(task)); + info(task, "Status of task: [name: {}, id: {}] change to {}, info: [{}]", task.getName(), task.getTaskId(), task.getStatus(), Json.toJson(task, null)); + if (Objects.isNull(runningTasks.putIfAbsent(task.getTaskId(), task))){ + jobWrappers.compute(task.getJobExecutionId(), (jobExecutionId, jobWrapper) -> { + if (Objects.nonNull(jobWrapper) && jobWrapper.addTask(task)){ + return jobWrapper; + } + jobWrapper = new JobWrapper(jobExecutionId); + jobWrapper.addTask(task); + return jobWrapper; + }); + } + } + + + @Override + public void removeRunningTask(String taskId) { + removeRunningTaskInner(taskId, true); + } + + @Override + public boolean refreshRunningTaskMetrics(LaunchedExchangisTask task, Map metricsMap) { + task = runningTasks.get(task.getTaskId()); + if (Objects.nonNull(task)) { + onEvent(new TaskMetricsUpdateEvent(task, metricsMap)); + task.setMetrics(null); + task.setMetricsMap(metricsMap); + trace(task, "Metrics info of task: [{}]", Json.toJson(metricsMap, null)); + return true; + } + return false; + } + + @Override + public boolean refreshRunningTaskStatus(LaunchedExchangisTask task, TaskStatus status) { + TaskStatus beforeStatus = task.getStatus(); + if (TaskStatus.isCompleted(status)){ + info(task, "Status of task: [name: {}, id: {}] change {} => {}", + task.getName(), task.getTaskId(), beforeStatus, status); + onEvent(new TaskStatusUpdateEvent(task, status)); + removeRunningTaskInner(task.getTaskId(), false); + return true; + } else { + task = runningTasks.get(task.getTaskId()); + if (Objects.nonNull(task) ) { + onEvent(new TaskStatusUpdateEvent(task, status)); + if (isTransition(task, status)) { + info(task, "Status of task: [name: {}, id: {}] change {} => {}", + task.getName(), task.getTaskId(), beforeStatus, status); + } + task.setStatus(status); + return true; + } + return false; + } + } + + @Override + public boolean refreshRunningTaskProgress(LaunchedExchangisTask task, TaskProgressInfo progressInfo) { + task = runningTasks.get(task.getTaskId()); + if (Objects.nonNull(task)){ + onEvent(new TaskProgressUpdateEvent(task, progressInfo)); + if (task.getProgress() != progressInfo.getProgress()){ + info(task, "Progress of task: [{}] change {} => {}", task.getTaskId(), task.getProgress(), progressInfo.getProgress()); + } + task.setProgress(progressInfo.getProgress()); + return true; + } + return false; + } + + @Override + public LaunchedExchangisTask getRunningTask(String taskId) { + return runningTasks.get(taskId); + } + + public TaskExecutionListener getExecutionListener() { + return executionListener; + } + + public void setExecutionListener(TaskExecutionListener executionListener) { + this.executionListener = executionListener; + } + + /** + * Remove inner + * @param taskId task id + * @param updateStatus if update status + */ + private void removeRunningTaskInner(String taskId, boolean updateStatus){ + LaunchedExchangisTask task = runningTasks.get(taskId); + if (Objects.nonNull(task)){ + if (updateStatus) { + onEvent(new TaskStatusUpdateEvent(task, task.getStatus())); + } + runningTasks.remove(taskId); + JobWrapper wrapper = jobWrappers.get(task.getJobExecutionId()); + if (Objects.nonNull(wrapper)){ + wrapper.removeTask(task); + } + } + } + /** + * OnEvent + * @param event event entity + */ + public void onEvent(TaskExecutionEvent event){ + try { + executionListener.onEvent(event); + } catch (Exception e) { + throw new ExchangisTaskExecuteException.Runtime("Fail to call 'onEvent' event: [id: " + event.eventId() +", type:" + event.getClass().getSimpleName() +"]", e); + } + } + + private boolean isTransition(LaunchedExchangisTask task, TaskStatus status){ + if (Objects.nonNull(task)){ + return !task.getStatus().equals(status); + } + return false; + } + + @Override + public JobLogEvent getJobLogEvent(JobLogEvent.Level level, LaunchedExchangisTask task, String message, Object... args) { + return new JobLogEvent(level, task.getExecuteUser(), task.getJobExecutionId(), message, args); + } + + private class JobWrapper{ + + /** + * job_execution_id + */ + String jobExecutionId; + + boolean destroy = false; + + JobWrapper(String jobExecutionId){ + this.jobExecutionId = jobExecutionId; + jobExecutionIds.add(jobExecutionId); + } + + Map tasksInJob = new HashMap<>(); + + final AtomicInteger taskNum = new AtomicInteger(0); + + /** + * Remove task (if the task list is empty, remove self from the map) + * @param task task + */ + public void removeTask(LaunchedExchangisTask task) { + synchronized (taskNum) { + if (Objects.nonNull(tasksInJob.remove(task.getTaskId()))) { + if (taskNum.decrementAndGet() == 0) { + // Flush the job log cache + JobLogCacheUtils.flush(jobExecutionId, true); + jobWrappers.remove(jobExecutionId); + jobExecutionIds.remove(jobExecutionId); + destroy = true; + } + } + } + } + + public boolean addTask(LaunchedExchangisTask task){ + synchronized (taskNum) { + if (!destroy) { + if (Objects.isNull(tasksInJob.put(task.getTaskId(), task))) { + taskNum.getAndIncrement(); + } + return true; + } + } + return false; + } + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/DefaultTaskExecution.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/DefaultTaskExecution.java new file mode 100644 index 000000000..07ed20e1d --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/DefaultTaskExecution.java @@ -0,0 +1,124 @@ +package com.webank.wedatasphere.exchangis.job.server.execution; + + +import com.webank.wedatasphere.exchangis.job.launcher.ExchangisTaskLaunchManager; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskExecuteException; +import com.webank.wedatasphere.exchangis.job.server.execution.loadbalance.TaskSchedulerLoadBalancer; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.ExchangisSchedulerTask; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks.MetricUpdateSchedulerTask; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks.StatusUpdateSchedulerTask; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks.SubmitSchedulerTask; +import com.webank.wedatasphere.exchangis.job.server.execution.subscriber.TaskChooseRuler; +import com.webank.wedatasphere.exchangis.job.server.execution.subscriber.TaskObserver; +import org.apache.linkis.scheduler.Scheduler; + +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +/** + * Default task execution + */ +public class DefaultTaskExecution extends AbstractTaskExecution{ + + public static final String DEFAULT_LAUNCHER_NAME = "Linkis"; + /** + * Scheduler + */ + private Scheduler scheduler; + + /** + * TaskManager + */ + private TaskManager taskManager; + + /** + * Observer list + */ + private List> taskObservers; + + private TaskChooseRuler taskChooseRuler; + /** + * load balancer + */ + private TaskSchedulerLoadBalancer taskSchedulerLoadBalancer; + + /** + * Launch manager + */ + private ExchangisTaskLaunchManager launchManager; + /** + * + * @param scheduler scheduler + * @param launchManager launch manager + * @param taskManager task manager for launched task + * @param taskObservers task observers + * @param taskSchedulerLoadBalancer load balancer + * @param taskChooseRuler choose ruler + */ + public DefaultTaskExecution(Scheduler scheduler, ExchangisTaskLaunchManager launchManager, + TaskManager taskManager, List> taskObservers, + TaskSchedulerLoadBalancer taskSchedulerLoadBalancer, + TaskChooseRuler taskChooseRuler){ + this.scheduler = scheduler; + this.taskManager = taskManager; + this.taskObservers = taskObservers; + this.launchManager = launchManager; + this.taskSchedulerLoadBalancer = taskSchedulerLoadBalancer; + this.taskChooseRuler = taskChooseRuler; + } + + @Override + protected synchronized void init() throws ExchangisTaskExecuteException { + super.init(); + Optional.ofNullable(getTaskSchedulerLoadBalancer()).ifPresent(loadBalancer -> { + loadBalancer.registerSchedulerTask(StatusUpdateSchedulerTask.class); + loadBalancer.registerSchedulerTask(MetricUpdateSchedulerTask.class); + }); + } + + @Override + public void preSubmit(ExchangisSchedulerTask schedulerTask) { + if (schedulerTask instanceof SubmitSchedulerTask){ + SubmitSchedulerTask submitSchedulerTask = ((SubmitSchedulerTask) schedulerTask); + if (Objects.nonNull(getExchangisLaunchManager())){ + submitSchedulerTask.setLauncher(getExchangisLaunchManager().getTaskLauncher(DEFAULT_LAUNCHER_NAME)); + } + submitSchedulerTask.setTaskManager(getTaskManager()); + submitSchedulerTask.setLoadBalancer(getTaskSchedulerLoadBalancer()); + } + } + + @Override + protected TaskManager getTaskManager() { + return this.taskManager; + } + + @Override + protected List> getTaskObservers() { + return this.taskObservers; + } + + @Override + protected Scheduler getScheduler() { + return this.scheduler; + } + + @Override + protected TaskChooseRuler getTaskChooseRuler() { + return taskChooseRuler; + } + + @Override + protected ExchangisTaskLaunchManager getExchangisLaunchManager() { + return launchManager; + } + + @Override + protected TaskSchedulerLoadBalancer getTaskSchedulerLoadBalancer() { + return this.taskSchedulerLoadBalancer; + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/DefaultTaskManager.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/DefaultTaskManager.java new file mode 100644 index 000000000..d36b70c89 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/DefaultTaskManager.java @@ -0,0 +1,23 @@ +package com.webank.wedatasphere.exchangis.job.server.execution; + +import com.webank.wedatasphere.exchangis.job.listener.JobLogListener; + +/** + * Default implement + */ +public class DefaultTaskManager extends AbstractTaskManager{ + + /** + * Log listener + */ + private JobLogListener jobLogListener; + + public DefaultTaskManager(JobLogListener jobLogListener) { + this.jobLogListener = jobLogListener; + } + + @Override + public JobLogListener getJobLogListener() { + return this.jobLogListener; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/TaskExecution.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/TaskExecution.java new file mode 100644 index 000000000..57679fdf5 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/TaskExecution.java @@ -0,0 +1,33 @@ +package com.webank.wedatasphere.exchangis.job.server.execution; + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisTask; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskExecuteException; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.ExchangisSchedulerTask; +import org.apache.linkis.scheduler.Scheduler; + +/** + * Task execution + */ +public interface TaskExecution { + + void submit(T task) throws ExchangisTaskExecuteException; + /** + * Submit scheduler task + * @param schedulerTask scheduler task + */ + void submit(ExchangisSchedulerTask schedulerTask) throws ExchangisSchedulerException; + + /** + * Start execution + */ + void start() throws ExchangisTaskExecuteException; + + /** + * Stop execution + */ + void stop(); + + void addListener(TaskExecutionListener listener); + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/TaskExecutionListener.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/TaskExecutionListener.java new file mode 100644 index 000000000..e7a119334 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/TaskExecutionListener.java @@ -0,0 +1,60 @@ +package com.webank.wedatasphere.exchangis.job.server.execution; + +import com.webank.wedatasphere.exchangis.job.exception.ExchangisOnEventException; +import com.webank.wedatasphere.exchangis.job.listener.ExchangisListener; +import com.webank.wedatasphere.exchangis.job.server.execution.events.*; + +/** + * Execution listener + */ +public interface TaskExecutionListener extends ExchangisListener { + /** + * Listen event during task execution + * @param event event + */ + default void onEvent(TaskExecutionEvent event) throws ExchangisOnEventException{ + getLogger().trace("Event: [id: {}, type: {}] in listener [{}]", event.eventId(), event.getClass().getSimpleName(), + this.getClass().getSimpleName()); + if (event instanceof TaskMetricsUpdateEvent){ + onMetricsUpdate((TaskMetricsUpdateEvent)event); + } else if (event instanceof TaskStatusUpdateEvent){ + onStatusUpdate((TaskStatusUpdateEvent)event); + } else if (event instanceof TaskLaunchEvent){ + onLaunch((TaskLaunchEvent)event); + } else if (event instanceof TaskDeleteEvent){ + onDelete((TaskDeleteEvent)event); + } else if (event instanceof TaskProgressUpdateEvent){ + onProgressUpdate((TaskProgressUpdateEvent)event); + } + } + + /** + * Listen metrics update + * @param metricsUpdateEvent update event + */ + void onMetricsUpdate(TaskMetricsUpdateEvent metricsUpdateEvent) throws ExchangisOnEventException; + + /** + * Status update + * @param statusUpdateEvent update event + */ + void onStatusUpdate(TaskStatusUpdateEvent statusUpdateEvent) throws ExchangisOnEventException; + + /** + * Info update + * @param infoUpdateEvent update event + */ + void onLaunch(TaskLaunchEvent infoUpdateEvent) throws ExchangisOnEventException; + + /** + * Delete + * @param deleteEvent delete event + */ + void onDelete(TaskDeleteEvent deleteEvent) throws ExchangisOnEventException; + + /** + * Progress update + * @param updateEvent update event + */ + void onProgressUpdate(TaskProgressUpdateEvent updateEvent) throws ExchangisOnEventException; +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/TaskManager.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/TaskManager.java new file mode 100644 index 000000000..0ffecb43a --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/TaskManager.java @@ -0,0 +1,68 @@ +package com.webank.wedatasphere.exchangis.job.server.execution; + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskProgressInfo; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; +import com.webank.wedatasphere.exchangis.job.listener.JobLogListener; +import com.webank.wedatasphere.exchangis.job.server.log.JobServerLogging; + +import java.util.List; +import java.util.Map; + +/** + * Task manager + */ +public interface TaskManager extends JobServerLogging { + + + List getRunningTasks(); + + /** + * Cancel running task + * @param taskId task id + */ + void cancelRunningTask(String taskId); + + /** + * Add running task to manager + * @param task running task + */ + void addRunningTask(T task); + + /** + * Remove the running task + * @param taskId task id + */ + void removeRunningTask(String taskId); + + /** + * Refresh running task metrics + * @param task + */ + boolean refreshRunningTaskMetrics(T task, Map metricsMap); + + /** + * Refresh running task status + * @param task + * @param status + * @return + */ + boolean refreshRunningTaskStatus(T task, TaskStatus status); + + /** + * Refresh progress + * @param task + * @param progressInfo + * @return + */ + boolean refreshRunningTaskProgress(T task, TaskProgressInfo progressInfo); + /** + * Get running task + * @param taskId task id + * @return T + */ + T getRunningTask(String taskId); + + JobLogListener getJobLogListener(); + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskDeleteEvent.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskDeleteEvent.java new file mode 100644 index 000000000..ec466f42a --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskDeleteEvent.java @@ -0,0 +1,24 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.events; + +public class TaskDeleteEvent extends TaskExecutionEvent { + + private String taskId; + + public TaskDeleteEvent(String taskId) { + super(null); + this.taskId = taskId; + } + + @Override + public String eventId() { + return "_TaskExecution_" + this.taskId; + } + + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskExecutionEvent.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskExecutionEvent.java new file mode 100644 index 000000000..b0523a552 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskExecutionEvent.java @@ -0,0 +1,37 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.events; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.listener.ExchangisEvent; + +public class TaskExecutionEvent implements ExchangisEvent { + private long eventTime; + + private LaunchedExchangisTask launchedExchangisTask; + public TaskExecutionEvent(LaunchedExchangisTask task){ + this.eventTime = System.currentTimeMillis(); + this.launchedExchangisTask = task; + } + @Override + public String eventId() { + return "_TaskExecution_" + launchedExchangisTask.getTaskId(); + } + + @Override + public void setEventId(String eventId) { + //null + } + + public LaunchedExchangisTask getLaunchedExchangisTask() { + return launchedExchangisTask; + } + + @Override + public long getEventTime() { + return this.eventTime; + } + + @Override + public void setEventTime(long timestamp) { + this.eventTime = timestamp; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskLaunchEvent.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskLaunchEvent.java new file mode 100644 index 000000000..cb4e034be --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskLaunchEvent.java @@ -0,0 +1,13 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.events; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; + +/** + * Insert event + */ +public class TaskLaunchEvent extends TaskExecutionEvent{ + + public TaskLaunchEvent(LaunchedExchangisTask task) { + super(task); + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskMetricsUpdateEvent.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskMetricsUpdateEvent.java new file mode 100644 index 000000000..3d46d9fd1 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskMetricsUpdateEvent.java @@ -0,0 +1,27 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.events; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; + +import java.util.HashMap; +import java.util.Map; + +/** + * Updating of task info + */ +public class TaskMetricsUpdateEvent extends TaskExecutionEvent{ + + private Map metrics = new HashMap<>(); + + public TaskMetricsUpdateEvent(LaunchedExchangisTask task, Map metrics) { + super(task); + this.metrics = metrics; + } + + public Map getMetrics() { + return metrics; + } + + public void setMetrics(Map metrics) { + this.metrics = metrics; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskProgressUpdateEvent.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskProgressUpdateEvent.java new file mode 100644 index 000000000..8339c53a9 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskProgressUpdateEvent.java @@ -0,0 +1,25 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.events; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskProgressInfo; + +/** + * Update of task progress + */ +public class TaskProgressUpdateEvent extends TaskExecutionEvent{ + + private TaskProgressInfo progressInfo; + + public TaskProgressUpdateEvent(LaunchedExchangisTask task, TaskProgressInfo progressInfo){ + super(task); + this.progressInfo = progressInfo; + } + + public TaskProgressInfo getProgressInfo() { + return progressInfo; + } + + public void setProgressInfo(TaskProgressInfo progressInfo) { + this.progressInfo = progressInfo; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskStatusUpdateEvent.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskStatusUpdateEvent.java new file mode 100644 index 000000000..33754ead9 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/events/TaskStatusUpdateEvent.java @@ -0,0 +1,25 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.events; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; + +/** + * Updating of task status + */ +public class TaskStatusUpdateEvent extends TaskExecutionEvent{ + + private TaskStatus updateStatus; + + public TaskStatusUpdateEvent(LaunchedExchangisTask task, TaskStatus status) { + super(task); + this.updateStatus = status; + } + + public TaskStatus getUpdateStatus() { + return updateStatus; + } + + public void setUpdateStatus(TaskStatus updateStatus) { + this.updateStatus = updateStatus; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/AbstractTaskGenerator.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/AbstractTaskGenerator.java new file mode 100644 index 000000000..f6be48332 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/AbstractTaskGenerator.java @@ -0,0 +1,136 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.generator; + +import com.webank.wedatasphere.exchangis.job.builder.manager.DefaultExchangisJobBuilderManager; +import com.webank.wedatasphere.exchangis.job.builder.manager.ExchangisJobBuilderManager; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisJob; +import com.webank.wedatasphere.exchangis.job.listener.JobLogListener; +import com.webank.wedatasphere.exchangis.job.listener.events.JobLogEvent; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskGenerateException; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.events.TaskGenerateErrorEvent; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.events.TaskGenerateEvent; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.events.TaskGenerateInitEvent; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.events.TaskGenerateSuccessEvent; +import org.apache.linkis.common.exception.ErrorException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; + +/** + * Contains the main progress for generating + */ +public abstract class AbstractTaskGenerator implements TaskGenerator { + + private static final Logger LOG = LoggerFactory.getLogger(AbstractTaskGenerator.class); + + private List listeners = new ArrayList<>(); + + protected TaskGeneratorContext generatorContext; + + @Override + public void init() throws ExchangisJobException { + } + + @Override + public LaunchableExchangisJob init(ExchangisJobInfo jobInfo) throws ExchangisTaskGenerateException { + Calendar calendar = Calendar.getInstance(); + LaunchableExchangisJob launchableExchangisJob = new LaunchableExchangisJob(); + launchableExchangisJob.setExchangisJobInfo(jobInfo); + launchableExchangisJob.setName(jobInfo.getName()); + launchableExchangisJob.setEngineType(jobInfo.getEngineType()); + launchableExchangisJob.setJobLabel(jobInfo.getJobLabel()); + launchableExchangisJob.setCreateTime(calendar.getTime()); + launchableExchangisJob.setLastUpdateTime(calendar.getTime()); + launchableExchangisJob.setId(jobInfo.getId()); + launchableExchangisJob.setExecUser(jobInfo.getExecuteUser()); + launchableExchangisJob.setCreateUser(jobInfo.getCreateUser()); + // Generate launchable exchangis job id to UUID + launchableExchangisJob.setJobExecutionId(UUID.randomUUID().toString()); + LOG.info("Generate job execution id: [{}] for job: [{}]" , launchableExchangisJob.getJobExecutionId(), launchableExchangisJob.getExchangisJobInfo().getName()); + onEvent(new TaskGenerateInitEvent(launchableExchangisJob)); + return launchableExchangisJob; + } + + @Override + public LaunchableExchangisJob generate(LaunchableExchangisJob launchableExchangisJob, String tenancy) throws ExchangisTaskGenerateException { + if (Objects.isNull(launchableExchangisJob.getExchangisJobInfo())){ + throw new ExchangisTaskGenerateException("Job info of launchableExchangisJob cannot be empty", null); + } + launchableExchangisJob.setCreateUser(tenancy); + try { + execute(launchableExchangisJob, getTaskGeneratorContext(), tenancy); + } catch(ErrorException e){ + if (e instanceof ExchangisTaskGenerateException){ + throw (ExchangisTaskGenerateException)e; + } + throw new ExchangisTaskGenerateException("Error occurred in generating progress", e); + } + return launchableExchangisJob; + } + + @Override + public LaunchableExchangisJob generate(LaunchableExchangisJob launchableExchangisJob) throws ExchangisTaskGenerateException { + return generate(launchableExchangisJob, launchableExchangisJob.getCreateUser()); + } + + + @Override + public TaskGeneratorContext getTaskGeneratorContext() { + return generatorContext; + } + + + /** + * Use the default job builder manager + * @return default manager + */ + @Override + public ExchangisJobBuilderManager getExchangisJobBuilderManager() { + return new DefaultExchangisJobBuilderManager(); + } + + @Override + public void addListener(TaskGenerateListener taskGenerateListener) { + listeners.add(taskGenerateListener); + } + + /** + * Listeners listen generate event method + * @param taskGenerateEvent event + * @throws ExchangisTaskGenerateException + */ + protected void onEvent(TaskGenerateEvent taskGenerateEvent) throws ExchangisTaskGenerateException{ + for (TaskGenerateListener listener : listeners) { + try { + listener.onEvent(taskGenerateEvent); + } catch (ErrorException e) { + throw new ExchangisTaskGenerateException("Fail to call 'onEvent' method in generator listener: [" + listener.getClass().getSimpleName() + + "] for event: [id: " + taskGenerateEvent.eventId() +", type:" + taskGenerateEvent.getClass().getSimpleName() +"]", e); + } + } + if (taskGenerateEvent instanceof TaskGenerateInitEvent){ + info(taskGenerateEvent.getLaunchableExchangisJob(), "Init to create launched job and begin generating"); + } else if (taskGenerateEvent instanceof TaskGenerateSuccessEvent){ + info(taskGenerateEvent.getLaunchableExchangisJob(), "Success to generate launched job, output tasks [{}]", + taskGenerateEvent.getLaunchableExchangisJob().getLaunchableExchangisTasks().size()); + } else if (taskGenerateEvent instanceof TaskGenerateErrorEvent){ + error(taskGenerateEvent.getLaunchableExchangisJob(), "Error occurred in generating", + ((TaskGenerateErrorEvent)taskGenerateEvent).getException()); + } + } + + @Override + public JobLogListener getJobLogListener() { + return getTaskGeneratorContext().getJobLogListener(); + } + + @Override + public JobLogEvent getJobLogEvent(JobLogEvent.Level level, LaunchableExchangisJob job, String message, Object... args) { + return new JobLogEvent(level, job.getCreateUser(), job.getJobExecutionId(), message, args); + } + + + protected abstract void execute(LaunchableExchangisJob launchableExchangisJob, TaskGeneratorContext ctx, String tenancy) throws ErrorException; +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/DefaultTaskGenerator.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/DefaultTaskGenerator.java new file mode 100644 index 000000000..8248bae5a --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/DefaultTaskGenerator.java @@ -0,0 +1,122 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.generator; + + +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.builder.manager.ExchangisJobBuilderManager; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisEngineJob; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisJob; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.server.builder.ServiceInExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.server.builder.transform.TransformExchangisJob; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskGenerateException; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.events.TaskGenerateErrorEvent; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.events.TaskGenerateSuccessEvent; +import com.webank.wedatasphere.exchangis.job.utils.SnowFlake; +import org.apache.linkis.common.conf.CommonVars; +import org.apache.linkis.common.exception.ErrorException; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +/** + * Async exec, + * construct a JobGenerationSchedulerTask and them submit to TaskExecution + */ +public class DefaultTaskGenerator extends AbstractTaskGenerator{ + + + private static class Constraints{ + private static final CommonVars TASK_ID_GENERATOR_DATA_CENTER = CommonVars.apply("wds.exchangis.job.task.generator.id.data-center", 1L); + + private static final CommonVars TASK_ID_GENERATOR_WORKER = CommonVars.apply("wds.exchangis.job.task.generator.id.worker", 1L); + + private static final CommonVars TASK_ID_GENERATOR_START_TIME = CommonVars.apply("wds.exchangis.job.task.generator.id.start-time", 1238434978657L); + } + protected TaskGeneratorContext ctx; + + private ExchangisJobBuilderManager jobBuilderManager; + + /** + * Generate task id + */ + private SnowFlake idGenerator; + + public DefaultTaskGenerator(TaskGeneratorContext ctx, ExchangisJobBuilderManager jobBuilderManager){ + this.ctx = ctx; + this.jobBuilderManager = jobBuilderManager; + } + + @Override + public TaskGeneratorContext getTaskGeneratorContext() { + return ctx; + } + + @Override + public void init() throws ExchangisJobException { + super.init(); + idGenerator = new SnowFlake(Constraints.TASK_ID_GENERATOR_DATA_CENTER.getValue(), Constraints.TASK_ID_GENERATOR_WORKER.getValue(), + Constraints.TASK_ID_GENERATOR_START_TIME.getValue()); + } + + @Override + protected void execute(LaunchableExchangisJob launchableExchangisJob, + TaskGeneratorContext generatorContext, String tenancy) throws ErrorException { + ExchangisTaskGenerateException throwable; + ExchangisJobInfo jobInfo = launchableExchangisJob.getExchangisJobInfo(); + List launchableExchangisTasks = new ArrayList<>(); + if (Objects.isNull(jobInfo)){ + throwable = new ExchangisTaskGenerateException("Job information is empty in launchable exchangis job", null); + onEvent(new TaskGenerateErrorEvent(launchableExchangisJob, throwable)); + throw throwable; + } + ExchangisJobBuilderManager jobBuilderManager = getExchangisJobBuilderManager(); + ServiceInExchangisJobBuilderContext ctx = new ServiceInExchangisJobBuilderContext(jobInfo, generatorContext.getJobLogListener()); + // Set the metadata service + ctx.setMetadataInfoService(generatorContext.getMetadataInfoService()); + ctx.setJobExecutionId(launchableExchangisJob.getJobExecutionId()); + ctx.putEnv("USER_NAME", tenancy); + // ExchangisJobInfo -> TransformExchangisJob(SubExchangisJob) + try { + TransformExchangisJob transformJob = jobBuilderManager.doBuild(jobInfo, TransformExchangisJob.class, ctx); + List engineJobs = new ArrayList<>(); + for (SubExchangisJob subExchangisJob : transformJob.getSubJobSet()){ + // Will deal with the parameters in source/sink of job + Optional.ofNullable(jobBuilderManager.doBuild(subExchangisJob, + SubExchangisJob.class, ExchangisEngineJob.class, ctx)).ifPresent(engineJobs::add); + } + // List -> List + for (ExchangisEngineJob engineJob : engineJobs){ + Optional.ofNullable(jobBuilderManager.doBuild(engineJob, + ExchangisEngineJob.class, LaunchableExchangisTask.class, ctx)).ifPresent(launchableExchangisTasks :: add); + } + if (launchableExchangisTasks.isEmpty()){ + throw new ExchangisTaskGenerateException("The result set of launchable tasks is empty, please examine your launchable job entity," + + " content: [" + jobInfo.getJobContent() + "]", null); + } + // Create task id + launchableExchangisTasks.forEach(task -> task.setId(idGenerator.nextId())); + launchableExchangisJob.setLaunchableExchangisTasks(launchableExchangisTasks); + onEvent(new TaskGenerateSuccessEvent(launchableExchangisJob)); + } catch (Exception e) { + if (e instanceof ExchangisTaskGenerateException){ + // Just throws the generate exception + throwable = (ExchangisTaskGenerateException)e; + } else { + throwable = new ExchangisTaskGenerateException("Error in generating launchable tasks", e); + } + onEvent(new TaskGenerateErrorEvent(launchableExchangisJob, throwable)); + throw throwable; + } + } + + @Override + public ExchangisJobBuilderManager getExchangisJobBuilderManager() { + return jobBuilderManager; + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/DefaultTaskGeneratorContext.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/DefaultTaskGeneratorContext.java new file mode 100644 index 000000000..e43a51dc7 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/DefaultTaskGeneratorContext.java @@ -0,0 +1,33 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.generator; + +import com.webank.wedatasphere.exchangis.datasource.core.service.MetadataInfoService; +import com.webank.wedatasphere.exchangis.job.listener.JobLogListener; + +/** + * Default generator context + */ +public class DefaultTaskGeneratorContext implements TaskGeneratorContext { + + private JobLogListener jobLogListener; + + private MetadataInfoService metadataInfoService; + + public DefaultTaskGeneratorContext(){ + + } + public DefaultTaskGeneratorContext(JobLogListener jobLogListener, + MetadataInfoService metadataInfoService){ + this.jobLogListener = jobLogListener; + this.metadataInfoService = metadataInfoService; + } + + @Override + public JobLogListener getJobLogListener() { + return this.jobLogListener; + } + + @Override + public MetadataInfoService getMetadataInfoService() { + return metadataInfoService; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/TaskGenerateListener.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/TaskGenerateListener.java new file mode 100644 index 000000000..755499205 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/TaskGenerateListener.java @@ -0,0 +1,45 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.generator; + +import com.webank.wedatasphere.exchangis.job.exception.ExchangisOnEventException; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.events.TaskGenerateErrorEvent; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.events.TaskGenerateEvent; +import com.webank.wedatasphere.exchangis.job.listener.ExchangisListener; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.events.TaskGenerateInitEvent; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.events.TaskGenerateSuccessEvent; + +/** + * Listener of task generating + */ +public interface TaskGenerateListener extends ExchangisListener { + + @Override + default void onEvent(TaskGenerateEvent event) throws ExchangisOnEventException { + getLogger().trace("Event: [id: {}, type: {}] in listener [{}]", event.eventId(), event.getClass().getSimpleName(), + this.getClass().getSimpleName()); + if (event instanceof TaskGenerateErrorEvent){ + onError((TaskGenerateErrorEvent) event); + } else if (event instanceof TaskGenerateInitEvent){ + onInit((TaskGenerateInitEvent)event); + } else if (event instanceof TaskGenerateSuccessEvent){ + onSuccess((TaskGenerateSuccessEvent)event); + } + } + + /** + * Listen error + * @param errorEvent error event + */ + void onError(TaskGenerateErrorEvent errorEvent); + + /** + * Listen init + * @param initEvent init event + */ + void onInit(TaskGenerateInitEvent initEvent); + + /** + * Listen success + * @param successEvent success event + */ + void onSuccess(TaskGenerateSuccessEvent successEvent); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/TaskGenerator.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/TaskGenerator.java new file mode 100644 index 000000000..107e2c51e --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/TaskGenerator.java @@ -0,0 +1,54 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.generator; + +/** + * To generate task for execution + */ + +import com.webank.wedatasphere.exchangis.job.builder.manager.ExchangisJobBuilderManager; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJob; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskGenerateException; +import com.webank.wedatasphere.exchangis.job.server.log.JobServerLogging; + +public interface TaskGenerator extends JobServerLogging { + /** + * init method + * @throws ExchangisJobException error in initializing + */ + void init() throws ExchangisJobException; + + /** + * Init the job info to suitable input + * @param jobInfo + * @return + */ + T init(ExchangisJobInfo jobInfo) throws ExchangisTaskGenerateException; + /** + * Generate exchangis job (has tasks) + * @param exchangisJob job extends ExchangisJob + * @param tenancy act as exec user + * @return job has been handled + * @throws ExchangisTaskGenerateException exception in generating + */ + T generate(T exchangisJob, String tenancy) throws ExchangisTaskGenerateException; + + T generate(T exchangisJob) throws ExchangisTaskGenerateException; + /** + * Get generator context + * @return context + */ + TaskGeneratorContext getTaskGeneratorContext(); + + /** + * Get job builder manager + * @return + */ + ExchangisJobBuilderManager getExchangisJobBuilderManager(); + + /** + * Add listeners + * @param taskGenerateListener listener + */ + void addListener(TaskGenerateListener taskGenerateListener); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/TaskGeneratorContext.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/TaskGeneratorContext.java new file mode 100644 index 000000000..d2a8ee6dc --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/TaskGeneratorContext.java @@ -0,0 +1,22 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.generator; + +import com.webank.wedatasphere.exchangis.datasource.core.service.MetadataInfoService; +import com.webank.wedatasphere.exchangis.job.listener.JobLogListener; + +/** + * Generator context + */ +public interface TaskGeneratorContext { + + /** + * Job Log listener + * @return + */ + JobLogListener getJobLogListener(); + + /** + * Metadata info service + * @return + */ + MetadataInfoService getMetadataInfoService(); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/events/TaskGenerateErrorEvent.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/events/TaskGenerateErrorEvent.java new file mode 100644 index 000000000..70076a9e8 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/events/TaskGenerateErrorEvent.java @@ -0,0 +1,21 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.generator.events; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisJob; + +/** + * Error event + */ +public class TaskGenerateErrorEvent extends TaskGenerateEvent{ + + private Throwable exception; + + public TaskGenerateErrorEvent(LaunchableExchangisJob launchableExchangisJob, Throwable e) { + super(System.currentTimeMillis(), launchableExchangisJob); + this.exception = e; + } + + public Throwable getException() { + return exception; + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/events/TaskGenerateEvent.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/events/TaskGenerateEvent.java new file mode 100644 index 000000000..c46744af3 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/events/TaskGenerateEvent.java @@ -0,0 +1,44 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.generator.events; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisJob; +import com.webank.wedatasphere.exchangis.job.listener.ExchangisEvent; + +public class TaskGenerateEvent implements ExchangisEvent { + + private long eventTime; + + private LaunchableExchangisJob launchableExchangisJob; + + public TaskGenerateEvent(long eventTime, LaunchableExchangisJob launchableExchangisJob){ + this.eventTime = eventTime; + this.launchableExchangisJob = launchableExchangisJob; + } + + @Override + public String eventId() { + return "_TaskGenerate_" + launchableExchangisJob.getJobExecutionId(); + } + + @Override + public void setEventId(String eventId) { + //null + } + + @Override + public long getEventTime() { + return this.eventTime; + } + + @Override + public void setEventTime(long timestamp) { + this.eventTime = timestamp; + } + + public LaunchableExchangisJob getLaunchableExchangisJob() { + return launchableExchangisJob; + } + + public void setLaunchableExchangisJob(LaunchableExchangisJob launchableExchangisJob) { + this.launchableExchangisJob = launchableExchangisJob; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/events/TaskGenerateInitEvent.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/events/TaskGenerateInitEvent.java new file mode 100644 index 000000000..a57c28e4c --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/events/TaskGenerateInitEvent.java @@ -0,0 +1,12 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.generator.events; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisJob; + +/** + * Init event + */ +public class TaskGenerateInitEvent extends TaskGenerateEvent{ + public TaskGenerateInitEvent(LaunchableExchangisJob launchableExchangisJob) { + super(System.currentTimeMillis(), launchableExchangisJob); + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/events/TaskGenerateSuccessEvent.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/events/TaskGenerateSuccessEvent.java new file mode 100644 index 000000000..7b0ee3205 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/generator/events/TaskGenerateSuccessEvent.java @@ -0,0 +1,30 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.generator.events; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisJob; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; + +import java.util.List; + +/** + * Success event + */ +public class TaskGenerateSuccessEvent extends TaskGenerateEvent{ + + /** + * Generate result + */ + private List taskGenerated; + + public TaskGenerateSuccessEvent(LaunchableExchangisJob launchableExchangisJob) { + super(System.currentTimeMillis(), launchableExchangisJob); + taskGenerated = launchableExchangisJob.getLaunchableExchangisTasks(); + } + + public List getTaskGenerated() { + return taskGenerated; + } + + public void setTaskGenerated(List taskGenerated) { + this.taskGenerated = taskGenerated; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/loadbalance/AbstractTaskSchedulerLoadBalancer.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/loadbalance/AbstractTaskSchedulerLoadBalancer.java new file mode 100644 index 000000000..9d84b93c7 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/loadbalance/AbstractTaskSchedulerLoadBalancer.java @@ -0,0 +1,96 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.loadbalance; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskExecuteException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskObserverException; +import com.webank.wedatasphere.exchangis.job.server.execution.TaskManager; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks.LoadBalanceSchedulerTask; +import com.webank.wedatasphere.exchangis.job.utils.TypeGenericUtils; +import org.apache.linkis.common.conf.CommonVars; +import org.apache.linkis.scheduler.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.Future; + +/** + * Scheduler load balancer for launched task + */ +public abstract class AbstractTaskSchedulerLoadBalancer implements TaskSchedulerLoadBalancer { + + private static final Logger LOG = LoggerFactory.getLogger(AbstractTaskSchedulerLoadBalancer.class); + + protected TaskManager taskManager; + + protected Scheduler scheduler; + + protected List> registeredTaskClasses = new ArrayList<>(); + + + + public AbstractTaskSchedulerLoadBalancer(Scheduler scheduler, TaskManager taskManager){ + this.taskManager = taskManager; + this.scheduler = scheduler; + } + @Override + public TaskManager getTaskManager() { + return this.taskManager; + } + + @Override + public void registerSchedulerTask(Class schedulerTaskClass){ + if(isSuitableClass(schedulerTaskClass)){ + LOG.info("Register the load balance scheduler class: [{}]", schedulerTaskClass.getName()); + registeredTaskClasses.add(schedulerTaskClass); + } + } + + @Override + public List> choose(LaunchedExchangisTask launchedExchangisTask) { + List> schedulerTasks = new ArrayList<>(); + registeredTaskClasses.forEach(taskClass -> { + Optional.ofNullable(choose(launchedExchangisTask, taskClass, false)).ifPresent(schedulerTasks::add); + }); + return schedulerTasks; + } + + @Override + public LoadBalanceSchedulerTask choose(LaunchedExchangisTask launchedExchangisTask, Class schedulerTaskClass) { + return choose(launchedExchangisTask, schedulerTaskClass, false); + } + + + /** + * Choose entrance + * @param launchedExchangisTask task + * @param schedulerTaskClass task class + * @param unchecked if checked + * @return scheduler task + */ + protected abstract LoadBalanceSchedulerTask choose(LaunchedExchangisTask launchedExchangisTask, Class schedulerTaskClass, boolean unchecked); + + + @Override + public Scheduler getScheduler() { + return scheduler; + } + + protected boolean isSuitableClass(Class schedulerTaskClass){ + if (LoadBalanceSchedulerTask.class.isAssignableFrom(schedulerTaskClass)){ + Class subType = TypeGenericUtils.getActualTypeFormGenericClass(schedulerTaskClass, null, 0); + if (Objects.isNull(subType) || !subType.equals(LaunchedExchangisTask.class)){ + LOG.warn("Unrecognized generic sub type: [{}] in scheduler", subType); + } else { + return true; + } + } else { + LOG.warn("Not load balance scheduler task class [{}]", schedulerTaskClass.getCanonicalName()); + } + return false; + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/loadbalance/FlexibleTenancyLoadBalancer.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/loadbalance/FlexibleTenancyLoadBalancer.java new file mode 100644 index 000000000..6ed5f556d --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/loadbalance/FlexibleTenancyLoadBalancer.java @@ -0,0 +1,447 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.loadbalance; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskExecuteException; +import com.webank.wedatasphere.exchangis.job.server.execution.TaskManager; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.*; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.loadbalance.LoadBalancePoller; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks.AbstractLoadBalanceSchedulerTask; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks.LoadBalanceSchedulerTask; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.common.conf.CommonVars; +import org.apache.linkis.scheduler.Scheduler; +import org.apache.linkis.scheduler.queue.ConsumerManager; +import org.apache.linkis.scheduler.queue.GroupFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.locks.ReentrantReadWriteLock; + + +public class FlexibleTenancyLoadBalancer extends AbstractTaskSchedulerLoadBalancer implements SchedulerThread { + + private static final Logger LOG = LoggerFactory.getLogger(FlexibleTenancyLoadBalancer.class); + /** + * key: {tenancy}_{schedulerTask_name} + */ + private ConcurrentHashMap tenancySchedulerTasks = new ConcurrentHashMap<>(); + + static class Constraints{ + private static final CommonVars SCHEDULE_INTERVAL = CommonVars.apply("wds.exchangis.job.task.scheduler.load-balancer.flexible.schedule-in-millisecond", 3000); + private static final CommonVars SEGMENT_MAX_OCCUPY = CommonVars.apply("wds.exchangis.job.task.scheduler.load-balancer.flexible.segments.max-occupy", 0.35d); + private static final CommonVars SEGMENT_MIN_OCCUPY = CommonVars.apply("wds.exchangis.job.task.scheduler.load-balancer.flexible.segments.min-occupy", 0.15d); + private static final CommonVars SEGMENT_ADJUST_STEP = CommonVars.apply("wds.exchangis.job.task.scheduler.load-balancer.flexible.segments.adjust-step", 5); + } + + private boolean isShutdown = false; + + private Future balanceFuture; + + public FlexibleTenancyLoadBalancer(Scheduler scheduler, TaskManager taskManager) { + super(scheduler, taskManager); + } + + + @Override + protected LoadBalanceSchedulerTask choose(LaunchedExchangisTask launchedExchangisTask, Class schedulerTaskClass, boolean unchecked) { + if( !unchecked || isSuitableClass(schedulerTaskClass)){ + String schedulerTaskName = schedulerTaskClass.getSimpleName(); + // Fetch the latest info + launchedExchangisTask = getTaskManager().getRunningTask(launchedExchangisTask.getTaskId()); + // If the value is None means that the task is ended + if (Objects.nonNull(launchedExchangisTask) && !TaskStatus.isCompleted(launchedExchangisTask.getStatus())) { + // Use the exec user as tenancy + String tenancy = launchedExchangisTask.getExecuteUser(); + GroupFactory groupFactory = getScheduler().getSchedulerContext().getOrCreateGroupFactory(); + if (groupFactory instanceof TenancyParallelGroupFactory && + !((TenancyParallelGroupFactory) groupFactory).getTenancies().contains(tenancy)) { + // Unrecognized tenancy name + tenancy = ""; + } + if (StringUtils.isBlank(tenancy)) { + tenancy = TenancyParallelGroupFactory.DEFAULT_TENANCY; + } + String finalTenancy = tenancy; + SchedulerTaskContainer schedulerTaskContainer =tenancySchedulerTasks.compute(tenancy + "_" + schedulerTaskName,(key, taskContainer) -> { + if (Objects.isNull(taskContainer)){ + LoadBalanceSchedulerTask headSchedulerTask = createLoadBalanceSchedulerTask(schedulerTaskClass); + if (headSchedulerTask instanceof AbstractLoadBalanceSchedulerTask){ + ((AbstractLoadBalanceSchedulerTask) headSchedulerTask) + .setSchedulerLoadBalancer(FlexibleTenancyLoadBalancer.this); + } + headSchedulerTask.setTenancy(finalTenancy); + try { + getScheduler().submit(headSchedulerTask); + } catch (Exception e){ + // Only if not enough reserved threads in scheduler + throw new ExchangisTaskExecuteException.Runtime("If there is no enough reserved threads in scheduler for tenancy: [" + finalTenancy + + "], load balance scheduler task: [" + schedulerTaskName + "]? please invoke setInitResidentThreads(num) method in consumerManager", e); + } + taskContainer = new SchedulerTaskContainer(headSchedulerTask); + taskContainer.tenancy = finalTenancy; + } + return taskContainer; + }); + // Select one + return schedulerTaskContainer.select(); + } + + } + return null; + } + + + @SuppressWarnings("unchecked") + private LoadBalanceSchedulerTask createLoadBalanceSchedulerTask(Class schedulerTaskClass){ + Constructor[] constructors = schedulerTaskClass.getDeclaredConstructors(); + if (constructors.length <= 0){ + throw new ExchangisTaskExecuteException.Runtime("Cannot find any constructors from load balance scheduler task: [" + schedulerTaskClass.getSimpleName() + "]", null); + } + // Use the first one constructor + Constructor constructor = constructors[0]; + Object[] parameters = new Object[constructor.getParameterCount()]; + Class[] parameterTypes = constructor.getParameterTypes(); + for (int i = 0 ;i < parameterTypes.length; i++){ + Class parameterType = parameterTypes[i]; + if (parameterType.isAssignableFrom(TaskManager.class)){ + parameters[i] = getTaskManager(); + } else if (parameterType.isAssignableFrom(Scheduler.class)){ + parameters[i] = getScheduler(); + } else if (parameterType.isAssignableFrom(this.getClass())){ + parameters[i] = this; + } else { + parameters[i] = null; + } + } + try { + LoadBalanceSchedulerTask loadBalanceSchedulerTask = (LoadBalanceSchedulerTask) constructor.newInstance(parameters); + //Use the current timestamp as ID + loadBalanceSchedulerTask.setId(String.valueOf(System.currentTimeMillis())); + return loadBalanceSchedulerTask; + } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + throw new ExchangisTaskExecuteException.Runtime("Cannot new instance of load balance scheduler task: [" + schedulerTaskClass.getSimpleName() + "]", e); + } + } + + @Override + public void run() { + Thread.currentThread().setName("Balancer-Thread" + getName()); + LOG.info("Thread:[ {} ] is started. ", Thread.currentThread().getName()); + ConsumerManager consumerManager = getScheduler().getSchedulerContext().getOrCreateConsumerManager(); + Map tenancyExecutorServices = new HashMap<>(); + int residentThreads = 0; + if (consumerManager instanceof TenancyParallelConsumerManager){ + tenancyExecutorServices = ((TenancyParallelConsumerManager) consumerManager).getTenancyExecutorServices(); + residentThreads = ((TenancyParallelConsumerManager) consumerManager).getInitResidentThreads(); + } else { + LOG.warn("Cannot auto scale-in/out on the consumer manager: [" + consumerManager.getClass().getSimpleName() +"] which is not a tenancy consumer manager"); + isShutdown = true; + } + while (!isShutdown){ + try { + loop(tenancyExecutorServices, residentThreads); + Thread.sleep(Constraints.SCHEDULE_INTERVAL.getValue()); + } catch (Exception e) { + if (e instanceof InterruptedException && isShutdown){ + LOG.info("Receive the interrupt signal from shutdown operation"); + } else { + LOG.warn("Unknown exception in scale-in/out segments of load balance scheduler task", e); + } + try { + // Enforce to sleep + Thread.sleep(Constraints.SCHEDULE_INTERVAL.getValue()); + } catch (InterruptedException ex) { + //Ignore + } + } + } + LOG.info("Thread:[ {} ] is stopped. ", Thread.currentThread().getName()); + } + + + @Override + public void start() { + if (Objects.isNull(this.scheduler)){ + throw new ExchangisTaskExecuteException.Runtime("TaskScheduler cannot be empty, please set it before starting the ["+ getName() +"]!", null); + } + if (Objects.nonNull(this.balanceFuture)){ + throw new ExchangisTaskExecuteException.Runtime("The load balancer: [" + getName() +"] has been started before", null); + } + // Submit self to default executor service + this.balanceFuture = this.scheduler.getSchedulerContext() + .getOrCreateConsumerManager().getOrCreateExecutorService().submit(this); + } + + /** + * Loop method + * @param tenancyExecutorServices executorServices + */ + private void loop(Map tenancyExecutorServices, int residentThreads){ + LOG.trace("Start to auto scale-in/out segments of load balance scheduler task"); + int adjustStep = Constraints.SEGMENT_ADJUST_STEP.getValue(); + Map tenancyLoopCounter = new HashMap<>(); + this.tenancySchedulerTasks.forEach((key, taskContainer) -> tenancyLoopCounter.compute(taskContainer.tenancy, (tenancy, counter) -> { + if (null == counter){ + counter = new LoopCounter(); + } + counter.containers.incrementAndGet(); + counter.segments.addAndGet(taskContainer.segments.length); + for (SchedulerTaskSegment segment : taskContainer.segments){ + counter.pollerSize.addAndGet(segment.loadBalanceSchedulerTask.getOrCreateLoadBalancePoller().size()); + } + counter.taskContainers.add(taskContainer); + return counter; + })); + tenancyExecutorServices.forEach((tenancy, executorService) -> { + LoopCounter loopCounter = tenancyLoopCounter.get(tenancy); + if (Objects.nonNull(loopCounter)){ + if (loopCounter.pollerSize.get() > 0) { + LOG.info("Monitor: [tenancy: {}, task_segments: {}, wait_in_poll: {}]", tenancy, loopCounter.segments.get(), + loopCounter.pollerSize.get()); + } + ThreadPoolExecutor pool = (ThreadPoolExecutor)executorService; + int adjustSegmentNum = 0; + int coreSize = pool.getCorePoolSize(); + // Must more than residentThreads +// if (TenancyParallelGroupFactory.DEFAULT_TENANCY.equals(tenancy) || coreSize > residentThreads){ + int segments = loopCounter.segments.get(); + // TODO fix the problem that the value of residentThreads always equal 1 for not default consumer + int restSize = TenancyParallelGroupFactory.DEFAULT_TENANCY.equals(tenancy)? coreSize - residentThreads - 1: coreSize - 1; + if (restSize > 0) { + int activeThreads = pool.getActiveCount(); + if (activeThreads >= coreSize) { + // All threads is active, should reduce the number of segments + adjustSegmentNum = Math.min((int) Math.floor((double) restSize * Constraints.SEGMENT_MIN_OCCUPY.getValue()), segments); + } else { + adjustSegmentNum = Math.max((int) Math.floor((double) restSize * Constraints.SEGMENT_MAX_OCCUPY.getValue()), segments); + } + adjustSegmentNum = adjustSegmentNum > segments ? segments + Math.min(adjustStep, adjustSegmentNum - segments) + : segments - Math.min(adjustStep, segments - adjustSegmentNum); + if (segments != adjustSegmentNum) { + // Div the number of container + int average = adjustSegmentNum / loopCounter.containers.get(); + LOG.info("Adjust total number of load balance scheduler task segments for tenancy: [{}] from {} to {}, average {}", + tenancy, segments, adjustSegmentNum, average); + for (int i = 0; i < loopCounter.containers.get(); i++) { + if (i == loopCounter.containers.get() - 1) { + loopCounter.taskContainers.get(i).adjustSegment(adjustSegmentNum); + } else { + loopCounter.taskContainers.get(i).adjustSegment(average); + adjustSegmentNum = adjustSegmentNum - average; + } + } + } + } +// } + } + }); + LOG.trace("End to auto scale-in/out segments of load balance scheduler task"); + } + @Override + public void stop() { + if (Objects.nonNull(this.balanceFuture)){ + this.isShutdown = true; + this.balanceFuture.cancel(true); + this.tenancySchedulerTasks.forEach((tenancy, container) -> { + container.segmentLock.writeLock().lock(); + try{ + for(SchedulerTaskSegment segment : container.segments){ + if (segment.loadBalanceSchedulerTask instanceof AbstractExchangisSchedulerTask){ + ((AbstractExchangisSchedulerTask) segment.loadBalanceSchedulerTask).kill(); + } + } + }finally { + container.segmentLock.writeLock().unlock(); + } + }); + this.tenancySchedulerTasks.clear(); + } + } + + @Override + public String getName() { + return this.getClass().getSimpleName(); + } + + static class LoopCounter { + + AtomicInteger containers = new AtomicInteger(0); + + AtomicInteger segments = new AtomicInteger(0); + + AtomicInteger pollerSize = new AtomicInteger(0); + + List taskContainers = new ArrayList<>(); + } + /** + * Scheduler + */ + private class SchedulerTaskContainer{ + + String tenancy; + + String taskName; + + SchedulerTaskSegment[] segments; + + ReentrantReadWriteLock segmentLock = new ReentrantReadWriteLock(); + + SchedulerTaskContainer(LoadBalanceSchedulerTask schedulerTask){ + // TODO should create the strategy of defining 'weight' value + segments = new SchedulerTaskSegment[]{new SchedulerTaskSegment(1, schedulerTask)}; + taskName = schedulerTask.getClass().getSimpleName(); + } + LoadBalanceSchedulerTask select(){ + segmentLock.writeLock().lock(); + try { + int segmentIndex = selectSegment(segments); + SchedulerTaskSegment segment = segments[segmentIndex]; + segment.cwt = segment.cwt - 1; + return segment.loadBalanceSchedulerTask; + }finally { + segmentLock.writeLock().unlock(); + } + } + + private void adjustSegment(int adjustNum){ + if (adjustNum != segments.length) { + segmentLock.writeLock().lock(); + try { + if (adjustNum > segments.length) { + scaleInSegment(adjustNum - segments.length); + } else { + scaleOutSegment(segments.length - adjustNum); + } + }finally { + segmentLock.writeLock().unlock(); + } + } + } + + /** + * Scale-out segment + * @param scaleOut + */ + private void scaleOutSegment(int scaleOut){ + int newSize = segments.length - scaleOut; + LOG.info("Scale-out segments for tenancy: [{}],scaleOut: [{}], newSize: [{}], scheduler task: [{}]", + tenancy, scaleOut, newSize, taskName); + if (newSize <= 0){ + LOG.warn("Scale-out fail, the newSize cannot <= 0"); + return; + } + SchedulerTaskSegment[] newSegments = new SchedulerTaskSegment[newSize]; + System.arraycopy(segments, 0, newSegments, 0, newSize); + int offset = 0; + for(int i = newSize; i < segments.length; i ++){ + LoadBalanceSchedulerTask schedulerTask = segments[i].loadBalanceSchedulerTask; + try { + if (AbstractExchangisSchedulerTask.class.isAssignableFrom(schedulerTask.getClass())) { + ((AbstractExchangisSchedulerTask) schedulerTask).kill(); + } + // Merge the poller + LoadBalancePoller poller = schedulerTask.getOrCreateLoadBalancePoller(); + // Combine the poller + newSegments[offset % newSize].loadBalanceSchedulerTask.getOrCreateLoadBalancePoller().combine(poller); + } catch (Exception e){ + LOG.warn("Scale-out segments for tenancy: [{}] wrong, index: [{}], scheduler task: [{}]", tenancy, i, taskName, e); + } + } + segments = newSegments; + } + /** + * Scale-in segment + * @param scaleIn + */ + private void scaleInSegment(int scaleIn){ + LOG.info("Scale-in segments for tenancy: [{}],scaleIn: [{}], newSize: [{}], scheduler task: [{}]", + tenancy, scaleIn, segments.length + scaleIn, taskName); + SchedulerTaskSegment[] newSegments = new SchedulerTaskSegment[segments.length + scaleIn]; + System.arraycopy(segments, 0, newSegments, 0, segments.length); + for(int i = segments.length; i < segments.length + scaleIn; i ++){ + try { + LoadBalanceSchedulerTask schedulerTask = + createLoadBalanceSchedulerTask(segments[0].loadBalanceSchedulerTask.getClass()); + if (schedulerTask instanceof AbstractLoadBalanceSchedulerTask){ + ((AbstractLoadBalanceSchedulerTask) schedulerTask) + .setSchedulerLoadBalancer(FlexibleTenancyLoadBalancer.this); + } + schedulerTask.setTenancy(tenancy); + getScheduler().submit(schedulerTask); + newSegments[i] = new SchedulerTaskSegment(1, schedulerTask); + } catch (Exception e){ + LOG.warn("Scale-in segments for tenancy: [{}] wrong, index: [{}]", tenancy, i, e); + } + } + segments = newSegments; + } + /** + * Select segment + * @param segments segments + * @return index + */ + private int selectSegment(SchedulerTaskSegment[] segments) { + int u = 0; + int reset = -1; + while (true) { + for (int i = 0; i < segments.length; i++) { + if (null == segments[i] || segments[i].cwt <= 0) { + continue; + } + u = i; + while (i < segments.length - 1) { + i++; + if (null == segments[i] || segments[i].cwt <= 0) { + continue; + } + if ((segments[u].wt * 1000 / segments[i].wt < + segments[u].cwt * 1000 / segments[i].cwt)) { + return u; + } + u = i; + } + return u; + } + if (reset++ > 0) { + return 0; + } + for (SchedulerTaskSegment segment : segments) { + segment.cwt = segment.wt; + } + } + } + } + + /** + * Each segment has + * weight => initial weight size + * cWeight => current weight + */ + private static class SchedulerTaskSegment{ + + int wt = -1; + + int cwt = -1; + + String schedulerId; + + LoadBalanceSchedulerTask loadBalanceSchedulerTask; + + SchedulerTaskSegment(int weight, LoadBalanceSchedulerTask task){ + this.wt = weight; + this.cwt = this.wt; + this.loadBalanceSchedulerTask = task; + this.schedulerId = task.getId(); + } + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/loadbalance/TaskSchedulerLoadBalancer.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/loadbalance/TaskSchedulerLoadBalancer.java new file mode 100644 index 000000000..46bba16fd --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/loadbalance/TaskSchedulerLoadBalancer.java @@ -0,0 +1,15 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.loadbalance; + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisTask; +import com.webank.wedatasphere.exchangis.job.server.execution.TaskManager; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.loadbalance.SchedulerLoadBalancer; + +public interface TaskSchedulerLoadBalancer extends SchedulerLoadBalancer{ + + /** + * Manager the running tasks + * @return task manager + */ + TaskManager getTaskManager(); + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/AbstractExchangisSchedulerTask.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/AbstractExchangisSchedulerTask.java new file mode 100644 index 000000000..d5b78a9f4 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/AbstractExchangisSchedulerTask.java @@ -0,0 +1,119 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler; + +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerRetryException; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.scheduler.executer.CompletedExecuteResponse; +import org.apache.linkis.scheduler.executer.ErrorExecuteResponse; +import org.apache.linkis.scheduler.executer.ExecuteRequest; +import org.apache.linkis.scheduler.queue.Job; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; + +/** + * Inheritable scheduler task for exchangis, different from ExchangisTask + */ +public abstract class AbstractExchangisSchedulerTask extends Job implements ExchangisSchedulerTask{ + + private static final Logger LOG = LoggerFactory.getLogger(AbstractExchangisSchedulerTask.class); + + public static final int MAX_RETRY_NUM = 3; + + private int maxRetryNum = MAX_RETRY_NUM; + + /** + * Tenancy name + */ + private String tenancy; + + protected String scheduleId; + /** + * Each schedule task should has an id + * @param scheduleId schedule id + */ + public AbstractExchangisSchedulerTask(String scheduleId){ + this.scheduleId = scheduleId; + } + + public AbstractExchangisSchedulerTask() { + + } + + @Override + public void init() throws Exception { + + } + + @Override + public ExecuteRequest jobToExecuteRequest() throws Exception { + return new DirectExecuteRequest(); + } + + @Override + public int getMaxRetryNum() { + return maxRetryNum; + } + + private void setMaxRetryNum(int maxRetryNum){ + this.maxRetryNum = maxRetryNum; + } + + @Override + public void close() throws IOException { + } + + @Override + public String getId() { + if (StringUtils.isNotBlank(this.scheduleId)){ + return scheduleId; + } + return super.getId(); + } + + /** + * schedule main method + * @throws ExchangisSchedulerException error exception + * @throws ExchangisSchedulerRetryException retry exception + */ + protected abstract void schedule() throws ExchangisSchedulerException, ExchangisSchedulerRetryException; + + public class DirectExecuteRequest implements ExecuteRequest { + + @Override + public String code() { + return null; + } + + public void directExecute() throws ExchangisSchedulerException, ExchangisSchedulerRetryException { + // Direct execute + try { + schedule(); + } catch (ExchangisSchedulerRetryException e){ + if (e.getRetryNum() > 0){ + setMaxRetryNum(e.getRetryNum()); + } + // Need to throw again + throw e; + } + } + } + + @Override + public void transitionCompleted(CompletedExecuteResponse executeCompleted) { + super.transitionCompleted(executeCompleted); + if (executeCompleted instanceof ErrorExecuteResponse){ + ErrorExecuteResponse response = ((ErrorExecuteResponse)executeCompleted); + LOG.error("Schedule Error: " + response.message(), response.t()); + } + } + + public String getTenancy() { + return tenancy; + } + + public void setTenancy(String tenancy) { + this.tenancy = tenancy; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/ExchangisGenericScheduler.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/ExchangisGenericScheduler.java new file mode 100644 index 000000000..4a0cf9f3f --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/ExchangisGenericScheduler.java @@ -0,0 +1,65 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler; + +import org.apache.linkis.common.conf.CommonVars; +import org.apache.linkis.scheduler.AbstractScheduler; +import org.apache.linkis.scheduler.SchedulerContext; +import org.apache.linkis.scheduler.executer.ExecutorManager; +import org.apache.linkis.scheduler.queue.ConsumerManager; +import org.apache.linkis.scheduler.queue.GroupFactory; +import org.apache.linkis.scheduler.queue.fifoqueue.FIFOSchedulerContextImpl; + +/** + * Inherited the AbstractScheduler from linkis-scheduler + */ +public class ExchangisGenericScheduler extends AbstractScheduler { + + private static class Constraints{ + + private static final CommonVars MAX_PARALLEL_PER_TENANCY = CommonVars.apply("wds.exchangis.job.scheduler.consumer.max.parallel.per-tenancy", 1); + + private static final CommonVars TENANCY_PATTERN = CommonVars.apply("wds.exchangis.job.scheduler.consumer.tenancies", "hadoop,log"); + + private static final CommonVars GROUP_INIT_CAPACITY = CommonVars.apply("wds.exchangis.job.scheduler.group.min.capacity", 1000); + + private static final CommonVars GROUP_MAX_CAPACITY = CommonVars.apply("wds.exchangis.job.scheduler.group.max.capacity", 5000); + + private static final CommonVars GROUP_MAX_RUNNING_JOBS = CommonVars.apply("wds.exchangis.job.scheduler.group.max.running-jobs", 30); + } + + + private SchedulerContext schedulerContext; + + private ExecutorManager executorManager; + + private ConsumerManager consumerManager; + + public ExchangisGenericScheduler(ExecutorManager executorManager, ConsumerManager consumerManager){ + this.executorManager = executorManager; + this.consumerManager = consumerManager; + } + + @Override + public void init() { + this.schedulerContext = new ExchangisSchedulerContext(Constraints.MAX_PARALLEL_PER_TENANCY.getValue(), Constraints.TENANCY_PATTERN.getValue()); + GroupFactory groupFactory = this.schedulerContext.getOrCreateGroupFactory(); + if (groupFactory instanceof TenancyParallelGroupFactory){ + TenancyParallelGroupFactory tenancyParallelGroupFactory = (TenancyParallelGroupFactory)groupFactory; + tenancyParallelGroupFactory.setDefaultInitCapacity(Constraints.GROUP_INIT_CAPACITY.getValue()); + tenancyParallelGroupFactory.setDefaultMaxCapacity(Constraints.GROUP_MAX_CAPACITY.getValue()); + tenancyParallelGroupFactory.setDefaultMaxRunningJobs(Constraints.GROUP_MAX_RUNNING_JOBS.getValue()); + } + ((FIFOSchedulerContextImpl) this.schedulerContext).setExecutorManager(executorManager); + ((FIFOSchedulerContextImpl) this.schedulerContext).setConsumerManager(consumerManager); + } + + @Override + public String getName() { + return "Exchangis-Multi-Tenancy-Scheduler"; + } + + @Override + public SchedulerContext getSchedulerContext() { + return schedulerContext; + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/ExchangisSchedulerContext.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/ExchangisSchedulerContext.java new file mode 100644 index 000000000..3e2a14292 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/ExchangisSchedulerContext.java @@ -0,0 +1,44 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler; + +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerException; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.scheduler.queue.ConsumerManager; +import org.apache.linkis.scheduler.queue.GroupFactory; +import org.apache.linkis.scheduler.queue.fifoqueue.FIFOSchedulerContextImpl; + +import java.util.Arrays; +import java.util.Collections; + +/** + * Contains the executorManager, consumerManager and groupFactory + */ +public class ExchangisSchedulerContext extends FIFOSchedulerContextImpl { + + /** + * Tenancy list + */ + private String tenancies; + + private int maxParallelismPerUser = 1; + public ExchangisSchedulerContext(int maxParallelismPerUser, String tenancies) { + super(Integer.MAX_VALUE); + this.maxParallelismPerUser = maxParallelismPerUser; + if (StringUtils.isNotBlank(tenancies)){ + this.tenancies = tenancies; + } + } + + @Override + public GroupFactory createGroupFactory() { + TenancyParallelGroupFactory parallelGroupFactory = new TenancyParallelGroupFactory(); + parallelGroupFactory.setParallelPerTenancy(maxParallelismPerUser); + parallelGroupFactory.setTenancies(StringUtils.isNotBlank(tenancies)? Arrays.asList(tenancies.split(",")) : Collections.emptyList()); + return parallelGroupFactory; + } + + @Override + public ConsumerManager createConsumerManager() { + throw new ExchangisSchedulerException.Runtime("Must set the consumer manager before scheduling", null); + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/ExchangisSchedulerExecutorFactory.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/ExchangisSchedulerExecutorFactory.java new file mode 100644 index 000000000..eea78bc82 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/ExchangisSchedulerExecutorFactory.java @@ -0,0 +1,24 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler; + +import org.apache.linkis.scheduler.executer.Executor; +import org.apache.linkis.scheduler.queue.SchedulerEvent; + +/** + * Create executor + */ +public interface ExchangisSchedulerExecutorFactory { + + /** + * Whether create singleton executor + * @param singleton boolean + */ + void setIsSingleTon(boolean singleton); + + /** + * Create Executor + * @param event scheduler event + * @return executor + */ + Executor getOrCreateExecutor(SchedulerEvent event); + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/ExchangisSchedulerExecutorManager.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/ExchangisSchedulerExecutorManager.java new file mode 100644 index 000000000..02ea96da7 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/ExchangisSchedulerExecutorManager.java @@ -0,0 +1,194 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler; + +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerRetryException; +import org.apache.linkis.protocol.engine.EngineState; +import org.apache.linkis.scheduler.exception.LinkisJobRetryException; +import org.apache.linkis.scheduler.executer.*; +import org.apache.linkis.scheduler.listener.ExecutorListener; +import org.apache.linkis.scheduler.queue.SchedulerEvent; +import scala.Option; +import scala.Some; +import scala.concurrent.duration.Duration; + +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + + +/** + * Executor manager for scheduler + */ +public class ExchangisSchedulerExecutorManager extends ExecutorManager { + + private ExchangisSchedulerExecutorFactory schedulerExecutorFactory; + + public ExchangisSchedulerExecutorManager(ExchangisSchedulerExecutorFactory schedulerExecutorFactory){ + this.schedulerExecutorFactory = schedulerExecutorFactory; + } + + public ExchangisSchedulerExecutorManager(){ + this.schedulerExecutorFactory = new DefaultExchangisSchedulerExecutorFactory(); + } + @Override + public void setExecutorListener(ExecutorListener engineListener) { + // Emm, It is never be used + } + + @Override + public Executor createExecutor(SchedulerEvent event) { + return schedulerExecutorFactory.getOrCreateExecutor(event); + } + + @Override + public Option askExecutor(SchedulerEvent event) { + return Some.apply(schedulerExecutorFactory.getOrCreateExecutor(event)); + } + + @Override + public Option askExecutor(SchedulerEvent event, Duration wait) { + return askExecutor(event); + } + + @Override + public Option getById(long id) { + return null; + } + + @Override + public Executor[] getByGroup(String groupName) { + return new Executor[0]; + } + + @Override + public void delete(Executor executor) { + + } + + @Override + public void shutdown() { + // Do nothing + } + + public ExchangisSchedulerExecutorFactory getSchedulerExecutorFactory() { + return schedulerExecutorFactory; + } + + public static class DefaultExchangisSchedulerExecutorFactory implements ExchangisSchedulerExecutorFactory{ + + private static final Class DEFAULT_DIRECT_EXECUTOR = DefaultDirectExecutor.class; + + /** + * Register executor class + */ + private Map> registeredExecutorClass = new ConcurrentHashMap<>(); + /** + * Singleton instance holder + */ + private Map singletonExecutorHolder = new ConcurrentHashMap<>(); + /** + * Default true + */ + boolean isSingleton = true; + @Override + public void setIsSingleTon(boolean singleton) { + this.isSingleton = singleton; + } + + @Override + public Executor getOrCreateExecutor(SchedulerEvent event) { + String name = event.getClass().getName(); + if (isSingleton){ + return singletonExecutorHolder.computeIfAbsent(name, this::createExecutorInternal); + } + return createExecutorInternal(name); + } + + private Executor createExecutorInternal(String eventName){ + Class executorClass = registeredExecutorClass + .getOrDefault(eventName, DEFAULT_DIRECT_EXECUTOR); + try { + Constructor constructor = executorClass.getDeclaredConstructor(); + Executor executor = (Executor)constructor.newInstance(); + if (executor instanceof FactoryCreateExecutor){ + ((FactoryCreateExecutor)executor).setSchedulerExecutorFactory(this); + } + return executor; + } catch (NoSuchMethodException e) { + throw new ExchangisSchedulerException.Runtime("Fail to construct the executor for" + + " scheduler task: [" + eventName + "], reason: has no suitable constructor", e); + } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { + throw new ExchangisSchedulerException.Runtime("Fail to construct the executor for" + + " scheduler task: [" + eventName + "], reason: authority or other error", e); + } + } + /** + * Register method + * @param schedulerTask scheduler task + * @param schedulerExecutor scheduler executor + */ + public void registerTaskExecutor(Class schedulerTask, + Class schedulerExecutor){ + String schedulerTaskClass = schedulerTask.getCanonicalName(); + registeredExecutorClass.putIfAbsent(schedulerTaskClass, schedulerExecutor); + } + } + + public static abstract class FactoryCreateExecutor implements Executor{ + + /** + * Executor factory + */ + private ExchangisSchedulerExecutorFactory schedulerExecutorFactory; + + public ExchangisSchedulerExecutorFactory getSchedulerExecutorFactory() { + return schedulerExecutorFactory; + } + + public void setSchedulerExecutorFactory(ExchangisSchedulerExecutorFactory schedulerExecutorFactory) { + this.schedulerExecutorFactory = schedulerExecutorFactory; + } + } + + public static class DefaultDirectExecutor extends FactoryCreateExecutor{ + + @Override + public long getId() { + return 0; + } + + @Override + public ExecuteResponse execute(ExecuteRequest executeRequest) { + if (executeRequest instanceof AbstractExchangisSchedulerTask.DirectExecuteRequest){ + try { + ((AbstractExchangisSchedulerTask.DirectExecuteRequest)executeRequest).directExecute(); + return new SuccessExecuteResponse(); + } catch (ExchangisSchedulerException | ExchangisSchedulerRetryException e) { + e.setErrCode(LinkisJobRetryException.JOB_RETRY_ERROR_CODE()); + return new ErrorExecuteResponse("Exception occurred in scheduling, task will fail or retry on the next time, message: [" + + e.getMessage() + "]", e); + } catch (Exception e){ + return new ErrorExecuteResponse("Unknown Exception occurred in scheduling, message: [" + e.getMessage() + "]", e); + } + } + return new ErrorExecuteResponse("Unsupported execute request: code: [" + executeRequest.code() + "]", null); + } + + @Override + public EngineState state() { + return null; + } + + @Override + public ExecutorInfo getExecutorInfo() { + return null; + } + + @Override + public void close() throws IOException { + + } + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/ExchangisSchedulerTask.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/ExchangisSchedulerTask.java new file mode 100644 index 000000000..904906274 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/ExchangisSchedulerTask.java @@ -0,0 +1,18 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler; + +import org.apache.linkis.scheduler.queue.SchedulerEvent; + +/** + * Exchangis scheduler task + */ +public interface ExchangisSchedulerTask extends SchedulerEvent { + + /** + * Tenancy + * @return + */ + String getTenancy(); + + void setTenancy(String tenancy); + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/SchedulerThread.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/SchedulerThread.java new file mode 100644 index 000000000..df9717029 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/SchedulerThread.java @@ -0,0 +1,22 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler; + +/** + * Define the basic interface of thread in scheduler + */ +public interface SchedulerThread extends Runnable{ + /** + * Start entrance + */ + void start(); + + /** + * Stop entrance + */ + void stop(); + + /** + * Name + * @return + */ + String getName(); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/TenancyParallelConsumerManager.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/TenancyParallelConsumerManager.java new file mode 100644 index 000000000..da52b214b --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/TenancyParallelConsumerManager.java @@ -0,0 +1,154 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler; + +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerException; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.common.utils.Utils; +import org.apache.linkis.scheduler.listener.ConsumerListener; +import org.apache.linkis.scheduler.queue.*; +import org.apache.linkis.scheduler.queue.fifoqueue.FIFOGroup; +import org.apache.linkis.scheduler.queue.fifoqueue.FIFOUserConsumer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import javax.annotation.PreDestroy; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.locks.ReentrantLock; + +/** + * Tenancy parallel Consumer manager + */ +public class TenancyParallelConsumerManager extends ConsumerManager { + + private static final Logger LOG = LoggerFactory.getLogger(TenancyParallelConsumerManager.class); + + private ConsumerListener consumerListener; + + /** + * Default executor service + */ + private ExecutorService defaultExecutorService; + + private ReentrantLock defaultExecutorServiceLock = new ReentrantLock(); + + private Map tenancyExecutorServices = new ConcurrentHashMap<>(); + + private Map consumerGroupMap = new ConcurrentHashMap<>(); + + private int initResidentThreads = 1; + + @Override + public void setConsumerListener(ConsumerListener consumerListener) { + this.consumerListener = consumerListener; + } + + @Override + public ExecutorService getOrCreateExecutorService() { + if (Objects.isNull(defaultExecutorService)){ + defaultExecutorServiceLock.lock(); + try{ + Group group = getSchedulerContext().getOrCreateGroupFactory().getOrCreateGroup(null); + if (group instanceof FIFOGroup){ + defaultExecutorService = Utils.newCachedThreadPool(((FIFOGroup) group).getMaxRunningJobs() + + this.initResidentThreads + 1, + TenancyParallelGroupFactory.GROUP_NAME_PREFIX + TenancyParallelGroupFactory.DEFAULT_TENANCY + "-Executor-", true); + tenancyExecutorServices.put(TenancyParallelGroupFactory.DEFAULT_TENANCY, defaultExecutorService); + } else { + throw new ExchangisSchedulerException.Runtime("Cannot construct the executor service " + + "using the default group: [" + group.getClass().getCanonicalName() + "]", null); + } + }finally{ + defaultExecutorServiceLock.unlock(); + } + } + return this.defaultExecutorService; + } + + @Override + public Consumer getOrCreateConsumer(String groupName) { + Consumer resultConsumer = consumerGroupMap.computeIfAbsent(groupName, groupName0 -> { + Consumer consumer = createConsumer(groupName); + Group group = getSchedulerContext().getOrCreateGroupFactory().getGroup(groupName); + consumer.setGroup(group); + consumer.setConsumeQueue(new LoopArrayQueue(group)); + LOG.info("Create a new consumer for group: [{}]", groupName); + Optional.ofNullable(consumerListener).ifPresent( listener -> listener.onConsumerCreated(consumer)); + consumer.start(); + return consumer; + }); + if (resultConsumer instanceof FIFOUserConsumer){ + ((FIFOUserConsumer) resultConsumer).setLastTime(System.currentTimeMillis()); + } + return resultConsumer; + } + + @Override + public Consumer createConsumer(String groupName) { + Group group = getSchedulerContext().getOrCreateGroupFactory().getGroup(groupName); + return new FIFOUserConsumer(getSchedulerContext(), getOrCreateExecutorService(groupName), group); + } + + @Override + public void destroyConsumer(String groupName) { + Optional.ofNullable(consumerGroupMap.get(groupName)).ifPresent( consumer -> { + LOG.warn("Start to shutdown the consumer for group: [{}]", groupName); + consumer.shutdown(); + consumerGroupMap.remove(groupName); + Optional.ofNullable(consumerListener).ifPresent( listener -> listener.onConsumerDestroyed(consumer)); + LOG.warn("End to shutdown the consumer for group: [{}]", groupName); + }); + } + + /*** + * Will invoke if the spring container is down + */ + @Override + public void shutdown() { + LOG.warn("Shutdown all the consumers which is working"); + consumerGroupMap.forEach((group, consumer) -> consumer.shutdown()); + LOG.warn("Shutdown all the executor service for tenancies: [{}]", StringUtils.join(tenancyExecutorServices.keySet(), ",")); + tenancyExecutorServices.forEach((tenancy, executorService) -> executorService.shutdownNow()); + } + + @Override + public Consumer[] listConsumers() { + return consumerGroupMap.values().toArray(new Consumer[]{}); + } + + protected ExecutorService getOrCreateExecutorService(String groupName){ + GroupFactory groupFactory = getSchedulerContext().getOrCreateGroupFactory(); + if (groupFactory instanceof TenancyParallelGroupFactory){ + TenancyParallelGroupFactory parallelGroupFactory = (TenancyParallelGroupFactory)groupFactory; + String tenancy = parallelGroupFactory.getTenancyByGroupName(groupName); + groupFactory.getGroup(groupName); + if (StringUtils.isNotBlank(tenancy)){ + return tenancyExecutorServices.computeIfAbsent(tenancy, tenancyName -> { + // Use the default value of max running jobs + return Utils.newCachedThreadPool(parallelGroupFactory.getDefaultMaxRunningJobs() + parallelGroupFactory.getParallelPerTenancy(), + TenancyParallelGroupFactory.GROUP_NAME_PREFIX + tenancy + "-Executor-", true); + }); + } + } + return getOrCreateExecutorService(); + } + + public int getInitResidentThreads() { + return initResidentThreads; + } + + public void setInitResidentThreads(int initResidentThreads) { + this.initResidentThreads = initResidentThreads; + } + + /** + * Tenancy executor service + * @return + */ + public Map getTenancyExecutorServices() { + return tenancyExecutorServices; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/TenancyParallelGroupFactory.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/TenancyParallelGroupFactory.java new file mode 100644 index 000000000..cf0ab4447 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/TenancyParallelGroupFactory.java @@ -0,0 +1,79 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler; + +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.scheduler.queue.AbstractGroup; +import org.apache.linkis.scheduler.queue.SchedulerEvent; +import org.apache.linkis.scheduler.queue.fifoqueue.FIFOGroup; +import org.apache.linkis.scheduler.queue.fifoqueue.FIFOGroupFactory; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Multi-tenancy group factory + */ +public class TenancyParallelGroupFactory extends FIFOGroupFactory { + + private static final int DEFAULT_PARALLEL_PER_TENANCY = 1; + + public static final String GROUP_NAME_PREFIX = "Multi-Tenancy-Group-"; + + public static final String DEFAULT_TENANCY = "default"; + + private static final Pattern TENANCY_IN_GROUP_PATTERN = Pattern.compile("^" + GROUP_NAME_PREFIX + "([-_\\w\\W]+)?_\\d$"); + + private int parallelPerTenancy = DEFAULT_PARALLEL_PER_TENANCY; + + private List tenancies = new ArrayList<>(); + + public int getParallelPerTenancy() { + return parallelPerTenancy; + } + + public void setParallelPerTenancy(int parallelPerTenancy) { + if (parallelPerTenancy < 0) + this.parallelPerTenancy = parallelPerTenancy; + } + + public List getTenancies() { + return tenancies; + } + + public void setTenancies(List tenancies) { + this.tenancies = tenancies; + } + + @Override + public AbstractGroup createGroup(String groupName) { + // Also use the fifo group + return new FIFOGroup(groupName, getInitCapacity(groupName), getMaxCapacity(groupName)); + } + + + @Override + public String getGroupNameByEvent(SchedulerEvent event) { + String tenancy = ""; + if (Objects.nonNull(event) && (event instanceof AbstractExchangisSchedulerTask)){ + String tenancyInSchedule = ((AbstractExchangisSchedulerTask)event).getTenancy(); + if (tenancies.contains(tenancyInSchedule)){ + tenancy = tenancyInSchedule; + } + } + return StringUtils.isNotBlank(tenancy)? GROUP_NAME_PREFIX + tenancy + "_" + (event.getId().hashCode() % parallelPerTenancy) : GROUP_NAME_PREFIX + DEFAULT_TENANCY; + } + + public String getTenancyByGroupName(String groupName){ + String tenancy = null; + if (StringUtils.isNotBlank(groupName)){ + Matcher matcher = TENANCY_IN_GROUP_PATTERN.matcher(groupName); + if (matcher.find()){ + tenancy = matcher.group(1); + } + } + return tenancy; + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/loadbalance/DelayLoadBalancePoller.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/loadbalance/DelayLoadBalancePoller.java new file mode 100644 index 000000000..0f82f3066 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/loadbalance/DelayLoadBalancePoller.java @@ -0,0 +1,92 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler.loadbalance; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.DelayQueue; +import java.util.concurrent.Delayed; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +/** + * To poll element with delay timing property + */ +public abstract class DelayLoadBalancePoller implements LoadBalancePoller{ + + private static final int MAX_POLL_SIZE = 50; + + /** + * Delay queue + */ + private DelayQueue delayQueue = new DelayQueue<>(); + @Override + public List poll() throws InterruptedException { + List delayElements = new ArrayList<>(); + delayQueue.drainTo(delayElements, MAX_POLL_SIZE); + while (delayElements.isEmpty()){ + try { + DelayElement element = delayQueue.poll(3, TimeUnit.SECONDS); + if (Objects.nonNull(element)){ + delayElements.add(element); + } + } catch (InterruptedException e) { + throw new InterruptedException(); + } + } + return delayElements.stream().map(delayElement -> delayElement.element).collect(Collectors.toList()); + } + + @Override + public void push(T element) { + DelayElement delayElement = new DelayElement(element); + delayQueue.offer(delayElement); + } + + @Override + @SuppressWarnings("unchecked") + public void combine(LoadBalancePoller other) { + // Only combine with DelayLoadBalancePoller + if(other instanceof DelayLoadBalancePoller){ + DelayLoadBalancePoller poller = (DelayLoadBalancePoller)other; + for(Object delayElement : poller.delayQueue.toArray()){ + delayQueue.put((DelayElement) delayElement); + } + } + } + + @Override + public int size() { + return delayQueue.size(); + } + + /** + * Get the delay time from element + * @param element element + * @return timestamp + */ + protected abstract long getDelayTimeInMillis(T element); + + private class DelayElement implements Delayed{ + T element; + + private long triggerTime; + + DelayElement(T element){ + this.element = element; + this.triggerTime = getDelayTimeInMillis(element); + } + @Override + public long getDelay(TimeUnit unit) { + return unit.convert(this.triggerTime - System.currentTimeMillis(), TimeUnit.MILLISECONDS); + } + + @Override + @SuppressWarnings("unchecked") + public int compareTo(Delayed o) { + DelayElement delayElement = (DelayElement)o; + long compare = this.triggerTime - delayElement.triggerTime; + return compare <= 0? -1 : 1; + } + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/loadbalance/LoadBalancePoller.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/loadbalance/LoadBalancePoller.java new file mode 100644 index 000000000..145b39e9a --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/loadbalance/LoadBalancePoller.java @@ -0,0 +1,26 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler.loadbalance; + +import java.util.List; + +/** + * Poller for load balance + * @param + */ +public interface LoadBalancePoller { + + List poll() throws InterruptedException; + + /** + * Push the element + * @param element element + */ + void push(T element); + + /** + * Combine with other poller + * @param other + */ + void combine(LoadBalancePoller other); + + int size(); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/loadbalance/SchedulerLoadBalancer.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/loadbalance/SchedulerLoadBalancer.java new file mode 100644 index 000000000..d420dc229 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/loadbalance/SchedulerLoadBalancer.java @@ -0,0 +1,32 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler.loadbalance; + +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks.LoadBalanceSchedulerTask; +import org.apache.linkis.scheduler.Scheduler; + +import java.util.List; + + +/** + * load balancer api of scheduler + */ +public interface SchedulerLoadBalancer { + /** + * Register the scheduler task into the balancer + * @param schedulerTaskClass class of scheduler task + */ + void registerSchedulerTask(Class schedulerTaskClass); + + /** + * Choose the load balance scheduler tasks + * @param element task + * @return + */ + List> choose(T element); + + LoadBalanceSchedulerTask choose(T element, Class schedulerTaskClass); + /** + * Hold the scheduler to analyze the condition of loading + * @return + */ + Scheduler getScheduler(); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/AbstractLoadBalanceSchedulerTask.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/AbstractLoadBalanceSchedulerTask.java new file mode 100644 index 000000000..73db64e94 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/AbstractLoadBalanceSchedulerTask.java @@ -0,0 +1,121 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks; + +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerRetryException; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.AbstractExchangisSchedulerTask; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.loadbalance.LoadBalancePoller; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.loadbalance.SchedulerLoadBalancer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +/** + * Implement the load balance logic + * @param + */ +public abstract class AbstractLoadBalanceSchedulerTask extends AbstractExchangisSchedulerTask implements LoadBalanceSchedulerTask { + + private static final Logger LOG = LoggerFactory.getLogger(AbstractLoadBalanceSchedulerTask.class); + + private LoadBalancePoller loadBalancePoller; + + private SchedulerLoadBalancer schedulerLoadBalancer; + + private boolean pollFinish = false; + + public AbstractLoadBalanceSchedulerTask() { + super(""); + } + + @Override + protected void schedule() throws ExchangisSchedulerException, ExchangisSchedulerRetryException { + LoadBalancePoller loadBalancePoller = getOrCreateLoadBalancePoller(); + if (Objects.isNull(loadBalancePoller)) { + LOG.warn("LoadBalancePoller is empty in load balance scheduler task [{}]", getName()); + return; + } + List pollElements = new ArrayList<>(); + LOG.info("Start to iterate the poller in load balance scheduler task [{}]", getName()); + while (!pollFinish && null != pollElements) { + try { + pollElements = loadBalancePoller.poll(); + Optional.of(pollElements).ifPresent(elements -> { + elements.forEach(pollElement -> { + try { + onPoll(pollElement); + } catch (Exception e) { + LOG.warn("Error occurred in onPoll in load balance scheduler task [{}]", getName(), e); + } + }); + for( T pollElement : elements){ + try { + rePushWithBalancer(pollElement, this.schedulerLoadBalancer); + } catch (Exception e) { + throw new ExchangisSchedulerException.Runtime( + "Error occurred in rePush in load balance scheduler task [" + getName() + "]", e); + } + } + }); + + } catch (Exception e) { + if (e instanceof InterruptedException && pollFinish){ + LOG.trace("Poller is interrupted by shutdown, will exit gradually"); + }else { + if (e instanceof ExchangisSchedulerException.Runtime) { + LOG.warn("Schedule method error", e); + } + LOG.warn("Error occurred in poll/onPoll/rePush in load balance scheduler task [{}]", getName(), e); + } + } + } + LOG.info("End to iterate the poller in load balance scheduler task [{}]", getName()); + } + + @Override + public LoadBalancePoller getOrCreateLoadBalancePoller() { + if (null == this.loadBalancePoller){ + synchronized (this){ + if (null == this.loadBalancePoller) { + this.loadBalancePoller = createLoadBalancePoller(); + } + } + } + return this.loadBalancePoller; + } + + public SchedulerLoadBalancer getSchedulerLoadBalancer() { + return schedulerLoadBalancer; + } + + public void setSchedulerLoadBalancer(SchedulerLoadBalancer schedulerLoadBalancer) { + this.schedulerLoadBalancer = schedulerLoadBalancer; + } + + /** + * Re push the element into poller with balancer + * @param element element + * @param loadBalancer load balancer + */ + private void rePushWithBalancer(T element, SchedulerLoadBalancer loadBalancer) throws ExchangisSchedulerException{ + LoadBalanceSchedulerTask loadBalanceSchedulerTask = loadBalancer.choose(element, this.getClass()); + Optional.ofNullable(loadBalanceSchedulerTask).ifPresent(schedulerTask -> + schedulerTask.getOrCreateLoadBalancePoller().push(element)); + } + @Override + public void kill() { + pollFinish = true; + super.kill(); + } + + protected abstract void onPoll(T element) throws ExchangisSchedulerException, ExchangisSchedulerRetryException; + + /** + * Create the load balance poller + * @return + */ + protected abstract LoadBalancePoller createLoadBalancePoller(); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/GenerationSchedulerTask.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/GenerationSchedulerTask.java new file mode 100644 index 000000000..eeaefba14 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/GenerationSchedulerTask.java @@ -0,0 +1,60 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks; + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisJob; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerRetryException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskGenerateException; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.TaskGenerator; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.TaskGeneratorContext; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.AbstractTaskGenerator; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.AbstractExchangisSchedulerTask; +import org.apache.linkis.scheduler.queue.JobInfo; + +public class GenerationSchedulerTask extends AbstractExchangisSchedulerTask { + + private LaunchableExchangisJob launchableExchangisJob; + + private TaskGeneratorContext ctx; + + private TaskGenerator taskGenerator; + /** + * Each schedule task should has an id + * + */ + public GenerationSchedulerTask(TaskGenerator taskGenerator, + ExchangisJobInfo exchangisJobInfo) throws ExchangisTaskGenerateException { + super(""); + this.taskGenerator = taskGenerator; + this.launchableExchangisJob = taskGenerator.init(exchangisJobInfo); + this.ctx = taskGenerator.getTaskGeneratorContext(); + this.scheduleId = this.launchableExchangisJob.getJobExecutionId(); + } + + @Override + protected void schedule() throws ExchangisSchedulerException, ExchangisSchedulerRetryException { + try { + this.taskGenerator.generate(this.launchableExchangisJob, this.getTenancy()); + } catch (Exception e) { + String errorMessage = "Exception in generating launchable tasks: [ name: " + launchableExchangisJob.getExchangisJobInfo().getName() + + ", job_execution_id: " + launchableExchangisJob.getJobExecutionId() + "]"; + // TODO retry the generating progress + if (!(e instanceof ExchangisTaskGenerateException)){ + // Retry the generate progress +// throw new ExchangisSchedulerRetryException(errorMessage, e); + } + throw new ExchangisSchedulerException(errorMessage, e); + } + } + + @Override + public String getName() { + return "Scheduler-GenerationTask-" + getId(); + } + + + @Override + public JobInfo getJobInfo() { + return null; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/LoadBalanceSchedulerTask.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/LoadBalanceSchedulerTask.java new file mode 100644 index 000000000..2eaa8cbb4 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/LoadBalanceSchedulerTask.java @@ -0,0 +1,19 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks; + +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.ExchangisSchedulerTask; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.loadbalance.LoadBalancePoller; + +/** + * Scheduler task could be balanced, + * Each one is a resident task with a poller + * @param + */ +public interface LoadBalanceSchedulerTask extends ExchangisSchedulerTask { + + /** + * Get/Create a poller + * @return + */ + LoadBalancePoller getOrCreateLoadBalancePoller(); + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/MetricUpdateSchedulerTask.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/MetricUpdateSchedulerTask.java new file mode 100644 index 000000000..4fded220d --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/MetricUpdateSchedulerTask.java @@ -0,0 +1,67 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks; + +import com.webank.wedatasphere.exchangis.job.launcher.exception.ExchangisTaskLaunchException; +import com.webank.wedatasphere.exchangis.job.launcher.AccessibleLauncherTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerRetryException; +import com.webank.wedatasphere.exchangis.job.server.execution.TaskManager; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.loadbalance.DelayLoadBalancePoller; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.loadbalance.LoadBalancePoller; +import org.apache.linkis.common.conf.CommonVars; +import org.apache.linkis.scheduler.queue.JobInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Map; +import java.util.Objects; + +/** + * Metric update scheduler task + */ +public class MetricUpdateSchedulerTask extends AbstractLoadBalanceSchedulerTask { + + private static final Logger LOG = LoggerFactory.getLogger(MetricUpdateSchedulerTask.class); + + private static final CommonVars METRIC_UPDATE_INTERVAL = CommonVars.apply("wds.exchangis.job.scheduler.task.metric.update.interval-in-millis", 3000L); + + private TaskManager taskManager; + + public MetricUpdateSchedulerTask(TaskManager taskManager){ + this.taskManager = taskManager; + } + + @Override + protected void onPoll(LaunchedExchangisTask launchedExchangisTask) throws ExchangisSchedulerException, ExchangisSchedulerRetryException { + LOG.trace("Metrics update task: [{}] in scheduler: [{}]", launchedExchangisTask.getTaskId(), getName()); + AccessibleLauncherTask launcherTask = launchedExchangisTask.getLauncherTask(); + try { + Map metricsInfo = launcherTask.getMetricsInfo(); + if (Objects.nonNull(metricsInfo)){ + taskManager.refreshRunningTaskMetrics(launchedExchangisTask, metricsInfo); + } + } catch (ExchangisTaskLaunchException e) { + throw new ExchangisSchedulerException("Fail to get metrics information for task: [" + launchedExchangisTask.getTaskId() + "]", e); + } + } + + @Override + protected LoadBalancePoller createLoadBalancePoller() { + return new DelayLoadBalancePoller() { + @Override + protected long getDelayTimeInMillis(LaunchedExchangisTask element) { + return System.currentTimeMillis() + METRIC_UPDATE_INTERVAL.getValue(); + } + }; + } + + @Override + public String getName() { + return getId() + "-Metric"; + } + + @Override + public JobInfo getJobInfo() { + return null; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/StatusUpdateSchedulerTask.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/StatusUpdateSchedulerTask.java new file mode 100644 index 000000000..e5033ee9f --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/StatusUpdateSchedulerTask.java @@ -0,0 +1,66 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks; + +import com.webank.wedatasphere.exchangis.job.launcher.exception.ExchangisTaskLaunchException; +import com.webank.wedatasphere.exchangis.job.launcher.AccessibleLauncherTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskProgressInfo; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerRetryException; +import com.webank.wedatasphere.exchangis.job.server.execution.TaskManager; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.loadbalance.DelayLoadBalancePoller; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.loadbalance.LoadBalancePoller; +import org.apache.linkis.common.conf.CommonVars; +import org.apache.linkis.scheduler.queue.JobInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Objects; + +/** + * Status update scheduler task + */ +public class StatusUpdateSchedulerTask extends AbstractLoadBalanceSchedulerTask { + + private static final Logger LOG = LoggerFactory.getLogger(StatusUpdateSchedulerTask.class); + private static final CommonVars STATUS_UPDATE_INTERVAL = CommonVars.apply("wds.exchangis.job.scheduler.task.status.update.interval-in-millis", 5000L); + + private TaskManager taskManager; + + public StatusUpdateSchedulerTask(TaskManager taskManager){ + this.taskManager = taskManager; + } + @Override + protected void onPoll(LaunchedExchangisTask launchedExchangisTask) throws ExchangisSchedulerException, ExchangisSchedulerRetryException { + LOG.trace("Status update task: [{}] in scheduler: [{}]", launchedExchangisTask.getId(), getName()); + AccessibleLauncherTask launcherTask = launchedExchangisTask.getLauncherTask(); + try{ + TaskProgressInfo progressInfo = launcherTask.getProgressInfo(); + if (Objects.nonNull(progressInfo)){ + this.taskManager.refreshRunningTaskProgress(launchedExchangisTask, progressInfo); + } + this.taskManager.refreshRunningTaskStatus(launchedExchangisTask, launcherTask.getLocalStatus()); + } catch (ExchangisTaskLaunchException e){ + throw new ExchangisSchedulerException("Fail to update status(progress) for task: [" + launchedExchangisTask.getTaskId() + "]", e); + } + } + + @Override + protected LoadBalancePoller createLoadBalancePoller() { + return new DelayLoadBalancePoller() { + @Override + protected long getDelayTimeInMillis(LaunchedExchangisTask element) { + return System.currentTimeMillis() + STATUS_UPDATE_INTERVAL.getValue(); + } + }; + } + + @Override + public String getName() { + return getId() + "-Status"; + } + + @Override + public JobInfo getJobInfo() { + return null; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/SubmitSchedulerTask.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/SubmitSchedulerTask.java new file mode 100644 index 000000000..f65507ca2 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/scheduler/tasks/SubmitSchedulerTask.java @@ -0,0 +1,178 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks; + +import com.webank.wedatasphere.exchangis.job.launcher.exception.ExchangisTaskLaunchException; +import com.webank.wedatasphere.exchangis.job.launcher.ExchangisTaskLauncher; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; +import com.webank.wedatasphere.exchangis.job.listener.JobLogListener; +import com.webank.wedatasphere.exchangis.job.listener.events.JobLogEvent; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerRetryException; +import com.webank.wedatasphere.exchangis.job.server.execution.AbstractTaskManager; +import com.webank.wedatasphere.exchangis.job.server.execution.TaskManager; +import com.webank.wedatasphere.exchangis.job.server.execution.events.TaskExecutionEvent; +import com.webank.wedatasphere.exchangis.job.server.execution.events.TaskDeleteEvent; +import com.webank.wedatasphere.exchangis.job.server.execution.events.TaskStatusUpdateEvent; +import com.webank.wedatasphere.exchangis.job.server.execution.loadbalance.TaskSchedulerLoadBalancer; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.AbstractExchangisSchedulerTask; +import com.webank.wedatasphere.exchangis.job.server.log.JobServerLogging; +import org.apache.linkis.scheduler.queue.JobInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; +import java.util.concurrent.Callable; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * Submit scheduler task + */ +public class SubmitSchedulerTask extends AbstractExchangisSchedulerTask implements JobServerLogging { + + private static final Logger LOG = LoggerFactory.getLogger(SubmitSchedulerTask.class); + + private LaunchableExchangisTask launchableExchangisTask; + + private TaskManager taskManager; + + private ExchangisTaskLauncher launcher; + + private TaskSchedulerLoadBalancer loadBalancer; + + private Callable submitCondition; + + private AtomicInteger retryCnt = new AtomicInteger(0); + /** + * Each schedule task should has an id + * + */ + public SubmitSchedulerTask(LaunchableExchangisTask task, Callable submitCondition) { + super(String.valueOf(task.getId())); + this.launchableExchangisTask = task; + this.submitCondition = submitCondition; + } + + public SubmitSchedulerTask(LaunchableExchangisTask task){ + this(task, null); + } + @Override + protected void schedule() throws ExchangisSchedulerException, ExchangisSchedulerRetryException { + Boolean submitAble; + String jobExecutionId = this.launchableExchangisTask.getJobExecutionId(); + try { + submitAble = submitCondition.call(); + } catch (Exception e){ + throw new ExchangisSchedulerRetryException("Error occurred in examining submit condition for task: [" + launchableExchangisTask.getId() + "]", e); + } + if (submitAble) { + info(jobExecutionId, "Submit the launchable task: [name:{} ,id:{} ] to launcher: [{}], retry_count: {}", + launchableExchangisTask.getName(), launchableExchangisTask.getId(), launcher.name(), retryCnt.get()); + LaunchedExchangisTask launchedExchangisTask; + try { + // Invoke launcher + Date launchTime = Calendar.getInstance().getTime(); + launchedExchangisTask = launcher.launch(this.launchableExchangisTask); +// launchedExchangisTask = new LaunchedExchangisTask(launchableExchangisTask); + launchedExchangisTask.setLaunchTime(launchTime); + } catch (Exception e) { + if (retryCnt.incrementAndGet() < getMaxRetryNum()) { + // Remove the launched task stored + onEvent(new TaskDeleteEvent(String.valueOf(launchableExchangisTask.getId()))); + throw new ExchangisSchedulerRetryException("Error occurred in invoking launching method for task: [" + launchableExchangisTask.getId() +"]", e); + }else { + // Update the launched task status to fail + launchedExchangisTask = new LaunchedExchangisTask(); + launchedExchangisTask.setTaskId(String.valueOf(launchableExchangisTask.getId())); + launchedExchangisTask.setJobExecutionId(launchableExchangisTask.getJobExecutionId()); + onEvent(new TaskStatusUpdateEvent(launchedExchangisTask, TaskStatus.Failed)); + } + throw new ExchangisSchedulerException("Error occurred in invoking launching method for task: [" + launchableExchangisTask.getId() +"]", e); + } + // Add the success/launched job into taskManager + if (Objects.nonNull(this.taskManager)){ + boolean successAdd = true; + try { + this.taskManager.addRunningTask(launchedExchangisTask); + } catch (Exception e){ + successAdd = false; + error(jobExecutionId, "Error occurred in adding running task: [{}] to taskManager, linkis_id: [{}], should kill the job in linkis!", + launchedExchangisTask.getId(), launchedExchangisTask.getLinkisJobId(), e); + LaunchedExchangisTask finalLaunchedExchangisTask1 = launchedExchangisTask; + Optional.ofNullable(launchedExchangisTask.getLauncherTask()).ifPresent(launcherTask -> { + try { + launcherTask.kill(); + } catch (ExchangisTaskLaunchException ex){ + LOG.error("Kill linkis_id: [{}] fail", finalLaunchedExchangisTask1.getLinkisJobId(), e); + } + }); + } + if (successAdd && Objects.nonNull(this.loadBalancer)) { + // Add the launchedExchangisTask to the load balance poller + List> loadBalanceSchedulerTasks = this.loadBalancer.choose(launchedExchangisTask); + LaunchedExchangisTask finalLaunchedExchangisTask = launchedExchangisTask; + Optional.ofNullable(loadBalanceSchedulerTasks).ifPresent(tasks -> tasks.forEach(loadBalanceSchedulerTask -> { + loadBalanceSchedulerTask.getOrCreateLoadBalancePoller().push(finalLaunchedExchangisTask); + })); + } + } + } + } + + /** + * Listen the execution event + * @param event + */ + private void onEvent(TaskExecutionEvent event){ + if (this.taskManager instanceof AbstractTaskManager) { + ((AbstractTaskManager) this.taskManager).onEvent(event); + } + } + + @Override + public JobLogEvent getJobLogEvent(JobLogEvent.Level level, String executionId, String message, Object... args) { + return new JobLogEvent(level, this.getTenancy(), executionId, message, args); + } + + @Override + public JobLogListener getJobLogListener() { + if (Objects.nonNull(this.taskManager)){ + return this.taskManager.getJobLogListener(); + } + return null; + } + + @Override + public String getName() { + return "Scheduler-SubmitTask-" + getId(); + } + + @Override + public JobInfo getJobInfo() { + return null; + } + + public TaskManager getTaskManager() { + return taskManager; + } + + public void setTaskManager(TaskManager taskManager) { + this.taskManager = taskManager; + } + + public ExchangisTaskLauncher getLauncher() { + return launcher; + } + + public void setLauncher(ExchangisTaskLauncher launcher) { + this.launcher = launcher; + } + + public TaskSchedulerLoadBalancer getLoadBalancer() { + return loadBalancer; + } + + public void setLoadBalancer(TaskSchedulerLoadBalancer loadBalancer) { + this.loadBalancer = loadBalancer; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/AbstractTaskObserver.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/AbstractTaskObserver.java new file mode 100644 index 000000000..84fb7586b --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/AbstractTaskObserver.java @@ -0,0 +1,233 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.subscriber; + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisTask; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskObserverException; +import com.webank.wedatasphere.exchangis.job.server.execution.TaskExecution; +import com.webank.wedatasphere.exchangis.job.server.execution.TaskManager; +import org.apache.linkis.common.conf.CommonVars; +import org.apache.linkis.scheduler.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.Objects; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.ReentrantLock; + +/** + * Contains the schedule and publish strategies + */ +public abstract class AbstractTaskObserver implements TaskObserver { + + private static final Logger LOG = LoggerFactory.getLogger(AbstractTaskObserver.class); + + private static final int DEFAULT_TASK_OBSERVER_PUBLISH_INTERVAL = 30000; + + private static final int DEFAULT_TASK_OBSERVER_PUBLISH_BATCH = 50; + + private static final CommonVars TASK_OBSERVER_PUBLISH_INTERVAL = CommonVars.apply("wds.exchangis.job.task.observer.publish.interval-in-millisecond", DEFAULT_TASK_OBSERVER_PUBLISH_INTERVAL); + + private static final CommonVars TASK_OBSERVER_PUBLISH_BATCH = CommonVars.apply("wds.exchangis.job.task.observer.publish.batch", DEFAULT_TASK_OBSERVER_PUBLISH_BATCH); + + private Scheduler scheduler; + + private TaskChooseRuler taskChooseRuler; + + /** + * Task manager + */ + private TaskManager taskManager; + + private TaskExecution taskExecution; + + private ReentrantLock observerLock = new ReentrantLock(); + + private Condition emptyCondition = observerLock.newCondition(); + + private AtomicBoolean waitStatus = new AtomicBoolean(false); + + private Future observerFuture; + + protected int publishBatch; + + protected int publishInterval; + + protected long lastPublishTime = -1; + + private boolean isShutdown = false; + + public AbstractTaskObserver(int publishBatch, int publishInterval){ + if (publishBatch <= 0){ + throw new IllegalArgumentException("Batch size of task subscribed cannot be less than(<) 0"); + } + this.publishBatch = publishBatch; + this.publishInterval = publishInterval; + } + + public AbstractTaskObserver(){ + this.publishBatch = TASK_OBSERVER_PUBLISH_BATCH.getValue(); + this.publishInterval = TASK_OBSERVER_PUBLISH_INTERVAL.getValue(); + } + + @Override + public void run() { + Thread.currentThread().setName("Observe-Thread-" + getName()); + LOG.info("Thread: [ {} ] is started. ", Thread.currentThread().getName()); + while (!isShutdown) { + try { + List publishedTasks; + try { + publishedTasks = onPublish(publishBatch); + this.lastPublishTime = System.currentTimeMillis(); + } catch (ExchangisTaskObserverException e){ + e.setMethodName("call_on_publish"); + throw e; + } + if (!publishedTasks.isEmpty()) { + List chooseTasks; + try { + chooseTasks = choose(publishedTasks, getTaskChooseRuler(), getScheduler()); + } catch (Exception e){ + throw new ExchangisTaskObserverException("call_choose_rule", "Fail to choose candidate tasks", e); + } + if (!chooseTasks.isEmpty()) { + try { + subscribe(chooseTasks); + } catch (ExchangisTaskObserverException e){ + e.setMethodName("call_subscribe"); + throw e; + } + } + } + sleepOrWaitIfNeed(publishedTasks); + } catch (Exception e){ + if(e instanceof ExchangisTaskObserverException){ + LOG.warn("Observer exception in progress paragraph: [{}]",((ExchangisTaskObserverException)e).getMethodName(), e); + } + LOG.warn("Unknown exception happened in observing thread", e); + // Enforce to sleep + try { + Thread.sleep(publishInterval); + } catch (InterruptedException ex) { + //Ignore + } + } + } + LOG.info("Thread: [ {} ] is stopped. ", Thread.currentThread().getName()); + } + + @Override + public synchronized void start() { + if (Objects.isNull(this.scheduler)){ + throw new ExchangisTaskObserverException.Runtime("TaskScheduler cannot be empty, please set it before starting the ["+ getName() +"]!", null); + } + if (Objects.nonNull(this.observerFuture)){ + throw new ExchangisTaskObserverException.Runtime("The observer: [" + getName() +"] has been started before", null); + } + // Submit self to default executor service + this.observerFuture = this.scheduler.getSchedulerContext() + .getOrCreateConsumerManager().getOrCreateExecutorService().submit(this); + } + + @Override + public synchronized void stop() { + if (Objects.nonNull(this.observerFuture)) { + this.isShutdown = true; + this.observerFuture.cancel(true); + } + } + + /** + * Sleep or wait during the publish and subscribe + * @param publishedTasks published tasks + */ + private void sleepOrWaitIfNeed(List publishedTasks){ + long observerWait = this.lastPublishTime + publishInterval - System.currentTimeMillis(); + if (publishedTasks.isEmpty() || observerWait > 0) { + observerWait = observerWait > 0? observerWait : publishInterval; + boolean hasLock = observerLock.tryLock(); + if (hasLock) { + try { + LOG.trace("TaskObserver wait in {} ms to ", observerWait); + waitStatus.set(true); + emptyCondition.await(observerWait, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + if (isShutdown){ + LOG.warn("TaskObserver wait is interrupted by shutdown"); + } else { + LOG.warn("TaskObserver wait is interrupted", e); + } + } finally { + waitStatus.set(false); + observerLock.unlock(); + } + } + } + } + protected abstract List onPublish(int batchSize) throws ExchangisTaskObserverException; + + /** + * Call publish + */ + protected void publish(){ + if (waitStatus.get()) { + observerLock.lock(); + try { + emptyCondition.signalAll(); + } finally { + observerLock.unlock(); + } + } + } + protected List choose(List candidateTasks, TaskChooseRuler chooseRuler, Scheduler scheduler){ + return chooseRuler.choose(candidateTasks, scheduler); + } + + @Override + public TaskChooseRuler getTaskChooseRuler() { + return this.taskChooseRuler; + } + + @Override + public void setTaskChooseRuler(TaskChooseRuler ruler) { + this.taskChooseRuler = ruler; + } + + + @Override + public Scheduler getScheduler() { + return scheduler; + } + + public void setScheduler(Scheduler scheduler) { + this.scheduler = scheduler; + } + + @Override + public TaskManager getTaskManager() { + return this.taskManager; + } + + @Override + public void setTaskManager(TaskManager taskManager) { + this.taskManager = taskManager; + } + + @Override + public void setTaskExecution(TaskExecution taskExecution) { + this.taskExecution = taskExecution; + } + + @Override + public TaskExecution getTaskExecution() { + return taskExecution; + } + + @Override + public String getName() { + return getClass().getSimpleName(); + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/CacheInTaskObserver.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/CacheInTaskObserver.java new file mode 100644 index 000000000..4500adadb --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/CacheInTaskObserver.java @@ -0,0 +1,114 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.subscriber; + + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisTask; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskObserverException; +import org.apache.linkis.common.conf.CommonVars; +import org.apache.linkis.scheduler.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; +import java.util.concurrent.ArrayBlockingQueue; + +/** + * Subscribe the task cached in memory(queue) + */ +public abstract class CacheInTaskObserver extends AbstractTaskObserver { + + private static final Logger LOG = LoggerFactory.getLogger(CacheInTaskObserver.class); + + protected Queue queue; + + private static final CommonVars TASK_OBSERVER_CACHE_SIZE = CommonVars.apply("wds.exchangis.job.task.observer.cache.size", 3000); + + public CacheInTaskObserver(int cacheSize){ + this.queue = new ArrayBlockingQueue<>(cacheSize); + } + + public CacheInTaskObserver(){ + this.queue = new ArrayBlockingQueue<>(TASK_OBSERVER_CACHE_SIZE.getValue()); + } + @Override + public List onPublish(int batchSize) throws ExchangisTaskObserverException { + List cacheTasks = new ArrayList<>(batchSize); + T polledTask; + while (cacheTasks.size() < batchSize && (polledTask = queue.poll()) != null){ + cacheTasks.add(polledTask); + } + int fetchTaskSize = cacheTasks.size(); + int restBatchSize = batchSize - fetchTaskSize; + if (restBatchSize > 0 && (this.lastPublishTime + this.publishInterval < System.currentTimeMillis())) { + Optional.ofNullable(onPublishNext(restBatchSize)).ifPresent(cacheTasks::addAll); + } + return cacheTasks; + } + + @Override + protected List choose(List candidateTasks, + TaskChooseRuler chooseRuler, Scheduler scheduler) { + List chooseTasks = chooseRuler.choose(candidateTasks, scheduler); + // Left the rejected tasks + candidateTasks.removeAll(chooseTasks); + // Update the lastUpdateTime + Date currentTime = Calendar.getInstance().getTime(); + candidateTasks.forEach(task -> task.setLastUpdateTime(currentTime)); + // Requeue into + this.queue.addAll(candidateTasks); + return chooseTasks; + } + + protected abstract List onPublishNext(int batchSize) throws ExchangisTaskObserverException; + /** + * Offer operation for service to add/offer queue + * @return queue + */ + public Queue getCacheQueue(){ + return new OperateLimitQueue(this.queue); + } + + /** + * Limit the operation + */ + private class OperateLimitQueue extends AbstractQueue{ + + private Queue innerQueue; + + public OperateLimitQueue(Queue queue){ + this.innerQueue = queue; + } + + @Override + public Iterator iterator() { + throw new ExchangisTaskObserverException.Runtime("Unsupported operation 'iterator'", null); + } + + @Override + public int size() { + return this.innerQueue.size(); + } + + @Override + public boolean offer(T launchableExchangisTask) { + boolean offer = this.innerQueue.offer(launchableExchangisTask); + if(offer){ + try { + publish(); + } catch (Exception e){ + LOG.warn("Publish the launchable task: {} has occurred an exception", launchableExchangisTask.getId(), e); + } + } + return offer; + } + + @Override + public T poll() { + throw new ExchangisTaskObserverException.Runtime("Unsupported operation 'poll'", null); + } + + @Override + public T peek() { + throw new ExchangisTaskObserverException.Runtime("Unsupported operation 'peek'", null); + } + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/MaxUsageTaskChooseRuler.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/MaxUsageTaskChooseRuler.java new file mode 100644 index 000000000..4ccbeb3d5 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/MaxUsageTaskChooseRuler.java @@ -0,0 +1,44 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.subscriber; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.TenancyParallelConsumerManager; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.TenancyParallelGroupFactory; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.scheduler.Scheduler; +import org.apache.linkis.scheduler.queue.ConsumerManager; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +/** + * Max usage of queue in executor service + */ +public class MaxUsageTaskChooseRuler implements TaskChooseRuler{ + + @Override + public List choose(List candidates, Scheduler scheduler) { + ConsumerManager consumerManager = scheduler.getSchedulerContext().getOrCreateConsumerManager(); + if (consumerManager instanceof TenancyParallelConsumerManager){ + TenancyParallelConsumerManager tenancyConsumerManager = (TenancyParallelConsumerManager)consumerManager; + Map tenancyExecutorServices = tenancyConsumerManager.getTenancyExecutorServices(); + Map candidateCounter = new HashMap<>(); + return candidates.stream().filter( task -> { + String tenancy = StringUtils.isNotBlank(task.getExecuteUser())? + task.getExecuteUser(): TenancyParallelGroupFactory.DEFAULT_TENANCY; + ExecutorService executorService = tenancyExecutorServices.get(tenancy); + AtomicInteger counter = candidateCounter.computeIfAbsent(tenancy, (key) -> new AtomicInteger(0)); + // TODO complete the choose rule + return Objects.isNull(executorService) || ((ThreadPoolExecutor)executorService).getQueue().remainingCapacity() >= counter.incrementAndGet(); + }).collect(Collectors.toList()); + } + return candidates; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/NewInTaskObserver.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/NewInTaskObserver.java new file mode 100644 index 000000000..17b0e0b9f --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/NewInTaskObserver.java @@ -0,0 +1,76 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.subscriber; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskObserverException; +import com.webank.wedatasphere.exchangis.job.server.execution.TaskExecution; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks.SubmitSchedulerTask; +import com.webank.wedatasphere.exchangis.job.server.service.TaskObserverService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.Iterator; +import java.util.List; +import java.util.Objects; + +/** + * Subscribe the new task from database and then submit to scheduler + */ +@Component +public class NewInTaskObserver extends CacheInTaskObserver { + + private static final Logger LOG = LoggerFactory.getLogger(NewInTaskObserver.class); + + @Resource + private TaskObserverService taskObserverService; + + @Override + protected List onPublishNext(int batchSize){ + // Get the launchable task from launchable task inner join launched task + List tasks = taskObserverService.onPublishLaunchableTask(batchSize); + if (!tasks.isEmpty()) { + LOG.info("Get the launchable task from database, size: [{}]", tasks.size()); + } + return tasks; + } + + + @Override + public void subscribe(List publishedTasks) throws ExchangisTaskObserverException { + Iterator iterator = publishedTasks.iterator(); + TaskExecution taskExecution = getTaskExecution(); + if (Objects.isNull(taskExecution)){ + throw new ExchangisTaskObserverException("TaskExecution cannot be null, please set it before subscribing!", null); + } + while(iterator.hasNext()){ + LaunchableExchangisTask launchableExchangisTask = iterator.next(); + if (Objects.nonNull(launchableExchangisTask)){ + try { + SubmitSchedulerTask submitSchedulerTask = new SubmitSchedulerTask(launchableExchangisTask, + () -> { + // check the status of launchedTask + // insert or update launched task, status as TaskStatus.Scheduler + return taskObserverService.subscribe(launchableExchangisTask); + }); + submitSchedulerTask.setTenancy(launchableExchangisTask.getExecuteUser()); + try { + taskExecution.submit(submitSchedulerTask); + } catch (Exception e) { + LOG.warn("Fail to async submit launchable task: [ id: {}, name: {}, job_execution_id: {} ]" + , launchableExchangisTask.getId(), launchableExchangisTask.getName(), launchableExchangisTask.getJobExecutionId(), e); + } + } catch (Exception e){ + LOG.error("Exception in subscribing launchable tasks, please check your status of database and network", e); + } + } + iterator.remove(); + } + } + + @Override + public String getName() { + return "NewInTaskObserver"; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/ReceiveTaskSubscriber.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/ReceiveTaskSubscriber.java new file mode 100644 index 000000000..f0748660b --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/ReceiveTaskSubscriber.java @@ -0,0 +1,27 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.subscriber; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskObserverException; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; + +/** + * Default implements + */ +@Component +public class ReceiveTaskSubscriber extends AbstractTaskObserver { + + + @Override + protected List onPublish(int batchSize) throws ExchangisTaskObserverException { + return new ArrayList<>(); + } + + + @Override + public void subscribe(List publishedTasks) throws ExchangisTaskObserverException { + + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/TaskChooseRuler.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/TaskChooseRuler.java new file mode 100644 index 000000000..9b0f08762 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/TaskChooseRuler.java @@ -0,0 +1,20 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.subscriber; + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisTask; +import org.apache.linkis.scheduler.Scheduler; + +import java.util.List; + +/** + * Choose rule + */ +public interface TaskChooseRuler { + + /** + * Choose the tasks from candidates with scheduler + * @param candidates candidate task + * @param scheduler scheduler + * @return + */ + List choose(List candidates, Scheduler scheduler); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/TaskObserver.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/TaskObserver.java new file mode 100644 index 000000000..d0a7b582f --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/TaskObserver.java @@ -0,0 +1,54 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.subscriber; + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisTask; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskObserverException; +import com.webank.wedatasphere.exchangis.job.server.execution.TaskExecution; +import com.webank.wedatasphere.exchangis.job.server.execution.TaskManager; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.SchedulerThread; +import org.apache.linkis.scheduler.Scheduler; + +import java.util.List; + + +/** + * Subscribe the ExchangisTask + * @param extends ExchangisTask + */ +public interface TaskObserver extends SchedulerThread { + + + /** + * Subscribe method + * @param publishedTasks + */ + void subscribe(List publishedTasks) throws ExchangisTaskObserverException; + + /** + * Task choose ruler + * @return ruler + */ + TaskChooseRuler getTaskChooseRuler(); + + void setTaskChooseRuler(TaskChooseRuler ruler); + + /** + * Scheduler + * @return + */ + Scheduler getScheduler(); + + void setScheduler(Scheduler scheduler); + + /** + * Task manager + * @return + */ + TaskManager getTaskManager(); + + void setTaskManager(TaskManager taskManager); + + void setTaskExecution(TaskExecution execution); + + TaskExecution getTaskExecution(); + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/UpdateInTaskObserver.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/UpdateInTaskObserver.java new file mode 100644 index 000000000..004a8d53a --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/UpdateInTaskObserver.java @@ -0,0 +1,20 @@ +package com.webank.wedatasphere.exchangis.job.server.execution.subscriber; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskObserverException; + +import java.util.List; + +public class UpdateInTaskObserver extends AbstractTaskObserver { + + @Override + protected List onPublish(int batchSize) throws ExchangisTaskObserverException { + return null; + } + + + @Override + public void subscribe(List publishedTasks) throws ExchangisTaskObserverException { + + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/log/JobServerLogging.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/log/JobServerLogging.java new file mode 100644 index 000000000..2b4e11dba --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/log/JobServerLogging.java @@ -0,0 +1,89 @@ +package com.webank.wedatasphere.exchangis.job.server.log; + +import com.webank.wedatasphere.exchangis.job.listener.JobLogListener; +import com.webank.wedatasphere.exchangis.job.listener.events.JobLogEvent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Objects; +import java.util.Optional; + +public interface JobServerLogging { + default Logger getLogger(){ + return LoggerFactory.getLogger(this.getClass()); + } + + default void trace(T entity, String message, Object... args) { + Logger logger = getLogger(); + if (Objects.nonNull(logger) && logger.isTraceEnabled()){ + logger.trace(message, args); + } + Optional.ofNullable(getJobLogListener()).ifPresent(listener -> + listener.onAsyncEvent(getJobLogEvent(JobLogEvent.Level.INFO, entity, message, args))); + } + + default void debug(T entity, String message){ + Logger logger = getLogger(); + if (Objects.nonNull(logger) && logger.isDebugEnabled()){ + logger.debug(message); + } + } + + default void info(T entity, String message, Object... args){ + Logger logger = getLogger(); + if (Objects.nonNull(logger) && logger.isInfoEnabled()){ + logger.info(message, args); + } + Optional.ofNullable(getJobLogListener()).ifPresent(listener -> + listener.onAsyncEvent(getJobLogEvent(JobLogEvent.Level.INFO, entity, message, args))); + } + + default void info(T entity, String message, Throwable t){ + Logger logger = getLogger(); + if (Objects.nonNull(logger) && logger.isInfoEnabled()){ + logger.info(message, t); + } + Optional.ofNullable(getJobLogListener()).ifPresent(listener -> + listener.onAsyncEvent(getJobLogEvent(JobLogEvent.Level.INFO, entity, message, t))); + } + + default void warn(T entity, String message, Object... args){ + Logger logger = getLogger(); + if (Objects.nonNull(logger) && logger.isWarnEnabled()){ + logger.warn(message, args); + } + Optional.ofNullable(getJobLogListener()).ifPresent(listener -> + listener.onAsyncEvent(getJobLogEvent(JobLogEvent.Level.WARN, entity, message, args))); + } + + default void warn(T entity, String message, Throwable t){ + Logger logger = getLogger(); + if (Objects.nonNull(logger) && logger.isWarnEnabled()){ + logger.warn(message, t); + } + Optional.ofNullable(getJobLogListener()).ifPresent(listener -> + listener.onAsyncEvent(getJobLogEvent(JobLogEvent.Level.WARN, entity, message, t))); + } + + default void error(T entity, String message, Object... args){ + Optional.ofNullable(getLogger()).ifPresent(logger -> logger.error(message, args)); + Optional.ofNullable(getJobLogListener()).ifPresent(listener -> + listener.onAsyncEvent(getJobLogEvent(JobLogEvent.Level.ERROR, entity, message, args))); + } + + default JobLogListener getJobLogListener() { + return null; + } + + /** + * Job log event + * @param level level + * @param entity entity + * @param message message + * @param args args + * @return + */ + default JobLogEvent getJobLogEvent(JobLogEvent.Level level, T entity, String message, Object... args){ + return new JobLogEvent(level, null, null, message, args); + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/log/appender/RpcJobLogAppender.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/log/appender/RpcJobLogAppender.java new file mode 100644 index 000000000..9073fda75 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/log/appender/RpcJobLogAppender.java @@ -0,0 +1,104 @@ +package com.webank.wedatasphere.exchangis.job.server.log.appender; + +import com.webank.wedatasphere.exchangis.job.server.log.JobLogService; +import com.webank.wedatasphere.exchangis.job.server.utils.SpringContextHolder; +import org.apache.logging.log4j.core.Filter; +import org.apache.logging.log4j.core.Layout; +import org.apache.logging.log4j.core.LogEvent; +import org.apache.logging.log4j.core.appender.AbstractAppender; +import org.apache.logging.log4j.core.config.Property; +import org.apache.logging.log4j.core.config.plugins.Plugin; +import org.apache.logging.log4j.core.config.plugins.PluginAttribute; +import org.apache.logging.log4j.core.config.plugins.PluginElement; +import org.apache.logging.log4j.core.config.plugins.PluginFactory; +import org.apache.logging.log4j.core.layout.PatternLayout; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.Serializable; +import java.util.Collections; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.atomic.AtomicReference; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Custom appender + */ +@Plugin(name = "RpcLog", category = "Core", elementType = "appender", printObject = true) +public class RpcJobLogAppender extends AbstractAppender { + + private static final Logger LOG = LoggerFactory.getLogger(RpcJobLogAppender.class); + + private static final Pattern JOB_LOG_PATTERN = Pattern.compile("^[\\s\\S]+?\\[([\\w\\d-]+):([\\w\\d-]+)]"); + + protected RpcJobLogAppender(String name, Filter filter, Layout layout, boolean ignoreExceptions, Property[] properties) { + super(name, filter, layout, ignoreExceptions, properties); + } + + @Override + public void append(LogEvent logEvent) { + String logContent = new String(getLayout().toByteArray(logEvent)); + + if (Objects.nonNull(JobLogServiceInstance.jobLogService)){ + String[] resolved = resolveJobLogLine(logContent); + if (Objects.nonNull(resolved)){ + JobLogServiceInstance.jobLogService.appendLog(resolved[0], resolved[1], Collections.singletonList(logContent)); + } else { + LOG.error("JobLogService instance is ignored ! missing log => [" + logContent + "]"); + } + } else { + LOG.error("JobLogService instance cannot be found ! missing log => [" + logContent + "]"); + } + } + + /** + * Resolve job log line + * @param line log line + * @return String[0] => tenancy, String[1] => job_execution_id + */ + private String[] resolveJobLogLine(String line){ + Matcher matcher = JOB_LOG_PATTERN.matcher(line); + if (matcher.find()){ + return new String[]{matcher.group(1), matcher.group(2)}; + } + return null; + } + + private static class JobLogServiceInstance{ + static JobLogService jobLogService; + static { + try { + jobLogService = SpringContextHolder.getBean(JobLogService.class); + }catch(Exception e){ + LOG.warn("Cannot get the bean of JobLogService from spring context !", e); + } + } + } + + @PluginFactory + public static RpcJobLogAppender createAppender(@PluginAttribute("name")String name, + @PluginElement("Filter")final Filter filter, + @PluginElement("Layout") Layout layout, + @PluginAttribute("ignoreExceptions")boolean ignoreExceptions){ + AtomicReference jobLogAppender = new AtomicReference<>(); + Optional.ofNullable(name).ifPresent(appenderName -> { + Layout layoutDef = layout; + if (Objects.isNull(layout)){ + layoutDef = PatternLayout.createDefaultLayout(); + } + jobLogAppender.set(new RpcJobLogAppender(name, filter, layoutDef, ignoreExceptions, Property.EMPTY_ARRAY)); + }); + return jobLogAppender.get(); + } + + public static void main(String[] args){ + String testLog = "2022-01-27 19:36:26.028 INFO - [davidhua:68f42422-a4d8-4065-9810-86013d93f153] Init to create launched job and begin generating"; + Matcher matcher = JOB_LOG_PATTERN.matcher(testLog); + if (matcher.find()){ + System.out.println(matcher.group(1)); + System.out.println(matcher.group(2)); + } + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/log/service/LocalSimpleJobLogService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/log/service/LocalSimpleJobLogService.java new file mode 100644 index 000000000..5b4a991dc --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/log/service/LocalSimpleJobLogService.java @@ -0,0 +1,277 @@ +package com.webank.wedatasphere.exchangis.job.server.log.service; + +import com.google.common.cache.*; +import com.webank.wedatasphere.exchangis.job.launcher.entity.LaunchedExchangisJobEntity; +import com.webank.wedatasphere.exchangis.job.log.LogQuery; +import com.webank.wedatasphere.exchangis.job.log.LogResult; +import com.webank.wedatasphere.exchangis.job.server.mapper.LaunchedJobDao; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisJobServerException; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.AbstractExchangisSchedulerTask; +import com.webank.wedatasphere.exchangis.job.server.log.JobLogService; +import com.webank.wedatasphere.exchangis.job.server.log.cache.AbstractJobLogCache; +import com.webank.wedatasphere.exchangis.job.server.log.cache.JobLogCache; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.common.conf.CommonVars; +import org.apache.linkis.common.utils.Utils; +import org.apache.linkis.scheduler.Scheduler; +import org.apache.linkis.scheduler.queue.JobInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.annotation.Resource; +import java.io.File; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.*; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode.LOG_OP_ERROR; + +/** + * Just store the log into the local + */ +public class LocalSimpleJobLogService implements JobLogService { + + private static final Logger LOG = LoggerFactory.getLogger(LocalSimpleJobLogService.class); + + private Cache> cacheHolder; + + private AbstractExchangisSchedulerTask cleaner; + + private volatile boolean cleanerOn; + + private static class Constraints{ + public static final CommonVars LOG_LOCAL_PATH = CommonVars.apply("wds.exchangis.job.log.local.path", "/data/bdp/dss/exchangis/main/logs"); + + public static final CommonVars lOG_CACHE_SIZE = CommonVars.apply("wds.exchangis.job.log.cache.size", 15); + + public static final CommonVars LOG_CACHE_EXPIRE_TIME_IN_SECONDS = CommonVars.apply("wds.exchangis.job.log.cache.expire.time-in-seconds", 5); + + public static final CommonVars LOG_MULTILINE_PATTERN = CommonVars.apply("wds.exchangis.log.multiline.pattern", "^\\d{4}-\\d{2}-\\d{2}\\s+\\d{2}:\\d{2}:\\d{2}\\.\\d{3}"); + } + + @Resource + private Scheduler scheduler; + + @Resource + private LaunchedJobDao launchedJobDao; + @PostConstruct + public void init(){ + cleanerOn = true; + cacheHolder = CacheBuilder.newBuilder().maximumSize(Constraints.lOG_CACHE_SIZE.getValue()) + .expireAfterAccess(Constraints.LOG_CACHE_EXPIRE_TIME_IN_SECONDS.getValue(), TimeUnit.SECONDS) + .removalListener((RemovalListener>) removalNotification -> { + // Flush for expired + if (removalNotification.getCause() == RemovalCause.EXPIRED){ + removalNotification.getValue().flushCache(true); + } + }) + .build(); + cleaner = new AbstractExchangisSchedulerTask("Job-Log-Cache-Cleaner") { + @Override + public String getTenancy() { + return "log"; + } + + @Override + public String getName() { + return getId(); + } + + @Override + public JobInfo getJobInfo() { + return null; + } + + @Override + protected void schedule() { + while(cleanerOn){ + try { + Thread.sleep(Constraints.LOG_CACHE_EXPIRE_TIME_IN_SECONDS.getValue()); + //Just invoke the auto cleaner + cacheHolder.get("log", () -> null); + } catch (Exception e){ + //Ignore + } + } + } + }; + scheduler.submit(cleaner); + } + + @PreDestroy + public void destroy(){ + this.cleanerOn = false; + if (Objects.nonNull(this.cleaner.future())){ + this.cleaner.future().cancel(true); + } + } + + @Override + public LogResult logsFromPage( String jobExecId, LogQuery logQuery) { + LaunchedExchangisJobEntity launchedExchangisJob = launchedJobDao.searchLogPathInfo(jobExecId); + return logsFromPageAndPath(launchedExchangisJob.getLogPath(), logQuery); + } + + @Override + public LogResult logsFromPageAndPath(String logPath, LogQuery logQuery) { + String fullPath = Constraints.LOG_LOCAL_PATH.getValue() + IOUtils.DIR_SEPARATOR_UNIX + logPath; + LogResult result = new LogResult(0, false, Collections.emptyList()); + if (!new File(fullPath).exists()){ + return result; + } + if (logQuery.getLastRows() != null && logQuery.getLastRows() > 0){ + return getLastRows(fullPath, logQuery.getLastRows()); + } + RandomAccessFile logReader = null; + try { + logReader = new RandomAccessFile(fullPath, "rw"); + String patternValue = Constraints.LOG_MULTILINE_PATTERN.getValue(); + Pattern linePattern = StringUtils.isNotBlank(patternValue)? Pattern.compile(patternValue) : null; + int readLine = 0; + int lineNum = 0; + int skippedLine = 0; + int ignoreLine = 0; + int pageSize = logQuery.getPageSize(); + int fromLine = logQuery.getFromLine(); + List ignoreKeywords = logQuery.getIgnoreKeywordsList(); + List onlyKeywords = logQuery.getOnlyKeywordsList(); + boolean rowIgnore = false; + String line = logReader.readLine(); + List logs = new ArrayList<>(); + while (readLine < pageSize && line != null){ + lineNum += 1; + if (skippedLine < fromLine - 1){ + skippedLine += 1; + } else { + if (rowIgnore) { + if (Objects.nonNull(linePattern)){ + Matcher matcher = linePattern.matcher(line); + if (matcher.find()){ + ignoreLine = 0; + rowIgnore = !isIncludeLine(line, onlyKeywords, ignoreKeywords); + } else { + ignoreLine += 1; + // TODO limit the value of ignoreLine + } + }else{ + rowIgnore = !isIncludeLine(line, onlyKeywords, ignoreKeywords); + } + }else { + rowIgnore = !isIncludeLine(line, onlyKeywords, ignoreKeywords); + } + if (!rowIgnore) { + logs.add(new String(line.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8)); + readLine += 1; + } + } + line = logReader.readLine(); + } + result = new LogResult(lineNum, false, logs); + } catch (IOException e) { + throw new ExchangisJobServerException.Runtime(LOG_OP_ERROR.getCode(),"Unable to query the logs from path: [" + logPath + "]", e); + } finally { + if (Objects.nonNull(logReader)) { + try { + logReader.close(); + } catch (IOException e) { + //Ignore + } + } + } + return result; + } + + @Override + public void appendLog(String tenancy, String jobExecId, List logs) { + appendLog(jobExecId, logs); + } + + @Override + public void appendLog(String jobExecId, List logs) { + JobLogCache cache = getOrCreateLogCache(jobExecId); + logs.forEach(cache ::cacheLog); + } + + + private boolean isIncludeLine(String line, List onlyKeywordList, List ignoreKeywordList){ + boolean accept = ignoreKeywordList.isEmpty() || ignoreKeywordList.stream().noneMatch(line::contains); + if (accept){ + accept = onlyKeywordList.isEmpty() || onlyKeywordList.stream().anyMatch(line::contains); + } + return accept; + } + + /** + * Get last rows + * @param fullPath full path + * @param lastRows last rows + * @return + */ + private LogResult getLastRows(String fullPath, int lastRows){ + try { + List logs = Arrays.asList(Utils.exec(new String[]{"tail", "-n", lastRows + "", fullPath}, 5000L).split("\n")); + return new LogResult(0, true, logs); + }catch (Exception e){ + throw new ExchangisJobServerException.Runtime(LOG_OP_ERROR.getCode(), "Fail to get last rows from path: [" + fullPath + "]", e); + } + } + @Override + public JobLogCache getOrCreateLogCache(String jobExecId){ + try { + return cacheHolder.get(jobExecId, () -> { + LaunchedExchangisJobEntity launchedExchangisJob = launchedJobDao.searchLogPathInfo(jobExecId); + if (Objects.nonNull(launchedExchangisJob)) { + File logFile = new File(Constraints.LOG_LOCAL_PATH.getValue() + IOUtils.DIR_SEPARATOR_UNIX + + launchedExchangisJob.getLogPath()); + if (!logFile.exists()){ + // Write empty string to create new file + FileUtils.writeStringToFile(logFile, ""); + LOG.info("Create the new job log file: {}", logFile.getAbsolutePath()); + } + RandomAccessFile file = new RandomAccessFile(logFile, "rw"); + // Seek to the end of file + file.seek(file.length()); + return new AbstractJobLogCache(scheduler, 100, 2000) { + @Override + public synchronized void flushCache(boolean isEnd) { + // Store into local path + if (!cacheQueue().isEmpty()) { + try { + List logLines = new ArrayList<>(); + cacheQueue().drainTo(logLines); + for (Object line : logLines) { + file.write(String.valueOf(line).getBytes(Charset.defaultCharset())); + } + } catch (IOException ex) { + LOG.error("Fail to flush the log cache of [" + launchedExchangisJob.getJobExecutionId() + "]", ex); + } + } + if (isEnd) { + cacheHolder.invalidate(jobExecId); + try { + file.close(); + } catch (IOException e) { + //Ignore + } + } + } + }; + } + return null; + }); + } catch (ExecutionException e) { + throw new ExchangisJobServerException.Runtime(LOG_OP_ERROR.getCode(),"Fail to create the job log cache of [" + jobExecId +"]", e); + } + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/ExchangisJobEntityDao.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/ExchangisJobEntityDao.java new file mode 100644 index 000000000..2368096cc --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/ExchangisJobEntityDao.java @@ -0,0 +1,73 @@ +package com.webank.wedatasphere.exchangis.job.server.mapper; + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobEntity; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobQueryVo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * + */ + +public interface ExchangisJobEntityDao { + + /** + * Add new JobEntity + * @param exchangisJobEntity job entity + */ + void addJobEntity(ExchangisJobEntity exchangisJobEntity); + + /** + * Delete jobEntity + * @param jobId job id + */ + void deleteJobEntity(@Param("jobId") Long jobId); + + /** + * upgrade jobEntity basic info + * @param jobEntity job entity + */ + void upgradeBasicInfo(ExchangisJobEntity jobEntity); + + /** + * Upgrade config + * @param jobEntity job entity + */ + void upgradeConfig(ExchangisJobEntity jobEntity); + + /** + * Upgrade content + * @param jobEntity job entity + */ + void upgradeContent(ExchangisJobEntity jobEntity); + /** + * Get jobEntity + * @param jobId job id + */ + ExchangisJobEntity getDetail(@Param("jobId") Long jobId); + + /** + * Get jobEntity list + * @param projectId + * @return + */ + List getDetailList(@Param("projectId") Long projectId); + + ExchangisJobEntity getBasicInfo(@Param("jobId") Long jobId); + + /** + * Query page list + * @param queryVo query vo + * @return list + */ + List queryPageList(ExchangisJobQueryVo queryVo); + + /** + * Delete batch + * @param ids id list + */ + void deleteBatch(@Param("ids") List ids); + + List getByNameWithProjectId(@Param("jobName") String jobName, @Param("projectId") Long projectId); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/ExchangisLaunchTaskMapper.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/ExchangisLaunchTaskMapper.java new file mode 100644 index 000000000..ed0e39666 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/ExchangisLaunchTaskMapper.java @@ -0,0 +1,31 @@ +package com.webank.wedatasphere.exchangis.job.server.mapper; + +import java.util.Date; +import java.util.List; + +import com.webank.wedatasphere.exchangis.job.server.dto.ExchangisTaskStatusMetricsDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.webank.wedatasphere.exchangis.job.launcher.entity.ExchangisLaunchTask; + +/** + * The interface Exchangis launch task mapper. + * + * @author yuxin.yuan + * @since 2021-09-08 + */ +@Mapper +public interface ExchangisLaunchTaskMapper extends BaseMapper { + + List listTasks(@Param("taskId") Long taskId, @Param("taskName") String taskName, + @Param("status") String status, @Param("launchStartTime") Date launchStartTime, + @Param("launchEndTime") Date launchEndTime, @Param("start") int start, @Param("size") int size); + + int count(@Param("taskId") Long taskId, @Param("taskName") String taskName, @Param("status") String status, + @Param("launchStartTime") Date launchStartTime, @Param("launchEndTime") Date launchEndTime); + + ExchangisTaskStatusMetricsDTO getTaskMetricsByStatus(String status); + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/LaunchableTaskDao.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/LaunchableTaskDao.java new file mode 100644 index 000000000..4002a6e41 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/LaunchableTaskDao.java @@ -0,0 +1,44 @@ +package com.webank.wedatasphere.exchangis.job.server.mapper; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * + * @Date 2022/1/17 21:58 + */ +public interface LaunchableTaskDao { + + /** + * Add new launchableTask + * @param tasks + */ + void addLaunchableTask(@Param("tasks")List tasks); + + /** + * Delete launchableTask + * @param taskId + */ + void deleteLaunchableTask(@Param("taskId") String taskId); + + /** + * upgradeLaunchableTask + * @param launchableExchangisTask + */ + void upgradeLaunchableTask(LaunchableExchangisTask launchableExchangisTask); + + /** + * Get launchableTask + * @param taskId + */ + LaunchableExchangisTask getLaunchableTask(@Param("taskId") String taskId); + + /** + * Get Tasks need to execute + * @param + */ + + List getTaskToLaunch(@Param("limitSize") Integer limitSize); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/LaunchedJobDao.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/LaunchedJobDao.java new file mode 100644 index 000000000..53baaef33 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/LaunchedJobDao.java @@ -0,0 +1,97 @@ +package com.webank.wedatasphere.exchangis.job.server.mapper; + +import com.webank.wedatasphere.exchangis.job.launcher.entity.LaunchedExchangisJobEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; + +import java.util.List; + +/** + * + */ +public interface LaunchedJobDao { + /** + * insert launchedJob + * @param launchedExchangisJobEntity entity + */ + + void insertLaunchedJob(LaunchedExchangisJobEntity launchedExchangisJobEntity); + + /** + * delete launchedJob + * @param jobExecutionId execution id + */ + + void deleteLaunchedJob(@Param("jobExecutionId")String jobExecutionId); + + /** + * upgrade launchedJob + * @param launchedExchangisJobEntity entity + */ + void upgradeLaunchedJob(LaunchedExchangisJobEntity launchedExchangisJobEntity); + + /** + * Update launch info + * @param launchedExchangisJobEntity entity + */ + void updateLaunchInfo(LaunchedExchangisJobEntity launchedExchangisJobEntity); + /** + * search launchJob + * @param jobExecutionId execution id + * @return entity + */ + LaunchedExchangisJobEntity searchLaunchedJob(@Param("jobExecutionId")String jobExecutionId); + + /** + * Search log path and status info + * @param jobExecutionId execution id + * @return + */ + LaunchedExchangisJobEntity searchLogPathInfo(@Param("jobExecutionId")String jobExecutionId); + /** + * upgrade launchedJob status + * @param jobExecutionId execution id + * @param status status + */ + + void upgradeLaunchedJobStatus(@Param("jobExecutionId")String jobExecutionId, @Param("status") String status, @Param("updateTime")Date updateTime); + + /** + * Try to upgrade launchedJob status in version control + * @param jobExecutionId execution id + * @param status update status + * @param launchableTaskNum expected launchable task number + * @param updateTime updateTime + */ + int upgradeLaunchedJobStatusInVersion(@Param("jobExecutionId")String jobExecutionId, @Param("status") String status, + @Param("launchableTaskNum") Integer launchableTaskNum, + @Param("updateTime")Date updateTime); + + /** + * To upgrade launchedJob progress + * @param jobExecutionId execution id + * @param totalTaskProgress progress of total related task + * @param updateTime updateTime + */ + int upgradeLaunchedJobProgress(@Param("jobExecutionId")String jobExecutionId, @Param("totalTaskProgress") Float totalTaskProgress, + @Param("updateTime")Date updateTime); + + /** + * get All launchJob + * @return job entity list + */ + List getAllLaunchedJob(@Param("jobExecutionId") String jobExecutionId, @Param("jobName") String jobName, @Param("status") String status, @Param("launchStartTime") Date launchStartTime, @Param("launchEndTime") Date launchEndTime, @Param("start")int start, @Param("size") int size, @Param("loginUser") String loginUser); + + /** + * get launchJob count + * return job entity number + */ + int count(@Param("jobExecutionId") String jobExecutionId, @Param("jobName") String jobName, @Param("status") String status, @Param("launchStartTime") Date launchStartTime, @Param("launchEndTime") Date launchEndTime, @Param("loginUser") String loginUser); + + /** + * delete launchJob + */ + void deleteJob(@Param("jobExecutionId")String jobExecutionId); + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/LaunchedTaskDao.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/LaunchedTaskDao.java new file mode 100644 index 000000000..b78acee21 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/LaunchedTaskDao.java @@ -0,0 +1,136 @@ +package com.webank.wedatasphere.exchangis.job.server.mapper; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.entity.LaunchedExchangisJobEntity; +import com.webank.wedatasphere.exchangis.job.launcher.entity.LaunchedExchangisTaskEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.jmx.export.annotation.ManagedOperationParameter; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * + */ +public interface LaunchedTaskDao { + + /** + * judge task whether launch(insert) or update + * @param launchedExchangisTaskEntity taskEntity + * @return insert/update result (1:insert 2:update) + */ + int insertLaunchedTaskOrUpdate(LaunchedExchangisTaskEntity launchedExchangisTaskEntity); + + /** + * insert launchedTask + * @param launchedExchangisTaskEntity + */ + void insertLaunchedTask(LaunchedExchangisTaskEntity launchedExchangisTaskEntity); + + /** + * delete launchedTask + * @param taskId + */ + void deleteLaunchedTask(@Param("taskId")String taskId); + + /** + * upgrade launchedTask + * @param launchedExchangisTaskEntity + */ + void upgradeLaunchedTask(LaunchedExchangisTaskEntity launchedExchangisTaskEntity); + + /** + * search launchedTask + * @param taskId + */ + + LaunchedExchangisTaskEntity getLaunchedTaskEntity(@Param("taskId") String taskId); + + /** + * upgrade launchedTask metrics + * @param metrics + * @param taskId + */ + + void upgradeLaunchedTaskMetrics(@Param("taskId") String taskId, @Param("metrics") String metrics, @Param("updateTime")Date updateTime); + + /** + * upgrade launchedTask status + * @param status + * @param taskId + */ + + void upgradeLaunchedTaskStatus(@Param("taskId") String taskId, @Param("status") String status, @Param("updateTime")Date updateTime); + + /** + * upgrade launchedTask progress + * @param taskId + * @param progress + * @param updateTime + */ + void upgradeLaunchedTaskProgress(@Param("taskId") String taskId, @Param("progress") Float progress, @Param("updateTime")Date updateTime); + + + /** + * Sum the progress value + * @param jobExecutionId job execution id + * @return sum result + */ + float sumProgressByJobExecutionId(@Param("jobExecutionId") String jobExecutionId); + /** + * Update the launch information + * @param launchedExchangisTaskEntity entity + */ + void updateLaunchInfo(LaunchedExchangisTaskEntity launchedExchangisTaskEntity); + + /** + * search launchedTaskList + * @param jobExecutionId + */ + + List selectTaskListByJobExecutionId(@Param("jobExecutionId") String jobExecutionId); + + /** + * Select status list + * @param jobExecutionId job execution id + * @return + */ + List selectTaskStatusByJobExecutionId(@Param("jobExecutionId")String jobExecutionId); + /** + * search getTaskMetrics + * @param jobExecutionId + */ + + List getTaskMetricsByJobExecutionId(@Param("jobExecutionId") String jobExecutionId); + + /** + * search launchedTaskList by taskId and jobExecutionId + * @param jobExecutionId + */ + + LaunchedExchangisTaskEntity getLaunchedTaskMetrics(@Param("jobExecutionId") String jobExecutionId, @Param("taskId") String taskId); + + /** + * Get launched task status + * @param taskId + * @return + */ + String getLaunchedTaskStatus(@Param("taskId") String taskId); + + /** + * search TaskStatusList + * @param + */ + + List getTaskStatusList(@Param("jobExecutionId") String jobExecutionId); + + /** + * delete task + * @param + */ + + void deleteTask(@Param("jobExecutionId") String jobExecutionId); + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/impl/ExchangisJobEntityMapper.xml b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/impl/ExchangisJobEntityMapper.xml new file mode 100644 index 000000000..db6f4afbd --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/impl/ExchangisJobEntityMapper.xml @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + + + + + + + + + + + exchangis_job_entity + + + + id, + name, create_time, last_update_time, engine_type, job_labels, create_user, job_content, execute_user, + job_params, job_desc, job_type, project_id, source, modify_user + + + + id, + name, create_time, last_update_time, engine_type, job_labels, create_user, execute_user, + job_params, job_desc, job_type, project_id, source, modify_user + + + + insert into + + (name, create_time, last_update_time, engine_type, job_labels, create_user, job_content, execute_user, job_params, + job_desc, job_type, project_id, source, modify_user) + values( + #{name}, + #{createTime}, + #{lastUpdateTime}, + #{engineType}, + #{jobLabel}, + #{createUser}, + #{jobContent}, + #{executeUser}, + #{jobParams}, + #{jobDesc}, + #{jobType}, + #{projectId}, + #{source}, + #{modifyUser} + ); + + + + DELETE FROM WHERE + id = #{jobId} + + + + UPDATE + SET + name = #{name}, + last_update_time = #{lastUpdateTime}, + engine_type = #{engineType}, + job_labels = #{jobLabel}, + job_type = #{jobType}, + job_desc = #{jobDesc}, + modify_user = #{modifyUser} + WHERE id = #{id} + + + + UPDATE + SET + execute_user = #{executeUser}, + job_params = #{jobParams}, + source = #{source}, + last_update_time = #{lastUpdateTime}, + modify_user = #{modifyUser} + WHERE id = #{id} + + + + UPDATE + SET + job_content = #{jobContent}, + last_update_time = #{lastUpdateTime}, + modify_user = #{modifyUser} + WHERE id = #{id} + + + + + + + + + + + + + + + + + + + + DELETE FROM + + WHERE id in + + #{item} + + + diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/impl/ExchangisLaunchTaskMapper.xml b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/impl/ExchangisLaunchTaskMapper.xml new file mode 100644 index 000000000..05e00f30c --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/impl/ExchangisLaunchTaskMapper.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + exchangis_launch_task + + + + + id,task_name, job_id, job_name, content, execute_node, create_time, create_user, launch_time, proxy_user, params_json, status, complete_time, engine_type + + + + + + + + + + + diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/impl/LaunchableTaskMapper.xml b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/impl/LaunchableTaskMapper.xml new file mode 100644 index 000000000..684bdab1c --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/impl/LaunchableTaskMapper.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + exchangis_launchable_task + + + + + id, name, create_time, last_update_time, engine_type, execute_user, linkis_job_name, linkis_job_content, linkis_params, linkis_source, labels + + + + insert into + + (id, name, job_execution_id, create_time, last_update_time, engine_type, execute_user, linkis_job_name, linkis_job_content, linkis_params, linkis_source, labels) + values( + #{task.id}, + #{task.name}, + #{task.jobExecutionId}, + #{task.createTime}, + #{task.lastUpdateTime}, + #{task.engineType}, + #{task.executeUser}, + #{task.linkisJobName}, + #{task.linkisJobContent}, + #{task.linkisParams}, + #{task.linkisSource}, + #{task.labels} + ); + + + + + delete * from + + where id = #{taskId} + + + + UPDATE + SET + id = #{id}, + name = #{name}, + create_time = #{createTime}, + last_update_time = #{lastUpdateTime}, + engine_type = #{engineType}, + execute_user = #{execute_user}, + linkis_job_name = #{linkisJobName}, + linkis_job_content = #{linkisJobContent}, + linkis_params = #{linkisParams}, + linkis_source = #{linkisSource}, + labels = #{labels} + + + + + + + + \ No newline at end of file diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/impl/LaunchedJobMapper.xml b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/impl/LaunchedJobMapper.xml new file mode 100644 index 000000000..df0e29ef3 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/impl/LaunchedJobMapper.xml @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + exchangis_launched_job_entity + + + + + id, name, create_time, last_update_time, job_id, job_execution_id, engine_type, execute_user, job_name, status, progress, error_code, error_msg, retry_num, log_path, create_user + + + insert into + + (name, create_time, last_update_time, job_id, launchable_task_num, job_execution_id, engine_type, execute_user, create_user, job_name, status, progress, error_code, error_msg, retry_num, log_path) + values( + #{name}, + #{createTime}, + #{lastUpdateTime}, + #{jobId}, + #{launchableTaskNum}, + #{jobExecutionId}, + #{engineType}, + #{executeUser}, + #{createUser}, + #{jobName}, + #{status}, + #{progress}, + #{errorCode}, + #{errorMessage}, + #{retryNum}, + #{logPath} + ); + + + + DELETE FROM WHERE + job_execution_id = #{jobExecutionId} + + + + UPDATE + SET + name = #{name}, + create_time = #{createTime}, + last_update_time = #{lastUpdateTime}, + job_id = #{jobId}, + launchable_task_num = #{launchableTaskNum}, + job_execution_id = #{jobExecutionId}, + engine_type = #{engineType}, + execute_user = #{execute_user}, + job_name = #{jobName}, + status = #{status}, + progress = #{progress}, + error_code = #{errorCode}, + error_msg = #{errorMessage}, + retry_num = #{retryNum}, + log_path = #{logPath} + where id = #{id} + + + UPDATE + SET + last_update_time = #{lastUpdateTime}, + launchable_task_num = #{launchableTaskNum}, + status = #{status} + WHERE job_execution_id = #{jobExecutionId} + + + + + + + UPDATE + SET + status = #{status}, + last_update_time = #{updateTime} + WHERE + job_execution_id = #{jobExecutionId} + + + + + + + + + AND job_execution_id = #{jobExecutionId} + + + AND #{updateTime} >= last_update_time + + + AND launchable_task_num = #{launchableTaskNum}; + + + + + + + + + + + + + + + DELETE FROM WHERE + job_execution_id = #{jobExecutionId} + + + diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/impl/LaunchedTaskMapper.xml b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/impl/LaunchedTaskMapper.xml new file mode 100644 index 000000000..fa50df759 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/mapper/impl/LaunchedTaskMapper.xml @@ -0,0 +1,226 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + exchangis_launched_task_entity + + + + + id, name, create_time, last_update_time, job_id, engine_type, execute_user, job_name, progress, error_code, error_msg, retry_num, task_id, linkis_job_id, linkis_job_info, job_execution_id, launch_time, running_time, metrics, status + + + insert into + + (id, name, create_time, last_update_time, job_id, engine_type, execute_user, job_name, progress, error_code, error_msg, retry_num, task_id, linkis_job_id, linkis_job_info, job_execution_id, launch_time, running_time, metrics, status) + values( + #{id}, + #{name}, + #{createTime}, + #{lastUpdateTime}, + #{jobId}, + #{engineType}, + #{executeUser}, + #{jobName}, + #{progress}, + #{errorCode}, + #{errorMessage}, + #{retryNum}, + #{taskId}, + #{linkisJobId}, + #{linkisJobInfo}, + #{jobExecutionId}, + #{launchTime}, + #{runningTime}, + #{metrics}, + #{status} + ) ON DUPLICATE KEY UPDATE + name = #{name}; + + + + insert into + + (id, name, create_time, last_update_time, job_id, engine_type, execute_user, job_name, progress, error_code, error_msg, retry_num, task_id, linkis_job_id, linkis_job_info, job_execution_id, launch_time, running_time, metrics, status) + values( + #{id}, + #{name}, + #{createTime}, + #{lastUpdateTime}, + #{jobId}, + #{engineType}, + #{executeUser}, + #{jobName}, + #{progress}, + #{errorCode}, + #{errorMessage}, + #{retryNum}, + #{taskId}, + #{linkisJobId}, + #{linkisJobInfo}, + #{jobExecutionId}, + #{launchTime}, + #{runningTime}, + #{metrics}, + #{status} + ); + + + + DELETE FROM WHERE + task_id = #{taskId} + + + + UPDATE + SET + id = #{id}, + name = #{name}, + create_time = #{createTime}, + last_update_time = #{lastUpdateTime}, + job_id = #{jobId}, + engine_type = #{engineType}, + execute_user = #{executeUser}, + job_name = #{jobName}, + progress = #{progress}, + error_code = #{errorCode}, + error_msg = #{errorMessage}, + retry_num = #{retryNum}, + task_id = #{taskId}, + linkis_job_id = #{linkisJobId}, + linkis_job_info = #{linkisJobInfo}, + job_execution_id = #{jobExecutionId}, + launch_time = #{launchTime}, + running_time = #{runningTime}, + metrics = #{metrics}, + status = #{status} + + + + UPDATE + SET + linkis_job_id = #{linkisJobId}, + linkis_job_info = #{linkisJobInfo}, + last_update_time = #{lastUpdateTime}, + error_code = #{errorCode}, + error_msg = #{errorMessage}, + retry_num = #{retryNum}, + launch_time = #{launchTime}, + running_time = #{runningTime}, + status = #{status} + WHERE + task_id = #{taskId} + + + + + UPDATE + SET + metrics = #{metrics}, + last_update_time = #{updateTime} + WHERE + task_id = #{taskId} + + + + UPDATE + SET + status = #{status}, + last_update_time = #{updateTime} + WHERE + task_id= #{taskId} + + + + UPDATE + SET + progress = #{progress}, + last_update_time = #{updateTime} + WHERE + task_id = #{taskId} + + + + + + + + + + + + + + + + + DELETE FROM WHERE + job_execution_id = #{jobExecutionId} + + diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/ExchangisMetricConverterFactory.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/ExchangisMetricConverterFactory.java new file mode 100644 index 000000000..e1d55d6fd --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/ExchangisMetricConverterFactory.java @@ -0,0 +1,41 @@ +package com.webank.wedatasphere.exchangis.job.server.metrics; + +import com.webank.wedatasphere.exchangis.job.enums.EngineTypeEnum; +import com.webank.wedatasphere.exchangis.job.server.metrics.converter.MetricsConverter; +import com.webank.wedatasphere.exchangis.job.server.metrics.converter.RegisterMetricConverterFactory; +import com.webank.wedatasphere.exchangis.job.server.metrics.converter.SqoopMetricConverter; +import org.apache.commons.lang.StringUtils; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Default metric converters factory + */ +@Component +public class ExchangisMetricConverterFactory implements RegisterMetricConverterFactory { + + private Map> registers = new ConcurrentHashMap<>(); + + @PostConstruct + public void init(){ + register(EngineTypeEnum.SQOOP.name(), new SqoopMetricConverter()); +// register(EngineTypeEnum.DATAX.name(), null); + } + @Override + public void register(String engineType, MetricsConverter converter) { + if (StringUtils.isNotBlank(engineType)) { + registers.put(engineType.toLowerCase(), converter); + } + } + + @Override + public MetricsConverter getOrCreateMetricsConverter(String engineType) { + return registers.getOrDefault(StringUtils.isNotBlank(engineType)? engineType.toLowerCase() : "null", metricMap -> { + // Return the empty vo + return new ExchangisMetricsVo(); + }); + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/ExchangisMetricsVo.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/ExchangisMetricsVo.java new file mode 100644 index 000000000..1169a1d44 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/ExchangisMetricsVo.java @@ -0,0 +1,170 @@ +package com.webank.wedatasphere.exchangis.job.server.metrics; + + +/** + */ +public class ExchangisMetricsVo implements MetricsVo{ + + /** + * Resource used + */ + private ResourceUsed resourceUsed; + + /** + * Traffic + */ + private Traffic traffic; + + /** + * Indicator + */ + private Indicator indicator; + + public ExchangisMetricsVo(){ + + } + + public ExchangisMetricsVo(ResourceUsed resourceUsed, Traffic traffic, Indicator indicator) { + this.resourceUsed = resourceUsed; + this.traffic = traffic; + this.indicator = indicator; + } + + public ResourceUsed getResourceUsed() { + return resourceUsed; + } + + public void setResourceUsed(ResourceUsed resourceUsed) { + this.resourceUsed = resourceUsed; + } + + public Traffic getTraffic() { + return traffic; + } + + public void setTraffic(Traffic traffic) { + this.traffic = traffic; + } + + public Indicator getIndicator() { + return indicator; + } + + public void setIndicator(Indicator indicator) { + this.indicator = indicator; + } + + public static class ResourceUsed { + private double cpu = 0.0; + + private long memory = 0; + + public ResourceUsed(double cpu, long memory){ + this.cpu = cpu; + this.memory = memory; + } + + public ResourceUsed(){ + + } + + public double getCpu() { + return cpu; + } + + public void setCpu(double cpu) { + this.cpu = cpu; + } + + public long getMemory() { + return memory; + } + + public void setMemory(long memory) { + this.memory = memory; + } + } + + public static class Traffic{ + private String source = "source"; + + private String sink = "sink"; + + private double flow; + + public Traffic(String source, String sink, double flow){ + this.source = source; + this.sink = sink; + this.flow = flow; + } + + public Traffic(){ + + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public String getSink() { + return sink; + } + + public void setSink(String sink) { + this.sink = sink; + } + + public double getFlow() { + return flow; + } + + public void setFlow(double flow) { + this.flow = flow; + } + } + + public static class Indicator{ + private long exchangedRecords = 0; + + private long errorRecords = 0; + + private long ignoredRecords = 0; + + public Indicator(long exchangedRecords, long errorRecords, long ignoredRecords){ + this.exchangedRecords = exchangedRecords; + this.errorRecords = errorRecords; + this.ignoredRecords = ignoredRecords; + } + + public Indicator(){ + + } + public long getExchangedRecords() { + return exchangedRecords; + } + + public void setExchangedRecords(Long exchangedRecords) { + this.exchangedRecords = exchangedRecords; + } + + public long getErrorRecords() { + return errorRecords; + } + + public void setErrorRecords(Long errorRecords) { + this.errorRecords = errorRecords; + } + + public long getIgnoredRecords() { + return ignoredRecords; + } + + public void setIgnoredRecords(Long ignoredRecords) { + this.ignoredRecords = ignoredRecords; + } + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/MetricConverterDemo.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/MetricConverterDemo.java new file mode 100644 index 000000000..01d2eb864 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/MetricConverterDemo.java @@ -0,0 +1,67 @@ +/* +package com.webank.wedatasphere.exchangis.job.server.metrics; + +import com.webank.wedatasphere.exchangis.job.launcher.entity.LaunchedExchangisJobEntity; +import com.webank.wedatasphere.exchangis.job.launcher.entity.LaunchedExchangisTaskEntity; +import com.webank.wedatasphere.exchangis.job.server.metrics.converter.MetricConverterFactory; +import com.webank.wedatasphere.exchangis.job.server.metrics.converter.MetricsConverter; + +import java.util.HashMap; +import java.util.Map; + +*/ +/** + * + * @Date 2022/1/10 20:56 + *//* + +public class MetricConverterDemo { + private static MetricConverterFactory factory = new MetricConverterFactory() { + @Override + public MetricsConverter getOrCreateMetricsConverter(Class metricsVoClass, String engineType) { + return null; + } + }; + + public static void main(String[] args){ + + Map metricsMap = new HashMap<>(); + LaunchedTaskMetricVo launchedTaskMetricVo = factory.getOrCreateMetricsConverter(LaunchedTaskMetricVo.class, "sqoop").convert(metricsMap); + + } + + public static class LaunchedExchangisTaskVo { + public LaunchedExchangisTaskVo(LaunchedExchangisTaskEntity taskEntity){ + + } + } + + public static class LaunchedExchangisTaskProgressVo extends LaunchedExchangisTaskVo { + + public LaunchedExchangisTaskProgressVo(LaunchedExchangisTaskEntity taskEntity) { + super(taskEntity); + } + } + + public static class LaunchedExchangisTaskMetricsVo extends LaunchedExchangisTaskVo { + private LaunchedTaskMetricVo metrics; + private LaunchedTaskRescouceMetricVo resourceMetrics; + private LaunchedTaskTrafficeMetricVo trafficMetrics; + private LaunchedTaskIndicatorMetricVo IndicatorMetrics; + + public LaunchedExchangisTaskMetricsVo(LaunchedExchangisTaskEntity taskEntity) { + super(taskEntity); + this.metrics = factory.getOrCreateMetricsConverter(LaunchedTaskMetricVo.class, taskEntity.getEngineType()).convert(taskEntity.getMetricsMap()); + this.resourceMetrics = factory.getOrCreateMetricsConverter(LaunchedresourcTaskMetricVo.class, taskEntity.getEngineType(), taskEntity.getMetricsMap()); + this.trafficMetrics = factory.getOrCreateMetricsConverter(LaunchedtrafficTaskMetricVo.class, taskEntity.getEngineType(), taskEntity.getMetricsMap()); + this.IndicatorMetrics = factory.getOrCreateMetricsConverter(LaunchedIndicatorTaskMetricVo.class, taskEntity.getEngineType(), taskEntity.getMetricsMap()); + + } + } + + public static class LaunchedTaskMetricVo implements MetricsVo{ + + + } +} +*/ diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/MetricsVo.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/MetricsVo.java new file mode 100644 index 000000000..cc3d01f6d --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/MetricsVo.java @@ -0,0 +1,7 @@ +package com.webank.wedatasphere.exchangis.job.server.metrics; + +/** + * Metric Vo + */ +public interface MetricsVo { +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/converter/AbstractMetricConverter.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/converter/AbstractMetricConverter.java new file mode 100644 index 000000000..91f51d15f --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/converter/AbstractMetricConverter.java @@ -0,0 +1,92 @@ +package com.webank.wedatasphere.exchangis.job.server.metrics.converter; + +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisJobServerException; +import com.webank.wedatasphere.exchangis.job.server.metrics.ExchangisMetricsVo; +import com.webank.wedatasphere.exchangis.job.server.utils.JsonEntity; + +import java.util.Map; +import java.util.Objects; + +import static com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode.METRICS_OP_ERROR; + +/** + * Abstract converter + */ +public abstract class AbstractMetricConverter implements MetricsConverter { + /** + * Convert method + * @param metricMap map value + * @return + */ + @Override + public ExchangisMetricsVo convert(Map metricMap) throws ExchangisJobServerException { + ExchangisMetricsVo metricsVo = new ExchangisMetricsVo(); + MetricsParser metricsParser = getParser(); + if (Objects.nonNull(metricsParser) && + Objects.nonNull(metricMap) && !metricMap.isEmpty()){ + JsonEntity metric = JsonEntity.from(metricMap); + try { + // ResourceUsed + JsonEntity resourceUsedEntity = metric.getConfiguration(metricsParser.resourceUsedKey()); + ExchangisMetricsVo.ResourceUsed resourceUsed = Objects.nonNull(resourceUsedEntity) ? + metricsParser.parseResourceUsed(metricsParser.resourceUsedKey(), resourceUsedEntity) : null; + metricsVo.setResourceUsed(Objects.nonNull(resourceUsed) ? resourceUsed : new ExchangisMetricsVo.ResourceUsed()); + } catch (Exception e){ + throw new ExchangisJobServerException(METRICS_OP_ERROR.getCode(), "Exception in parsing \"resourceUsed\" info", e); + } + try { + // Traffic + JsonEntity trafficEntity = metric.getConfiguration(metricsParser.trafficKey()); + ExchangisMetricsVo.Traffic traffic = Objects.nonNull(trafficEntity) ? + metricsParser.parseTraffic(metricsParser.trafficKey(), trafficEntity) : null; + metricsVo.setTraffic(Objects.nonNull(traffic) ? traffic : new ExchangisMetricsVo.Traffic()); + } catch (Exception e){ + throw new ExchangisJobServerException(METRICS_OP_ERROR.getCode(), "Exception in parsing \"traffic\" info", e); + } + try { + // Indicator + JsonEntity indicatorEntity = metric.getConfiguration(metricsParser.indicatorKey()); + ExchangisMetricsVo.Indicator indicator = Objects.nonNull(indicatorEntity) ? + metricsParser.parseIndicator(metricsParser.indicatorKey(), indicatorEntity) : null; + metricsVo.setIndicator(Objects.nonNull(indicator) ? indicator : new ExchangisMetricsVo.Indicator()); + }catch (Exception e){ + throw new ExchangisJobServerException(METRICS_OP_ERROR.getCode(), "Exception in parsing \"indicator\" info", e); + } + } + return metricsVo; + } + + /** + * Get parser + * @return parser + */ + protected abstract MetricsParser getParser(); + + protected interface MetricsParser{ + /** + * ResourceUsed key + * @return key + */ + default String resourceUsedKey(){ return "-"; }; + + /** + * Traffic key + * @return key + */ + default String trafficKey(){ return "-"; }; + + /** + * Indicator key + * @return key + */ + default String indicatorKey(){ return "-"; }; + + ExchangisMetricsVo.ResourceUsed parseResourceUsed(String key, JsonEntity rawValue); + + ExchangisMetricsVo.Traffic parseTraffic(String key, JsonEntity rawValue); + + ExchangisMetricsVo.Indicator parseIndicator(String key, JsonEntity rawValue); + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/converter/MetricConverterFactory.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/converter/MetricConverterFactory.java new file mode 100644 index 000000000..f1ef689ef --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/converter/MetricConverterFactory.java @@ -0,0 +1,18 @@ +package com.webank.wedatasphere.exchangis.job.server.metrics.converter; + + +import com.webank.wedatasphere.exchangis.job.server.metrics.MetricsVo; + +/** + * Metric ConverterFactory + * Metrics vo + */ +public interface MetricConverterFactory { + + /** + * getConverter + * @param engineType engine type + * @return converter + */ + MetricsConverter getOrCreateMetricsConverter(String engineType); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/converter/MetricsConverter.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/converter/MetricsConverter.java new file mode 100644 index 000000000..85283bae9 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/converter/MetricsConverter.java @@ -0,0 +1,20 @@ +package com.webank.wedatasphere.exchangis.job.server.metrics.converter; + + +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisJobServerException; +import com.webank.wedatasphere.exchangis.job.server.metrics.MetricsVo; + +import java.util.Map; + +/** + * Converter the metricMap to MetricVo + */ +public interface MetricsConverter { + + /** + * Convert method + * @param metricMap map value + * @return T entity extends MetricsVo + */ + T convert(Map metricMap) throws ExchangisJobServerException; +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/converter/RegisterMetricConverterFactory.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/converter/RegisterMetricConverterFactory.java new file mode 100644 index 000000000..e4648958c --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/converter/RegisterMetricConverterFactory.java @@ -0,0 +1,17 @@ +package com.webank.wedatasphere.exchangis.job.server.metrics.converter; + +import com.webank.wedatasphere.exchangis.job.server.metrics.MetricsVo; + +/** + * Registrable Converter factory + * @param + */ +public interface RegisterMetricConverterFactory extends MetricConverterFactory { + + /** + * Register method + * @param engineType engine type + * @param converter converter + */ + void register(String engineType, MetricsConverter converter); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/converter/SqoopMetricConverter.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/converter/SqoopMetricConverter.java new file mode 100644 index 000000000..cedab27e3 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/metrics/converter/SqoopMetricConverter.java @@ -0,0 +1,77 @@ +package com.webank.wedatasphere.exchangis.job.server.metrics.converter; + +import com.webank.wedatasphere.exchangis.job.server.metrics.ExchangisMetricsVo; +import com.webank.wedatasphere.exchangis.job.server.utils.JsonEntity; +import com.webank.wedatasphere.exchangis.job.utils.MemUtils; +import org.apache.commons.lang.StringUtils; + +import java.math.BigDecimal; +import java.util.Objects; + +/** + * Convert the metrics in sqoop engine + */ +public class SqoopMetricConverter extends AbstractMetricConverter implements AbstractMetricConverter.MetricsParser { + + @Override + public String resourceUsedKey() { + return ""; + } + + @Override + public String trafficKey() { + return ""; + } + + @Override + public String indicatorKey() { + return JsonEntity.encodePath("org.apache.hadoop.mapreduce.TaskCounter"); + } + + @Override + protected AbstractMetricConverter.MetricsParser getParser() { + return this; + } + + @Override + public ExchangisMetricsVo.ResourceUsed parseResourceUsed(String key, JsonEntity rawValue) { + ExchangisMetricsVo.ResourceUsed resourceUsed = new ExchangisMetricsVo.ResourceUsed(); + String nodeResource = rawValue.getString("NodeResourceJson"); + if (StringUtils.isNotBlank(nodeResource)){ + JsonEntity nodeResourceJson = JsonEntity.from(nodeResource); + String memoryUnit = nodeResourceJson.getString("driver.memory"); + if (StringUtils.isNotBlank(memoryUnit)){ + String[] memory = memoryUnit.split(" "); + resourceUsed.setMemory(memory.length >= 2 ? + MemUtils.convertToMB((long) Double.parseDouble(memory[0]), memory[1]) : (long) Double.parseDouble(memory[0])); + } + String cpuVCores = nodeResourceJson.getString("driver.cpu"); + if (StringUtils.isNotBlank(cpuVCores)){ + resourceUsed.setCpu(Integer.parseInt(cpuVCores)); + } + } + return resourceUsed; + } + + @Override + public ExchangisMetricsVo.Traffic parseTraffic(String key, JsonEntity rawValue) { + ExchangisMetricsVo.Traffic traffic = new ExchangisMetricsVo.Traffic(); + Double records = rawValue.getDouble(JsonEntity.encodePath("org.apache.hadoop.mapreduce.TaskCounter") + ".MAP_OUTPUT_RECORDS"); + Double runTime = rawValue.getDouble("MetricsRunTime"); + if (Objects.nonNull(records) && Objects.nonNull(runTime)){ + traffic.setFlow(new BigDecimal(records / runTime * 1000).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + } + return traffic; + } + + @Override + public ExchangisMetricsVo.Indicator parseIndicator(String key, JsonEntity rawValue) { + ExchangisMetricsVo.Indicator indicator = new ExchangisMetricsVo.Indicator(); + Long records = rawValue.getLong("MAP_OUTPUT_RECORDS"); + if (Objects.nonNull(records)){ + indicator.setExchangedRecords(records); + } + return indicator; + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/ExchangisJobRestfulApi.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/ExchangisJobRestfulApi.java new file mode 100644 index 000000000..c55ef2511 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/ExchangisJobRestfulApi.java @@ -0,0 +1,328 @@ +package com.webank.wedatasphere.exchangis.job.server.restful; + +import com.webank.wedatasphere.exchangis.common.pager.PageResult; +import com.webank.wedatasphere.exchangis.common.validator.groups.InsertGroup; +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisDataSourceException; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobQueryVo; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobVo; +import com.webank.wedatasphere.exchangis.job.enums.EngineTypeEnum; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisJobServerException; +import com.webank.wedatasphere.exchangis.job.server.service.JobInfoService; +import org.apache.linkis.server.Message; +import org.apache.linkis.server.security.SecurityFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.validation.BindingResult; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.validation.groups.Default; +import java.util.*; + + +/** + * The basic controller of Exchangis job + */ +@RestController +@RequestMapping(value = "dss/exchangis/main/job", produces = {"application/json;charset=utf-8"}) +public class ExchangisJobRestfulApi { + + private static final Logger LOG = LoggerFactory.getLogger(ExchangisJobRestfulApi.class); + + /** + * Job service + */ + @Resource + private JobInfoService jobInfoService; + + /** + * Query job in page + * + * @param projectId project id + * @param jobType job type + * @param name name + * @param current current + * @param size size + * @param request request + * @return message + */ + @RequestMapping(value = "", method = RequestMethod.GET) + public Message getJobList(@RequestParam(value = "projectId") Long projectId, + @RequestParam(value = "jobType", required = false) String jobType, + @RequestParam(value = "name", required = false) String name, + @RequestParam(value = "current", required = false) int current, + @RequestParam(value = "size", required = false) int size, + HttpServletRequest request) { + ExchangisJobQueryVo queryVo = new ExchangisJobQueryVo( + projectId, jobType, name, current, size + ); + String userName = SecurityFilter.getLoginUsername(request); + queryVo.setCreateUser(userName); + try { + PageResult pageResult = jobInfoService.queryJobList(queryVo); + return Message.ok().data("total", pageResult.getTotal()).data("result", pageResult.getList()); + } catch (Exception e) { + LOG.error("Fail to query job list for user {}", userName, e); + return Message.error("Failed to query job list (获取任务列表失败)"); + } + } + + /** + * Engine list + * + * @return message + */ + @RequestMapping(value = "/engineType", method = RequestMethod.GET) + public Message getEngineList() { + // TODO limit the engine type in exchangis +// return Message.ok().data("result", EngineTypeEnum.values()); + return Message.ok().data("result", new EngineTypeEnum[]{EngineTypeEnum.SQOOP}); + } + + /** + * Create job + * + * @param request http request + * @param exchangisJobVo exchangis job vo + * @return message + */ + @RequestMapping(value = "", method = RequestMethod.POST) + public Message createJob( + @Validated({InsertGroup.class, Default.class}) @RequestBody ExchangisJobVo exchangisJobVo, + BindingResult result, + HttpServletRequest request) { + if (result.hasErrors()) { + return Message.error(result.getFieldErrors().get(0).getDefaultMessage()); + } + String userName = SecurityFilter.getLoginUsername(request); + exchangisJobVo.setCreateUser(userName); + Message response = Message.ok(); + try { + response.data("result", jobInfoService.createJob(exchangisJobVo)); + } catch (Exception e) { + String message = "Fail to create job: " + exchangisJobVo.getJobName() + " (创建任务失败)"; + LOG.error(message, e); + response = Message.error(message); + } + return response; + } + + /** + * Copy job + * + * @param sourceJobId source job id + * @param exchangisJobVo job vo + * @return message + */ + @RequestMapping(value = "/{sourceJobId:\\d+}/copy", method = RequestMethod.POST) + public Message copyJob(@PathVariable("sourceJobId") Long sourceJobId, + @Validated @RequestBody ExchangisJobVo exchangisJobVo, + BindingResult result, HttpServletRequest request) { + if (result.hasErrors()) { + return Message.error(result.getFieldErrors().get(0).getDefaultMessage()); + } + String userName = SecurityFilter.getLoginUsername(request); + exchangisJobVo.setId(sourceJobId); + exchangisJobVo.setModifyUser(userName); + Message response = Message.ok(); + try { + if (!hasAuthority(userName, jobInfoService.getJob(sourceJobId, true))) { + return Message.error("You have no permission to update (没有复制权限)"); + } + response.data("result", jobInfoService.copyJob(exchangisJobVo)); + } catch (Exception e) { + String message = "Fail to update job: " + exchangisJobVo.getJobName() + " (复制任务失败)"; + LOG.error(message, e); + response = Message.error(message); + } + return response; + //return Message.error("Function will be supported in next version (该功能将在下版本支持)"); + } + + /** + * Update job + * + * @param id job id + * @param exchangisJobVo job vo + * @return message + */ + @RequestMapping(value = "/{id:\\d+}", method = RequestMethod.PUT) + public Message updateJob(@PathVariable("id") Long id, + @Validated @RequestBody ExchangisJobVo exchangisJobVo, + BindingResult result, HttpServletRequest request) { + if (result.hasErrors()) { + return Message.error(result.getFieldErrors().get(0).getDefaultMessage()); + } + String userName = SecurityFilter.getLoginUsername(request); + exchangisJobVo.setId(id); + exchangisJobVo.setModifyUser(userName); + Message response = Message.ok(); + try { + if (!hasAuthority(userName, jobInfoService.getJob(id, true))) { + return Message.error("You have no permission to update (没有更新权限)"); + } + response.data("result", jobInfoService.updateJob(exchangisJobVo)); + } catch (Exception e) { + String message = "Fail to update job: " + exchangisJobVo.getJobName() + " (更新任务失败)"; + LOG.error(message, e); + response = Message.error(message); + } + return response; + } + + /** + * Delete job + * + * @param id id + * @param request http request + * @return message + */ + @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) + public Message deleteJob(@PathVariable("id") Long id, HttpServletRequest request) { + String userName = SecurityFilter.getLoginUsername(request); + Message response = Message.ok("job deleted"); + try { + if (!hasAuthority(userName, jobInfoService.getJob(id, true))) { + return Message.error("You have no permission to update ()"); + } + jobInfoService.deleteJob(id); + } catch (Exception e) { + String message = "Fail to delete job [ id: " + id + "] (删除任务失败)"; + LOG.error(message, e); + response = Message.error(message); + } + return response; + } + + + /** + * Get job + * + * @param request http request + * @param id id + * @return message + */ + @RequestMapping(value = "/{id}", method = RequestMethod.GET) + public Message getJob(HttpServletRequest request, @PathVariable("id") Long id) { + Message response = Message.ok(); + try { + LOG.info("Request88888: {}", request); + ExchangisJobVo job = jobInfoService.getDecoratedJob(request, id); + response.data("result", job); + } catch (Exception e) { + String message = "Fail to get job detail (查询任务失败)"; + if (e.getCause() instanceof ExchangisJobServerException) { + message += ", reason: " + e.getCause().getMessage(); + } + LOG.error(message, e); + response = Message.error(message); + } + return response; + } + + /** + * Get all sub job list + * @param request + * @param projectId + * @return + */ + @RequestMapping(value = "/subJob/list", method = RequestMethod.GET) + public Message getSubJobList(HttpServletRequest request, @RequestParam(value = "projectId") Long projectId) { + Message response = Message.ok(); + try { + List jobList = jobInfoService.getSubJobList(request, projectId); + response.data("result", jobList); + } catch (Exception e) { + String message = "Fail to get job detail (查询所有子任务列表失败)"; + if (e.getCause() instanceof ExchangisJobServerException) { + message += ", reason: " + e.getCause().getMessage(); + } + LOG.error(message, e); + response = Message.error(message); + } + return response; + } + + /** + * Get job list + * @param projectId + * @param jobName + * @return + */ + @RequestMapping(value = "/getJob/list", method = RequestMethod.GET) + public Message getByNameWithProjectId(@RequestParam(value = "projectId") Long projectId, + @RequestParam(value = "jobName", required = false) String jobName) { + Message response = Message.ok(); + try { + List jobs = jobInfoService.getByNameWithProjectId(jobName, projectId); + response.data("result", jobs); + } catch (Exception e) { + String message = "Fail to get job detail (查询任务失败)"; + if (e.getCause() instanceof ExchangisJobServerException) { + message += ", reason: " + e.getCause().getMessage(); + } + LOG.error(message, e); + response = Message.error(message); + } + return response; + } + + /** + * Save the job configuration + * + * @param id id + * @param jobVo job vo + * @return message + */ + @RequestMapping(value = "/{id}/config", method = RequestMethod.PUT) + public Message saveJobConfig(@PathVariable("id") Long id, + @RequestBody ExchangisJobVo jobVo, HttpServletRequest request) { + jobVo.setId(id); + jobVo.setModifyUser(SecurityFilter.getLoginUsername(request)); + Message response = Message.ok(); + try { + ExchangisJobVo exchangisJob = jobInfoService.updateJobConfig(jobVo); + response.data("id", exchangisJob.getId()); + } catch (Exception e) { + String message = "Fail to save the job configuration (保存任务配置失败)"; + LOG.error(message, e); + response = Message.error(message); + } + return response; + } + + @RequestMapping(value = "/{id}/content", method = RequestMethod.PUT) + public Message saveSubJobs(@PathVariable("id") Long id, + @RequestBody ExchangisJobVo jobVo, HttpServletRequest request) { + jobVo.setId(id); + jobVo.setModifyUser(SecurityFilter.getLoginUsername(request)); + Message response = Message.ok(); + try { + ExchangisJobVo exchangisJob = jobInfoService.updateJobContent(jobVo); + response.data("id", exchangisJob.getId()); + } catch (Exception e) { + String message = "Fail to save the job content (保存任务内容失败)"; + if (e.getCause() instanceof ExchangisJobServerException + || e.getCause() instanceof ExchangisDataSourceException) { + message += ", reason: " + e.getCause().getMessage(); + } + LOG.error(message, e); + response = Message.error(message); + } + return response; + } + + /** + * TODO complete the authority strategy + * + * @param username username + * @param job job + * @return + */ + private boolean hasAuthority(String username, ExchangisJobVo job) { + return Objects.nonNull(job) && username.equals(job.getCreateUser()); + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/ExchangisMetricsRestfulApi.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/ExchangisMetricsRestfulApi.java new file mode 100644 index 000000000..dd1698aab --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/ExchangisMetricsRestfulApi.java @@ -0,0 +1,57 @@ +package com.webank.wedatasphere.exchangis.job.server.restful; + +import com.webank.wedatasphere.exchangis.job.server.service.ExchangisMetricsService; +import org.apache.linkis.server.Message; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; + +@RestController +@RequestMapping(value = "dss/exchangis/main", produces = {"application/json;charset=utf-8"}) +public class ExchangisMetricsRestfulApi { + + private final ExchangisMetricsService exchangisMetricsService; + + @Autowired + public ExchangisMetricsRestfulApi(ExchangisMetricsService exchangisMetricsService) { + this.exchangisMetricsService = exchangisMetricsService; + } + + // get task state metrics + @RequestMapping( value = "metrics/taskstate", method = RequestMethod.GET) + public Message getTaskStateMetrics(HttpServletRequest request) throws Exception { + return this.exchangisMetricsService.getTaskStateMetrics(request); + } + + // get task process metrics + @RequestMapping( value = "metrics/taskprocess", method = RequestMethod.GET) + public Message getTaskProcessMetrics(HttpServletRequest request) throws Exception { + return this.exchangisMetricsService.getTaskProcessMetrics(request); + } + + // get datasource flow metrics + @RequestMapping( value = "metrics/datasourceflow", method = RequestMethod.GET) + public Message getDataSourceFlowMetrics(HttpServletRequest request) throws Exception { + return this.exchangisMetricsService.getDataSourceFlowMetrics(request); + } + + // get engine (sqoop datax linkis etc.) resource metrics + @RequestMapping( value = "metrics/engineresource", method = RequestMethod.GET) + public Message getEngineResourceMetrics(HttpServletRequest request) throws Exception { + return this.exchangisMetricsService.getEngineResourceMetrics(request); + } + + @RequestMapping( value = "metrics/engineresourcecpu", method = RequestMethod.GET) + public Message getEngineResourceCpuMetrics(HttpServletRequest request) throws Exception { + return this.exchangisMetricsService.getEngineResourceCpuMetrics(request); + } + + @RequestMapping( value = "metrics/engineresourcemem", method = RequestMethod.GET) + public Message getEngineResourceMemMetrics(HttpServletRequest request) throws Exception { + return this.exchangisMetricsService.getEngineResourceMemMetrics(request); + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/ExchangisTaskRestfulApi.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/ExchangisTaskRestfulApi.java new file mode 100644 index 000000000..7c4aab099 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/ExchangisTaskRestfulApi.java @@ -0,0 +1,16 @@ +package com.webank.wedatasphere.exchangis.job.server.restful; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +/** + * The type Exchangis task controller. + * + * @date 2021/10/13 + */ +@RestController +@RequestMapping(value = "dss/exchangis/main/tasks", produces = {"application/json;charset=utf-8"}) +public class ExchangisTaskRestfulApi { + private static final Logger LOG = LoggerFactory.getLogger(ExchangisTaskRestfulApi.class); + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/execute/ExchangisJobExecuteRestfulApi.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/execute/ExchangisJobExecuteRestfulApi.java new file mode 100644 index 000000000..b4d8bc430 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/execute/ExchangisJobExecuteRestfulApi.java @@ -0,0 +1,244 @@ +package com.webank.wedatasphere.exchangis.job.server.restful.execute; + +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; +import com.webank.wedatasphere.exchangis.job.log.LogQuery; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisJobServerException; +import com.webank.wedatasphere.exchangis.job.server.service.JobInfoService; +import com.webank.wedatasphere.exchangis.job.server.service.impl.DefaultJobExecuteService; +import com.webank.wedatasphere.exchangis.job.server.vo.ExchangisCategoryLogVo; +import com.webank.wedatasphere.exchangis.job.server.vo.ExchangisJobProgressVo; +import com.webank.wedatasphere.exchangis.job.server.vo.ExchangisJobTaskVo; +import com.webank.wedatasphere.exchangis.job.server.vo.ExchangisLaunchedJobListVo; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobVo; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.server.Message; +import org.apache.linkis.server.security.SecurityFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.*; + +/** + * + * @Date 2022/1/8 15:25 + */ +@RestController +@RequestMapping(value = "dss/exchangis/main/job", produces = {"application/json;charset=utf-8"}) +public class ExchangisJobExecuteRestfulApi { + private static final Logger LOG = LoggerFactory.getLogger(ExchangisJobExecuteRestfulApi.class); + @Autowired + private JobInfoService jobInfoService; + + @Resource + private DefaultJobExecuteService executeService; + + /** + * Execute job + * @param permitPartialFailures permit + * @param id id + * @return message + */ + @RequestMapping( value = "/{id}/execute", method = RequestMethod.POST) + public Message executeJob(@RequestBody(required = false) Map permitPartialFailures, + @PathVariable("id") Long id, HttpServletRequest request) { + String loginUser = SecurityFilter.getLoginUsername(request); + Message result = Message.ok("Submitted succeed(提交成功)!"); + ExchangisJobInfo jobInfo = null; + try { + // First to find the job from the old table. + ExchangisJobVo jobVo = jobInfoService.getJob(id, false); + if (Objects.isNull(jobVo)){ + return Message.error("Job related the id: [" + id + "] is Empty(关联的任务不存在)"); + } + // Convert to the job info + jobInfo = new ExchangisJobInfo(jobVo); + if (!hasAuthority(loginUser, jobInfo)){ + return Message.error("You have no permission to execute job (没有执行任务权限)"); + } + // Send to execute service + String jobExecutionId = executeService.executeJob(jobInfo, StringUtils.isNotBlank(jobInfo.getExecuteUser()) ? + jobInfo.getExecuteUser() : loginUser); + result.data("jobExecutionId", jobExecutionId); + } catch (Exception e) { + String message; + if (Objects.nonNull(jobInfo)) { + message = "Error occur while executing job: [id: " + jobInfo.getId() + " name: " + jobInfo.getName() + "]"; + result = Message.error(message + "(执行任务出错), reason: " + e.getMessage()); + } else { + message = "Error to get the job detail (获取任务信息出错)"; + result = Message.error(message); + } + LOG.error(message, e); + } + result.setMethod("/api/rest_j/v1/dss/exchangis/main/job/{id}/execute"); + return result; + } + + @RequestMapping( value = "/execution/{jobExecutionId}/taskList", method = RequestMethod.GET) + public Message getExecutedJobTaskList(@PathVariable(value = "jobExecutionId") String jobExecutionId) { + Message message = Message.ok("Submitted succeed(提交成功)!"); + try { + List jobTaskList = executeService.getExecutedJobTaskList(jobExecutionId); + message.data("tasks", jobTaskList); + } catch (ExchangisJobServerException e) { + String errorMessage = "Error occur while get taskList: [jobExecutionId: " + jobExecutionId + "]"; + LOG.error(errorMessage, e); + message = Message.error(message + "(执行任务出错), reason: " + e.getMessage()); + } + message.setMethod("/api/rest_j/v1/dss/exchangis/main/job/execution/" + jobExecutionId + "/taskList"); + return message; + } + + @RequestMapping( value = "/execution/{jobExecutionId}/progress", method = RequestMethod.GET) + public Message getExecutedJobAndTaskStatus(@PathVariable(value = "jobExecutionId") String jobExecutionId) { + ExchangisJobProgressVo jobAndTaskStatus; + try { + jobAndTaskStatus = executeService.getExecutedJobProgressInfo(jobExecutionId); + } catch (ExchangisJobServerException e) { + // TODO Log exception + return Message.error("Fail to get progress info (获取任务执行状态失败), reason: [" + e.getMessage() + "]"); + } + Message message = Message.ok("Submitted succeed(提交成功)!"); + message.setMethod("/api/rest_j/v1/dss/exchangis/main/job/execution/" +jobExecutionId +"/progress"); + message.data("job", jobAndTaskStatus); + return message; + } + + @RequestMapping( value = "/execution/{jobExecutionId}/status", method = RequestMethod.GET) + public Message getExecutedJobStatus(@PathVariable(value = "jobExecutionId") String jobExecutionId) { + Message message = Message.ok("Submitted succeed(提交成功)!"); + try { + ExchangisJobProgressVo jobStatus = executeService.getJobStatus(jobExecutionId); + message.setMethod("/api/rest_j/v1/dss/exchangis/main/job/execution/" + jobExecutionId + "/status"); + message.data("status", jobStatus.getStatus()); + message.data("progress", jobStatus.getProgress()); + message.data("allTaskStatus", jobStatus.getAllTaskStatus()); + } catch (ExchangisJobServerException e) { + String errorMessage = "Error occur while getting job status: [job_execution_id: " + jobExecutionId +"]"; + LOG.error(errorMessage, e); + message = Message.error(message + ", reason: " + e.getMessage()); + } + return message; + } + + @RequestMapping(value = "/execution/{jobExecutionId}/log", method = RequestMethod.GET) + public Message getJobExecutionLogs(@PathVariable(value = "jobExecutionId") String jobExecutionId, + @RequestParam(value = "fromLine", required = false) Integer fromLine, + @RequestParam(value = "pageSize", required = false) Integer pageSize, + @RequestParam(value = "ignoreKeywords", required = false) String ignoreKeywords, + @RequestParam(value = "onlyKeywords", required = false) String onlyKeywords, + @RequestParam(value = "lastRows", required = false) Integer lastRows, HttpServletRequest request) { + + Message result = Message.ok("Submitted succeed(提交成功)!"); + LogQuery logQuery = new LogQuery(fromLine, pageSize, + ignoreKeywords, onlyKeywords, lastRows); + try { + ExchangisCategoryLogVo categoryLogVo = this.executeService + .getJobLogInfo(jobExecutionId, logQuery, SecurityFilter.getLoginUsername(request)); + result.setData(Json.convert(categoryLogVo, Map.class, String.class, Object.class)); + } catch (ExchangisJobServerException e) { + String message = "Error occur while querying job log: [job_execution_id: " + jobExecutionId +"]"; + LOG.error(message, e); + result = Message.error(message + ", reason: " + e.getMessage()); + } + result.setMethod("/api/rest_j/v1/dss/exchangis/main/job/execution/{jobExecutionId}/log"); + return result; + } + + @RequestMapping( value = "/execution/{jobExecutionId}/kill", method = RequestMethod.POST) + public Message ExecutedJobKill(@PathVariable(value = "jobExecutionId") String jobExecutionId) throws ExchangisJobServerException { + ExchangisJobProgressVo jobStatus = executeService.getJobStatus(jobExecutionId); + String status = jobStatus.getStatus().toString(); + Message message = null; + if (!TaskStatus.isCompleted(jobStatus.getStatus())) + { + message = Message.ok("Kill succeed(停止成功)!"); + try { + executeService.killJob(jobExecutionId); + } catch (ExchangisJobServerException e) { + String errorMessage = "Error occur while killing job: [job_execution_id: " + jobExecutionId + "]"; + LOG.error(errorMessage, e); + message = Message.error(message + ", reason: " + e.getMessage()); + } + } + else { + message = Message.error("Kill failed(停止失败)!,job 已经到终态"); + } + message.setMethod("/api/rest_j/v1/dss/exchangis/main/job/execution/" + jobExecutionId + "/kill"); + return message; + } + + @RequestMapping(value = "/listJobs", method = RequestMethod.GET) + public Message listJobs(@RequestParam(value = "jobExecutionId", required = false) String jobExecutionId, + @RequestParam(value = "jobName", required = false) String jobName, + @RequestParam(value = "status", required = false) String status, + @RequestParam(value = "launchStartTime", required = false) Long launchStartTime, + @RequestParam(value = "launchEndTime", required = false) Long launchEndTime, + @RequestParam(value = "current", required = false) int current, + @RequestParam(value = "size", required = false) int size, + HttpServletRequest request) { + Message message = Message.ok("Submitted succeed(提交成功)!"); + try { + List jobList = executeService.getExecutedJobList(jobExecutionId, jobName, status, + launchStartTime, launchEndTime, current, size, request); + int total = executeService.count(jobExecutionId, jobName, status, launchStartTime, launchEndTime, request); + message.data("jobList", jobList); + message.data("total", total); + } catch (ExchangisJobServerException e) { + String errorMessage = "Error occur while getting job list: [job_execution_id: " + jobExecutionId + "jobName: " + jobName + "status: " + status + "]"; + LOG.error(errorMessage, e); + message = Message.error(message + ", reason: " + e.getMessage()); + } + message.setMethod("/api/rest_j/v1/dss/exchangis/main/job/execution/listJobs"); + return message; + } + + /** + * TODO complete the authority strategy + * @param username username + * @param jobInfo job info + * @return + */ + private boolean hasAuthority(String username, ExchangisJobInfo jobInfo){ + return username.equals(jobInfo.getCreateUser()); + } + + @RequestMapping( value = "/{jobExecutionId}/deleteJob", method = RequestMethod.POST) + public Message ExecutedJobDelete(@PathVariable(value = "jobExecutionId") String jobExecutionId) throws ExchangisJobServerException { + //ExchangisLaunchedJobEntity jobAndTaskStatus = exchangisExecutionService.getExecutedJobAndTaskStatus(jobExecutionId); + Message message = Message.ok("Kill succeed(停止成功)!"); + try { + executeService.deleteJob(jobExecutionId); + message.data("jobExecutionId", jobExecutionId); + } catch (ExchangisJobServerException e){ + String errorMessage = "Error occur while delete job: [job_execution_id: " + jobExecutionId + "]"; + LOG.error(errorMessage, e); + message = Message.error(message + ", reason: " + e.getMessage()); + } + message.setMethod("/api/rest_j/v1/dss/exchangis/main/job/" + jobExecutionId + "/deleteJob"); + return message; + } + + @RequestMapping( value = "/{jobExecutionId}/allTaskStatus", method = RequestMethod.GET) + public Message allTaskStatus(@PathVariable(value = "jobExecutionId") String jobExecutionId) throws ExchangisJobServerException { + //ExchangisLaunchedJobEntity jobAndTaskStatus = exchangisExecutionService.getExecutedJobAndTaskStatus(jobExecutionId); + Message message = Message.ok("所有任务状态"); + try { + List allStatus = executeService.allTaskStatus(jobExecutionId); + message.data("allStatus", allStatus); + message.data("jobExecutionId", jobExecutionId); + } catch (ExchangisJobServerException e) { + String errorMessage = "Error occur while judge whether all task complete: [job_execution_id: " + jobExecutionId + "]"; + LOG.error(errorMessage, e); + message = Message.error(message + ", reason: " + e.getMessage()); + } + message.setMethod("/api/rest_j/v1/dss/exchangis/main/job/" + jobExecutionId + "/allTaskStatus"); + return message; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/execute/ExchangisTaskExecuteRestfulApi.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/execute/ExchangisTaskExecuteRestfulApi.java new file mode 100644 index 000000000..6a597d59b --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/execute/ExchangisTaskExecuteRestfulApi.java @@ -0,0 +1,84 @@ +package com.webank.wedatasphere.exchangis.job.server.restful.execute; + +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import com.webank.wedatasphere.exchangis.job.log.LogQuery; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisJobServerException; +import com.webank.wedatasphere.exchangis.job.server.service.JobInfoService; +import com.webank.wedatasphere.exchangis.job.server.service.JobExecuteService; +import com.webank.wedatasphere.exchangis.job.server.vo.ExchangisCategoryLogVo; +import com.webank.wedatasphere.exchangis.job.server.vo.ExchangisLaunchedTaskMetricsVo; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.server.Message; +import org.apache.linkis.server.security.SecurityFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Map; + +/** + * + * @Date 2022/1/8 17:23 + */ + +@RestController +@RequestMapping(value = "dss/exchangis/main/task", produces = {"application/json;charset=utf-8"}) +public class ExchangisTaskExecuteRestfulApi { + private static final Logger LOG = LoggerFactory.getLogger(ExchangisTaskExecuteRestfulApi.class); + @Autowired + private JobInfoService jobInfoService; + + @Resource + private JobExecuteService jobExecuteService; + + @RequestMapping( value = "/execution/{taskId}/metrics", method = RequestMethod.POST) + public Message getTaskMetrics(@PathVariable("taskId") String taskId, + @RequestBody Map json, HttpServletRequest request) throws ExchangisJobServerException { + Message result = Message.ok("Submitted succeed(提交成功)!"); + String jobExecutionId = null; + + if(null!=json.get("jobExecutionId")){ + jobExecutionId = (String) json.get("jobExecutionId"); + } + if (StringUtils.isBlank(jobExecutionId)){ + return Message.error("Required params 'jobExecutionId' is missing"); + } + try{ + ExchangisLaunchedTaskMetricsVo taskMetrics = this.jobExecuteService + .getLaunchedTaskMetrics(taskId, jobExecutionId, SecurityFilter.getLoginUsername(request)); + result.data("task", taskMetrics); + }catch(Exception e){ + String message = "Error occur while fetching metrics: [task_id: " + taskId + ", job_execution_id: " + jobExecutionId +"]"; + LOG.error(message, e); + result = Message.error(message + ", reason: " + e.getMessage()); + } + result.setMethod("/api/rest_j/v1/dss/exchangis/main/task/execution/{taskId}/metrics"); + return result; + } + + @RequestMapping(value = "/execution/{taskId}/log", method = RequestMethod.GET) + public Message getTaskExecutionLogs(@PathVariable(value = "taskId") String taskId, + @RequestParam(value = "jobExecutionId", required = false) String jobExecutionId, + @RequestParam(value = "fromLine", required = false) Integer fromLine, + @RequestParam(value = "pageSize", required = false) Integer pageSize, + @RequestParam(value = "ignoreKeywords", required = false) String ignoreKeywords, + @RequestParam(value = "onlyKeywords", required = false) String onlyKeywords, + @RequestParam(value = "lastRows", required = false) Integer lastRows, HttpServletRequest request){ + Message result = Message.ok("Submitted succeed(提交成功)!"); + LogQuery logQuery = new LogQuery(fromLine, pageSize, + ignoreKeywords, onlyKeywords, lastRows); + try { + ExchangisCategoryLogVo categoryLogVo = this.jobExecuteService.getTaskLogInfo(taskId, jobExecutionId, logQuery, SecurityFilter.getLoginUsername(request)); + result.setData(Json.convert(categoryLogVo, Map.class, String.class, Object.class)); + } catch (Exception e) { + String message = "Error occur while query task log: [task_id: " + taskId + ", job_execution_id: " + jobExecutionId +"]"; + LOG.error(message, e); + result = Message.error(message + ", reason: " + e.getMessage()); + } + result.setMethod("/api/rest_j/v1/dss/exchangis/main/job/execution/{taskId}/log"); + return result; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/external/ExchangisJobDssAppConnRestfulApi.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/external/ExchangisJobDssAppConnRestfulApi.java new file mode 100644 index 000000000..4e31fd727 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/external/ExchangisJobDssAppConnRestfulApi.java @@ -0,0 +1,304 @@ +package com.webank.wedatasphere.exchangis.job.server.restful.external; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.webank.wedatasphere.exchangis.common.validator.groups.InsertGroup; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisJobServerException; +import com.webank.wedatasphere.exchangis.job.server.service.IProjectCopyService; +import com.webank.wedatasphere.exchangis.job.server.service.IProjectImportService; +import com.webank.wedatasphere.exchangis.job.server.service.JobInfoService; +import com.webank.wedatasphere.exchangis.job.server.service.impl.DefaultJobExecuteService; +import com.webank.wedatasphere.exchangis.job.server.service.impl.ProjectImportServerImpl; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobVo; +import com.webank.wedatasphere.exchangis.project.server.entity.ExchangisProject; +import com.webank.wedatasphere.exchangis.project.server.mapper.ProjectMapper; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.server.BDPJettyServerHelper; +import org.apache.linkis.server.Message; +import org.apache.linkis.server.security.SecurityFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.BindingResult; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.validation.groups.Default; +import javax.ws.rs.core.Context; +import java.rmi.ServerException; +import java.util.Map; +import java.util.Objects; + +/** + * Define to support the app conn, in order to distinguish from the inner api + */ +@RestController +@RequestMapping(value = "/dss/exchangis/main/appJob", produces = {"application/json;charset=utf-8"}) +public class ExchangisJobDssAppConnRestfulApi { + + private static final Logger LOG = LoggerFactory.getLogger(ExchangisJobDssAppConnRestfulApi.class); + /** + * Job service + */ + @Resource + private JobInfoService jobInfoService; + + /** + * Job execute service + */ + @Resource + private DefaultJobExecuteService executeService; + + @Resource + private ProjectImportServerImpl projectImportServer; + + @Resource + private IProjectCopyService projectCopyService; + + @Autowired + private ProjectMapper projectMapper; + + /** + * Create job + * @param request http request + * @param exchangisJobVo exchangis job vo + * @return message + */ + @RequestMapping( value = "/create", method = RequestMethod.POST) + public Message createJob( + @Validated({InsertGroup.class, Default.class}) @RequestBody ExchangisJobVo exchangisJobVo, + BindingResult result, + HttpServletRequest request) { + if (result.hasErrors()){ + return Message.error(result.getFieldErrors().get(0).getDefaultMessage()); + } + String userName = SecurityFilter.getLoginUsername(request); + exchangisJobVo.setCreateUser(userName); + Message response = Message.ok(); + try{ + Long id = null; + id = jobInfoService.createJob(exchangisJobVo).getId(); + response.data("id", id); + LOG.info("id6666: {}", id); + } catch (Exception e){ + String message = "Fail to create dss job: " + exchangisJobVo.getJobName() +" (创建DSS任务失败)"; + LOG.error(message, e); + response = Message.error(message); + } + return response; + } + + /** + * Delete job + * @param id id + * @param request http request + * @return message + */ + @RequestMapping( value = "/{id:\\d+}", method = RequestMethod.POST) + public Message deleteJob(@PathVariable("id") Long id, HttpServletRequest request) { + String userName = SecurityFilter.getLoginUsername(request); + Message response = Message.ok("dss job deleted"); + try { + LOG.info("delete job bean: {}, jobid: {}", jobInfoService.getJob(id, true), jobInfoService.getJob(id, true).getId()); + if (Objects.isNull(jobInfoService.getJob(id, true)) || jobInfoService.getJob(id, true).getId() == null){ + return response; + } + else if (!hasAuthority(userName, jobInfoService.getJob(id, true))){ + return Message.error("You have no permission to update (没有删除权限)"); + } + jobInfoService.deleteJob(id); + } catch (Exception e){ + String message = "Fail to delete dss job [ id: " + id + "] (删除DSS任务失败)"; + LOG.error(message, e); + response = Message.error(message); + } + return response; + } + + /** + * Update job + * @param id job id + * @param exchangisJobVo job vo + * @return message + */ + @RequestMapping( value = "/{id:\\d+}", method = RequestMethod.PUT) + public Message updateJob(@PathVariable("id") Long id, + @Validated @RequestBody ExchangisJobVo exchangisJobVo, + BindingResult result, HttpServletRequest request) { + if (result.hasErrors()){ + return Message.error(result.getFieldErrors().get(0).getDefaultMessage()); + } + String userName = SecurityFilter.getLoginUsername(request); + exchangisJobVo.setId(id); + exchangisJobVo.setModifyUser(userName); + Message response = Message.ok(); + try{ + LOG.info("update job bean: {}, jobid: {}", jobInfoService.getJob(id, true), jobInfoService.getJob(id, true).getId()); + if (Objects.isNull(jobInfoService.getJob(id, true)) || jobInfoService.getJob(id, true).getId() == null){ + return Message.error("You have no job in exchangis,please delete this job (该节点在exchangis端不存在,请删除该节点)"); + } + else if (!hasAuthority(userName, jobInfoService.getJob(id , true))){ + return Message.error("You have no permission to update (没有更新权限666)"); + } + response.data("id", jobInfoService.updateJob(exchangisJobVo).getId()); + } catch (Exception e){ + String message = "Fail to update dss job: " + exchangisJobVo.getJobName() +" (更新DSS任务失败)"; + LOG.error(message, e); + response = Message.error(message); + } + return response; + } + + /** + * Execute job + * @param id id + * @return message + */ + @RequestMapping( value = "/execute/{id}", method = RequestMethod.POST) + public Message executeJob(@PathVariable("id") Long id, HttpServletRequest request, @RequestBody Map params) { + try { + LOG.info("start to parse params8909"); + String paramString = BDPJettyServerHelper.jacksonJson().writeValueAsString(params); + LOG.error("paramString999879: {}", paramString); + } catch (JsonProcessingException e) { + LOG.error("parse execute content error: {}", e.getMessage()); + } + String submitUser = params.get("submitUser").toString(); + String loginUser = SecurityFilter.getLoginUsername(request); + Message result = Message.ok(); + ExchangisJobInfo jobInfo = null; + LOG.info("wds execute user: {}", loginUser); + try { + // First to find the job from the old table. + ExchangisJobVo jobVo = jobInfoService.getJob(id, false); + if (Objects.isNull(jobVo)){ + return Message.error("Job related the id: [" + id + "] is Empty(关联的DSS任务不存在)"); + } + // Convert to the job info + jobInfo = new ExchangisJobInfo(jobVo); + jobInfo.setName(jobVo.getJobName()); + jobInfo.setId(jobVo.getId()); + LOG.info("jobInfo: name{},executerUser{},createUser{},id{}",jobInfo.getName(),jobInfo.getExecuteUser(),jobInfo.getCreateUser(),jobInfo.getId()); + LOG.info("loginUser: {}, jobVo:{}",loginUser,jobVo); + //find project info + ExchangisProject project = projectMapper.getDetailById(jobVo.getProjectId()); + LOG.info("project: {}, getProjectId:{}",project,jobVo.getProjectId()); + //find project user authority + /*if (!hasAuthority(submitUser, jobVo)){ + return Message.error("You have no permission to execute job (没有执行DSS任务权限)"); + }*/ + // Send to execute service + String jobExecutionId = executeService.executeJob(jobInfo, StringUtils.isNotBlank(jobInfo.getExecuteUser()) ? + jobInfo.getExecuteUser() : loginUser); + result.data("jobExecutionId", jobExecutionId); + + LOG.info("Prepare to get job status"); + /*while (true) { + TaskStatus jobStatus = executeService.getJobStatus(jobExecutionId).getStatus(); + LOG.info("Taskstatus is: {}", jobStatus.name()); + if (jobStatus == TaskStatus.Success ) { + result.data("jobStatus", jobStatus.name()); + LOG.info("Execute task success"); + break; + } else if (jobStatus == TaskStatus.Cancelled || jobStatus == TaskStatus.Failed || jobStatus == TaskStatus.Undefined || jobStatus == TaskStatus.Timeout) { + result.data("jobStatus", jobStatus.name()); + LOG.info("Execute task faild"); + throw new Exception(); + } + }*/ + } catch (Exception e) { + String message; + if (Objects.nonNull(jobInfo)) { + message = "Error occur while executing job: [id: " + jobInfo.getId() + " name: " + jobInfo.getName() + "]"; + result = Message.error(message + "(执行任务出错), reason: " + e.getMessage()); + } else { + message = "Error to get the job detail (获取任务信息出错)"; + result = Message.error(message); + } + LOG.error(message, e); + } + return result; + } + + @RequestMapping( value = "/import", method = RequestMethod.POST) + public Message importJob(@Context HttpServletRequest request, @RequestBody Map params) throws ServerException, ExchangisJobServerException{ + + Message response = null; + try { + LOG.info("param: {}", params); + response = projectImportServer.importProject(request, params); + LOG.info("import job success"); + } catch (ExchangisJobServerException e){ + String message = "Fail import job [ id: " + params + "] (导入任务失败)"; + LOG.error(message, e); + response = Message.error(message); + } + return response; + + } + + @RequestMapping( value = "/export", method = RequestMethod.POST) + public Message exportJob(@Context HttpServletRequest request, @RequestBody Map params) throws ServerException, ExchangisJobServerException { + String userName = SecurityFilter.getLoginUsername(request); + + LOG.info("export function params: {}", params); + Message response = null; + try { + response = jobInfoService.exportProject(params, userName, request); + LOG.info("export job success"); + } catch (Exception e){ + String message = "Fail Export job [ id: " + params + "] (导出任务失败)"; + LOG.error(message, e); + response = Message.error(message); + } + return response; + + //return jobInfoService.exportProject(params, userName, request); + + } + + @RequestMapping( value = "/copy", method = RequestMethod.POST) + public Message copy(@Context HttpServletRequest request, @RequestBody Map params) throws ServerException { + String userName = SecurityFilter.getLoginUsername(request); + + LOG.info("copy function params: {}", params); + Message response = null; + try { + response = projectCopyService.copy(params, userName, request); + LOG.info("copy node success"); + } catch (Exception e){ + String message = "Fail Copy project [ id: " + params + "] (导出任务失败)"; + LOG.error(message, e); + response = Message.error(message); + } + return response; + + //return jobInfoService.exportProject(params, userName, request); + + } + + /** + * TODO complete the authority strategy + * @param username username + * @param job job + * @return + */ + private boolean hasAuthority(String username, ExchangisJobVo job){ + return Objects.nonNull(job) && username.equals(job.getCreateUser()); + } + + /** + * @param username username + * @param project project + * @return + */ + private boolean hasExecuteAuthority(String username, ExchangisProject project){ + if(project.getEditUsers().contains(username)||project.getExecUsers().contains(username)){ + return true; + } + return false; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/external/ModuleEnum.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/external/ModuleEnum.java new file mode 100644 index 000000000..ebd971548 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/restful/external/ModuleEnum.java @@ -0,0 +1,30 @@ +package com.webank.wedatasphere.exchangis.job.server.restful.external; + +import java.util.Arrays; + +/** + * @author tikazhang + * @Date 2022/3/14 20:37 + */ +public enum ModuleEnum { + + SQOOP_IDS("sqoopIds", "SQOOP ids"), + + DATAX_IDS("dataxIds", "DATAX ids"); + + private String name; + private String desc; + + ModuleEnum(String name, String desc) { + this.name = name; + this.desc = desc; + } + + public static ModuleEnum getEnum(String name) { + return Arrays.stream(ModuleEnum.values()).filter(e -> e.getName().equals(name)).findFirst().orElseThrow(NullPointerException::new); + } + + public String getName() { + return name; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/ExchangisJobDsBindService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/ExchangisJobDsBindService.java new file mode 100644 index 000000000..69a599369 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/ExchangisJobDsBindService.java @@ -0,0 +1,13 @@ +package com.webank.wedatasphere.exchangis.job.server.service; + +import com.webank.wedatasphere.exchangis.dao.domain.ExchangisJobDsBind; + +import java.util.List; + +public interface ExchangisJobDsBindService { + + void updateJobDsBind(Long jobId, List dsBinds); + + boolean inUse(Long datasourceId); + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/ExchangisMetricsService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/ExchangisMetricsService.java new file mode 100644 index 000000000..fa544c34f --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/ExchangisMetricsService.java @@ -0,0 +1,20 @@ +package com.webank.wedatasphere.exchangis.job.server.service; + + +import org.apache.linkis.server.Message; + +import javax.servlet.http.HttpServletRequest; + +public interface ExchangisMetricsService { + Message getTaskStateMetrics(HttpServletRequest request); + + Message getTaskProcessMetrics(HttpServletRequest request); + + Message getDataSourceFlowMetrics(HttpServletRequest request); + + Message getEngineResourceCpuMetrics(HttpServletRequest request); + + Message getEngineResourceMemMetrics(HttpServletRequest request); + + Message getEngineResourceMetrics(HttpServletRequest request); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/IProjectCopyService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/IProjectCopyService.java new file mode 100644 index 000000000..e5d5f724d --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/IProjectCopyService.java @@ -0,0 +1,21 @@ +package com.webank.wedatasphere.exchangis.job.server.service; + +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisJobServerException; +import org.apache.linkis.server.Message; + +import javax.servlet.http.HttpServletRequest; +import java.util.Map; + +/** + * @author tikazhang + * @Date 2022/4/24 21:11 + */ +public interface IProjectCopyService { + + /** + * Copy node + * @param + */ + Message copy(Map params, String UserName, HttpServletRequest request) throws ExchangisJobException, ExchangisJobServerException; +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/IProjectExportService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/IProjectExportService.java new file mode 100644 index 000000000..feea880c0 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/IProjectExportService.java @@ -0,0 +1,21 @@ +package com.webank.wedatasphere.exchangis.job.server.service; + +import com.webank.wedatasphere.exchangis.job.server.dto.ExportedProject; + +import javax.servlet.http.HttpServletRequest; +import java.util.Map; +import java.util.Set; + +/** + * @author tikazhang + * @Date 2022/3/15 9:30 + */ +public interface IProjectExportService { + String exportProject(Map params, String username, HttpServletRequest request) throws Exception; + + ExportedProject export(Long projectId, Map> moduleIdsMap, boolean partial); + + Map> getModuleIdsMap(Map params); + + Long getProjectId(Map> moduleIdsMap); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/IProjectImportService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/IProjectImportService.java new file mode 100644 index 000000000..abccb0d88 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/IProjectImportService.java @@ -0,0 +1,20 @@ +package com.webank.wedatasphere.exchangis.job.server.service; + +import com.webank.wedatasphere.exchangis.job.server.dto.IdCatalog; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisJobServerException; +import com.webank.wedatasphere.exchangis.project.server.exception.ExchangisProjectErrorException; +import org.apache.linkis.server.Message; + +import javax.servlet.http.HttpServletRequest; +import java.rmi.ServerException; +import java.util.Map; + +/** + * @author tikazhang + * @Date 2022/3/15 10:01 + */ +public interface IProjectImportService { + Message importProject(HttpServletRequest req, Map params) throws ExchangisJobServerException, ServerException; + + IdCatalog importOpt(String projectJson, Long projectId, String versionSuffix, String userName) throws ExchangisJobServerException; +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/JobExecuteService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/JobExecuteService.java new file mode 100644 index 000000000..026d5a3c8 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/JobExecuteService.java @@ -0,0 +1,96 @@ +package com.webank.wedatasphere.exchangis.job.server.service; + + +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.launcher.exception.ExchangisTaskLaunchException; +import com.webank.wedatasphere.exchangis.job.log.LogQuery; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisJobServerException; +import com.webank.wedatasphere.exchangis.job.server.vo.*; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +public interface JobExecuteService { + + /** + * Check if the user has the authority of execution job + * @param jobExecutionId job execution id + * @param userName user name + * @return bool + */ + boolean hasExecuteJobAuthority(String jobExecutionId, String userName); + + ExchangisCategoryLogVo getJobLogInfo(String jobExecutionId, LogQuery logQuery, String userName) throws ExchangisJobServerException; + + ExchangisCategoryLogVo getTaskLogInfo(String taskId, String jobExecutionId, LogQuery logQuery, String userName) throws ExchangisJobServerException, ExchangisTaskLaunchException; + + /** + * Gets task Metrics + * + * @param taskid the task id + * @param jobExecutionId the job ExecutionId + * @return the task launched metrics + */ + ExchangisLaunchedTaskMetricsVo getLaunchedTaskMetrics(String taskid, String jobExecutionId, String userName) throws ExchangisJobServerException; + + /** + * Gets job progress info + * @param jobExecutionId the job ExecutionId + * @return the job tasks status + */ + ExchangisJobProgressVo getExecutedJobProgressInfo(String jobExecutionId) throws ExchangisJobServerException; + + /** + * Gets job status info + * @param jobExecutionId the job ExecutionId + * @return the job status + */ + ExchangisJobProgressVo getJobStatus(String jobExecutionId) throws ExchangisJobServerException; + + /** + * Gets Executed task list + * @param jobExecutionId the job ExecutionId + * @return the launched taskList + */ + List getExecutedJobTaskList(String jobExecutionId) throws ExchangisJobServerException; + + /** + * Gets Executed job list + * @return the launched jobList + */ + List getExecutedJobList(String jobExecutionId, String jobName, String status, + Long launchStartTime, Long launchEndTime, int current, int size, HttpServletRequest request) throws ExchangisJobServerException; + + /** + * Count int. + * + * @param jobExecutionId the job id + * @param jobName the job name + * @param status the status + * @param launchStartTime the launch start time + * @param launchEndTime the launch end time + * @return the int + */ + int count(String jobExecutionId, String jobName, String status, Long launchStartTime, Long launchEndTime, HttpServletRequest request); + + /** + * Execute job + * @param jobInfo job info + * @return job execution id + * @throws ExchangisJobServerException + */ + String executeJob(ExchangisJobInfo jobInfo, String execUser) throws ExchangisJobServerException; + /** + * Kill job. + * + * @param jobExecutionId the job ExecutionId + */ + void killJob(String jobExecutionId) throws ExchangisJobServerException; + + /** + * @param jobExecutionId the job ExecutionId + */ + void deleteJob(String jobExecutionId) throws ExchangisJobServerException; + + List allTaskStatus(String jobExecutionId) throws ExchangisJobServerException; +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/JobInfoService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/JobInfoService.java new file mode 100644 index 000000000..2f7cb538e --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/JobInfoService.java @@ -0,0 +1,121 @@ +package com.webank.wedatasphere.exchangis.job.server.service; + +import com.webank.wedatasphere.exchangis.common.pager.PageResult; +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisDataSourceException; +import com.webank.wedatasphere.exchangis.job.server.dto.ExportedProject; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobQueryVo; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobVo; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisJobServerException; +import org.apache.linkis.server.Message; + +import javax.servlet.http.HttpServletRequest; + +import java.util.List; + +import java.rmi.ServerException; +import java.util.Map; +import java.util.Set; + + +/** + * The interface Exchangis job service. + * + * @author yuxin.yuan + * @since 2021-08-10 + */ +public interface JobInfoService { + + /** + * Create job. + * + * @param jobVo the exchangis job basic info + * @return the exchangis job basic info vo + */ + ExchangisJobVo createJob(ExchangisJobVo jobVo); + + /** + * Update job exchangis job basic info. + * + * @param jobVo the exchangis job basic info dto + * @return the exchangis job basic info vo + */ + ExchangisJobVo updateJob(ExchangisJobVo jobVo); + + /** + * Gets job list(return job basic info). + * + * @param queryVo query vo + * @return the job page result + */ + PageResult queryJobList(ExchangisJobQueryVo queryVo); + + /** + * Delete job + * @param id job id + */ + void deleteJob(Long id); + + /** + * Get exchangis job by id. + * TODO remove the request + * @param id the id + * @throws ExchangisJobServerException the exchangis job error exception + */ + ExchangisJobVo getJob(Long id, boolean basic); + + /** + * Get job by name and projectId + * @param jobName + * @param projectId + * @return + */ + List getByNameWithProjectId(String jobName, Long projectId); + + ExchangisJobVo getDecoratedJob(HttpServletRequest request, Long id) throws ExchangisJobServerException; + + /** + * Get all subJob list + * @param request + * @param projectId + * @return + * @throws ExchangisJobServerException + */ + List getSubJobList(HttpServletRequest request, Long projectId) throws ExchangisJobServerException; + + /** + * Update exchangis job config. + * + * @param jobVo the exchangis job config + * @return the exchangis job + */ + ExchangisJobVo updateJobConfig(ExchangisJobVo jobVo) throws ExchangisJobServerException; + + /** + * Update exchangis job content. + * + * @param jobVo the exchangis job content + * @return the exchangis job + */ + ExchangisJobVo updateJobContent(ExchangisJobVo jobVo) throws ExchangisJobServerException, ExchangisDataSourceException; + + /** + * Export exchangis job to BML. + * + * @param username params + * @return + */ + Message exportProject(Map params, String username, HttpServletRequest request) throws ExchangisJobServerException, ServerException; + + ExportedProject export(Long projectId, Map> moduleIdsMap, boolean partial, HttpServletRequest request) throws ExchangisJobServerException; + + Map> getModuleIdsMap(Map params); + + /** + * Copy job exchangis job basic info. + * + * @param jobVo the exchangis job basic info dto + * @return the exchangis job basic info vo + */ + ExchangisJobVo copyJob(ExchangisJobVo jobVo); + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/TaskExecuteService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/TaskExecuteService.java new file mode 100644 index 000000000..7ac422a75 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/TaskExecuteService.java @@ -0,0 +1,35 @@ +package com.webank.wedatasphere.exchangis.job.server.service; + +import com.webank.wedatasphere.exchangis.job.exception.ExchangisOnEventException; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; +import com.webank.wedatasphere.exchangis.job.server.execution.TaskExecutionListener; + +import java.util.Date; + +/** + * Task execute service + */ +public interface TaskExecuteService extends TaskExecutionListener { + + /** + * Update the task and its related job status + * @param task task + * @param status status + */ + void updateTaskStatus(LaunchedExchangisTask task, TaskStatus status, boolean updateJob) throws ExchangisOnEventException; + + void updateTaskProgress(LaunchedExchangisTask task, float progress) throws ExchangisOnEventException; + + /** + * Try to update the job progress by executionId + * @param jobExecutionId job execution id + */ + void updateJobProgress(String jobExecutionId, Date updateTime); + /** + * Try to update the job status by executionId + * @param jobExecutionId job execution id + * @param status status + */ + void updateJobStatus(String jobExecutionId, TaskStatus status, Date updateTime); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/TaskGenerateService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/TaskGenerateService.java new file mode 100644 index 000000000..5c9672cd7 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/TaskGenerateService.java @@ -0,0 +1,9 @@ +package com.webank.wedatasphere.exchangis.job.server.service; + +import com.webank.wedatasphere.exchangis.job.server.execution.generator.TaskGenerateListener; + +/** + * TaskGenerate Service + */ +public interface TaskGenerateService extends TaskGenerateListener { +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/TaskObserverService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/TaskObserverService.java new file mode 100644 index 000000000..1aaa35dc1 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/TaskObserverService.java @@ -0,0 +1,25 @@ +package com.webank.wedatasphere.exchangis.job.server.service; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; + +import java.util.List; + +/** + * Task observer service + */ +public interface TaskObserverService { + + /** + * Get the launchable task + * @param limitSize limit size + * @return list + */ + List onPublishLaunchableTask(int limitSize); + + /** + * Subscribe the launchable task + * @param task task + * @return boolean + */ + boolean subscribe(LaunchableExchangisTask task); +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultJobExecuteService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultJobExecuteService.java new file mode 100644 index 000000000..3fea2972e --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultJobExecuteService.java @@ -0,0 +1,372 @@ +package com.webank.wedatasphere.exchangis.job.server.service.impl; + +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.launcher.AccessibleLauncherTask; +import com.webank.wedatasphere.exchangis.job.launcher.ExchangisTaskLaunchManager; +import com.webank.wedatasphere.exchangis.job.launcher.ExchangisTaskLauncher; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisJob; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; +import com.webank.wedatasphere.exchangis.job.launcher.entity.LaunchedExchangisJobEntity; +import com.webank.wedatasphere.exchangis.job.launcher.entity.LaunchedExchangisTaskEntity; +import com.webank.wedatasphere.exchangis.job.launcher.exception.ExchangisTaskLaunchException; +import com.webank.wedatasphere.exchangis.job.log.LogQuery; +import com.webank.wedatasphere.exchangis.job.log.LogResult; +import com.webank.wedatasphere.exchangis.job.server.mapper.LaunchableTaskDao; +import com.webank.wedatasphere.exchangis.job.server.mapper.LaunchedJobDao; +import com.webank.wedatasphere.exchangis.job.server.mapper.LaunchedTaskDao; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisJobServerException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskGenerateException; +import com.webank.wedatasphere.exchangis.job.server.execution.DefaultTaskExecution; +import com.webank.wedatasphere.exchangis.job.server.execution.TaskExecution; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.TaskGenerator; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks.GenerationSchedulerTask; +import com.webank.wedatasphere.exchangis.job.server.log.JobLogService; +import com.webank.wedatasphere.exchangis.job.server.metrics.ExchangisMetricsVo; +import com.webank.wedatasphere.exchangis.job.server.metrics.converter.MetricConverterFactory; +import com.webank.wedatasphere.exchangis.job.server.metrics.converter.MetricsConverter; +import com.webank.wedatasphere.exchangis.job.server.service.JobExecuteService; +import com.webank.wedatasphere.exchangis.job.server.vo.*; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.server.security.SecurityFilter; +import org.modelmapper.ModelMapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.*; + +import static com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode.*; + +@Service +public class DefaultJobExecuteService implements JobExecuteService { + private final static Logger LOG = LoggerFactory.getLogger(DefaultJobExecuteService.class); + + @Autowired + private LaunchedTaskDao launchedTaskDao; + + @Autowired + private LaunchedJobDao launchedJobDao; + + @Autowired + private LaunchableTaskDao launchableTaskDao; + + @Autowired + private ModelMapper modelMapper; + + /** + * Task generator + */ + @Resource + private TaskGenerator taskGenerator; + + /** + * Task execution + */ + @Resource + private TaskExecution taskExecution; + + @Autowired + private JobLogService jobLogService; + + + /** + * Launch manager + */ + @Resource + private ExchangisTaskLaunchManager launchManager; + + /** + * Metrics converter factory + */ + @Resource + private MetricConverterFactory metricConverterFactory; + + @Override + public List getExecutedJobTaskList(String jobExecutionId) throws ExchangisJobServerException{ + List launchedExchangisTaskEntities = launchedTaskDao.selectTaskListByJobExecutionId(jobExecutionId); + List jobTaskList = new ArrayList<>(); + if(launchedExchangisTaskEntities != null) { + try { + launchedExchangisTaskEntities.forEach(taskEntity -> { + ExchangisJobTaskVo exchangisTaskVO = modelMapper.map(taskEntity, ExchangisJobTaskVo.class); + jobTaskList.add(exchangisTaskVO); + } + ); + } catch (Exception e) { + LOG.error("Exception happened while get TaskLists mapping to Vo(获取task列表映射至页面是出错,请校验任务信息), " + "message: " + e.getMessage(), e); + } + } + + return jobTaskList; + } + + @Override + public ExchangisJobProgressVo getExecutedJobProgressInfo(String jobExecutionId) throws ExchangisJobServerException { + LaunchedExchangisJobEntity launchedExchangisJobEntity = launchedJobDao.searchLaunchedJob(jobExecutionId); + if (launchedExchangisJobEntity == null) { + throw new ExchangisJobServerException(31100, "Get jobProgress information is null(獲取job进度信息为空), " + "jobExecutionId = " + jobExecutionId); + } + ExchangisJobProgressVo jobProgressVo = null; + try { + jobProgressVo = modelMapper.map(launchedExchangisJobEntity, ExchangisJobProgressVo.class); + List launchedExchangisTaskEntity = launchedTaskDao.selectTaskListByJobExecutionId(jobExecutionId); + ExchangisJobProgressVo finalJobProgressVo = jobProgressVo; + launchedExchangisTaskEntity.forEach(taskEntity -> { + finalJobProgressVo.addTaskProgress(new ExchangisJobProgressVo.ExchangisTaskProgressVo(taskEntity.getTaskId(), taskEntity.getName(), taskEntity.getStatus(), taskEntity.getProgress())); + //jobProgressVo.addTaskProgress(new ExchangisJobProgressVo.ExchangisTaskProgressVo(taskEntity.getTaskId(), taskEntity.getName(), taskEntity.getStatus(), taskEntity.getProgress())); + }); + } catch (Exception e){ + LOG.error("Get job and task progress happen execption ," + "[jobExecutionId =" + jobExecutionId + "]", e); + } + return jobProgressVo; + } + + @Override + public ExchangisJobProgressVo getJobStatus(String jobExecutionId) throws ExchangisJobServerException{ + LaunchedExchangisJobEntity launchedExchangisJobEntity = launchedJobDao.searchLaunchedJob(jobExecutionId); + ExchangisJobProgressVo jobProgressVo = null; + try { + jobProgressVo = modelMapper.map(launchedExchangisJobEntity, ExchangisJobProgressVo.class); + } catch (Exception e) { + LOG.error("Get job status happen execption, " + "[jobExecutionId =" + jobExecutionId + "](获取作业状态错误)", e); + } + + boolean allTaskStatus = false; + + assert jobProgressVo != null; + if(TaskStatus.isCompleted(jobProgressVo.getStatus())) { + List taskStatusList = launchedTaskDao.getTaskStatusList(jobExecutionId); + allTaskStatus = taskStatusList.isEmpty(); + if (!allTaskStatus){ + allTaskStatus = taskStatusList.stream().allMatch( status -> + StringUtils.isNotBlank(status) && TaskStatus.isCompleted(TaskStatus.valueOf(status))); + } + } + jobProgressVo.setAllTaskStatus(allTaskStatus); + return jobProgressVo; + } + + @Override + public void killJob(String jobExecutionId) throws ExchangisJobServerException{ + Calendar calendar = Calendar.getInstance(); + launchedJobDao.upgradeLaunchedJobStatus(jobExecutionId, TaskStatus.Cancelled.name(), calendar.getTime()); + } + + @Override + public ExchangisLaunchedTaskMetricsVo getLaunchedTaskMetrics(String taskId, String jobExecutionId, String userName) throws ExchangisJobServerException { + LaunchedExchangisTaskEntity launchedExchangisTaskEntity = launchedTaskDao.getLaunchedTaskMetrics(jobExecutionId, taskId); + if (Objects.isNull(launchedExchangisTaskEntity) || !hasExecuteJobAuthority(jobExecutionId, userName)) { + throw new ExchangisJobServerException(METRICS_OP_ERROR.getCode(), "Unable to find the launched job by [" + jobExecutionId + "]", null); + } + ExchangisLaunchedTaskMetricsVo exchangisLaunchedTaskVo = new ExchangisLaunchedTaskMetricsVo(); + exchangisLaunchedTaskVo.setTaskId(launchedExchangisTaskEntity.getTaskId()); + exchangisLaunchedTaskVo.setName(launchedExchangisTaskEntity.getName()); + exchangisLaunchedTaskVo.setStatus(launchedExchangisTaskEntity.getStatus().name()); + MetricsConverter metricsConverter = metricConverterFactory.getOrCreateMetricsConverter(launchedExchangisTaskEntity.getEngineType()); + if (Objects.nonNull(metricsConverter)){ + try { + exchangisLaunchedTaskVo.setMetrics(metricsConverter.convert(launchedExchangisTaskEntity.getMetricsMap())); + }catch (ExchangisJobServerException e){ + // Print the problem in convert metrics vo + LOG.warn("Problem occurred in convert of metrics vo", e); + } + } + return exchangisLaunchedTaskVo; + } + + @Override + public boolean hasExecuteJobAuthority(String jobExecutionId, String userName) { + return hasExecuteJobAuthority(this.launchedJobDao.searchLaunchedJob(jobExecutionId) , userName); + } + + /** + * Check if has the authority of accessing execution job + * @param launchedExchangisJob launched job + * @param userName userName + * @return + */ + public boolean hasExecuteJobAuthority(LaunchedExchangisJobEntity launchedExchangisJob, String userName){ +// return Objects.nonNull(launchedExchangisJob) && launchedExchangisJob.getExecuteUser().equals(userName); + return true; + } + + @Override + public ExchangisCategoryLogVo getJobLogInfo(String jobExecutionId, LogQuery logQuery, String userName) throws ExchangisJobServerException { + LaunchedExchangisJobEntity launchedExchangisJob = this.launchedJobDao.searchLogPathInfo(jobExecutionId); + if (Objects.isNull(launchedExchangisJob) || !hasExecuteJobAuthority(launchedExchangisJob, userName)){ + throw new ExchangisJobServerException(LOG_OP_ERROR.getCode(), "Unable to find the launched job by [" + jobExecutionId + "]", null); + } + LogResult logResult = jobLogService.logsFromPageAndPath(launchedExchangisJob.getLogPath(), logQuery); + return resultToCategoryLog(logQuery, logResult, launchedExchangisJob.getStatus()); + } + + @Override + public ExchangisCategoryLogVo getTaskLogInfo(String taskId, String jobExecutionId, LogQuery logQuery, String userName) + throws ExchangisJobServerException, ExchangisTaskLaunchException { + LaunchedExchangisTaskEntity launchedTaskEntity = this.launchedTaskDao.getLaunchedTaskEntity(taskId); + if (Objects.isNull(launchedTaskEntity)){ + return resultToCategoryLog(logQuery, new LogResult(0, false, new ArrayList<>()), TaskStatus.Inited); + } + if (StringUtils.isBlank(launchedTaskEntity.getLinkisJobId())){ + TaskStatus status = launchedTaskEntity.getStatus(); + // Means that the task is not ready or task submit failed + return resultToCategoryLog(logQuery, new LogResult(0, TaskStatus.isCompleted(status), new ArrayList<>()), status); + } + if (!hasExecuteJobAuthority(jobExecutionId, userName)){ + throw new ExchangisJobServerException(LOG_OP_ERROR.getCode(), "Not have permission of accessing task [" + taskId + "]", null); + } + // Construct the launchedExchangisTask + LaunchedExchangisTask launchedTask = new LaunchedExchangisTask(); + launchedTask.setLinkisJobId(launchedTaskEntity.getLinkisJobId()); + launchedTask.setLinkisJobInfo(launchedTaskEntity.getLinkisJobInfo()); + launchedTask.setTaskId(launchedTaskEntity.getTaskId()); + launchedTask.setExecuteUser(launchedTaskEntity.getExecuteUser()); + launchedTask.setEngineType(launchedTaskEntity.getEngineType()); + ExchangisTaskLauncher taskLauncher = + this.launchManager.getTaskLauncher(DefaultTaskExecution.DEFAULT_LAUNCHER_NAME); + if (Objects.isNull(taskLauncher)){ + throw new ExchangisJobServerException(LOG_OP_ERROR.getCode(), "Unable to find the suitable launcher for [task: " + taskId + ", engine type: " + + launchedTask.getEngineType() +"]", null); + } + AccessibleLauncherTask accessibleLauncherTask = taskLauncher.launcherTask(launchedTask); + return resultToCategoryLog(logQuery, accessibleLauncherTask.queryLogs(logQuery), launchedTaskEntity.getStatus()); + } + + @Override + public List getExecutedJobList(String jobExecutionId, String jobName, String status, + Long launchStartTime, Long launchEndTime, int current, int size, HttpServletRequest request) throws ExchangisJobServerException{ + if (current <= 0) { + current = 1; + } + if (size <= 0) { + size = 10; + } + int start = (current - 1) * size; + List jobList = new ArrayList<>(); + Date startTime = launchStartTime == null ? null : new Date(launchStartTime); + Date endTime = launchEndTime == null ? null : new Date(launchEndTime); + List jobEntitylist = launchedJobDao.getAllLaunchedJob(jobExecutionId, jobName, status, startTime, endTime, start, size, SecurityFilter.getLoginUsername(request)); + //LOG.info("ExecutedJobList information: " + jobExecutionId + jobName + status + launchStartTime + launchEndTime + current + size); + if(jobEntitylist != null) { + try { + for (LaunchedExchangisJobEntity launchedExchangisJobEntity : jobEntitylist) { + ExchangisLaunchedJobListVo exchangisJobVo = modelMapper.map(launchedExchangisJobEntity, ExchangisLaunchedJobListVo.class); + if (launchedExchangisJobEntity.getExchangisJobEntity() == null || launchedExchangisJobEntity.getExchangisJobEntity().getSource() == null) { + exchangisJobVo.setExecuteNode("-"); + } else { + Map sourceObject = Json.fromJson(launchedExchangisJobEntity.getExchangisJobEntity().getSource(), Map.class); + if (Objects.nonNull(sourceObject)){ + exchangisJobVo.setExecuteNode(String.valueOf(sourceObject + .getOrDefault("executeNode", "-"))); + } + } + List launchedExchangisTaskEntities = launchedTaskDao.selectTaskListByJobExecutionId(launchedExchangisJobEntity.getJobExecutionId()); + if (launchedExchangisTaskEntities == null) { + exchangisJobVo.setFlow((long) 0); + } else { + int flows = 0; + int taskNum = launchedExchangisTaskEntities.size(); + for (LaunchedExchangisTaskEntity launchedExchangisTaskEntity : launchedExchangisTaskEntities) { + if (launchedExchangisTaskEntity.getMetricsMap() == null || launchedExchangisTaskEntity.getMetricsMap().get("traffic") == null) { + flows += 0; + continue; + } + Map flowMap = (Map) launchedExchangisTaskEntity.getMetricsMap().get("traffic"); + flows += flowMap == null ? 0 : Integer.parseInt(flowMap.get("flow").toString()); + } + exchangisJobVo.setFlow(taskNum == 0 ? 0 : (long) (flows / taskNum)); + } + jobList.add(exchangisJobVo); + } + } catch (Exception e) { + LOG.error("Exception happened while get JobLists mapping to Vo(获取job列表映射至页面是出错,请校验任务信息), " + "message: " + e.getMessage(), e); + } + } + return jobList; + } + + @Override + public int count(String jobExecutionId, String jobName, String status, Long launchStartTime, Long launchEndTime, HttpServletRequest request) { + Date startTime = launchStartTime == null ? null : new Date(launchStartTime); + Date endTime = launchEndTime == null ? null : new Date(launchEndTime); + + return launchedJobDao.count(jobExecutionId, jobName, status, startTime, endTime, SecurityFilter.getLoginUsername(request)); + } + + @Override + public String executeJob(ExchangisJobInfo jobInfo, String execUser) throws ExchangisJobServerException { + // Build generator scheduler task + GenerationSchedulerTask schedulerTask = null; + try { + schedulerTask = new GenerationSchedulerTask(taskGenerator, jobInfo); + } catch (ExchangisTaskGenerateException e) { + throw new ExchangisJobServerException(JOB_EXCEPTION_CODE.getCode(), "Exception in initial the launchable job", e); + } + // The scheduler task id is execution id + String jobExecutionId = schedulerTask.getId(); + // Use exec user as tenancy + schedulerTask.setTenancy(execUser); + LOG.info("Submit the generation scheduler task: [{}] for job: [{}], tenancy: [{}] to TaskExecution", jobExecutionId, jobInfo.getId(), execUser); + try { + taskExecution.submit(schedulerTask); + } catch (ExchangisSchedulerException e) { + throw new ExchangisJobServerException(JOB_EXCEPTION_CODE.getCode(), "Exception in submitting to taskExecution", e); + } + return jobExecutionId; + } + + /** + * Convert the log result to category log + * @param logResult log result + * @param status status + * @return category log + */ + private ExchangisCategoryLogVo resultToCategoryLog(LogQuery logQuery, LogResult logResult, TaskStatus status){ + ExchangisCategoryLogVo categoryLogVo = new ExchangisCategoryLogVo(); + boolean noLogs = logResult.getLogs().isEmpty(); + if (Objects.nonNull(logQuery.getLastRows())){ + logResult.setEnd(true); + }else if (noLogs){ +// logResult.getLogs().add("<>"); + if (TaskStatus.isCompleted(status)){ + logResult.setEnd(true); +// categoryLogVo.setIsEnd(true); + } + } + categoryLogVo.newCategory("error", log -> log.contains("ERROR") || noLogs); + categoryLogVo.newCategory("warn", log -> log.contains("WARN") || noLogs); + categoryLogVo.newCategory("info", log -> log.contains("INFO") || noLogs); + categoryLogVo.processLogResult(logResult, false); + if (!noLogs) { + categoryLogVo.getLogs().put("all", StringUtils.join(logResult.getLogs(), "\n")); + } + return categoryLogVo; + } + + @Transactional + @Override + public void deleteJob(String jobExecutionId) throws ExchangisJobServerException { + List taskStatusList = launchedTaskDao.getTaskStatusList(jobExecutionId); + if(taskStatusList.contains("Inited") || taskStatusList.contains("Scheduled") || taskStatusList.contains("Running") || taskStatusList.contains("WaitForRetry")){ + throw new ExchangisJobServerException(JOB_EXCEPTION_CODE.getCode(), "不能删除该作业"); + }else { + launchedTaskDao.deleteTask(jobExecutionId); + launchedJobDao.deleteJob(jobExecutionId); + } + } + + @Override + public List allTaskStatus(String jobExecutionId) throws ExchangisJobServerException { + List taskStatusList = launchedTaskDao.getTaskStatusList(jobExecutionId); + return taskStatusList; + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultJobInfoService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultJobInfoService.java new file mode 100644 index 000000000..2072eb094 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultJobInfoService.java @@ -0,0 +1,451 @@ +package com.webank.wedatasphere.exchangis.job.server.service.impl; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.webank.wedatasphere.exchangis.common.pager.PageResult; +import com.webank.wedatasphere.exchangis.dao.domain.ExchangisJobDsBind; +import com.webank.wedatasphere.exchangis.datasource.core.exception.ExchangisDataSourceException; +import com.webank.wedatasphere.exchangis.datasource.core.ui.viewer.ExchangisDataSourceUIViewer; +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import com.webank.wedatasphere.exchangis.datasource.core.vo.ExchangisJobInfoContent; +import com.webank.wedatasphere.exchangis.datasource.service.ExchangisDataSourceService; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobEntity; +import com.webank.wedatasphere.exchangis.job.server.dto.ExportedProject; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisJobServerException; +import com.webank.wedatasphere.exchangis.job.server.mapper.ExchangisJobEntityDao; +import com.webank.wedatasphere.exchangis.job.server.restful.external.ModuleEnum; +import com.webank.wedatasphere.exchangis.job.server.service.JobInfoService; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobQueryVo; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobVo; +import com.webank.wedatasphere.exchangis.project.server.service.ProjectService; +import com.webank.wedatasphere.exchangis.project.server.vo.ExchangisProjectInfo; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.bml.client.BmlClient; +import org.apache.linkis.bml.client.BmlClientFactory; +import org.apache.linkis.bml.protocol.BmlUploadResponse; +import org.apache.linkis.common.utils.JsonUtils; +import org.apache.linkis.manager.label.utils.LabelUtils; +import org.apache.linkis.server.BDPJettyServerHelper; +import org.apache.linkis.server.Message; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.io.ByteArrayInputStream; +import java.nio.charset.StandardCharsets; +import java.rmi.ServerException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * Default implement + */ +@Service +public class DefaultJobInfoService implements JobInfoService { + + private static final Logger LOG = LoggerFactory.getLogger(DefaultJobInfoService.class); + + /** + * Project service + */ + @Resource + private ProjectService projectService; + + @Autowired + private ExchangisJobDsBindServiceImpl exchangisJobDsBindService; + + @Autowired + private ExchangisDataSourceService exchangisDataSourceService; + + @Resource + private ExchangisJobEntityDao jobEntityDao; + + @Resource + private JobInfoService jobInfoService; + + @Override + @Transactional(rollbackFor = Exception.class) + public ExchangisJobVo createJob(ExchangisJobVo jobVo) { + // Define the entity + /*ExchangisJobEntity jobEntity = new ExchangisJobEntity(); + jobEntity.setProjectId(jobVo.getProjectId()); + jobEntity.setJobType(jobVo.getJobType()); + jobEntity.setEngineType(jobVo.getEngineType()); + jobEntity.setJobLabels(jobVo.getJobLabels()); + jobEntity.setName(jobVo.getJobName()); + jobEntity.setJobDesc(jobVo.getJobDesc()); + jobEntity.setExecuteUser(jobVo.getExecuteUser()); + jobEntity.setJobParams(jobVo.getJobParams()); + jobEntity.setCreateUser(jobVo.getCreateUser()); + jobEntity.setCreateTime(Calendar.getInstance().getTime()); + jobEntity.setSource(Json.toJson(jobVo.getSource(), null)); + jobEntityDao.addJobEntity(jobEntity); + jobVo.setId(jobEntity.getId()); + jobVo.setCreateTime(jobEntity.getCreateTime()); + return jobVo;*/ + LOG.info("00005Sqoop job labels is: {}", jobVo.getJobLabels()); + ExchangisJobEntity jobEntity = new ExchangisJobEntity(); + jobEntity.setProjectId(jobVo.getProjectId()); + jobEntity.setJobType(jobVo.getJobType()); + jobEntity.setEngineType(jobVo.getEngineType()); + jobEntity.setJobLabel(jobVo.getJobLabels()); + jobEntity.setJobLabels(jobVo.getJobLabels()); + jobEntity.setName(jobVo.getJobName()); + jobEntity.setJobDesc(jobVo.getJobDesc()); + jobEntity.setExecuteUser(jobVo.getProxyUser()); + jobEntity.setJobParams(jobVo.getJobParams()); + jobEntity.setCreateUser(jobVo.getCreateUser()); + jobEntity.setCreateTime(Calendar.getInstance().getTime()); + jobEntity.setSource(Json.toJson(jobVo.getSource(), null)); + //jobEntity.setJobContent(jobVo.getContent()); + jobEntity.setModifyUser(jobVo.getModifyUser()); + LOG.info("Sqoop job Entity labels is: {}", jobEntity.getJobLabel()); + //Map contentVo = BDPJettyServerHelper.gson().fromJson(jobVo.getContent(), Map.class); + LOG.info("Sqoop job content is: {}, Modify user is: {}, jobType is: {}", jobVo.getContent(), jobEntity.getExecuteUser(), jobEntity.getJobType()); + if(jobVo.getContent() != null) { + jobEntity.setJobContent(jobVo.getContent()); + LOG.info("Sqoop job content is: {}, executor: {}", jobEntity.getJobContent(), jobEntity.getExecuteUser()); + } + jobEntityDao.addJobEntity(jobEntity); + jobVo.setId(jobEntity.getId()); + jobVo.setCreateTime(jobEntity.getCreateTime()); + return jobVo; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public ExchangisJobVo updateJob(ExchangisJobVo jobVo) { + ExchangisJobEntity jobEntity = new ExchangisJobEntity(); + jobEntity.setId(jobVo.getId()); + jobEntity.setJobType(jobVo.getJobType()); + jobEntity.setEngineType(jobVo.getEngineType()); + jobEntity.setJobLabel(jobVo.getJobLabels()); + jobEntity.setName(jobVo.getJobName()); + jobEntity.setJobLabels(jobVo.getJobLabels()); + jobEntity.setJobDesc(jobVo.getJobDesc()); + jobEntity.setLastUpdateTime(Calendar.getInstance().getTime()); + jobEntity.setModifyUser(jobVo.getModifyUser()); + jobEntityDao.upgradeBasicInfo(jobEntity); + return jobVo; + } + + @Override + public PageResult queryJobList(ExchangisJobQueryVo queryVo){ + PageHelper.startPage(queryVo.getPage(), queryVo.getPageSize()); + try{ + List jobEntities = this.jobEntityDao.queryPageList(queryVo); + PageInfo pageInfo = new PageInfo<>(jobEntities); + List infoList = jobEntities + .stream().map(ExchangisJobVo::new).collect(Collectors.toList()); + PageResult pageResult = new PageResult<>(); + pageResult.setList(infoList); + pageResult.setTotal(pageInfo.getTotal()); + return pageResult; + }finally { + PageHelper.clearPage(); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteJob(Long id) { + this.jobEntityDao.deleteJobEntity(id); + this.exchangisJobDsBindService.updateJobDsBind(id, new ArrayList<>()); + } + + @Override + public ExchangisJobVo getJob(Long id, boolean basic) { + ExchangisJobEntity exchangisJob = basic ? this.jobEntityDao.getBasicInfo(id) : this.jobEntityDao.getDetail(id); + ExchangisJobVo jobVo = new ExchangisJobVo(exchangisJob); + jobVo.setProjectId(exchangisJob.getProjectId()); + if (exchangisJob != null && StringUtils.isNotBlank(exchangisJob.getJobContent())) { + jobVo.setContent(exchangisJob.getJobContent()); + jobVo.setSource(Objects.nonNull(exchangisJob.getSource())? + Json.fromJson(exchangisJob.getSource(), Map.class, String.class, Object.class) : new HashMap<>()); + } + return jobVo; + } + + @Override + public List getByNameWithProjectId(String jobName, Long projectId) { + List exchangisJobs = this.jobEntityDao.getByNameWithProjectId(jobName, projectId); + List exchangisJobVos = new ArrayList<>(); + for(ExchangisJobEntity exchangisJob : exchangisJobs){ + ExchangisJobVo jobVo = new ExchangisJobVo(exchangisJob); + if (exchangisJob != null && StringUtils.isNotBlank(exchangisJob.getJobContent())) { + jobVo.setContent(exchangisJob.getJobContent()); + jobVo.setSource(Objects.nonNull(exchangisJob.getSource())? + Json.fromJson(exchangisJob.getSource(), Map.class, String.class, Object.class) : new HashMap<>()); + } + exchangisJobVos.add(jobVo); + } + + return exchangisJobVos; + } + @Override + public ExchangisJobVo getDecoratedJob(HttpServletRequest request, Long id) throws ExchangisJobServerException { + ExchangisJobEntity exchangisJob = this.jobEntityDao.getDetail(id); + ExchangisJobVo jobVo = new ExchangisJobVo(exchangisJob); + if (exchangisJob != null && StringUtils.isNotBlank(exchangisJob.getJobContent())) { + // Rebuild the job content with ui configuration + List jobDataSourceUIs = exchangisDataSourceService.getJobDataSourceUIs(request, id); + ObjectMapper objectMapper = JsonUtils.jackson(); + try { + String content = objectMapper.writeValueAsString(jobDataSourceUIs); + JsonNode contentJsonNode = objectMapper.readTree(content); + ObjectNode objectNode = objectMapper.createObjectNode(); + objectNode.set("subJobs", contentJsonNode); + jobVo.setContent(objectNode.toString()); + jobVo.setSource(Objects.nonNull(exchangisJob.getSource())? + Json.fromJson(exchangisJob.getSource(), Map.class, String.class, Object.class) : new HashMap<>()); + } catch (JsonProcessingException e) { + throw new ExchangisJobServerException(31100, + "Fail to rebuild the job content with ui (渲染任务内容失败)", e); + } + } + return jobVo; + } + + @Override + public List getSubJobList(HttpServletRequest request, Long projectId) throws ExchangisJobServerException{ + List exchangisJobList = this.jobEntityDao.getDetailList(projectId); + List exchangisJobVos = new ArrayList<>(); + if(!exchangisJobList.isEmpty()) { + for(ExchangisJobEntity exchangisJob : exchangisJobList){ + ExchangisJobVo jobVo = new ExchangisJobVo(exchangisJob); + if(StringUtils.isNotBlank(exchangisJob.getJobContent())){ + List jobDataSourceUIs = exchangisDataSourceService.getJobDataSourceUIs(request, exchangisJob.getId()); + ObjectMapper objectMapper = JsonUtils.jackson(); + try { + String content = objectMapper.writeValueAsString(jobDataSourceUIs); + JsonNode contentJsonNode = objectMapper.readTree(content); + ObjectNode objectNode = objectMapper.createObjectNode(); + objectNode.set("subJobs", contentJsonNode); + jobVo.setContent(objectNode.toString()); + jobVo.setSource(Objects.nonNull(exchangisJob.getSource())? + Json.fromJson(exchangisJob.getSource(), Map.class, String.class, Object.class) : new HashMap<>()); + } catch (JsonProcessingException e) { + throw new ExchangisJobServerException(31100, + "Fail to rebuild the job content with ui (渲染任务内容失败)", e); + } + } + exchangisJobVos.add(jobVo); + } + } + return exchangisJobVos; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public ExchangisJobVo updateJobConfig(ExchangisJobVo jobVo) { + ExchangisJobEntity jobEntity = this.jobEntityDao.getBasicInfo(jobVo.getId()); + Map sourceMap = StringUtils.isNotBlank(jobEntity.getSource())? + Json.fromJson(jobEntity.getSource(), Map.class, String.class, Object.class) : null; + jobEntity.setExecuteUser(jobVo.getProxyUser()); + jobEntity.setJobParams(jobVo.getJobParams()); + if (Objects.isNull(sourceMap)){ + sourceMap = new HashMap<>(); + } + sourceMap.putAll(jobVo.getSource()); + jobEntity.setSource(Json.toJson(sourceMap, null)); + jobEntity.setModifyUser(jobVo.getModifyUser()); + jobEntity.setLastUpdateTime(Calendar.getInstance().getTime()); + this.jobEntityDao.upgradeConfig(jobEntity); + return jobVo; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public ExchangisJobVo updateJobContent(ExchangisJobVo jobVo) throws ExchangisJobServerException, ExchangisDataSourceException { + Long jobId = jobVo.getId(); + ExchangisJobEntity exchangisJob = this.jobEntityDao.getDetail(jobId); + exchangisJob.setJobContent(jobVo.getContent()); + final String engine = exchangisJob.getEngineType(); + // 校验是否有重复子任务名 + List content = LabelUtils.Jackson.fromJson(exchangisJob.getJobContent(), + List.class, ExchangisJobInfoContent.class); + long count = content.stream().map(ExchangisJobInfoContent::getSubJobName).distinct().count(); + if (count < content.size()) { + throw new ExchangisJobServerException(31101, "Already exits duplicated job name(存在重复子任务名)"); + } + List dsBinds = new ArrayList<>(content.size()); + // 校验引擎是否支持该数据通道 + for (int i = 0; i < content.size(); i++) { + ExchangisJobInfoContent task = content.get(i); + String sourceType = task.getDataSources().getSourceId().split("\\.")[0]; + String sinkType = task.getDataSources().getSinkId().split("\\.")[0]; + this.exchangisDataSourceService.checkDSSupportDegree(engine, sourceType, sinkType); + ExchangisJobDsBind dsBind = new ExchangisJobDsBind(); + dsBind.setJobId(jobVo.getId()); + dsBind.setTaskIndex(i); + dsBind.setSourceDsId(Long.parseLong(task.getDataSources().getSourceId().split("\\.")[1])); + dsBind.setSinkDsId(Long.parseLong(task.getDataSources().getSinkId().split("\\.")[1])); + dsBinds.add(dsBind); + } + exchangisJob.setModifyUser(jobVo.getModifyUser()); + exchangisJob.setLastUpdateTime(jobVo.getModifyTime()); + this.exchangisJobDsBindService.updateJobDsBind(jobId, dsBinds); + this.jobEntityDao.upgradeContent(exchangisJob); + return jobVo; + } + + @Override + public Message exportProject(Map params, String userName, HttpServletRequest request) throws ExchangisJobServerException, ServerException { + ExportedProject exportedProject = null; + Long projectId = Long.parseLong(params.get("projectId").toString()); + Boolean partial = (Boolean) params.get("partial"); + Map> moduleIdsMap = getModuleIdsMap(params); + + LOG.info("export project, user: {}, project: {}, partial:{}", userName, projectId, partial); + exportedProject = export(projectId, moduleIdsMap, partial, request); + String exported = null; + try { + exported = BDPJettyServerHelper.jacksonJson().writeValueAsString(exportedProject); + } catch (JsonProcessingException e) { + LOG.error("Occur error while tranform class", e.getMessage()); + } + + LOG.info("projectName: {}, exported:{}", exportedProject.getName(), exported); + BmlClient bmlClient = BmlClientFactory.createBmlClient(userName); + BmlUploadResponse bmlUploadResponse = bmlClient.uploadShareResource(userName, exportedProject.getName(), + "exchangis_exported_" + UUID.randomUUID(), new ByteArrayInputStream(exported.getBytes(StandardCharsets.UTF_8))); + + if (bmlUploadResponse == null || !bmlUploadResponse.isSuccess()) { + throw new ServerException("cannot upload exported data to BML"); + } + + LOG.info("{} is exporting the project, uploaded to BML the resourceID is {} and the version is {}", + userName, bmlUploadResponse.resourceId(), bmlUploadResponse.version()); + + Message message = Message.ok("export job") + .data("resourceId", bmlUploadResponse.resourceId()) + .data("version", bmlUploadResponse.version()); + return message; + } + + @Override + public ExportedProject export(Long projectId, Map> moduleIdsMap, boolean partial, HttpServletRequest request) throws ExchangisJobServerException { + ExportedProject exportedProject = new ExportedProject(); + ExchangisProjectInfo project = projectService.getProjectDetailById(projectId); + + LOG.info("execute export method! export project is {}.", project.getName()); + exportedProject.setName(project.getName()); + + setSqoop(projectId, moduleIdsMap, partial, exportedProject, request); + + setDatax(projectId, moduleIdsMap, partial, exportedProject, request); + + return exportedProject; + } + + private void setSqoop(Long projectId, Map> moduleIdsMap, boolean partial, ExportedProject exportedProject, HttpServletRequest request) throws ExchangisJobServerException { + List sqoops = new ArrayList<>(); + LOG.info("Request: {}", request); + if (partial) { + Set longs = moduleIdsMap.get(ModuleEnum.SQOOP_IDS.getName()); + if (longs.size() > 0) { + for (Long id : longs) { + LOG.info("id: {}", id); + ExchangisJobVo job = jobInfoService.getJob(id, false); + + String sqoopStr = null; + try { + sqoopStr = BDPJettyServerHelper.jacksonJson().writeValueAsString(job); + } catch (JsonProcessingException e) { + LOG.error("Occur error while tranform class", e.getMessage()); + } + + LOG.info("sqoopStr99999:{}", sqoopStr); + LOG.info("ExchangisJobVo sqoop: {}", job.getContent()); + LOG.info("getCreateTime: {}", job.getId()); + LOG.info("executorUser999: {}", job.getExecuteUser()); + sqoops.add(job); + } + exportedProject.setSqoops(sqoops); + } + + } else { + LOG.info("Through request {} and projectId {} get Sqoopjob", request, projectId); + sqoops = jobInfoService.getSubJobList(request, projectId); + exportedProject.setSqoops(sqoops); + //exportedProject.setSqoops(jobInfoService.getByProject(request, projectId)); + } + LOG.info("exporting project, export sqoopJob: {}", exportedProject); + } + + private void setDatax(Long projectId, Map> moduleIdsMap, boolean partial, ExportedProject exportedProject, HttpServletRequest request) throws ExchangisJobServerException { + List datax = new ArrayList<>(); + if (partial) { + Set longs = moduleIdsMap.get(ModuleEnum.DATAX_IDS.getName()); + if (longs.size() > 0) { + for (Long id : longs) { + ExchangisJobVo job = jobInfoService.getDecoratedJob(request, id); + datax.add(job); + } + exportedProject.setDataxes(datax); + } + + } else { + LOG.info("Through request {} and projectId {} get datax", request, projectId); + datax = jobInfoService.getSubJobList(request, projectId); + exportedProject.setSqoops(datax); + //exportedProject.setDataxes(jobInfoService.getByProject(request, projectId)); + } + LOG.info("exporting project, export datax: {}", exportedProject); + } + + /** + * 获取需要导出对象集合 + * + * @param params + * @return + */ + @Override + public Map> getModuleIdsMap(Map params) { + + Map> map = Maps.newHashMap(); + String sqoopIdsStr = null; + if(params.get("sqoopIds") != null) { + sqoopIdsStr = params.get("sqoopIds").toString(); + } + String dataxIdsStr = null; + if(params.get("dataxIds") != null) { + dataxIdsStr = params.get("dataxIds").toString(); + } + + Set sqoopIds = Sets.newHashSet(); + Set dataxIds = Sets.newHashSet(); + + if (StringUtils.isNotEmpty(sqoopIdsStr)) { + sqoopIds = Arrays.stream(StringUtils.split(sqoopIdsStr, ",")) + .map(Long::parseLong).collect(Collectors.toSet()); + } + if (StringUtils.isNotEmpty(dataxIdsStr)) { + dataxIds = Arrays.stream(StringUtils.split(dataxIdsStr, ",")) + .map(Long::parseLong).collect(Collectors.toSet()); + } + map.put("sqoopIds", sqoopIds); + map.put("dataxIds", dataxIds); + LOG.info("The objects to be exported are: {}", map); + return map; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public ExchangisJobVo copyJob(ExchangisJobVo jobVo) { + ExchangisJobVo job = jobInfoService.getJob(jobVo.getId(), false); + ExchangisJobVo newJob = jobInfoService.createJob(job); + return newJob; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultTaskExecuteService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultTaskExecuteService.java new file mode 100644 index 000000000..d32248478 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultTaskExecuteService.java @@ -0,0 +1,165 @@ +package com.webank.wedatasphere.exchangis.job.server.service.impl; + +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisOnEventException; +import com.webank.wedatasphere.exchangis.job.launcher.exception.ExchangisTaskLaunchException; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; +import com.webank.wedatasphere.exchangis.job.launcher.entity.LaunchedExchangisJobEntity; +import com.webank.wedatasphere.exchangis.job.server.mapper.LaunchedJobDao; +import com.webank.wedatasphere.exchangis.job.server.mapper.LaunchedTaskDao; +import com.webank.wedatasphere.exchangis.job.server.execution.events.*; +import com.webank.wedatasphere.exchangis.job.server.log.cache.JobLogCacheUtils; +import com.webank.wedatasphere.exchangis.job.server.service.TaskExecuteService; +import com.webank.wedatasphere.exchangis.job.server.utils.SpringContextHolder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Objects; + +@Service +public class DefaultTaskExecuteService implements TaskExecuteService { + + private static final Logger LOG = LoggerFactory.getLogger(DefaultTaskExecuteService.class); + @Resource + private LaunchedTaskDao launchedTaskDao; + + @Resource + private LaunchedJobDao launchedJobDao; + + private TaskExecuteService selfService; + + @Override + public void onMetricsUpdate(TaskMetricsUpdateEvent metricsUpdateEvent) { + LaunchedExchangisTask task = metricsUpdateEvent.getLaunchedExchangisTask(); + task.setLastUpdateTime(Calendar.getInstance().getTime()); + launchedTaskDao.upgradeLaunchedTaskMetrics(task.getTaskId(), Json.toJson(metricsUpdateEvent.getMetrics(), null), + task.getLastUpdateTime()); + } + + @Override + public void onStatusUpdate(TaskStatusUpdateEvent statusUpdateEvent) throws ExchangisOnEventException { + LaunchedExchangisTask task = statusUpdateEvent.getLaunchedExchangisTask(); + TaskStatus status = statusUpdateEvent.getUpdateStatus(); + LaunchedExchangisJobEntity launchedJob = null; + if (!TaskStatus.isCompleted(status)){ + launchedJob = launchedJobDao.searchLaunchedJob(task.getJobExecutionId()); + TaskStatus jobStatus = launchedJob.getStatus(); + if (TaskStatus.isCompleted(jobStatus) && Objects.nonNull(task.getLauncherTask())){ + // Kill the remote task + try { + task.getLauncherTask().kill(); + } catch (ExchangisTaskLaunchException e) { + throw new ExchangisOnEventException("Kill linkis_id: [" + task.getLinkisJobId() + "] fail", e); + } + }else if (jobStatus == TaskStatus.Scheduled || jobStatus == TaskStatus.Inited){ + launchedJobDao.upgradeLaunchedJobStatusInVersion(launchedJob.getJobExecutionId(), TaskStatus.Running.name(), 0, launchedJob.getLastUpdateTime()); + } + } + // Have different status, then update + if (!task.getStatus().equals(status)){ + launchedJob = Objects.isNull(launchedJob) ? + launchedJobDao.searchLaunchedJob(task.getJobExecutionId()) : launchedJob; + getSelfService().updateTaskStatus(task, status, !TaskStatus.isCompleted(launchedJob.getStatus())); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void onLaunch(TaskLaunchEvent taskLaunchEvent) { + LaunchedExchangisTask task = taskLaunchEvent.getLaunchedExchangisTask(); + task.setLastUpdateTime(Calendar.getInstance().getTime()); + this.launchedTaskDao.updateLaunchInfo(task); + // Well, search the job info + LaunchedExchangisJobEntity launchedJob = launchedJobDao.searchLaunchedJob(task.getJobExecutionId()); + TaskStatus jobStatus = launchedJob.getStatus(); + if (jobStatus == TaskStatus.Scheduled || jobStatus == TaskStatus.Inited) { + // Update the job status also, status change to Running + this.launchedJobDao.upgradeLaunchedJobStatusInVersion(task.getJobExecutionId(), + TaskStatus.Running.name(), 0, launchedJob.getLastUpdateTime()); + } + JobLogCacheUtils.flush(task.getJobExecutionId(), false); + } + + @Override + public void onDelete(TaskDeleteEvent deleteEvent) { + this.launchedTaskDao.deleteLaunchedTask(deleteEvent.getTaskId()); + } + + @Override + public void onProgressUpdate(TaskProgressUpdateEvent updateEvent) throws ExchangisOnEventException { + LaunchedExchangisTask task = updateEvent.getLaunchedExchangisTask(); + if (task.getProgress() != updateEvent.getProgressInfo().getProgress()) { + getSelfService().updateTaskProgress(task, updateEvent.getProgressInfo().getProgress()); + } + } + + /** + * First to update task status, then update the job + * @param task task + * @param status status + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void updateTaskStatus(LaunchedExchangisTask task, TaskStatus status, boolean updateJob) throws ExchangisOnEventException { + JobLogCacheUtils.flush(task.getJobExecutionId(), false); + task.setLastUpdateTime(Calendar.getInstance().getTime()); + launchedTaskDao.upgradeLaunchedTaskStatus(task.getTaskId(), status.name(), task.getLastUpdateTime()); + if (updateJob) { + if (status == TaskStatus.Failed || status == TaskStatus.Cancelled) { + // Update directly, no open another transaction + launchedJobDao.upgradeLaunchedJobStatus(task.getJobExecutionId(), status.name(), task.getLastUpdateTime()); + } else if (status == TaskStatus.Success) { + getSelfService().updateJobStatus(task.getJobExecutionId(), TaskStatus.Success, task.getLastUpdateTime()); + } + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateTaskProgress(LaunchedExchangisTask task, float progress) throws ExchangisOnEventException { + task.setLastUpdateTime(Calendar.getInstance().getTime()); + this.launchedTaskDao.upgradeLaunchedTaskProgress(task.getTaskId(), progress, task.getLastUpdateTime()); + getSelfService().updateJobProgress(task.getJobExecutionId(), task.getLastUpdateTime()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateJobProgress(String jobExecutionId, Date updateTime) { + // Sum all the task's progress + float totalTaskProgress = this.launchedTaskDao.sumProgressByJobExecutionId(jobExecutionId); + if (totalTaskProgress > 0){ + this.launchedJobDao.upgradeLaunchedJobProgress(jobExecutionId, totalTaskProgress, updateTime); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateJobStatus(String jobExecutionId, TaskStatus status, Date updateTime) { + List statusList = launchedTaskDao.selectTaskStatusByJobExecutionId(jobExecutionId); + if (statusList.stream().allMatch(taskStatus -> taskStatus.equalsIgnoreCase(TaskStatus.Success.name()))){ + launchedJobDao.upgradeLaunchedJobStatusInVersion(jobExecutionId, + TaskStatus.Success.name(), statusList.size(), updateTime); + } + } + + /** + * Get the self service + * @return service + */ + private TaskExecuteService getSelfService() throws ExchangisOnEventException { + if (Objects.isNull(selfService)){ + this.selfService = SpringContextHolder.getBean(TaskExecuteService.class); + if (Objects.isNull(this.selfService)){ + throw new ExchangisOnEventException("TaskExecuteService cannot be found in spring context", null); + } + } + return this.selfService; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultTaskGenerateService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultTaskGenerateService.java new file mode 100644 index 000000000..f4a6aa44d --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultTaskGenerateService.java @@ -0,0 +1,72 @@ +package com.webank.wedatasphere.exchangis.job.server.service.impl; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisJob; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; +import com.webank.wedatasphere.exchangis.job.launcher.entity.LaunchedExchangisJobEntity; +import com.webank.wedatasphere.exchangis.job.server.mapper.LaunchableTaskDao; +import com.webank.wedatasphere.exchangis.job.server.mapper.LaunchedJobDao; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.events.TaskGenerateErrorEvent; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.events.TaskGenerateInitEvent; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.events.TaskGenerateSuccessEvent; +import com.webank.wedatasphere.exchangis.job.server.execution.subscriber.NewInTaskObserver; +import com.webank.wedatasphere.exchangis.job.server.log.cache.JobLogCacheUtils; +import com.webank.wedatasphere.exchangis.job.server.service.TaskGenerateService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Calendar; +import java.util.List; + +/** + * Task generate service + */ +@Service +public class DefaultTaskGenerateService implements TaskGenerateService { + @Resource + private LaunchedJobDao launchedJobDao; + + @Resource + private LaunchableTaskDao launchableTaskDao; + + @Resource + private NewInTaskObserver newInTaskObserver; + @Override + public void onError(TaskGenerateErrorEvent errorEvent) { + JobLogCacheUtils.flush(errorEvent.getLaunchableExchangisJob().getJobExecutionId(), true); + this.launchedJobDao.upgradeLaunchedJobStatus(errorEvent.getLaunchableExchangisJob().getJobExecutionId() + , TaskStatus.Failed.name(), Calendar.getInstance().getTime()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void onInit(TaskGenerateInitEvent initEvent) { + LaunchableExchangisJob job = initEvent.getLaunchableExchangisJob(); + LaunchedExchangisJobEntity launchedJob = new LaunchedExchangisJobEntity(job); + launchedJobDao.insertLaunchedJob(launchedJob); + JobLogCacheUtils.flush(job.getJobExecutionId(), false); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void onSuccess(TaskGenerateSuccessEvent successEvent) { + LaunchableExchangisJob launchableExchangisJob = successEvent.getLaunchableExchangisJob(); + List tasks = successEvent.getTaskGenerated(); + Calendar calendar = Calendar.getInstance(); + tasks.forEach( task -> { + task.setJobExecutionId(launchableExchangisJob.getJobExecutionId()); + task.setCreateTime(calendar.getTime()); + task.setLastUpdateTime(task.getCreateTime()); + }); + this.launchableTaskDao.addLaunchableTask(tasks); + LaunchedExchangisJobEntity launchedJob = new LaunchedExchangisJobEntity(launchableExchangisJob); + launchedJob.setStatus(TaskStatus.Scheduled); + launchedJob.setLaunchableTaskNum(tasks.size()); + launchedJob.setLastUpdateTime(calendar.getTime()); + this.launchedJobDao.updateLaunchInfo(launchedJob); + // Offer to the observer + tasks.forEach(task -> this.newInTaskObserver.getCacheQueue().offer(task)); + JobLogCacheUtils.flush(launchableExchangisJob.getJobExecutionId(), false); + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultTaskObserverService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultTaskObserverService.java new file mode 100644 index 000000000..6c9a8b60e --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultTaskObserverService.java @@ -0,0 +1,41 @@ +package com.webank.wedatasphere.exchangis.job.server.service.impl; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.entity.LaunchedExchangisTaskEntity; +import com.webank.wedatasphere.exchangis.job.server.mapper.LaunchableTaskDao; +import com.webank.wedatasphere.exchangis.job.server.mapper.LaunchedTaskDao; +import com.webank.wedatasphere.exchangis.job.server.service.TaskObserverService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; + +/** + * Task observer service + */ +@Service +public class DefaultTaskObserverService implements TaskObserverService { + + /** + * Launchable task + */ + @Resource + private LaunchableTaskDao launchableTaskDao; + + @Resource + private LaunchedTaskDao launchedTaskDao; + + @Override + public List onPublishLaunchableTask(int limitSize) { + return launchableTaskDao.getTaskToLaunch(limitSize); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean subscribe(LaunchableExchangisTask task) { + LaunchedExchangisTaskEntity taskEntity = new LaunchedExchangisTaskEntity(task); + int result = this.launchedTaskDao.insertLaunchedTaskOrUpdate(taskEntity); + return result <= 1; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/ExchangisJobDsBindServiceImpl.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/ExchangisJobDsBindServiceImpl.java new file mode 100644 index 000000000..d55be86f8 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/ExchangisJobDsBindServiceImpl.java @@ -0,0 +1,39 @@ +package com.webank.wedatasphere.exchangis.job.server.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.webank.wedatasphere.exchangis.dao.domain.ExchangisJobDsBind; +import com.webank.wedatasphere.exchangis.dao.mapper.ExchangisJobDsBindMapper; +import com.webank.wedatasphere.exchangis.job.server.service.ExchangisJobDsBindService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Optional; + +@Service +public class ExchangisJobDsBindServiceImpl implements ExchangisJobDsBindService { + + @Autowired + private ExchangisJobDsBindMapper dsBindMapper; + + @Override + public void updateJobDsBind(Long jobId, List dsBinds) { + + QueryWrapper deleteCondition = new QueryWrapper<>(); + deleteCondition.eq("job_id", jobId); + this.dsBindMapper.delete(deleteCondition); + + for (ExchangisJobDsBind dsBind : dsBinds) { + this.dsBindMapper.insert(dsBind); + } + + } + + @Override + public boolean inUse(Long datasourceId) { + QueryWrapper condition = new QueryWrapper<>(); + condition.eq("source_ds_id", datasourceId).or().eq("sink_ds_id", datasourceId); + Integer count = Optional.ofNullable(this.dsBindMapper.selectCount(condition)).orElse(0); + return count > 0; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/ExchangisMetricsServiceImpl.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/ExchangisMetricsServiceImpl.java new file mode 100644 index 000000000..a29c9bc71 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/ExchangisMetricsServiceImpl.java @@ -0,0 +1,348 @@ +package com.webank.wedatasphere.exchangis.job.server.service.impl; + +import com.webank.wedatasphere.exchangis.job.server.dto.ExchangisEngineResourceMetricsDTO; +import com.webank.wedatasphere.exchangis.job.server.dto.ExchangisTaskProcessMetricsDTO; +import com.webank.wedatasphere.exchangis.job.server.dto.ExchangisTaskStatusMetricsDTO; +import com.webank.wedatasphere.exchangis.job.server.mapper.ExchangisLaunchTaskMapper; +import com.webank.wedatasphere.exchangis.job.server.service.ExchangisMetricsService; +import org.apache.linkis.server.Message; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletRequest; +import java.text.SimpleDateFormat; +import java.util.*; + +@Service +public class ExchangisMetricsServiceImpl implements ExchangisMetricsService { + + + private final ExchangisLaunchTaskMapper exchangisLaunchTaskMapper; + + @Autowired + public ExchangisMetricsServiceImpl(ExchangisLaunchTaskMapper exchangisLaunchTaskMapper) { + this.exchangisLaunchTaskMapper = exchangisLaunchTaskMapper; + } + + @Override + public Message getTaskStateMetrics(HttpServletRequest request) { + List metrices = new ArrayList<>(); + // TODO hard code + ExchangisTaskStatusMetricsDTO success = exchangisLaunchTaskMapper.getTaskMetricsByStatus("SUCCESS"); + ExchangisTaskStatusMetricsDTO failed = exchangisLaunchTaskMapper.getTaskMetricsByStatus("FAILED"); + ExchangisTaskStatusMetricsDTO running = exchangisLaunchTaskMapper.getTaskMetricsByStatus("RUNNING"); + ExchangisTaskStatusMetricsDTO busy = exchangisLaunchTaskMapper.getTaskMetricsByStatus("BUSY"); + ExchangisTaskStatusMetricsDTO idle = exchangisLaunchTaskMapper.getTaskMetricsByStatus("IDLE"); + ExchangisTaskStatusMetricsDTO unlock = exchangisLaunchTaskMapper.getTaskMetricsByStatus("UNLOCK"); + + Optional.ofNullable(success).ifPresent(metrices::add); + Optional.ofNullable(failed).ifPresent(metrices::add); + Optional.ofNullable(running).ifPresent(metrices::add); + Optional.ofNullable(busy).ifPresent(metrices::add); + Optional.ofNullable(idle).ifPresent(metrices::add); + Optional.ofNullable(unlock).ifPresent(metrices::add); + + Message message = Message.ok(); + message.setMethod("/dss/exchangis/main/metrics/taskstate"); + message.data("metrices", metrices); + return message; + } + + @Override + public Message getTaskProcessMetrics(HttpServletRequest request) { + // TODO mock data for process metrics + List list = new ArrayList<>(); + + // total + ExchangisTaskProcessMetricsDTO total = new ExchangisTaskProcessMetricsDTO(); + total.setKey("total"); + total.setTitle("总进度"); + total.setRunning(50); + total.setInitialized(10); + total.setTotal(120); + total.setPercentOfComplete("48%"); + list.add(total); + + // bdp + ExchangisTaskProcessMetricsDTO bdp = new ExchangisTaskProcessMetricsDTO(); + bdp.setKey("bdp"); + bdp.setTitle("BDP"); + bdp.setRunning(20); + bdp.setInitialized(10); + bdp.setTotal(60); + bdp.setPercentOfComplete("33%"); + list.add(bdp); + + // es + ExchangisTaskProcessMetricsDTO es = new ExchangisTaskProcessMetricsDTO(); + es.setKey("es"); + es.setTitle("ES"); + es.setRunning(20); + es.setInitialized(0); + es.setTotal(40); + es.setPercentOfComplete("50%"); + list.add(es); + + // fps + ExchangisTaskProcessMetricsDTO fps = new ExchangisTaskProcessMetricsDTO(); + fps.setKey("fps"); + fps.setTitle("FPS"); + fps.setRunning(10); + fps.setInitialized(0); + fps.setTotal(20); + fps.setPercentOfComplete("50%"); + list.add(fps); + + Message message = Message.ok(); + message.setMethod("/dss/exchangis/main/metrics/taskprocess"); + message.data("list", list); + return message; + } + + // mock data for echarts + + /** + * + * dataset: { + * source: [ + * ['datasource', '2021-10-25 15:00', '2021-10-25 15:01', '2021-10-25 15:02', '2021-10-25 15:03', '2021-10-25 15:04'], + * ['ds1', 41.1, 30.4, 65.1, 53.3, 44.2], + * ['ds2', 86.5, 92.1, 85.7, 83.1, 93.2], + * ['ds3', 24.1, 67.2, 79.5, 86.4, 76.2] + * ] + * }, + */ + @Override + public Message getDataSourceFlowMetrics(HttpServletRequest request) { + // TODO + // make last past 4 hours data, dimension is min + String fromDateTime = "2021-10-25 15:00"; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + Date parsedFrom; + try { + parsedFrom = sdf.parse(fromDateTime); + } catch (Exception e) { + parsedFrom = new Date(); + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(parsedFrom); + + List> dataset = new ArrayList<>(); + List header = new ArrayList<>(); + int loopNum = 4 * 60; + + // 添加第一行,头信息 +// header.add("数据源"); +// for (int i = 1; i <= loopNum; i++) { +// header.add(sdf.format(calendar.getTime())); +// calendar.add(Calendar.MINUTE, 1); +// } + header.add("时间"); + header.add("ds1"); + header.add("ds2"); + header.add("ds3"); + dataset.add(header); + + List realData; + int max = 10240; + int min = 512; + for (int i = 1; i <= loopNum; i++) { + realData = new ArrayList<>(); + realData.add(sdf.format(calendar.getTime())); + calendar.add(Calendar.MINUTE, 1); + realData.add(Math.random() * (max - min) + min); + realData.add(Math.random() * (max - min) + min); + realData.add( Math.random() * (max - min) + min); + dataset.add(realData); + } + + // 添加数据信息 +// List ds1Data = new ArrayList<>(); +// ds1Data.add("ds1"); +// +// List ds2Data = new ArrayList<>(); +// ds2Data.add("ds2"); +// +// List ds3Data = new ArrayList<>(); +// ds3Data.add("ds3"); +// for (int i = 1; i <= loopNum; i++) { +// ds1Data.add(i * RandomUtils.nextInt(1024)); +// ds2Data.add(i * RandomUtils.nextInt(512)); +// ds3Data.add(i * RandomUtils.nextInt(2048)); +// } +// dataset.add(ds1Data); +// dataset.add(ds2Data); +// dataset.add(ds3Data); + Message message = Message.ok(); + message.setMethod("/dss/exchangis/main/metrics/datasourceflow"); + message.data("dataset", dataset); + return message; + } + + @Override + public Message getEngineResourceCpuMetrics(HttpServletRequest request) { + // make last past 4 hours data, dimension is min + String fromDateTime = "2021-10-25 15:00"; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + Date parsedFrom; + try { + parsedFrom = sdf.parse(fromDateTime); + } catch (Exception e) { + parsedFrom = new Date(); + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(parsedFrom); + + List> dataset = new ArrayList<>(); + List header = new ArrayList<>(); + int loopNum = 4 * 60; + + // 添加第一行,头信息 + header.add("时间"); + header.add("datax"); + header.add("sqoop"); + header.add("linkis"); +// for (int i = 1; i <= loopNum; i++) { +// header.add(sdf.format(calendar.getTime())); +// calendar.add(Calendar.MINUTE, 1); +// } + dataset.add(header); + + // 添加数据信息 + List realData; +// ds1Data.add("datax"); + +// List ds2Data = new ArrayList<>(); +// ds2Data.add("sqoop"); +// +// List ds3Data = new ArrayList<>(); +// ds3Data.add("linkis"); + int min = 1; + int max = 8; + for (int i = 1; i <= loopNum; i++) { + realData = new ArrayList<>(); + realData.add(sdf.format(calendar.getTime())); + calendar.add(Calendar.MINUTE, 1); + realData.add(Math.random() * (max - min) + min); + realData.add(Math.random() * (max - min) + min); + realData.add( Math.random() * (max - min) + min); + dataset.add(realData); + } +// dataset.add(ds1Data); +// dataset.add(ds2Data); +// dataset.add(ds3Data); +// dataset.add(realData); + Message message = Message.ok(); + message.setMethod("/dss/exchangis/main/metrics/engineresourcecpu"); + message.data("dataset", dataset); + return message; + + + } + + @Override + public Message getEngineResourceMemMetrics(HttpServletRequest request) { + // make last past 4 hours data, dimension is min + String fromDateTime = "2021-10-25 15:00"; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + Date parsedFrom; + try { + parsedFrom = sdf.parse(fromDateTime); + } catch (Exception e) { + parsedFrom = new Date(); + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(parsedFrom); + + List> dataset = new ArrayList<>(); + List header = new ArrayList<>(); + int loopNum = 4 * 60; + + // 添加第一行,头信息 +// header.add("引擎"); +// for (int i = 1; i <= loopNum; i++) { +// header.add(sdf.format(calendar.getTime())); +// calendar.add(Calendar.MINUTE, 1); +// } +// dataset.add(header); +// +// // 添加数据信息 +// List ds1Data = new ArrayList<>(); +// ds1Data.add("datax"); +// +// List ds2Data = new ArrayList<>(); +// ds2Data.add("sqoop"); +// +// List ds3Data = new ArrayList<>(); +// ds3Data.add("linkis"); +// for (int i = 1; i <= loopNum; i++) { +// ds1Data.add(i * RandomUtils.nextInt(4192)); +// ds2Data.add(i * RandomUtils.nextInt(2048)); +// ds3Data.add(i * RandomUtils.nextInt(1024)); +// } + + // 添加第一行,头信息 + header.add("时间"); + header.add("datax"); + header.add("sqoop"); + header.add("linkis"); +// for (int i = 1; i <= loopNum; i++) { +// header.add(sdf.format(calendar.getTime())); +// calendar.add(Calendar.MINUTE, 1); +// } + dataset.add(header); + + // 添加数据信息 + List realData; + int max = 8192; + int min = 1024; + for (int i = 1; i <= loopNum; i++) { + realData = new ArrayList<>(); + realData.add(sdf.format(calendar.getTime())); + calendar.add(Calendar.MINUTE, 1); + realData.add(Math.random() * (max - min) + min); + realData.add(Math.random() * (max - min) + min); + realData.add( Math.random() * (max - min) + min); +// realData.add(i * RandomUtils.nextInt(4)); +// realData.add(i * RandomUtils.nextInt(4)); +// realData.add(i * RandomUtils.nextInt(4)); + dataset.add(realData); + } +// dataset.add(ds1Data); +// dataset.add(ds2Data); +// dataset.add(ds3Data); + Message message = Message.ok(); + message.setMethod("/dss/exchangis/main/metrics/engineresourcemem"); + message.data("dataset", dataset); + return message; + } + + @Override + public Message getEngineResourceMetrics(HttpServletRequest request) { + List list = new ArrayList<>(); + ExchangisEngineResourceMetricsDTO sqoop = new ExchangisEngineResourceMetricsDTO(); + sqoop.setEngine("sqoop"); + sqoop.setCpu("45%"); + sqoop.setMem("1782Mi"); + list.add(sqoop); + + ExchangisEngineResourceMetricsDTO datax = new ExchangisEngineResourceMetricsDTO(); + datax.setEngine("datax"); + datax.setCpu("32%"); + datax.setMem("512Mi"); + list.add(datax); + + ExchangisEngineResourceMetricsDTO linkis = new ExchangisEngineResourceMetricsDTO(); + linkis.setEngine("linkis"); + linkis.setCpu("78%"); + linkis.setMem("4196Mi"); + list.add(linkis); + + Message message = Message.ok(); + message.setMethod("/dss/exchangis/main/metrics/engineresource"); + message.data("list", list); + return message; + } + + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/ProjectCopyServiceImpl.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/ProjectCopyServiceImpl.java new file mode 100644 index 000000000..7d462ce2f --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/ProjectCopyServiceImpl.java @@ -0,0 +1,84 @@ +package com.webank.wedatasphere.exchangis.job.server.service.impl; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.common.collect.Lists; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.server.dto.ExportedProject; +import com.webank.wedatasphere.exchangis.job.server.dto.IdCatalog; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisJobServerException; +import com.webank.wedatasphere.exchangis.job.server.restful.external.ModuleEnum; +import com.webank.wedatasphere.exchangis.job.server.service.IProjectCopyService; +import com.webank.wedatasphere.exchangis.job.server.service.IProjectImportService; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobVo; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.server.BDPJettyServerHelper; +import org.apache.linkis.server.Message; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletRequest; +import java.util.Map; +import java.util.Set; + +/** + * @author tikazhang + * @Date 2022/4/24 21:15 + */ +@Service +public class ProjectCopyServiceImpl implements IProjectCopyService { + private static final Logger LOG = LoggerFactory.getLogger(ProjectCopyServiceImpl.class); + + @Autowired + private IProjectImportService projectImportService; + + @Autowired + private DefaultJobInfoService defaultJobInfoService; + + @Autowired + private ProjectImportServerImpl projectImportServer; + + @Override + public Message copy(Map params, String userName, HttpServletRequest request) throws ExchangisJobException, ExchangisJobServerException { + LOG.info("begin to copy in project params is {}", params); + Long projectId = Long.parseLong(params.get("projectId").toString()); + Boolean partial = (Boolean) params.get("partial"); + Map> moduleIdsMap = defaultJobInfoService.getModuleIdsMap(params); + + String projectVersion = params.getOrDefault("projectVersion", "v1").toString(); + String flowVersion = (String) params.get("flowVersion"); + if (StringUtils.isEmpty(flowVersion)) { + LOG.error("flowVersion is null, can not copy flow to a newest version"); + flowVersion = "v00001"; + } + String contextIdStr = (String) params.get("contextID"); + + ExportedProject exportedProject = defaultJobInfoService.export(projectId, moduleIdsMap, partial, request); + + copySqoop(moduleIdsMap, exportedProject); + + String projectJson = null; + try { + projectJson = BDPJettyServerHelper.jacksonJson().writeValueAsString(exportedProject); + } catch (JsonProcessingException e) { + LOG.error("Occur error while tranform class", e.getMessage()); + } + String versionSuffix = projectVersion + "_" + flowVersion; + + IdCatalog idCatalog = projectImportServer.importOpt(projectJson, projectId, versionSuffix, userName); + + Message message = Message.ok() + .data("sqoop", idCatalog.getSqoop()); + return message; + } + + private void copySqoop(Map> moduleIdsMap, ExportedProject exportedProject) { + Set sqoopIds = moduleIdsMap.get(ModuleEnum.SQOOP_IDS.getName()); + if (!sqoopIds.isEmpty()) { + ExchangisJobVo sqoops = exportedProject.getSqoops().get(0); + exportedProject.setSqoops(Lists.newArrayList(sqoops)); + } + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/ProjectImportServerImpl.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/ProjectImportServerImpl.java new file mode 100644 index 000000000..d8fedbb02 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/ProjectImportServerImpl.java @@ -0,0 +1,198 @@ +package com.webank.wedatasphere.exchangis.job.server.service.impl; + +import com.webank.wedatasphere.exchangis.job.server.dto.ExportedProject; +import com.webank.wedatasphere.exchangis.job.server.dto.IdCatalog; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisJobServerException; +import com.webank.wedatasphere.exchangis.job.server.service.IProjectImportService; +import com.webank.wedatasphere.exchangis.job.server.service.JobInfoService; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobVo; +import com.webank.wedatasphere.exchangis.project.server.entity.ExchangisProject; +import com.webank.wedatasphere.exchangis.project.server.exception.ExchangisProjectErrorException; +import com.webank.wedatasphere.exchangis.project.server.mapper.ProjectMapper; +import com.webank.wedatasphere.exchangis.project.server.service.ProjectService; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.bml.client.BmlClient; +import org.apache.linkis.bml.client.BmlClientFactory; +import org.apache.linkis.bml.protocol.BmlDownloadResponse; +import org.apache.linkis.server.BDPJettyServerHelper; +import org.apache.linkis.server.Message; +import org.apache.linkis.server.security.SecurityFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.rmi.ServerException; +import java.util.Calendar; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @author tikazhang + * @Date 2022/3/15 9:58 + */ + +@Service +public class ProjectImportServerImpl implements IProjectImportService { + + private static final Logger LOG = LoggerFactory.getLogger(ProjectImportServerImpl.class); + + Pattern pattern1 = Pattern.compile("([a-zA-Z]+_\\d+).*"); + + Pattern pattern2 = Pattern.compile("(\\S+)_v1\\S+"); + + @Resource + private JobInfoService jobInfoService; + + @Autowired + private ProjectMapper projectMapper; + + @Override + public Message importProject(HttpServletRequest req, Map params) throws ExchangisJobServerException, ServerException { + String userName = SecurityFilter.getLoginUsername(req); + //String resourceId = "99763d27-a35e-43f2-829b-100830bca538"; + String resourceId = (String) params.get("resourceId"); + String version = (String) params.get("flowVersion"); + //Long projectId = Long.parseLong("1497870871035973669"); + Long projectId = Long.parseLong("111111"); + String projectVersion = (String) params.get("projectVersion"); + String flowVersion = (String) params.get("flowVersion"); + String versionSuffix = projectVersion; + LOG.info("resourceId: {}, projectId: {}, versionSuffix: {}, version: {}, userName: {}", resourceId, projectId, versionSuffix, version, userName); + BmlClient bmlClient = BmlClientFactory.createBmlClient(userName); + BmlDownloadResponse bmlDownloadResponse = bmlClient.downloadShareResource(userName, resourceId, version); + LOG.info("bmlDownloadResponse: {}", bmlDownloadResponse); + Message message = null; + if (bmlDownloadResponse == null || !bmlDownloadResponse.isSuccess()) { + throw new ServerException("cannot download exported data from BML"); + } + try { + String projectJson = IOUtils.toString(bmlDownloadResponse.inputStream(), StandardCharsets.UTF_8); + LOG.info("projectJson: {}", projectJson); + IdCatalog idCatalog = importOpt(projectJson, projectId, versionSuffix, userName); + message = Message.ok("import Job ok") + .data("sqoop", idCatalog.getSqoop()) + .data("datax", idCatalog.getDatax()); + + return message; + } catch (IOException | ExchangisJobServerException e) { + LOG.error("Error occur while import option: {}", e.getMessage()); + message = Message.error("Error occur while import option: {}"); + //throw new ExchangisJobServerException(31101, "导入出现错误:" + "[" + e.getMessage() + "]"); + } + finally { + IOUtils.closeQuietly(bmlDownloadResponse.inputStream()); + } + + return message; + } + + @Override + public IdCatalog importOpt(String projectJson, Long projectId, String versionSuffix, String userName) throws ExchangisJobServerException { + ExportedProject exportedProject = BDPJettyServerHelper.gson().fromJson(projectJson, ExportedProject.class); + IdCatalog idCatalog = new IdCatalog(); + + importSqoop(projectId, versionSuffix, exportedProject, idCatalog, userName); + + importDatax(projectId, versionSuffix, exportedProject, idCatalog, userName); + + return idCatalog; + } + + private void importSqoop(Long projectId, String versionSuffix, ExportedProject exportedProject, IdCatalog idCatalog, String userName) throws ExchangisJobServerException { + List sqoops = exportedProject.getSqoops(); + if (sqoops == null) { + return; + } + List projects = projectMapper.getDetailByName(exportedProject.getName()); + if (projects.size() == 0) { + ExchangisProject project = new ExchangisProject(); + project.setName(exportedProject.getName()); + project.setCreateTime(Calendar.getInstance().getTime()); + project.setCreateUser(userName); + Long newProjectId = projectMapper.insertOne(project); + List newProjects = projectMapper.getDetailByName(exportedProject.getName()); + addSqoopTask (sqoops, newProjects, versionSuffix, idCatalog, projectId); + } + else if (projects.size() == 1) { + addSqoopTask (sqoops, projects, versionSuffix, idCatalog, projectId); + } + else { + throw new ExchangisJobServerException(31101, "Already exits duplicated project name(存在重复项目名称) projectName is:" + "[" + exportedProject.getName() + "]"); + } + } + + private void importDatax(Long projectId, String versionSuffix, ExportedProject exportedProject, IdCatalog idCatalog, String userName) { + List dataxes = exportedProject.getDataxes(); + if (dataxes == null) { + return; + } + for (ExchangisJobVo datax : dataxes) { + Long oldId = datax.getId(); + datax.setProjectId(projectId); + datax.setJobName(updateName(datax.getJobName(), versionSuffix)); + //Long existingId = (long) 66; + Long existingId = jobInfoService.getByNameWithProjectId(datax.getJobName(), projectId).get(0).getId(); + //Long existingId = jobInfoService.getByNameWithProjectId(datax.getJobName(), projectId); + if (existingId != null) { + idCatalog.getSqoop().put(oldId, existingId); + } else { + jobInfoService.createJob(datax); + idCatalog.getSqoop().put(oldId, datax.getId()); + } + } + } + + public void addSqoopTask (List sqoops, List projects, String versionSuffix, IdCatalog idCatalog, Long projectId) throws ExchangisJobServerException { + for (ExchangisJobVo sqoop : sqoops) { + Long projectIdProd = projects.get(0).getId(); + Long oldId = sqoop.getId(); + sqoop.setProjectId(projectIdProd); + sqoop.setJobName(updateName(sqoop.getJobName(), versionSuffix)); + //Long existingId = (long) 55; + LOG.info("oldId: {}, projectid: {}, jobName: {}", sqoop.getId(), sqoop.getProjectId(), sqoop.getJobName()); + LOG.info("jobByNameWithProjectId: {}", jobInfoService.getByNameWithProjectId(sqoop.getJobName(), projectIdProd)); + Long existingId; + if (jobInfoService.getByNameWithProjectId(sqoop.getJobName(), projectIdProd) == null || jobInfoService.getByNameWithProjectId(sqoop.getJobName(), projectId).size() == 0) { + existingId = null; + } else { + existingId = jobInfoService.getByNameWithProjectId(sqoop.getJobName(), projectIdProd).get(0).getId(); + } + //Long existingId = jobInfoService.getByNameWithProjectId(sqoop.getJobName(), projectId); + if (existingId != null) { + idCatalog.getSqoop().put(oldId, existingId); + throw new ExchangisJobServerException(31101, "Already exits duplicated job name(存在重复任务名称) jobName is:" + "[" + sqoop.getJobName() + "]"); + } else { + //sqoop.setJobName("hahaha"); + LOG.info("Sqoop job content is: {}, Modify user is: {}, jobType is: {}", sqoop.getContent(), sqoop.getExecuteUser(), sqoop.getJobType()); + ExchangisJobVo jobVo = jobInfoService.createJob(sqoop); + LOG.info("oldId: {}, newid: {}, jobName0000000: {}", sqoop.getId(), jobVo.getId(), jobVo.getJobName()); + idCatalog.getSqoop().put(oldId, jobVo.getId()); + } + } + } + + private String updateName(String name, String versionSuffix) { + if (StringUtils.isBlank(versionSuffix)) { + return name; + } + + Matcher matcher = pattern1.matcher(name); + if (matcher.find()) { + return matcher.group(1) + "_" + versionSuffix; + } else { + Matcher matcher2 = pattern2.matcher(name); + if (matcher2.find()) { + return matcher2.group(1) + "_" + versionSuffix; + } + } + return name + "_" + versionSuffix; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/open/DefaultJobOpenService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/open/DefaultJobOpenService.java new file mode 100644 index 000000000..81ec15408 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/open/DefaultJobOpenService.java @@ -0,0 +1,66 @@ +package com.webank.wedatasphere.exchangis.job.server.service.open; + +import com.github.pagehelper.PageHelper; +import com.webank.wedatasphere.exchangis.job.api.ExchangisJobOpenService; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobEntity; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.server.mapper.ExchangisJobEntityDao; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobQueryVo; +import org.apache.commons.lang.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; + +import static com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode.JOB_EXCEPTION_CODE; + + +/** + * Default implement + */ +@Service +public class DefaultJobOpenService implements ExchangisJobOpenService { + + @Resource + private ExchangisJobEntityDao jobEntityDao; + + @Override + public ExchangisJobEntity getJobById(Long id, boolean basic) throws ExchangisJobException { + try { + return basic ? this.jobEntityDao.getBasicInfo(id) : this.jobEntityDao.getDetail(id); + } catch (Exception e){ + throw new ExchangisJobException(JOB_EXCEPTION_CODE.getCode(), + "Fail to the information of job [id: " + id + "]", e); + } + } + + @Override + public List queryJobs(ExchangisJobQueryVo queryVo, boolean inPage) throws ExchangisJobException { + try { + if (inPage) { + PageHelper.startPage(queryVo.getPage(), queryVo.getPageSize()); + try { + return this.jobEntityDao.queryPageList(queryVo); + } finally { + PageHelper.clearPage(); + } + } + return this.jobEntityDao.queryPageList(queryVo); + } catch (Exception e){ + throw new ExchangisJobException(JOB_EXCEPTION_CODE.getCode(), + "Fail to query job list", e); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteJobBatch(List idList) throws ExchangisJobException { + try { + this.jobEntityDao.deleteBatch(idList); + } catch (Exception e){ + throw new ExchangisJobException(JOB_EXCEPTION_CODE.getCode(), + "Fail to delete batch job ids, id list: [" + StringUtils.join(idList,",") + "]", e); + } + } +} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/DateTool.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/utils/DateTool.java old mode 100755 new mode 100644 similarity index 82% rename from modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/DateTool.java rename to exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/utils/DateTool.java index 96b93d425..aa0f79f6a --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/DateTool.java +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/utils/DateTool.java @@ -1,220 +1,225 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.util; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.regex.Pattern; - -/** - * Created by devendeng on 2018/10/22. - */ -public class DateTool { - private static final String TIME_PLACEHOLDER_DATE_0 = "${yyyyMMdd}"; - private static final String TIME_PLACEHOLDER_DATE_1 = "${yyyy-MM-dd}"; - public static final String TIME_PLACEHOLDER_DATE_TIME = "${yyyy-MM-dd HH:mm:ss}"; - private static final String TIME_PLACEHOLDER_TIMESTAMP = "${timestamp}"; - static final String MONTH_BEGIN_SYMBOL = "run_month_begin"; - static final String MONTH_END_SYMBOL = "run_month_end"; - static final String LINE_SYMBOL = "_std"; - public static final String[] TIME_PLACEHOLDER = new String[] - {TIME_PLACEHOLDER_DATE_0, TIME_PLACEHOLDER_DATE_1, TIME_PLACEHOLDER_DATE_TIME, TIME_PLACEHOLDER_TIMESTAMP}; - - private static final String TIME_REGULAR_EXPRESSION = "\\$\\{(run_date|run_month_begin|run_month_end)(_std)?\\s*([+-])?\\s*([0-9])?\\}"; - public static final Pattern TIME_REGULAR_PATTERN = Pattern.compile(TIME_REGULAR_EXPRESSION); - - private static Logger log = LoggerFactory.getLogger(DateTool.class); - private Calendar calendar=Calendar.getInstance(); - - public DateTool(Date date){ - this.calendar.setTime(date); - } - - public DateTool(long timeInMillis){ - this.calendar.setTimeInMillis(timeInMillis); - } - - public DateTool(){ - } - - public DateTool set(int field, int value) { - calendar.set(field, value); - return this; - } - - public DateTool getDate(String date) { - SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); - try { - calendar.setTime(format.parse(date)); - } catch (ParseException e) { - log.error("Parse exception.",e); - } - return this; - } - - /** - * - * @return - */ - public DateTool getHalfBeg(int amount) { - calendar.add(Calendar.MONTH, amount * 6); - int currentMonth = calendar.get(Calendar.MONTH) + 1; - - if (currentMonth >= 1 && currentMonth <= 6) { - calendar.set(Calendar.MONTH, 0); - } else if (currentMonth >= 7 && currentMonth <= 12) { - calendar.set(Calendar.MONTH, 6); - } - calendar.set(Calendar.DATE, 1); - return this; - } - - /** - * - * @return - */ - public DateTool getHalfEnd(int amount) { - calendar.add(Calendar.MONTH, amount * 6); - int currentMonth = calendar.get(Calendar.MONTH) + 1; - - if (currentMonth >= 1 && currentMonth <= 6) { - calendar.set(Calendar.MONTH, 5); - calendar.set(Calendar.DATE, 30); - } else if (currentMonth >= 7 && currentMonth <= 12) { - calendar.set(Calendar.MONTH, 11); - calendar.set(Calendar.DATE, 31); - } - return this; - } - - /** - * Begin of quarter - * - * @return - */ - public DateTool getQuarterBeg(int amount) { - calendar.add(Calendar.MONTH, amount * 3); - - int currentMonth = calendar.get(Calendar.MONTH) + 1; - - if (currentMonth >= 1 && currentMonth <= 3) { - calendar.set(Calendar.MONTH, 0); - } else if (currentMonth >= 4 && currentMonth <= 6) { - calendar.set(Calendar.MONTH, 3); - } else if (currentMonth >= 7 && currentMonth <= 9) { - calendar.set(Calendar.MONTH, 6); - } else if (currentMonth >= 10 && currentMonth <= 12) { - calendar.set(Calendar.MONTH, 9); - } - calendar.set(Calendar.DATE, 1); - return this; - } - - /** - * End of quarter - * - * @return - */ - public DateTool getQuarterEnd(int amount) { - calendar.add(Calendar.MONTH, amount * 3); - int currentMonth = calendar.get(Calendar.MONTH) + 1; - if (currentMonth >= 1 && currentMonth <= 3) { - calendar.set(Calendar.MONTH, 2); - calendar.set(Calendar.DATE, 31); - } else if (currentMonth >= 4 && currentMonth <= 6) { - calendar.set(Calendar.MONTH, 5); - calendar.set(Calendar.DATE, 30); - } else if (currentMonth >= 7 && currentMonth <= 9) { - calendar.set(Calendar.MONTH, 8); - calendar.set(Calendar.DATE, 30); - } else if (currentMonth >= 10 && currentMonth <= 12) { - calendar.set(Calendar.MONTH, 11); - calendar.set(Calendar.DATE, 31); - } - return this; - } - - public DateTool addDay(int amount){ - calendar.add(Calendar.DAY_OF_YEAR, amount); - return this; - } - - public DateTool add(int field, int amount){ - calendar.add(field, amount); - return this; - } - - public DateTool addMonth(int amount){ - calendar.add(Calendar.MONTH, amount); - return this; - } - - public DateTool addYesterdayMonth(int amount){ - calendar.add(Calendar.DAY_OF_MONTH, -1); - calendar.add(Calendar.MONTH, amount); - return this; - } - public DateTool getMonthEnd(int amount){ - calendar.set(Calendar.DATE, 1); - calendar.add(Calendar.MONTH, amount+1); - calendar.add(Calendar.DAY_OF_MONTH, -1); - return this; - } - - public DateTool getMonthBegin(int amount){ - calendar.set(Calendar.DATE, 1); - calendar.add(Calendar.MONTH, amount); - return this; - } - - public String format(String pattern){ - SimpleDateFormat format=new SimpleDateFormat(pattern); - return format.format(calendar.getTime()); - } - - public String format(String pattern, long time){ - SimpleDateFormat format = new SimpleDateFormat(pattern); - return format.format(new Date(time)); - } - public String currentTimestamp(){ - return String.valueOf(System.currentTimeMillis()/1000); - } - - - public static Date stringToDate(String dateStr, String formatStr){ - DateFormat sdf=new SimpleDateFormat(formatStr); - Date date=null; - try { - date = sdf.parse(dateStr); - } catch (ParseException e) { - log.error("Parse exception.",e); - } - return date; - } - - public DateTool truncate(long mills) { - calendar.setTimeInMillis(mills * (calendar.getTimeInMillis() / mills)); - return this; - } -} +package com.webank.wedatasphere.exchangis.job.server.utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.regex.Pattern; + + +public class DateTool { + private static final String TIME_PLACEHOLDER_DATE_0 = "${yyyyMMdd}"; + private static final String TIME_PLACEHOLDER_DATE_1 = "${yyyy-MM-dd}"; + public static final String TIME_PLACEHOLDER_DATE_TIME = "${yyyy-MM-dd HH:mm:ss}"; + /** + * yyyyMMddHH + * yyyy-MM-dd-HH + * HH + */ + public static final String TIME_PLACEHOLDER_DATE_HOUR_0 = "${yyyyMMddHH}"; + public static final String TIME_PLACEHOLDER_DATE_HOUR_1 = "${yyyy-MM-dd-HH}"; + public static final String TIME_PLACEHOLDER_DATE_HOUR_2 = "${HH}"; + + private static final String TIME_PLACEHOLDER_TIMESTAMP = "${timestamp}"; + static final String MONTH_BEGIN_SYMBOL = "run_month_begin"; + static final String MONTH_END_SYMBOL = "run_month_end"; + static final String TIME_PLACEHOLDER_SYMBOL = "timestamp"; + static final String MONTH_BEGIN_LAST_SYMBOL = "run_month_begin-1"; + static final String[] HOUR_SPEC_SYMBOLS = new String[]{"yyyyMMdd", "yyyy-MM-dd", "HH"}; + static final String LINE_SYMBOL = "_std"; + public static final String[] TIME_PLACEHOLDER = new String[]{ + TIME_PLACEHOLDER_DATE_0, TIME_PLACEHOLDER_DATE_1, TIME_PLACEHOLDER_DATE_TIME, TIME_PLACEHOLDER_TIMESTAMP, + TIME_PLACEHOLDER_DATE_HOUR_0, TIME_PLACEHOLDER_DATE_HOUR_1, TIME_PLACEHOLDER_DATE_HOUR_2}; + + private static final String TIME_REGULAR_EXPRESSION = "\\$\\{(run_date|run_month_begin|run_month_end|HH|yyyyMMdd|yyyy-MM-dd|timestamp)(_std)?\\s*([+-])?\\s*([0-9])?\\}"; + public static final Pattern TIME_REGULAR_PATTERN = Pattern.compile(TIME_REGULAR_EXPRESSION); + + private static Logger log = LoggerFactory.getLogger(DateTool.class); + private Calendar calendar=Calendar.getInstance(); + + public DateTool(Date date){ + this.calendar.setTime(date); + } + + public DateTool(long timeInMillis){ + this.calendar.setTimeInMillis(timeInMillis); + } + + public DateTool(){ + } + + public DateTool set(int field, int value) { + calendar.set(field, value); + return this; + } + + public DateTool getDate(String date) { + SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); + try { + calendar.setTime(format.parse(date)); + } catch (ParseException e) { + log.error("Parse exception.",e); + } + return this; + } + + /** + * + * @return + */ + public DateTool getHalfBeg(int amount) { + calendar.add(Calendar.MONTH, amount * 6); + int currentMonth = calendar.get(Calendar.MONTH) + 1; + + if (currentMonth >= 1 && currentMonth <= 6) { + calendar.set(Calendar.MONTH, 0); + } else if (currentMonth >= 7 && currentMonth <= 12) { + calendar.set(Calendar.MONTH, 6); + } + calendar.set(Calendar.DATE, 1); + return this; + } + + /** + * + * @return + */ + public DateTool getHalfEnd(int amount) { + calendar.add(Calendar.MONTH, amount * 6); + int currentMonth = calendar.get(Calendar.MONTH) + 1; + + if (currentMonth >= 1 && currentMonth <= 6) { + calendar.set(Calendar.MONTH, 5); + calendar.set(Calendar.DATE, 30); + } else if (currentMonth >= 7 && currentMonth <= 12) { + calendar.set(Calendar.MONTH, 11); + calendar.set(Calendar.DATE, 31); + } + return this; + } + + /** + * Begin of quarter + * + * @return + */ + public DateTool getQuarterBeg(int amount) { + calendar.add(Calendar.MONTH, amount * 3); + + int currentMonth = calendar.get(Calendar.MONTH) + 1; + + if (currentMonth >= 1 && currentMonth <= 3) { + calendar.set(Calendar.MONTH, 0); + } else if (currentMonth >= 4 && currentMonth <= 6) { + calendar.set(Calendar.MONTH, 3); + } else if (currentMonth >= 7 && currentMonth <= 9) { + calendar.set(Calendar.MONTH, 6); + } else if (currentMonth >= 10 && currentMonth <= 12) { + calendar.set(Calendar.MONTH, 9); + } + calendar.set(Calendar.DATE, 1); + return this; + } + + /** + * End of quarter + * + * @return + */ + public DateTool getQuarterEnd(int amount) { + calendar.add(Calendar.MONTH, amount * 3); + int currentMonth = calendar.get(Calendar.MONTH) + 1; + if (currentMonth >= 1 && currentMonth <= 3) { + calendar.set(Calendar.MONTH, 2); + calendar.set(Calendar.DATE, 31); + } else if (currentMonth >= 4 && currentMonth <= 6) { + calendar.set(Calendar.MONTH, 5); + calendar.set(Calendar.DATE, 30); + } else if (currentMonth >= 7 && currentMonth <= 9) { + calendar.set(Calendar.MONTH, 8); + calendar.set(Calendar.DATE, 30); + } else if (currentMonth >= 10 && currentMonth <= 12) { + calendar.set(Calendar.MONTH, 11); + calendar.set(Calendar.DATE, 31); + } + return this; + } + + public DateTool addDay(int amount){ + calendar.add(Calendar.DAY_OF_YEAR, amount); + return this; + } + + public DateTool addHour(int amount){ + calendar.add(Calendar.HOUR_OF_DAY, amount); + return this; + } + public DateTool add(int field, int amount){ + calendar.add(field, amount); + return this; + } + + public DateTool addMonth(int amount){ + calendar.add(Calendar.MONTH, amount); + return this; + } + + public DateTool addYesterdayMonth(int amount){ + calendar.add(Calendar.DAY_OF_MONTH, -1); + calendar.add(Calendar.MONTH, amount); + return this; + } + public DateTool getMonthEnd(int amount){ + calendar.set(Calendar.DATE, 1); + calendar.add(Calendar.MONTH, amount+1); + calendar.add(Calendar.DAY_OF_MONTH, -1); + return this; + } + + public DateTool getMonthBegin(int amount){ + calendar.set(Calendar.DATE, 1); + calendar.add(Calendar.MONTH, amount); + return this; + } + + public DateTool getMonthBeginLastDay(int amount){ + calendar.set(Calendar.DATE, 1); + calendar.add(Calendar.MONTH, amount); + calendar.add(Calendar.DAY_OF_MONTH, -1); + return this; + } + + public String format(String pattern){ + SimpleDateFormat format=new SimpleDateFormat(pattern); + return format.format(calendar.getTime()); + } + + public String format(String pattern, long time){ + SimpleDateFormat format = new SimpleDateFormat(pattern); + return format.format(new Date(time)); + } + public String currentTimestamp(){ + return String.valueOf(System.currentTimeMillis()/1000); + } + + + public static Date stringToDate(String dateStr, String formatStr){ + DateFormat sdf=new SimpleDateFormat(formatStr); + Date date=null; + try { + date = sdf.parse(dateStr); + } catch (ParseException e) { + log.error("Parse exception.",e); + } + return date; + } + + public DateTool truncate(long mills) { + calendar.setTimeInMillis(mills * (calendar.getTimeInMillis() / mills)); + return this; + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/utils/JobUtils.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/utils/JobUtils.java new file mode 100644 index 000000000..ba088e970 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/utils/JobUtils.java @@ -0,0 +1,140 @@ +package com.webank.wedatasphere.exchangis.job.server.utils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.StringWriter; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.regex.Matcher; + + +public class JobUtils { + private static Logger logger = LoggerFactory.getLogger(JobUtils.class); + + /** + * Replace the parameter in variables + * @param map + * @param key + * @param subValue + */ + private static void replaceParameters(Map map, String key, + StringBuffer subValue) { + StringBuilder subKey = new StringBuilder(); + char[] chars = key.toCharArray(); + int i=0; + boolean isParamter = false; + int count = 0; + while(i 0){ + subKey.append(chars[i]).append(chars[i+1]); + } + count++; + i=i+2; + continue; + }else if(chars[i] == '}'){ + count--; + if(count == 0){ + String parameter = subKey.toString(); + if(parameter.contains("${") && parameter.contains("}")){ + StringBuffer sb = new StringBuffer(); + replaceParameters(map, parameter, sb); + parameter = sb.toString(); + } + String v = map.get(parameter); + isParamter = false; + subKey.delete(0, subKey.length()); + if(null != v && !"".equals(v)){ + if(v.contains("${") && v.contains("}")){ + replaceParameters(map, v, subValue); + }else{ + subValue.append(v); + } + }else{ + subValue.append("${").append(parameter).append("}"); + } + i=i+1; + continue; + } + + } + if(isParamter){ + subKey.append(chars[i]); + }else{ + subValue.append(chars[i]); + } + i=i+1; + } + } + + + public static String renderDt(String template, Calendar calendar){ + long time = calendar.getTimeInMillis(); + if(template==null){ + return null; + } + Date date =new Date(); + Matcher matcher= DateTool.TIME_REGULAR_PATTERN.matcher(template); + while(matcher.find()){ + try { + String m = template.substring(matcher.start(), matcher.end()); + StringWriter sw = new StringWriter(); + DateTool dataTool = new DateTool(time); + String symbol = matcher.group(1); + boolean spec = false; + if (null != symbol) { + String startTime = null; + String tempTime = null; + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + if ("run_date".equals(symbol)) { + int n = 1; + if (m.split("-").length > 1) { + List days = Arrays.asList(m.split("-")); + n = Integer.parseInt(days.get(1).substring(0, days.get(1).length()-1)); + } + calendar.setTime(date); + calendar.add(Calendar.DAY_OF_MONTH, -n); + tempTime = format.format(calendar.getTime()).substring(0, 10) + " 00:00:00"; + startTime = template.replace(m, tempTime); + return startTime; + } + + for(String specSymbol : DateTool.HOUR_SPEC_SYMBOLS){ + if(specSymbol.equals(symbol)){ + tempTime = dataTool.format(specSymbol); + startTime = template.replace(m, tempTime); + return startTime; + } + } + if (DateTool.MONTH_BEGIN_SYMBOL.equals(symbol)) { + dataTool.getMonthBegin(0); + tempTime = dataTool.format("yyyy-MM-dd HH:mm:ss"); + startTime = template.replace(m, tempTime); + return startTime; + } else if (DateTool.MONTH_BEGIN_LAST_SYMBOL.equals(symbol)) { + dataTool.getMonthBeginLastDay(0); + tempTime = dataTool.format("yyyy-MM-dd HH:mm:ss"); + startTime = template.replace(m, tempTime); + return startTime; + } else if (DateTool.TIME_PLACEHOLDER_SYMBOL.equals(symbol)){ + calendar.setTime(date); + calendar.add(Calendar.DAY_OF_MONTH, -1); + tempTime = String.valueOf(calendar.getTimeInMillis()); + startTime = template.replace(m, tempTime); + return startTime; + } + } + + }catch(Exception e){ + logger.error("TASK_ERROR, cannot render job's configuration, message: {}", e.getMessage(), e); + break; + } + } + //${yesterday} + return template.replace("${yesterday}",new DateTool(time).addDay(-1).format("yyyyMMdd")); + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/utils/JsonEntity.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/utils/JsonEntity.java new file mode 100644 index 000000000..448262822 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/utils/JsonEntity.java @@ -0,0 +1,400 @@ +package com.webank.wedatasphere.exchangis.job.server.utils; + +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import org.apache.commons.lang.StringUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * Copy and simplify from 'Configuration' in 'DataX' + */ +public class JsonEntity { + public static final String SPLIT_CHAR = "."; + private Object root; + + public static JsonEntity from(String json){ + return new JsonEntity(json); + } + + public static JsonEntity from(Map map){ + return new JsonEntity(map); + } + + + public static boolean searchKeyToInsertValue(JsonEntity configuration, String path, + String key, Object value){ + JsonEntity subConf = configuration.getConfiguration(path); + Set keys = subConf.getKeys(); + //search key + for(String key0 : keys){ + if(key0.endsWith(SPLIT_CHAR + key)){ + configuration.set(StringUtils.join(new String[]{path, key0}, SPLIT_CHAR), value); + return true; + } + } + + return false; + } + + + public static List searchKeyPaths(JsonEntity configuration, String path, + String key){ + return searchKeyPaths(configuration, path, key, Integer.MAX_VALUE); + } + + public static List searchKeyPaths(JsonEntity configuration, String path, + String key, int depth){ + List result = new ArrayList<>(); + JsonEntity subConf = configuration.getConfiguration(path); + Set keys = subConf.getKeys(depth); + keys.forEach(key0 -> { + if(key0.equals(key) || key0.endsWith(SPLIT_CHAR + key)){ + result.add(key0); + } + }); + return result; + } + /** + * Serialize the configuration + * @return + */ + public String toJson(){ + return Json.toJson(root, null); + } + + @SuppressWarnings("unchecked") + public Map toMap(){ + if (this.root instanceof Map){ + return new HashMap<>((Map) root); + } + return null; + } + + /** + * Set value to path + * @param path path + * @param object object value + * @return + */ + public Object set(final String path, final Object object) { + if(!checkPath(path)){ + return null; + } + Object result = this.get(path); + setObject(path, extract(object)); + return result; + } + + /** + * Get value by path + * @param path path + * @return + */ + public Object get(final String path){ + this.checkPath(path); + return this.findObject(path); + } + + /** + * Get string value by path + * if the result is null, use the default value + * @param path path + * @param defaultValue default value + * @return + */ + public String getString(final String path, String defaultValue){ + Object result = this.get(path); + if(null == result){ + return defaultValue; + } + if(result instanceof String){ + return (String)result; + }else if(result.getClass().isPrimitive() || isWrapClass(result.getClass())){ + return String.valueOf(result); + }else{ + return Json.toJson(result, null); + } + } + + /** + * get integer value by path + * @param path path + * @return + */ + public Integer getInt(final String path){ + String result = this.getString(path); + if(null == result){ + return null; + } + return Integer.valueOf(result); + } + + /** + * get double value by path + * @param path path + * @return + */ + public Double getDouble(final String path){ + String result = this.getString(path); + if(null == result){ + return null; + } + return Double.valueOf(result); + } + + /** + * get long value by path + * @param path path + * @return + */ + public Long getLong(final String path){ + String result = this.getString(path); + if(null == result){ + return null; + } + return Long.valueOf(result); + } + /** + * Get string value by path + * @param path path + * @return + */ + public String getString(final String path){ + return getString(path, null); + } + + /** + * Get keys + * @return + */ + public Set getKeys(){ + return getKeys(Integer.MAX_VALUE); + } + + public Set getKeys(int maxDepth){ + Set collect = new HashSet<>(); + this.getKeysRecursive(this.root, "", collect, maxDepth); + return collect; + } + + public JsonEntity getConfiguration(final String path){ + Object object = this.get(path); + if(null == object){ + return null; + } + return from(Json.toJson(object, null)); + } + + private Object findObject(final String path){ + if(StringUtils.isBlank(path)){ + return this.root; + } + Object target = this.root; + for(final String each : split2List(path)){ + if(isPathMap(each) && target instanceof Map){ + target = ((Map)target).get(each); + }else if (isPathList(each) && target instanceof List){ + String index = each.replace("[", "").replace("]", ""); + if(!StringUtils.isNumeric(index)){ + throw new IllegalArgumentException("index value must be numeric, value: " + index); + } + target = ((List)target).get(Integer.valueOf(index)); + }else{ + target = null; + break; + } + } + return target; + } + + private void setObject(final String path, final Object object){ + Object newRoot = setObjectRecursive(this.root, split2List(path), 0, object); + boolean isSuit = null != newRoot && (newRoot instanceof List || object instanceof Map); + if(isSuit){ + this.root = newRoot; + } + } + + private Object setObjectRecursive(Object current, final List paths, + int index, final Object value){ + if(index >= paths.size()){ + return value; + } + String path = paths.get(index).trim(); + if(isPathMap(path)){ + //current object is not map + Map mapping; + if(!(current instanceof Map)){ + mapping = new HashMap<>(1); + mapping.put(path, buildObject(paths.subList(index + 1, paths.size()), value)); + return mapping; + } + mapping = (Map)current; + //current map does not have key + if(!mapping.containsKey(path)){ + mapping.put(path, buildObject(paths.subList(index + 1, paths.size()), value)); + return mapping; + } + mapping.put(path, setObjectRecursive(mapping.get(path), + paths, index + 1, value)); + return mapping; + } + if(isPathList(path)){ + List lists; + int listIndex = getIndex(path); + //current object is not list + if(!(current instanceof List)){ + lists = expand(new ArrayList<>(listIndex + 1), listIndex + 1); + lists.set(listIndex, buildObject(paths.subList(index + 1, paths.size()), value)); + return lists; + } + lists = (List) current; + lists = expand(lists, listIndex + 1); + //current list does not have the index + if(null == lists.get(listIndex)){ + lists.set(listIndex, buildObject(paths.subList(index + 1, paths.size()), value)); + return lists; + } + lists.set(listIndex, setObjectRecursive(lists.get(listIndex), + paths, index + 1, value)); + return lists; + } + throw new RuntimeException("system error"); + } + + private Object buildObject(final List paths, final Object object){ + if(null == paths ){ + throw new IllegalArgumentException("paths cannot be null"); + } + if(1 == paths.size() && StringUtils.isBlank(paths.get(0))){ + return object; + } + Object child = object; + for(int i = paths.size() - 1; i >= 0; i--){ + String path = paths.get(i); + if(isPathMap(path)){ + Map mapping = new HashMap<>(1); + mapping.put(path, child); + child = mapping; + continue; + } + if(isPathList(path)){ + int index = getIndex(path); + List lists = new ArrayList<>(index + 1); + expand(lists, index + 1); + lists.set(index, child); + child = lists; + continue; + } + throw new IllegalArgumentException("illegal path"); + } + return child; + } + + private Object extract(final Object object){ + if(object instanceof JsonEntity){ + return ((JsonEntity)object).root; + } + if(object instanceof List){ + List result = new ArrayList<>(); + for(final Object each : (List)object){ + result.add(extract(each)); + } + return result; + } + if(object instanceof Map){ + Map map = (Map)object; + Map result = new HashMap<>(map.size()); + for(final Object key : map.keySet()){ + result.put(String.valueOf(key), extract(map.get(key))); + } + return result; + } + return object; + } + + private boolean isPathList(final String path){ + return path.contains("[") && path.contains("]"); + } + + private boolean isPathMap(final String path){ + return StringUtils.isNotBlank(path) && !isPathList(path); + } + + private List split2List(final String path){ + return Arrays.asList(StringUtils.split(path.replace("[", ".["), ".")).stream() + .map(value -> value.replace("0x2e", ".")).collect(Collectors.toList()); + } + + private int getIndex(final String index) { + return Integer.parseInt(index.replace("[", "").replace("]", "")); + } + + private boolean checkPath(final String path){ + if(null == path){ + return false; + } + for(String each : StringUtils.split(SPLIT_CHAR)){ + if(StringUtils.isWhitespace(each)){ + throw new IllegalArgumentException("cannot contains white space in : " + path); + } + } + return true; + } + + private List expand(List list, int size) { + int expand = size - list.size(); + while (expand-- > 0) { + list.add(null); + } + return list; + } + + private void getKeysRecursive(final Object current, String path, Set collect,int depth){ + if(depth-- <= 0){ + collect.add(path); + return; + } + if(current instanceof Map){ + Map mapping = (Map)current; + for(final Object key : mapping.keySet()){ + String keyStr = String.valueOf(key).trim(); + if(StringUtils.isBlank(path)){ + getKeysRecursive(mapping.get(key), keyStr, collect, depth); + }else{ + getKeysRecursive(mapping.get(key), path + SPLIT_CHAR + keyStr, collect, depth); + } + } + }else if(current instanceof List){ + List lists = (List) current; + for(int i = 0; i < lists.size(); i++){ + getKeysRecursive(lists.get(i), path + String.format("[%d]", i), collect, depth); + } + }else{ + collect.add(path); + } + } + + private static boolean isWrapClass(Class clz){ + try{ + return ((Class)clz.getField("TYPE").get(null)).isPrimitive(); + }catch(Exception e){ + return false; + } + } + + public static String encodePath(String path){ + if (StringUtils.isNotBlank(path)){ + return path.replace(".", "0x2e"); + } + return path; + } + private JsonEntity(final String json){ + this.root = Json.fromJson(json, Map.class); + } + + private JsonEntity(final Map jsonMap){ + this.root = new HashMap<>(jsonMap); + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/utils/SpringContextHolder.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/utils/SpringContextHolder.java new file mode 100644 index 000000000..44d6bb7e5 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/utils/SpringContextHolder.java @@ -0,0 +1,43 @@ +/** + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + */ +package com.webank.wedatasphere.exchangis.job.server.utils; + +import org.springframework.beans.factory.DisposableBean; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +import java.util.Objects; + +@Component +public class SpringContextHolder implements ApplicationContextAware, DisposableBean { + + private static ApplicationContext applicationContext = null; + + public static ApplicationContext getApplicationContext() { + return applicationContext; + } + + public static T getBean(Class requiredType) { + if (Objects.nonNull(applicationContext)) { + return applicationContext.getBean(requiredType); + } + return null; + } + + @Override + public void setApplicationContext(ApplicationContext applicationContext) { + if (SpringContextHolder.applicationContext == null) { + SpringContextHolder.applicationContext = applicationContext; + } + } + + @Override + public void destroy() throws Exception { + applicationContext = null; + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisCategoryLogVo.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisCategoryLogVo.java new file mode 100644 index 000000000..e044d4be9 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisCategoryLogVo.java @@ -0,0 +1,83 @@ +package com.webank.wedatasphere.exchangis.job.server.vo; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.webank.wedatasphere.exchangis.job.log.LogResult; +import org.apache.commons.lang.StringUtils; + +import java.util.*; +import java.util.function.Function; + +/** + * Category log + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +public class ExchangisCategoryLogVo { + + @JsonIgnore + private Map categoryStrategy = new HashMap<>(); + + private int endLine; + + private boolean isEnd = false; + + private Map logs = new HashMap<>(); + + public void newCategory(String name, Function logAcceptable){ + this.categoryStrategy.put(name, new CategoryLog(logAcceptable)); + } + + public void processLogResult(LogResult logResult, boolean acceptEmpty){ + this.endLine = logResult.getEndLine(); + this.isEnd = logResult.isEnd(); + List categoryLogs = new ArrayList<>(this.categoryStrategy.values()); + Optional.ofNullable(logResult.getLogs()).ifPresent(logs -> logs.forEach(log -> { + for (CategoryLog categoryLog : categoryLogs){ + if (categoryLog.logAcceptable.apply(log)) { + categoryLog.logs.add(log); + } + } + })); + this.categoryStrategy.forEach((category, categoryLog) -> { + if (!categoryLog.logs.isEmpty() || acceptEmpty) { + this.logs.put(category, StringUtils.join(categoryLog.logs, "\n")); + categoryLog.logs.clear(); + } + }); + } + + public int getEndLine() { + return endLine; + } + + public void setEndLine(int endLine) { + this.endLine = endLine; + } + + public boolean getIsEnd() { + return isEnd; + } + + public void setIsEnd(boolean end) { + isEnd = end; + } + + public Map getLogs() { + return logs; + } + + public void setLogs(Map logs) { + this.logs = logs; + } + + private static class CategoryLog{ + + private List logs = new ArrayList<>(); + + private Function logAcceptable; + + public CategoryLog(Function logAcceptable){ + this.logAcceptable = logAcceptable; + } + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisJobBasicInfoVO.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisJobBasicInfoVO.java new file mode 100644 index 000000000..40751f3b7 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisJobBasicInfoVO.java @@ -0,0 +1,114 @@ +package com.webank.wedatasphere.exchangis.job.server.vo; + +public class ExchangisJobBasicInfoVO { + + private Long id; + + private Long projectId; + + private Long dssProjectId; + + private String dssProjectName; + + private String nodeId; + + private String nodeName; + + private String jobName; + + private String jobType; + + private String engineType; + + private String jobLabels; + + private String jobDesc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + public String getJobName() { + return jobName; + } + + public void setJobName(String jobName) { + this.jobName = jobName; + } + + public String getJobType() { + return jobType; + } + + public void setJobType(String jobType) { + this.jobType = jobType; + } + + public String getEngineType() { + return engineType; + } + + public void setEngineType(String engineType) { + this.engineType = engineType; + } + + public String getJobLabels() { + return jobLabels; + } + + public void setJobLabels(String jobLabels) { + this.jobLabels = jobLabels; + } + + public String getJobDesc() { + return jobDesc; + } + + public void setJobDesc(String jobDesc) { + this.jobDesc = jobDesc; + } + + public Long getDssProjectId() { + return dssProjectId; + } + + public void setDssProjectId(Long dssProjectId) { + this.dssProjectId = dssProjectId; + } + + public String getDssProjectName() { + return dssProjectName; + } + + public void setDssProjectName(String dssProjectName) { + this.dssProjectName = dssProjectName; + } + + public String getNodeId() { + return nodeId; + } + + public void setNodeId(String nodeId) { + this.nodeId = nodeId; + } + + public String getNodeName() { + return nodeName; + } + + public void setNodeName(String nodeName) { + this.nodeName = nodeName; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisJobExportVo.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisJobExportVo.java new file mode 100644 index 000000000..030e71808 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisJobExportVo.java @@ -0,0 +1,4 @@ +package com.webank.wedatasphere.exchangis.job.server.vo; + +public class ExchangisJobExportVo { +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisJobImportVo.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisJobImportVo.java new file mode 100644 index 000000000..ed0433750 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisJobImportVo.java @@ -0,0 +1,4 @@ +package com.webank.wedatasphere.exchangis.job.server.vo; + +public class ExchangisJobImportVo { +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisJobProgressVo.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisJobProgressVo.java new file mode 100644 index 000000000..80a56e0b8 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisJobProgressVo.java @@ -0,0 +1,73 @@ +package com.webank.wedatasphere.exchangis.job.server.vo; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; + +import java.util.*; + + +public class ExchangisJobProgressVo extends ExchangisProgressVo{ + + private Map> tasks = new HashMap<>(); + + public ExchangisJobProgressVo(TaskStatus status, Double progress) { + super(status, progress); + } + + public ExchangisJobProgressVo(){ + super(); + } + + /** + * Add task progress + * @param progressVo progress vo + */ + public void addTaskProgress(ExchangisProgressVo progressVo){ + TaskStatus status = progressVo.getStatus(); + if (Objects.nonNull(status)){ + tasks.compute(status, (keyStatus, statusTasks) -> { + if (Objects.isNull(statusTasks)){ + statusTasks = new ArrayList<>(); + } + statusTasks.add(progressVo); + return statusTasks; + }); + } + } + + public Map> getTasks() { + return tasks; + } + + public void setTasks(Map> tasks) { + this.tasks = tasks; + } + + public static class ExchangisTaskProgressVo extends ExchangisProgressVo{ + + private String taskId; + + private String name; + + public ExchangisTaskProgressVo(String taskId, String name, TaskStatus status, Double progress) { + super(status, progress); + this.taskId = taskId; + this.name = name; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisJobTaskVo.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisJobTaskVo.java new file mode 100644 index 000000000..ae6a94c12 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisJobTaskVo.java @@ -0,0 +1,128 @@ +package com.webank.wedatasphere.exchangis.job.server.vo; + +import java.util.Date; + +/** + * + * @Date 2022/1/12 22:34 + */ + +public class ExchangisJobTaskVo { + + private String name; + + private Date createTime; + + private String status; + + private Date lastUpdateTime; + + private String engineType; + + private String executeUser; + + private String taskId; + + private String linkisJobId; + + private String linkisJobInfo; + + private Date launchTime; + + public ExchangisJobTaskVo(){ + + } + + public ExchangisJobTaskVo(String taskId, String name, String status, Date createTime, Date launchTime, Date lastUpdateTime, String engineType, String linkisJobId, String linkisJobInfo, String executeUser){ + this.taskId = taskId; + this.name = name; + this.status = status; + this.createTime = createTime; + this.launchTime = launchTime; + this.lastUpdateTime = lastUpdateTime; + this.engineType = engineType; + this.linkisJobId = linkisJobId; + this.linkisJobInfo = linkisJobInfo; + this.executeUser = executeUser; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Date getLastUpdateTime() { + return lastUpdateTime; + } + + public void setLastUpdateTime(Date lastUpdateTime) { + this.lastUpdateTime = lastUpdateTime; + } + + public String getEngineType() { + return engineType; + } + + public void setEngineType(String engineType) { + this.engineType = engineType; + } + + public String getExecuteUser() { + return executeUser; + } + + public void setExecuteUser(String executeUser) { + this.executeUser = executeUser; + } + + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getLinkisJobId() { + return linkisJobId; + } + + public void setLinkisJobId(String linkisJobId) { + this.linkisJobId = linkisJobId; + } + + public String getLinkisJobInfo() { + return linkisJobInfo; + } + + public void setLinkisJobInfo(String linkisJobInfo) { + this.linkisJobInfo = linkisJobInfo; + } + + public Date getLaunchTime() { + return launchTime; + } + + public void setLaunchTime(Date launchTime) { + this.launchTime = launchTime; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisLaunchedJobListVo.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisLaunchedJobListVo.java new file mode 100644 index 000000000..f48c9f8b2 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisLaunchedJobListVo.java @@ -0,0 +1,128 @@ +package com.webank.wedatasphere.exchangis.job.server.vo; + +import java.util.Date; + +/** + * + * @Date 2022/1/16 10:21 + */ +public class ExchangisLaunchedJobListVo { + private String jobExecutionId; + + private String executeNode; + + private String name; + + private Date createTime; + + private Long flow; + + private String createUser; + + private String executeUser; + + private String status; + + private double progress; + + private Date lastUpdateTime; + + public ExchangisLaunchedJobListVo(){ + + } + + public ExchangisLaunchedJobListVo(String jobExecutionId, String executeNode, String name, Date createTime, Long flow, String createUser, String executeUser, String status, double progress, Date lastUpdateTime){ + this.jobExecutionId = jobExecutionId; + this.executeNode = executeNode; + this.name = name; + this.status = status; + this.createTime = createTime; + this.flow = flow; + this.createUser = createUser; + this.lastUpdateTime = lastUpdateTime; + this.progress = progress; + this.lastUpdateTime = lastUpdateTime; + this.executeUser = executeUser; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getJobExecutionId() { + return jobExecutionId; + } + + public void setJobExecutionId(String jobExecutionId) { + this.jobExecutionId = jobExecutionId; + } + + public String getExecuteNode() { + return executeNode; + } + + public void setExecuteNode(String executeNode) { + this.executeNode = executeNode; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Long getFlow() { + return flow; + } + + public void setFlow(Long flow) { + this.flow = flow; + } + + public String getExecuteUser() { + return executeUser; + } + + public void setExecuteUser(String executeUser) { + this.executeUser = executeUser; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public double getProgress() { + return progress; + } + + public void setProgress(double progress) { + this.progress = progress; + } + + public Date getLastUpdateTime() { + return lastUpdateTime; + } + + public void setLastUpdateTime(Date lastUpdateTime) { + this.lastUpdateTime = lastUpdateTime; + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisLaunchedTaskMetricsVo.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisLaunchedTaskMetricsVo.java new file mode 100644 index 000000000..006863f20 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisLaunchedTaskMetricsVo.java @@ -0,0 +1,61 @@ +package com.webank.wedatasphere.exchangis.job.server.vo; + +import com.webank.wedatasphere.exchangis.job.server.metrics.ExchangisMetricsVo; + +/** + * + * @Date 2022/1/12 23:00 + */ +public class ExchangisLaunchedTaskMetricsVo { + private String taskId; + + private String name; + + private String status; + + private ExchangisMetricsVo metrics; + //private Map metrics; + + public ExchangisLaunchedTaskMetricsVo(){ + + } + + public ExchangisLaunchedTaskMetricsVo(String taskId, String name, String status, ExchangisMetricsVo metrics){ + this.taskId = taskId; + this.name = name; + this.status = status; + this.metrics = metrics; + } + + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public ExchangisMetricsVo getMetrics() { + return metrics; + } + + public void setMetrics(ExchangisMetricsVo metrics) { + this.metrics = metrics; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisProgressVo.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisProgressVo.java new file mode 100644 index 000000000..4db843806 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/vo/ExchangisProgressVo.java @@ -0,0 +1,51 @@ +package com.webank.wedatasphere.exchangis.job.server.vo; + +import com.webank.wedatasphere.exchangis.job.launcher.domain.task.TaskStatus; + + +public class ExchangisProgressVo { + protected TaskStatus status; + + protected Double progress = 0.0d; + + protected Boolean allTaskStatus; + + public ExchangisProgressVo(){ + + } + + public ExchangisProgressVo(TaskStatus status, Double progress){ + this.status = status; + this.progress = progress; + } + + public ExchangisProgressVo(TaskStatus status, Double progress, Boolean allTaskStatus){ + this.status = status; + this.progress = progress; + this.allTaskStatus = allTaskStatus; + } + + public TaskStatus getStatus() { + return status; + } + + public void setStatus(TaskStatus status) { + this.status = status; + } + + public Double getProgress() { + return progress; + } + + public void setProgress(Double progress) { + this.progress = progress; + } + + public Boolean getAllTaskStatus() { + return allTaskStatus; + } + + public void setAllTaskStatus(Boolean allTaskStatus) { + this.allTaskStatus = allTaskStatus; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/DefaultRpcJobLogger.scala b/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/DefaultRpcJobLogger.scala new file mode 100644 index 000000000..62cc242d3 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/DefaultRpcJobLogger.scala @@ -0,0 +1,33 @@ +package com.webank.wedatasphere.exchangis.job.server.log + +import com.webank.wedatasphere.exchangis.job.listener.JobLogListener +import com.webank.wedatasphere.exchangis.job.listener.events.JobLogEvent +import com.webank.wedatasphere.exchangis.job.listener.events.JobLogEvent.Level +import org.slf4j.{Logger, LoggerFactory} + +/** + * Custom job logger, use log4j to record job logs + */ +class DefaultRpcJobLogger extends JobLogListener{ + + override def getLogger: Logger = DefaultRpcJobLogger.LOG + + /** + * Listen the event + * + * @param event event + */ + override def onEvent(event: JobLogEvent): Unit = { + val message = s"[${event.getTenancy}:${event.getJobExecutionId}] ${event.getMessage}" + event.getLevel match { + case Level.INFO => getLogger.info(message, event.getArgs: _*) + case Level.ERROR => getLogger.error(message, event.getArgs: _*) + case Level.WARN => getLogger.warn(message, event.getArgs: _*) + case _ => getLogger.trace(message, event.getArgs) + } + } +} + +object DefaultRpcJobLogger{ + private final val LOG: Logger = LoggerFactory.getLogger(this.getClass) +} diff --git a/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/JobLogService.scala b/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/JobLogService.scala new file mode 100644 index 000000000..f581f400c --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/JobLogService.scala @@ -0,0 +1,22 @@ +package com.webank.wedatasphere.exchangis.job.server.log +import java.util + +import com.webank.wedatasphere.exchangis.job.log.{LogQuery, LogResult} +import com.webank.wedatasphere.exchangis.job.server.log.cache.JobLogCache + + +/** + * Job Log service + */ +trait JobLogService{ + + def getOrCreateLogCache(jobExecId: String): JobLogCache[String] + + def logsFromPage(jobExecId: String, logQuery: LogQuery): LogResult + + def logsFromPageAndPath(logPath: String, logQuery: LogQuery): LogResult + + def appendLog(tenancy: String, jobExecId: String, logs: util.List[String]): Unit + + def appendLog(jobExecId: String, logs: util.List[String]): Unit +} diff --git a/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/cache/FileHandleCache.scala b/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/cache/FileHandleCache.scala new file mode 100644 index 000000000..415393b29 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/cache/FileHandleCache.scala @@ -0,0 +1,5 @@ +package com.webank.wedatasphere.exchangis.job.server.log.cache + +trait FileHandleCache { + +} diff --git a/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/cache/FileHandleLocalCache.scala b/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/cache/FileHandleLocalCache.scala new file mode 100644 index 000000000..f7ec6298d --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/cache/FileHandleLocalCache.scala @@ -0,0 +1,5 @@ +package com.webank.wedatasphere.exchangis.job.server.log.cache + +class FileHandleLocalCache { + +} diff --git a/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/cache/JobLogCache.scala b/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/cache/JobLogCache.scala new file mode 100644 index 000000000..1986373ae --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/cache/JobLogCache.scala @@ -0,0 +1,100 @@ +package com.webank.wedatasphere.exchangis.job.server.log.cache + +import java.util +import java.util.concurrent.{ArrayBlockingQueue, Future} + +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisJobServerException +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.SchedulerThread +import org.apache.linkis.common.utils.{Logging, Utils} +import org.apache.linkis.scheduler.Scheduler +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode.LOG_OP_ERROR +import com.webank.wedatasphere.exchangis.job.server.log.JobLogService +import com.webank.wedatasphere.exchangis.job.server.utils.SpringContextHolder +import org.slf4j.{Logger, LoggerFactory} +trait JobLogCache[V] extends Logging { + def cacheLog(log: V) + + def flushCache(isEnd: Boolean): Unit +} + +object JobLogCacheUtils{ + lazy val jobLogService: JobLogService = SpringContextHolder.getBean(classOf[JobLogService]) + val LOG: Logger = LoggerFactory.getLogger(classOf[JobLogCache[String]]) + def flush(jobExecId: String, isEnd: Boolean = false): Unit ={ + Utils.tryAndWarn{ + jobLogService match { + case service: JobLogService => service.getOrCreateLogCache(jobExecId) match { + case cache: JobLogCache[String] => cache.flushCache(isEnd) + } + case _ => + } + }(LOG) + } +} +abstract class AbstractJobLogCache[V](scheduler: Scheduler, maxSize: Int = 100, flushInterval: Int = 2000) extends JobLogCache[V] with SchedulerThread{ + + var lastFlush: Long = -1L + + var cacheQueue: util.concurrent.ArrayBlockingQueue[Any] = new ArrayBlockingQueue[Any](maxSize) + + var isShutdown: Boolean = false + + var flushFuture: Future[_] = _ + /** + * Start entrance + */ + override def start(): Unit = { + this.flushFuture = scheduler match { + case scheduler: Scheduler => scheduler.getSchedulerContext.getOrCreateConsumerManager.getOrCreateExecutorService.submit(this) + case _ => throw new ExchangisJobServerException(LOG_OP_ERROR.getCode, s"TaskScheduler cannot be empty, please set it before starting the [$getName]") + } + } + + override def run(): Unit = { + Thread.currentThread.setName(s"JobLogCache-Refresher-$getName") + info(s"Thread: [ ${Thread.currentThread.getName} ] is started.") + while (!isShutdown){ + Utils.tryAndError{ + flushCache(false) + lastFlush = System.currentTimeMillis + } + Utils.tryAndError(Thread.sleep(flushInterval)) + } + info(s"Thread: [ ${Thread.currentThread.getName} ] is stopped.") + } + + override def cacheLog(log: V): Unit = { + val element: Any = getCacheQueueElement(log) + if (!cacheQueue.offer(element)) { + warn("The cache queue is full, should flush the cache immediately") + flushCache(false) + } else if (lastFlush + flushInterval < System.currentTimeMillis){ + trace("The cache has reached the time to be flush") + flushCache(false) + } else onCache(log) + } + + protected def onCache(log: V): Unit = { + // Do nothing + } + /** + * Stop entrance + */ + override def stop(): Unit = { + Option(this.flushFuture).foreach( future => { + this.isShutdown = true + future.cancel(true) + }) + } + + /** + * Name + * + * @return + */ + override def getName: String = "Default" + + def getCacheQueueElement(log: V): Any = { + log + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/cache/JobLogRpcCache.scala b/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/cache/JobLogRpcCache.scala new file mode 100644 index 000000000..1e5a3e072 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/cache/JobLogRpcCache.scala @@ -0,0 +1,50 @@ +//package com.webank.wedatasphere.exchangis.job.server.log.cache +// +//import java.util +// +//import org.apache.linkis.scheduler.Scheduler +//import java.util.concurrent.{ArrayBlockingQueue, ConcurrentHashMap} +//import java.util.concurrent.locks.ReentrantLock +// +//abstract class JobLogRpcCache(scheduler: Scheduler, maxSize: Int = 1000, flushInterval: Int = 100) extends AbstractJobLogCache[RpcCacheId, String](scheduler,maxSize,flushInterval) { +// val rpcCacheSplits: ConcurrentHashMap[String, ServerLogSplit] = new ConcurrentHashMap[String, ServerLogSplit] +// /** +// * Sync to flush special cache +// * @param cacheId id +// */ +// override def flushCache(cacheId: RpcCacheId): Unit = { +// } +// +// override def flushCache(): Unit = { +// +// } +// +// override def onCache(cacheId: RpcCacheId, log: String): Unit = { +// rpcCacheSplits.computeIfAbsent(s"${cacheId.protocol}://${cacheId.address}:${cacheId.port}", (serverUrl: String) => { +// new ServerLogSplit() +// }) match { +// case split: ServerLogSplit => split.queue.add(log) +// case _ => +// } +// } +// override def getCacheQueueElement(cacheId: RpcCacheId, log: String): Any = { +// // Just use the Int token as element +// 1 +// } +// +// def rpcCall(serverUrl: String, jobExecId: String, tenancy: String, logs: util.List[String]) +// +// class ServerLogSplit{ +// val splitLock: ReentrantLock = new ReentrantLock +// val queue: util.Queue[String] = new ArrayBlockingQueue[String](maxSize) +// } +//} +//object JobLogRpcCache{ +// implicit def scalaFunctionToJava[From, To](function: (From) => To): java.util.function.Function[From, To] = { +// new java.util.function.Function[From, To] { +// override def apply(input: From): To = function(input) +// } +// } +//} +//case class RpcCacheId(address: String, port: String, jobExecId: String, tenancy: String = "default", protocol: String = "http") +// diff --git a/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/client/JobLogHttpClient.scala b/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/client/JobLogHttpClient.scala new file mode 100644 index 000000000..f63f1fdb3 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/client/JobLogHttpClient.scala @@ -0,0 +1,17 @@ +package com.webank.wedatasphere.exchangis.job.server.log.client + +import com.webank.wedatasphere.exchangis.job.server.utils.SpringContextHolder +import org.springframework.context.ApplicationContext + +class JobLogHttpClient { + +} +object JobLogHttpClient{ + def main(args: Array[String]): Unit = { + val spring: ApplicationContext = SpringContextHolder.getApplicationContext + spring match { + case e: ApplicationContext => print("hello world") + case _ => print("none") + } + } +} \ No newline at end of file diff --git a/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/serivce/DefaultJobLogService.scala b/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/serivce/DefaultJobLogService.scala new file mode 100644 index 000000000..b5baa50df --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/scala/com/webank/wedatasphere/exchangis/job/server/log/serivce/DefaultJobLogService.scala @@ -0,0 +1,19 @@ +package com.webank.wedatasphere.exchangis.job.server.log.serivce + +import java.util + +import com.webank.wedatasphere.exchangis.job.log.{LogQuery, LogResult} +import com.webank.wedatasphere.exchangis.job.server.log.JobLogService +import com.webank.wedatasphere.exchangis.job.server.log.cache.JobLogCache + +class DefaultJobLogService extends JobLogService{ + override def getOrCreateLogCache(jobExecId: String): JobLogCache[String] = ??? + + override def logsFromPage(jobExecId: String, logQuery: LogQuery): LogResult = ??? + + override def appendLog(tenancy: String, jobExecId: String, logs: util.List[String]): Unit = ??? + + override def appendLog(jobExecId: String, logs: util.List[String]): Unit = ??? + + override def logsFromPageAndPath(logPath: String, logQuery: LogQuery): LogResult = ??? +} diff --git a/exchangis-job/exchangis-job-server/src/main/test/com/webank/wedatasphere/exchangis/job/server/builder/JobBuilderMainProgress.java b/exchangis-job/exchangis-job-server/src/main/test/com/webank/wedatasphere/exchangis/job/server/builder/JobBuilderMainProgress.java new file mode 100644 index 000000000..0d83c2cde --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/test/com/webank/wedatasphere/exchangis/job/server/builder/JobBuilderMainProgress.java @@ -0,0 +1,61 @@ +package com.webank.wedatasphere.exchangis.job.server.builder; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.webank.wedatasphere.exchangis.datasource.core.utils.Json; +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisEngineJob; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobVO; +import com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob; +import com.webank.wedatasphere.exchangis.job.server.builder.engine.DataxExchangisEngineJob; +import com.webank.wedatasphere.exchangis.job.server.builder.engine.SqoopExchangisEngineJob; +import com.webank.wedatasphere.exchangis.job.server.builder.transform.TransformExchangisJob; + +import java.security.SecureRandom; +import java.util.*; + +public class JobBuilderMainProgress { + + public static void main(String[] args) throws Exception{ +// System.setProperty("log4j.configurationFile", "C:\\Users\\hadoop\\IdeaProjects\\Exchangis\\assembly-package\\config\\log4j2.xml"); + System.setProperty("log4j.configurationFile", "C:\\Users\\davidhua\\IdeaProjects\\Exchangis\\assembly-package\\config\\log4j2.xml"); + SpringExchangisJobBuilderManager jobBuilderManager = new SpringExchangisJobBuilderManager(); + jobBuilderManager.init(); + ExchangisJobInfo jobInfo = getDemoSqoopJobInfo(); + ExchangisJobBuilderContext ctx = new ExchangisJobBuilderContext(); + ctx.setOriginalJob(jobInfo); + // ExchangisJob -> ExchangisTransformJob(SubExchangisJob) + TransformExchangisJob transformJob = jobBuilderManager.doBuild(jobInfo, TransformExchangisJob.class, ctx); + List engineJobs = new ArrayList<>(); + // ExchangisTransformJob(SubExchangisJob) -> List + for(SubExchangisJob subExchangisJob : transformJob.getSubJobSet()){ + Optional.ofNullable(jobBuilderManager.doBuild(subExchangisJob, + SubExchangisJob.class, ExchangisEngineJob.class, ctx)).ifPresent(engineJobs::add); + } + engineJobs.forEach(engineJob -> { + if(engineJob instanceof DataxExchangisEngineJob){ + Map code = Json.fromJson(((DataxExchangisEngineJob)engineJob).getCode(), Map.class); + try { + System.out.println(Json.getMapper().writerWithDefaultPrettyPrinter().writeValueAsString(code)); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + }else if(engineJob instanceof SqoopExchangisEngineJob){ + try { + System.out.println(Json.getMapper().writerWithDefaultPrettyPrinter().writeValueAsString(engineJobs)); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + } + }); + } + + public static ExchangisJobInfo getDemoSqoopJobInfo(){ + ExchangisJobVO job = new ExchangisJobVO(); + job.setId((long) new SecureRandom().nextInt(100)); + job.setJobName("Job-Builder-Main"); + job.setContent("[{\"subjobName\":\"subjob1\",\"dataSources\":{\"source_id\":\"MYSQL.10002.db_mask.table_source\",\"sink_id\":\"MYSQL.10002.db_mask.table_sink\"},\"params\":{\"sources\":[{\"config_key\":\"exchangis.job.mysql.write_type\",\"config_name\":\"写入方式\",\"config_value\":\"insert\",\"sort\":1},{\"config_key\":\"exchangis.job.mysql.batch_size\",\"config_name\":\"批量大小\",\"config_value\":1000,\"sort\":2}],\"sinks\":[{\"config_key\":\"exchangis.job.mysql.write_type\",\"config_name\":\"写入方式\",\"config_value\":\"insert\",\"sort\":1},{\"config_key\":\"exchangis.job.mysql.batch_size\",\"config_name\":\"批量大小\",\"config_value\":1000,\"sort\":2}]},\"transforms\":{\"type\":\"MAPPING\",\"sql\":\"\",\"mapping\":[{\"source_field_name\":\"field1\",\"source_field_type\":\"varchar\",\"sink_field_name\":\"field2\",\"sink_field_type\":\"varchar\",\"validator\":[\">100\",\"<200\"],\"transformer\":{\"name\":\"ex_substr\",\"params\":[\"1\",\"3\"]}},{\"source_field_name\":\"field3\",\"source_field_type\":\"varchar\",\"sink_field_name\":\"field4\",\"sink_field_type\":\"varchar\",\"validator\":[\"like'%example'\"],\"transformer\":{\"name\":\"ex_replace\",\"params\":[\"1\",\"3\",\"***\"]}}]},\"settings\":[{\"config_key\":\"errorlimit_percentage\",\"config_name\":\"脏数据占比阈值\",\"config_value\":\"insert\",\"sort\":1},{\"config_key\":\"errorlimit_record\",\"config_name\":\"脏数据最大记录数\",\"config_value\":\"10\",\"sort\":2}]}]"); + job.setEngineType("sqoop"); + return new ExchangisJobInfo(job); + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/test/com/webank/wedatasphere/exchangis/job/server/builder/JobBuilderTest.java b/exchangis-job/exchangis-job-server/src/main/test/com/webank/wedatasphere/exchangis/job/server/builder/JobBuilderTest.java new file mode 100644 index 000000000..e2472d34e --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/test/com/webank/wedatasphere/exchangis/job/server/builder/JobBuilderTest.java @@ -0,0 +1,219 @@ +package com.webank.wedatasphere.exchangis.job.server.builder; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisEngineJob; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobVO; +import com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode; +import com.webank.wedatasphere.exchangis.job.server.builder.transform.TransformExchangisJob; + +import java.util.*; + +public class JobBuilderTest { + + private static SpringExchangisJobBuilderManager jobBuilderManager = new SpringExchangisJobBuilderManager(); + + static { + jobBuilderManager.init(); + } + + public static void main(String[] args) throws ExchangisJobException, JsonProcessingException { + + String code = "{\n" + + " \"job\": {\n" + + " \"content\":[\n" + + " {\n" + + " \"reader\": {\n" + + " \"name\": \"txtfilereader\", \n" + + " \"parameter\": {\n" + + " \"path\":[\"/opt/install/datax/data/test1.csv\"],\n" + + " \"encoding\":\"gbk\",\n" + + " \"column\": [\n" + + " {\n" + + " \"index\":0,\n" + + " \"type\":\"string\"\n" + + " },\n" + + " {\n" + + " \"index\":1,\n" + + " \"type\":\"string\"\n" + + " }\n" + + " ], \n" + + " \"fileldDelimiter\":\",\"\n" + + " }\n" + + " }, \n" + + " \"writer\": {\n" + + " \"name\": \"mysqlwriter\", \n" + + " \"parameter\": {\n" + + " \"username\": \"root\",\n" + + " \"password\": \"MTIzNDU2\", \n" + + " \"column\": [\n" + + " \"i\",\n" + + " \"j\"\n" + + " ],\n" + + " \"preSql\": [], \n" + + " \"connection\": [\n" + + " {\n" + + " \"jdbcUrl\":\"jdbc:mysql://172.24.2.61:3306/test\", \n" + + " \"table\": [\"testtab\"]\n" + + " }\n" + + " ]\n" + + " }\n" + + " }\n" + + " }\n" + + " ], \n" + + " \"setting\": {\n" + + " \"speed\": {\n" + + " \"channel\": \"4\"\n" + + " }\n" + + " }\n" + + " }\n" + + "}"; +// System.out.println(code); + + ExchangisJobInfo job = getSqoopJob(); + System.out.println(job.getName()); + ExchangisJobBuilderContext ctx = new ExchangisJobBuilderContext(); + ctx.putEnv("USER_NAME", "xxxxyyyyzzzz"); + ctx.setOriginalJob(job); + TransformExchangisJob transformJob = jobBuilderManager.doBuild(job, TransformExchangisJob.class, ctx); + List engineJobs = new ArrayList<>(); + + + for (SubExchangisJob subExchangisJob : transformJob.getSubJobSet()) { + String sourceDsId = subExchangisJob.getRealmParams(SubExchangisJob.REALM_JOB_CONTENT_SOURCE).get("datasource").getValue().toString(); + String sinkDsId = subExchangisJob.getRealmParams(SubExchangisJob.REALM_JOB_CONTENT_SINK).get("datasource").getValue().toString(); +// if (!ctx.containsDatasourceParam(sourceDsId)) { +// Map sourceDsParam = getDsParam(sourceDsId); +// ctx.putDatasourceParam(sourceDsId, sourceDsParam); +// } +// if (!ctx.containsDatasourceParam(sinkDsId)) { +// Map sinkDsParam = getDsParam(sinkDsId); +// ctx.putDatasourceParam(sinkDsId, sinkDsParam); +// } + // connectParams + Optional.ofNullable(jobBuilderManager.doBuild(subExchangisJob, + SubExchangisJob.class, ExchangisEngineJob.class, ctx)).ifPresent(engineJobs::add); + } + + // List -> List + List launchableTasks = new ArrayList<>(); + for (ExchangisEngineJob engineJob : engineJobs) { + Optional.ofNullable(jobBuilderManager.doBuild(engineJob, + ExchangisEngineJob.class, LaunchableExchangisTask.class, ctx)).ifPresent(launchableTasks::add); + } + if (launchableTasks.isEmpty()) { + throw new ExchangisJobException(ExchangisJobExceptionCode.TASK_BUILDER_ERROR.getCode(), + "The result set of launcher job is empty, please examine your job entity, [ 生成LauncherJob为空 ]", null); + } + + for (LaunchableExchangisTask launchableTask : launchableTasks) { + System.out.println(launchableTask.getName()); + } + + } + + public static ExchangisJobInfo getSqoopJob() { + ExchangisJobVO job = new ExchangisJobVO(); + job.setId(22L); + job.setProjectId(1456173825011081218L); + job.setJobName("T_SQOOP"); + job.setJobType("OFFLINE"); + job.setEngineType("DATAX"); + job.setJobLabels(""); + job.setJobDesc(""); + job.setContent("[{\n" + + " \"subJobName\": \"new\",\n" + + " \"dataSources\": {\n" + + " \"source_id\": \"HIVE.34.test.psn\",\n" + + " \"sink_id\": \"MYSQL.29.test.t_psn\"\n" + + " },\n" + + " \"params\": {\n" + + " \"sources\": [{\n" + + " \"config_key\": \"exchangis.job.ds.params.sqoop.hive.r.trans_proto\",\n" + + " \"config_name\": \"传输方式\",\n" + + " \"config_value\": \"记录\",\n" + + " \"sort\": 1\n" + + " }, {\n" + + " \"config_key\": \"exchangis.job.ds.params.sqoop.hive.r.partition\",\n" + + " \"config_name\": \"分区信息\",\n" + + " \"config_value\": \"year,month=2018,09\",\n" + + " \"sort\": 2\n" + + " }, {\n" + + " \"config_key\": \"exchangis.job.ds.params.sqoop.hive.r.row_format\",\n" + + " \"config_name\": \"字段格式\",\n" + + " \"config_value\": \"1\",\n" + + " \"sort\": 3\n" + + " }],\n" + + " \"sinks\": [{\n" + + " \"config_key\": \"exchangis.job.ds.params.sqoop.mysql.w.write_type\",\n" + + " \"config_name\": \"写入方式\",\n" + + " \"config_value\": \"UPDATEONLY\",\n" + + " \"sort\": 1\n" + + " }, {\n" + + " \"config_key\": \"exchangis.job.ds.params.sqoop.mysql.w.batch_size\",\n" + + " \"config_name\": \"批量大小\",\n" + + " \"config_value\": \"1\",\n" + + " \"sort\": 2\n" + + " }]\n" + + " },\n" + + " \"transforms\": {\n" + + " \"addEnable\": false,\n" + + " \"type\": \"MAPPING\",\n" + + " \"sql\": null,\n" + + " \"mapping\": [\n" + + " {\n" + + " \"sink_field_name\": \"id\",\n" + + " \"sink_field_type\": \"INT\",\n" + + " \"validator\": [],\n" + + " \"transformer\": {},\n" + + " \"source_field_name\": \"id\",\n" + + " \"source_field_type\": \"INT\"\n" + + " }, {\n" + + " \"sink_field_name\": \"age\",\n" + + " \"sink_field_type\": \"INT\",\n" + + " \"validator\": [],\n" + + " \"transformer\": {},\n" + + " \"source_field_name\": \"age\",\n" + + " \"source_field_type\": \"INT\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"settings\": [{\n" + + " \"config_key\": \"exchangis.sqoop.setting.max.parallelism\",\n" + + " \"config_name\": \"作业最大并行数\",\n" + + " \"config_value\": \"1\",\n" + + " \"sort\": 1\n" + + " }, {\n" + + " \"config_key\": \"exchangis.sqoop.setting.max.memory\",\n" + + " \"config_name\": \"作业最大内存\",\n" + + " \"config_value\": \"1\",\n" + + " \"sort\": 2\n" + + " }]\n" + + "}]"); + job.setProxyUser("hdfs"); + job.setSyncType("FULL"); + job.setJobParams("{}"); + return new ExchangisJobInfo(job); + } + + public static Map getDsParam(String id) { + Map params = new HashMap<>(); + if (id.equals("29")) { + params.put("host", "192.168.0.66"); + params.put("port", "3306"); + params.put("username", "scm"); + params.put("password", "scm_@casc2f"); + } + if (id.equals("34")) { + params.put("host", "192.168.0.111"); + params.put("port", "9083"); + params.put("uris", "thrift://192.168.0.111:9083"); + } + return params; + } + +} diff --git a/exchangis-job/exchangis-job-server/src/main/test/com/webank/wedatasphere/exchangis/job/server/builder/TestDataXJobBuilder.java b/exchangis-job/exchangis-job-server/src/main/test/com/webank/wedatasphere/exchangis/job/server/builder/TestDataXJobBuilder.java new file mode 100644 index 000000000..7d2121294 --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/test/com/webank/wedatasphere/exchangis/job/server/builder/TestDataXJobBuilder.java @@ -0,0 +1,82 @@ +package com.webank.wedatasphere.exchangis.job.server.builder; + +import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisEngineJob; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobVO; +import com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode; +import com.webank.wedatasphere.exchangis.job.server.builder.transform.TransformExchangisJob; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +public class TestDataXJobBuilder { + + private static SpringExchangisJobBuilderManager jobBuilderManager = new SpringExchangisJobBuilderManager(); + + static { + jobBuilderManager.init(); + } + + public static void main(String[] args) throws ExchangisJobException { + ExchangisJobVO job = getDataxJob(); + ExchangisJobBuilderContext ctx = new ExchangisJobBuilderContext(); + ctx.putEnv("USER_NAME", "xxxxyyyyzzzz"); + ExchangisJobInfo jobInfo = new ExchangisJobInfo(job); + ctx.setOriginalJob(jobInfo); + TransformExchangisJob transformJob = jobBuilderManager.doBuild(jobInfo, TransformExchangisJob.class, ctx); + List engineJobs = new ArrayList<>(); + + + for (SubExchangisJob subExchangisJob : transformJob.getSubJobSet()) { + String sourceDsId = subExchangisJob.getRealmParams(SubExchangisJob.REALM_JOB_CONTENT_SOURCE).get("datasource").getValue().toString(); + String sinkDsId = subExchangisJob.getRealmParams(SubExchangisJob.REALM_JOB_CONTENT_SINK).get("datasource").getValue().toString(); + // if (!ctx.containsDatasourceParam(sourceDsId)) { + // Map sourceDsParam = getDsParam(sourceDsId); + // ctx.putDatasourceParam(sourceDsId, sourceDsParam); + // } + // if (!ctx.containsDatasourceParam(sinkDsId)) { + // Map sinkDsParam = getDsParam(sinkDsId); + // ctx.putDatasourceParam(sinkDsId, sinkDsParam); + // } + // connectParams + Optional.ofNullable(jobBuilderManager.doBuild(subExchangisJob, + SubExchangisJob.class, ExchangisEngineJob.class, ctx)).ifPresent(engineJobs::add); + } + + // List -> List + List launchableTasks = new ArrayList<>(); + for (ExchangisEngineJob engineJob : engineJobs) { + Optional.ofNullable(jobBuilderManager.doBuild(engineJob, + ExchangisEngineJob.class, LaunchableExchangisTask.class, ctx)).ifPresent(launchableTasks::add); + } + if (launchableTasks.isEmpty()) { + throw new ExchangisJobException(ExchangisJobExceptionCode.TASK_BUILDER_ERROR.getCode(), + "The result set of launcher job is empty, please examine your job entity, [ 生成LauncherJob为空 ]", null); + } + + for (LaunchableExchangisTask launchableTask : launchableTasks) { + System.out.println(launchableTask.getName()); + } + } + + public static ExchangisJobVO getDataxJob() { + ExchangisJobVO job = new ExchangisJobVO(); + job.setId(22L); + job.setProjectId(1456173825011081218L); +// job.setName("T_DATAX"); + job.setJobType("OFFLINE"); + job.setEngineType("DATAX"); + job.setJobLabels(""); + job.setJobDesc(""); + job.setProxyUser("hdfs"); + job.setSyncType("FULL"); + job.setJobParams("{}"); + job.setContent("[{\"subJobName\":\"TjpQkiAeGfTe\",\"dataSources\":{\"source_id\":\"HIVE.22.test.psn\",\"sink_id\":\"MYSQL.29.test.t_psn\"},\"params\":{\"sources\":[{\"config_key\":\"exchangis.job.ds.params.datax.hive.r.trans_proto\",\"config_name\":\"传输方式\",\"config_value\":\"记录\",\"sort\":1},{\"config_key\":\"exchangis.job.ds.params.datax.hive.r.partition\",\"config_name\":\"分区信息\",\"config_value\":\"\",\"sort\":2},{\"config_key\":\"exchangis.job.ds.params.datax.hive.r.row_format\",\"config_name\":\"字段格式\",\"config_value\":\"\",\"sort\":3}],\"sinks\":[{\"config_key\":\"exchangis.job.ds.params.datax.mysql.w.write_type\",\"config_name\":\"写入方式\",\"config_value\":\"INSERT\",\"sort\":1},{\"config_key\":\"exchangis.job.ds.params.datax.mysql.w.batch_size\",\"config_name\":\"批量大小\",\"config_value\":\"1000\",\"sort\":2}]},\"transforms\":{\"type\":\"MAPPING\",\"mapping\":[{\"sink_field_name\":\"id\",\"sink_field_type\":\"INT\",\"sink_field_index\":0,\"sink_field_editable\":true,\"validator\":[\"> 1\"],\"transformer\":{\"name\":\"ex_pad\",\"params\":[\"r\",\"3\",\"0\"]},\"deleteEnable\":false,\"source_field_name\":\"id\",\"source_field_type\":\"int\",\"source_field_index\":0,\"source_field_editable\":false},{\"sink_field_name\":\"age\",\"sink_field_type\":\"INT\",\"sink_field_index\":1,\"sink_field_editable\":true,\"validator\":[\"> 0\"],\"transformer\":{\"name\":\"ex_pad\",\"params\":[\"l\",\"3\",\"0\"]},\"deleteEnable\":false,\"source_field_name\":\"age\",\"source_field_type\":\"int\",\"source_field_index\":1,\"source_field_editable\":false}],\"addEnable\":false},\"settings\":[{\"config_key\":\"exchangis.datax.setting.speed.bytes\",\"config_name\":\"作业速率限制\",\"config_value\":\"1000\",\"sort\":1},{\"config_key\":\"exchangis.datax.setting.speed.records\",\"config_name\":\"作业记录数限制\",\"config_value\":\"1000\",\"sort\":2},{\"config_key\":\"exchangis.datax.setting.max.parallelism\",\"config_name\":\"作业最大并行度\",\"config_value\":\"1\",\"sort\":3},{\"config_key\":\"exchangis.datax.setting.max.memory\",\"config_name\":\"作业最大使用内存\",\"config_value\":\"2000\",\"sort\":4},{\"config_key\":\"exchangis.datax.setting.errorlimit.record\",\"config_name\":\"最多错误记录数\",\"config_value\":\"1000\",\"sort\":5}]}]"); + return job; + } +} diff --git a/exchangis-job/exchangis-job-server/src/main/test/com/webank/wedatasphere/exchangis/job/server/execution/JobExecutionUnitTest.java b/exchangis-job/exchangis-job-server/src/main/test/com/webank/wedatasphere/exchangis/job/server/execution/JobExecutionUnitTest.java new file mode 100644 index 000000000..ed992d87f --- /dev/null +++ b/exchangis-job/exchangis-job-server/src/main/test/com/webank/wedatasphere/exchangis/job/server/execution/JobExecutionUnitTest.java @@ -0,0 +1,152 @@ +package com.webank.wedatasphere.exchangis.job.server.execution; + +import com.webank.wedatasphere.exchangis.job.exception.ExchangisOnEventException; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisJob; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask; +import com.webank.wedatasphere.exchangis.job.launcher.manager.LinkisExchangisTaskLaunchManager; +import com.webank.wedatasphere.exchangis.job.listener.events.JobLogEvent; +import com.webank.wedatasphere.exchangis.job.listener.JobLogListener; +import com.webank.wedatasphere.exchangis.job.server.builder.JobBuilderMainProgress; +import com.webank.wedatasphere.exchangis.job.server.builder.SpringExchangisJobBuilderManager; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisSchedulerRetryException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskExecuteException; +import com.webank.wedatasphere.exchangis.job.server.exception.ExchangisTaskGenerateException; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.DefaultTaskGenerator; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.DefaultTaskGeneratorContext; +import com.webank.wedatasphere.exchangis.job.server.execution.generator.TaskGenerator; +import com.webank.wedatasphere.exchangis.job.server.execution.loadbalance.FlexibleTenancyLoadBalancer; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.*; +import com.webank.wedatasphere.exchangis.job.server.execution.scheduler.tasks.GenerationSchedulerTask; +import com.webank.wedatasphere.exchangis.job.server.execution.subscriber.MaxUsageTaskChooseRuler; +import com.webank.wedatasphere.exchangis.job.server.execution.subscriber.NewInTaskObserver; +import com.webank.wedatasphere.exchangis.job.server.execution.subscriber.TaskObserver; +import com.webank.wedatasphere.exchangis.job.server.log.DefaultRpcJobLogger; +import org.apache.linkis.scheduler.Scheduler; +import org.apache.linkis.scheduler.executer.ExecutorManager; +import org.apache.linkis.scheduler.queue.JobInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +/** + * Unit test of execution module + */ +public class JobExecutionUnitTest { +// private static final Logger LOG = LoggerFactory.getLogger(JobExecutionUnitTest.class); + + public static void main(String[] args) throws ExchangisTaskExecuteException { +// System.setProperty("log4j.configurationFile", "C:\\Users\\davidhua\\IdeaProjects\\Exchangis\\assembly-package\\config\\log4j2.xml"); + System.setProperty("log4j.configurationFile", "C:\\Users\\hadoop\\IdeaProjects\\Exchangis\\assembly-package\\config\\log4j2.xml"); + System.setProperty("wds.exchangis.job.scheduler.consumer.tenancies", "hadoop"); + final Logger LOG = LoggerFactory.getLogger(JobExecutionUnitTest.class); + LOG.info("Job Execution Unit Test begin to launch"); + // Logger + DefaultRpcJobLogger jobLogger = new DefaultRpcJobLogger(); + jobLogger.onEvent(new JobLogEvent(UUID.randomUUID().toString(), "That is just a test")); + // Start an endless thread to hold the running of program + new Thread(new EndlessThread()).start(); + try { +// JobLogListener logListener = getLogListener(); + // Task Generator + SpringExchangisJobBuilderManager jobBuilderManager = new SpringExchangisJobBuilderManager(); + jobBuilderManager.init(); + TaskGenerator taskGenerator = new DefaultTaskGenerator(new DefaultTaskGeneratorContext(jobLogger), jobBuilderManager); + // Executor manager + ExecutorManager executorManager = new ExchangisSchedulerExecutorManager(); + // Tenancy consumer manager + TenancyParallelConsumerManager consumerManager = new TenancyParallelConsumerManager(); + consumerManager.setInitResidentThreads(4); + // Task manager + TaskManager taskManager = new DefaultTaskManager(jobLogger); + Scheduler scheduler = new ExchangisGenericScheduler(executorManager, consumerManager); + scheduler.init(); + // Load balancer + FlexibleTenancyLoadBalancer loadBalancer = new FlexibleTenancyLoadBalancer(scheduler, taskManager); + // Task observers + List> observers = new ArrayList<>(); + NewInTaskObserver newInObserver = new NewInTaskObserver(); + observers.add(newInObserver); + // Launcher manager + LinkisExchangisTaskLaunchManager launchManager = new LinkisExchangisTaskLaunchManager(); + launchManager.init(); + // Task execution + TaskExecution execution = + new DefaultTaskExecution(scheduler, launchManager, taskManager, observers, loadBalancer, new MaxUsageTaskChooseRuler()); + execution.start(); + // Test submit + execution.submit(getTestUnitTask("hadoop")); + // Submit LaunchableExchangisTask + submitTest(execution, newInObserver); + // Generate + generateTest(execution, taskGenerator, "davidhua"); + } catch (Exception e){ + LOG.error("Job Execution Unit Test shutdown", e); + } + } + + private static void generateTest(TaskExecution execution, + TaskGenerator taskGenerator, + String tenancy) throws ExchangisSchedulerException, ExchangisTaskGenerateException { + GenerationSchedulerTask task = new GenerationSchedulerTask(taskGenerator, JobBuilderMainProgress.getDemoSqoopJobInfo()); + task.setTenancy(tenancy); + execution.submit(task); + } + private static void submitTest(TaskExecution execution, NewInTaskObserver newInTaskObserver){ + LaunchableExchangisTask task = new LaunchableExchangisTask(); + task.setId(1694451505815490560L); + task.setJobExecutionId(UUID.randomUUID().toString()); + newInTaskObserver.getCacheQueue().offer(task); + } + + private static JobLogListener getLogListener(){ + return new JobLogListener() { + @Override + public void onEvent(JobLogEvent event) throws ExchangisOnEventException { + + } + }; + } + + private static AbstractExchangisSchedulerTask getTestUnitTask(String user){ + return new AbstractExchangisSchedulerTask("execution-test") { + final Logger LOG = LoggerFactory.getLogger(this.getClass()); + @Override + public String getName() { + return null; + } + + @Override + public JobInfo getJobInfo() { + return null; + } + + @Override + public String getTenancy() { + return user; + } + + @Override + protected void schedule() throws ExchangisSchedulerException, ExchangisSchedulerRetryException { + LOG.info("id: [{}] schedule success", getId()); + } + }; + } + private static class EndlessThread implements Runnable{ + + @Override + public void run() { + while(true){ + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + //Ignore + } + } + } + } +} diff --git a/exchangis-job/pom.xml b/exchangis-job/pom.xml new file mode 100644 index 000000000..8d279529f --- /dev/null +++ b/exchangis-job/pom.xml @@ -0,0 +1,36 @@ + + + + exchangis + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-job + pom + 1.0.0-RC1 + + + exchangis-job-common + exchangis-job-server + exchangis-job-builder + exchangis-job-launcher + exchangis-job-metrics + + + + 8 + 8 + + + + + org.modelmapper + modelmapper + 2.4.3 + + + \ No newline at end of file diff --git a/exchangis-plugins/engine/datax/datax-assembly/package.xml b/exchangis-plugins/engine/datax/datax-assembly/package.xml new file mode 100644 index 000000000..d88b54980 --- /dev/null +++ b/exchangis-plugins/engine/datax/datax-assembly/package.xml @@ -0,0 +1,66 @@ + + core + + zip + + false + + + ../datax-core/target/core + / + + + ../datax-hdfsreader/target/plugin + / + + + ../datax-hdfswriter/target/plugin + / + + + ../datax-textfilereader/target/plugin + / + + + ../datax-textfilewriter/target/plugin + / + + + ../datax-ftpreader/target/plugin + / + + + ../datax-ftpwriter/target/plugin + / + + + ../datax-elasticsearchwriter/target/plugin + / + + + ../datax-mysqlreader/target/plugin + / + + + ../datax-mysqlwriter/target/plugin + / + + + ../datax-oraclereader/target/plugin + / + + + ../datax-oraclewriter/target/plugin + / + + + + + true + lib + runtime + + + \ No newline at end of file diff --git a/exchangis-plugins/engine/datax/datax-assembly/pom.xml b/exchangis-plugins/engine/datax/datax-assembly/pom.xml new file mode 100644 index 000000000..c243fc656 --- /dev/null +++ b/exchangis-plugins/engine/datax/datax-assembly/pom.xml @@ -0,0 +1,43 @@ + + + + exchangis-executor-engine-datax + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../pom.xml + + 4.0.0 + + datax-assembly + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2.1 + + + assemble + + single + + + install + + + + false + false + + ${basedir}/package.xml + + datax + ${project.parent.build.directory} + + + + + \ No newline at end of file diff --git a/exchangis-plugins/engine/datax/datax-core/pom.xml b/exchangis-plugins/engine/datax/datax-core/pom.xml new file mode 100644 index 000000000..ae737a761 --- /dev/null +++ b/exchangis-plugins/engine/datax/datax-core/pom.xml @@ -0,0 +1,198 @@ + + + + exchangis-executor-engine-datax + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../pom.xml + + 4.0.0 + jar + ${datax.engine.version} + datax-core + + + com.alibaba + druid + 1.0.15 + + + com.alibaba + fastjson + + + commons-configuration + commons-configuration + + + org.apache.commons + commons-lang3 + + + commons-cli + commons-cli + + + commons-pool + commons-pool + + + commons-beanutils + commons-beanutils + + + org.apache.httpcomponents + httpclient + 4.4 + + + org.apache.httpcomponents + fluent-hc + 4.4 + + + org.codehaus.janino + janino + 2.5.16 + + + org.codehaus.groovy + groovy-all + 2.1.9 + + + net.sourceforge.javacsv + javacsv + 2.0 + + + org.anarres.lzo + lzo-core + 1.0.5 + + + ch.qos.logback + logback-classic + + + org.slf4j + slf4j-api + + + io.airlift + aircompressor + 0.3 + + + com.facebook.presto.hadoop + hadoop-apache2 + 0.3 + provided + + + junit + junit + 4.12 + test + + + org.apache.commons + commons-math3 + + + org.apache.commons + commons-compress + + + commons-io + commons-io + + + com.google.guava + guava + + + com.google.code.gson + gson + + + com.dm + dm + 16 + system + ${basedir}/src/main/lib/Dm7JdbcDriver16.jar + + + com.sybase + jconn3 + 1.0.0-SNAPSHOT + system + ${basedir}/src/main/lib/jconn3-1.0.0-SNAPSHOT.jar + + + ppas + ppas + 16 + system + ${basedir}/src/main/lib/edb-jdbc16.jar + + + + org.apache.hadoop + hadoop-common + ${hadoop.version} + + + org.apache.commons + commons-compress + + + slf4j-log4j12 + org.slf4j + + + + + + + + src/main/resources + + **/* + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2.1 + + + assemble + + single + + + install + + + + false + false + + + com.alibaba.datax.core.Engine + + + + ${basedir}/src/main/assembly/package.xml + + core + + + + + \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-core/src/main/assembly/package.xml b/exchangis-plugins/engine/datax/datax-core/src/main/assembly/package.xml similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/assembly/package.xml rename to exchangis-plugins/engine/datax/datax-core/src/main/assembly/package.xml diff --git a/modules/executor/engine/datax/datax-core/src/main/bin/datax.py b/exchangis-plugins/engine/datax/datax-core/src/main/bin/datax.py similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/bin/datax.py rename to exchangis-plugins/engine/datax/datax-core/src/main/bin/datax.py diff --git a/modules/executor/engine/datax/datax-core/src/main/bin/dxprof.py b/exchangis-plugins/engine/datax/datax-core/src/main/bin/dxprof.py similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/bin/dxprof.py rename to exchangis-plugins/engine/datax/datax-core/src/main/bin/dxprof.py diff --git a/modules/executor/engine/datax/datax-core/src/main/bin/perftrace.py b/exchangis-plugins/engine/datax/datax-core/src/main/bin/perftrace.py similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/bin/perftrace.py rename to exchangis-plugins/engine/datax/datax-core/src/main/bin/perftrace.py diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/base/BaseObject.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/base/BaseObject.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/base/BaseObject.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/base/BaseObject.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/constant/CommonConstant.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/constant/CommonConstant.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/constant/CommonConstant.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/constant/CommonConstant.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/constant/PluginType.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/constant/PluginType.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/constant/PluginType.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/constant/PluginType.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/BoolColumn.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/BoolColumn.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/BoolColumn.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/BoolColumn.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/BytesColumn.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/BytesColumn.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/BytesColumn.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/BytesColumn.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Column.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Column.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Column.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Column.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/ColumnCast.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/ColumnCast.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/ColumnCast.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/ColumnCast.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/DateColumn.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/DateColumn.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/DateColumn.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/DateColumn.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/DoubleColumn.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/DoubleColumn.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/DoubleColumn.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/DoubleColumn.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/LongColumn.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/LongColumn.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/LongColumn.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/LongColumn.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/OverFlowUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/OverFlowUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/OverFlowUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/OverFlowUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Record.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Record.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Record.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Record.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/StringColumn.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/StringColumn.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/StringColumn.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/StringColumn.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/CommonErrorCode.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/CommonErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/CommonErrorCode.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/CommonErrorCode.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/DataXException.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/DataXException.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/DataXException.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/DataXException.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/ExceptionTracker.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/ExceptionTracker.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/ExceptionTracker.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/ExceptionTracker.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractJobPlugin.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractJobPlugin.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractJobPlugin.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractJobPlugin.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractPlugin.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractPlugin.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractPlugin.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractPlugin.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractTaskPlugin.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractTaskPlugin.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractTaskPlugin.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractTaskPlugin.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/BasicDataReceiver.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/BasicDataReceiver.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/BasicDataReceiver.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/BasicDataReceiver.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/JobPluginCollector.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/JobPluginCollector.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/JobPluginCollector.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/JobPluginCollector.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/PluginCollector.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/PluginCollector.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/PluginCollector.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/PluginCollector.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/PluginProcessorLoader.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/PluginProcessorLoader.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/PluginProcessorLoader.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/PluginProcessorLoader.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/Pluginable.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/Pluginable.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/Pluginable.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/Pluginable.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/RecordReceiver.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/RecordReceiver.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/RecordReceiver.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/RecordReceiver.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/RecordSender.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/RecordSender.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/RecordSender.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/RecordSender.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/TaskPluginCollector.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/TaskPluginCollector.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/TaskPluginCollector.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/TaskPluginCollector.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/ErrorCode.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/ErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/ErrorCode.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/ErrorCode.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Hook.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Hook.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Hook.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Hook.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Reader.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Reader.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Reader.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Reader.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Writer.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Writer.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Writer.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Writer.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/PerfRecord.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/PerfRecord.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/PerfRecord.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/PerfRecord.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/PerfTrace.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/PerfTrace.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/PerfTrace.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/PerfTrace.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/VMInfo.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/VMInfo.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/VMInfo.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/VMInfo.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/Configuration.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/Configuration.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/Configuration.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/Configuration.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/FilterUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/FilterUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/FilterUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/FilterUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/HostUtils.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/HostUtils.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/HostUtils.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/HostUtils.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/ListUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/ListUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/ListUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/ListUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/RangeSplitUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/RangeSplitUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/RangeSplitUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/RangeSplitUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/RetryUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/RetryUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/RetryUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/RetryUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/StrUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/StrUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/StrUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/StrUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/AbstractContainer.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/AbstractContainer.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/AbstractContainer.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/AbstractContainer.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/Engine.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/Engine.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/Engine.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/Engine.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/container/util/HookInvoker.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/container/util/HookInvoker.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/container/util/HookInvoker.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/container/util/HookInvoker.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/container/util/JobAssignUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/container/util/JobAssignUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/container/util/JobAssignUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/container/util/JobAssignUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/JobContainer.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/JobContainer.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/JobContainer.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/JobContainer.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/meta/ExecuteMode.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/meta/ExecuteMode.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/meta/ExecuteMode.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/meta/ExecuteMode.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/meta/State.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/meta/State.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/meta/State.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/meta/State.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/AbstractScheduler.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/AbstractScheduler.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/AbstractScheduler.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/AbstractScheduler.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/processinner/ProcessInnerScheduler.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/processinner/ProcessInnerScheduler.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/processinner/ProcessInnerScheduler.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/processinner/ProcessInnerScheduler.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/processinner/StandAloneScheduler.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/processinner/StandAloneScheduler.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/processinner/StandAloneScheduler.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/processinner/StandAloneScheduler.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/Communication.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/Communication.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/Communication.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/Communication.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/CommunicationTool.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/CommunicationTool.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/CommunicationTool.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/CommunicationTool.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/LocalTGCommunicationManager.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/LocalTGCommunicationManager.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/LocalTGCommunicationManager.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/LocalTGCommunicationManager.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/collector/AbstractCollector.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/collector/AbstractCollector.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/collector/AbstractCollector.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/collector/AbstractCollector.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/collector/ProcessInnerCollector.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/collector/ProcessInnerCollector.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/collector/ProcessInnerCollector.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/collector/ProcessInnerCollector.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/AbstractContainerCommunicator.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/AbstractContainerCommunicator.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/AbstractContainerCommunicator.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/AbstractContainerCommunicator.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/job/StandAloneJobContainerCommunicator.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/job/StandAloneJobContainerCommunicator.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/job/StandAloneJobContainerCommunicator.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/job/StandAloneJobContainerCommunicator.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/AbstractTGContainerCommunicator.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/AbstractTGContainerCommunicator.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/AbstractTGContainerCommunicator.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/AbstractTGContainerCommunicator.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/StandaloneTGContainerCommunicator.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/StandaloneTGContainerCommunicator.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/StandaloneTGContainerCommunicator.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/StandaloneTGContainerCommunicator.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/report/AbstractReporter.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/report/AbstractReporter.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/report/AbstractReporter.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/report/AbstractReporter.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/report/ProcessInnerReporter.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/report/ProcessInnerReporter.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/report/ProcessInnerReporter.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/report/ProcessInnerReporter.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/DefaultJobPluginCollector.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/DefaultJobPluginCollector.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/DefaultJobPluginCollector.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/DefaultJobPluginCollector.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/AbstractTaskPluginCollector.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/AbstractTaskPluginCollector.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/AbstractTaskPluginCollector.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/AbstractTaskPluginCollector.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/HttpPluginCollector.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/HttpPluginCollector.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/HttpPluginCollector.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/HttpPluginCollector.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/StdoutPluginCollector.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/StdoutPluginCollector.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/StdoutPluginCollector.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/StdoutPluginCollector.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/util/DirtyRecord.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/util/DirtyRecord.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/util/DirtyRecord.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/util/DirtyRecord.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskGroupContainer.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskGroupContainer.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskGroupContainer.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskGroupContainer.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskMonitor.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskMonitor.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskMonitor.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskMonitor.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/AbstractRunner.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/AbstractRunner.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/AbstractRunner.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/AbstractRunner.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/ReaderRunner.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/ReaderRunner.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/ReaderRunner.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/ReaderRunner.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/TaskGroupContainerRunner.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/TaskGroupContainerRunner.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/TaskGroupContainerRunner.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/TaskGroupContainerRunner.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/WriterRunner.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/WriterRunner.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/WriterRunner.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/WriterRunner.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/AbstractChannel.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/AbstractChannel.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/AbstractChannel.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/AbstractChannel.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/RecordChannel.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/RecordChannel.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/RecordChannel.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/RecordChannel.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/memory/MemoryRecordChannel.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/memory/MemoryRecordChannel.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/memory/MemoryRecordChannel.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/memory/MemoryRecordChannel.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/BufferedRecordExchanger.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/BufferedRecordExchanger.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/BufferedRecordExchanger.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/BufferedRecordExchanger.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/BufferedRecordTransformerExchanger.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/BufferedRecordTransformerExchanger.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/BufferedRecordTransformerExchanger.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/BufferedRecordTransformerExchanger.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/RecordExchanger.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/RecordExchanger.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/RecordExchanger.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/RecordExchanger.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/TransformerExchanger.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/TransformerExchanger.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/TransformerExchanger.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/TransformerExchanger.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/DefaultRecord.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/DefaultRecord.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/DefaultRecord.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/DefaultRecord.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/TerminateRecord.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/TerminateRecord.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/TerminateRecord.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/TerminateRecord.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/ComplexTransformerProxy.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/ComplexTransformerProxy.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/ComplexTransformerProxy.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/ComplexTransformerProxy.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/FilterTransformer.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/FilterTransformer.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/FilterTransformer.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/FilterTransformer.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/GroovyTransformer.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/GroovyTransformer.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/GroovyTransformer.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/GroovyTransformer.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/GroovyTransformerStaticUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/GroovyTransformerStaticUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/GroovyTransformerStaticUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/GroovyTransformerStaticUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/PadTransformer.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/PadTransformer.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/PadTransformer.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/PadTransformer.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/ReplaceTransformer.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/ReplaceTransformer.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/ReplaceTransformer.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/ReplaceTransformer.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/SubstrTransformer.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/SubstrTransformer.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/SubstrTransformer.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/SubstrTransformer.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerErrorCode.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerErrorCode.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerErrorCode.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerExecution.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerExecution.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerExecution.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerExecution.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerExecutionParas.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerExecutionParas.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerExecutionParas.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerExecutionParas.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerInfo.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerInfo.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerInfo.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerInfo.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerRegistry.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerRegistry.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerRegistry.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerRegistry.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ClassSize.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ClassSize.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ClassSize.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ClassSize.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ClassUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ClassUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ClassUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ClassUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/CompressSuffixName.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/CompressSuffixName.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/CompressSuffixName.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/CompressSuffixName.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ConfigParser.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ConfigParser.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ConfigParser.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ConfigParser.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ConfigurationValidate.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ConfigurationValidate.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ConfigurationValidate.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ConfigurationValidate.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ErrorRecordChecker.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ErrorRecordChecker.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ErrorRecordChecker.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ErrorRecordChecker.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ExceptionTracker.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ExceptionTracker.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ExceptionTracker.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ExceptionTracker.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/FrameworkErrorCode.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/FrameworkErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/FrameworkErrorCode.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/FrameworkErrorCode.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/HttpClientUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/HttpClientUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/HttpClientUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/HttpClientUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/LdapUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/LdapUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/LdapUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/LdapUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/SecretUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/SecretUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/SecretUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/SecretUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/TransformerUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/TransformerUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/TransformerUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/TransformerUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/ClassLoaderSwapper.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/ClassLoaderSwapper.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/ClassLoaderSwapper.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/ClassLoaderSwapper.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/CoreConstant.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/CoreConstant.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/CoreConstant.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/CoreConstant.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/JarLoader.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/JarLoader.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/JarLoader.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/JarLoader.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/LoadUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/LoadUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/LoadUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/LoadUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/EnumStrVal.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/EnumStrVal.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/EnumStrVal.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/EnumStrVal.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/EnumVal.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/EnumVal.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/EnumVal.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/EnumVal.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/ExecuteMode.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/ExecuteMode.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/ExecuteMode.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/ExecuteMode.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/State.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/State.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/State.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/State.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/CommonRdbmsReader.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/CommonRdbmsReader.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/CommonRdbmsReader.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/CommonRdbmsReader.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/Constant.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/Constant.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/Constant.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/Constant.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/Key.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/Key.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/Key.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/Key.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/ResultSetReadProxy.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/ResultSetReadProxy.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/ResultSetReadProxy.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/ResultSetReadProxy.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/HintUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/HintUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/HintUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/HintUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/OriginalConfPretreatmentUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/OriginalConfPretreatmentUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/OriginalConfPretreatmentUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/OriginalConfPretreatmentUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/PreCheckTask.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/PreCheckTask.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/PreCheckTask.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/PreCheckTask.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/ReaderSplitUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/ReaderSplitUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/ReaderSplitUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/ReaderSplitUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/SingleTableSplitUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/SingleTableSplitUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/SingleTableSplitUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/SingleTableSplitUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/ConnectionFactory.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/ConnectionFactory.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/ConnectionFactory.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/ConnectionFactory.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/Constant.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/Constant.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/Constant.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/Constant.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/DBUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/DBUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/DBUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/DBUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/DBUtilErrorCode.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/DBUtilErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/DBUtilErrorCode.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/DBUtilErrorCode.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/DataBaseType.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/DataBaseType.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/DataBaseType.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/DataBaseType.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/DriverWrapper.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/DriverWrapper.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/DriverWrapper.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/DriverWrapper.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/JdbcConnectionFactory.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/JdbcConnectionFactory.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/JdbcConnectionFactory.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/JdbcConnectionFactory.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/RdbmsException.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/RdbmsException.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/RdbmsException.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/RdbmsException.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/RdbmsRangeSplitWrap.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/RdbmsRangeSplitWrap.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/RdbmsRangeSplitWrap.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/RdbmsRangeSplitWrap.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/SqlFormatUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/SqlFormatUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/SqlFormatUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/SqlFormatUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/TableExpandUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/TableExpandUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/TableExpandUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/util/TableExpandUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/CommonRdbmsWriter.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/CommonRdbmsWriter.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/CommonRdbmsWriter.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/CommonRdbmsWriter.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/Constant.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/Constant.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/Constant.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/Constant.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/Key.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/Key.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/Key.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/Key.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/MysqlWriterErrorCode.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/MysqlWriterErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/MysqlWriterErrorCode.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/MysqlWriterErrorCode.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/util/OriginalConfPretreatmentUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/util/OriginalConfPretreatmentUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/util/OriginalConfPretreatmentUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/util/OriginalConfPretreatmentUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/util/WriterUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/util/WriterUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/util/WriterUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/writer/util/WriterUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/PathMeta.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/PathMeta.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/PathMeta.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/PathMeta.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/ColumnEntry.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/ColumnEntry.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/ColumnEntry.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/ColumnEntry.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/Constant.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/Constant.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/Constant.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/Constant.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/ExpandLzopInputStream.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/ExpandLzopInputStream.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/ExpandLzopInputStream.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/ExpandLzopInputStream.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/Key.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/Key.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/Key.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/Key.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/UnstructuredStorageReaderErrorCode.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/UnstructuredStorageReaderErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/UnstructuredStorageReaderErrorCode.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/UnstructuredStorageReaderErrorCode.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/UnstructuredStorageReaderUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/UnstructuredStorageReaderUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/UnstructuredStorageReaderUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/UnstructuredStorageReaderUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/ZipCycleInputStream.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/ZipCycleInputStream.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/ZipCycleInputStream.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/reader/ZipCycleInputStream.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/Constant.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/Constant.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/Constant.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/Constant.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/Key.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/Key.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/Key.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/Key.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/TextCsvWriterManager.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/TextCsvWriterManager.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/TextCsvWriterManager.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/TextCsvWriterManager.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/UnstructuredStorageWriterErrorCode.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/UnstructuredStorageWriterErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/UnstructuredStorageWriterErrorCode.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/UnstructuredStorageWriterErrorCode.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/UnstructuredStorageWriterUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/UnstructuredStorageWriterUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/UnstructuredStorageWriterUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/UnstructuredStorageWriterUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/UnstructuredWriter.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/UnstructuredWriter.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/UnstructuredWriter.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/UnstructuredWriter.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/ZipCollectOutputStream.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/ZipCollectOutputStream.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/ZipCollectOutputStream.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/unstructuredstorage/writer/ZipCollectOutputStream.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/utils/HdfsUserGroupInfoLock.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/utils/HdfsUserGroupInfoLock.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/utils/HdfsUserGroupInfoLock.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/utils/HdfsUserGroupInfoLock.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/transformer/ComplexTransformer.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/transformer/ComplexTransformer.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/transformer/ComplexTransformer.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/transformer/ComplexTransformer.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/transformer/Transformer.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/transformer/Transformer.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/transformer/Transformer.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/transformer/Transformer.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/CryptoUtils.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/CryptoUtils.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/CryptoUtils.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/CryptoUtils.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/GsonUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/GsonUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/GsonUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/GsonUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/PatternInjectUtils.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/PatternInjectUtils.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/PatternInjectUtils.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/PatternInjectUtils.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/constant/TransportMode.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/constant/TransportMode.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/constant/TransportMode.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/constant/TransportMode.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/constant/TransportType.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/constant/TransportType.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/constant/TransportType.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/constant/TransportType.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/ldap/LdapConnection.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/ldap/LdapConnection.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/ldap/LdapConnection.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/ldap/LdapConnection.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/ldap/LdapConnectionFactory.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/ldap/LdapConnectionFactory.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/ldap/LdapConnectionFactory.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/ldap/LdapConnectionFactory.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/ldap/LdapConnector.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/ldap/LdapConnector.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/ldap/LdapConnector.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/ldap/LdapConnector.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/spi/EnhancedReader.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/spi/EnhancedReader.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/spi/EnhancedReader.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/spi/EnhancedReader.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/spi/EnhancedWriter.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/spi/EnhancedWriter.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/spi/EnhancedWriter.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/common/spi/EnhancedWriter.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/ThreadLocalSecurityManager.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/ThreadLocalSecurityManager.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/ThreadLocalSecurityManager.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/ThreadLocalSecurityManager.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/job/meta/MetaSchema.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/job/meta/MetaSchema.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/job/meta/MetaSchema.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/job/meta/MetaSchema.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/job/scheduler/speed/DefaultVariableTaskGroupSpeedStrategy.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/job/scheduler/speed/DefaultVariableTaskGroupSpeedStrategy.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/job/scheduler/speed/DefaultVariableTaskGroupSpeedStrategy.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/job/scheduler/speed/DefaultVariableTaskGroupSpeedStrategy.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/job/scheduler/speed/VariableTaskGroupSpeedStrategy.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/job/scheduler/speed/VariableTaskGroupSpeedStrategy.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/job/scheduler/speed/VariableTaskGroupSpeedStrategy.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/job/scheduler/speed/VariableTaskGroupSpeedStrategy.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/Processor.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/Processor.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/Processor.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/Processor.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/ProcessorSecurityManager.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/ProcessorSecurityManager.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/ProcessorSecurityManager.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/ProcessorSecurityManager.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/loader/JavaMemoryClassObject.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/loader/JavaMemoryClassObject.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/loader/JavaMemoryClassObject.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/loader/JavaMemoryClassObject.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/loader/JavaMemoryFileObject.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/loader/JavaMemoryFileObject.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/loader/JavaMemoryFileObject.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/loader/JavaMemoryFileObject.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/loader/JavaSrcUtils.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/loader/JavaSrcUtils.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/loader/JavaSrcUtils.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/loader/JavaSrcUtils.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/loader/plugin/DefaultPluginProcessorLoader.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/loader/plugin/DefaultPluginProcessorLoader.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/loader/plugin/DefaultPluginProcessorLoader.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/processor/loader/plugin/DefaultPluginProcessorLoader.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/channel/ChannelElement.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/channel/ChannelElement.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/channel/ChannelElement.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/channel/ChannelElement.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/channel/StreamChannel.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/channel/StreamChannel.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/channel/StreamChannel.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/channel/StreamChannel.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/channel/memory/MemoryStreamChannel.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/channel/memory/MemoryStreamChannel.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/channel/memory/MemoryStreamChannel.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/channel/memory/MemoryStreamChannel.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/CheckPoint.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/CheckPoint.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/CheckPoint.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/CheckPoint.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/CheckPointStore.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/CheckPointStore.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/CheckPointStore.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/CheckPointStore.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/storage/BufferedRandomAccessFile.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/storage/BufferedRandomAccessFile.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/storage/BufferedRandomAccessFile.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/storage/BufferedRandomAccessFile.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/storage/CheckPointMemStore.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/storage/CheckPointMemStore.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/storage/CheckPointMemStore.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/storage/CheckPointMemStore.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/storage/CheckPointStoreFile.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/storage/CheckPointStoreFile.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/storage/CheckPointStoreFile.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/checkpoint/storage/CheckPointStoreFile.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/stream/ByteBlock.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/stream/ByteBlock.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/stream/ByteBlock.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/stream/ByteBlock.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/stream/ChannelInput.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/stream/ChannelInput.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/stream/ChannelInput.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/stream/ChannelInput.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/stream/ChannelOutput.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/stream/ChannelOutput.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/stream/ChannelOutput.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/stream/ChannelOutput.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/stream/StreamMeta.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/stream/StreamMeta.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/stream/StreamMeta.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/core/transport/stream/StreamMeta.java diff --git a/modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/util/KerberosUtil.java b/exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/util/KerberosUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/util/KerberosUtil.java rename to exchangis-plugins/engine/datax/datax-core/src/main/java/com/webank/wedatasphere/exchangis/datax/util/KerberosUtil.java diff --git a/modules/executor/engine/datax/datax-core/src/main/lib/Dm7JdbcDriver16.jar b/exchangis-plugins/engine/datax/datax-core/src/main/lib/Dm7JdbcDriver16.jar similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/lib/Dm7JdbcDriver16.jar rename to exchangis-plugins/engine/datax/datax-core/src/main/lib/Dm7JdbcDriver16.jar diff --git a/modules/executor/engine/datax/datax-core/src/main/lib/db2jcc4.jar b/exchangis-plugins/engine/datax/datax-core/src/main/lib/db2jcc4.jar similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/lib/db2jcc4.jar rename to exchangis-plugins/engine/datax/datax-core/src/main/lib/db2jcc4.jar diff --git a/modules/executor/engine/datax/datax-core/src/main/lib/edb-jdbc16.jar b/exchangis-plugins/engine/datax/datax-core/src/main/lib/edb-jdbc16.jar similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/lib/edb-jdbc16.jar rename to exchangis-plugins/engine/datax/datax-core/src/main/lib/edb-jdbc16.jar diff --git a/modules/executor/engine/datax/datax-core/src/main/lib/jconn3-1.0.0-SNAPSHOT.jar b/exchangis-plugins/engine/datax/datax-core/src/main/lib/jconn3-1.0.0-SNAPSHOT.jar similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/lib/jconn3-1.0.0-SNAPSHOT.jar rename to exchangis-plugins/engine/datax/datax-core/src/main/lib/jconn3-1.0.0-SNAPSHOT.jar diff --git a/modules/executor/engine/datax/datax-core/src/main/resources/.secret.properties b/exchangis-plugins/engine/datax/datax-core/src/main/resources/.secret.properties similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/resources/.secret.properties rename to exchangis-plugins/engine/datax/datax-core/src/main/resources/.secret.properties diff --git a/modules/executor/engine/datax/datax-core/src/main/resources/core.json b/exchangis-plugins/engine/datax/datax-core/src/main/resources/core.json similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/resources/core.json rename to exchangis-plugins/engine/datax/datax-core/src/main/resources/core.json diff --git a/modules/executor/engine/datax/datax-core/src/main/resources/kerberos.properties b/exchangis-plugins/engine/datax/datax-core/src/main/resources/kerberos.properties similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/resources/kerberos.properties rename to exchangis-plugins/engine/datax/datax-core/src/main/resources/kerberos.properties diff --git a/modules/executor/engine/datax/datax-core/src/main/resources/ldap.properties b/exchangis-plugins/engine/datax/datax-core/src/main/resources/ldap.properties similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/resources/ldap.properties rename to exchangis-plugins/engine/datax/datax-core/src/main/resources/ldap.properties diff --git a/modules/executor/engine/datax/datax-core/src/main/resources/log/logback.xml b/exchangis-plugins/engine/datax/datax-core/src/main/resources/log/logback.xml similarity index 100% rename from modules/executor/engine/datax/datax-core/src/main/resources/log/logback.xml rename to exchangis-plugins/engine/datax/datax-core/src/main/resources/log/logback.xml diff --git a/exchangis-plugins/engine/datax/datax-elasticsearchwriter/pom.xml b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/pom.xml new file mode 100644 index 000000000..944169751 --- /dev/null +++ b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/pom.xml @@ -0,0 +1,107 @@ + + + + exchangis-executor-engine-datax + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../pom.xml + + 4.0.0 + jar + ${datax.engine.version} + datax-elasticsearchwriter + + + com.webank.wedatasphere.exchangis + datax-core + ${datax.engine.version} + provided + + + slf4j-log4j12 + org.slf4j + + + + + org.slf4j + slf4j-api + provided + + + ch.qos.logback + logback-classic + provided + + + io.searchbox + jest-common + 2.4.0 + + + io.searchbox + jest + 2.4.0 + + + joda-time + joda-time + 2.9.9 + + + org.elasticsearch.client + elasticsearch-rest-high-level-client + 6.7.1 + + + elasticsearch + org.elasticsearch + + + + + org.elasticsearch + elasticsearch + 6.7.1 + + + commons-logging + commons-logging + + + + + com.alibaba + fastjson + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2.1 + + + assemble + + single + + + install + + + + false + false + + ${basedir}/src/main/assembly/package.xml + + plugin + + + + + \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-elasticsearchwriter/src/main/assembly/package.xml b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/assembly/package.xml similarity index 100% rename from modules/executor/engine/datax/datax-elasticsearchwriter/src/main/assembly/package.xml rename to exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/assembly/package.xml diff --git a/modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESClient.java b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESClient.java similarity index 100% rename from modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESClient.java rename to exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESClient.java diff --git a/modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESColumn.java b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESColumn.java similarity index 100% rename from modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESColumn.java rename to exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESColumn.java diff --git a/modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESFieldType.java b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESFieldType.java similarity index 100% rename from modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESFieldType.java rename to exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESFieldType.java diff --git a/modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESWriter.java b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESWriter.java similarity index 100% rename from modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESWriter.java rename to exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESWriter.java diff --git a/modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESWriterErrorCode.java b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESWriterErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESWriterErrorCode.java rename to exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/ESWriterErrorCode.java diff --git a/modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/Key.java b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/Key.java similarity index 100% rename from modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/Key.java rename to exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/alibaba/datax/plugin/writer/elasticsearchwriter/Key.java diff --git a/modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticKey.java b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticKey.java similarity index 100% rename from modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticKey.java rename to exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticKey.java diff --git a/modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticRestClient.java b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticRestClient.java similarity index 99% rename from modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticRestClient.java rename to exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticRestClient.java index 59dc6db80..7866336c7 100644 --- a/modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticRestClient.java +++ b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticRestClient.java @@ -351,7 +351,7 @@ private void initialClient(String[] endPoints, CredentialsProvider credentialsPr ); restClientBuilder.setRequestConfigCallback( requestConfigBuilder -> requestConfigBuilder - .setContentCompressionEnabled(true) +// .setContentCompressionEnabled(true) .setConnectTimeout(Integer.parseInt( String.valueOf(finalClientConfig.getOrDefault(ElasticKey.CLIENT_CONFIG_CONN_TIMEOUT, CONN_TIMEOUT_IN_MILLISECONDS)))) diff --git a/modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticWriter.java b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticWriter.java similarity index 100% rename from modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticWriter.java rename to exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticWriter.java diff --git a/modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticWriterErrorCode.java b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticWriterErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticWriterErrorCode.java rename to exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/ElasticWriterErrorCode.java diff --git a/modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/column/CustomProcessor.java b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/column/CustomProcessor.java similarity index 100% rename from modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/column/CustomProcessor.java rename to exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/column/CustomProcessor.java diff --git a/modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/column/ElasticColumn.java b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/column/ElasticColumn.java similarity index 100% rename from modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/column/ElasticColumn.java rename to exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/column/ElasticColumn.java diff --git a/modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/column/ElasticFieldDataType.java b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/column/ElasticFieldDataType.java similarity index 100% rename from modules/executor/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/column/ElasticFieldDataType.java rename to exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/java/com/webank/wedatasphere/exchangis/datax/plugin/writer/elasticsearchwriter/v6/column/ElasticFieldDataType.java diff --git a/modules/executor/engine/datax/datax-elasticsearchwriter/src/main/resources/plugin.json b/exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/resources/plugin.json similarity index 100% rename from modules/executor/engine/datax/datax-elasticsearchwriter/src/main/resources/plugin.json rename to exchangis-plugins/engine/datax/datax-elasticsearchwriter/src/main/resources/plugin.json diff --git a/exchangis-plugins/engine/datax/datax-ftpreader/pom.xml b/exchangis-plugins/engine/datax/datax-ftpreader/pom.xml new file mode 100644 index 000000000..c80dd8e83 --- /dev/null +++ b/exchangis-plugins/engine/datax/datax-ftpreader/pom.xml @@ -0,0 +1,98 @@ + + + + exchangis-executor-engine-datax + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../pom.xml + + 4.0.0 + jar + ${datax.engine.version} + datax-ftpreader + + + com.webank.wedatasphere.exchangis + datax-core + ${datax.engine.version} + provided + + + slf4j-log4j12 + org.slf4j + + + + + org.slf4j + slf4j-api + provided + + + commons-io + commons-io + provided + + + org.apache.commons + commons-lang3 + provided + + + commons-codec + commons-codec + ${commons-codec} + provided + + + com.alibaba + fastjson + provided + + + ch.qos.logback + logback-classic + provided + + + com.jcraft + jsch + + 0.1.54 + + + commons-net + commons-net + 3.3 + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2.1 + + + assemble + + single + + + install + + + + false + false + + ${basedir}/src/main/assembly/package.xml + + plugin + + + + + \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-ftpreader/src/main/assembly/package.xml b/exchangis-plugins/engine/datax/datax-ftpreader/src/main/assembly/package.xml similarity index 100% rename from modules/executor/engine/datax/datax-ftpreader/src/main/assembly/package.xml rename to exchangis-plugins/engine/datax/datax-ftpreader/src/main/assembly/package.xml diff --git a/modules/executor/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/Constant.java b/exchangis-plugins/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/Constant.java similarity index 100% rename from modules/executor/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/Constant.java rename to exchangis-plugins/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/Constant.java diff --git a/modules/executor/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/FtpConnParams.java b/exchangis-plugins/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/FtpConnParams.java similarity index 100% rename from modules/executor/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/FtpConnParams.java rename to exchangis-plugins/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/FtpConnParams.java diff --git a/modules/executor/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/FtpHelper.java b/exchangis-plugins/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/FtpHelper.java similarity index 100% rename from modules/executor/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/FtpHelper.java rename to exchangis-plugins/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/FtpHelper.java diff --git a/modules/executor/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/FtpReader.java b/exchangis-plugins/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/FtpReader.java similarity index 100% rename from modules/executor/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/FtpReader.java rename to exchangis-plugins/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/FtpReader.java diff --git a/modules/executor/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/FtpReaderErrorCode.java b/exchangis-plugins/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/FtpReaderErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/FtpReaderErrorCode.java rename to exchangis-plugins/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/FtpReaderErrorCode.java diff --git a/modules/executor/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/Key.java b/exchangis-plugins/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/Key.java similarity index 100% rename from modules/executor/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/Key.java rename to exchangis-plugins/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/Key.java diff --git a/modules/executor/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/SftpHelper.java b/exchangis-plugins/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/SftpHelper.java similarity index 100% rename from modules/executor/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/SftpHelper.java rename to exchangis-plugins/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/SftpHelper.java diff --git a/modules/executor/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/StandardFtpHelper.java b/exchangis-plugins/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/StandardFtpHelper.java similarity index 100% rename from modules/executor/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/StandardFtpHelper.java rename to exchangis-plugins/engine/datax/datax-ftpreader/src/main/java/com/alibaba/datax/plugin/reader/ftpreader/StandardFtpHelper.java diff --git a/modules/executor/engine/datax/datax-ftpreader/src/main/resources/plugin-template.json b/exchangis-plugins/engine/datax/datax-ftpreader/src/main/resources/plugin-template.json similarity index 100% rename from modules/executor/engine/datax/datax-ftpreader/src/main/resources/plugin-template.json rename to exchangis-plugins/engine/datax/datax-ftpreader/src/main/resources/plugin-template.json diff --git a/modules/executor/engine/datax/datax-ftpreader/src/main/resources/plugin.json b/exchangis-plugins/engine/datax/datax-ftpreader/src/main/resources/plugin.json similarity index 100% rename from modules/executor/engine/datax/datax-ftpreader/src/main/resources/plugin.json rename to exchangis-plugins/engine/datax/datax-ftpreader/src/main/resources/plugin.json diff --git a/modules/executor/engine/datax/datax-ftpreader/src/main/resources/plugin_job_template.json b/exchangis-plugins/engine/datax/datax-ftpreader/src/main/resources/plugin_job_template.json similarity index 100% rename from modules/executor/engine/datax/datax-ftpreader/src/main/resources/plugin_job_template.json rename to exchangis-plugins/engine/datax/datax-ftpreader/src/main/resources/plugin_job_template.json diff --git a/exchangis-plugins/engine/datax/datax-ftpwriter/pom.xml b/exchangis-plugins/engine/datax/datax-ftpwriter/pom.xml new file mode 100644 index 000000000..a4966c9c7 --- /dev/null +++ b/exchangis-plugins/engine/datax/datax-ftpwriter/pom.xml @@ -0,0 +1,98 @@ + + + + exchangis-executor-engine-datax + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../pom.xml + + 4.0.0 + jar + ${datax.engine.version} + datax-ftpwriter + + + com.webank.wedatasphere.exchangis + datax-core + ${datax.engine.version} + provided + + + slf4j-log4j12 + org.slf4j + + + + provided + org.slf4j + slf4j-api + + + + ch.qos.logback + logback-classic + provided + + + commons-io + commons-io + provided + + + org.apache.commons + commons-lang3 + provided + + + commons-codec + commons-codec + ${commons-codec} + provided + + + com.alibaba + fastjson + provided + + + com.jcraft + jsch + 0.1.54 + + + commons-net + commons-net + 3.3 + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2.1 + + + assemble + + single + + + install + + + + false + false + + ${basedir}/src/main/assembly/package.xml + + plugin + + + + + \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-ftpwriter/src/main/assembly/package.xml b/exchangis-plugins/engine/datax/datax-ftpwriter/src/main/assembly/package.xml similarity index 100% rename from modules/executor/engine/datax/datax-ftpwriter/src/main/assembly/package.xml rename to exchangis-plugins/engine/datax/datax-ftpwriter/src/main/assembly/package.xml diff --git a/modules/executor/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/FtpWriter.java b/exchangis-plugins/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/FtpWriter.java similarity index 100% rename from modules/executor/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/FtpWriter.java rename to exchangis-plugins/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/FtpWriter.java diff --git a/modules/executor/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/FtpWriterErrorCode.java b/exchangis-plugins/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/FtpWriterErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/FtpWriterErrorCode.java rename to exchangis-plugins/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/FtpWriterErrorCode.java diff --git a/modules/executor/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/Key.java b/exchangis-plugins/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/Key.java similarity index 100% rename from modules/executor/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/Key.java rename to exchangis-plugins/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/Key.java diff --git a/modules/executor/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/Constant.java b/exchangis-plugins/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/Constant.java similarity index 100% rename from modules/executor/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/Constant.java rename to exchangis-plugins/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/Constant.java diff --git a/modules/executor/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/FtpConnParams.java b/exchangis-plugins/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/FtpConnParams.java similarity index 100% rename from modules/executor/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/FtpConnParams.java rename to exchangis-plugins/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/FtpConnParams.java diff --git a/modules/executor/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/IFtpHelper.java b/exchangis-plugins/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/IFtpHelper.java similarity index 100% rename from modules/executor/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/IFtpHelper.java rename to exchangis-plugins/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/IFtpHelper.java diff --git a/modules/executor/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/SftpHelperImpl.java b/exchangis-plugins/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/SftpHelperImpl.java similarity index 100% rename from modules/executor/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/SftpHelperImpl.java rename to exchangis-plugins/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/SftpHelperImpl.java diff --git a/modules/executor/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/StandardFtpHelperImpl.java b/exchangis-plugins/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/StandardFtpHelperImpl.java similarity index 100% rename from modules/executor/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/StandardFtpHelperImpl.java rename to exchangis-plugins/engine/datax/datax-ftpwriter/src/main/java/com/alibaba/datax/plugin/writer/ftpwriter/util/StandardFtpHelperImpl.java diff --git a/modules/executor/engine/datax/datax-ftpwriter/src/main/resources/plugin.json b/exchangis-plugins/engine/datax/datax-ftpwriter/src/main/resources/plugin.json similarity index 100% rename from modules/executor/engine/datax/datax-ftpwriter/src/main/resources/plugin.json rename to exchangis-plugins/engine/datax/datax-ftpwriter/src/main/resources/plugin.json diff --git a/modules/executor/engine/datax/datax-ftpwriter/src/main/resources/plugin_job_template.json b/exchangis-plugins/engine/datax/datax-ftpwriter/src/main/resources/plugin_job_template.json similarity index 100% rename from modules/executor/engine/datax/datax-ftpwriter/src/main/resources/plugin_job_template.json rename to exchangis-plugins/engine/datax/datax-ftpwriter/src/main/resources/plugin_job_template.json diff --git a/exchangis-plugins/engine/datax/datax-hdfsreader/pom.xml b/exchangis-plugins/engine/datax/datax-hdfsreader/pom.xml new file mode 100644 index 000000000..dfc58f3db --- /dev/null +++ b/exchangis-plugins/engine/datax/datax-hdfsreader/pom.xml @@ -0,0 +1,154 @@ + + + + exchangis-executor-engine-datax + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../pom.xml + + 4.0.0 + datax-hdfsreader + jar + ${datax.engine.version} + + 1.2.1 + 2.7.2 + 1.2.2 + 2.9.1 + + + + + com.webank.wedatasphere.exchangis + datax-core + provided + + + org.apache.hadoop + hadoop-common + + + slf4j-log4j12 + org.slf4j + + + ${datax.engine.version} + + + org.slf4j + slf4j-api + provided + + + ch.qos.logback + logback-classic + provided + + + org.apache.hadoop + hadoop-hdfs + ${hadoop.version} + + + netty-all + io.netty + + + + + + io.netty + netty-all + 4.1.46.Final + + + org.apache.hadoop + hadoop-common + ${hadoop.version} + + + org.apache.hadoop + hadoop-yarn-common + ${hadoop.version} + + + org.apache.hadoop + hadoop-mapreduce-client-core + ${hadoop.version} + + + com.alibaba + fastjson + + + org.apache.hive + hive-exec + ${hive.version} + + + org.codehaus.groovy + groovy-all + + + zookeeper + org.apache.zookeeper + + + + + xalan + xalan + 2.7.1 + + + + org.apache.hbase + hbase-server + ${hbase.version} + + + + + xerces + xercesImpl + ${xerces.version} + + + + + + src/main/resources + + **/* + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2.1 + + + assemble + + single + + + install + + + + false + false + + ${basedir}/src/main/assembly/package.xml + + plugin + + + + + \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-hdfsreader/src/main/assembly/package.xml b/exchangis-plugins/engine/datax/datax-hdfsreader/src/main/assembly/package.xml similarity index 100% rename from modules/executor/engine/datax/datax-hdfsreader/src/main/assembly/package.xml rename to exchangis-plugins/engine/datax/datax-hdfsreader/src/main/assembly/package.xml diff --git a/modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/Constant.java b/exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/Constant.java similarity index 100% rename from modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/Constant.java rename to exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/Constant.java diff --git a/modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/HdfsFileType.java b/exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/HdfsFileType.java similarity index 100% rename from modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/HdfsFileType.java rename to exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/HdfsFileType.java diff --git a/modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/HdfsReader.java b/exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/HdfsReader.java similarity index 100% rename from modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/HdfsReader.java rename to exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/HdfsReader.java diff --git a/modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/HdfsReaderErrorCode.java b/exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/HdfsReaderErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/HdfsReaderErrorCode.java rename to exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/HdfsReaderErrorCode.java diff --git a/modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/HdfsReaderUtil.java b/exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/HdfsReaderUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/HdfsReaderUtil.java rename to exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/HdfsReaderUtil.java diff --git a/modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/Key.java b/exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/Key.java similarity index 100% rename from modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/Key.java rename to exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/Key.java diff --git a/modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/hfile/HBASEV1HFileParser.java b/exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/hfile/HBASEV1HFileParser.java similarity index 100% rename from modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/hfile/HBASEV1HFileParser.java rename to exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/hfile/HBASEV1HFileParser.java diff --git a/modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/hfile/HFileParser.java b/exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/hfile/HFileParser.java similarity index 100% rename from modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/hfile/HFileParser.java rename to exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/hfile/HFileParser.java diff --git a/modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/hfile/HFileParserFactory.java b/exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/hfile/HFileParserFactory.java similarity index 100% rename from modules/executor/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/hfile/HFileParserFactory.java rename to exchangis-plugins/engine/datax/datax-hdfsreader/src/main/java/com/alibaba/datax/plugin/reader/hdfsreader/hfile/HFileParserFactory.java diff --git a/modules/executor/engine/datax/datax-hdfsreader/src/main/resources/plugin.json b/exchangis-plugins/engine/datax/datax-hdfsreader/src/main/resources/plugin.json similarity index 100% rename from modules/executor/engine/datax/datax-hdfsreader/src/main/resources/plugin.json rename to exchangis-plugins/engine/datax/datax-hdfsreader/src/main/resources/plugin.json diff --git a/modules/executor/engine/datax/datax-hdfsreader/src/main/resources/plugin_job_template.json b/exchangis-plugins/engine/datax/datax-hdfsreader/src/main/resources/plugin_job_template.json similarity index 100% rename from modules/executor/engine/datax/datax-hdfsreader/src/main/resources/plugin_job_template.json rename to exchangis-plugins/engine/datax/datax-hdfsreader/src/main/resources/plugin_job_template.json diff --git a/modules/executor/engine/datax/datax-hdfsreader/src/test/java/com/alibaba/datax/plugin/reader/hdfsreader/HFileParser.java b/exchangis-plugins/engine/datax/datax-hdfsreader/src/test/java/com/alibaba/datax/plugin/reader/hdfsreader/HFileParser.java similarity index 100% rename from modules/executor/engine/datax/datax-hdfsreader/src/test/java/com/alibaba/datax/plugin/reader/hdfsreader/HFileParser.java rename to exchangis-plugins/engine/datax/datax-hdfsreader/src/test/java/com/alibaba/datax/plugin/reader/hdfsreader/HFileParser.java diff --git a/exchangis-plugins/engine/datax/datax-hdfswriter/pom.xml b/exchangis-plugins/engine/datax/datax-hdfswriter/pom.xml new file mode 100644 index 000000000..5e09ca5d7 --- /dev/null +++ b/exchangis-plugins/engine/datax/datax-hdfswriter/pom.xml @@ -0,0 +1,157 @@ + + + + exchangis-executor-engine-datax + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../pom.xml + + 4.0.0 + + datax-hdfswriter + jar + ${datax.engine.version} + + 1.2.1 + 2.7.2 + 2.9.1 + + + + + com.webank.wedatasphere.exchangis + datax-core + provided + + + org.apache.hadoop + hadoop-common + + + slf4j-log4j12 + org.slf4j + + + ${datax.engine.version} + + + com.alibaba + fastjson + + + org.slf4j + slf4j-api + provided + + + ch.qos.logback + logback-classic + provided + + + + org.apache.hadoop + hadoop-hdfs + ${hadoop.version} + + + xml-apis + xml-apis + + + netty-all + io.netty + + + + + + io.netty + netty-all + 4.1.46.Final + + + org.apache.hadoop + hadoop-common + ${hadoop.version} + + + commons-logging + commons-logging + + + + + + org.apache.hadoop + hadoop-mapreduce-client-core + ${hadoop.version} + + + + org.apache.hive + hive-serde + ${hive.version} + + + org.apache.hive + hive-service + ${hive.version} + + + geronimo-jaspic_1.0_spec + org.apache.geronimo.specs + + + + + org.apache.hive + hive-common + ${hive.version} + + + org.apache.hive.hcatalog + hive-hcatalog-core + ${hive.version} + + + xalan + xalan + 2.7.1 + + + xerces + xercesImpl + ${xerces.version} + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2.1 + + + assemble + + single + + + install + + + + false + false + + ${basedir}/src/main/assembly/package.xml + + plugin + + + + + \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-hdfswriter/src/main/assembly/package.xml b/exchangis-plugins/engine/datax/datax-hdfswriter/src/main/assembly/package.xml similarity index 100% rename from modules/executor/engine/datax/datax-hdfswriter/src/main/assembly/package.xml rename to exchangis-plugins/engine/datax/datax-hdfswriter/src/main/assembly/package.xml diff --git a/modules/executor/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/Constant.java b/exchangis-plugins/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/Constant.java similarity index 100% rename from modules/executor/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/Constant.java rename to exchangis-plugins/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/Constant.java diff --git a/modules/executor/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/HdfsWriter.java b/exchangis-plugins/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/HdfsWriter.java similarity index 100% rename from modules/executor/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/HdfsWriter.java rename to exchangis-plugins/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/HdfsWriter.java diff --git a/modules/executor/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/HdfsWriterErrorCode.java b/exchangis-plugins/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/HdfsWriterErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/HdfsWriterErrorCode.java rename to exchangis-plugins/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/HdfsWriterErrorCode.java diff --git a/modules/executor/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/HdfsWriterUtil.java b/exchangis-plugins/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/HdfsWriterUtil.java similarity index 100% rename from modules/executor/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/HdfsWriterUtil.java rename to exchangis-plugins/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/HdfsWriterUtil.java diff --git a/modules/executor/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/Key.java b/exchangis-plugins/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/Key.java similarity index 100% rename from modules/executor/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/Key.java rename to exchangis-plugins/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/Key.java diff --git a/modules/executor/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/SupportHiveDataType.java b/exchangis-plugins/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/SupportHiveDataType.java similarity index 100% rename from modules/executor/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/SupportHiveDataType.java rename to exchangis-plugins/engine/datax/datax-hdfswriter/src/main/java/com/alibaba/datax/plugin/writer/hdfswriter/SupportHiveDataType.java diff --git a/modules/executor/engine/datax/datax-hdfswriter/src/main/resources/plugin.json b/exchangis-plugins/engine/datax/datax-hdfswriter/src/main/resources/plugin.json similarity index 100% rename from modules/executor/engine/datax/datax-hdfswriter/src/main/resources/plugin.json rename to exchangis-plugins/engine/datax/datax-hdfswriter/src/main/resources/plugin.json diff --git a/modules/executor/engine/datax/datax-hdfswriter/src/main/resources/plugin_job_template.json b/exchangis-plugins/engine/datax/datax-hdfswriter/src/main/resources/plugin_job_template.json similarity index 100% rename from modules/executor/engine/datax/datax-hdfswriter/src/main/resources/plugin_job_template.json rename to exchangis-plugins/engine/datax/datax-hdfswriter/src/main/resources/plugin_job_template.json diff --git a/exchangis-plugins/engine/datax/datax-mysqlreader/pom.xml b/exchangis-plugins/engine/datax/datax-mysqlreader/pom.xml new file mode 100644 index 000000000..f66e7486a --- /dev/null +++ b/exchangis-plugins/engine/datax/datax-mysqlreader/pom.xml @@ -0,0 +1,75 @@ + + + + exchangis-executor-engine-datax + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../pom.xml + + 4.0.0 + ${datax.engine.version} + datax-mysqlreader + jar + + + com.webank.wedatasphere.exchangis + datax-core + provided + + + org.apache.hadoop + hadoop-common + + + slf4j-log4j12 + org.slf4j + + + ${datax.engine.version} + + + org.slf4j + slf4j-api + provided + + + ch.qos.logback + logback-classic + provided + + + mysql + mysql-connector-java + 5.1.38 + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2.1 + + + assemble + + single + + + install + + + + false + false + + ${basedir}/src/main/assembly/package.xml + + plugin + + + + + \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-mysqlreader/src/main/assembly/package.xml b/exchangis-plugins/engine/datax/datax-mysqlreader/src/main/assembly/package.xml similarity index 100% rename from modules/executor/engine/datax/datax-mysqlreader/src/main/assembly/package.xml rename to exchangis-plugins/engine/datax/datax-mysqlreader/src/main/assembly/package.xml diff --git a/modules/executor/engine/datax/datax-mysqlreader/src/main/java/com/alibaba/datax/plugin/reader/mysqlreader/MysqlReader.java b/exchangis-plugins/engine/datax/datax-mysqlreader/src/main/java/com/alibaba/datax/plugin/reader/mysqlreader/MysqlReader.java similarity index 100% rename from modules/executor/engine/datax/datax-mysqlreader/src/main/java/com/alibaba/datax/plugin/reader/mysqlreader/MysqlReader.java rename to exchangis-plugins/engine/datax/datax-mysqlreader/src/main/java/com/alibaba/datax/plugin/reader/mysqlreader/MysqlReader.java diff --git a/modules/executor/engine/datax/datax-mysqlreader/src/main/java/com/alibaba/datax/plugin/reader/mysqlreader/MysqlReaderErrorCode.java b/exchangis-plugins/engine/datax/datax-mysqlreader/src/main/java/com/alibaba/datax/plugin/reader/mysqlreader/MysqlReaderErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-mysqlreader/src/main/java/com/alibaba/datax/plugin/reader/mysqlreader/MysqlReaderErrorCode.java rename to exchangis-plugins/engine/datax/datax-mysqlreader/src/main/java/com/alibaba/datax/plugin/reader/mysqlreader/MysqlReaderErrorCode.java diff --git a/modules/executor/engine/datax/datax-mysqlreader/src/main/resources/plugin.json b/exchangis-plugins/engine/datax/datax-mysqlreader/src/main/resources/plugin.json similarity index 100% rename from modules/executor/engine/datax/datax-mysqlreader/src/main/resources/plugin.json rename to exchangis-plugins/engine/datax/datax-mysqlreader/src/main/resources/plugin.json diff --git a/modules/executor/engine/datax/datax-mysqlreader/src/main/resources/plugin_job_template.json b/exchangis-plugins/engine/datax/datax-mysqlreader/src/main/resources/plugin_job_template.json similarity index 100% rename from modules/executor/engine/datax/datax-mysqlreader/src/main/resources/plugin_job_template.json rename to exchangis-plugins/engine/datax/datax-mysqlreader/src/main/resources/plugin_job_template.json diff --git a/exchangis-plugins/engine/datax/datax-mysqlwriter/pom.xml b/exchangis-plugins/engine/datax/datax-mysqlwriter/pom.xml new file mode 100644 index 000000000..d901cc033 --- /dev/null +++ b/exchangis-plugins/engine/datax/datax-mysqlwriter/pom.xml @@ -0,0 +1,75 @@ + + + + exchangis-executor-engine-datax + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../pom.xml + + 4.0.0 + jar + ${datax.engine.version} + datax-mysqlwriter + + + com.webank.wedatasphere.exchangis + datax-core + provided + + + org.apache.hadoop + hadoop-common + + + slf4j-log4j12 + org.slf4j + + + ${datax.engine.version} + + + org.slf4j + slf4j-api + provided + + + ch.qos.logback + logback-classic + provided + + + mysql + mysql-connector-java + 5.1.38 + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2.1 + + + assemble + + single + + + install + + + + false + false + + ${basedir}/src/main/assembly/package.xml + + plugin + + + + + \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-mysqlwriter/src/main/assembly/package.xml b/exchangis-plugins/engine/datax/datax-mysqlwriter/src/main/assembly/package.xml similarity index 100% rename from modules/executor/engine/datax/datax-mysqlwriter/src/main/assembly/package.xml rename to exchangis-plugins/engine/datax/datax-mysqlwriter/src/main/assembly/package.xml diff --git a/modules/executor/engine/datax/datax-mysqlwriter/src/main/java/com/alibaba/datax/plugin/writer/mysqlwriter/MysqlWriter.java b/exchangis-plugins/engine/datax/datax-mysqlwriter/src/main/java/com/alibaba/datax/plugin/writer/mysqlwriter/MysqlWriter.java similarity index 100% rename from modules/executor/engine/datax/datax-mysqlwriter/src/main/java/com/alibaba/datax/plugin/writer/mysqlwriter/MysqlWriter.java rename to exchangis-plugins/engine/datax/datax-mysqlwriter/src/main/java/com/alibaba/datax/plugin/writer/mysqlwriter/MysqlWriter.java diff --git a/modules/executor/engine/datax/datax-mysqlwriter/src/main/resources/plugin.json b/exchangis-plugins/engine/datax/datax-mysqlwriter/src/main/resources/plugin.json similarity index 100% rename from modules/executor/engine/datax/datax-mysqlwriter/src/main/resources/plugin.json rename to exchangis-plugins/engine/datax/datax-mysqlwriter/src/main/resources/plugin.json diff --git a/modules/executor/engine/datax/datax-mysqlwriter/src/main/resources/plugin_job_template.json b/exchangis-plugins/engine/datax/datax-mysqlwriter/src/main/resources/plugin_job_template.json similarity index 100% rename from modules/executor/engine/datax/datax-mysqlwriter/src/main/resources/plugin_job_template.json rename to exchangis-plugins/engine/datax/datax-mysqlwriter/src/main/resources/plugin_job_template.json diff --git a/exchangis-plugins/engine/datax/datax-oraclereader/pom.xml b/exchangis-plugins/engine/datax/datax-oraclereader/pom.xml new file mode 100644 index 000000000..a98114677 --- /dev/null +++ b/exchangis-plugins/engine/datax/datax-oraclereader/pom.xml @@ -0,0 +1,82 @@ + + + + exchangis-executor-engine-datax + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../pom.xml + + 4.0.0 + ${datax.engine.version} + datax-oraclereader + jar + + + com.webank.wedatasphere.exchangis + datax-core + provided + + + org.apache.hadoop + hadoop-common + + + slf4j-log4j12 + org.slf4j + + + ${datax.engine.version} + + + org.slf4j + slf4j-api + provided + + + ch.qos.logback + logback-classic + provided + + + org.apache.commons + commons-lang3 + provided + + + com.oracle + ojdbc6 + 11.2.0.3 + system + ${basedir}/src/main/lib/ojdbc6-11.2.0.3.jar + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2.1 + + + assemble + + single + + + install + + + + false + false + + ${basedir}/src/main/assembly/package.xml + + plugin + + + + + \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-oraclereader/src/main/assembly/package.xml b/exchangis-plugins/engine/datax/datax-oraclereader/src/main/assembly/package.xml similarity index 100% rename from modules/executor/engine/datax/datax-oraclereader/src/main/assembly/package.xml rename to exchangis-plugins/engine/datax/datax-oraclereader/src/main/assembly/package.xml diff --git a/modules/executor/engine/datax/datax-oraclereader/src/main/java/com/alibaba/datax/plugin/reader/oraclereader/Constant.java b/exchangis-plugins/engine/datax/datax-oraclereader/src/main/java/com/alibaba/datax/plugin/reader/oraclereader/Constant.java similarity index 100% rename from modules/executor/engine/datax/datax-oraclereader/src/main/java/com/alibaba/datax/plugin/reader/oraclereader/Constant.java rename to exchangis-plugins/engine/datax/datax-oraclereader/src/main/java/com/alibaba/datax/plugin/reader/oraclereader/Constant.java diff --git a/modules/executor/engine/datax/datax-oraclereader/src/main/java/com/alibaba/datax/plugin/reader/oraclereader/OracleReader.java b/exchangis-plugins/engine/datax/datax-oraclereader/src/main/java/com/alibaba/datax/plugin/reader/oraclereader/OracleReader.java similarity index 100% rename from modules/executor/engine/datax/datax-oraclereader/src/main/java/com/alibaba/datax/plugin/reader/oraclereader/OracleReader.java rename to exchangis-plugins/engine/datax/datax-oraclereader/src/main/java/com/alibaba/datax/plugin/reader/oraclereader/OracleReader.java diff --git a/modules/executor/engine/datax/datax-oraclereader/src/main/java/com/alibaba/datax/plugin/reader/oraclereader/OracleReaderErrorCode.java b/exchangis-plugins/engine/datax/datax-oraclereader/src/main/java/com/alibaba/datax/plugin/reader/oraclereader/OracleReaderErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-oraclereader/src/main/java/com/alibaba/datax/plugin/reader/oraclereader/OracleReaderErrorCode.java rename to exchangis-plugins/engine/datax/datax-oraclereader/src/main/java/com/alibaba/datax/plugin/reader/oraclereader/OracleReaderErrorCode.java diff --git a/modules/executor/engine/datax/datax-oraclereader/src/main/lib/ojdbc6-11.2.0.3.jar b/exchangis-plugins/engine/datax/datax-oraclereader/src/main/lib/ojdbc6-11.2.0.3.jar similarity index 100% rename from modules/executor/engine/datax/datax-oraclereader/src/main/lib/ojdbc6-11.2.0.3.jar rename to exchangis-plugins/engine/datax/datax-oraclereader/src/main/lib/ojdbc6-11.2.0.3.jar diff --git a/modules/executor/engine/datax/datax-oraclereader/src/main/resources/plugin.json b/exchangis-plugins/engine/datax/datax-oraclereader/src/main/resources/plugin.json similarity index 100% rename from modules/executor/engine/datax/datax-oraclereader/src/main/resources/plugin.json rename to exchangis-plugins/engine/datax/datax-oraclereader/src/main/resources/plugin.json diff --git a/modules/executor/engine/datax/datax-oraclereader/src/main/resources/plugin_job_template.json b/exchangis-plugins/engine/datax/datax-oraclereader/src/main/resources/plugin_job_template.json similarity index 100% rename from modules/executor/engine/datax/datax-oraclereader/src/main/resources/plugin_job_template.json rename to exchangis-plugins/engine/datax/datax-oraclereader/src/main/resources/plugin_job_template.json diff --git a/exchangis-plugins/engine/datax/datax-oraclewriter/pom.xml b/exchangis-plugins/engine/datax/datax-oraclewriter/pom.xml new file mode 100644 index 000000000..f926cd8b0 --- /dev/null +++ b/exchangis-plugins/engine/datax/datax-oraclewriter/pom.xml @@ -0,0 +1,81 @@ + + + + exchangis-executor-engine-datax + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../pom.xml + + 4.0.0 + + ${datax.engine.version} + datax-oraclewriter + jar + + + + com.webank.wedatasphere.exchangis + datax-core + provided + + + org.apache.hadoop + hadoop-common + + + slf4j-log4j12 + org.slf4j + + + ${datax.engine.version} + + + org.slf4j + slf4j-api + provided + + + ch.qos.logback + logback-classic + provided + + + com.oracle + ojdbc6 + 11.2.0.3 + system + ${basedir}/src/main/lib/ojdbc6-11.2.0.3.jar + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2.1 + + + assemble + + single + + + install + + + + false + false + + ${basedir}/src/main/assembly/package.xml + + plugin + + + + + + \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-oraclewriter/src/main/assembly/package.xml b/exchangis-plugins/engine/datax/datax-oraclewriter/src/main/assembly/package.xml similarity index 100% rename from modules/executor/engine/datax/datax-oraclewriter/src/main/assembly/package.xml rename to exchangis-plugins/engine/datax/datax-oraclewriter/src/main/assembly/package.xml diff --git a/modules/executor/engine/datax/datax-oraclewriter/src/main/java/com/alibaba/datax/plugin/writer/oraclewriter/OracleWriter.java b/exchangis-plugins/engine/datax/datax-oraclewriter/src/main/java/com/alibaba/datax/plugin/writer/oraclewriter/OracleWriter.java similarity index 100% rename from modules/executor/engine/datax/datax-oraclewriter/src/main/java/com/alibaba/datax/plugin/writer/oraclewriter/OracleWriter.java rename to exchangis-plugins/engine/datax/datax-oraclewriter/src/main/java/com/alibaba/datax/plugin/writer/oraclewriter/OracleWriter.java diff --git a/modules/executor/engine/datax/datax-oraclewriter/src/main/java/com/alibaba/datax/plugin/writer/oraclewriter/OracleWriterErrorCode.java b/exchangis-plugins/engine/datax/datax-oraclewriter/src/main/java/com/alibaba/datax/plugin/writer/oraclewriter/OracleWriterErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-oraclewriter/src/main/java/com/alibaba/datax/plugin/writer/oraclewriter/OracleWriterErrorCode.java rename to exchangis-plugins/engine/datax/datax-oraclewriter/src/main/java/com/alibaba/datax/plugin/writer/oraclewriter/OracleWriterErrorCode.java diff --git a/modules/executor/engine/datax/datax-oraclewriter/src/main/lib/ojdbc6-11.2.0.3.jar b/exchangis-plugins/engine/datax/datax-oraclewriter/src/main/lib/ojdbc6-11.2.0.3.jar similarity index 100% rename from modules/executor/engine/datax/datax-oraclewriter/src/main/lib/ojdbc6-11.2.0.3.jar rename to exchangis-plugins/engine/datax/datax-oraclewriter/src/main/lib/ojdbc6-11.2.0.3.jar diff --git a/modules/executor/engine/datax/datax-oraclewriter/src/main/resources/plugin.json b/exchangis-plugins/engine/datax/datax-oraclewriter/src/main/resources/plugin.json similarity index 100% rename from modules/executor/engine/datax/datax-oraclewriter/src/main/resources/plugin.json rename to exchangis-plugins/engine/datax/datax-oraclewriter/src/main/resources/plugin.json diff --git a/modules/executor/engine/datax/datax-oraclewriter/src/main/resources/plugin_job_template.json b/exchangis-plugins/engine/datax/datax-oraclewriter/src/main/resources/plugin_job_template.json similarity index 100% rename from modules/executor/engine/datax/datax-oraclewriter/src/main/resources/plugin_job_template.json rename to exchangis-plugins/engine/datax/datax-oraclewriter/src/main/resources/plugin_job_template.json diff --git a/exchangis-plugins/engine/datax/datax-textfilereader/pom.xml b/exchangis-plugins/engine/datax/datax-textfilereader/pom.xml new file mode 100644 index 000000000..de9f2479f --- /dev/null +++ b/exchangis-plugins/engine/datax/datax-textfilereader/pom.xml @@ -0,0 +1,92 @@ + + + + exchangis-executor-engine-datax + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../pom.xml + + 4.0.0 + ${datax.engine.version} + datax-textfilereader + jar + + + com.webank.wedatasphere.exchangis + datax-core + provided + + + slf4j-log4j12 + org.slf4j + + + ${datax.engine.version} + + + org.slf4j + slf4j-api + provided + + + ch.qos.logback + logback-classic + provided + + + commons-io + commons-io + provided + + + org.apache.commons + commons-lang3 + provided + + + commons-codec + commons-codec + ${commons-codec} + provided + + + com.alibaba + fastjson + provided + + + com.google.guava + guava + provided + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2.1 + + + assemble + + single + + + install + + + + false + false + + ${basedir}/src/main/assembly/package.xml + + plugin + + + + + \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-textfilereader/src/main/assembly/package.xml b/exchangis-plugins/engine/datax/datax-textfilereader/src/main/assembly/package.xml similarity index 100% rename from modules/executor/engine/datax/datax-textfilereader/src/main/assembly/package.xml rename to exchangis-plugins/engine/datax/datax-textfilereader/src/main/assembly/package.xml diff --git a/modules/executor/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/Constant.java b/exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/Constant.java similarity index 100% rename from modules/executor/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/Constant.java rename to exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/Constant.java diff --git a/modules/executor/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/Key.java b/exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/Key.java similarity index 100% rename from modules/executor/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/Key.java rename to exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/Key.java diff --git a/modules/executor/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReader.java b/exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReader.java similarity index 100% rename from modules/executor/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReader.java rename to exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReader.java diff --git a/modules/executor/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReaderErrorCode.java b/exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReaderErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReaderErrorCode.java rename to exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReaderErrorCode.java diff --git a/modules/executor/engine/datax/datax-textfilereader/src/main/resources/plugin.json b/exchangis-plugins/engine/datax/datax-textfilereader/src/main/resources/plugin.json similarity index 100% rename from modules/executor/engine/datax/datax-textfilereader/src/main/resources/plugin.json rename to exchangis-plugins/engine/datax/datax-textfilereader/src/main/resources/plugin.json diff --git a/modules/executor/engine/datax/datax-textfilereader/src/main/resources/plugin_job_template.json b/exchangis-plugins/engine/datax/datax-textfilereader/src/main/resources/plugin_job_template.json similarity index 100% rename from modules/executor/engine/datax/datax-textfilereader/src/main/resources/plugin_job_template.json rename to exchangis-plugins/engine/datax/datax-textfilereader/src/main/resources/plugin_job_template.json diff --git a/exchangis-plugins/engine/datax/datax-textfilewriter/pom.xml b/exchangis-plugins/engine/datax/datax-textfilewriter/pom.xml new file mode 100644 index 000000000..5b9794f0c --- /dev/null +++ b/exchangis-plugins/engine/datax/datax-textfilewriter/pom.xml @@ -0,0 +1,92 @@ + + + + exchangis-executor-engine-datax + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../pom.xml + + 4.0.0 + ${datax.engine.version} + datax-textfilewriter + jar + + + com.webank.wedatasphere.exchangis + datax-core + provided + + + slf4j-log4j12 + org.slf4j + + + ${datax.engine.version} + + + org.slf4j + slf4j-api + provided + + + ch.qos.logback + logback-classic + provided + + + commons-io + commons-io + provided + + + org.apache.commons + commons-lang3 + provided + + + commons-codec + commons-codec + ${commons-codec} + provided + + + com.alibaba + fastjson + provided + + + com.google.guava + guava + provided + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2.1 + + + assemble + + single + + + install + + + + false + false + + ${basedir}/src/main/assembly/package.xml + + plugin + + + + + \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-textfilewriter/src/main/assembly/package.xml b/exchangis-plugins/engine/datax/datax-textfilewriter/src/main/assembly/package.xml similarity index 100% rename from modules/executor/engine/datax/datax-textfilewriter/src/main/assembly/package.xml rename to exchangis-plugins/engine/datax/datax-textfilewriter/src/main/assembly/package.xml diff --git a/modules/executor/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/Key.java b/exchangis-plugins/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/Key.java similarity index 100% rename from modules/executor/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/Key.java rename to exchangis-plugins/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/Key.java diff --git a/modules/executor/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/TxtFileWriter.java b/exchangis-plugins/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/TxtFileWriter.java similarity index 100% rename from modules/executor/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/TxtFileWriter.java rename to exchangis-plugins/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/TxtFileWriter.java diff --git a/modules/executor/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/TxtFileWriterErrorCode.java b/exchangis-plugins/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/TxtFileWriterErrorCode.java similarity index 100% rename from modules/executor/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/TxtFileWriterErrorCode.java rename to exchangis-plugins/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/TxtFileWriterErrorCode.java diff --git a/modules/executor/engine/datax/datax-textfilewriter/src/main/resources/plugin.json b/exchangis-plugins/engine/datax/datax-textfilewriter/src/main/resources/plugin.json similarity index 100% rename from modules/executor/engine/datax/datax-textfilewriter/src/main/resources/plugin.json rename to exchangis-plugins/engine/datax/datax-textfilewriter/src/main/resources/plugin.json diff --git a/modules/executor/engine/datax/datax-textfilewriter/src/main/resources/plugin_job_template.json b/exchangis-plugins/engine/datax/datax-textfilewriter/src/main/resources/plugin_job_template.json similarity index 100% rename from modules/executor/engine/datax/datax-textfilewriter/src/main/resources/plugin_job_template.json rename to exchangis-plugins/engine/datax/datax-textfilewriter/src/main/resources/plugin_job_template.json diff --git a/exchangis-plugins/engine/datax/pom.xml b/exchangis-plugins/engine/datax/pom.xml new file mode 100644 index 000000000..9150add55 --- /dev/null +++ b/exchangis-plugins/engine/datax/pom.xml @@ -0,0 +1,118 @@ + + + + exchangis-plugins + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + + 4.0.0 + + exchangis-executor-engine-datax + pom + + 1.7.25 + 1.2.3 + 1.2.68 + 3.1.1 + 16.0.1 + 2.8.2 + 1.19 + 2.4 + 1.6 + 1.10 + 1.2 + 1.9.4 + 2.7.2 + 1.2.1 + 6.7.1 + 1.11 + 3.0.0-Plus-2 + + + datax-core + datax-ftpreader + datax-ftpwriter + datax-hdfsreader + datax-hdfswriter + datax-textfilereader + datax-textfilewriter + datax-elasticsearchwriter + datax-mysqlreader + datax-mysqlwriter + datax-oraclereader + datax-oraclewriter + datax-assembly + + + + + org.apache.commons + commons-lang3 + ${commons.lang3.version} + + + commons-pool + commons-pool + ${commons-pool} + + + com.alibaba + fastjson + ${fastjson-version} + + + com.google.guava + guava + ${guava-version} + + + ch.qos.logback + logback-classic + ${logback-classic-version} + + + org.slf4j + slf4j-api + ${slf4j-api-version} + + + org.apache.commons + commons-math3 + ${commons-math3-version} + + + org.apache.commons + commons-compress + ${commons-compress-version} + + + commons-io + commons-io + ${commons-io} + + + commons-beanutils + commons-beanutils + ${commons-beanutils} + + + com.google.code.gson + gson + ${gson-version} + + + commons-cli + commons-cli + ${commons-cli-version} + + + commons-configuration + commons-configuration + ${commons-configuration-version} + + + + \ No newline at end of file diff --git a/exchangis-plugins/engine/sqoop/pom.xml b/exchangis-plugins/engine/sqoop/pom.xml new file mode 100644 index 000000000..f475aa57a --- /dev/null +++ b/exchangis-plugins/engine/sqoop/pom.xml @@ -0,0 +1,291 @@ + + + + + + linkis + org.apache.linkis + 1.1.1 + ../../pom.xml + + 4.0.0 + + linkis-engineplugin-sqoop + + 1.4.6 + 3.1.2 + + + + + org.apache.commons + commons-exec + provided + 1.3 + + + org.apache.sqoop + sqoop + hadoop200 + ${sqoop.version} + + + org.apache.commons + commons-exec + provided + 1.3 + + + org.apache.avro + avro + provided + 1.10.2 + + + com.lmax + disruptor + provided + 3.4.3 + + + org.apache.hive + hive-common + provided + ${hive.version} + + + * + * + + + + + org.apache.hadoop + hadoop-mapreduce-client-core + ${hadoop.version} + + + servlet-api + javax.servlet + + + + + org.apache.linkis + linkis-once-engineconn + ${linkis.version} + + + commons-logging + commons-logging + + + + + org.apache.linkis + linkis-computation-engineconn + ${linkis.version} + + + org.apache.hadoop + hadoop-client + ${hadoop.version} + + + log4j + log4j + + + org.mortbay.jetty + jetty + + + org.mortbay.jetty + jetty-util + + + com.sun.jersey + jersey-core + + + com.sun.jersey + jersey-server + + + com.sun.jersey + jersey-json + + + jsr311-api + javax.ws.rs + + + net.java.dev.jets3t + jets3t + + + com.jcraft + jsch + + + com.google.code.findbugs + jsr305 + + + xmlenc + xmlenc + + + net.java.dev.jets3t + jets3t + + + org.apache.avro + avro + + + org.apache.hadoop + hadoop-auth + + + com.jcraft + jsch + + + com.google.code.findbugs + jsr305 + + + servlet-api + javax.servlet + + + org.slf4j + slf4j-log4j12 + + + hadoop-hdfs + org.apache.hadoop + + + + + org.apache.linkis + linkis-engineconn-plugin-core + ${linkis.version} + + + + org.apache.linkis + linkis-rpc + ${linkis.version} + provided + + + + org.apache.linkis + linkis-storage + ${linkis.version} + provided + + + + org.apache.linkis + linkis-common + ${linkis.version} + provided + + + + org.apache.linkis + linkis-bml-engine-hook + ${linkis.version} + + + commons-logging + commons-logging + + + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + net.alchim31.maven + scala-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-assembly-plugin + 2.3 + false + + + make-assembly + package + + single + + + + src/main/assembly/distribution.xml + + + + + + false + out + false + false + + src/main/assembly/distribution.xml + + + + + + + src/main/java + + **/*.xml + **/*.properties + + + + src/main/resources + + **/application.yml + **/bootstrap.yml + + + + + \ No newline at end of file diff --git a/exchangis-plugins/engine/sqoop/src/main/assembly/distribution.xml b/exchangis-plugins/engine/sqoop/src/main/assembly/distribution.xml new file mode 100644 index 000000000..78f54c4c0 --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/assembly/distribution.xml @@ -0,0 +1,324 @@ + + + + sqoop + + dir + + true + sqoop + + + + + + /dist/v${sqoop.version}/lib + true + true + false + false + true + + + antlr:antlr:jar + aopalliance:aopalliance:jar + asm:asm:jar + cglib:cglib:jar + com.amazonaws:aws-java-sdk-autoscaling:jar + com.amazonaws:aws-java-sdk-core:jar + com.amazonaws:aws-java-sdk-ec2:jar + com.amazonaws:aws-java-sdk-route53:jar + com.amazonaws:aws-java-sdk-sts:jar + com.amazonaws:jmespath-java:jar + com.fasterxml.jackson.core:jackson-annotations:jar + com.fasterxml.jackson.core:jackson-core:jar + com.fasterxml.jackson.core:jackson-databind:jar + com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar + com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar + com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar + com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar + com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar + com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar + com.fasterxml.jackson.module:jackson-module-parameter-names:jar + com.fasterxml.jackson.module:jackson-module-paranamer:jar + com.fasterxml.jackson.module:jackson-module-scala_2.11:jar + com.github.andrewoma.dexx:dexx-collections:jar + com.github.vlsi.compactmap:compactmap:jar + com.google.code.findbugs:annotations:jar + com.google.code.findbugs:jsr305:jar + com.google.code.gson:gson:jar + com.google.guava:guava:jar + com.google.inject:guice:jar + com.google.protobuf:protobuf-java:jar + com.netflix.archaius:archaius-core:jar + com.netflix.eureka:eureka-client:jar + com.netflix.eureka:eureka-core:jar + com.netflix.hystrix:hystrix-core:jar + com.netflix.netflix-commons:netflix-commons-util:jar + com.netflix.netflix-commons:netflix-eventbus:jar + com.netflix.netflix-commons:netflix-infix:jar + com.netflix.netflix-commons:netflix-statistics:jar + com.netflix.ribbon:ribbon:jar + com.netflix.ribbon:ribbon-core:jar + com.netflix.ribbon:ribbon-eureka:jar + com.netflix.ribbon:ribbon-httpclient:jar + com.netflix.ribbon:ribbon-loadbalancer:jar + com.netflix.ribbon:ribbon-transport:jar + com.netflix.servo:servo-core:jar + com.ning:async-http-client:jar + com.sun.jersey.contribs:jersey-apache-client4:jar + com.sun.jersey:jersey-client:jar + com.sun.jersey:jersey-core:jar + com.sun.jersey:jersey-json:jar + com.sun.jersey:jersey-server:jar + com.sun.jersey:jersey-servlet:jar + com.sun.xml.bind:jaxb-impl:jar + com.thoughtworks.paranamer:paranamer:jar + com.thoughtworks.xstream:xstream:jar + org.apache.linkis:linkis-common:jar + org.apache.linkis:linkis-module:jar + commons-beanutils:commons-beanutils:jar + commons-beanutils:commons-beanutils-core:jar + commons-cli:commons-cli:jar + commons-codec:commons-codec:jar + commons-collections:commons-collections:jar + commons-configuration:commons-configuration:jar + commons-daemon:commons-daemon:jar + commons-dbcp:commons-dbcp:jar + commons-digester:commons-digester:jar + commons-httpclient:commons-httpclient:jar + commons-io:commons-io:jar + commons-jxpath:commons-jxpath:jar + commons-lang:commons-lang:jar + commons-logging:commons-logging:jar + commons-net:commons-net:jar + commons-pool:commons-pool:jar + io.micrometer:micrometer-core:jar + io.netty:netty:jar + io.netty:netty-all:jar + io.netty:netty-buffer:jar + io.netty:netty-codec:jar + io.netty:netty-codec-http:jar + io.netty:netty-common:jar + io.netty:netty-handler:jar + io.netty:netty-transport:jar + io.netty:netty-transport-native-epoll:jar + io.reactivex:rxjava:jar + io.reactivex:rxnetty:jar + io.reactivex:rxnetty-contexts:jar + io.reactivex:rxnetty-servo:jar + javax.activation:activation:jar + javax.annotation:javax.annotation-api:jar + javax.inject:javax.inject:jar + javax.servlet:javax.servlet-api:jar + javax.servlet.jsp:jsp-api:jar + javax.validation:validation-api:jar + javax.websocket:javax.websocket-api:jar + javax.ws.rs:javax.ws.rs-api:jar + javax.xml.bind:jaxb-api:jar + javax.xml.stream:stax-api:jar + joda-time:joda-time:jar + log4j:log4j:jar + mysql:mysql-connector-java:jar + net.databinder.dispatch:dispatch-core_2.11:jar + net.databinder.dispatch:dispatch-json4s-jackson_2.11:jar + org.antlr:antlr-runtime:jar + org.antlr:stringtemplate:jar + org.apache.commons:commons-compress:jar + org.apache.commons:commons-math:jar + org.apache.commons:commons-math3:jar + org.apache.curator:curator-client:jar + org.apache.curator:curator-framework:jar + org.apache.curator:curator-recipes:jar + org.apache.directory.api:api-asn1-api:jar + org.apache.directory.api:api-util:jar + org.apache.directory.server:apacheds-i18n:jar + org.apache.directory.server:apacheds-kerberos-codec:jar + org.apache.hadoop:hadoop-annotations:jar + org.apache.hadoop:hadoop-auth:jar + org.apache.hadoop:hadoop-common:jar + org.apache.hadoop:hadoop-hdfs:jar + org.apache.htrace:htrace-core:jar + org.apache.httpcomponents:httpclient:jar + org.apache.httpcomponents:httpcore:jar + org.apache.logging.log4j:log4j-api:jar + org.apache.logging.log4j:log4j-core:jar + org.apache.logging.log4j:log4j-jul:jar + org.apache.logging.log4j:log4j-slf4j-impl:jar + org.apache.zookeeper:zookeeper:jar + org.aspectj:aspectjweaver:jar + org.bouncycastle:bcpkix-jdk15on:jar + org.bouncycastle:bcprov-jdk15on:jar + org.codehaus.jackson:jackson-jaxrs:jar + org.codehaus.jackson:jackson-xc:jar + org.codehaus.jettison:jettison:jar + org.codehaus.woodstox:stax2-api:jar + org.codehaus.woodstox:woodstox-core-asl:jar + org.eclipse.jetty:jetty-annotations:jar + org.eclipse.jetty:jetty-client:jar + org.eclipse.jetty:jetty-continuation:jar + org.eclipse.jetty:jetty-http:jar + org.eclipse.jetty:jetty-io:jar + org.eclipse.jetty:jetty-jndi:jar + org.eclipse.jetty:jetty-plus:jar + org.eclipse.jetty:jetty-security:jar + org.eclipse.jetty:jetty-server:jar + org.eclipse.jetty:jetty-servlet:jar + org.eclipse.jetty:jetty-servlets:jar + org.eclipse.jetty:jetty-util:jar + org.eclipse.jetty:jetty-webapp:jar + org.eclipse.jetty:jetty-xml:jar + org.eclipse.jetty.websocket:javax-websocket-client-impl:jar + org.eclipse.jetty.websocket:javax-websocket-server-impl:jar + org.eclipse.jetty.websocket:websocket-api:jar + org.eclipse.jetty.websocket:websocket-client:jar + org.eclipse.jetty.websocket:websocket-common:jar + org.eclipse.jetty.websocket:websocket-server:jar + org.eclipse.jetty.websocket:websocket-servlet:jar + org.fusesource.leveldbjni:leveldbjni-all:jar + org.glassfish.hk2:class-model:jar + org.glassfish.hk2:config-types:jar + org.glassfish.hk2.external:aopalliance-repackaged:jar + org.glassfish.hk2.external:asm-all-repackaged:jar + org.glassfish.hk2.external:bean-validator:jar + org.glassfish.hk2.external:javax.inject:jar + org.glassfish.hk2:hk2:jar + org.glassfish.hk2:hk2-api:jar + org.glassfish.hk2:hk2-config:jar + org.glassfish.hk2:hk2-core:jar + org.glassfish.hk2:hk2-locator:jar + org.glassfish.hk2:hk2-runlevel:jar + org.glassfish.hk2:hk2-utils:jar + org.glassfish.hk2:osgi-resource-locator:jar + org.glassfish.hk2:spring-bridge:jar + org.glassfish.jersey.bundles:jaxrs-ri:jar + org.glassfish.jersey.bundles.repackaged:jersey-guava:jar + org.glassfish.jersey.containers:jersey-container-servlet:jar + org.glassfish.jersey.containers:jersey-container-servlet-core:jar + org.glassfish.jersey.core:jersey-client:jar + org.glassfish.jersey.core:jersey-common:jar + org.glassfish.jersey.core:jersey-server:jar + org.glassfish.jersey.ext:jersey-entity-filtering:jar + org.glassfish.jersey.ext:jersey-spring3:jar + org.glassfish.jersey.media:jersey-media-jaxb:jar + org.glassfish.jersey.media:jersey-media-json-jackson:jar + org.glassfish.jersey.media:jersey-media-multipart:jar + org.hdrhistogram:HdrHistogram:jar + org.javassist:javassist:jar + org.json4s:json4s-ast_2.11:jar + org.json4s:json4s-core_2.11:jar + org.json4s:json4s-jackson_2.11:jar + org.jsoup:jsoup:jar + org.jvnet.mimepull:mimepull:jar + org.jvnet:tiger-types:jar + org.latencyutils:LatencyUtils:jar + org.mortbay.jasper:apache-el:jar + org.mortbay.jetty:jetty:jar + org.mortbay.jetty:jetty-util:jar + org.ow2.asm:asm-analysis:jar + org.ow2.asm:asm-commons:jar + org.ow2.asm:asm-tree:jar + org.reflections:reflections:jar + org.scala-lang.modules:scala-parser-combinators_2.11:jar + org.scala-lang.modules:scala-xml_2.11:jar + org.scala-lang:scala-compiler:jar + org.scala-lang:scala-library:jar + org.scala-lang:scala-reflect:jar + org.scala-lang:scalap:jar + org.slf4j:jul-to-slf4j:jar + org.slf4j:slf4j-api:jar + org.springframework.boot:spring-boot:jar + org.springframework.boot:spring-boot-actuator:jar + org.springframework.boot:spring-boot-actuator-autoconfigure:jar + org.springframework.boot:spring-boot-autoconfigure:jar + org.springframework.boot:spring-boot-starter:jar + org.springframework.boot:spring-boot-starter-actuator:jar + org.springframework.boot:spring-boot-starter-aop:jar + org.springframework.boot:spring-boot-starter-jetty:jar + org.springframework.boot:spring-boot-starter-json:jar + org.springframework.boot:spring-boot-starter-log4j2:jar + org.springframework.boot:spring-boot-starter-web:jar + org.springframework.cloud:spring-cloud-commons:jar + org.springframework.cloud:spring-cloud-config-client:jar + org.springframework.cloud:spring-cloud-context:jar + org.springframework.cloud:spring-cloud-netflix-archaius:jar + org.springframework.cloud:spring-cloud-netflix-core:jar + org.springframework.cloud:spring-cloud-netflix-eureka-client:jar + org.springframework.cloud:spring-cloud-netflix-ribbon:jar + org.springframework.cloud:spring-cloud-starter:jar + org.springframework.cloud:spring-cloud-starter-config:jar + org.springframework.cloud:spring-cloud-starter-eureka:jar + org.springframework.cloud:spring-cloud-starter-netflix-archaius:jar + org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:jar + org.springframework.cloud:spring-cloud-starter-netflix-ribbon:jar + org.springframework.security:spring-security-crypto:jar + org.springframework.security:spring-security-rsa:jar + org.springframework:spring-aop:jar + org.springframework:spring-beans:jar + org.springframework:spring-context:jar + org.springframework:spring-core:jar + org.springframework:spring-expression:jar + org.springframework:spring-jcl:jar + org.springframework:spring-web:jar + org.springframework:spring-webmvc:jar + org.tukaani:xz:jar + org.yaml:snakeyaml:jar + software.amazon.ion:ion-java:jar + xerces:xercesImpl:jar + xmlenc:xmlenc:jar + xmlpull:xmlpull:jar + xpp3:xpp3_min:jar + + + + + + + + ${basedir}/src/main/resources + + * + + 0777 + 0755 + /dist/v${sqoop.version}/conf + unix + + + + ${basedir}/target + + *.jar + + + *doc.jar + + 0777 + /plugin/${sqoop.version} + + + + + + + diff --git a/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/LinkisSqoopClient.java b/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/LinkisSqoopClient.java new file mode 100644 index 000000000..9d364be57 --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/LinkisSqoopClient.java @@ -0,0 +1,229 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.client; + +import org.apache.linkis.common.exception.ErrorException; +import org.apache.linkis.engineconnplugin.sqoop.client.utils.JarLoader; +import org.apache.linkis.protocol.engine.JobProgressInfo; + +import org.apache.sqoop.SqoopOptions; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.io.Writer; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Map; +import java.util.function.Consumer; + +public class LinkisSqoopClient { + private static Class sqoopEngineClass; + private static Logger logger = LoggerFactory.getLogger(LinkisSqoopClient.class); + private static JarLoader jarLoader; + + public static int run(Map params) { + try { + jarLoader = + new JarLoader( + new String[] { + LinkisSqoopClient.class + .getProtectionDomain() + .getCodeSource() + .getLocation() + .getPath() + }); + // Load the sqoop class redefined by progress, notice that is not be resolved + jarLoader.loadClass("org.apache.sqoop.mapreduce.JobBase", false); + // Add the sqoop-{version}.jar to class path + jarLoader.addJarURL( + SqoopOptions.class + .getProtectionDomain() + .getCodeSource() + .getLocation() + .getPath()); + // Update the context loader + Thread.currentThread().setContextClassLoader(jarLoader); + sqoopEngineClass = + jarLoader.loadClass("org.apache.linkis.engineconnplugin.sqoop.client.Sqoop"); + Method method = sqoopEngineClass.getDeclaredMethod("main", Map.class); + return (Integer) method.invoke(null, params); + } catch (Throwable e) { + logger.error("Run Error Message:" + getLog(e), e); + return -1; + } + } + + /** Close */ + public static void close() { + operateInClassLoader( + jarLoader, + () -> { + Method method = sqoopEngineClass.getDeclaredMethod("close"); + method.invoke(null); + return null; + }, + e -> logger.error("Close Error Message: {}", getLog(e))); + } + + /** + * Fetch application id + * + * @return application id + */ + public static String getApplicationId() { + return operateInClassLoader( + jarLoader, + () -> { + Method method = sqoopEngineClass.getDeclaredMethod("getApplicationId"); + return (String) method.invoke(null); + }, + e -> logger.error("Linkis SqoopClient getApplicationId: {}", getLog(e))); + } + + /** + * Fetch application url + * + * @return url + */ + public static String getApplicationURL() { + return operateInClassLoader( + jarLoader, + () -> { + Method method = sqoopEngineClass.getDeclaredMethod("getApplicationURL"); + return (String) method.invoke(null); + }, + e -> logger.error("Linkis SqoopClient getApplicationURL: {}", getLog(e))); + } + + /** + * Progress value + * + * @return progress + */ + public static Float progress() { + return operateInClassLoader( + jarLoader, + () -> { + Method method = sqoopEngineClass.getDeclaredMethod("progress"); + return (Float) method.invoke(null); + }, + e -> logger.error("Linkis SqoopClient progress: {}", getLog(e))); + } + + /** + * ProgressInfo + * + * @return + */ + @SuppressWarnings("unchecked") + public static JobProgressInfo getProgressInfo() { + return operateInClassLoader( + jarLoader, + () -> { + Method method = sqoopEngineClass.getDeclaredMethod("getProgressInfo"); + return (JobProgressInfo) method.invoke(null); + }, + e -> logger.error("Linkis SqoopClient getProgressInfo: {}", getLog(e))); + } + + /** + * Get metrics + * + * @return map value + */ + @SuppressWarnings("unchecked") + public static Map getMetrics() { + return operateInClassLoader( + jarLoader, + () -> { + Method method = sqoopEngineClass.getDeclaredMethod("getMetrics"); + return (Map) method.invoke(null); + }, + e -> logger.error("Linkis SqoopClient getMetrics: {}", getLog(e))); + } + + /** + * Get diagnosis + * + * @return map value + */ + @SuppressWarnings("unchecked") + public static Map getDiagnosis() { + return operateInClassLoader( + jarLoader, + () -> { + Method method = sqoopEngineClass.getDeclaredMethod("getDiagnosis"); + return (Map) method.invoke(null); + }, + e -> logger.error("Linkis SqoopClient getDiagnosis: {}", getLog(e))); + } + + /** + * Console log + * + * @param e throwable + * @return log + */ + private static String getLog(Throwable e) { + Writer result = new StringWriter(); + PrintWriter printWriter = new PrintWriter(result); + e.printStackTrace(printWriter); + return e.toString(); + } + + /** + * Operate in special classloader + * + * @param classLoader classloader + * @param operation operation + * @param resolver resolver + * @param return type + * @return return + */ + private static R operateInClassLoader( + ClassLoader classLoader, ClientOperation operation, Consumer resolver) { + ClassLoader currentLoader = Thread.currentThread().getContextClassLoader(); + R result = null; + try { + Thread.currentThread().setContextClassLoader(classLoader); + result = operation.operate(); + } catch (Exception t) { + resolver.accept(t); + } finally { + Thread.currentThread().setContextClassLoader(currentLoader); + } + return result; + } + + @FunctionalInterface + interface ClientOperation { + + /** + * Operate + * + * @return T + * @throws ErrorException error exception + */ + T operate() + throws ErrorException, NoSuchMethodException, InvocationTargetException, + IllegalAccessException; + } +} diff --git a/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/Sqoop.java b/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/Sqoop.java new file mode 100644 index 000000000..bb1e0c093 --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/Sqoop.java @@ -0,0 +1,551 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.client; + +import org.apache.linkis.engineconnplugin.sqoop.client.config.ParamsMapping; +import org.apache.linkis.engineconnplugin.sqoop.client.exception.JobClosableException; +import org.apache.linkis.engineconnplugin.sqoop.context.SqoopEnvConfiguration; +import org.apache.linkis.engineconnplugin.sqoop.context.SqoopParamsConfiguration; +import org.apache.linkis.protocol.engine.JobProgressInfo; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.conf.Configured; +import org.apache.hadoop.mapred.TIPStatus; +import org.apache.hadoop.mapreduce.*; +import org.apache.hadoop.util.Tool; +import org.apache.hadoop.util.ToolRunner; +import org.apache.sqoop.manager.SqlManager; +import org.apache.sqoop.manager.oracle.OraOopManagerFactory; +import org.apache.sqoop.util.LoggingUtils; + +import com.cloudera.sqoop.SqoopOptions; +import com.cloudera.sqoop.manager.DefaultManagerFactory; +import com.cloudera.sqoop.tool.SqoopTool; +import com.cloudera.sqoop.util.OptionsFileUtil; + +import java.io.File; +import java.io.IOException; +import java.lang.reflect.Field; +import java.net.MalformedURLException; +import java.nio.file.Paths; +import java.sql.SQLException; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; + +/** + * Main entry-point for Sqoop Usage: hadoop jar (this_jar_name) com.cloudera.sqoop.Sqoop (options) + * See the SqoopOptions class for options. + */ +public class Sqoop extends Configured implements Tool { + + public static final Log LOG = LogFactory.getLog(Sqoop.class.getName()); + public static volatile AtomicReference job = new AtomicReference<>(); + public static SqlManager sqlManager; + public static final String[] DEFAULT_FACTORY_CLASS_NAMES_ARR = { + OraOopManagerFactory.class.getName(), DefaultManagerFactory.class.getName(), + }; + public static final String FACTORY_CLASS_NAMES_KEY = "sqoop.connection.factories"; + public static final String METRICS_RUN_TIME = "MetricsRunTime"; + private static Float progress = 0.0f; + + /** + * If this System property is set, always throw an exception, do not just exit with status 1. + */ + public static final String SQOOP_RETHROW_PROPERTY = "sqoop.throwOnError"; + + /** The option to specify an options file from which other options to the tool are read. */ + public static final String SQOOP_OPTIONS_FILE_SPECIFIER = "--options-file"; + + static { + Configuration.addDefaultResource("sqoop-site.xml"); + } + + private SqoopTool tool; + private SqoopOptions options; + private String[] childPrgmArgs; + + /** + * Creates a new instance of Sqoop set to run the supplied SqoopTool with the default + * configuration. + * + * @param tool the SqoopTool to run in the main body of Sqoop. + */ + public Sqoop(SqoopTool tool) { + this(tool, (Configuration) null); + } + + /** + * Creates a new instance of Sqoop set to run the supplied SqoopTool with the provided + * configuration. + * + * @param tool the SqoopTool to run in the main body of Sqoop. + * @param conf the Configuration to use (e.g., from ToolRunner). + */ + public Sqoop(SqoopTool tool, Configuration conf) { + this(tool, conf, new SqoopOptions()); + } + + /** + * Creates a new instance of Sqoop set to run the supplied SqoopTool with the provided + * configuration and SqoopOptions. + * + * @param tool the SqoopTool to run in the main body of Sqoop. + * @param conf the Configuration to use (e.g., from ToolRunner). + * @param opts the SqoopOptions which control the tool's parameters. + */ + public Sqoop(SqoopTool tool, Configuration conf, SqoopOptions opts) { + /*LOG.info("Running Sqoop version: " + new SqoopVersion().VERSION);*/ + + if (null != conf) { + setConf(conf); + } + + this.options = opts; + this.options.setConf(getConf()); + + this.tool = tool; + } + + /** @return the SqoopOptions used in this Sqoop instance. */ + public SqoopOptions getOptions() { + return this.options; + } + + /** @return the SqoopTool used in this Sqoop instance. */ + public SqoopTool getTool() { + return this.tool; + } + + @Override + /** Actual main entry-point for the program */ + public int run(String[] args) { + if (options.getConf() == null) { + options.setConf(getConf()); + } + options.getConf().setStrings(FACTORY_CLASS_NAMES_KEY, DEFAULT_FACTORY_CLASS_NAMES_ARR); + try { + options = tool.parseArguments(args, null, options, false); + tool.appendArgs(this.childPrgmArgs); + tool.validateOptions(options); + if (options.getVerbose()) { + LoggingUtils.setDebugLevel(); + } + } catch (Exception e) { + LOG.error(e.getMessage(), e); + System.err.println(e.getMessage()); + return 1; + } + return tool.run(options); + } + + /** + * SqoopTools sometimes pass arguments to a child program (e.g., mysqldump). Users can specify + * additional args to these programs by preceeding the additional arguments with a standalone + * '--'; but ToolRunner/GenericOptionsParser will cull out this argument. We remove the + * child-program arguments in advance, and store them to be readded later. + * + * @param argv the argv in to the SqoopTool + * @return the argv with a "--" and any subsequent arguments removed. + */ + private String[] stashChildPrgmArgs(String[] argv) { + for (int i = 0; i < argv.length; i++) { + if ("--".equals(argv[i])) { + this.childPrgmArgs = Arrays.copyOfRange(argv, i, argv.length); + return Arrays.copyOfRange(argv, 0, i); + } + } + + // Didn't find child-program arguments. + return argv; + } + + /** + * Given a Sqoop object and a set of arguments to deliver to its embedded SqoopTool, run the + * tool, wrapping the call to ToolRunner. This entry-point is preferred to ToolRunner.run() + * because it has a chance to stash child program arguments before GenericOptionsParser would + * remove them. + */ + public static int runSqoop(Sqoop sqoop, String[] args) { + String[] toolArgs = sqoop.stashChildPrgmArgs(args); + try { + return ToolRunner.run(sqoop.getConf(), sqoop, toolArgs); + } catch (Exception e) { + LOG.error("Got exception running Sqoop: " + e.toString()); + e.printStackTrace(); + rethrowIfRequired(toolArgs, e); + return 1; + } + } + + public static void rethrowIfRequired(String[] toolArgs, Exception ex) { + final RuntimeException exceptionToThrow; + if (ex instanceof RuntimeException) { + exceptionToThrow = (RuntimeException) ex; + } else { + exceptionToThrow = new RuntimeException(ex); + } + + throw exceptionToThrow; + } + + /** + * Entry-point that parses the correct SqoopTool to use from the args, but does not call + * System.exit() as main() will. + */ + public static int runTool(Map argsMap, Configuration conf) { + + // Expand the options + String[] expandedArgs = null; + try { + String[] flatArgs = convertParamsMapToAarray(argsMap, conf); + expandedArgs = OptionsFileUtil.expandArguments(flatArgs); + } catch (Exception ex) { + LOG.error("Error while expanding arguments", ex); + System.err.println(ex.getMessage()); + System.err.println("Try 'sqoop help' for usage."); + return 1; + } + + String toolName = expandedArgs[0]; + Configuration pluginConf = SqoopTool.loadPlugins(conf); + SqoopTool tool = SqoopTool.getTool(toolName); + if (null == tool) { + System.err.println("No such sqoop tool: " + toolName + ". See 'sqoop help'."); + return 1; + } + + Sqoop sqoop = new Sqoop(tool, pluginConf); + return runSqoop(sqoop, Arrays.copyOfRange(expandedArgs, 1, expandedArgs.length)); + } + + private static String[] convertParamsMapToAarray( + Map paramsMap, Configuration conf) throws Exception { + List paramsList = new ArrayList<>(); + + for (Map.Entry entry : paramsMap.entrySet()) { + if (StringUtils.isNotBlank(entry.getKey())) { + String key = entry.getKey().toLowerCase(); + if (key.equals(SqoopParamsConfiguration.SQOOP_PARAM_MODE().getValue())) { + paramsList.add(0, entry.getValue()); + continue; + } + if (key.startsWith(SqoopParamsConfiguration.SQOOP_PARAM_ENV_PREFIX().getValue())) { + key = + key.substring( + SqoopParamsConfiguration.SQOOP_PARAM_ENV_PREFIX() + .getValue() + .length()); + conf.set(key, entry.getValue()); + continue; + } + String conKey = ParamsMapping.mapping.get(key); + if (conKey != null) { + if (entry.getValue() != null && entry.getValue().length() != 0) { + paramsList.add(conKey); + paramsList.add(entry.getValue()); + } else { + paramsList.add(conKey); + } + } else { + // Ignore the unrecognized params + LOG.warn("The Key " + entry.getKey() + " Is Not Supported"); + } + } + } + return paramsList.toArray(new String[0]); + } + + /** + * Entry-point that parses the correct SqoopTool to use from the args, but does not call + * System.exit() as main() will. + */ + public static int runTool(Map params) { + Configuration conf = new Configuration(); + try { + for (String fileName : + SqoopEnvConfiguration.SQOOP_HADOOP_SITE_FILE().getValue().split(";")) { + File resourceFile = Paths.get(fileName).toFile(); + if (resourceFile.exists()) { + LOG.info("Append resource: [" + resourceFile.getPath() + "] to configuration"); + conf.addResource(resourceFile.toURI().toURL()); + } + } + + } catch (MalformedURLException e) { + e.printStackTrace(); + System.exit(1); + } + return runTool(params, conf); + } + + public static int main(Map code) { + return runTool(code); + } + + /** + * Close method + * + * @throws JobClosableException + */ + public static void close() throws JobClosableException { + Job runnableJob = job.get(); + try { + if (Objects.nonNull(runnableJob)) { + runnableJob.killJob(); + } + if (sqlManager != null && sqlManager.getConnection() != null) { + sqlManager.getConnection().close(); + } + } catch (IllegalStateException se) { + if (isJobReady(runnableJob)) { + LOG.warn( + "Unable to close the mapReduce job, it seems that the job isn't connected to the cluster"); + } else if (Objects.nonNull(runnableJob)) { + String cluster = "UNKNOWN"; + try { + cluster = runnableJob.getCluster().getFileSystem().getCanonicalServiceName(); + } catch (Exception e) { + // Ignore + } + throw new JobClosableException( + "Unable to close the mapReduce job related to cluster [" + cluster + "]", + se); + } + } catch (IOException | SQLException e) { + throw new JobClosableException("Error in closing sqoop client", e); + } + } + + /** + * Get application id + * + * @return string value + */ + public static String getApplicationId() { + String applicationId = ""; + try { + Job runnableJob = job.get(); + if (Objects.nonNull(runnableJob)) { + JobID jobId = runnableJob.getJobID(); + if (Objects.nonNull(jobId)) { + applicationId = jobId.toString(); + } + } + } catch (Exception e) { + // Not throw exception + LOG.error("GetApplicationId in sqoop Error", e); + } + return applicationId; + } + + /** + * Get application url + * + * @return url + */ + public static String getApplicationURL() { + String applicationUrl = ""; + Job runnableJob = job.get(); + try { + if (Objects.nonNull(runnableJob)) { + return runnableJob.getTrackingURL(); + } + } catch (Exception e) { + if (e instanceof IllegalStateException && !isJobReady(runnableJob)) { + LOG.trace("The mapReduce job is not ready, wait for the job status to be Running"); + } else { + LOG.error("GetApplicationURL in sqoop Error", e); + } + } + return applicationUrl; + } + + /** + * Get progress value + * + * @return float value + */ + public static Float progress() { + Job runnableJob = job.get(); + try { + if (Objects.nonNull(runnableJob)) { + // Count by two paragraphs + progress = (runnableJob.mapProgress() + runnableJob.reduceProgress()) / 2.0f; + } + } catch (Exception e) { + if (e instanceof IllegalStateException && !isJobReady(runnableJob)) { + LOG.trace("The mapReduce job is not ready, the value of progress is 0.0 always"); + } else { + LOG.error("Get progress in sqoop Error", e); + } + } + return progress; + } + + /** + * Get progress info + * + * @return info + */ + public static JobProgressInfo getProgressInfo() { + Job runnableJob = job.get(); + try { + if (Objects.nonNull(runnableJob)) { + AtomicInteger totalTasks = new AtomicInteger(); + AtomicInteger failedTasks = new AtomicInteger(); + AtomicInteger runTasks = new AtomicInteger(); + AtomicInteger successTasks = new AtomicInteger(); + TaskType[] analyzeTypes = new TaskType[] {TaskType.MAP, TaskType.REDUCE}; + for (TaskType taskType : analyzeTypes) { + TaskReport[] taskReports = runnableJob.getTaskReports(taskType); + Optional.ofNullable(taskReports) + .ifPresent( + reports -> { + totalTasks.addAndGet(reports.length); + for (TaskReport report : reports) { + TIPStatus tipStatus = report.getCurrentStatus(); + switch (tipStatus) { + case FAILED: + case KILLED: + failedTasks.getAndIncrement(); + break; + case PENDING: + case RUNNING: + runTasks.getAndIncrement(); + break; + case COMPLETE: + successTasks.getAndIncrement(); + break; + default: + } + } + }); + } + return new JobProgressInfo( + getApplicationId(), + totalTasks.get(), + runTasks.get(), + failedTasks.get(), + successTasks.get()); + } + } catch (Exception e) { + if (e instanceof IllegalStateException && !isJobReady(runnableJob)) { + LOG.trace( + "The mapReduce job is not ready, the value of progressInfo is always empty"); + } else { + LOG.error("Get progress info in sqoop Error", e); + } + } + return new JobProgressInfo(getApplicationId(), 0, 0, 0, 0); + } + + /** + * Get metrics + * + * @return metrics map + */ + public static Map getMetrics() { + Job runnableJob = job.get(); + // Actual the counter map + Map metricsMap = new HashMap<>(); + try { + if (Objects.nonNull(runnableJob)) { + Counters counters = runnableJob.getCounters(); + counters.forEach( + group -> + metricsMap.computeIfAbsent( + group.getName(), + (groupName) -> { + Map map = new HashMap<>(); + group.forEach( + counter -> + map.put( + counter.getName(), + counter.getValue())); + return map; + })); + long startTime = runnableJob.getStartTime(); + long endTime = + runnableJob.getFinishTime() > 0 + ? runnableJob.getFinishTime() + : System.currentTimeMillis(); + // Analyze the run time + metricsMap.put(METRICS_RUN_TIME, startTime > 0 ? endTime - startTime : 0); + } + } catch (Exception e) { + if (e instanceof IllegalStateException && !isJobReady(runnableJob)) { + LOG.trace( + "The mapReduce job is not ready, the value of metricsMap is always empty"); + } else { + LOG.error("Get metrics info in sqoop Error", e); + } + } + return metricsMap; + } + + /** + * Get diagnosis + * + * @return + */ + public static Map getDiagnosis() { + Job runnableJob = job.get(); + Map diagnosis = new HashMap<>(); + try { + if (Objects.nonNull(runnableJob)) { + TaskType[] analyzeTypes = new TaskType[] {TaskType.MAP, TaskType.REDUCE}; + List listReports = new ArrayList<>(); + for (TaskType taskType : analyzeTypes) { + listReports.addAll(Arrays.asList(runnableJob.getTaskReports(taskType))); + } + listReports.forEach( + report -> diagnosis.put(report.getTaskId(), report.getDiagnostics())); + } + } catch (Exception e) { + if (e instanceof IllegalStateException && !isJobReady(runnableJob)) { + LOG.trace("The mapReduce job is not ready, the value of diagnosis is always empty"); + } else { + LOG.error("Get diagnosis info in sqoop Error", e); + } + } + return diagnosis; + } + + /** + * If the job is ready + * + * @param runnableJob job + * @return + */ + private static boolean isJobReady(Job runnableJob) { + boolean ready = false; + try { + Field stateField = Job.class.getDeclaredField("state"); + stateField.setAccessible(true); + Job.JobState state = (Job.JobState) stateField.get(runnableJob); + ready = state.equals(Job.JobState.RUNNING); + } catch (NoSuchFieldException | IllegalAccessException e) { + // Ignore + } + return ready; + } +} diff --git a/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/config/ExecutionContext.java b/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/config/ExecutionContext.java new file mode 100644 index 000000000..4dde08a76 --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/config/ExecutionContext.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.client.config; + +import org.apache.linkis.engineconn.common.creation.EngineCreationContext; + +public class ExecutionContext { + private final EngineCreationContext environmentContext; + + public ExecutionContext(EngineCreationContext environmentContext) { + this.environmentContext = environmentContext; + } +} diff --git a/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/config/ParamsMapping.java b/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/config/ParamsMapping.java new file mode 100644 index 000000000..d52d68176 --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/config/ParamsMapping.java @@ -0,0 +1,144 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.client.config; + +import org.apache.linkis.engineconnplugin.sqoop.context.SqoopParamsConfiguration; + +import java.util.HashMap; +import java.util.Map; + +/** Params mapping */ +public final class ParamsMapping { + public static Map mapping; + + static { + String paramPrefix = SqoopParamsConfiguration.SQOOP_PARAM_PREFIX().getValue(); + mapping = new HashMap<>(); + mapping.put(paramPrefix + "connect", "--connect"); + mapping.put(paramPrefix + "connection.manager", "--connection-manager"); + mapping.put(paramPrefix + "connection.param.file", "--connection-param-file"); + mapping.put(paramPrefix + "driver", "--driver"); + mapping.put(paramPrefix + "hadoop.home", "--hadoop-home"); + mapping.put(paramPrefix + "hadoop.mapred.home", "--hadoop-mapred-home"); + mapping.put(paramPrefix + "help", "help"); + mapping.put(paramPrefix + "password", "--password"); + mapping.put(paramPrefix + "password.alias", "--password-alias"); + mapping.put(paramPrefix + "password.file", "--password-file"); + mapping.put(paramPrefix + "relaxed.isolation", "--relaxed-isolation"); + mapping.put(paramPrefix + "skip.dist.cache", "--skip-dist-cache"); + mapping.put(paramPrefix + "username", "--username"); + mapping.put(paramPrefix + "verbose", "--verbose"); + mapping.put(paramPrefix + "append", "--append"); + mapping.put(paramPrefix + "as.avrodatafile", "--as-avrodatafile"); + mapping.put(paramPrefix + "as.parquetfile", "--as-parquetfile"); + mapping.put(paramPrefix + "as.sequencefile", "--as-sequencefile"); + mapping.put(paramPrefix + "as.textfile", "--as-textfile"); + mapping.put(paramPrefix + "autoreset.to.one.mapper", "--autoreset-to-one-mapper"); + mapping.put(paramPrefix + "boundary.query", "--boundary-query"); + mapping.put(paramPrefix + "case.insensitive", "--case-insensitive"); + mapping.put(paramPrefix + "columns", "--columns"); + mapping.put(paramPrefix + "compression.codec", "--compression-codec"); + mapping.put(paramPrefix + "delete.target.dir", "--delete-target-dir"); + mapping.put(paramPrefix + "direct", "--direct"); + mapping.put(paramPrefix + "direct.split.size", "--direct-split-size"); + mapping.put(paramPrefix + "query", "--query"); + mapping.put(paramPrefix + "fetch.size", "--fetch-size"); + mapping.put(paramPrefix + "inline.lob.limit", "--inline-lob-limit"); + mapping.put(paramPrefix + "num.mappers", "--num-mappers"); + mapping.put(paramPrefix + "mapreduce.job.name", "--mapreduce-job-name"); + mapping.put(paramPrefix + "merge.key", "--merge-key"); + mapping.put(paramPrefix + "split.by", "--split-by"); + mapping.put(paramPrefix + "table", "--table"); + mapping.put(paramPrefix + "target.dir", "--target-dir"); + mapping.put(paramPrefix + "validate", "--validate"); + mapping.put(paramPrefix + "validation.failurehandler", "--validation-failurehandler"); + mapping.put(paramPrefix + "validation.threshold", " --validation-threshold"); + mapping.put(paramPrefix + "validator", "--validator"); + mapping.put(paramPrefix + "warehouse.dir", "--warehouse-dir"); + mapping.put(paramPrefix + "where", "--where"); + mapping.put(paramPrefix + "compress", "--compress"); + mapping.put(paramPrefix + "check.column", "--check-column"); + mapping.put(paramPrefix + "incremental", "--incremental"); + mapping.put(paramPrefix + "last.value", "--last-value"); + mapping.put(paramPrefix + "enclosed.by", "--enclosed-by"); + mapping.put(paramPrefix + "escaped.by", "--escaped-by"); + mapping.put(paramPrefix + "fields.terminated.by", "--fields-terminated-by"); + mapping.put(paramPrefix + "lines.terminated.by", "--lines-terminated-by"); + mapping.put(paramPrefix + "mysql.delimiters", "--mysql-delimiters"); + mapping.put(paramPrefix + "optionally.enclosed.by", "--optionally-enclosed-by"); + mapping.put(paramPrefix + "input.enclosed.by", "--input-enclosed-by"); + mapping.put(paramPrefix + "input.escaped.by", "--input-escaped-by"); + mapping.put(paramPrefix + "input.fields.terminated.by", "--input-fields-terminated-by"); + mapping.put(paramPrefix + "input.lines.terminated.by", "--input-lines-terminated-by"); + mapping.put(paramPrefix + "input.optionally.enclosed.by", "--input-optionally-enclosed-by"); + mapping.put(paramPrefix + "create.hive.table", "--create-hive-table"); + mapping.put(paramPrefix + "hive.delims.replacement", "--hive-delims-replacement"); + mapping.put(paramPrefix + "hive.database", "--hive-database"); + mapping.put(paramPrefix + "hive.drop.import.delims", "--hive-drop-import-delims"); + mapping.put(paramPrefix + "hive.home", "--hive-home"); + mapping.put(paramPrefix + "hive.import", "--hive-import"); + mapping.put(paramPrefix + "hive.overwrite", "--hive-overwrite"); + mapping.put(paramPrefix + "hive.partition.value", "--hive-partition-value"); + mapping.put(paramPrefix + "hive.table", "--hive-table"); + mapping.put(paramPrefix + "column.family", "--column-family"); + mapping.put(paramPrefix + "hbase.bulkload", "--hbase-bulkload"); + mapping.put(paramPrefix + "hbase.create.table", "--hbase-create-table"); + mapping.put(paramPrefix + "hbase.row.key", "--hbase-row-key"); + mapping.put(paramPrefix + "hbase.table", "--hbase-table"); + mapping.put(paramPrefix + "hcatalog.database", "--hcatalog-database"); + mapping.put(paramPrefix + "hcatalog.home", "--hcatalog-home"); + mapping.put(paramPrefix + "hcatalog.partition.keys", "--hcatalog-partition-keys"); + mapping.put(paramPrefix + "hcatalog.partition.values", "--hcatalog-partition-values"); + mapping.put(paramPrefix + "hcatalog.table", "--hcatalog-table"); + mapping.put(paramPrefix + "hive.partition.key", "--hive-partition-key"); + mapping.put(paramPrefix + "map.column.hive", "--map-column-hive"); + mapping.put(paramPrefix + "create.hcatalog.table", "--create-hcatalog-table"); + mapping.put(paramPrefix + "hcatalog.storage.stanza", "--hcatalog-storage-stanza"); + mapping.put(paramPrefix + "accumulo.batch.size", "--accumulo-batch-size"); + mapping.put(paramPrefix + "accumulo.column.family", "--accumulo-column-family"); + mapping.put(paramPrefix + "accumulo.create.table", "--accumulo-create-table"); + mapping.put(paramPrefix + "accumulo.instance", "--accumulo-instance"); + mapping.put(paramPrefix + "accumulo.max.latency", "--accumulo-max-latency"); + mapping.put(paramPrefix + "accumulo.password", "--accumulo-password"); + mapping.put(paramPrefix + "accumulo.row.key", "--accumulo-row-key"); + mapping.put(paramPrefix + "accumulo.table", "--accumulo-table"); + mapping.put(paramPrefix + "accumulo.user", "--accumulo-user"); + mapping.put(paramPrefix + "accumulo.visibility", "--accumulo-visibility"); + mapping.put(paramPrefix + "accumulo.zookeepers", "--accumulo-zookeepers"); + mapping.put(paramPrefix + "bindir", "--bindir"); + mapping.put(paramPrefix + "class.name", "--class-name"); + mapping.put(paramPrefix + "input.null.non.string", "--input-null-non-string"); + mapping.put(paramPrefix + "input.null.string", "--input-null-string"); + mapping.put(paramPrefix + "jar.file", "--jar-file"); + mapping.put(paramPrefix + "map.column.java", "--map-column-java"); + mapping.put(paramPrefix + "null.non.string", "--null-non-string"); + mapping.put(paramPrefix + "null.string", "--null-string"); + mapping.put(paramPrefix + "outdir", "--outdir"); + mapping.put(paramPrefix + "package.name", "--package-name"); + mapping.put(paramPrefix + "conf", "-conf"); + mapping.put(paramPrefix + "D", "-D"); + mapping.put(paramPrefix + "fs", "-fs"); + mapping.put(paramPrefix + "jt", "-jt"); + mapping.put(paramPrefix + "files", "-files"); + mapping.put(paramPrefix + "libjars", "-libjars"); + mapping.put(paramPrefix + "archives", "-archives"); + mapping.put(paramPrefix + "update.key", "--update-key"); + mapping.put(paramPrefix + "update.mode", "--update-mode"); + mapping.put(paramPrefix + "export.dir", "--export-dir"); + } +} diff --git a/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/exception/JobClosableException.java b/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/exception/JobClosableException.java new file mode 100644 index 000000000..efbcd0e6b --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/exception/JobClosableException.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.client.exception; + +import org.apache.linkis.common.exception.ErrorException; + +/** Exception in closing/destroying the job */ +public class JobClosableException extends ErrorException { + private static final long serialVersionUID = 1L; + + public static final int ERROR_CODE = 16025; + + public JobClosableException(String message) { + super(ERROR_CODE, message); + } + + public JobClosableException(String message, Throwable e) { + super(ERROR_CODE, message); + this.initCause(e); + } +} diff --git a/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/exception/JobExecutionException.java b/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/exception/JobExecutionException.java new file mode 100644 index 000000000..168d54ff3 --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/exception/JobExecutionException.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.client.exception; + +import org.apache.linkis.common.exception.ErrorException; + +public class JobExecutionException extends ErrorException { + private static final long serialVersionUID = 1L; + + public static final int ERROR_CODE = 16023; + + public JobExecutionException(String message) { + super(ERROR_CODE, message); + } + + public JobExecutionException(String message, Throwable e) { + super(ERROR_CODE, message); + this.initCause(e); + } +} diff --git a/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/utils/JarLoader.java b/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/utils/JarLoader.java new file mode 100644 index 000000000..6140e68e8 --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/utils/JarLoader.java @@ -0,0 +1,170 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.client.utils; + +import org.apache.commons.lang3.Validate; + +import java.io.File; +import java.io.FileFilter; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.security.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +public class JarLoader extends URLClassLoader { + private AccessControlContext acc; + + public JarLoader(String[] paths) { + this(paths, false); + } + + public JarLoader(String[] paths, boolean recursive) { + this(paths, recursive, JarLoader.class.getClassLoader()); + } + + public JarLoader(String[] paths, boolean recursive, ClassLoader parent) { + super(getURLs(paths, recursive), parent); + } + + private static URL[] getURLs(String[] paths, boolean recursive) { + List urls = new ArrayList<>(); + if (recursive) { + List dirs = new ArrayList<>(); + for (String path : paths) { + dirs.add(path); + collectDirs(path, dirs); + } + for (String path : dirs) { + urls.addAll(doGetURLs(path)); + } + } else { + // For classpath, classloader will recursive automatically + urls.addAll( + Arrays.stream(paths) + .map(File::new) + .filter(File::exists) + .map( + f -> { + try { + return f.toURI().toURL(); + } catch (MalformedURLException e) { + // Ignore + return null; + } + }) + .collect(Collectors.toList())); + } + return urls.toArray(new URL[0]); + } + + public void addJarURL(String path) { + // Single jar + File singleJar = new File(path); + if (singleJar.exists() && singleJar.isFile()) { + try { + this.addURL(singleJar.toURI().toURL()); + } catch (MalformedURLException e) { + // Ignore + } + } + } + + private static void collectDirs(String path, List collector) { + + File current = new File(path); + if (!current.exists() || !current.isDirectory()) { + return; + } + + if (null != current.listFiles()) { + for (File child : Objects.requireNonNull(current.listFiles())) { + if (!child.isDirectory()) { + continue; + } + + collector.add(child.getAbsolutePath()); + collectDirs(child.getAbsolutePath(), collector); + } + } + } + + private static List doGetURLs(final String path) { + + File jarPath = new File(path); + + Validate.isTrue(jarPath.exists() && jarPath.isDirectory(), "jar包路径必须存在且为目录."); + + /* set filter */ + FileFilter jarFilter = pathname -> pathname.getName().endsWith(".jar"); + + /* iterate all jar */ + File[] allJars = new File(path).listFiles(jarFilter); + assert allJars != null; + List jarURLs = new ArrayList<>(allJars.length); + + for (File allJar : allJars) { + try { + jarURLs.add(allJar.toURI().toURL()); + } catch (Exception e) { + // Ignore + } + } + + return jarURLs; + } + + /** + * change the order to load class + * + * @param name name + * @param resolve isResolve + * @return + * @throws ClassNotFoundException + */ + @Override + public Class loadClass(String name, boolean resolve) throws ClassNotFoundException { + synchronized (getClassLoadingLock(name)) { + // First, check if the class has already been loaded + Class c = findLoadedClass(name); + if (c == null) { + long t0 = System.nanoTime(); + try { + // invoke findClass in this class + c = findClass(name); + } catch (ClassNotFoundException e) { + // ClassNotFoundException thrown if class not found + } + if (c == null) { + return super.loadClass(name, resolve); + } + // For compatibility with higher versions > java 1.8.0_141 + // sun.misc.PerfCounter.getFindClasses().addElapsedTimeFrom(t0); + // sun.misc.PerfCounter.getFindClasses().increment(); + } + if (resolve) { + resolveClass(c); + } + return c; + } + } +} diff --git a/exchangis-plugins/engine/sqoop/src/main/java/org/apache/sqoop/mapreduce/JobBase.java b/exchangis-plugins/engine/sqoop/src/main/java/org/apache/sqoop/mapreduce/JobBase.java new file mode 100644 index 000000000..6703c303c --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/java/org/apache/sqoop/mapreduce/JobBase.java @@ -0,0 +1,410 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sqoop.mapreduce; + +import org.apache.linkis.engineconnplugin.sqoop.client.Sqoop; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; +import org.apache.hadoop.mapreduce.InputFormat; +import org.apache.hadoop.mapreduce.Job; +import org.apache.hadoop.mapreduce.Mapper; +import org.apache.hadoop.mapreduce.OutputFormat; +import org.apache.hadoop.util.StringUtils; +import org.apache.sqoop.config.ConfigurationConstants; + +import com.cloudera.sqoop.SqoopOptions; +import com.cloudera.sqoop.config.ConfigurationHelper; +import com.cloudera.sqoop.manager.ConnManager; +import com.cloudera.sqoop.tool.SqoopTool; +import com.cloudera.sqoop.util.ClassLoaderStack; +import com.cloudera.sqoop.util.Jars; + +import java.io.File; +import java.io.IOException; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Base class for configuring and running a MapReduce job. Allows dependency injection, etc, for + * easy customization of import job types. + */ +public class JobBase { + + public static final Log LOG = LogFactory.getLog(JobBase.class.getName()); + + public static final String SERIALIZE_SQOOPOPTIONS = "sqoop.jobbase.serialize.sqoopoptions"; + public static final boolean SERIALIZE_SQOOPOPTIONS_DEFAULT = false; + public static final String HADOOP_MAP_TASK_MAX_ATTEMTPS = "mapreduce.map.maxattempts"; + public static final String HADOOP_REDUCE_TASK_MAX_ATTEMTPS = "mapreduce.reduce.maxattempts"; + + protected SqoopOptions options; + protected Class mapperClass; + protected Class inputFormatClass; + protected Class outputFormatClass; + + private Job mrJob; + + private ClassLoader prevClassLoader = null; + protected final boolean isHCatJob; + + public static final String PROPERTY_VERBOSE = "sqoop.verbose"; + + public JobBase() { + this(null); + } + + public JobBase(final SqoopOptions opts) { + this(opts, null, null, null); + } + + public JobBase( + final SqoopOptions opts, + final Class mapperClass, + final Class inputFormatClass, + final Class outputFormatClass) { + System.out.println(SqoopOptions.class.getClassLoader()); + this.options = opts; + this.mapperClass = mapperClass; + this.inputFormatClass = inputFormatClass; + this.outputFormatClass = outputFormatClass; + isHCatJob = options.getHCatTableName() != null; + } + + /** @return the mapper class to use for the job. */ + protected Class getMapperClass() throws ClassNotFoundException { + return this.mapperClass; + } + + /** @return the inputformat class to use for the job. */ + protected Class getInputFormatClass() throws ClassNotFoundException { + return this.inputFormatClass; + } + + /** @return the outputformat class to use for the job. */ + protected Class getOutputFormatClass() throws ClassNotFoundException { + return this.outputFormatClass; + } + + /** Set the OutputFormat class to use for this job. */ + public void setOutputFormatClass(Class cls) { + this.outputFormatClass = cls; + } + + /** Set the InputFormat class to use for this job. */ + public void setInputFormatClass(Class cls) { + this.inputFormatClass = cls; + } + + /** Set the Mapper class to use for this job. */ + public void setMapperClass(Class cls) { + this.mapperClass = cls; + } + + /** Set the SqoopOptions configuring this job. */ + public void setOptions(SqoopOptions opts) { + this.options = opts; + } + + /** + * Put jar files required by Sqoop into the DistributedCache. + * + * @param job the Job being submitted. + * @param mgr the ConnManager to use. + */ + protected void cacheJars(Job job, ConnManager mgr) throws IOException { + if (options.isSkipDistCache()) { + LOG.info("Not adding sqoop jars to distributed cache as requested"); + return; + } + + Configuration conf = job.getConfiguration(); + FileSystem fs = FileSystem.getLocal(conf); + Set localUrls = new HashSet(); + + addToCache(Jars.getSqoopJarPath(), fs, localUrls); + if (null != mgr) { + addToCache(Jars.getDriverClassJar(mgr), fs, localUrls); + addToCache(Jars.getJarPathForClass(mgr.getClass()), fs, localUrls); + } + + SqoopTool tool = this.options.getActiveSqoopTool(); + if (null != tool) { + // Make sure the jar for the tool itself is on the classpath. (In case + // this is a third-party plugin tool.) + addToCache(Jars.getJarPathForClass(tool.getClass()), fs, localUrls); + List toolDeps = tool.getDependencyJars(); + if (null != toolDeps) { + for (String depFile : toolDeps) { + addToCache(depFile, fs, localUrls); + } + } + } + + // If the user specified a particular jar file name, + + // Add anything in $SQOOP_HOME/lib, if this is set. + String sqoopHome = System.getenv("SQOOP_HOME"); + if (null != sqoopHome) { + File sqoopHomeFile = new File(sqoopHome); + File sqoopLibFile = new File(sqoopHomeFile, "lib"); + if (sqoopLibFile.exists()) { + addDirToCache(sqoopLibFile, fs, localUrls); + } + } else { + LOG.warn("SQOOP_HOME is unset. May not be able to find " + "all job dependencies."); + } + + // If the user run import into hive as Parquet file, + // Add anything in $HIVE_HOME/lib. + if (options.doHiveImport() + && (options.getFileLayout() == SqoopOptions.FileLayout.ParquetFile)) { + String hiveHome = options.getHiveHome(); + if (null != hiveHome) { + File hiveHomeFile = new File(hiveHome); + File hiveLibFile = new File(hiveHomeFile, "lib"); + if (hiveLibFile.exists()) { + addDirToCache(hiveLibFile, fs, localUrls); + } + } else { + LOG.warn("HIVE_HOME is unset. Cannot add hive libs as dependencies."); + } + } + + String tmpjars = conf.get(ConfigurationConstants.MAPRED_DISTCACHE_CONF_PARAM); + StringBuilder sb = new StringBuilder(); + + // If we didn't put anything in our set, then there's nothing to cache. + if (localUrls.isEmpty() && (org.apache.commons.lang.StringUtils.isEmpty(tmpjars))) { + return; + } + + if (null != tmpjars) { + String[] tmpjarsElements = tmpjars.split(","); + for (String jarElement : tmpjarsElements) { + if (jarElement.isEmpty()) { + warn("Empty input is invalid and was removed from tmpjars."); + } else { + sb.append(jarElement); + sb.append(","); + } + } + } + + int lastComma = sb.lastIndexOf(","); + if (localUrls.isEmpty() && lastComma >= 0) { + sb.deleteCharAt(lastComma); + } + + // Add these to the 'tmpjars' array, which the MR JobSubmitter + // will upload to HDFS and put in the DistributedCache libjars. + sb.append(StringUtils.arrayToString(localUrls.toArray(new String[0]))); + conf.set(ConfigurationConstants.MAPRED_DISTCACHE_CONF_PARAM, sb.toString()); + } + + protected void warn(String message) { + LOG.warn(message); + } + + private void addToCache(String file, FileSystem fs, Set localUrls) { + if (null == file) { + return; + } + + Path p = new Path(file); + String qualified = p.makeQualified(fs).toString(); + LOG.debug("Adding to job classpath: " + qualified); + localUrls.add(qualified); + } + + /** Add the .jar elements of a directory to the DCache classpath, nonrecursively. */ + private void addDirToCache(File dir, FileSystem fs, Set localUrls) { + if (null == dir) { + return; + } + + for (File libfile : dir.listFiles()) { + if (libfile.exists() && !libfile.isDirectory() && libfile.getName().endsWith("jar")) { + addToCache(libfile.toString(), fs, localUrls); + } + } + } + + /** If jars must be loaded into the local environment, do so here. */ + protected void loadJars(Configuration conf, String ormJarFile, String tableClassName) + throws IOException { + + boolean isLocal = + "local".equals(conf.get("mapreduce.jobtracker.address")) + || "local".equals(conf.get("mapred.job.tracker")); + if (isLocal) { + // If we're using the LocalJobRunner, then instead of using the compiled + // jar file as the job source, we're running in the current thread. Push + // on another classloader that loads from that jar in addition to + // everything currently on the classpath. + this.prevClassLoader = ClassLoaderStack.addJarFile(ormJarFile, tableClassName); + } + } + + /** If any classloader was invoked by loadJars, free it here. */ + protected void unloadJars() { + if (null != this.prevClassLoader) { + // unload the special classloader for this jar. + ClassLoaderStack.setCurrentClassLoader(this.prevClassLoader); + } + } + + /** Configure the inputformat to use for the job. */ + protected void configureInputFormat( + Job job, String tableName, String tableClassName, String splitByCol) + throws ClassNotFoundException, IOException { + // TODO: 'splitByCol' is import-job specific; lift it out of this API. + Class ifClass = getInputFormatClass(); + LOG.debug("Using InputFormat: " + ifClass); + job.setInputFormatClass(ifClass); + } + + /** Configure the output format to use for the job. */ + protected void configureOutputFormat(Job job, String tableName, String tableClassName) + throws ClassNotFoundException, IOException { + Class ofClass = getOutputFormatClass(); + LOG.debug("Using OutputFormat: " + ofClass); + job.setOutputFormatClass(ofClass); + } + + /** + * Set the mapper class implementation to use in the job, as well as any related configuration + * (e.g., map output types). + */ + protected void configureMapper(Job job, String tableName, String tableClassName) + throws ClassNotFoundException, IOException { + job.setMapperClass(getMapperClass()); + } + + /** + * Configure the number of map/reduce tasks to use in the job, returning the number of map tasks + * for backward compatibility. + */ + protected int configureNumTasks(Job job) throws IOException { + int numMapTasks = configureNumMapTasks(job); + configureNumReduceTasks(job); + return numMapTasks; + } + + /** Configure the number of map tasks to use in the job. */ + protected int configureNumMapTasks(Job job) throws IOException { + int numMapTasks = options.getNumMappers(); + if (numMapTasks < 1) { + numMapTasks = SqoopOptions.DEFAULT_NUM_MAPPERS; + LOG.warn("Invalid mapper count; using " + numMapTasks + " mappers."); + } + ConfigurationHelper.setJobNumMaps(job, numMapTasks); + return numMapTasks; + } + + /** Configure the number of reduce tasks to use in the job. */ + protected int configureNumReduceTasks(Job job) throws IOException { + job.setNumReduceTasks(0); + return 0; + } + + /** Set the main job that will be run. */ + protected void setJob(Job job) { + LOG.info("Customize JobBase Set The Job"); + mrJob = job; + Sqoop.job.set(job); + } + + /** @return the main MapReduce job that is being run, or null if no job has started. */ + public Job getJob() { + return mrJob; + } + + /** + * Create new Job object in unified way for all types of jobs. + * + * @param configuration Hadoop configuration that should be used + * @return New job object, created object won't be persisted in the instance + */ + public Job createJob(Configuration configuration) throws IOException { + // Put the SqoopOptions into job if requested + if (configuration.getBoolean(SERIALIZE_SQOOPOPTIONS, SERIALIZE_SQOOPOPTIONS_DEFAULT)) { + putSqoopOptionsToConfiguration(options, configuration); + } + + return new Job(configuration); + } + + /** + * Iterates over serialized form of SqoopOptions and put them into Configuration object. + * + * @param opts SqoopOptions that should be serialized + * @param configuration Target configuration object + */ + public void putSqoopOptionsToConfiguration(SqoopOptions opts, Configuration configuration) { + for (Map.Entry e : opts.writeProperties().entrySet()) { + String key = (String) e.getKey(); + String value = (String) e.getValue(); + + // We don't need to do if(value is empty) because that is already done + // for us by the SqoopOptions.writeProperties() method. + configuration.set("sqoop.opt." + key, value); + } + } + + /** Actually run the MapReduce job. */ + protected boolean runJob(Job job) + throws ClassNotFoundException, IOException, InterruptedException { + return job.waitForCompletion(true); + } + + /** + * Display a notice on the log that the current MapReduce job has been retired, and thus + * Counters are unavailable. + * + * @param log the Log to display the info to. + */ + protected void displayRetiredJobNotice(Log log) { + log.info("The MapReduce job has already been retired. Performance"); + log.info("counters are unavailable. To get this information, "); + log.info("you will need to enable the completed job store on "); + log.info("the jobtracker with:"); + log.info("mapreduce.jobtracker.persist.jobstatus.active = true"); + log.info("mapreduce.jobtracker.persist.jobstatus.hours = 1"); + log.info("A jobtracker restart is required for these settings"); + log.info("to take effect."); + } + + /** + * Save interesting options to constructed job. Goal here is to propagate some of them to the + * job itself, so that they can be easily accessed. We're propagating only interesting global + * options (like verbose flag). + * + * @param job Destination job to save options + */ + protected void propagateOptionsToJob(Job job) { + Configuration configuration = job.getConfiguration(); + + // So far, propagate only verbose flag + configuration.setBoolean(PROPERTY_VERBOSE, options.getVerbose()); + } +} diff --git a/exchangis-plugins/engine/sqoop/src/main/resources/linkis-engineconn.properties b/exchangis-plugins/engine/sqoop/src/main/resources/linkis-engineconn.properties new file mode 100644 index 000000000..99b76eaea --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/resources/linkis-engineconn.properties @@ -0,0 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + +wds.linkis.server.version=v1 + +wds.linkis.engineconn.plugin.default.class=org.apache.linkis.engineconnplugin.sqoop.SqoopEngineConnPlugin + +wds.linkis.engine.connector.hooks=org.apache.linkis.engineconn.computation.executor.hook.ComputationEngineConnHook +# wds.linkis.hadoop.site.xml= \ No newline at end of file diff --git a/exchangis-plugins/engine/sqoop/src/main/resources/log4j2.xml b/exchangis-plugins/engine/sqoop/src/main/resources/log4j2.xml new file mode 100644 index 000000000..3b45ae2a1 --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/resources/log4j2.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/SqoopEngineConnPlugin.scala b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/SqoopEngineConnPlugin.scala new file mode 100644 index 000000000..52266bb71 --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/SqoopEngineConnPlugin.scala @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop + +import org.apache.linkis.manager.engineplugin.common.EngineConnPlugin +import org.apache.linkis.manager.engineplugin.common.creation.EngineConnFactory +import org.apache.linkis.manager.engineplugin.common.launch.EngineConnLaunchBuilder +import org.apache.linkis.manager.engineplugin.common.resource.{EngineResourceFactory, GenericEngineResourceFactory} +import org.apache.linkis.manager.label.entity.Label +import org.apache.linkis.engineconnplugin.sqoop.factory.SqoopEngineConnFactory +import org.apache.linkis.engineconnplugin.sqoop.launch.SqoopEngineConnLaunchBuilder + + +class SqoopEngineConnPlugin extends EngineConnPlugin{ + private val EP_CONTEXT_CONSTRUCTOR_LOCK = new Object() + private var engineResourceFactory: EngineResourceFactory = _ + private var engineConnLaunchBuilder: EngineConnLaunchBuilder = _ + private var engineConnFactory: EngineConnFactory = _ + override def init(params: java.util.Map[String, Any]): Unit = {} + + override def getEngineResourceFactory: EngineResourceFactory = { + + EP_CONTEXT_CONSTRUCTOR_LOCK.synchronized{ + if(null == engineResourceFactory){ + engineResourceFactory = new GenericEngineResourceFactory + } + engineResourceFactory + } + } + + override def getEngineConnLaunchBuilder: EngineConnLaunchBuilder = { + EP_CONTEXT_CONSTRUCTOR_LOCK.synchronized { + if (null == engineConnLaunchBuilder) { + engineConnLaunchBuilder = new SqoopEngineConnLaunchBuilder() + } + engineConnLaunchBuilder + } + } + + + override def getEngineConnFactory: EngineConnFactory = { + EP_CONTEXT_CONSTRUCTOR_LOCK.synchronized { + if (null == engineConnFactory) { + engineConnFactory = new SqoopEngineConnFactory + } + engineConnFactory + } + } + + override def getDefaultLabels: java.util.List[Label[_]] = new java.util.ArrayList[Label[_]] +} diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopEngineConnContext.scala b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopEngineConnContext.scala new file mode 100644 index 000000000..be1d340db --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopEngineConnContext.scala @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.context + +import org.apache.linkis.engineconnplugin.sqoop.client.config.ExecutionContext + +class SqoopEngineConnContext{ + private var executionContext: ExecutionContext = _ + + def getExecutionContext: ExecutionContext = executionContext + + def setExecutionContext(executionContext: ExecutionContext): Unit = this.executionContext = executionContext + +} diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopEnvConfiguration.scala b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopEnvConfiguration.scala new file mode 100644 index 000000000..63417dbca --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopEnvConfiguration.scala @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.context + +import org.apache.linkis.common.conf.{CommonVars, TimeType} + +object SqoopEnvConfiguration { + + val SQOOP_HADOOP_SITE_FILE: CommonVars[String] = CommonVars("wds.linkis.hadoop.site.xml", "core-site.xml;hdfs-site.xml;yarn-site.xml;mapred-site.xml") + + val SQOOP_STATUS_FETCH_INTERVAL: CommonVars[TimeType] = CommonVars("sqoop.fetch.status.interval", new TimeType("5s")) + + val LINKIS_DATASOURCE_SERVICE_NAME: CommonVars[String] = CommonVars("wds.linkis.datasource.service.name", "linkis-ps-data-source-manager") + + val SQOOP_HOME: CommonVars[String] = CommonVars("SQOOP_HOME", "") + + val SQOOP_CONF_DIR: CommonVars[String] = CommonVars("SQOOP_CONF_DIR", "") + + val SQOOP_HCAT_HOME: CommonVars[String] = CommonVars("HCAT_HOME", "") + + val SQOOP_HBASE_HOME: CommonVars[String] = CommonVars("HBASE_HOME", "") + + val SQOOP_ZOOCFGDIR: CommonVars[String] = CommonVars("ZOOCFGDIR", "") +} diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopParamsConfiguration.scala b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopParamsConfiguration.scala new file mode 100644 index 000000000..0c449a9d4 --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopParamsConfiguration.scala @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.context + +import org.apache.linkis.common.conf.CommonVars + +/** + * Sqoop Params Configuration + */ +object SqoopParamsConfiguration { + + val SQOOP_PARAM_MODE: CommonVars[String] = CommonVars("sqoop.params.name.mode", "sqoop.mode") + + val SQOOP_PARAM_HOST: CommonVars[String] = CommonVars("sqoop.params.name.host", "sqoop.args.host") + + val SQOOP_PARAM_PORT: CommonVars[String] = CommonVars("sqoop.params.name.ip", "sqoop.args.port") + + val SQOOP_PARAM_CONNECT_PARAMS: CommonVars[String] = CommonVars("sqoop.params.name.ip", "sqoop.args.params") + + val SQOOP_PARAM_CONNECT: CommonVars[String] = CommonVars("sqoop.params.name.connect", "sqoop.args.connect") + + val SQOOP_PARAM_DATA_SOURCE: CommonVars[String] = CommonVars("sqoop.params.name.data-source", "sqoop.args.datasource.name") + + val SQOOP_PARAM_PREFIX: CommonVars[String] = CommonVars("sqoop.params.name.prefix", "sqoop.args.") + + val SQOOP_PARAM_ENV_PREFIX: CommonVars[String] = CommonVars("sqoop.params.name.env.prefix", "sqoop.env.") +} diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopResourceConfiguration.scala b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopResourceConfiguration.scala new file mode 100644 index 000000000..710d28cc2 --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopResourceConfiguration.scala @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.context + +import org.apache.linkis.common.conf.CommonVars + + +object SqoopResourceConfiguration { + + val LINKIS_SQOOP_TASK_MAP_MEMORY: CommonVars[Int] = CommonVars[Int]("sqoop.task.map.memory", 2) + + val LINKIS_SQOOP_TASK_MAP_CPU_CORES: CommonVars[Int] = CommonVars[Int]("sqoop.task.map.cpu.cores", 1) + + val LINKIS_QUEUE_NAME: CommonVars[String] = CommonVars[String]("wds.linkis.rm.yarnqueue", "default") +} diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopExecutor.scala b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopExecutor.scala new file mode 100644 index 000000000..5c43366ba --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopExecutor.scala @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.executor + +import org.apache.linkis.engineconn.executor.entity.{LabelExecutor, ResourceExecutor, YarnExecutor} +import org.apache.linkis.engineconnplugin.sqoop.client.Sqoop +import org.apache.linkis.engineconnplugin.sqoop.context.SqoopResourceConfiguration.LINKIS_QUEUE_NAME +import org.apache.linkis.manager.common.entity.resource.NodeResource +import org.apache.linkis.manager.label.entity.Label +import java.util + +import org.apache.linkis.engineconnplugin.sqoop.client.Sqoop +import org.apache.linkis.engineconnplugin.sqoop.client.exception.JobExecutionException +import org.apache.linkis.engineconnplugin.sqoop.context.SqoopEngineConnContext + +trait SqoopExecutor extends YarnExecutor with LabelExecutor with ResourceExecutor{ + private var yarnMode: String = "Client" + private var executorLabels: util.List[Label[_]] = new util.ArrayList[Label[_]] + override def getApplicationId: String = Sqoop.getApplicationId + + override def getApplicationURL: String = Sqoop.getApplicationURL + + override def getYarnMode: String = yarnMode + def setYarnMode(yarnMode: String): Unit = this.yarnMode = yarnMode + + override def getQueue: String = LINKIS_QUEUE_NAME.getValue + + override def getExecutorLabels(): util.List[Label[_]] = executorLabels + + override def setExecutorLabels(labels: util.List[Label[_]]): Unit = this.executorLabels = labels + + override def requestExpectedResource(expectedResource: NodeResource): NodeResource = throw new JobExecutionException("Not support method for requestExpectedResource.") + + protected val sqoopEngineConnContext: SqoopEngineConnContext +} diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopOnceCodeExecutor.scala b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopOnceCodeExecutor.scala new file mode 100644 index 000000000..1d7cb6af3 --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopOnceCodeExecutor.scala @@ -0,0 +1,142 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.executor + +import org.apache.linkis.common.utils.{JsonUtils, OverloadUtils, Utils} +import org.apache.linkis.engineconn.once.executor.{OnceExecutorExecutionContext, OperableOnceExecutor} +import org.apache.linkis.engineconnplugin.sqoop.client.{LinkisSqoopClient, Sqoop} +import org.apache.linkis.engineconnplugin.sqoop.context.SqoopResourceConfiguration.{LINKIS_QUEUE_NAME, LINKIS_SQOOP_TASK_MAP_CPU_CORES, LINKIS_SQOOP_TASK_MAP_MEMORY} +import org.apache.linkis.engineconnplugin.sqoop.context.{SqoopEngineConnContext, SqoopParamsConfiguration} +import org.apache.linkis.manager.common.entity.resource.{CommonNodeResource, DriverAndYarnResource, LoadInstanceResource, NodeResource, YarnResource} +import org.apache.linkis.scheduler.executer.ErrorExecuteResponse +import java.util +import java.util.concurrent.{Future, TimeUnit} + +import org.apache.linkis.engineconn.common.creation.EngineCreationContext +import org.apache.linkis.engineconn.core.EngineConnObject +import org.apache.linkis.manager.engineplugin.common.conf.EngineConnPluginConf +import org.apache.linkis.protocol.engine.JobProgressInfo +import org.apache.linkis.engineconnplugin.sqoop.client.LinkisSqoopClient +import org.apache.linkis.engineconnplugin.sqoop.client.exception.JobExecutionException +import org.apache.linkis.engineconnplugin.sqoop.context.{SqoopEngineConnContext, SqoopEnvConfiguration} +import org.apache.linkis.engineconnplugin.sqoop.params.SqoopParamsResolver + + +class SqoopOnceCodeExecutor(override val id: Long, + override protected val sqoopEngineConnContext: SqoopEngineConnContext) extends SqoopOnceExecutor with OperableOnceExecutor{ + + + private var params: util.Map[String, String] = _ + private var future: Future[_] = _ + private var daemonThread: Future[_] = _ + private val paramsResolvers: Array[SqoopParamsResolver] = Array() + + override def doSubmit(onceExecutorExecutionContext: OnceExecutorExecutionContext, options: Map[String, String]): Unit = { + var isFailed = false + future = Utils.defaultScheduler.submit(new Runnable { + override def run(): Unit = { + // TODO filter job content + params = onceExecutorExecutionContext.getOnceExecutorContent.getJobContent.asInstanceOf[util.Map[String, String]] + info("Try to execute params." + params) + if(runSqoop(params, onceExecutorExecutionContext.getEngineCreationContext) != 0) { + isFailed = true + tryFailed() + setResponse(ErrorExecuteResponse("Run code failed!", new JobExecutionException("Exec Sqoop Code Error"))) + } + info("All codes completed, now to stop SqoopEngineConn.") + closeDaemon() + if (!isFailed) { + trySucceed() + } + this synchronized notify() + } + }) + } + protected def runSqoop(params: util.Map[String, String], context: EngineCreationContext): Int = { + Utils.tryCatch { + val finalParams = paramsResolvers.foldLeft(params) { + case (newParam, resolver) => resolver.resolve(newParam, context) + } + LinkisSqoopClient.run(finalParams) + }{ + case e: Exception => + error(s"Run Error Message: ${e.getMessage}", e) + -1 + } + + } + + override protected def waitToRunning(): Unit = { + if (!isCompleted) daemonThread = Utils.defaultScheduler.scheduleAtFixedRate(new Runnable { + override def run(): Unit = { + if (!(future.isDone || future.isCancelled)) { + info("The Sqoop Process In Running") + } + } + }, SqoopEnvConfiguration.SQOOP_STATUS_FETCH_INTERVAL.getValue.toLong, + SqoopEnvConfiguration.SQOOP_STATUS_FETCH_INTERVAL.getValue.toLong, TimeUnit.MILLISECONDS) + } + override def getCurrentNodeResource(): NodeResource = { + val memorySuffix = "g" + val properties = EngineConnObject.getEngineCreationContext.getOptions + Option(properties.get(EngineConnPluginConf.JAVA_ENGINE_REQUEST_MEMORY.key)).foreach(memory => { + if (! memory.toLowerCase.endsWith(memorySuffix)) { + properties.put(EngineConnPluginConf.JAVA_ENGINE_REQUEST_MEMORY.key, memory + memorySuffix) + } + }) + val resource = new DriverAndYarnResource( + new LoadInstanceResource(EngineConnPluginConf.JAVA_ENGINE_REQUEST_MEMORY.getValue(properties).toLong, + EngineConnPluginConf.JAVA_ENGINE_REQUEST_CORES.getValue(properties), + EngineConnPluginConf.JAVA_ENGINE_REQUEST_INSTANCE), + new YarnResource(LINKIS_SQOOP_TASK_MAP_MEMORY.getValue * getNumTasks, LINKIS_SQOOP_TASK_MAP_CPU_CORES.getValue * getNumTasks, 0, LINKIS_QUEUE_NAME.getValue) + ) + val engineResource = new CommonNodeResource + engineResource.setUsedResource(resource) + engineResource + } + + def getNumTasks: Int = { + if (params != null) { + params.getOrDefault("sqoop.args.num.mappers", "1").toInt + } else { + 0 + } + } + protected def closeDaemon(): Unit = { + if (daemonThread != null) daemonThread.cancel(true) + } + + override def getProgress: Float = LinkisSqoopClient.progress() + + override def getProgressInfo: Array[JobProgressInfo] = { + val progressInfo = LinkisSqoopClient.getProgressInfo + info(s"Progress Info, id: ${progressInfo.id}, total: ${progressInfo.totalTasks}, running: ${progressInfo.runningTasks}," + + s" succeed: ${progressInfo.succeedTasks}, fail: ${progressInfo.failedTasks}") + Array(progressInfo) + } + + + override def getMetrics: util.Map[String, Any] = { + val metrics = LinkisSqoopClient.getMetrics.asInstanceOf[util.Map[String, Any]] + // Report the resource + metrics.put("NodeResourceJson", getCurrentNodeResource().getUsedResource.toJson) + metrics + } + + override def getDiagnosis: util.Map[String, Any] = LinkisSqoopClient.getDiagnosis.asInstanceOf[util.Map[String, Any]] +} diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopOnceExecutor.scala b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopOnceExecutor.scala new file mode 100644 index 000000000..727d1f640 --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopOnceExecutor.scala @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.executor + +import org.apache.linkis.common.utils.Utils +import org.apache.linkis.engineconn.core.hook.ShutdownHook +import org.apache.linkis.engineconn.once.executor.{ManageableOnceExecutor, OnceExecutorExecutionContext} +import org.apache.linkis.engineconnplugin.sqoop.client.LinkisSqoopClient +import org.apache.linkis.manager.common.entity.enumeration.NodeStatus +import org.apache.linkis.engineconnplugin.sqoop.client.{LinkisSqoopClient, Sqoop} + +import scala.collection.convert.WrapAsScala._ + + +trait SqoopOnceExecutor extends ManageableOnceExecutor with SqoopExecutor{ + protected def submit(onceExecutorExecutionContext: OnceExecutorExecutionContext): Unit = { + val options = onceExecutorExecutionContext.getOnceExecutorContent.getJobContent.map { + case (k, v: String) => k -> v + case (k, v) if v != null => k -> v.toString + case (k, _) => k -> null + }.toMap + doSubmit(onceExecutorExecutionContext, options) + } + def doSubmit(onceExecutorExecutionContext: OnceExecutorExecutionContext, options: Map[String, String]): Unit + + val id: Long + + override def getId: String = "SqoopOnceApp_" + id + override def close(): Unit = { + Sqoop.close() + super.close() + } + override def trySucceed(): Boolean = { + super.trySucceed() + } + + + override def ensureAvailable[A](f: => A): A = { + // Not need to throws exception + Utils.tryQuietly{ super.ensureAvailable(f) } + } + + override def tryFailed(): Boolean = { + LinkisSqoopClient.close() + super.tryFailed() + } + + override def supportCallBackLogs(): Boolean = true + + + protected def isCompleted: Boolean = isClosed || NodeStatus.isCompleted(getStatus) +} diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/factory/SqoopEngineConnFactory.scala b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/factory/SqoopEngineConnFactory.scala new file mode 100644 index 000000000..25666df2a --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/factory/SqoopEngineConnFactory.scala @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.factory + +import org.apache.linkis.common.utils.Logging +import org.apache.linkis.engineconn.common.creation.EngineCreationContext +import org.apache.linkis.engineconnplugin.sqoop.context.SqoopEngineConnContext +import org.apache.linkis.engineconnplugin.sqoop.util.ClassUtil +import org.apache.linkis.manager.engineplugin.common.creation.{ExecutorFactory, MultiExecutorEngineConnFactory} +import org.apache.linkis.manager.label.entity.engine.EngineType +import org.apache.linkis.manager.label.entity.engine.EngineType.EngineType +import org.apache.linkis.engineconnplugin.sqoop.context.SqoopEngineConnContext +import org.apache.linkis.engineconnplugin.sqoop.util.ClassUtil + +class SqoopEngineConnFactory extends MultiExecutorEngineConnFactory with Logging{ + override def getExecutorFactories: Array[ExecutorFactory] = executorFactoryArray + + override protected def getDefaultExecutorFactoryClass: Class[_ <: ExecutorFactory] = classOf[SqoopExecutorFactory] + + override protected def getEngineConnType: EngineType = EngineType.SQOOP + + override protected def createEngineConnSession(engineCreationContext: EngineCreationContext): Any = { + //val environmentContext = createEnvironmentContext(engineCreationContext) + val sqoopEngineConnContext = new SqoopEngineConnContext() + sqoopEngineConnContext + } + + + private val executorFactoryArray = Array[ExecutorFactory](ClassUtil.getInstance(classOf[SqoopExecutorFactory], new SqoopExecutorFactory)) +} diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/factory/SqoopExecutorFactory.scala b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/factory/SqoopExecutorFactory.scala new file mode 100644 index 000000000..4b39fa0f0 --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/factory/SqoopExecutorFactory.scala @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.factory + +import org.apache.linkis.engineconn.common.creation.EngineCreationContext +import org.apache.linkis.engineconn.common.engineconn.EngineConn +import org.apache.linkis.engineconn.once.executor.OnceExecutor +import org.apache.linkis.engineconn.once.executor.creation.OnceExecutorFactory +import org.apache.linkis.engineconnplugin.sqoop.context.SqoopEngineConnContext +import org.apache.linkis.engineconnplugin.sqoop.executor.SqoopOnceCodeExecutor +import org.apache.linkis.manager.label.entity.Label +import org.apache.linkis.manager.label.entity.engine.RunType.{APPCONN, RunType} +import org.apache.linkis.engineconnplugin.sqoop.context.SqoopEngineConnContext +import org.apache.linkis.engineconnplugin.sqoop.executor.SqoopOnceCodeExecutor + +class SqoopExecutorFactory extends OnceExecutorFactory{ + + + override protected def getRunType: RunType = APPCONN + + override protected def newExecutor(id: Int, engineCreationContext: EngineCreationContext, engineConn: EngineConn, labels: Array[Label[_]]): OnceExecutor = { + engineConn.getEngineConnSession match { + case context: SqoopEngineConnContext => + new SqoopOnceCodeExecutor(id, context) + + } + } +} diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/launch/SqoopEngineConnLaunchBuilder.scala b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/launch/SqoopEngineConnLaunchBuilder.scala new file mode 100644 index 000000000..a643b792c --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/launch/SqoopEngineConnLaunchBuilder.scala @@ -0,0 +1,92 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.launch + +import java.nio.file.Paths +import java.util +import java.util.concurrent.TimeUnit + +import org.apache.linkis.engineconnplugin.sqoop.context.SqoopEnvConfiguration._ +import org.apache.linkis.manager.engineplugin.common.launch.entity.EngineConnBuildRequest +import org.apache.linkis.manager.engineplugin.common.launch.process.Environment.{variable, _} +import org.apache.linkis.manager.engineplugin.common.launch.process.JavaProcessEngineConnLaunchBuilder +import org.apache.linkis.manager.engineplugin.common.launch.process.LaunchConstants._ +import org.apache.commons.io.IOUtils +import org.apache.commons.lang3.StringUtils + +import scala.collection.JavaConverters._ + +class SqoopEngineConnLaunchBuilder extends JavaProcessEngineConnLaunchBuilder{ + + override protected def getEnvironment(implicit engineConnBuildRequest: EngineConnBuildRequest): util.Map[String, String] = { + val environment = super.getEnvironment + // Basic classpath + addPathToClassPath(environment, variable(HADOOP_CONF_DIR)) + addExistPathToClassPath(environment, Seq(SQOOP_CONF_DIR.getValue)) + if (StringUtils.isNotBlank(SQOOP_HOME.getValue)) { + addPathToClassPath(environment, Seq(SQOOP_HOME.getValue, "/*")) + addPathToClassPath(environment, Seq(SQOOP_HOME.getValue, "/lib/*")) + } + // HBase classpath + if (StringUtils.isNotBlank(SQOOP_HBASE_HOME.getValue) && Paths.get(SQOOP_HBASE_HOME.getValue).toFile.exists()) { + resolveCommandToClassPath(environment, SQOOP_HBASE_HOME.getValue + "/bin/hbase classpath") + } + // HCat classpath + if (StringUtils.isNotBlank(SQOOP_HCAT_HOME.getValue) && Paths.get(SQOOP_HCAT_HOME.getValue).toFile.exists()) { + resolveCommandToClassPath(environment, SQOOP_HCAT_HOME.getValue + "/bin/hcat -classpath") + } + addExistPathToClassPath(environment, Seq(SQOOP_ZOOCFGDIR.getValue)) + environment + } + + + override protected def getNecessaryEnvironment(implicit engineConnBuildRequest: EngineConnBuildRequest): Array[String] = { + // To submit a mapReduce job, we should load the configuration from hadoop config dir + Array(HADOOP_CONF_DIR.toString, SQOOP_HOME.key) + } + + private def addExistPathToClassPath(env: util.Map[String, String], path: String): Unit = { + if (StringUtils.isNotBlank(path) && Paths.get(path).toFile.exists()) { + addPathToClassPath(env, path) + } + } + private def resolveCommandToClassPath(env: util.Map[String, String], command: String): Unit = { + trace(s"Invoke command [${command}] to get class path sequence") + val builder = new ProcessBuilder(Array("/bin/bash", "-c", command): _*) + // Set the environment + builder.environment.putAll(sys.env.asJava) + builder.redirectErrorStream(false) + val process = builder.start() + if(process.waitFor(5, TimeUnit.SECONDS) && + process.waitFor() == 0) { + val jarPathSerial = IOUtils.toString(process.getInputStream).trim() + // TODO we should decide separator in different environment + val separatorChar = ":" + val jarPathList = StringUtils.split(jarPathSerial, separatorChar).filterNot(jarPath => { + val splitIndex = jarPath.lastIndexOf("/") + val jarName = if (splitIndex >= 0) jarPath.substring(splitIndex + 1) else jarPath + jarName.matches("^jasper-compiler-[\\s\\S]+?\\.jar$") || jarName.matches("^jsp-[\\s\\S]+?\\.jar$") || jarName.matches("^disruptor-[\\s\\S]+?\\.jar") + }).toList + addPathToClassPath(env, StringUtils.join(jarPathList.asJava, separatorChar)) + } + // Release the process + process.destroy(); + } + private implicit def buildPath(paths: Seq[String]): String = Paths.get(paths.head, paths.tail: _*).toFile.getPath + +} diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/params/SqoopParamsResolver.scala b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/params/SqoopParamsResolver.scala new file mode 100644 index 000000000..464fc3922 --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/params/SqoopParamsResolver.scala @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.params + +import java.util + +import org.apache.linkis.engineconn.common.creation.EngineCreationContext +/** + * Resolve the engine job params + */ +trait SqoopParamsResolver { + + /** + * main method + * @param params input + * @return + */ + def resolve(params: util.Map[String, String], context: EngineCreationContext): util.Map[String, String] +} diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/resource/SqoopEngineConnResourceFactory.scala b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/resource/SqoopEngineConnResourceFactory.scala new file mode 100644 index 000000000..1634e8b7e --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/resource/SqoopEngineConnResourceFactory.scala @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.resource + +import org.apache.linkis.manager.common.entity.resource.{LoadInstanceResource, Resource} +import org.apache.linkis.manager.engineplugin.common.resource.AbstractEngineResourceFactory + +import java.util + +class SqoopEngineConnResourceFactory extends AbstractEngineResourceFactory{ + override protected def getRequestResource(properties: util.Map[String, String]): Resource = { + new LoadInstanceResource(1, + 1, + 1) + } +} diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/util/ClassUtil.scala b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/util/ClassUtil.scala new file mode 100644 index 000000000..c3476821f --- /dev/null +++ b/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/util/ClassUtil.scala @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.linkis.engineconnplugin.sqoop.util + +import org.apache.linkis.common.utils.{ClassUtils, Utils} +import org.apache.linkis.engineconnplugin.sqoop.client.exception.JobExecutionException + +import scala.collection.convert.wrapAsScala._ + +object ClassUtil { + + def getInstance[T](clazz: Class[T] , defaultValue: T): T = { + val classes = ClassUtils.reflections.getSubTypesOf(clazz).filterNot(ClassUtils.isInterfaceOrAbstract).toArray + if(classes.length <= 1) defaultValue + else if(classes.length == 2) { + val realClass = if(classes(0) == defaultValue.getClass) classes(1) else classes(0); + Utils.tryThrow(realClass.newInstance) { t => + new JobExecutionException(s"New a instance of ${clazz.getSimpleName} failed!", t); + } + } else { + throw new JobExecutionException(s"Too many subClasses of ${clazz.getSimpleName}, list: $classes."); + } + } + +} diff --git a/exchangis-plugins/exchangis-appconn/pom.xml b/exchangis-plugins/exchangis-appconn/pom.xml new file mode 100644 index 000000000..7658a56c7 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/pom.xml @@ -0,0 +1,125 @@ + + + + exchangis-plugins + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + ../pom.xml + + 4.0.0 + + exchangis-appconn + + + 8 + 8 + + + + + org.apache.linkis + linkis-module + ${linkis.version} + provided + + + httpclient + org.apache.httpcomponents + + + true + + + com.webank.wedatasphere.dss + dss-project-plugin + ${dss.version} + + + com.webank.wedatasphere.dss + dss-appconn-core + ${dss.version} + + + org.apache.linkis + linkis-storage + ${linkis.version} + provided + + + linkis-common + org.apache.linkis + + + + + com.webank.wedatasphere.dss + dss-development-process-standard + ${dss.version} + + + com.webank.wedatasphere.dss + dss-structure-integration-standard + ${dss.version} + + + com.webank.wedatasphere.dss + dss-development-process-standard-execution + ${dss.version} + + + com.webank.wedatasphere.dss + dss-common + ${dss.version} + provided + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + net.alchim31.maven + scala-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-assembly-plugin + 2.3 + false + + + make-assembly + package + + single + + + + src/main/assembly/distribution.xml + + + + + + false + exchangis-appconn + false + false + + src/main/assembly/distribution.xml + + + + + + \ No newline at end of file diff --git a/exchangis-plugins/exchangis-appconn/src/main/assembly/distribution.xml b/exchangis-plugins/exchangis-appconn/src/main/assembly/distribution.xml new file mode 100644 index 000000000..94687fcb5 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/assembly/distribution.xml @@ -0,0 +1,78 @@ + + + + exchangis-appconn + + zip + + true + exchangis + + + + + lib + true + true + false + true + true + + + + + + ${basedir}/src/main/resources + + appconn.properties + + 0777 + / + unix + + + + ${basedir}/src/main/resources + + log4j.properties + log4j2.xml + + 0777 + conf + unix + + + ${basedir}/src/main/resources + + init.sql + init_real.sql + appconn-install.sh + + 0777 + db + unix + + + + + + diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ExchangisAppConn.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ExchangisAppConn.java new file mode 100644 index 000000000..4fdde8cd4 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ExchangisAppConn.java @@ -0,0 +1,38 @@ +package com.webank.wedatasphere.exchangis.dss.appconn; + +import com.webank.wedatasphere.dss.appconn.core.ext.ThirdlyAppConn; +import com.webank.wedatasphere.dss.appconn.core.impl.AbstractOnlySSOAppConn; +import com.webank.wedatasphere.dss.standard.app.development.standard.DevelopmentIntegrationStandard; +import com.webank.wedatasphere.dss.standard.app.structure.StructureIntegrationStandard; +import org.apache.linkis.common.conf.CommonVars; + +/** + * Exchangis AppConn top implement + */ +public class ExchangisAppConn extends AbstractOnlySSOAppConn implements ThirdlyAppConn { + + /** + * Project service operation + */ + private ExchangisStructureIntegrationStandard exchangisStructureIntegrationStandard; + + /** + * Operation for flow node + */ + private ExchangisDevelopmentIntegrationStandard exchangisDevelopmentIntegrationStandard; + @Override + public DevelopmentIntegrationStandard getOrCreateDevelopmentStandard() { + return exchangisDevelopmentIntegrationStandard; + } + + @Override + public StructureIntegrationStandard getOrCreateStructureStandard() { + return exchangisStructureIntegrationStandard; + } + + @Override + protected void initialize() { + exchangisStructureIntegrationStandard = ExchangisStructureIntegrationStandard.getInstance(); + exchangisDevelopmentIntegrationStandard = ExchangisDevelopmentIntegrationStandard.getInstance(); + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ExchangisDevelopmentIntegrationStandard.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ExchangisDevelopmentIntegrationStandard.java new file mode 100644 index 000000000..b1dd91dcf --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ExchangisDevelopmentIntegrationStandard.java @@ -0,0 +1,54 @@ +package com.webank.wedatasphere.exchangis.dss.appconn; + +import com.webank.wedatasphere.dss.standard.app.development.service.*; +import com.webank.wedatasphere.dss.standard.app.development.standard.AbstractDevelopmentIntegrationStandard; +import com.webank.wedatasphere.exchangis.dss.appconn.service.*; + +/** + * Develop integration + */ +public class ExchangisDevelopmentIntegrationStandard extends AbstractDevelopmentIntegrationStandard { + + private static ExchangisDevelopmentIntegrationStandard instance; + + static { + instance = new ExchangisDevelopmentIntegrationStandard(); + } + + /** + * Get singleton instance + * @return development integration + */ + public static ExchangisDevelopmentIntegrationStandard getInstance(){ + return instance; + } + + private ExchangisDevelopmentIntegrationStandard(){ + + } + + @Override + protected RefCRUDService createRefCRUDService() { + return new ExchangisRefCRUDService(); + } + + @Override + protected RefExecutionService createRefExecutionService() { + return new ExchangisRefExecutionService(); + } + + @Override + protected RefExportService createRefExportService() { + return new ExchangisRefExportService(); + } + + @Override + protected RefImportService createRefImportService() { + return new ExchangisRefImportService(); + } + + @Override + protected RefQueryService createRefQueryService() { + return new ExchangisRefQueryService(); + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ExchangisStructureIntegrationStandard.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ExchangisStructureIntegrationStandard.java new file mode 100644 index 000000000..1a68b928e --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ExchangisStructureIntegrationStandard.java @@ -0,0 +1,29 @@ +package com.webank.wedatasphere.exchangis.dss.appconn; + +import com.webank.wedatasphere.dss.standard.app.structure.AbstractStructureIntegrationStandard; +import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectService; +import com.webank.wedatasphere.exchangis.dss.appconn.service.ExchangisProjectService; + +/** + * Structure(Project) service implement + */ +public class ExchangisStructureIntegrationStandard extends AbstractStructureIntegrationStandard { + + private static ExchangisStructureIntegrationStandard instance; + + static{ + instance = new ExchangisStructureIntegrationStandard(); + } + + /** + * Get the singleton instance + * @return structure integration + */ + public static ExchangisStructureIntegrationStandard getInstance(){ + return instance; + } + @Override + protected ProjectService createProjectService() { + return new ExchangisProjectService(); + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/constraints/Constraints.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/constraints/Constraints.java new file mode 100644 index 000000000..95c0c64ac --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/constraints/Constraints.java @@ -0,0 +1,40 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.constraints; + + +import org.apache.linkis.common.conf.CommonVars; + +/** + * Constraints + */ +public class Constraints { + + // AppConn name + public final static String EXCHANGIS_APPCONN_NAME = CommonVars.apply("wds.dss.appconn.exchangis.name", "Exchangis").getValue(); + + public final static String API_REQUEST_PREFIX = CommonVars.apply("wds.dss.appconn.exchangis.api.request-prefix", "api/rest_j/v1/dss/exchangis/main").getValue(); + + public final static String DOMAIN_NAME = CommonVars.apply("wds.dss.appconn.exchangis.domain.name", "DSS").getValue(); + + // Constraint in Project operation + public final static String PROJECT_ID = "projectId"; + + // Node type + public final static String NODE_TYPE_SQOOP = CommonVars.apply("wds.dss.appconn.exchangis.node-type.sqoop", "linkis.appconn.exchangis.sqoop").getValue(); + public final static String NODE_TYPE_DATAX = CommonVars.apply("wds.dss.appconn.exchangis.node-type.datax", "linkis.appconn.exchangis.datax").getValue(); + + // Engine type + public final static String ENGINE_TYPE_DATAX_NAME = CommonVars.apply("wds.dss.appconn.exchangis.engine.datax.name", "DATAX").getValue(); + public final static String ENGINE_TYPE_SQOOP_NAME = CommonVars.apply("wds.dss.appconn.exchangis.engine.sqoop.name", "SQOOP").getValue(); + + // Job type + public final static String JOB_TYPE_OFFLINE = CommonVars.apply("wds.dss.appconn.exchangis.job-type.offline", "OFFLINE").getValue(); + + // Constraint in Ref operation + public final static String REF_JOB_DESC = "desc"; + public final static String REF_JOB_ID = "id"; + public final static String REF_JOB_LABELS = "labels"; + public final static String REF_JUMP_URL_FORMAT = CommonVars.apply("wds.dss.appconn.exchangis.ref.jump","#/childJobManagement").getValue(); + + +} + diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/enums/ExchangisStatusEnum.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/enums/ExchangisStatusEnum.java new file mode 100644 index 000000000..16d92bfab --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/enums/ExchangisStatusEnum.java @@ -0,0 +1,44 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.enums; + +import java.util.Arrays; + +/** + * @author tikazhang + * @Date 2022/5/4 12:22 + */ +public enum ExchangisStatusEnum { + Scheduled(0, "Scheduled"), + Running(1, "Running"), + Success(2, "Success"), + Failed(3,"Failed"), + Cancelled(4, "Cancelled"), + Inited(5, "Inited"), + Timeout(6, "Timeout"); + + private int code; + private String status; + private ExchangisStatusEnum(int code, String status) { + this.code = code; + this.status = status; + } + + public static ExchangisStatusEnum getEnum(String status) { + return Arrays.stream(ExchangisStatusEnum.values()).filter(e -> e.getStatus().equals(status)).findFirst().orElseThrow(NullPointerException::new); + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/AbstractExchangisOperation.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/AbstractExchangisOperation.java new file mode 100644 index 000000000..0e69fc138 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/AbstractExchangisOperation.java @@ -0,0 +1,192 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation; + +import com.webank.wedatasphere.dss.standard.app.sso.Workspace; +import com.webank.wedatasphere.dss.standard.app.sso.builder.SSOUrlBuilderOperation; +import com.webank.wedatasphere.dss.standard.app.sso.request.SSORequestOperation; +import com.webank.wedatasphere.dss.standard.app.sso.request.SSORequestService; +import com.webank.wedatasphere.dss.standard.common.app.AppIntegrationService; +import com.webank.wedatasphere.dss.standard.common.entity.ref.RequestRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.ref.ExchangisRefExecutionOperation; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.HttpExtAction; +import com.webank.wedatasphere.exchangis.dss.appconn.response.result.ExchangisEntityRespResult; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.httpclient.request.HttpAction; +import org.apache.linkis.httpclient.request.UserAction; +import org.apache.linkis.httpclient.response.HttpResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.function.Supplier; + +import static com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints.API_REQUEST_PREFIX; + +/** + * Abstract implement, contains the method to create sso request + */ +public abstract class AbstractExchangisOperation { + + private final static Logger LOG = LoggerFactory.getLogger(AbstractExchangisOperation.class); + + private SSORequestService ssoRequestService; + + private String uri; + + /** + * Refer to the url in table 'dss_appconn_instance' + */ + private String baseURL; + + private String redirectUrl; + + public AbstractExchangisOperation(){ + + } + + protected abstract Logger getLogger(); + + public AbstractExchangisOperation(String[] uriParts){ + if (Objects.nonNull(uriParts)){ + uri = StringUtils.join(uriParts, IOUtils.DIR_SEPARATOR_UNIX); + } + } + public AbstractExchangisOperation(AppIntegrationService appIntegrationService){ + setSSORequestService(appIntegrationService); + } + + /** + * Set sso request service + * @param appIntegrationService integrated sso request service + */ + protected void setSSORequestService(AppIntegrationService appIntegrationService){ + if (Objects.nonNull(appIntegrationService)){ + this.ssoRequestService = appIntegrationService.getSSORequestService(); + // Also upgrade the base url + this.baseURL = appIntegrationService.getAppInstance().getBaseUrl(); + // Append the api prefix + this.baseURL = this.baseURL.endsWith(IOUtils.DIR_SEPARATOR_UNIX + "")? + baseURL + API_REQUEST_PREFIX: baseURL + IOUtils.DIR_SEPARATOR_UNIX + API_REQUEST_PREFIX; + this.redirectUrl = String.valueOf(appIntegrationService.getAppInstance().getConfig().get("redirectUrl")); + } + } + + @SuppressWarnings("unchecked") + protected SSORequestOperation getOrCreateSSORequestOperation(String name) throws ExternalOperationFailedException { + if (Objects.nonNull(this.ssoRequestService)){ + return ssoRequestService.createSSORequestOperation(name); + } + throw new ExternalOperationFailedException(-1, "The ssoRequestService is empty in operation: [" + + this.getClass().getSimpleName() + "]"); + } + + protected SSORequestOperation getOrCreateSSORequestOperation() throws ExternalOperationFailedException{ + return getOrCreateSSORequestOperation(getAppName()); + } + + /** + * Get sso url builder operation + * @param workspace work space + * @param appName app name + * @param url url + * @return + */ + protected SSOUrlBuilderOperation getSSOUrlBuilderOperation(Workspace workspace, + String appName, String url){ + //LOG.info("requestURL555555: {}", requestURL()); + return workspace.getSSOUrlBuilderOperation().copy().setAppName(appName).setReqUrl(url) + .setWorkspace(workspace.getWorkspaceName()); + } + + protected SSOUrlBuilderOperation getSSOUrlBuilderOperation(Workspace workspace){ + return getSSOUrlBuilderOperation(workspace, getAppName(), requestURL()); + } + + /** + * AppConn name + * @return name value + */ + protected String getAppName() { + return Constraints.EXCHANGIS_APPCONN_NAME; + } + + /** + * Get request url of operation + * @return url value + */ + public String requestURL(){ + return requestURL(uri); + } + + public String requestURL(String customUri){ + return baseURL.endsWith(IOUtils.DIR_SEPARATOR_UNIX + "") ? + baseURL + customUri : baseURL + IOUtils.DIR_SEPARATOR_UNIX + customUri; + } + + public String pageUrl(String customUri){ + return redirectUrl.endsWith(IOUtils.DIR_SEPARATOR_UNIX + "") ? + redirectUrl + customUri : redirectUrl + IOUtils.DIR_SEPARATOR_UNIX + customUri; + } + + /** + * Send request and get response entity + * @param url url + * @param workspace workspace + * @param requestRef request ref + * @param httpActionBuilder action builder + * @param entityClass response entity class + * @param entityParameters parametric types of response entity class + * @param response entity + * @param request ref + * @return + * @throws ExternalOperationFailedException + */ + protected ExchangisEntityRespResult.BasicMessageEntity requestToGetEntity(String url, + Workspace workspace, + T requestRef, HttpActionBuilder httpActionBuilder, Class entityClass, Class... entityParameters) throws ExternalOperationFailedException { + LOG.info("Create job url{}: ", url); + HttpExtAction action = httpActionBuilder.build(requestRef); + LOG.info("Action{}: ", action.getRequestBody()); + if (Objects.nonNull(action)){ + SSOUrlBuilderOperation ssoUrlBuilderOperation = getSSOUrlBuilderOperation(workspace, getAppName(), url); + ExchangisEntityRespResult.BasicMessageEntity entity; + try { + LOG.info("ssoUrlBuilderOperation: {}", ssoUrlBuilderOperation.getBuiltUrl()); + action.setUrl(ssoUrlBuilderOperation.getBuiltUrl()); + SSORequestOperation ssoRequestOperation = getOrCreateSSORequestOperation(); + ExchangisEntityRespResult httpResult = new ExchangisEntityRespResult(ssoRequestOperation.requestWithSSO(ssoUrlBuilderOperation, action)); + entity = httpResult.getEntity(entityClass, entityParameters); + return entity; + } catch (Exception e){ + if (e instanceof ExternalOperationFailedException){ + getLogger().error("Response process exception: url: [" + url + "], message: [" + e.getMessage(), e); + throw (ExternalOperationFailedException)e; + } + getLogger().error("Request to url: [" + url + "] exception", e); + throw new ExternalOperationFailedException(-1, e.getMessage()); + } + } + + return null; + } + + protected ExchangisEntityRespResult.BasicMessageEntity requestToGetEntity(Workspace workspace, + T requestRef, HttpActionBuilder httpActionBuilder, Class entityClass, Class... entityParameters) throws ExternalOperationFailedException { + return requestToGetEntity(requestURL(), workspace, requestRef, httpActionBuilder, entityClass, entityParameters); + } + @FunctionalInterface + public interface HttpActionBuilder{ + + /** + * Build main entrance + * @return http action + */ + HttpExtAction build(T input) throws ExternalOperationFailedException; + } + +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/OperationStrategy.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/OperationStrategy.java new file mode 100644 index 000000000..391eb7f45 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/OperationStrategy.java @@ -0,0 +1,36 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation; + + +import com.webank.wedatasphere.dss.standard.app.development.listener.common.AsyncExecutionRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.listener.common.RefExecutionState; +import com.webank.wedatasphere.dss.standard.app.development.ref.NodeRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.service.DevelopmentService; +import com.webank.wedatasphere.dss.standard.app.sso.request.SSORequestOperation; +import com.webank.wedatasphere.dss.standard.common.entity.ref.ResponseRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import org.apache.linkis.httpclient.request.HttpAction; +import org.apache.linkis.httpclient.response.HttpResult; + + +public interface OperationStrategy { + + ResponseRef createRef(NodeRequestRef requestRef, + String baseUrl, + DevelopmentService developmentService, + SSORequestOperation ssoRequestOperation) throws ExternalOperationFailedException; + + void deleteRef(String baseUrl, + NodeRequestRef visualisDeleteRequestRef, + SSORequestOperation ssoRequestOperation) throws ExternalOperationFailedException; + + ResponseRef executeRef(AsyncExecutionRequestRef ref, String baseUrl, SSORequestOperation ssoRequestOperation) throws ExternalOperationFailedException; + + String getId(AsyncExecutionRequestRef requestRef); + + String submit(AsyncExecutionRequestRef ref, String baseUrl, SSORequestOperation ssoRequestOperation, DevelopmentService developmentService) throws ExternalOperationFailedException; + + RefExecutionState state(AsyncExecutionRequestRef ref, String baseUrl, SSORequestOperation ssoRequestOperation, String execId) throws ExternalOperationFailedException; + + ResponseRef getAsyncResult(AsyncExecutionRequestRef ref, String baseUrl, SSORequestOperation ssoRequestOperation, String execId) throws ExternalOperationFailedException; + +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/impl/ExchangisAsyncRefExecutionOperation.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/impl/ExchangisAsyncRefExecutionOperation.java new file mode 100644 index 000000000..a00893040 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/impl/ExchangisAsyncRefExecutionOperation.java @@ -0,0 +1,88 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.impl; + +import com.webank.wedatasphere.dss.standard.app.development.listener.common.AsyncExecutionRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.listener.common.CompletedExecutionResponseRef; +import com.webank.wedatasphere.dss.standard.app.development.listener.common.RefExecutionAction; +import com.webank.wedatasphere.dss.standard.app.development.listener.common.RefExecutionState; +import com.webank.wedatasphere.dss.standard.app.development.listener.core.Procedure; +import com.webank.wedatasphere.dss.standard.app.development.ref.ExecutionRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.service.DevelopmentService; +import com.webank.wedatasphere.dss.standard.app.sso.request.SSORequestOperation; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.ref.ModuleFactory; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisCompletedExecutionResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisExecutionAction; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author tikazhang + * @Date 2022/4/28 11:38 + */ +public class ExchangisAsyncRefExecutionOperation implements Procedure{ + + private static final Logger logger = LoggerFactory.getLogger(ExchangisAsyncRefExecutionOperation.class); + + public ExchangisExecutionAction execute(ExecutionRequestRef requestRef, String baseUrl, SSORequestOperation ssoRequestOperation, DevelopmentService developmentService) throws ExternalOperationFailedException { + AsyncExecutionRequestRef asyncExecutionRequestRef = (AsyncExecutionRequestRef) requestRef; + ExchangisOptStrategy exchangisOpt = (ExchangisOptStrategy) ModuleFactory.getInstance().crateModule(Constraints.ENGINE_TYPE_SQOOP_NAME); + String execId = exchangisOpt.submit(asyncExecutionRequestRef, baseUrl, ssoRequestOperation, developmentService); + ExchangisExecutionAction exchangisExecutionAction = new ExchangisExecutionAction(); + exchangisExecutionAction.set_execId(execId); + exchangisExecutionAction.setRequestRef(requestRef); + return exchangisExecutionAction; + } + + public RefExecutionState state (RefExecutionAction action, String baseUrl, SSORequestOperation ssoRequestOperation) throws ExternalOperationFailedException { + ExchangisExecutionAction sqoopAction = (ExchangisExecutionAction) action; + ExecutionRequestRef requestRef = sqoopAction.getRequestRef(); + AsyncExecutionRequestRef asyncExecutionRequestRef = (AsyncExecutionRequestRef) requestRef; + String execId = sqoopAction.get_execId(); + ExchangisOptStrategy exchangisOpt = (ExchangisOptStrategy) ModuleFactory.getInstance().crateModule(Constraints.ENGINE_TYPE_SQOOP_NAME); + RefExecutionState refExecutionState = exchangisOpt.state(asyncExecutionRequestRef, baseUrl, ssoRequestOperation, execId); + return refExecutionState; + } + + public CompletedExecutionResponseRef result (RefExecutionAction action, String baseUrl, SSORequestOperation ssoRequestOperation) throws ExternalOperationFailedException { + ExchangisExecutionAction sqoopAction = (ExchangisExecutionAction) action; + ExecutionRequestRef requestRef = sqoopAction.getRequestRef(); + String execId = sqoopAction.get_execId(); + AsyncExecutionRequestRef asyncExecutionRequestRef = (AsyncExecutionRequestRef) requestRef; + ExchangisOptStrategy exchangisOpt = (ExchangisOptStrategy) ModuleFactory.getInstance().crateModule(Constraints.ENGINE_TYPE_SQOOP_NAME); + exchangisOpt.getAsyncResult(asyncExecutionRequestRef, baseUrl, ssoRequestOperation, execId); + ExchangisCompletedExecutionResponseRef responseRef = new ExchangisCompletedExecutionResponseRef(200); + responseRef.setIsSucceed(true); + return responseRef; + } + + public boolean kill(String baseUrl, SSORequestOperation ssoRequestOperation, RefExecutionAction refExecutionAction) { + ExchangisExecutionAction sqoopAction = null; + if (refExecutionAction instanceof ExchangisExecutionAction) { + sqoopAction = (ExchangisExecutionAction) refExecutionAction; + } + ExecutionRequestRef requestRef = sqoopAction.getRequestRef(); + AsyncExecutionRequestRef asyncExecutionRequestRef = (AsyncExecutionRequestRef) requestRef; + try { + ExchangisOptStrategy exchangisOpt = (ExchangisOptStrategy) ModuleFactory.getInstance().crateModule(Constraints.ENGINE_TYPE_SQOOP_NAME); + if (exchangisOpt.kill(asyncExecutionRequestRef, baseUrl, ssoRequestOperation, sqoopAction.get_execId())) { + return true; + } else { + return false; + } + } catch (ExternalOperationFailedException e) { + logger.info("kill executed job failed, execId is: {}", sqoopAction.get_execId()); + } + return false; + } + + @Override + public float progress(RefExecutionAction refExecutionAction) { + return 0; + } + + @Override + public String log(RefExecutionAction refExecutionAction) { + return null; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/impl/ExchangisOptStrategy.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/impl/ExchangisOptStrategy.java new file mode 100644 index 000000000..8660f0370 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/impl/ExchangisOptStrategy.java @@ -0,0 +1,318 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.impl; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.google.gson.reflect.TypeToken; +import com.webank.wedatasphere.dss.common.entity.node.DSSNode; +import com.webank.wedatasphere.dss.common.entity.node.DSSNodeDefault; +import com.webank.wedatasphere.dss.common.utils.DSSCommonUtils; +import com.webank.wedatasphere.dss.standard.app.development.listener.common.AsyncExecutionRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.listener.common.RefExecutionState; +import com.webank.wedatasphere.dss.standard.app.development.ref.NodeRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.service.DevelopmentService; +import com.webank.wedatasphere.dss.standard.app.sso.request.SSORequestOperation; +import com.webank.wedatasphere.dss.standard.app.structure.StructureService; +import com.webank.wedatasphere.dss.standard.common.entity.ref.ResponseRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; +import com.webank.wedatasphere.exchangis.dss.appconn.enums.ExchangisStatusEnum; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.OperationStrategy; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.ref.AbstractExchangisRefOperation; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisCommonResponseDef; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisCompletedExecutionResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisOpenResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisEntityPostAction; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisGetAction; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisPostAction; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.HttpExtAction; +import com.webank.wedatasphere.exchangis.dss.appconn.response.result.ExchangisEntityRespResult; +import com.webank.wedatasphere.exchangis.dss.appconn.utils.AppConnUtils; +import com.webank.wedatasphere.exchangis.dss.appconn.utils.NumberUtils; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.common.io.resultset.ResultSetWriter; +import org.apache.linkis.httpclient.request.HttpAction; +import org.apache.linkis.httpclient.response.HttpResult; +import org.apache.linkis.server.BDPJettyServerHelper; +import org.apache.linkis.server.conf.ServerConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.util.*; + +public class ExchangisOptStrategy extends AbstractExchangisRefOperation implements OperationStrategy { + private final static Logger logger = LoggerFactory.getLogger(ExchangisOptStrategy.class); + + + private String getNodeNameByKey(String key, String json) { + JsonParser parser = new JsonParser(); + JsonObject jsonObject = parser.parse(json).getAsJsonObject(); + JsonArray nodeJsonArray = jsonObject.getAsJsonArray("nodes"); + List dwsNodes = DSSCommonUtils.COMMON_GSON.fromJson(nodeJsonArray, new TypeToken>() { + }.getType()); + return dwsNodes.stream().filter(n -> key.equals(n.getId())).map(DSSNode::getName).findFirst().orElse(""); + } + + @Override + public ResponseRef createRef(NodeRequestRef requestRef, String baseUrl, DevelopmentService developmentService, SSORequestOperation ssoRequestOperation) throws ExternalOperationFailedException { + return null; + } + + @Override + public void deleteRef(String baseUrl, NodeRequestRef visualisDeleteRequestRef, SSORequestOperation ssoRequestOperation) throws ExternalOperationFailedException { + + } + + @Override + public ResponseRef executeRef(AsyncExecutionRequestRef nodeRequestRef, String baseUrl, SSORequestOperation ssoRequestOperation) throws ExternalOperationFailedException { + + //AsyncExecutionRequestRef nodeRequestRef = (AsyncExecutionRequestRef) executionRequestRef; + + String executionRequestRefJson = null; + String parameter = null; + String workspace = null; + try { + parameter = BDPJettyServerHelper.jacksonJson().writeValueAsString(nodeRequestRef.getParameters()); + workspace = BDPJettyServerHelper.jacksonJson().writeValueAsString(nodeRequestRef.getWorkspace()); + logger.info("parameter => parameter: {}", parameter); + logger.info("workspace => workspace: {}", workspace); + executionRequestRefJson = BDPJettyServerHelper.jacksonJson().writeValueAsString(nodeRequestRef); + } catch (JsonProcessingException e) { + logger.error("Parser request happen error"); + } + + logger.info("executionRequestRef => executionRequestRef: {}", nodeRequestRef); + logger.info("executionRequestRefJson => executionRequestRefJson: {}", executionRequestRefJson); + try { + nodeRequestRef.getExecutionRequestRefContext().getRuntimeMap().get("wds.dss.workflow.submit.user").toString(); + logger.info("getExecutionRequestRefContext User: {}", nodeRequestRef.getExecutionRequestRefContext().getRuntimeMap().get("wds.dss.workflow.submit.user").toString()); + } catch (Exception e) { + logger.error("parser request error", e); + } + Long id = AppConnUtils.resolveParam(nodeRequestRef.getJobContent(), Constraints.REF_JOB_ID, Double.class).longValue(); + logger.info("execute job request => id: {}, name: {}, user: {}, jobContent: {}", + id, nodeRequestRef.getName(), nodeRequestRef.getExecutionRequestRefContext().getRuntimeMap().get("wds.dss.workflow.submit.user").toString(), + nodeRequestRef.getJobContent().toString()); + String originLabels = nodeRequestRef.getExecutionRequestRefContext().getRuntimeMap().get("labels").toString(); + String realLabels = ""; + try { + Map responseMap = BDPJettyServerHelper.jacksonJson().readValue(originLabels, Map.class); + realLabels = responseMap.get("route").toString(); + } catch (JsonProcessingException e) { + logger.error("parser request error", e); + } + String url = requestURL("appJob/execute/" + id); + String finalRealLabels = realLabels; + ExchangisEntityRespResult.BasicMessageEntity> entity = requestToGetEntity(url, nodeRequestRef.getWorkspace(), nodeRequestRef, + (requestRef) -> { + // Build ref execution action + + ExchangisEntityPostAction exchangisEntityPostAction = new ExchangisEntityPostAction(); + exchangisEntityPostAction.setUser(nodeRequestRef.getExecutionRequestRefContext().getRuntimeMap().get("wds.dss.workflow.submit.user").toString()); + HashMap labels = new HashMap<>(); + labels.put("route", finalRealLabels); + exchangisEntityPostAction.addRequestPayload("labels", labels); + return exchangisEntityPostAction; + + /*return new ExchangisEntityPostAction<>(null, + nodeRequestRef.getExecutionRequestRefContext().getRuntimeMap().get("wds.dss.workflow.submit.user").toString());*/ + }, Map.class); + if (Objects.isNull(entity)){ + throw new ExternalOperationFailedException(31020, "The response entity cannot be empty", null); + } + ExchangisEntityRespResult httpResult = entity.getResult(); + logger.info("execute job response => status: {}, response: {}", httpResult.getStatusCode(), httpResult.getResponseBody()); + return new ExchangisCommonResponseDef(httpResult); + } + + @Override + public String getId(AsyncExecutionRequestRef requestRef) { + try { + String executionContent = BDPJettyServerHelper.jacksonJson().writeValueAsString(requestRef.getJobContent()); + ExchangisOpenResponseRef exchangisOpenResponseRef = new ExchangisOpenResponseRef(executionContent, 0); + return NumberUtils.parseDoubleString(exchangisOpenResponseRef.getSqoopId()); + } catch (Exception e) { + logger.error("failed to parse jobContent when execute widget node", e); + } + return null; + } + + @Override + public String submit(AsyncExecutionRequestRef ref, String baseUrl, SSORequestOperation ssoRequestOperation, DevelopmentService developmentService) throws ExternalOperationFailedException { + String url = baseUrl + "api/rest_j/" + ServerConfiguration.BDP_SERVER_VERSION() + "/dss/exchangis/main/appJob" + "/execute/" + getId(ref); + ref.getExecutionRequestRefContext().appendLog("dss execute sqoop node,ready to submit from " + url); + ExchangisEntityPostAction exchangisEntityPostAction = new ExchangisEntityPostAction(); + exchangisEntityPostAction.setUser(ref.getExecutionRequestRefContext().getRuntimeMap().get("wds.dss.workflow.submit.user").toString()); + String originLabels = ref.getExecutionRequestRefContext().getRuntimeMap().get("labels").toString(); + String realLabels = null; + if (originLabels.contains("route")) { + Map changeData = BDPJettyServerHelper.gson().fromJson(originLabels, Map.class); + realLabels = changeData.get("route"); + } else { + realLabels = originLabels; + } + setSSORequestService(developmentService); + String submitUser = ref.getExecutionRequestRefContext().getRuntimeMap().get("wds.dss.workflow.submit.user").toString(); + HashMap labels = new HashMap<>(); + labels.put("route", realLabels); + exchangisEntityPostAction.addRequestPayload("labels", labels); + exchangisEntityPostAction.addRequestPayload("submitUser",submitUser); + + ExchangisEntityRespResult.BasicMessageEntity> entity = requestToGetEntity(url, ref.getWorkspace(), ref, + (requestRef) -> { + // Build ref execution action + return exchangisEntityPostAction; + /*return new ExchangisEntityPostAction<>(null, + nodeRequestRef.getExecutionRequestRefContext().getRuntimeMap().get("wds.dss.workflow.submit.user").toString());*/ + }, Map.class); + if (Objects.isNull(entity)){ + throw new ExternalOperationFailedException(31020, "The response entity cannot be empty", null); + } + ExchangisEntityRespResult httpResult = entity.getResult(); + logger.info("execute job response => status: {}, response: {}", httpResult.getStatusCode(), httpResult.getResponseBody()); + Map responseMap = BDPJettyServerHelper.gson().fromJson(httpResult.getResponseBody(), Map.class); + Map dataMap = (Map) responseMap.get("data"); + return Optional.of(dataMap.get("jobExecutionId").toString()).orElseThrow(() -> new ExternalOperationFailedException(90176, "Get execute Id failed")); + } + + @Override + public RefExecutionState state(AsyncExecutionRequestRef ref, String baseUrl, SSORequestOperation ssoRequestOperation, String execId) throws ExternalOperationFailedException { + String originLabels = ref.getExecutionRequestRefContext().getRuntimeMap().get("labels").toString(); + String realLabels = null; + if (originLabels.contains("route")) { + Map changeData = BDPJettyServerHelper.gson().fromJson(originLabels, Map.class); + realLabels = changeData.get("route"); + } else { + realLabels = originLabels; + } + if (StringUtils.isEmpty(execId)) { + ref.getExecutionRequestRefContext().appendLog("dss execute sqoop error for execId is null when get state!"); + throw new ExternalOperationFailedException(90176, "dss execute sqoop error when get state"); + } + String url = baseUrl + "api/rest_j/" + ServerConfiguration.BDP_SERVER_VERSION() + "/dss/exchangis/main/job" + "/execution/" + execId +"/status?labels=" + realLabels; + ref.getExecutionRequestRefContext().appendLog("dss execute sqoop node,ready to submit from " + url); + + ExchangisGetAction exchangisGetAction = new ExchangisGetAction(); + exchangisGetAction.setUrl(ref.getExecutionRequestRefContext().getRuntimeMap().get("wds.dss.workflow.submit.user").toString()); + + try { + ExchangisEntityRespResult.BasicMessageEntity> entity = requestToGetEntity(url, ref.getWorkspace(), ref, + (requestRef) -> { + // Build ref execution action + return exchangisGetAction; + /*return new ExchangisEntityPostAction<>(null, + nodeRequestRef.getExecutionRequestRefContext().getRuntimeMap().get("wds.dss.workflow.submit.user").toString());*/ + }, Map.class); + + if (Objects.isNull(entity)){ + throw new ExternalOperationFailedException(31020, "The response entity cannot be empty", null); + } + ExchangisEntityRespResult httpResult = entity.getResult(); + logger.info("execute job response => status: {}, response: {}", httpResult.getStatusCode(), httpResult.getResponseBody()); + Map responseMap = BDPJettyServerHelper.gson().fromJson(httpResult.getResponseBody(), Map.class); + Map dataMap = (Map) responseMap.get("data"); + + String status = Optional.of(dataMap.get("status").toString()).orElseThrow(() -> new ExternalOperationFailedException(90176, "DSS execute sqoop node failed,payload is empty", null)); + switch (ExchangisStatusEnum.getEnum(status)) { + case Failed: + return RefExecutionState.Failed; + case Success: + return RefExecutionState.Success; + case Cancelled: + return RefExecutionState.Killed; + default: + return RefExecutionState.Running; + } + } catch (Exception e) { + ref.getExecutionRequestRefContext().appendLog("dss execute sqoop error for get state failed,url:" + url); + ref.getExecutionRequestRefContext().appendLog(e.getMessage()); + throw new ExternalOperationFailedException(90176, "dss execute sqoop error for get state failed", e); + } + } + + @Override + public ResponseRef getAsyncResult(AsyncExecutionRequestRef ref, String baseUrl, SSORequestOperation ssoRequestOperation, String execId) throws ExternalOperationFailedException { + /*String url = baseUrl + "api/rest_j/" + ServerConfiguration.BDP_SERVER_VERSION() + "/dss/exchangis/main/appJob" + "/execute/" + getId(ref); + ref.getExecutionRequestRefContext().appendLog("dss execute sqoop node,ready to submit from " + url); + ExchangisEntityPostAction exchangisEntityPostAction = new ExchangisEntityPostAction(); + exchangisEntityPostAction.setUser(ref.getExecutionRequestRefContext().getRuntimeMap().get("wds.dss.workflow.submit.user").toString()); + String originLabels = ref.getExecutionRequestRefContext().getRuntimeMap().get("labels").toString(); + String submitUser = ref.getExecutionRequestRefContext().getRuntimeMap().get("wds.dss.workflow.submit.user").toString(); + exchangisEntityPostAction.addRequestPayload("submitUser",submitUser); + HashMap labels = new HashMap<>(); + labels.put("route", originLabels); + exchangisEntityPostAction.addRequestPayload("labels", labels); + + try { + ExchangisEntityRespResult.BasicMessageEntity> entity = requestToGetEntity(url, ref.getWorkspace(), ref, + (requestRef) -> { + // Build ref execution action + return exchangisEntityPostAction; + }, Map.class); + if (Objects.isNull(entity)) { + throw new ExternalOperationFailedException(31020, "The response entity cannot be empty", null); + } + ExchangisEntityRespResult httpResult = entity.getResult(); + logger.info("execute job response => status: {}, response: {}", httpResult.getStatusCode(), httpResult.getResponseBody()); + Map responseMap = BDPJettyServerHelper.gson().fromJson(httpResult.getResponseBody(), Map.class); + Map dataMap = (Map) responseMap.get("data"); + String newExecId = dataMap.get("jobExecutionId").toString(); + ResultSetWriter resultSetWriter = ref.getExecutionRequestRefContext().createTextResultSetWriter(); + resultSetWriter.addRecordString(newExecId); + resultSetWriter.flush(); + IOUtils.closeQuietly(resultSetWriter); + ref.getExecutionRequestRefContext().sendResultSet(resultSetWriter); + } catch (IOException e) { + ref.getExecutionRequestRefContext().appendLog("dss execute sqoop node failed,url:" + url); + ref.getExecutionRequestRefContext().appendLog(e.getMessage()); + throw new ExternalOperationFailedException(90176, "dss execute sqoop node failed", e); + }*/ + return new ExchangisCompletedExecutionResponseRef(200); + } + + + public boolean kill (AsyncExecutionRequestRef ref, String baseUrl, SSORequestOperation ssoRequestOperation, String execId) throws ExternalOperationFailedException { + String originLabels = ref.getExecutionRequestRefContext().getRuntimeMap().get("labels").toString(); + String realLabels = null; + if (originLabels.contains("route")) { + Map changeData = BDPJettyServerHelper.gson().fromJson(originLabels, Map.class); + realLabels = changeData.get("route"); + } else { + realLabels = originLabels; + } + + if (StringUtils.isEmpty(execId)) { + ref.getExecutionRequestRefContext().appendLog("dss execute sqoop error for execId is null when kill job!"); + throw new ExternalOperationFailedException(90176, "dss execute sqoop error when kill job"); + } + String url = baseUrl + "api/rest_j/" + ServerConfiguration.BDP_SERVER_VERSION() + "/dss/exchangis/main/job" + "/execution/" + execId + "/kill?labels=" + realLabels; + ref.getExecutionRequestRefContext().appendLog("dss execute sqoop node,ready to submit from " + url); + + ExchangisEntityPostAction exchangisPostAction = new ExchangisEntityPostAction(); + exchangisPostAction.setUrl(ref.getExecutionRequestRefContext().getRuntimeMap().get("wds.dss.workflow.submit.user").toString()); + + ExchangisEntityRespResult.BasicMessageEntity> entity = requestToGetEntity(url, ref.getWorkspace(), ref, + (requestRef) -> { + // Build ref execution action + return exchangisPostAction; + }, Map.class); + + if (Objects.isNull(entity)) { + throw new ExternalOperationFailedException(31020, "The response entity cannot be empty", null); + } + ExchangisEntityRespResult httpResult = entity.getResult(); + logger.info("execute job response => status: {}, response: {}", httpResult.getStatusCode(), httpResult.getResponseBody()); + if (httpResult.getStatusCode() == 200) { + return true; + } + return false; + } + + @Override + protected Logger getLogger() { + return null; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/project/AbstractExchangisProjectOperation.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/project/AbstractExchangisProjectOperation.java new file mode 100644 index 000000000..ada5a5eae --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/project/AbstractExchangisProjectOperation.java @@ -0,0 +1,52 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.project; + +import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectRequestRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.AbstractExchangisOperation; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisEntityPostAction; +import com.webank.wedatasphere.exchangis.dss.appconn.request.entity.ProjectReqEntity; +import com.webank.wedatasphere.exchangis.dss.appconn.utils.AppConnUtils; +import com.webank.wedatasphere.exchangis.dss.appconn.utils.JsonExtension; +import org.apache.commons.lang.StringUtils; + +import java.util.HashMap; +import java.util.Map; + +/** + * Abstract implement of operation related by project + */ +public abstract class AbstractExchangisProjectOperation extends AbstractExchangisOperation { + + public AbstractExchangisProjectOperation(String[] uriParts) { + super(uriParts); + } + + public AbstractExchangisProjectOperation(){ + + } + /** + * Get Project entity + * @return postEntity + */ + protected ProjectReqEntity getProjectEntity(ProjectRequestRef projectRequestRef){ + // Build project request entity + Map source = new HashMap<>(); + /*String editUsers= StringUtils.join( projectRequestRef.getEditUsers(),","); + String viewUsers = StringUtils.join( projectRequestRef.getAccessUsers(),","); + String execUsers = StringUtils.join( projectRequestRef.getReleaseUsers(),",");*/ + String editUsers= projectRequestRef.getName(); + String viewUsers = projectRequestRef.getName(); + String execUsers = projectRequestRef.getName(); + ProjectReqEntity projectReqEntity = new ProjectReqEntity(projectRequestRef.getId(), editUsers,viewUsers,execUsers, + projectRequestRef.getName(), projectRequestRef.getDescription(), source); + projectReqEntity.setLabels(AppConnUtils.serializeDssLabel(projectRequestRef.getDSSLabels())); + // Try to set the project request ref into the source map + try { + Map requestRefMap = JsonExtension.convert(projectReqEntity, Map.class, String.class, Object.class); + source.putAll(requestRefMap); + } catch (ExternalOperationFailedException e){ + getLogger().warn("Unable to serialize the project requestRef into the source map", e); + } + return projectReqEntity; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/project/ExchangisProjectCreationOperation.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/project/ExchangisProjectCreationOperation.java new file mode 100644 index 000000000..1baed0bc5 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/project/ExchangisProjectCreationOperation.java @@ -0,0 +1,84 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.project; + +import com.webank.wedatasphere.dss.standard.app.sso.builder.SSOUrlBuilderOperation; +import com.webank.wedatasphere.dss.standard.app.sso.request.SSORequestOperation; +import com.webank.wedatasphere.dss.standard.app.structure.StructureService; +import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectCreationOperation; +import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectRequestRef; +import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectResponseRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; + +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisEntityPostAction; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.AbstractExchangisOperation; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisProjectResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.request.entity.ProjectReqEntity; +import com.webank.wedatasphere.exchangis.dss.appconn.response.result.ExchangisEntityRespResult; +import com.webank.wedatasphere.exchangis.dss.appconn.utils.AppConnUtils; +import com.webank.wedatasphere.exchangis.dss.appconn.utils.JsonExtension; +import org.apache.linkis.httpclient.request.HttpAction; +import org.apache.linkis.httpclient.response.HttpResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Project create operation + */ +public class ExchangisProjectCreationOperation extends AbstractExchangisProjectOperation implements ProjectCreationOperation { + private final static Logger LOG = LoggerFactory.getLogger(ExchangisProjectCreationOperation.class); + + private StructureService structureService; + + public ExchangisProjectCreationOperation(StructureService structureService) { + super(new String[]{"appProject"}); + setStructureService(structureService); + } + + @Override + public ProjectResponseRef createProject(ProjectRequestRef projectRequestRef) throws ExternalOperationFailedException { + LOG.info("create project request => dss_projectId:{}, name:{}, createUser:{}, parameters:{}, workspaceName:{}", + projectRequestRef.getId(), projectRequestRef.getName(), projectRequestRef.getCreateBy(), projectRequestRef.getParameters().toString(), + projectRequestRef.getWorkspace().getWorkspaceName()); + ExchangisEntityRespResult.BasicMessageEntity> entity = requestToGetEntity(projectRequestRef.getWorkspace(), projectRequestRef, + (requestRef) -> { + // Build project post(add) action + ExchangisEntityPostAction postAction = new ExchangisEntityPostAction<>(getProjectEntity(requestRef)); + postAction.setUser(requestRef.getCreateBy()); + return postAction; + }, Map.class); + if (Objects.isNull(entity)){ + throw new ExternalOperationFailedException(31020, "The response entity cannot be empty", null); + } + ExchangisEntityRespResult httpResult = entity.getResult(); + LOG.info("create project response => status {}, response {}", httpResult.getStatusCode(), httpResult.getResponseBody()); + long projectId; + try { + projectId = Long.parseLong(String.valueOf(entity.getData().get(Constraints.PROJECT_ID))); + } catch (Exception e){ + throw new ExternalOperationFailedException(31020, "Fail to resolve the project id from response entity", e); + } + ExchangisProjectResponseRef responseRef = new ExchangisProjectResponseRef(httpResult, projectId); + responseRef.setAppInstance(structureService.getAppInstance()); + return responseRef; + } + + @Override + public void init() { + + } + + @Override + public void setStructureService(StructureService structureService) { + this.structureService = structureService; + setSSORequestService(this.structureService); + } + + @Override + protected Logger getLogger() { + return LOG; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/project/ExchangisProjectDeletionOperation.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/project/ExchangisProjectDeletionOperation.java new file mode 100644 index 000000000..609408baf --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/project/ExchangisProjectDeletionOperation.java @@ -0,0 +1,73 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.project; + +import com.webank.wedatasphere.dss.standard.app.sso.request.SSORequestOperation; +import com.webank.wedatasphere.dss.standard.app.structure.StructureService; +import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectDeletionOperation; +import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectRequestRef; +import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectResponseRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisDeleteAction; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisProjectResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisEntityPostAction; +import com.webank.wedatasphere.exchangis.dss.appconn.response.result.ExchangisEntityRespResult; +import org.apache.linkis.httpclient.request.HttpAction; +import org.apache.linkis.httpclient.response.HttpResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + + +/** + * Project delete operation + */ +public class ExchangisProjectDeletionOperation extends AbstractExchangisProjectOperation implements ProjectDeletionOperation { + private static Logger LOG = LoggerFactory.getLogger(ExchangisProjectDeletionOperation.class); + + private SSORequestOperation ssoRequestOperation; + private StructureService structureService; + + public ExchangisProjectDeletionOperation(StructureService structureService) { + setStructureService(structureService); + } + + @Override + protected Logger getLogger() { + return LOG; + } + + @Override + public ProjectResponseRef deleteProject(ProjectRequestRef projectRequestRef) throws ExternalOperationFailedException { + LOG.info("delete project request => dss_projectId:{}, name:{}, createName:{}", projectRequestRef.getId(), + projectRequestRef.getName(), projectRequestRef.getCreateBy()); + String url = requestURL("appProject/" + projectRequestRef.getName()+"/"); + ExchangisEntityRespResult.BasicMessageEntity> entity = requestToGetEntity(url,projectRequestRef.getWorkspace(), projectRequestRef, + (requestRef) ->{ + ExchangisEntityPostAction exchangisEntityPostAction = new ExchangisEntityPostAction(); + exchangisEntityPostAction.setUser(requestRef.getCreateBy()); + return exchangisEntityPostAction; + }, Map.class); + if (Objects.isNull(entity)){ + throw new ExternalOperationFailedException(31020, "The response entity cannot be empty", null); + } + ExchangisEntityRespResult httpResult = entity.getResult(); + LOG.info("delete project response => status {}, response {}", httpResult.getStatusCode(), httpResult.getResponseBody()); + ExchangisProjectResponseRef responseRef = new ExchangisProjectResponseRef(httpResult, null); + responseRef.setAppInstance(structureService.getAppInstance()); + return responseRef; + } + + @Override + public void init() { + + } + + @Override + public void setStructureService(StructureService structureService) { + this.structureService = structureService; + setSSORequestService(this.structureService); + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/project/ExchangisProjectGetOperation.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/project/ExchangisProjectGetOperation.java new file mode 100644 index 000000000..ff12b2e7d --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/project/ExchangisProjectGetOperation.java @@ -0,0 +1,92 @@ +/* +package com.webank.wedatasphere.exchangis.dss.appconn.operation.project; + +import com.webank.wedatasphere.dss.common.entity.project.DSSProject; +import com.webank.wedatasphere.dss.standard.app.sso.request.SSORequestOperation; +import com.webank.wedatasphere.dss.standard.app.structure.StructureService; +import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectGetOperation; +import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectRequestRef; +import com.webank.wedatasphere.dss.standard.common.exception.AppStandardErrorException; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisProjectResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisEntityPostAction; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisGetAction; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.HttpExtAction; +import com.webank.wedatasphere.exchangis.dss.appconn.response.result.ExchangisEntityRespResult; +import com.webank.wedatasphere.exchangis.dss.appconn.service.ExchangisProjectService; +import com.webank.wedatasphere.exchangis.dss.appconn.utils.AppConnUtils; +import org.apache.linkis.httpclient.request.HttpAction; +import org.apache.linkis.httpclient.response.HttpResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +*/ +/** + * @author tikazhang + * @Date 2022/3/22 0:48 + *//* + +public class ExchangisProjectGetOperation extends AbstractExchangisProjectOperation implements ProjectGetOperation { + private static Logger LOG = LoggerFactory.getLogger(ExchangisProjectDeletionOperation.class); + + private SSORequestOperation ssoRequestOperation; + private StructureService structureService; + + public ExchangisProjectGetOperation(StructureService structureService) { + setStructureService(structureService); + } + + @Override + protected Logger getLogger() { + return LOG; + } + + @Override + public DSSProject getProject(ProjectRequestRef projectRequestRef) throws ExternalOperationFailedException { + LOG.info("get project request => dss_projectId:{}, name:{}, createName:{}", projectRequestRef.getId(), + projectRequestRef.getName(), projectRequestRef.getCreateBy()); + String url = requestURL("appProject/check/" + projectRequestRef.getName() + "/"); + ExchangisEntityRespResult.BasicMessageEntity> entity = requestToGetEntity(url, projectRequestRef.getWorkspace(), projectRequestRef, + (requestRef) -> { + ExchangisEntityPostAction exchangisEntityPostAction = new ExchangisEntityPostAction(); + exchangisEntityPostAction.setUser(requestRef.getCreateBy()); + return exchangisEntityPostAction; + }, Map.class); + if (Objects.isNull(entity)) { + throw new ExternalOperationFailedException(31020, "The response entity cannot be empty", null); + } + try { + ExchangisEntityRespResult httpResult = entity.getResult(); + httpResult.getResponseBody(); + Map resMap = AppConnUtils.getResponseMap(httpResult); + DSSProject dssProject = new DSSProject(); + Map dataMap = (Map) resMap.get("data"); + Map projectInfo = (Map) dataMap.get("projectInfo"); + //如果查询不到project,则无重复项目可以直接返回 + if (projectInfo == null) { + return null; + } + dssProject.setId(Long.parseLong(projectInfo.get("id").toString())); + return dssProject; + } catch (AppStandardErrorException e) { + throw new ExternalOperationFailedException(90176, "search Exchangis Project failed when get HttpResult", e); + } catch (Exception e) { + throw new ExternalOperationFailedException(90176, "search Exchangis project failed when parse response json", e); + } + } + + @Override + public void init() { + + } + + @Override + public void setStructureService(StructureService structureService) { + this.structureService = structureService; + setSSORequestService(this.structureService); + } +}*/ diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/project/ExchangisProjectUpdateOperation.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/project/ExchangisProjectUpdateOperation.java new file mode 100644 index 000000000..eac1d3c92 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/project/ExchangisProjectUpdateOperation.java @@ -0,0 +1,75 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.project; + +import com.webank.wedatasphere.dss.standard.app.structure.StructureService; +import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectRequestRef; +import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectResponseRef; +import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectUpdateOperation; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisProjectResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisEntityPutAction; +import com.webank.wedatasphere.exchangis.dss.appconn.request.entity.ProjectReqEntity; +import com.webank.wedatasphere.exchangis.dss.appconn.response.result.ExchangisEntityRespResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.atomic.AtomicLong; + +/** + * Project update operation + */ +public class ExchangisProjectUpdateOperation extends AbstractExchangisProjectOperation implements ProjectUpdateOperation { + private static final Logger LOG = LoggerFactory.getLogger(ExchangisProjectUpdateOperation.class); + + private StructureService structureService; + + public ExchangisProjectUpdateOperation(StructureService structureService) { + super(new String[]{"appProject"}); + setStructureService(structureService); + } + + @Override + public ProjectResponseRef updateProject(ProjectRequestRef projectRequestRef) throws ExternalOperationFailedException { + LOG.info("update project request => dss_projectId:{}, name:{}, createName:{}", + projectRequestRef.getId(), projectRequestRef.getName(),projectRequestRef.getCreateBy()); + ExchangisEntityRespResult.BasicMessageEntity> entity = requestToGetEntity(projectRequestRef.getWorkspace(), projectRequestRef, + (requestRef) -> { + // Build project put(update) action + return new ExchangisEntityPutAction<>(getProjectEntity(requestRef), requestRef.getCreateBy()); + }, Map.class); + if (Objects.isNull(entity)){ + throw new ExternalOperationFailedException(31020, "The response entity cannot be empty", null); + } + ExchangisEntityRespResult httpResult = entity.getResult(); + LOG.info("update project response => status {}, response {}", httpResult.getStatusCode(), httpResult.getResponseBody()); + AtomicLong newProjectId = new AtomicLong(projectRequestRef.getId()); + try { + Optional.ofNullable(entity.getData()).ifPresent( data -> newProjectId + .set(Long.parseLong(String.valueOf(data.getOrDefault(Constraints.PROJECT_ID, newProjectId.get()))))); + } catch (Exception e){ + throw new ExternalOperationFailedException(31020, "Fail to resolve the project id from response entity", e); + } + ExchangisProjectResponseRef responseRef = new ExchangisProjectResponseRef(httpResult, newProjectId.get()); + responseRef.setAppInstance(structureService.getAppInstance()); + return responseRef; + } + + @Override + public void init() { + + } + + @Override + public void setStructureService(StructureService structureService) { + this.structureService = structureService; + setSSORequestService(this.structureService); + } + + @Override + protected Logger getLogger() { + return LOG; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/publish/ExchangisExportRequestRef.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/publish/ExchangisExportRequestRef.java new file mode 100644 index 000000000..fbe71be63 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/publish/ExchangisExportRequestRef.java @@ -0,0 +1,52 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.publish; + +import com.google.common.collect.Maps; +import com.webank.wedatasphere.dss.standard.app.development.ref.ExportRequestRef; +import com.webank.wedatasphere.dss.standard.app.sso.Workspace; + +import java.util.Map; + +/** + * @author tikazhang + * @Date 2022/3/13 16:33 + */ +public class ExchangisExportRequestRef implements ExportRequestRef { + + Map parameters = Maps.newHashMap(); + Workspace workspace; + + @Override + public Object getParameter(String key) { + return parameters.get(key); + } + + @Override + public void setParameter(String key, Object value) { + parameters.put(key, value); + } + + @Override + public Map getParameters() { + return parameters; + } + + @Override + public String getName() { + return parameters.get("name").toString(); + } + + @Override + public String getType() { + return parameters.get("type").toString(); + } + + @Override + public Workspace getWorkspace() { + return workspace; + } + + @Override + public void setWorkspace(Workspace workspace) { + this.workspace = workspace; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/publish/ExchangisImportRequestRef.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/publish/ExchangisImportRequestRef.java new file mode 100644 index 000000000..58be4e6fa --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/publish/ExchangisImportRequestRef.java @@ -0,0 +1,74 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.publish; + +import com.google.common.collect.Maps; +import com.webank.wedatasphere.dss.standard.app.development.operation.RefImportOperation; +import com.webank.wedatasphere.dss.standard.app.development.ref.ImportRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.service.DevelopmentService; +import com.webank.wedatasphere.dss.standard.app.sso.Workspace; +import com.webank.wedatasphere.dss.standard.app.sso.builder.SSOUrlBuilderOperation; +import com.webank.wedatasphere.dss.standard.app.sso.request.SSORequestOperation; +import com.webank.wedatasphere.dss.standard.common.entity.ref.ResponseRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisExportResponseRef; +import org.apache.linkis.httpclient.request.HttpAction; +import org.apache.linkis.httpclient.response.HttpResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Map; + +/** + * @author tikazhang + * @Date 2022/3/13 16:45 + */ +public class ExchangisImportRequestRef implements ImportRequestRef { + + Map parameters = Maps.newHashMap(); + Workspace workspace; + + @Override + public Object getParameter(String key) { + return parameters.get(key); + } + + @Override + public void setParameter(String key, Object value) { + parameters.put(key, value); + } + + @Override + public Map getParameters() { + return parameters; + } + + @Override + public String getName() { + return parameters.get("name").toString(); + } + + @Override + public String getType() { + return parameters.get("type").toString(); + } + + @Override + public boolean equals(Object ref) { + return false; + } + + @Override + public String toString() { + return parameters.toString(); + } + + @Override + public Workspace getWorkspace() { + return workspace; + } + + @Override + public void setWorkspace(Workspace workspace) { + this.workspace = workspace; + } + +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/AbstractExchangisRefOperation.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/AbstractExchangisRefOperation.java new file mode 100644 index 000000000..b4b9cb831 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/AbstractExchangisRefOperation.java @@ -0,0 +1,40 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.ref; + +import com.webank.wedatasphere.dss.standard.app.development.ref.NodeRequestRef; +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.AbstractExchangisOperation; +import com.webank.wedatasphere.exchangis.dss.appconn.request.entity.RefJobReqEntity; +import com.webank.wedatasphere.exchangis.dss.appconn.utils.AppConnUtils; + +import java.util.Collections; +import java.util.Map; +import java.util.Optional; + +/** + * Abstract implement of operation related by ref + */ +public abstract class AbstractExchangisRefOperation extends AbstractExchangisOperation { + public AbstractExchangisRefOperation() { + } + + public AbstractExchangisRefOperation(String[] uriParts) { + super(uriParts); + } + + /** + * Job request entity + * @param nodeRequestRef node request ref + * @param engineType engine type + * @return + */ + public RefJobReqEntity getRefJobReqEntity(NodeRequestRef nodeRequestRef, String engineType){ + Map jobContent = Optional.ofNullable(nodeRequestRef.getJobContent()).orElse(Collections.emptyMap()); + String desc = String.valueOf(jobContent.getOrDefault(Constraints.REF_JOB_DESC, "")); + RefJobReqEntity jobReqEntity = new RefJobReqEntity(nodeRequestRef.getName(), desc, + Constraints.JOB_TYPE_OFFLINE, engineType, nodeRequestRef.getProjectId()); + jobReqEntity.setJobLabels(AppConnUtils.serializeDssLabel(nodeRequestRef.getDSSLabels())); + //TODO store the job content + jobReqEntity.setSource(nodeRequestRef.getJobContent()); + return jobReqEntity; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisExportOperation.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisExportOperation.java new file mode 100644 index 000000000..a0f1de8cf --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisExportOperation.java @@ -0,0 +1,105 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.ref; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.webank.wedatasphere.dss.standard.app.development.operation.RefExportOperation; +import com.webank.wedatasphere.dss.standard.app.development.ref.ExportRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.service.DevelopmentService; +import com.webank.wedatasphere.dss.standard.app.sso.builder.SSOUrlBuilderOperation; +import com.webank.wedatasphere.dss.standard.app.sso.request.SSORequestOperation; +import com.webank.wedatasphere.dss.standard.common.entity.ref.ResponseRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisExportResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisOpenResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisEntityPostAction; +import org.apache.linkis.httpclient.request.HttpAction; +import org.apache.linkis.httpclient.response.HttpResult; +import org.apache.linkis.server.BDPJettyServerHelper; +import org.apache.linkis.server.conf.ServerConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; + +/** + * Ref export operation + */ +public class ExchangisExportOperation extends AbstractExchangisRefOperation implements RefExportOperation { + private final static Logger LOG = LoggerFactory.getLogger(ExchangisExportOperation.class); + + private DevelopmentService developmentService; + private SSORequestOperation ssoRequestOperation; + + public ExchangisExportOperation(DevelopmentService developmentService){ + this.developmentService = developmentService; + this.ssoRequestOperation = this.developmentService.getSSORequestService().createSSORequestOperation(getAppName()); + setSSORequestService(this.developmentService); + } + + + @Override + public ResponseRef exportRef(ExportRequestRef exportRequestRef) throws ExternalOperationFailedException { + String url = developmentService.getAppInstance().getBaseUrl() + "api/rest_j/" + ServerConfiguration.BDP_SERVER_VERSION() + "/dss/exchangis/main/appJob" + "/export"; + ExchangisEntityPostAction exchangisEntityPostAction = new ExchangisEntityPostAction(); + exchangisEntityPostAction.setUser(exportRequestRef.getParameter("user").toString()); + exchangisEntityPostAction.addRequestPayload("projectId", exportRequestRef.getParameter("projectId")); + exchangisEntityPostAction.addRequestPayload("partial", true); + HashMap labels = new HashMap<>(); + labels.put("route", "dev"); + exchangisEntityPostAction.addRequestPayload("labels", labels); + String nodeType = exportRequestRef.getParameter("nodeType").toString(); + String externalContent = null; + + String exportContent = null; + try { + exportContent = BDPJettyServerHelper.jacksonJson().writeValueAsString(exportRequestRef); + } catch (JsonProcessingException e) { + LOG.error("Occur error while tranform class", e.getMessage()); + } + LOG.info("url: {}", url); + LOG.info("exportRequestRef: {}", exportContent); + try { + LOG.info("jobContent: {}", exportRequestRef.getParameter("jobContent")); + externalContent = BDPJettyServerHelper.jacksonJson().writeValueAsString(exportRequestRef.getParameter("jobContent")); + if(Constraints.NODE_TYPE_SQOOP.equalsIgnoreCase(nodeType)) { + ExchangisOpenResponseRef exchangisOpenResponseRef = new ExchangisOpenResponseRef(externalContent, 0); + exchangisEntityPostAction.addRequestPayload("sqoopIds", ((Double) Double.parseDouble(exchangisOpenResponseRef.getSqoopId())).longValue()); + LOG.info("sqoopIds: {}", exchangisEntityPostAction.getRequestPayload()); + } else if(Constraints.NODE_TYPE_DATAX.equalsIgnoreCase(nodeType)) { + ExchangisOpenResponseRef exchangisOpenResponseRef = new ExchangisOpenResponseRef(externalContent, 0); + exchangisEntityPostAction.addRequestPayload("dataXIds", ((Double) Double.parseDouble(exchangisOpenResponseRef.getSqoopId())).longValue()); + } else { + throw new ExternalOperationFailedException(90177, "Unknown task type " + exportRequestRef.getType(), null); + } + } catch (Exception e) { + LOG.error("Failed to create export request", e); + } + SSOUrlBuilderOperation ssoUrlBuilderOperation = exportRequestRef.getWorkspace().getSSOUrlBuilderOperation().copy(); + ssoUrlBuilderOperation.setAppName(getAppName()); + ssoUrlBuilderOperation.setReqUrl(url); + ssoUrlBuilderOperation.setWorkspace(exportRequestRef.getWorkspace().getWorkspaceName()); + ResponseRef responseRef; + try{ + LOG.info("getBuiltUrl: {}", ssoUrlBuilderOperation.getBuiltUrl()); + LOG.info("postAction: {}", exchangisEntityPostAction); + exchangisEntityPostAction.setUrl(ssoUrlBuilderOperation.getBuiltUrl()); + HttpResult httpResult = this.ssoRequestOperation.requestWithSSO(ssoUrlBuilderOperation, exchangisEntityPostAction); + LOG.info("httpResult: {}", httpResult.getResponseBody()); + responseRef = new ExchangisExportResponseRef(httpResult.getResponseBody()); + LOG.info("responseRef: {}", responseRef.getResponseBody()); + } catch (Exception e){ + throw new ExternalOperationFailedException(90176, "Export Exchangis Exception", e); + } + return responseRef; + } + + @Override + public void setDevelopmentService(DevelopmentService developmentService) { + this.developmentService = developmentService; + } + + @Override + protected Logger getLogger() { + return LOG; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisImportOperation.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisImportOperation.java new file mode 100644 index 000000000..e24e12b8c --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisImportOperation.java @@ -0,0 +1,82 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.ref; + +import com.webank.wedatasphere.dss.standard.app.development.operation.RefImportOperation; +import com.webank.wedatasphere.dss.standard.app.development.ref.ImportRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.service.DevelopmentService; +import com.webank.wedatasphere.dss.standard.app.sso.builder.SSOUrlBuilderOperation; +import com.webank.wedatasphere.dss.standard.app.sso.request.SSORequestOperation; +import com.webank.wedatasphere.dss.standard.common.entity.ref.ResponseRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisImportResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisEntityPostAction; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisPostAction; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.AbstractExchangisResponseRef; +import org.apache.linkis.httpclient.request.HttpAction; +import org.apache.linkis.httpclient.response.HttpResult; +import org.apache.linkis.server.conf.ServerConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.Map; + + +/** + * Ref import operation + */ +public class ExchangisImportOperation extends AbstractExchangisRefOperation implements RefImportOperation { + private final static Logger LOG = LoggerFactory.getLogger(ExchangisImportOperation.class); + + private DevelopmentService developmentService; + private SSORequestOperation ssoRequestOperation; + + public ExchangisImportOperation(DevelopmentService developmentService){ + this.developmentService = developmentService; + setSSORequestService(this.developmentService); + this.ssoRequestOperation = this.developmentService.getSSORequestService().createSSORequestOperation(getAppName()); + } + + @Override + public ResponseRef importRef(ImportRequestRef importRequestRef) throws ExternalOperationFailedException { + String originUrl = developmentService.getAppInstance().getBaseUrl().split("#")[0]; + String url = originUrl + "api/rest_j/" + ServerConfiguration.BDP_SERVER_VERSION() + "/dss/exchangis/main/appJob" + "/import"; + ExchangisEntityPostAction exchangisEntityPostAction = new ExchangisEntityPostAction(); + exchangisEntityPostAction.setUser(importRequestRef.getParameter("user").toString()); + exchangisEntityPostAction.addRequestPayload("projectId", importRequestRef.getParameter("projectId")); + exchangisEntityPostAction.addRequestPayload("projectVersion", importRequestRef.getParameter("orcVersion")); + exchangisEntityPostAction.addRequestPayload("flowVersion", importRequestRef.getParameter("version")); + exchangisEntityPostAction.addRequestPayload("resourceId", importRequestRef.getParameter("resourceId").toString()); + exchangisEntityPostAction.addRequestPayload("version", importRequestRef.getParameter("version").toString()); + exchangisEntityPostAction.addRequestPayload("user", importRequestRef.getParameter("user").toString()); + //exchangisEntityPostAction.addRequestPayload("labels", "{\"route\":\"prod\"}"); + HashMap labels = new HashMap<>(); + labels.put("route", "dev"); + exchangisEntityPostAction.addRequestPayload("labels", labels); + LOG.info("resourceId: {}", importRequestRef.getParameter("resourceId")); + LOG.info("exchangisEntityPostAction: {}", exchangisEntityPostAction.getRequestPayload()); + SSOUrlBuilderOperation ssoUrlBuilderOperation = importRequestRef.getWorkspace().getSSOUrlBuilderOperation().copy(); + ssoUrlBuilderOperation.setAppName(getAppName()); + ssoUrlBuilderOperation.setReqUrl(url); + ssoUrlBuilderOperation.setWorkspace(importRequestRef.getWorkspace().getWorkspaceName()); + ResponseRef responseRef; + try { + exchangisEntityPostAction.setUrl(ssoUrlBuilderOperation.getBuiltUrl()); + HttpResult httpResult = this.ssoRequestOperation.requestWithSSO(ssoUrlBuilderOperation, exchangisEntityPostAction); + responseRef = new ExchangisImportResponseRef((Map) importRequestRef.getParameter("jobContent"), httpResult.getResponseBody(), importRequestRef.getParameter("nodeType").toString()); + } catch (Exception e) { + throw new ExternalOperationFailedException(90176, "Import Exchangis Exception", e); + } + return responseRef; + } + + @Override + public void setDevelopmentService(DevelopmentService developmentService) { + this.developmentService = developmentService; + } + + @Override + protected Logger getLogger() { + return LOG; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefCopyOperation.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefCopyOperation.java new file mode 100644 index 000000000..d0495ad80 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefCopyOperation.java @@ -0,0 +1,106 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.ref; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.webank.wedatasphere.dss.standard.app.development.operation.RefCopyOperation; +import com.webank.wedatasphere.dss.standard.app.development.service.DevelopmentService; +import com.webank.wedatasphere.dss.standard.app.sso.builder.SSOUrlBuilderOperation; +import com.webank.wedatasphere.dss.standard.app.sso.plugin.SSOIntegrationConf; +import com.webank.wedatasphere.dss.standard.app.sso.request.SSORequestOperation; +import com.webank.wedatasphere.dss.standard.common.entity.ref.ResponseRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisCopyRequestRef; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisCopyResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisOpenResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisEntityPostAction; +import org.apache.http.HttpRequest; +import org.apache.linkis.httpclient.request.HttpAction; +import org.apache.linkis.httpclient.response.HttpResult; +import org.apache.linkis.server.BDPJettyServerHelper; +import org.apache.linkis.server.conf.ServerConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Map; + +/** + * @author tikazhang + * @Date 2022/4/24 10:55 + */ +public class ExchangisRefCopyOperation extends AbstractExchangisRefOperation implements RefCopyOperation { + + private static final Logger LOG = LoggerFactory.getLogger(ExchangisRefCopyOperation.class); + + private DevelopmentService developmentService; + + private SSORequestOperation ssoRequestOperation; + + public ExchangisRefCopyOperation(DevelopmentService developmentService) { + this.developmentService = developmentService; + this.ssoRequestOperation = this.developmentService.getSSORequestService().createSSORequestOperation(getAppName()); + setSSORequestService(this.developmentService); + } + + @Override + public ResponseRef copyRef(ExchangisCopyRequestRef exchangisCopyRequestRef) throws ExternalOperationFailedException { + String url = developmentService.getAppInstance().getBaseUrl() + "api/rest_j" + ServerConfiguration.BDP_SERVER_VERSION() + "/dss/exchangis/main/appJob" + "/copy"; + ExchangisEntityPostAction exchangisEntityPostAction = new ExchangisEntityPostAction(); + exchangisEntityPostAction.setUser(exchangisCopyRequestRef.getParameter("user").toString()); + exchangisEntityPostAction.addRequestPayload("projectId", exchangisCopyRequestRef.getParameter("projectId")); + exchangisEntityPostAction.addRequestPayload("partial", true); + exchangisEntityPostAction.addRequestPayload("projectVersion", "v1"); + exchangisEntityPostAction.addRequestPayload("flowVersion", exchangisCopyRequestRef.getParameter("orcVersion")); + exchangisEntityPostAction.addRequestPayload("contextID", exchangisCopyRequestRef.getParameter("contextId").toString()); + String nodeType = exchangisCopyRequestRef.getParameter("nodeType").toString(); + String externalContent = null; + Map jobContent = (Map) exchangisCopyRequestRef.getParameter("jobContent"); + + try { + LOG.info("jobConten: {}", exchangisCopyRequestRef.getParameter("jobContent")); + externalContent = BDPJettyServerHelper.jacksonJson().writeValueAsString(exchangisCopyRequestRef.getParameter("jobContent")); + if (Constraints.NODE_TYPE_SQOOP.equals(nodeType)) { + ExchangisOpenResponseRef exchangisOpenResponseRef = new ExchangisOpenResponseRef(externalContent, 0); + exchangisEntityPostAction.addRequestPayload("sqoopIds",((Double) Double.parseDouble(exchangisOpenResponseRef.getSqoopId())).longValue()); + LOG.info("sqoopIds: {}", exchangisEntityPostAction.getRequestPayload()); + } else if(Constraints.NODE_TYPE_DATAX.equalsIgnoreCase(nodeType)) { + ExchangisOpenResponseRef exchangisOpenResponseRef = new ExchangisOpenResponseRef(externalContent, 0); + exchangisEntityPostAction.addRequestPayload("dataXIds", ((Double) Double.parseDouble(exchangisOpenResponseRef.getDataxId())).longValue()); + } else { + throw new ExternalOperationFailedException(90177, "Unknown task type " + exchangisCopyRequestRef.getType(), null); + } + } catch (JsonProcessingException e) { + LOG.error("Failed to create copy request", e); + } + + SSOUrlBuilderOperation ssoUrlBuilderOperation = exchangisCopyRequestRef.getWorkspace().getSSOUrlBuilderOperation(); + ssoUrlBuilderOperation.setAppName(getAppName()); + ssoUrlBuilderOperation.setReqUrl(url); + ssoUrlBuilderOperation.setWorkspace(exchangisCopyRequestRef.getWorkspace().getWorkspaceName()); + ResponseRef responseRef = null; + try { + LOG.info("getBuiltUrl: {}", ssoUrlBuilderOperation.getBuiltUrl()); + LOG.info("postAction: {}", exchangisEntityPostAction); + exchangisEntityPostAction.setUrl(ssoUrlBuilderOperation.getBuiltUrl()); + HttpResult httpResult = (HttpResult) this.ssoRequestOperation.requestWithSSO(ssoUrlBuilderOperation, exchangisEntityPostAction); + Map responseMap = SSOIntegrationConf.gson().fromJson(httpResult.getResponseBody(), Map.class); + Map dataMap = (Map) responseMap.get("data"); + Map sqoopData = (Map) dataMap.get("sqoop"); + jobContent.put("sqoopIds", Double.parseDouble(sqoopData.get(jobContent.get("id").toString()).toString())); + responseRef = new ExchangisCopyResponseRef( jobContent, httpResult.getResponseBody()); + } catch (Exception e) { + throw new ExternalOperationFailedException(90176, "Copy Exchangis Exception", e); + } + + return responseRef; + } + + @Override + public void setDevelopmentService(DevelopmentService developmentService) { + this.developmentService = developmentService; + } + + @Override + protected Logger getLogger() { + return LOG; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefCreationOperation.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefCreationOperation.java new file mode 100644 index 000000000..343b94709 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefCreationOperation.java @@ -0,0 +1,74 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.ref; + +import com.webank.wedatasphere.dss.standard.app.development.operation.RefCreationOperation; +import com.webank.wedatasphere.dss.standard.app.development.ref.CreateRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.ref.NodeRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.service.DevelopmentService; +import com.webank.wedatasphere.dss.standard.common.entity.ref.ResponseRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisCommonResponseDef; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisEntityPostAction; +import com.webank.wedatasphere.exchangis.dss.appconn.response.result.ExchangisEntityRespResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Map; +import java.util.Objects; + + +/** + * Ref creation operation + */ +public class ExchangisRefCreationOperation extends AbstractExchangisRefOperation implements RefCreationOperation { + private final static Logger LOG = LoggerFactory.getLogger(ExchangisRefCreationOperation.class); + + DevelopmentService developmentService; + + public ExchangisRefCreationOperation(DevelopmentService developmentService){ + super(new String[]{"appJob/create"}); + this.developmentService = developmentService; + setSSORequestService(developmentService); + } + + @Override + public ResponseRef createRef(CreateRequestRef createRequestRef) throws ExternalOperationFailedException { + NodeRequestRef exchangisCreateRequestRef = (NodeRequestRef) createRequestRef; + exchangisCreateRequestRef.getProjectName(); + ResponseRef responseRef = null; + if(Constraints.NODE_TYPE_SQOOP.equalsIgnoreCase(exchangisCreateRequestRef.getNodeType())){ + responseRef = sendOffLineRequest(exchangisCreateRequestRef, Constraints.ENGINE_TYPE_SQOOP_NAME); + LOG.info("responseRef: {}", responseRef.toMap()); + }else if(Constraints.NODE_TYPE_DATAX.equalsIgnoreCase(exchangisCreateRequestRef.getNodeType())){ + responseRef = sendOffLineRequest(exchangisCreateRequestRef, Constraints.ENGINE_TYPE_DATAX_NAME); + } + return responseRef; + } + + private ResponseRef sendOffLineRequest(NodeRequestRef nodeRequestRef, String engineType) throws ExternalOperationFailedException { + LOG.info("create {} job request => jobContent:{}, projectId:{}, projectName:{}, parameters:{}, type:{}", + engineType, nodeRequestRef.getJobContent(), nodeRequestRef.getProjectId(), nodeRequestRef.getProjectName(), + nodeRequestRef.getParameters().toString(), nodeRequestRef.getType()); + ExchangisEntityRespResult.BasicMessageEntity> entity = requestToGetEntity(nodeRequestRef.getWorkspace(), nodeRequestRef, + (requestRef) -> { + // Build ref creation action + return new ExchangisEntityPostAction<>(getRefJobReqEntity(requestRef, engineType), requestRef.getUserName()); + }, Map.class); + if (Objects.isNull(entity)){ + throw new ExternalOperationFailedException(31020, "The response entity cannot be empty", null); + } + ExchangisEntityRespResult httpResult = entity.getResult(); + LOG.info("create {} job response => status: {}, response: {}", engineType, httpResult.getStatusCode(), httpResult.getResponseBody()); + return new ExchangisCommonResponseDef(httpResult); + } + + @Override + public void setDevelopmentService(DevelopmentService developmentService) { + this.developmentService = developmentService; + } + + @Override + protected Logger getLogger() { + return LOG; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefDeletionOperation.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefDeletionOperation.java new file mode 100644 index 000000000..b5e51895c --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefDeletionOperation.java @@ -0,0 +1,75 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.ref; + +import com.google.common.collect.Maps; +import com.webank.wedatasphere.dss.standard.app.development.operation.RefDeletionOperation; +import com.webank.wedatasphere.dss.standard.app.development.ref.NodeRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.service.DevelopmentService; +import com.webank.wedatasphere.dss.standard.app.sso.builder.SSOUrlBuilderOperation; +import com.webank.wedatasphere.dss.standard.app.sso.request.SSORequestOperation; +import com.webank.wedatasphere.dss.standard.common.entity.ref.RequestRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisDeleteAction; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisEntityPostAction; +import com.webank.wedatasphere.exchangis.dss.appconn.response.result.ExchangisEntityRespResult; +import com.webank.wedatasphere.exchangis.dss.appconn.utils.AppConnUtils; +import org.apache.linkis.httpclient.response.HttpResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Ref delete operation + */ +public class ExchangisRefDeletionOperation extends AbstractExchangisRefOperation implements RefDeletionOperation { + private final static Logger LOG = LoggerFactory.getLogger(ExchangisRefDeletionOperation.class); + + DevelopmentService developmentService; + + public ExchangisRefDeletionOperation(DevelopmentService developmentService){ + this.developmentService = developmentService; + setSSORequestService(developmentService); + } + + @Override + public void deleteRef(RequestRef deleteRequestRef) throws ExternalOperationFailedException { + NodeRequestRef nodeRequestRef = (NodeRequestRef) deleteRequestRef; + deleteJob(nodeRequestRef); + } + + private void deleteJob(NodeRequestRef nodeRequestRef) throws ExternalOperationFailedException{ + Integer id = AppConnUtils.resolveParam(nodeRequestRef.getJobContent(), Constraints.REF_JOB_ID, Integer.class); + LOG.info("delete job request => id: {}, jobContext:{}", + id, nodeRequestRef.getJobContent().toString()); + //TODO delete job have bug while get id. + String url = requestURL("appJob/" + id); + ExchangisEntityRespResult.BasicMessageEntity> entity = requestToGetEntity(url, nodeRequestRef.getWorkspace(), nodeRequestRef, + (requestRef) ->{ + // Build ref delete action + ExchangisEntityPostAction exchangisEntityPostAction = new ExchangisEntityPostAction(); + exchangisEntityPostAction.setUser(requestRef.getUserName()); + HashMap labels = new HashMap<>(); + labels.put("route", "dev"); + exchangisEntityPostAction.addRequestPayload("labels", labels); + return exchangisEntityPostAction; + //return new ExchangisDeleteAction(requestRef.getUserName()); + }, Map.class); + if (Objects.isNull(entity)){ + throw new ExternalOperationFailedException(31020, "The response entity cannot be empty", null); + } + LOG.info("delete job response => status: {}, url:{}", entity.getResult().getStatusCode(), url); + } + + @Override + public void setDevelopmentService(DevelopmentService developmentService) { + this.developmentService = developmentService; + } + + @Override + protected Logger getLogger() { + return LOG; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefExecutionOperation.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefExecutionOperation.java new file mode 100644 index 000000000..df9be14c0 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefExecutionOperation.java @@ -0,0 +1,172 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.ref; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.webank.wedatasphere.dss.standard.app.development.listener.common.*; +import com.webank.wedatasphere.dss.standard.app.development.listener.core.Killable; +import com.webank.wedatasphere.dss.standard.app.development.listener.core.LongTermRefExecutionOperation; +import com.webank.wedatasphere.dss.standard.app.development.listener.core.SchedulerManager; +import com.webank.wedatasphere.dss.standard.app.development.listener.scheduler.LongTermRefExecutionScheduler; +import com.webank.wedatasphere.dss.standard.app.development.operation.RefExecutionOperation; +import com.webank.wedatasphere.dss.standard.app.development.ref.ExecutionRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.service.DevelopmentService; +import com.webank.wedatasphere.dss.standard.app.sso.builder.SSOUrlBuilderOperation; +import com.webank.wedatasphere.dss.standard.app.sso.request.SSORequestOperation; +import com.webank.wedatasphere.dss.standard.common.entity.ref.ResponseRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.impl.ExchangisAsyncRefExecutionOperation; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.impl.ExchangisOptStrategy; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisCommonResponseDef; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisEntityPostAction; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisExecutionAction; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisPostAction; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.AbstractExchangisResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.response.result.ExchangisEntityRespResult; +import com.webank.wedatasphere.exchangis.dss.appconn.utils.AppConnUtils; +import org.apache.commons.io.IOUtils; +import org.apache.linkis.httpclient.request.HttpAction; +import org.apache.linkis.httpclient.response.HttpResult; +//import org.apache.linkis.server.BDPJettyServerHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Ref execute operation + */ +public class ExchangisRefExecutionOperation extends LongTermRefExecutionOperation implements RefExecutionOperation, Killable { + + private final static Logger LOG = LoggerFactory.getLogger(ExchangisRefExecutionOperation.class); + + DevelopmentService developmentService; + + SSORequestOperation ssoRequestOperation; + LongTermRefExecutionScheduler scheduler = SchedulerManager.getScheduler(); + + public ExchangisRefExecutionOperation(DevelopmentService service) { + this.developmentService = service; + this.ssoRequestOperation = this.developmentService.getSSORequestService().createSSORequestOperation(Constraints.EXCHANGIS_APPCONN_NAME); + } + + @Override + protected RefExecutionAction submit(ExecutionRequestRef executionRequestRef) { + try { + return new ExchangisAsyncRefExecutionOperation().execute(executionRequestRef, developmentService.getAppInstance().getBaseUrl(), ssoRequestOperation, developmentService); + } catch (ExternalOperationFailedException e) { + LOG.error("submit execute job failed: {}", e.getMessage()); + } + return null; + } + + @Override + public RefExecutionState state(RefExecutionAction refExecutionAction) { + try { + return new ExchangisAsyncRefExecutionOperation().state(refExecutionAction, developmentService.getAppInstance().getBaseUrl(), ssoRequestOperation); + } catch (ExternalOperationFailedException e) { + LOG.error("getting execute job state failed: {}", e.getMessage()); + } + return null; + } + + @Override + public CompletedExecutionResponseRef result(RefExecutionAction refExecutionAction) { + try { + return new ExchangisAsyncRefExecutionOperation().result(refExecutionAction, developmentService.getAppInstance().getBaseUrl(), ssoRequestOperation); + } catch (ExternalOperationFailedException e) { + LOG.error("getting execute job resulted failed: {}", e.getMessage()); + } + return null; + } + + @Override + public ResponseRef execute(ExecutionRequestRef executionRequestRef) { + AsyncExecutionRequestRef asyncExecutionRequestRef = (AsyncExecutionRequestRef) executionRequestRef; + String nodeType = asyncExecutionRequestRef.getExecutionRequestRefContext().getRuntimeMap().get("nodeType").toString().toLowerCase().trim(); + LOG.info("nodeType:{}", nodeType); + String nodeName = Constraints.ENGINE_TYPE_SQOOP_NAME; + LOG.info("nodeName:{}", nodeName); + if (Constraints.NODE_TYPE_SQOOP.equalsIgnoreCase("linkis.appconn." + nodeType)) { + try { + return executeAsyncOpt(asyncExecutionRequestRef); + } catch (ExternalOperationFailedException e) { + asyncExecutionRequestRef.getExecutionRequestRefContext().appendLog(e.getMessage()); + LOG.error("Async execute sqoop node failed", e); + } + } else { + return executeSyncOpt(executionRequestRef, nodeName); + } + return null; + } + + /** + * 执行异步操作 + * + * @param requestRef + * @return + */ + private ResponseRef executeAsyncOpt(ExecutionRequestRef requestRef) throws ExternalOperationFailedException { + + ExchangisOptStrategy sqoopStrategy = (ExchangisOptStrategy) ModuleFactory.getInstance().crateModule(Constraints.ENGINE_TYPE_SQOOP_NAME); + AsyncExecutionRequestRef asyncExecutionRequestRef = (AsyncExecutionRequestRef) requestRef; + + //任务发布 + RefExecutionAction action = submit(requestRef); + ExchangisExecutionAction sqoopAction = null; + if (action instanceof ExchangisExecutionAction) { + sqoopAction = (ExchangisExecutionAction) action; + } + if (action instanceof AbstractRefExecutionAction) { + ((AbstractRefExecutionAction) action).setExecutionRequestRefContext(createExecutionRequestRefContext(requestRef)); + } + //获取任务状态 + RefExecutionState state = state(sqoopAction); + LOG.info("Now state is: {}", state.getStatus()); + if (state != null && state.isCompleted()) { + //获取结果集 + CompletedExecutionResponseRef response = result(sqoopAction); + return response; + } else { + AsyncExecutionResponseRef response = createAsyncResponseRef(requestRef, action); + response.setRefExecution(this); + if (scheduler != null) { + scheduler.addAsyncResponse(response); + } + return response; + } + + } + + /** + * 执行同步操作 + * + * @param ref + * @param nodeName + * @return + */ + private ResponseRef executeSyncOpt(ExecutionRequestRef ref, String nodeName) { + AsyncExecutionRequestRef asyncExecutionRequestRef = (AsyncExecutionRequestRef) ref; + try { + return ModuleFactory.getInstance().crateModule(nodeName).executeRef(asyncExecutionRequestRef, developmentService.getAppInstance().getBaseUrl(), ssoRequestOperation); + } catch (ExternalOperationFailedException e) { + LOG.error("execute " + nodeName + " failed", e); + } + return null; + + } + + @Override + public void setDevelopmentService(DevelopmentService developmentService) { + this.developmentService = developmentService; + } + + @Override + public boolean kill(RefExecutionAction refExecutionAction) { + return new ExchangisAsyncRefExecutionOperation().kill(developmentService.getAppInstance().getBaseUrl(), ssoRequestOperation, refExecutionAction); + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefQueryOperation.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefQueryOperation.java new file mode 100644 index 000000000..bf4cd6084 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefQueryOperation.java @@ -0,0 +1,59 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.ref; + +import com.webank.wedatasphere.dss.common.utils.DSSCommonUtils; +import com.webank.wedatasphere.dss.standard.app.development.operation.RefQueryOperation; +import com.webank.wedatasphere.dss.standard.app.development.ref.OpenRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.service.DevelopmentService; +import com.webank.wedatasphere.dss.standard.common.entity.ref.ResponseRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisOpenRequestRef; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisOpenResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.utils.AppConnUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.Map; + +/** + * Ref query operation + */ +public class ExchangisRefQueryOperation extends AbstractExchangisRefOperation implements RefQueryOperation { + private final static Logger LOG = LoggerFactory.getLogger(ExchangisRefQueryOperation.class); + + private DevelopmentService developmentService; + + public ExchangisRefQueryOperation(DevelopmentService developmentService){ + this.developmentService = developmentService; + setSSORequestService(developmentService); + } + @Override + public ResponseRef query(OpenRequestRef openRequestRef) throws ExternalOperationFailedException { + // Note: dss will scan the AppConn package to new the ExchangisOpenRequestRef + ExchangisOpenRequestRef exchangisOpenRequestRef = (ExchangisOpenRequestRef) openRequestRef; + try { + LOG.info("ExchangisOpenRequestRef getJobContent: {}", exchangisOpenRequestRef.getJobContent()); + Integer id = AppConnUtils.resolveParam(exchangisOpenRequestRef.getJobContent(), Constraints.REF_JOB_ID, Integer.class); + String labels = (String) exchangisOpenRequestRef.getJobContent().get(Constraints.REF_JOB_LABELS); + LOG.info("Job labels is : {}", labels); + String jumpUrl = pageUrl(Constraints.REF_JUMP_URL_FORMAT + "?id=" + id + "&labels=" + labels); + Map retMap = new HashMap<>(); + LOG.info("ExchangisOpenResponseRef jump url: {}", jumpUrl); + retMap.put("jumpUrl", jumpUrl); + return new ExchangisOpenResponseRef(DSSCommonUtils.COMMON_GSON.toJson(retMap),0); + } catch (Exception e) { + throw new ExternalOperationFailedException(31022, "Failed to parse jobContent ", e); + } + } + + @Override + public void setDevelopmentService(DevelopmentService developmentService) { + this.developmentService = developmentService; + } + + @Override + protected Logger getLogger() { + return LOG; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefUpdateOperation.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefUpdateOperation.java new file mode 100644 index 000000000..4e886f16c --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ExchangisRefUpdateOperation.java @@ -0,0 +1,80 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.ref; + +import com.webank.wedatasphere.dss.standard.app.development.operation.RefUpdateOperation; +import com.webank.wedatasphere.dss.standard.app.development.ref.NodeRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.ref.UpdateRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.service.DevelopmentService; +import com.webank.wedatasphere.dss.standard.app.sso.builder.SSOUrlBuilderOperation; +import com.webank.wedatasphere.dss.standard.app.sso.request.SSORequestOperation; +import com.webank.wedatasphere.dss.standard.common.entity.ref.ResponseRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.ExchangisCommonResponseDef; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisEntityPutAction; +import com.webank.wedatasphere.exchangis.dss.appconn.request.action.ExchangisPutAction; +import com.webank.wedatasphere.exchangis.dss.appconn.ref.AbstractExchangisResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.request.entity.RefJobReqEntity; +import com.webank.wedatasphere.exchangis.dss.appconn.response.result.ExchangisEntityRespResult; +import com.webank.wedatasphere.exchangis.dss.appconn.utils.AppConnUtils; +import org.apache.linkis.httpclient.response.HttpResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Map; +import java.util.Objects; + +/** + * Ref update operation + */ +public class ExchangisRefUpdateOperation extends AbstractExchangisRefOperation implements RefUpdateOperation { + private final static Logger LOG = LoggerFactory.getLogger(ExchangisRefUpdateOperation.class); + + DevelopmentService developmentService; + + public ExchangisRefUpdateOperation(DevelopmentService developmentService){ + this.developmentService = developmentService; + setSSORequestService(developmentService); + } + + @Override + public ResponseRef updateRef(UpdateRequestRef updateRequestRef) throws ExternalOperationFailedException { + NodeRequestRef nodeRequestRef = (NodeRequestRef) updateRequestRef; + ResponseRef responseRef = null; + if(Constraints.NODE_TYPE_SQOOP.equalsIgnoreCase(nodeRequestRef.getNodeType())){ + responseRef = updateOffLineRequest(nodeRequestRef, Constraints.ENGINE_TYPE_SQOOP_NAME); + }else if(Constraints.NODE_TYPE_DATAX.equalsIgnoreCase(nodeRequestRef.getNodeType())){ + responseRef = updateOffLineRequest(nodeRequestRef, Constraints.NODE_TYPE_DATAX); + } + return responseRef; + } + + private ResponseRef updateOffLineRequest(NodeRequestRef nodeRequestRef, String engineType) throws ExternalOperationFailedException{ + Integer id = AppConnUtils.resolveParam(nodeRequestRef.getJobContent(), Constraints.REF_JOB_ID, Integer.class); + LOG.info("update {} job request => id: {}, jobContent:{}", id, engineType, nodeRequestRef.getJobContent()); + String url = requestURL("/appJob/" + id); + ExchangisEntityRespResult.BasicMessageEntity> entity = requestToGetEntity(url, nodeRequestRef.getWorkspace(), nodeRequestRef, + (requestRef) -> { + // Build ref update action + RefJobReqEntity jobReqEntity = getRefJobReqEntity(requestRef, engineType); + jobReqEntity.setId(Long.valueOf(id)); + return new ExchangisEntityPutAction<>(jobReqEntity, requestRef.getUserName()); + }, Map.class); + if (Objects.isNull(entity)){ + throw new ExternalOperationFailedException(31020, "The response entity cannot be empty", null); + } + ExchangisEntityRespResult httpResult = entity.getResult(); + LOG.info("update {} job response => id: {}, status: {}, response: {}", engineType, id, httpResult.getStatusCode(), + httpResult.getResponseBody()); + return new ExchangisCommonResponseDef(httpResult); + } + + @Override + public void setDevelopmentService(DevelopmentService developmentService) { + this.developmentService = developmentService; + } + + @Override + protected Logger getLogger() { + return LOG; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ModuleFactory.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ModuleFactory.java new file mode 100644 index 000000000..bd637d722 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/operation/ref/ModuleFactory.java @@ -0,0 +1,46 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.operation.ref; + + +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.OperationStrategy; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.impl.ExchangisOptStrategy; +import org.apache.commons.lang.StringUtils; + +import java.util.HashMap; +import java.util.Map; + +public class ModuleFactory { + private volatile static ModuleFactory factory; + private static Map map = new HashMap<>(); + + static { + map.put(Constraints.ENGINE_TYPE_SQOOP_NAME, new ExchangisOptStrategy()); + } + + private ModuleFactory() { + } + + + public OperationStrategy crateModule(String name) throws ExternalOperationFailedException { + if (StringUtils.isEmpty(name) || !map.containsKey(name)) { + throw new ExternalOperationFailedException(90177, "create module failed,Unknown task type: " + name, null); + } + return map.get(name); + } + + + public static ModuleFactory getInstance() { + if (factory == null) { + synchronized (ModuleFactory.class) { + if (factory == null) { + factory = new ModuleFactory(); + } + } + } + + return factory; + } + + +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/AbstractExchangisResponseRef.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/AbstractExchangisResponseRef.java new file mode 100644 index 000000000..3c2da6031 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/AbstractExchangisResponseRef.java @@ -0,0 +1,42 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.ref; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.webank.wedatasphere.dss.standard.common.entity.ref.AbstractResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.response.result.ExchangisEntityRespResult; +import org.apache.linkis.server.BDPJettyServerHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Collections; +import java.util.Map; + +/** + * Abstract response ref + */ +public abstract class AbstractExchangisResponseRef extends AbstractResponseRef { + private static final Logger LOG = LoggerFactory.getLogger(AbstractExchangisResponseRef.class); + protected AbstractExchangisResponseRef(String responseBody, int status) { + super(responseBody, status); + } + + public AbstractExchangisResponseRef(ExchangisEntityRespResult result){ + super(result.getResponseBody(), result.getStatusCode()); + } + @Override + @SuppressWarnings("unchecked") + public Map toMap() { + try { + responseMap = BDPJettyServerHelper.jacksonJson().readValue(responseBody, Map.class); + } catch (JsonProcessingException e) { + LOG.warn("Fail to convert the response body {} to map", responseBody); + return Collections.emptyMap(); + } + return responseMap; + } + + @Override + public String getErrorMsg() { + return errorMsg; + } + +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisCommonResponseDef.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisCommonResponseDef.java new file mode 100644 index 000000000..120d0d860 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisCommonResponseDef.java @@ -0,0 +1,17 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.ref; + +import com.webank.wedatasphere.exchangis.dss.appconn.response.result.ExchangisEntityRespResult; + +/** + * Common response ref + */ +public class ExchangisCommonResponseDef extends AbstractExchangisResponseRef{ + + protected ExchangisCommonResponseDef(String responseBody, int status) { + super(responseBody, status); + } + + public ExchangisCommonResponseDef(ExchangisEntityRespResult result) { + super(result); + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisCompletedExecutionResponseRef.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisCompletedExecutionResponseRef.java new file mode 100644 index 000000000..07ab8de79 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisCompletedExecutionResponseRef.java @@ -0,0 +1,13 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.ref; + +import com.webank.wedatasphere.dss.standard.app.development.listener.common.CompletedExecutionResponseRef; + +public class ExchangisCompletedExecutionResponseRef extends CompletedExecutionResponseRef { + public ExchangisCompletedExecutionResponseRef(int status) { + super(status); + } + + public ExchangisCompletedExecutionResponseRef(String responseBody, int status) { + super(responseBody, status); + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisCopyRequestRef.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisCopyRequestRef.java new file mode 100644 index 000000000..4880e5675 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisCopyRequestRef.java @@ -0,0 +1,20 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.ref; + +import com.webank.wedatasphere.dss.standard.app.development.ref.CopyRequestRef; +import com.webank.wedatasphere.dss.standard.app.sso.Workspace; +import com.webank.wedatasphere.dss.standard.common.entity.ref.AbstractRequestRef; + +/** + * @author tikazhang + * @Date 2022/4/24 10:59 + */ +public class ExchangisCopyRequestRef extends AbstractRequestRef implements CopyRequestRef { + + private Workspace workspace; + + @Override + public void setWorkspace(Workspace workspace) { this.workspace = workspace; } + + @Override + public Workspace getWorkspace() { return this.workspace; } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisCopyResponseRef.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisCopyResponseRef.java new file mode 100644 index 000000000..bdf4e130e --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisCopyResponseRef.java @@ -0,0 +1,23 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.ref; + +import com.webank.wedatasphere.dss.standard.app.development.ref.DSSCommonResponseRef; + +import java.util.Map; + +/** + * @author tikazhang + * @Date 2022/4/24 12:52 + */ +public class ExchangisCopyResponseRef extends DSSCommonResponseRef { + private Map newJobContent; + + public ExchangisCopyResponseRef(Map jobContent, String responseBody) throws Exception { + super(responseBody); + this.newJobContent = jobContent; + } + + @Override + public Map toMap() { + return newJobContent; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisExportResponseRef.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisExportResponseRef.java new file mode 100644 index 000000000..017e1d610 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisExportResponseRef.java @@ -0,0 +1,29 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.ref; + +import com.webank.wedatasphere.dss.standard.common.entity.ref.CommonResponseRef; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.ref.ExchangisExportOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Map; + +/** + * @author tikazhang + * @Date 2022/3/9 17:39 + */ +public class ExchangisExportResponseRef extends CommonResponseRef { + + private final static Logger LOG = LoggerFactory.getLogger(ExchangisExportResponseRef.class); + + Map bmlResource; + + public ExchangisExportResponseRef(String responseBody) throws Exception { + super(responseBody, 0); + LOG.info("responseBody123: {}", responseBody); + LOG.info("responseMap123: {}", responseMap.toString()); + bmlResource = ((Map) responseMap.get("data")); + } + + @Override + public Map toMap() {return bmlResource;} +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisImportResponseRef.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisImportResponseRef.java new file mode 100644 index 000000000..d15080d29 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisImportResponseRef.java @@ -0,0 +1,41 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.ref; + +import com.google.common.collect.Maps; +import com.webank.wedatasphere.dss.standard.common.entity.ref.CommonResponseRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; + +import java.util.Map; + +/** + * @author tikazhang + * @Date 2022/3/9 23:01 + */ +public class ExchangisImportResponseRef extends CommonResponseRef { + + Map newJobContent = Maps.newHashMap(); + + public ExchangisImportResponseRef(Map jobContent, String responseBody, String nodeType) throws Exception { + super(responseBody, 0); + if (!Constraints.NODE_TYPE_SQOOP.equalsIgnoreCase(nodeType) && !Constraints.NODE_TYPE_DATAX.equalsIgnoreCase(nodeType)) { + throw new ExternalOperationFailedException(90177, "Unknown task type" + nodeType, null); + } + Map data = (Map)responseMap.get("data"); + Map realNode = (Map)data.get("sqoop"); + double newId = 0; + for (Map.Entry entry : realNode.entrySet()) { + newId = Double.parseDouble(entry.getValue().toString()); + if (newId != 0) { + break; + } + } + Map jobContentData = (Map)jobContent.get("data"); + jobContentData.put("id", newId); + jobContent.put("data", jobContentData); + this.newJobContent = jobContent; + } + + @Override + public Map toMap() {return newJobContent;} + +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisOpenRequestRef.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisOpenRequestRef.java new file mode 100644 index 000000000..31916f9d6 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisOpenRequestRef.java @@ -0,0 +1,28 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.ref; + +import com.webank.wedatasphere.dss.standard.app.development.ref.OpenRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.ref.impl.CommonRequestRefImpl; + +import java.util.Map; + +/** + * Open request ref + */ +public class ExchangisOpenRequestRef extends CommonRequestRefImpl implements OpenRequestRef { + @Override + @SuppressWarnings("unchecked") + public String getName() { + return ((Map)this.getParameters().get("params")).get("title").toString(); + } + + @Override + @SuppressWarnings("unchecked") + public String getType() { + return ((Map)this.getParameters().get("node")).get("nodeType").toString(); + } + + @SuppressWarnings("unchecked") + public Map getJobContent() { + return ((Map)this.getParameters().get("params")); + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisOpenResponseRef.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisOpenResponseRef.java new file mode 100644 index 000000000..a1ee802cf --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisOpenResponseRef.java @@ -0,0 +1,22 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.ref; + +import com.webank.wedatasphere.dss.standard.app.development.ref.CommonResponseRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.utils.ExchangisNodeUtils; + +/** + * Ref open response + */ +public class ExchangisOpenResponseRef extends CommonResponseRef { + public ExchangisOpenResponseRef(String responseBody, int status) { + super(responseBody, status); + } + + public String getSqoopId() throws ExternalOperationFailedException { + return ExchangisNodeUtils.getSqoopId(responseBody); + } + + public String getDataxId() throws ExternalOperationFailedException { + return ExchangisNodeUtils.getDataxId(responseBody); + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisProjectResponseRef.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisProjectResponseRef.java new file mode 100644 index 000000000..4f50d9b0a --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/ref/ExchangisProjectResponseRef.java @@ -0,0 +1,59 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.ref; + +import com.google.common.collect.Maps; +import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectResponseRef; +import com.webank.wedatasphere.dss.standard.common.desc.AppInstance; +import com.webank.wedatasphere.exchangis.dss.appconn.response.result.ExchangisEntityRespResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Map; + +/** + * Response ref + */ +public class ExchangisProjectResponseRef extends AbstractExchangisResponseRef implements ProjectResponseRef { + private static final Logger LOG = LoggerFactory.getLogger(ExchangisProjectResponseRef.class); + private Long projectRefId; + private AppInstance appInstance; + + public ExchangisProjectResponseRef(ExchangisEntityRespResult result, + Long projectId){ + super(result.getResponseBody(), result.getStatusCode()); + this.projectRefId = projectId; + } + + public ExchangisProjectResponseRef(String responseBody, + int status){ + super(responseBody, status); + } + + @Override + public Long getProjectRefId() { + return projectRefId; + } + + @Override + public Map getProjectRefIds() { + Map projectRefIdsMap = Maps.newHashMap(); + projectRefIdsMap.put(appInstance, projectRefId); + return projectRefIdsMap; + } + + + public void setProjectRefId(Long projectRefId) { + this.projectRefId = projectRefId; + } + + public AppInstance getAppInstance() { + return appInstance; + } + + public void setAppInstance(AppInstance appInstance) { + this.appInstance = appInstance; + } + + public void setErrorMsg(String errorMsg) { + this.errorMsg = errorMsg; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisDeleteAction.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisDeleteAction.java new file mode 100644 index 000000000..8688d84fd --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisDeleteAction.java @@ -0,0 +1,45 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.request.action; + + +import org.apache.linkis.httpclient.request.DeleteAction; +import org.apache.linkis.httpclient.request.UserAction; + +/** + * Delete action + */ +public class ExchangisDeleteAction extends DeleteAction implements HttpExtAction, UserAction { + + /** + * URL + */ + String url; + + String user; + + public ExchangisDeleteAction(){ + + } + + public ExchangisDeleteAction(String user){ + this.user = user; + } + @Override + public String getURL() { + return url; + } + + @Override + public void setUrl(String url) { + this.url = url; + } + + @Override + public void setUser(String user) { + this.user = user; + } + + @Override + public String getUser() { + return user; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisEntityPostAction.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisEntityPostAction.java new file mode 100644 index 000000000..746e08548 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisEntityPostAction.java @@ -0,0 +1,98 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.request.action; + +import com.fasterxml.jackson.core.JsonProcessingException; +import org.apache.linkis.httpclient.request.POSTAction; +import org.apache.linkis.httpclient.request.UserAction; +import org.apache.linkis.server.BDPJettyServerHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.Objects; + +/** + * Entity post action + * @param + */ +public class ExchangisEntityPostAction extends POSTAction implements HttpExtAction, UserAction { + + private static final Logger LOG = LoggerFactory.getLogger(ExchangisEntityPostAction.class); + + /** + * URL + */ + private String url; + + private String user; + + private HashMap queryParams; + /** + * Entity to post request + */ + private T postEntity; + + public ExchangisEntityPostAction(){ + + } + + public ExchangisEntityPostAction(T postEntity){ + this.postEntity = postEntity; + } + + public ExchangisEntityPostAction(T postEntity, String user){ + this.postEntity = postEntity; + this.user = user; + } + + public HashMap getQueryParams() { + return queryParams; + } + + public void setQueryParams(HashMap queryParams) { + this.queryParams = queryParams; + } + + @Override + public String getURL() { + return url; + } + + @Override + public String getRequestPayload() { + String requestPayLoad = ""; + try { + if (Objects.nonNull(postEntity)) { + requestPayLoad = BDPJettyServerHelper.jacksonJson().writeValueAsString(postEntity); + } else { + requestPayLoad = BDPJettyServerHelper.jacksonJson().writeValueAsString(getRequestPayloads()); + } + }catch (JsonProcessingException e) { + LOG.error("Failed to covert entity/request payload to a string", e); + } + return requestPayLoad; + } + + @Override + public void setUser(String user) { + this.user = user; + } + + @Override + public String getUser() { + return this.user; + } + + @Override + public void setUrl(String url) { + this.url = url; + } + + public T getPostEntity() { + return postEntity; + } + + public void setPostEntity(T postEntity) { + this.postEntity = postEntity; + } + +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisEntityPutAction.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisEntityPutAction.java new file mode 100644 index 000000000..d8c1f9c8f --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisEntityPutAction.java @@ -0,0 +1,50 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.request.action; + +import org.apache.linkis.httpclient.request.PutAction; +import org.apache.linkis.httpclient.request.UserAction; + +/** + * Actual contains a post action + * @param + */ +public class ExchangisEntityPutAction extends PutAction implements HttpExtAction, UserAction { + /** + * Inner action + */ + private ExchangisEntityPostAction postAction; + + public ExchangisEntityPutAction(){ + postAction = new ExchangisEntityPostAction<>(); + } + + public ExchangisEntityPutAction(T entity){ + postAction = new ExchangisEntityPostAction<>(entity); + } + public ExchangisEntityPutAction(T entity, String user){ + postAction = new ExchangisEntityPostAction<>(entity, user); + } + @Override + public String getURL() { + return postAction.getURL(); + } + + @Override + public String getRequestPayload() { + return postAction.getRequestPayload(); + } + + @Override + public void setUser(String user) { + postAction.setUser(user); + } + + @Override + public String getUser() { + return postAction.getUser(); + } + + @Override + public void setUrl(String url) { + postAction.setUrl(url); + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisExecutionAction.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisExecutionAction.java new file mode 100644 index 000000000..a50731801 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisExecutionAction.java @@ -0,0 +1,51 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.request.action; + +import com.webank.wedatasphere.dss.standard.app.development.listener.common.AbstractRefExecutionAction; +import com.webank.wedatasphere.dss.standard.app.development.listener.common.LongTermRefExecutionAction; +import com.webank.wedatasphere.dss.standard.app.development.listener.common.RefExecutionState; +import com.webank.wedatasphere.dss.standard.app.development.ref.ExecutionRequestRef; + +/** + * @author tikazhang + * @Date 2022/4/29 16:25 + */ +public class ExchangisExecutionAction extends AbstractRefExecutionAction implements LongTermRefExecutionAction { + private RefExecutionState _state; + private int schedulserId; + private String _execId; + private ExecutionRequestRef requestRef; + + public RefExecutionState get_state() { + return _state; + } + + public void set_state(RefExecutionState _state) { + this._state = _state; + } + + public String get_execId() { + return _execId; + } + + public void set_execId(String _execId) { + this._execId = _execId; + } + + public ExecutionRequestRef getRequestRef() { + return requestRef; + } + + public void setRequestRef(ExecutionRequestRef requestRef) { + this.requestRef = requestRef; + } + + @Override + public void setSchedulerId(int schedulserId) { + this.schedulserId = schedulserId; + } + + @Override + public int getSchedulerId() { + return schedulserId; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisGetAction.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisGetAction.java new file mode 100644 index 000000000..84445fb45 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisGetAction.java @@ -0,0 +1,30 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.request.action; + + +import org.apache.linkis.httpclient.request.GetAction; +import org.apache.linkis.httpclient.request.UserAction; + +public class ExchangisGetAction extends GetAction implements HttpExtAction, UserAction { + String url; + String user; + + @Override + public String getURL() { + return url; + } + + @Override + public void setUrl(String url) { + this.url = url; + } + + @Override + public void setUser(String user) { + this.user = user; + } + + @Override + public String getUser() { + return user; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisPostAction.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisPostAction.java new file mode 100644 index 000000000..326248719 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisPostAction.java @@ -0,0 +1,44 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.request.action; + +import com.fasterxml.jackson.core.JsonProcessingException; +import org.apache.linkis.httpclient.request.POSTAction; +import org.apache.linkis.httpclient.request.UserAction; +import org.apache.linkis.server.BDPJettyServerHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ExchangisPostAction extends POSTAction implements UserAction { + + private static final Logger LOGGER = LoggerFactory.getLogger(ExchangisPostAction.class); + String url; + String user; + + @Override + public String getRequestPayload() { + try { + return BDPJettyServerHelper.jacksonJson().writeValueAsString(getRequestPayloads()); + } catch (JsonProcessingException e) { + LOGGER.error("failed to covert {} to a string", getRequestPayloads(), e); + return ""; + } + } + + @Override + public String getURL() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + @Override + public void setUser(String user) { + this.user = user; + } + + @Override + public String getUser() { + return user; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisPutAction.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisPutAction.java new file mode 100644 index 000000000..94d956886 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/ExchangisPutAction.java @@ -0,0 +1,44 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.request.action; + +import com.fasterxml.jackson.core.JsonProcessingException; +import org.apache.linkis.httpclient.request.PutAction; +import org.apache.linkis.httpclient.request.UserAction; +import org.apache.linkis.server.BDPJettyServerHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ExchangisPutAction extends PutAction implements UserAction { + + private static final Logger LOGGER = LoggerFactory.getLogger(ExchangisPutAction.class); + String url; + String user; + + @Override + public String getRequestPayload() { + try { + return BDPJettyServerHelper.jacksonJson().writeValueAsString(getRequestPayloads()); + } catch (JsonProcessingException e) { + LOGGER.error("failed to covert {} to a string", getRequestPayloads(), e); + return ""; + } + } + + @Override + public String getURL() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + @Override + public void setUser(String user) { + this.user = user; + } + + @Override + public String getUser() { + return user; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/HttpExtAction.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/HttpExtAction.java new file mode 100644 index 000000000..2eb2cb0d9 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/action/HttpExtAction.java @@ -0,0 +1,15 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.request.action; + +import org.apache.linkis.httpclient.request.HttpAction; + +/** + * Extension http action + */ +public interface HttpExtAction extends HttpAction { + + /** + * Set url + * @param url url path + */ + void setUrl(String url); +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/entity/ProjectReqEntity.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/entity/ProjectReqEntity.java new file mode 100644 index 000000000..02b6bcca8 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/entity/ProjectReqEntity.java @@ -0,0 +1,138 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.request.entity; + +import com.webank.wedatasphere.exchangis.dss.appconn.constraints.Constraints; + +import java.util.HashMap; +import java.util.Map; + +/** + * Request entity of project + */ +public class ProjectReqEntity { + + private Long id; + + private String projectName; + + private String description; + + /** + * Request domain + */ + private String domain = Constraints.DOMAIN_NAME; + /** + * Information from the dss + */ + private Map source = new HashMap<>(); + + /** + * User has the edit permission + */ + private String editUsers; + + /** + * User has the view permission + */ + private String viewUsers; + + /** + * User has the execute permission + */ + private String execUsers; + + /** + * labels + */ + private String labels; + + public ProjectReqEntity(){ + + } + + public ProjectReqEntity(String owner, String projectName, String description, Map source){ + this.projectName = projectName; + this.description = description; + this.source = source; + setEditUsers(owner); + setViewUsers(owner); + setExecUsers(owner); + } + + public ProjectReqEntity(Long id, String editUsers, String viewUsers, String execUsers, String projectName, String description, Map source){ + this.id = id; + this.projectName = projectName; + this.description = description; + this.source = source; + setEditUsers(editUsers); + setViewUsers(viewUsers); + setExecUsers(execUsers); + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Map getSource() { + return source; + } + + public void setSource(Map source) { + this.source = source; + } + + public String getEditUsers() { + return editUsers; + } + + public void setEditUsers(String editUsers) { + this.editUsers = editUsers; + } + + public String getViewUsers() { + return viewUsers; + } + + public void setViewUsers(String viewUsers) { + this.viewUsers = viewUsers; + } + + public String getExecUsers() { + return execUsers; + } + + public void setExecUsers(String execUsers) { + this.execUsers = execUsers; + } + + public String getDomain() { + return domain; + } + + public String getLabels() { + return labels; + } + + public void setLabels(String labels) { + this.labels = labels; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/entity/RefJobReqEntity.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/entity/RefJobReqEntity.java new file mode 100644 index 000000000..a2f7df877 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/request/entity/RefJobReqEntity.java @@ -0,0 +1,118 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.request.entity; + +import java.util.HashMap; +import java.util.Map; + +/** + * Ref job entity + */ +public class RefJobReqEntity { + + private Long id; + /** + * Project id in thirty system + */ + private Long projectId; + + /** + * Job type + */ + private String jobType; + + /** + * Engine Type + */ + private String engineType; + + /** + * Job labels + */ + private String jobLabels; + + /** + * Job description + */ + private String jobDesc; + + /** + * Job name + */ + private String jobName; + + private Map source = new HashMap<>();; + public RefJobReqEntity(String jobName, String jobDesc, + String jobType, String engineType, + Long projectId){ + this.jobName = jobName; + this.jobDesc = jobDesc; + this.jobType = jobType; + this.engineType = engineType; + this.projectId = projectId; + } + public RefJobReqEntity(){ + + } + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + public String getJobType() { + return jobType; + } + + public void setJobType(String jobType) { + this.jobType = jobType; + } + + public String getEngineType() { + return engineType; + } + + public void setEngineType(String engineType) { + this.engineType = engineType; + } + + public String getJobLabels() { + return jobLabels; + } + + public void setJobLabels(String jobLabels) { + this.jobLabels = jobLabels; + } + + public String getJobDesc() { + return jobDesc; + } + + public void setJobDesc(String jobDesc) { + this.jobDesc = jobDesc; + } + + public String getJobName() { + return jobName; + } + + public void setJobName(String jobName) { + this.jobName = jobName; + } + + public Map getSource() { + return source; + } + + public void setSource(Map source) { + this.source = source; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/response/entity/ProjectRespEntity.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/response/entity/ProjectRespEntity.java new file mode 100644 index 000000000..0a2c2f864 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/response/entity/ProjectRespEntity.java @@ -0,0 +1,4 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.response.entity; + +public class ProjectRespEntity { +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/response/result/ExchangisEntityRespResult.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/response/result/ExchangisEntityRespResult.java new file mode 100644 index 000000000..a97b84e74 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/response/result/ExchangisEntityRespResult.java @@ -0,0 +1,191 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.response.result; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.utils.JsonExtension; +import org.apache.commons.lang.StringUtils; +import org.apache.linkis.httpclient.response.HttpResult; + +import java.util.Objects; + +/** + * Convert the response body of http result to entity + */ + +public class ExchangisEntityRespResult implements HttpResult { + + /** + * Result held inner + */ + private HttpResult result; + + public ExchangisEntityRespResult(HttpResult result) throws ExternalOperationFailedException { + this.result = result; + int statusCode = result.getStatusCode(); + if (statusCode != 200){ + throw new ExternalOperationFailedException(-1, "The response result has wrong status code: [" + + result.getStatusCode() + "], response body: [" + result.getResponseBody() + "]", null); + } + } + + @Override + public String getContentType() { + return result.getContentType(); + } + + @Override + public String getUri() { + return result.getUri(); + } + + @Override + public int getStatusCode() { + return result.getStatusCode(); + } + + @Override + public void set(String responseBody, int statusCode, String url, String contentType) { + this.set(responseBody, statusCode, url, contentType); + } + + @Override + public String getResponseBody() { + return this.result.getResponseBody(); + } + + /** + * Get the entity from the response body + * @return entity + */ + public BasicMessageEntity getEntity(Class mainClass, Class... parameters) throws ExternalOperationFailedException { + String responseBody = this.result.getResponseBody(); + ObjectMapper mapper = JsonExtension.getMapper(); + Class[] parametricClass = new Class[parameters.length + 1]; + parametricClass[0] = mainClass; + if (parameters.length > 0){ + System.arraycopy(parameters, 0, parametricClass, 1, parameters.length); + } + if (StringUtils.isNotBlank(responseBody)){ + try { + BasicMessageEntity messageEntity = mapper.readValue(responseBody, mapper.getTypeFactory().constructParametricType(BasicMessageEntity.class, parametricClass)); + if (messageEntity.getStatus() != 0){ + throw new ExternalOperationFailedException(-1, "The status in Response message entity is " + + "" + messageEntity.getStatus() + ", message: [" + messageEntity.getMessage() +"]", null); + } + messageEntity.result = this; + return messageEntity; + } catch (JsonProcessingException e) { + throw new ExternalOperationFailedException(3130, "Fail to convert the response body: [" + responseBody + + "] to message entity, entity: [" + mainClass.getSimpleName() + "]", e); + } + } + return null; + + } + + public T getEntityValue(Class mainClass, Class... parameters) throws ExternalOperationFailedException{ + BasicMessageEntity entity = getEntity(mainClass, parameters); + return Objects.nonNull(entity)? entity.getData() : null; + } + public static class BasicMessageEntity{ + /** + * Result status + */ + private Integer status = 0; + + /** + * Refer request method(uri) + */ + private String method; + + /** + * Error message + */ + private String message; + + /** + * Actual entity + */ + private T data; + + private String title; + + private String desc; + + private String labels; + + private Object workspace; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getLabels() { + return labels; + } + + public void setLabels(String labels) { + this.labels = labels; + } + + public Object getWorkspace() { + return workspace; + } + + public void setWorkspace(Object workspace) { + this.workspace = workspace; + } + + private ExchangisEntityRespResult result; + + public ExchangisEntityRespResult getResult() { + return result; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getMethod() { + return method; + } + + public void setMethod(String method) { + this.method = method; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } + } + +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisProjectService.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisProjectService.java new file mode 100644 index 000000000..d1ba5288d --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisProjectService.java @@ -0,0 +1,49 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.service; + +import com.webank.wedatasphere.dss.standard.app.structure.project.*; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.project.ExchangisProjectCreationOperation; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.project.ExchangisProjectDeletionOperation; +//import com.webank.wedatasphere.exchangis.dss.appconn.operation.project.ExchangisProjectGetOperation; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.project.ExchangisProjectUpdateOperation; + +/** + * Project service implement + */ +public class ExchangisProjectService extends ProjectService { + + @Override + public boolean isCooperationSupported() { + return true; + } + + @Override + public boolean isProjectNameUnique() { + return false; + } + + @Override + protected ProjectCreationOperation createProjectCreationOperation() { + return new ExchangisProjectCreationOperation(this); + } + + @Override + protected ProjectUpdateOperation createProjectUpdateOperation() { + return new ExchangisProjectUpdateOperation(this); + } + + @Override + protected ProjectDeletionOperation createProjectDeletionOperation() { + return new ExchangisProjectDeletionOperation(this); + } + + /* @Override + protected ProjectGetOperation createProjectGetOperation() { + return null; + //return new ExchangisProjectGetOperation(this); + }*/ + + @Override + protected ProjectUrlOperation createProjectUrlOperation() { + return null; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisRefCRUDService.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisRefCRUDService.java new file mode 100644 index 000000000..fe34bfce9 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisRefCRUDService.java @@ -0,0 +1,44 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.service; + +import com.webank.wedatasphere.dss.standard.app.development.operation.RefCopyOperation; +import com.webank.wedatasphere.dss.standard.app.development.operation.RefCreationOperation; +import com.webank.wedatasphere.dss.standard.app.development.operation.RefDeletionOperation; +import com.webank.wedatasphere.dss.standard.app.development.operation.RefUpdateOperation; +import com.webank.wedatasphere.dss.standard.app.development.ref.CopyRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.ref.CreateRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.ref.DeleteRequestRef; +import com.webank.wedatasphere.dss.standard.app.development.service.AbstractRefCRUDService; +import com.webank.wedatasphere.dss.standard.common.entity.ref.RequestRef; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.ref.ExchangisRefCopyOperation; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.ref.ExchangisRefCreationOperation; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.ref.ExchangisRefDeletionOperation; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.ref.ExchangisRefUpdateOperation; + +/** + * Ref CRUD service + */ +public class ExchangisRefCRUDService extends AbstractRefCRUDService { + + @Override + @SuppressWarnings("unchecked") + protected RefCreationOperation createRefCreationOperation() { + return (RefCreationOperation) new ExchangisRefCreationOperation(this); + } + + @Override + protected RefCopyOperation createRefCopyOperation() { + return (RefCopyOperation) new ExchangisRefCopyOperation(this); + } + + @Override + @SuppressWarnings("unchecked") + protected RefUpdateOperation createRefUpdateOperation() { + return (RefUpdateOperation) new ExchangisRefUpdateOperation(this); + } + + @Override + @SuppressWarnings("unchecked") + protected RefDeletionOperation createRefDeletionOperation() { + return new ExchangisRefDeletionOperation(this); + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisRefExecutionService.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisRefExecutionService.java new file mode 100644 index 000000000..ed0aabd51 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisRefExecutionService.java @@ -0,0 +1,13 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.service; + +import com.webank.wedatasphere.dss.standard.app.development.operation.RefExecutionOperation; +import com.webank.wedatasphere.dss.standard.app.development.service.AbstractRefExecutionService; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.ref.ExchangisRefExecutionOperation; + +public class ExchangisRefExecutionService extends AbstractRefExecutionService { + @Override + public RefExecutionOperation createRefExecutionOperation() { + ExchangisRefExecutionOperation exchangisExecutionOperation = new ExchangisRefExecutionOperation(this); + return exchangisExecutionOperation; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisRefExportService.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisRefExportService.java new file mode 100644 index 000000000..54e084a8a --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisRefExportService.java @@ -0,0 +1,18 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.service; + +import com.webank.wedatasphere.dss.standard.app.development.operation.RefExportOperation; +import com.webank.wedatasphere.dss.standard.app.development.service.AbstractRefExportService; +import com.webank.wedatasphere.dss.standard.common.entity.ref.RequestRef; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.ref.ExchangisExportOperation; + +/** + * Ref export service + */ +public class ExchangisRefExportService extends AbstractRefExportService { + @Override + @SuppressWarnings("unchecked") + protected RefExportOperation createRefExportOperation() { + return (RefExportOperation) new ExchangisExportOperation(this); + } + +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisRefImportService.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisRefImportService.java new file mode 100644 index 000000000..12d968fc4 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisRefImportService.java @@ -0,0 +1,19 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.service; + + +import com.webank.wedatasphere.dss.standard.app.development.operation.RefImportOperation; +import com.webank.wedatasphere.dss.standard.app.development.service.AbstractRefImportService; +import com.webank.wedatasphere.dss.standard.common.entity.ref.RequestRef; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.ref.ExchangisImportOperation; + +/** + * Ref import service + */ +public class ExchangisRefImportService extends AbstractRefImportService { + @Override + @SuppressWarnings("unchecked") + protected RefImportOperation createRefImportOperation() { + return (RefImportOperation) new ExchangisImportOperation(this); + } + +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisRefQueryService.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisRefQueryService.java new file mode 100644 index 000000000..123d93975 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/service/ExchangisRefQueryService.java @@ -0,0 +1,16 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.service; + +import com.webank.wedatasphere.dss.standard.app.development.operation.RefQueryOperation; +import com.webank.wedatasphere.dss.standard.app.development.service.AbstractRefQueryService; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.ref.ExchangisRefQueryOperation; + +/** + * Ref query service + */ +public class ExchangisRefQueryService extends AbstractRefQueryService { + @Override + @SuppressWarnings("rawtypes") + protected RefQueryOperation createRefQueryOperation() { + return new ExchangisRefQueryOperation(this); + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/utils/AppConnUtils.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/utils/AppConnUtils.java new file mode 100644 index 000000000..7a7a2fbc3 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/utils/AppConnUtils.java @@ -0,0 +1,60 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.utils; + +import com.webank.wedatasphere.dss.common.label.DSSLabel; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.response.result.ExchangisEntityRespResult; +import org.apache.linkis.httpclient.response.HttpResult; +import org.apache.linkis.manager.label.entity.SerializableLabel; +import org.apache.linkis.server.BDPJettyServerHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Appconn utils for exchangis + */ +public class AppConnUtils { + + private static final Logger LOG = LoggerFactory.getLogger(AppConnUtils.class); + /** + * Invoke the "getStringValue" method in label entity and then concat each one + * @param list label list + * @return serialized string value + */ + public static String serializeDssLabel(List list){ + String dssLabelStr = ""; + if(list != null && !list.isEmpty()){ + dssLabelStr = list.stream().map(SerializableLabel::getStringValue).collect(Collectors.joining(",")); + } + return dssLabelStr; + } + + @SuppressWarnings("unchecked") + public static T resolveParam(Map responseMap, String key, Class type){ + try { + ExchangisEntityRespResult.BasicMessageEntity entity = JsonExtension.convert(responseMap, ExchangisEntityRespResult.BasicMessageEntity.class, Object.class); + Object data = entity.getData(); + if (Objects.nonNull(data) && data instanceof Map){ + Map dataMap = (Map)data; + // TODO convert different type + return (T)dataMap.get(key); + } + } catch (ExternalOperationFailedException e) { + LOG.warn("Exception in resolving params: " + key, e); + } + return null; + } + + public static Map getResponseMap(HttpResult httpResult) throws ExternalOperationFailedException { + try { + return BDPJettyServerHelper.jacksonJson().readValue(httpResult.getResponseBody(), Map.class); + } catch (Exception e) { + throw new ExternalOperationFailedException(90176, "search visualis project exception", e); + } + } + +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/utils/ExchangisNodeUtils.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/utils/ExchangisNodeUtils.java new file mode 100644 index 000000000..b29ef48dc --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/utils/ExchangisNodeUtils.java @@ -0,0 +1,53 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.utils; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.webank.wedatasphere.dss.standard.app.development.ref.NodeRequestRef; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import org.apache.linkis.server.BDPJettyServerHelper; + +import java.util.Map; + +/** + * @author tikazhang + * @Date 2022/3/9 16:14 + */ +public class ExchangisNodeUtils { + public static String getId(NodeRequestRef nodeRequestRef) throws Exception { + String externalContent = BDPJettyServerHelper.jacksonJson().writeValueAsString(nodeRequestRef.getJobContent()); + if ("linkis.appconn.exchangis.sqoop".equalsIgnoreCase(nodeRequestRef.getNodeType())) { + return NumberUtils.parseDoubleString(getSqoopId(externalContent)); + } else if ("linkis.appconn.exchangis.datax".equalsIgnoreCase(nodeRequestRef.getNodeType())) { + return NumberUtils.parseDoubleString(getDataxId(externalContent)); + } + return null; + } + + + public static String getSqoopId(String responseBody) throws ExternalOperationFailedException { + String sqoopId = null; + try { + Map responseMap = BDPJettyServerHelper.jacksonJson().readValue(responseBody, Map.class); + sqoopId = ((Map) responseMap.get("data")).get("id").toString(); + } catch (JsonMappingException e) { + throw new ExternalOperationFailedException(1000054, "Get sqoop Id failed!", e); + } catch (JsonProcessingException e) { + throw new ExternalOperationFailedException(1000054, "Get sqoop Id failed!", e); + } + + return sqoopId; + } + + public static String getDataxId(String responseBody) throws ExternalOperationFailedException { + String dataxId = null; + try { + Map responseMap = BDPJettyServerHelper.jacksonJson().readValue(responseBody, Map.class); + dataxId = ((Map) responseMap.get("data")).get("dataxId").toString(); + } catch (JsonMappingException e) { + throw new ExternalOperationFailedException(1000055, "Get datax Id failed!", e); + } catch (JsonProcessingException e) { + throw new ExternalOperationFailedException(1000055, "Get datax Id failed!", e); + } + return dataxId; + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/utils/JsonExtension.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/utils/JsonExtension.java new file mode 100644 index 000000000..8f6f4960f --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/utils/JsonExtension.java @@ -0,0 +1,41 @@ +package com.webank.wedatasphere.exchangis.dss.appconn.utils; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; +import com.webank.wedatasphere.exchangis.dss.appconn.operation.ref.ExchangisRefQueryOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Extends the function from the mapper "BDPJettyServerHelper.jacksonJson()" + */ +public class JsonExtension { + + private final static Logger LOG = LoggerFactory.getLogger(JsonExtension.class); + + /** + * Convert object using serialization and deserialization + * + * @param simpleObj simpleObj + * @param tClass type class + * @param T + * @return result + */ + @SuppressWarnings("unchecked") + public static T convert(Object simpleObj, Class tClass, Class... parameters) throws ExternalOperationFailedException{ + ObjectMapper mapper = getMapper(); + try { + if (parameters.length > 0) { + return mapper.convertValue(simpleObj, mapper.getTypeFactory().constructParametricType(tClass, parameters)); + } + return (T) mapper.convertValue(simpleObj, tClass); + } catch (Exception e) { + throw new ExternalOperationFailedException(3130, "Fail to process method 'convert(" + simpleObj + ": " + simpleObj.getClass().getSimpleName() + + ", " + tClass.getSimpleName() + ": "+ Class.class + ", ...: " + Class.class + ")", e); + } + } + + public static ObjectMapper getMapper(){ + return new ObjectMapper(); + } +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/utils/NumberUtils.java b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/utils/NumberUtils.java new file mode 100644 index 000000000..8f71dbfd3 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/java/com/webank/wedatasphere/exchangis/dss/appconn/utils/NumberUtils.java @@ -0,0 +1,34 @@ +/* + * Copyright 2019 WeBank + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.webank.wedatasphere.exchangis.dss.appconn.utils; + +public class NumberUtils { + + public static Integer getInt(Object original){ + if(original instanceof Double){ + return ((Double) original).intValue(); + } + return (Integer) original; + } + + public static String parseDoubleString(String doubleString) { + Double doubleValue = Double.parseDouble(doubleString); + Integer intValue = doubleValue.intValue(); + return intValue.toString(); + } + +} diff --git a/exchangis-plugins/exchangis-appconn/src/main/resources/appconn-install.sh b/exchangis-plugins/exchangis-appconn/src/main/resources/appconn-install.sh new file mode 100644 index 000000000..1a2850e92 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/resources/appconn-install.sh @@ -0,0 +1,140 @@ +#!/bin/sh +#Actively load user env +source ~/.bashrc +shellDir=`dirname $0` +workDir=`cd ${shellDir}/..;pwd` + +SOURCE_ROOT=${workDir} + +APPCONN_NAME='exchangis' +APPCONN_INSTALL_IP=127.0.0.1 +APPCONN_INSTALL_PORT=8088 + +#echo "Current path of init sql is ${DB_DML_PATH}" +LOCAL_IP="`ifconfig | grep 'inet' | grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $2}'`" #cut -d: -f2 按照:号进行分割,筛选出第二列的数据 + +function isSuccess(){ + if [ $? -ne 0 ]; then + echo "Failed to " + $1 + exit 1 + else + echo "Succeed to" + $1 + fi +} + +interact_echo(){ + while [ 1 ]; do + read -p "$1 (Y/N)" yn + if [ "${yn}x" == "Yx" ] || [ "${yn}x" == "yx" ]; then + return 0 + elif [ "${yn}x" == "Nx" ] || [ "${yn}x" == "nx" ]; then + return 1 + else + echo "Unknown choise: [$yn], please choose again." + fi + done +} + +#PROC_NAME=DSSProjectServerApplication +#ProcNumber=`ps -ef |grep -w $PROC_NAME|grep -v grep|wc -l` +#if [ $ProcNumber -le 0 ];then +# echo "${PROC_NAME} is not running,Please check whether DSS is installed" +# exit 1000 +#else +# echo "Begine to install appconn" +#fi + +##choose install mysql mode +function initInstallAppConn() { + echo "Current installation component is exchangis" + + echo "" + echo "If this machine(127.0.0.1) is installed, enter 1" + echo "For others, you need to enter a complete IP address." + read -p "Please enter the ip of appconn: " ip + APPCONN_INSTALL_IP=$ip + if [[ '1' = "$ip" ]];then + APPCONN_INSTALL_IP="127.0.0.1" + fi + echo "You input ip is ${APPCONN_INSTALL_IP}" + + echo "" + read -p "Please enter the port of appconn:" port + APPCONN_INSTALL_PORT=$port + echo "You input ip is ${APPCONN_INSTALL_PORT}" +} + +function replaceCommonIp() { + if [[ $APPCONN_INSTALL_IP == "127.0.0.1" ]] || [[ $APPCONN_INSTALL_IP == "0.0.0.0" ]];then + echo "APPCONN_INSTALL_IP is equals $APPCONN_INSTALL_IP, we will change it to ip address" + APPCONN_INSTALL_IP=$LOCAL_IP + fi +} + +##choose execute mysql mode +function executeSQL() { + TEMP_DB_DML_PATH=${shellDir} + DB_DML_PATH=$TEMP_DB_DML_PATH/init_real.sql + cp -rf $TEMP_DB_DML_PATH/init.sql $DB_DML_PATH + + if [ $1 == "y" ] then + break + else + sed -i "s/APPCONN_INSTALL_IP/$APPCONN_INSTALL_IP/g" $DB_DML_PATH + sed -i "s/APPCONN_INSTALL_PORT/$APPCONN_INSTALL_PORT/g" $DB_DML_PATH + sed -i "s#DSS_INSTALL_HOME_VAL#$DSS_INSTALL_HOME#g" $DB_DML_PATH + fi + read -p "Please input the db host(default: 127.0.0.1): " MYSQL_HOST + if [ "x${MYSQL_HOST}" == "x" ]; then + MYSQL_HOST="127.0.0.1" + fi + while [ 1 ]; do + read -p "Please input the db port(default: 3306): " $MYSQL_PORT + if [ "x${$MYSQL_PORT}" == "x" ]; then + $MYSQL_PORT=3306 + break + elif [ ${$MYSQL_PORT} -gt 0 ] 2>/dev/null; then + break + else + echo "${$MYSQL_PORT} is not a number, please input again" + fi + done + read -p "Please input the db username(default: root): " MYSQL_USER + if [ "x${MYSQL_USER}" == "x" ]; then + MYSQL_USER="root" + fi + read -p "Please input the db password(default: ""): " MYSQL_PASSWORD + read -p "Please input the db name(default: exchangis)" MYSQL_DB + if [ "x${MYSQL_DB}" == "x" ]; then + MYSQL_DB="exchangis" + fi + mysql -h$MYSQL_HOST -P$MYSQL_PORT -u$MYSQL_USER -p$MYSQL_PASSWORD -D$MYSQL_DB --default-character-set=utf8 -e "source $DB_DML_PATH" + isSuccess "source $DB_DML_PATH" + echo "the table update finished" +} + +echo "" +echo "step1:Start to install exchangis appconn. Initialize installation settings" +useDomain="" +interact_echo "Whether your exchangis appconn is accessed with a domain name?" +if [ $? == 0 ]; then + echo "Please configure the relevant domain name parameters in init.sql in advance" + useDomain="y" +else + initInstallAppConn +fi +echo "" + +echo "step2:replaceIp" +if [ ${useDomain} != "y"]; then + replaceCommonIp +fi +echo "" + +echo "step3:update database" +executeSQL ${useDomain} +echo "" + +echo "" +echo "step4:Restart the DSS service,please use sbin/dss-start-all.sh to restart it!" +echo "" \ No newline at end of file diff --git a/exchangis-plugins/exchangis-appconn/src/main/resources/appconn.properties b/exchangis-plugins/exchangis-appconn/src/main/resources/appconn.properties new file mode 100644 index 000000000..51a424d00 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/resources/appconn.properties @@ -0,0 +1,22 @@ +# +# /* +# * Copyright 2019 WeBank +# * +# * Licensed under the Apache License, Version 2.0 (the "License"); +# * you may not use this file except in compliance with the License. +# * You may obtain a copy of the License at +# * +# * http://www.apache.org/licenses/LICENSE-2.0 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# */ +# + + + + + diff --git a/exchangis-plugins/exchangis-appconn/src/main/resources/init.sql b/exchangis-plugins/exchangis-appconn/src/main/resources/init.sql new file mode 100644 index 000000000..5057e8396 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/resources/init.sql @@ -0,0 +1,68 @@ + +delete from `dss_application` WHERE `name` ='exchangis'; +INSERT INTO `dss_application`(`name`,`url`,`is_user_need_init`,`level`,`user_init_url`,`exists_project_service`,`project_url`,`enhance_json`,`if_iframe`,`homepage_url`,`redirect_url`) VALUES ('exchangis','',0,1,NULL,0,'','{\"watermark\":false,\"rsDownload\":true}',1,'',NULL); + +UPDATE `dss_application` SET url = 'http://APPCONN_INSTALL_IP:APPCONN_INSTALL_PORT' WHERE `name` ='exchangis'; +UPDATE `dss_application` SET project_url = 'http://APPCONN_INSTALL_IP:APPCONN_INSTALL_PORT/#/projectManage',homepage_url = 'http://APPCONN_INSTALL_IP:APPCONN_INSTALL_PORT/#/projectManage' WHERE `name` in('exchangis'); + +select @dss_exchangis_applicationId:=id from `dss_application` WHERE `name` ='exchangis'; + +delete from `dss_menu` WHERE `name` ='exchangis'; +INSERT INTO `dss_menu`(`name`,`level`,`upper_menu_id`,`front_name`,`comment`,`description`,`is_active`,`is_component`,`icon`,`application_id`) values ('exchangis','2',4,'数据交换(exchangis)',NULL,NULL,1,1,NULL,@dss_exchangis_applicationId); + +delete from `dss_onestop_menu` WHERE name='数据交换'; +INSERT INTO `dss_onestop_menu` (`id`, `name`, `title_en`, `title_cn`, `description`, `is_active`, `icon`, `order`, `create_by`, `create_time`, `last_update_time`, `last_update_user`) VALUES('6','数据交换','data exchange','数据交换','数据交换描述','1',NULL,NULL,NULL,NULL,NULL,NULL); + +delete from `dss_onestop_menu_application` WHERE title_en='exchangis'; +INSERT INTO `dss_onestop_menu_application` (`application_id`, `onestop_menu_id`, `title_en`, `title_cn`, `desc_en`, `desc_cn`, `labels_en`, `labels_cn`, `is_active`, `access_button_en`, `access_button_cn`, `manual_button_en`, `manual_button_cn`, `manual_button_url`, `icon`, `order`, `create_by`, `create_time`, `last_update_time`, `last_update_user`, `image`) VALUES(@dss_exchangis_applicationId,'6','exchangis','exchangis','Exchangis','Exchangis是一个轻量级的、高扩展性的数据交换平台,支持对结构化及无结构化的异构数据源之间的数据传输,在应用层上具有数据权限管控、节点服务高可用和多租户资源隔离等业务特性,而在数据层上又具有传输架构多样化、模块插件化和组件低耦合等架构特点。','user manual','生产,运维','1','enter Exchangis','进入Exchangis','user manual','用户手册','http://127.0.0.1:8088/wiki/scriptis/manual/workspace_cn.html','shujujiaohuan-logo',NULL,NULL,NULL,NULL,NULL,'shujujiaohuan-icon'); + + +delete from `dss_appconn` where `appconn_name`='exchangis'; +INSERT INTO `dss_appconn` (`appconn_name`, `is_user_need_init`, `level`, `if_iframe`, `is_external`, `reference`, `class_name`, `appconn_class_path`, `resource`) VALUES ('exchangis', 0, 1, NULL, 0, NULL, 'com.webank.wedatasphere.exchangis.dss.appconn.ExchangisAppConn', 'DSS_INSTALL_HOME_VAL/dss-appconns/exchangis/lib', ''); + +select @dss_appconn_exchangisId:=id from `dss_appconn` where `appconn_name` = 'exchangis'; + +delete from `dss_appconn_instance` where `homepage_url` like '%exchangis%'; +INSERT INTO `dss_appconn_instance` (`appconn_id`, `label`, `url`, `enhance_json`, `homepage_url`, `redirect_url`) VALUES (@dss_appconn_exchangisId, 'DEV', 'http://APPCONN_INSTALL_IP:APPCONN_INSTALL_PORT/', '', 'http://APPCONN_INSTALL_IP:APPCONN_INSTALL_PORT/#/projectManage', 'http://APPCONN_INSTALL_IP:APPCONN_INSTALL_PORT/'); + + +delete from `dss_workflow_node` where `node_type` like '%exchangis%'; +insert into `dss_workflow_node` (`name`, `appconn_name`, `node_type`, `jump_url`, `support_jump`, `submit_to_scheduler`, `enable_copy`, `should_creation_before_node`, `icon`) values('sqoop','exchangis','linkis.appconn.exchangis.sqoop','http://APPCONN_INSTALL_IP:APPCONN_INSTALL_PORT/#/childJobManagement','1','1','0','1',''); +-- insert into `dss_workflow_node` (`name`, `appconn_name`, `node_type`, `jump_url`, `support_jump`, `submit_to_scheduler`, `enable_copy`, `should_creation_before_node`, `icon`) values('datax','exchangis','linkis.appconn.exchangis.datax','http://APPCONN_INSTALL_IP:APPCONN_INSTALL_PORT/dss/exchangis/#/childJobManagement','1','1','0','1',''); + + + +select @dss_exchangis_sqoopId:=id from `dss_workflow_node` where `node_type` = 'linkis.appconn.exchangis.sqoop'; +-- select @dss_exchangis_dataxId:=id from `dss_workflow_node` where `node_type` = 'linkis.appconn.exchangis.datax'; + + +delete from `dss_workflow_node_to_group` where `node_id`=@dss_exchangis_sqoopId; +delete from `dss_workflow_node_to_group` where `node_id`=@dss_exchangis_dataxId; + + +delete from `dss_workflow_node_to_ui` where `workflow_node_id`=@dss_exchangis_sqoopId; +delete from `dss_workflow_node_to_ui` where `workflow_node_id`=@dss_exchangis_dataxId; + + +select @dss_exchangis_sqoopId:=id from `dss_workflow_node` where `node_type` = 'linkis.appconn.exchangis.sqoop'; +-- select @dss_exchangis_dataxId:=id from `dss_workflow_node` where `node_type` = 'linkis.appconn.exchangis.datax'; + +INSERT INTO `dss_workflow_node_to_group`(`node_id`,`group_id`) values (@dss_exchangis_sqoopId,1); +-- INSERT INTO `dss_workflow_node_to_group`(`node_id`,`group_id`) values (@dss_exchangis_dataxId,1); + + +INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_sqoopId,1); +INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_sqoopId,2); +INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_sqoopId,3); +INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_sqoopId,4); +INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_sqoopId,5); + + +-- INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_dataxId,1); +-- INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_dataxId,2); +-- INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_dataxId,3); +-- INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_dataxId,4); +-- INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_dataxId,5); + + + diff --git a/exchangis-plugins/exchangis-appconn/src/main/resources/init_real.sql b/exchangis-plugins/exchangis-appconn/src/main/resources/init_real.sql new file mode 100644 index 000000000..db228dcc2 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/resources/init_real.sql @@ -0,0 +1,65 @@ + +delete from `dss_application` WHERE `name` ='exchangis'; +INSERT INTO `dss_application`(`name`,`url`,`is_user_need_init`,`level`,`user_init_url`,`exists_project_service`,`project_url`,`enhance_json`,`if_iframe`,`homepage_url`,`redirect_url`) VALUES ('exchangis','',0,1,NULL,0,'','{\"watermark\":false,\"rsDownload\":true}',1,'',NULL); + +UPDATE `dss_application` SET url = 'http://APPCONN_INSTALL_IP:APPCONN_INSTALL_PORT' WHERE `name` ='exchangis'; +UPDATE `dss_application` SET project_url = 'http://APPCONN_INSTALL_IP:APPCONN_INSTALL_PORT/#/projectManage',homepage_url = 'http://APPCONN_INSTALL_IP:APPCONN_INSTALL_PORT/#/projectManage' WHERE `name` in('exchangis'); + +select @dss_exchangis_applicationId:=id from `dss_application` WHERE `name` ='exchangis'; + +delete from `dss_menu` WHERE `name` ='exchangis'; +INSERT INTO `dss_menu`(`name`,`level`,`upper_menu_id`,`front_name`,`comment`,`description`,`is_active`,`is_component`,`icon`,`application_id`) values ('exchangis','2',4,'数据交换(exchangis)',NULL,NULL,1,1,NULL,@dss_exchangis_applicationId); + +delete from `dss_onestop_menu_application` WHERE title_en='exchangis'; +INSERT INTO `dss_onestop_menu_application` (`application_id`, `onestop_menu_id`, `title_en`, `title_cn`, `desc_en`, `desc_cn`, `labels_en`, `labels_cn`, `is_active`, `access_button_en`, `access_button_cn`, `manual_button_en`, `manual_button_cn`, `manual_button_url`, `icon`, `order`, `create_by`, `create_time`, `last_update_time`, `last_update_user`, `image`) VALUES(@dss_exchangis_applicationId,'6','exchangis','exchangis','Exchangis','Exchangis是一个轻量级的、高扩展性的数据交换平台,支持对结构化及无结构化的异构数据源之间的数据传输,在应用层上具有数据权限管控、节点服务高可用和多租户资源隔离等业务特性,而在数据层上又具有传输架构多样化、模块插件化和组件低耦合等架构特点。','user manual','生产,运维','1','enter Exchangis','进入Exchangis','user manual','用户手册','http://127.0.0.1:8088/wiki/scriptis/manual/workspace_cn.html','shujujiaohuan-logo',NULL,NULL,NULL,NULL,NULL,'shujujiaohuan-icon'); + + +delete from `dss_appconn` where `appconn_name`='exchangis'; +INSERT INTO `dss_appconn` (`appconn_name`, `is_user_need_init`, `level`, `if_iframe`, `is_external`, `reference`, `class_name`, `appconn_class_path`, `resource`) VALUES ('exchangis', 0, 1, NULL, 0, NULL, 'com.webank.wedatasphere.exchangis.dss.appconn.ExchangisAppConn', 'DSS_INSTALL_HOME_VAL/dss-appconns/exchangis/lib', ''); + +select @dss_appconn_exchangisId:=id from `dss_appconn` where `appconn_name` = 'exchangis'; + +delete from `dss_appconn_instance` where `homepage_url` like '%exchangis%'; +INSERT INTO `dss_appconn_instance` (`appconn_id`, `label`, `url`, `enhance_json`, `homepage_url`, `redirect_url`) VALUES (@dss_appconn_exchangisId, 'DEV', 'http://APPCONN_INSTALL_IP:APPCONN_INSTALL_PORT/', '', 'http://APPCONN_INSTALL_IP:APPCONN_INSTALL_PORT/#/projectManage', 'http://APPCONN_INSTALL_IP:APPCONN_INSTALL_PORT/'); + + +delete from `dss_workflow_node` where `node_type` like '%exchangis%'; +insert into `dss_workflow_node` (`name`, `appconn_name`, `node_type`, `jump_url`, `support_jump`, `submit_to_scheduler`, `enable_copy`, `should_creation_before_node`, `icon`) values('sqoop','exchangis','linkis.appconn.exchangis.sqoop','http://APPCONN_INSTALL_IP:APPCONN_INSTALL_PORT/#/childJobManagement','1','1','0','1',''); +-- insert into `dss_workflow_node` (`name`, `appconn_name`, `node_type`, `jump_url`, `support_jump`, `submit_to_scheduler`, `enable_copy`, `should_creation_before_node`, `icon`) values('datax','exchangis','linkis.appconn.exchangis.datax','http://APPCONN_INSTALL_IP:APPCONN_INSTALL_PORT/dss/exchangis/#/childJobManagement','1','1','0','1',''); + + + +select @dss_exchangis_sqoopId:=id from `dss_workflow_node` where `node_type` = 'linkis.appconn.exchangis.sqoop'; +-- select @dss_exchangis_dataxId:=id from `dss_workflow_node` where `node_type` = 'linkis.appconn.exchangis.datax'; + + +delete from `dss_workflow_node_to_group` where `node_id`=@dss_exchangis_sqoopId; +delete from `dss_workflow_node_to_group` where `node_id`=@dss_exchangis_dataxId; + + +delete from `dss_workflow_node_to_ui` where `workflow_node_id`=@dss_exchangis_sqoopId; +delete from `dss_workflow_node_to_ui` where `workflow_node_id`=@dss_exchangis_dataxId; + + +select @dss_exchangis_sqoopId:=id from `dss_workflow_node` where `node_type` = 'linkis.appconn.exchangis.sqoop'; +-- select @dss_exchangis_dataxId:=id from `dss_workflow_node` where `node_type` = 'linkis.appconn.exchangis.datax'; + +INSERT INTO `dss_workflow_node_to_group`(`node_id`,`group_id`) values (@dss_exchangis_sqoopId,1); +-- INSERT INTO `dss_workflow_node_to_group`(`node_id`,`group_id`) values (@dss_exchangis_dataxId,1); + + +INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_sqoopId,1); +INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_sqoopId,2); +INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_sqoopId,3); +INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_sqoopId,4); +INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_sqoopId,5); + + +-- INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_dataxId,1); +-- INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_dataxId,2); +-- INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_dataxId,3); +-- INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_dataxId,4); +-- INSERT INTO `dss_workflow_node_to_ui`(`workflow_node_id`,`ui_id`) values (@dss_exchangis_dataxId,5); + + + diff --git a/exchangis-plugins/exchangis-appconn/src/main/resources/log4j.properties b/exchangis-plugins/exchangis-appconn/src/main/resources/log4j.properties new file mode 100644 index 000000000..55970acab --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/resources/log4j.properties @@ -0,0 +1,38 @@ +# +# /* +# * Copyright 2019 WeBank +# * +# * Licensed under the Apache License, Version 2.0 (the "License"); +# * you may not use this file except in compliance with the License. +# * You may obtain a copy of the License at +# * +# * http://www.apache.org/licenses/LICENSE-2.0 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# */ +# + +### set log levels ### + +log4j.rootCategory=INFO,console + +log4j.appender.console=org.apache.log4j.ConsoleAppender +log4j.appender.console.Threshold=INFO +log4j.appender.console.layout=org.apache.log4j.PatternLayout +#log4j.appender.console.layout.ConversionPattern= %d{ISO8601} %-5p (%t) [%F:%M(%L)] - %m%n +log4j.appender.console.layout.ConversionPattern= %d{ISO8601} %-5p (%t) %p %c{1} - %m%n + + +log4j.appender.com.webank.bdp.ide.core=org.apache.log4j.DailyRollingFileAppender +log4j.appender.com.webank.bdp.ide.core.Threshold=INFO +log4j.additivity.com.webank.bdp.ide.core=false +log4j.appender.com.webank.bdp.ide.core.layout=org.apache.log4j.PatternLayout +log4j.appender.com.webank.bdp.ide.core.Append=true +log4j.appender.com.webank.bdp.ide.core.File=logs/linkis.log +log4j.appender.com.webank.bdp.ide.core.layout.ConversionPattern= %d{ISO8601} %-5p (%t) [%F:%M(%L)] - %m%n + +log4j.logger.org.springframework=INFO diff --git a/exchangis-plugins/exchangis-appconn/src/main/resources/log4j2.xml b/exchangis-plugins/exchangis-appconn/src/main/resources/log4j2.xml new file mode 100644 index 000000000..6d1dd9a1f --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/main/resources/log4j2.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/exchangis-plugins/exchangis-appconn/src/test/java/com/webank/wedatasphere/exchangis/appconn/TestAppConn.java b/exchangis-plugins/exchangis-appconn/src/test/java/com/webank/wedatasphere/exchangis/appconn/TestAppConn.java new file mode 100644 index 000000000..4347f6ea9 --- /dev/null +++ b/exchangis-plugins/exchangis-appconn/src/test/java/com/webank/wedatasphere/exchangis/appconn/TestAppConn.java @@ -0,0 +1,24 @@ +package com.webank.wedatasphere.exchangis.appconn; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.gson.Gson; +import org.apache.linkis.server.BDPJettyServerHelper; + +import java.util.HashMap; +import java.util.Map; + +public class TestAppConn { + private final static Gson gson = new Gson(); + public static void main(String[] args) throws JsonProcessingException { + //String str="{\"method\":null,\"status\":0,\"message\":\"OK\",\"data\":{\"item\":{\"id\":\"1469200683600183298\",\"dssProjectId\":null,\"name\":\"DWExchangis06\",\"workspaceName\":\"DWExchangis06\",\"description\":\"测试不要删除\",\"tags\":\"\",\"editUsers\":\"\",\"viewUsers\":\"\",\"execUsers\":\"\",\"domain\":\"STANDALONE\"}}}"; + String str = "{\"route\":\"prod\"}"; + Map labels = new HashMap<>(); + Map responseMap = BDPJettyServerHelper.jacksonJson().readValue(str, Map.class); + System.out.println(responseMap); + labels.put("labels", responseMap); + System.out.println(labels); + Map item = (Map) ((Map) responseMap.get("data")).get("item"); + System.out.println(item.get("id")); + + } +} diff --git a/exchangis-plugins/pom.xml b/exchangis-plugins/pom.xml new file mode 100644 index 000000000..55444b3d8 --- /dev/null +++ b/exchangis-plugins/pom.xml @@ -0,0 +1,39 @@ + + + + exchangis + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-plugins + pom + 1.0.0-RC1 + + exchangis-appconn + + + + + 8 + 8 + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2.1 + + + assemble + none + + + + + + \ No newline at end of file diff --git a/exchangis-project/exchangis-project-server/pom.xml b/exchangis-project/exchangis-project-server/pom.xml new file mode 100644 index 000000000..6a0b22106 --- /dev/null +++ b/exchangis-project/exchangis-project-server/pom.xml @@ -0,0 +1,76 @@ + + + + exchangis-project + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-project-server + + + 8 + 8 + + + + + org.apache.linkis + linkis-module + ${linkis.version} + + + + org.apache.linkis + linkis-mybatis + ${linkis.version} + + + + org.apache.commons + commons-math3 + 3.6.1 + + + com.webank.wedatasphere.exchangis + exchangis-dao + 1.0.0-RC1 + compile + + + + com.webank.wedatasphere.exchangis + exchangis-job-common + 1.0.0-RC1 + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + net.alchim31.maven + scala-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + + + src/main/java + + **/*.xml + + + + + \ No newline at end of file diff --git a/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/domain/ProjectPageQuery.java b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/domain/ProjectPageQuery.java new file mode 100644 index 000000000..9a4a012f3 --- /dev/null +++ b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/domain/ProjectPageQuery.java @@ -0,0 +1,42 @@ +package com.webank.wedatasphere.exchangis.project.server.domain; + +import com.webank.wedatasphere.exchangis.common.pager.PageQuery; +import com.webank.wedatasphere.exchangis.project.server.entity.ExchangisProject; + +/** + * For querying page + */ +public class ProjectPageQuery extends PageQuery { + /** + * Project name + */ + protected String name; + + protected String domain; + + protected String createUser; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDomain() { + return domain; + } + + public void setDomain(String domain) { + this.domain = domain; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } +} diff --git a/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/entity/ExchangisProject.java b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/entity/ExchangisProject.java new file mode 100644 index 000000000..924be5031 --- /dev/null +++ b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/entity/ExchangisProject.java @@ -0,0 +1,210 @@ +package com.webank.wedatasphere.exchangis.project.server.entity; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.linkis.common.utils.JsonUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +public class ExchangisProject { + + private static final Logger LOG = LoggerFactory.getLogger(ExchangisProject.class); + + public enum Domain { + DSS, STANDALONE + } + + /** + * Id (Long value) + */ + private Long id; + /** + * Project name + */ + private String name; + /** + * Description + */ + private String description; + + /** + * Create user + */ + private String createUser; + + /** + * Create time + */ + private Date createTime; + + /** + * Last update user + */ + private String lastUpdateUser; + + /** + * Last update time + */ + private Date lastUpdateTime; + + /** + * Labels + */ + private String labels; + + /** + * User has editing permission + */ + private String editUsers; + + /** + * User has viewing permission + */ + private String viewUsers; + + /** + * User has executing permission + */ + private String execUsers; + + /** + * Domain + */ + private String domain; + + /** + * Source map + */ + private Map sourceMap = new HashMap<>(); + + private String source; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getLastUpdateTime() { + return lastUpdateTime; + } + + public void setLastUpdateTime(Date lastUpdateTime) { + this.lastUpdateTime = lastUpdateTime; + } + + public String getEditUsers() { + return editUsers; + } + + public void setEditUsers(String editUsers) { + this.editUsers = editUsers; + } + + public String getViewUsers() { + return viewUsers; + } + + public void setViewUsers(String viewUsers) { + this.viewUsers = viewUsers; + } + + public String getExecUsers() { + return execUsers; + } + + public void setExecUsers(String execUsers) { + this.execUsers = execUsers; + } + + public String getDomain() { return domain; } + + public void setDomain(String domain) { this.domain = domain; } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getLastUpdateUser() { + return lastUpdateUser; + } + + public void setLastUpdateUser(String lastUpdateUser) { + this.lastUpdateUser = lastUpdateUser; + } + + public String getLabels() { + return labels; + } + + public void setLabels(String labels) { + this.labels = labels; + } + + // TODO use the common Json util + public Map getSourceMap() { + if (Objects.isNull(this.sourceMap) && Objects.nonNull(this.source)){ + try { + ObjectMapper mapper = JsonUtils.jackson(); + this.sourceMap = mapper.readValue(this.source, mapper.getTypeFactory() + .constructParametricType(Map.class, String.class, Object.class)); + } catch (JsonProcessingException e) { + //Ignore + LOG.warn("Cannot deserialize the source string: {}", this.source, e); + } + } + return sourceMap; + } + + public void setSourceMap(Map sourceMap) { + this.sourceMap = sourceMap; + } + + // TODO use the common Json util + public String getSource() { + if (Objects.isNull(this.source) && Objects.nonNull(this.sourceMap)){ + try { + this.source = JsonUtils.jackson().writeValueAsString(this.sourceMap); + } catch (JsonProcessingException e) { + // Ignore + LOG.warn("Cannot serialize the source map", e); + } + } + return source; + } +} diff --git a/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/exception/ExchangisProjectErrorException.java b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/exception/ExchangisProjectErrorException.java new file mode 100644 index 000000000..951df9b88 --- /dev/null +++ b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/exception/ExchangisProjectErrorException.java @@ -0,0 +1,17 @@ +package com.webank.wedatasphere.exchangis.project.server.exception; + + +import org.apache.linkis.common.exception.ErrorException; + +public class ExchangisProjectErrorException extends ErrorException { + + public ExchangisProjectErrorException(int errCode, String desc) { + super(errCode, desc); + } + + public ExchangisProjectErrorException(int errorCode, String desc, Throwable throwable){ + super(errorCode, desc); + this.initCause(throwable); + } + +} diff --git a/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/mapper/ProjectMapper.java b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/mapper/ProjectMapper.java new file mode 100644 index 000000000..7eeb19428 --- /dev/null +++ b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/mapper/ProjectMapper.java @@ -0,0 +1,75 @@ +package com.webank.wedatasphere.exchangis.project.server.mapper; + +import com.webank.wedatasphere.exchangis.project.server.domain.ProjectPageQuery; +import com.webank.wedatasphere.exchangis.project.server.entity.ExchangisProject; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * Project mapper + */ +public interface ProjectMapper { + + /** + * Query the page list + * @param pageQuery page query + * @return page list + */ + List queryPageList(ProjectPageQuery pageQuery); + + /** + * Get detail by id + * @param projectId project id + * @return project entity + */ + ExchangisProject getDetailById(Long projectId); + + /** + * Get basic info by id + * @param projectId project id + * @return project entity + */ + ExchangisProject getBasicById(Long projectId); + /** + * Insert project + * @param project project entity + * @return project id + */ + long insertOne(ExchangisProject project); + + /** + * If exists + * @param projectId project id + * @param projectName project name + * @return int + */ + Integer existsOne(@Param("projectId")Long projectId, @Param("projectName")String projectName); + + /** + * Update one + * @param project project entity + */ + void updateOne(ExchangisProject project); + + /** + * Delete project + * @param projectId + */ + void deleteOne(Long projectId); + + /** + * Delete project by name + * @param name + */ + void deleteByName(String name); + + /** + * get projects by name + * @param projectName + * @return List + */ + List getDetailByName(@Param("projectName") String projectName); + + ExchangisProject selectByName(String name); +} diff --git a/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/mapper/impl/ProjectMapper.xml b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/mapper/impl/ProjectMapper.xml new file mode 100644 index 000000000..9871e1094 --- /dev/null +++ b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/mapper/impl/ProjectMapper.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + id, name, description, create_user, create_time, last_update_user, + last_update_time, project_labels, edit_users, view_users, exec_users, domain, source + + + id, name, description, create_user, create_time, last_update_user, + last_update_time, project_labels, domain + + + + + + + AND name like concat('%', #{name}, '%') + + + AND create_user = #{createUser} + + + AND domain = #{domain} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + `id` = #{id}; + + + + + + + + + + + + DELETE FROM exchangis_project_info WHERE name = #{name} + + + + + + + + diff --git a/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/restful/ExchangisProjectRestfulApi.java b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/restful/ExchangisProjectRestfulApi.java new file mode 100644 index 000000000..3c3b1a9f8 --- /dev/null +++ b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/restful/ExchangisProjectRestfulApi.java @@ -0,0 +1,217 @@ +package com.webank.wedatasphere.exchangis.project.server.restful; + + +import com.webank.wedatasphere.exchangis.common.pager.PageResult; +import com.webank.wedatasphere.exchangis.common.validator.groups.UpdateGroup; +import com.webank.wedatasphere.exchangis.project.server.entity.ExchangisProject; +import com.webank.wedatasphere.exchangis.project.server.service.ProjectService; +import com.webank.wedatasphere.exchangis.project.server.utils.ExchangisProjectRestfulUtils; +import com.webank.wedatasphere.exchangis.project.server.vo.ExchangisProjectInfo; +import com.webank.wedatasphere.exchangis.project.server.vo.ProjectQueryVo; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.math3.util.Pair; +import org.apache.linkis.common.utils.JsonUtils; +import org.apache.linkis.server.Message; +import org.apache.linkis.server.security.SecurityFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.validation.BindingResult; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.validation.groups.Default; +import java.util.Objects; +import java.util.Optional; + + +/** + * This is the restful class for exchangis project + */ +@RestController +@RequestMapping(value = "/dss/exchangis/main", produces = {"application/json;charset=utf-8"}) +public class ExchangisProjectRestfulApi { + private static final Logger LOG = LoggerFactory.getLogger(ExchangisProjectRestfulApi.class); + + /** + * Project service + */ + @Resource + private ProjectService projectService; + + /** + * Project query + * @param request http request + * @param queryVo query vo + * @param current current page + * @param size size + * @param name name + * @return message + */ + @RequestMapping( value = "projects", method = {RequestMethod.POST, RequestMethod.GET}) + public Message queryProjects(HttpServletRequest request, + @RequestBody ProjectQueryVo queryVo, + @RequestParam(value = "current", required = false) Integer current, + @RequestParam(value = "size", required = false) Integer size, + @RequestParam(value = "name", required = false) String name) { + String username = SecurityFilter.getLoginUsername(request); + Optional.ofNullable(current).ifPresent(queryVo::setCurrent); + Optional.ofNullable(size).ifPresent(queryVo::setSize); + Optional.ofNullable(name).ifPresent(queryVo::setName); + queryVo.setCreateUser(username); + try { + PageResult pageResult = projectService.queryProjects(queryVo); + return pageResult.toMessage(); + } catch (Exception t) { + LOG.error("Failed to query project list for user {}", username, t); + return Message.error("Failed to query project list (获取工程列表失败)"); + } + } + + /** + * Project query detail by id + * @param request http request + * @param projectId project id + * @return + */ + @RequestMapping( value = "projects/{projectId:\\d+}", method = RequestMethod.GET) + public Message queryProjectDetail(HttpServletRequest request, + @PathVariable("projectId") Long projectId) { + String username = SecurityFilter.getLoginUsername(request); + try { + ExchangisProjectInfo project = projectService.getProjectDetailById(projectId); + if (Objects.isNull(project)){ + return Message.error("Not found the project (找不到对应工程)"); + } + if (!hasAuthority(username, project)){ + return Message.error("You have no permission to query (没有工程查看权限)"); + } + return Message.ok().data("item", project); + } catch (Exception t) { + LOG.error("failed to get project detail for user {}", username, t); + return Message.error("Fail to get project detail (获取工程详情失败)"); + } + } + + /** + * Create project + * @param request request + * @param projectVo project vo + * @param result result + * @return + */ + @RequestMapping(value = "createProject", method = RequestMethod.POST) + public Message createProject(@Validated @RequestBody ExchangisProjectInfo projectVo, + BindingResult result, HttpServletRequest request) { + if (result.hasErrors()){ + return Message.error(result.getFieldErrors().get(0).getDefaultMessage()); + } + String username = SecurityFilter.getLoginUsername(request); + try { + if (projectService.existsProject(null, projectVo.getName())){ + return Message.error("Have the same name project (存在同名工程)"); + } + LOG.info("CreateProject vo: {}, userName: {}", JsonUtils.jackson().writeValueAsString(projectVo), username); + long projectId = projectService.createProject(projectVo, username); + return ExchangisProjectRestfulUtils.dealOk("创建工程成功", + new Pair<>("projectName", projectVo.getName()), + new Pair<>("projectId", projectId)); + } catch (Exception t) { + LOG.error("Failed to create project for user {}", username, t); + return Message.error("Fail to create project (创建工程失败)"); + } + } + /** + * check project name + * @param request http request + * @param name project name + * @return + */ + @RequestMapping( value = "/check/{name}", method = RequestMethod.POST) + public Message getProjectByName(HttpServletRequest request, @PathVariable("name") String name) { + String username = SecurityFilter.getLoginUsername(request); + try { + ExchangisProjectInfo projectInfo = projectService.selectByName(name); + return ExchangisProjectRestfulUtils.dealOk("根据名字获取工程成功", + new Pair<>("projectInfo",projectInfo)); + } catch (Exception t) { + LOG.error("Failed to delete project for user {}", username, t); + return Message.error("Failed to delete project (根据名字获取工程失败)"); + } + + + } + + + /** + * Update project + * @param request request + * @param projectVo project vo + * @return + */ + @RequestMapping( value = "updateProject", method = RequestMethod.PUT) + public Message updateProject(@Validated({UpdateGroup.class, Default.class}) @RequestBody ExchangisProjectInfo projectVo + , BindingResult result, HttpServletRequest request) { + if (result.hasErrors()){ + return Message.error(result.getFieldErrors().get(0).getDefaultMessage()); + } + String username = SecurityFilter.getLoginUsername(request); + try { + ExchangisProjectInfo projectStored = projectService.getProjectById(Long.valueOf(projectVo.getId())); + if (!hasAuthority(username, projectStored)){ + return Message.error("You have no permission to update (没有项目的更新权限)"); + } + String domain = projectStored.getDomain(); + if (StringUtils.isNotBlank(domain) && !ExchangisProject.Domain.STANDALONE.name() + .equalsIgnoreCase(domain)){ + return Message.error("Cannot update the outer project (无法更新来自 " + domain + " 的外部项目)"); + } + LOG.info("UpdateProject vo: {}, userName: {}", JsonUtils.jackson().writeValueAsString(projectVo), username); + projectService.updateProject(projectVo, username); + return ExchangisProjectRestfulUtils.dealOk("更新工程成功", + new Pair<>("projectName", projectVo.getName()), + new Pair<>("projectId", projectVo.getId())); + } catch (Exception t) { + LOG.error("Failed to update project for user {}", username, t); + return Message.error("Fail to update project (更新工程失败)"); + } + } + + /** + * Delete project + * @param request http request + * @param id project id + * @return + */ + @RequestMapping( value = "/projects/{id:\\d+}", method = RequestMethod.DELETE) + public Message deleteProject(HttpServletRequest request, @PathVariable("id") Long id) { + String username = SecurityFilter.getLoginUsername(request); + try { + ExchangisProjectInfo projectInfo = projectService.getProjectById(id); + if (!hasAuthority(username, projectInfo)){ + return Message.error("You have no permission to delete (删除工程失败)"); + } + String domain = projectInfo.getDomain(); + if (StringUtils.isNotBlank(domain) && !ExchangisProject.Domain.STANDALONE.name() + .equalsIgnoreCase(domain)){ + return Message.error("Cannot delete the outer project (无法删除来自 " + domain + " 的外部项目)"); + } + projectService.deleteProject(id); + return ExchangisProjectRestfulUtils.dealOk("删除工程成功"); + } catch (Exception t) { + LOG.error("Failed to delete project for user {}", username, t); + return Message.error("Failed to delete project (删除工程失败)"); + } + } + + /** + * TODO complete the authority strategy + * @param username username + * @param project project + * @return + */ + private boolean hasAuthority(String username, ExchangisProjectInfo project){ + return Objects.nonNull(project) && username.equals(project.getCreateUser()); + } +} diff --git a/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/restful/external/ExchangisProjectDssAppConnRestfulApi.java b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/restful/external/ExchangisProjectDssAppConnRestfulApi.java new file mode 100644 index 000000000..bd44bcde8 --- /dev/null +++ b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/restful/external/ExchangisProjectDssAppConnRestfulApi.java @@ -0,0 +1,157 @@ +package com.webank.wedatasphere.exchangis.project.server.restful.external; + +import com.webank.wedatasphere.exchangis.common.validator.groups.UpdateGroup; +import com.webank.wedatasphere.exchangis.project.server.entity.ExchangisProject; +import com.webank.wedatasphere.exchangis.project.server.service.ProjectService; +import com.webank.wedatasphere.exchangis.project.server.utils.ExchangisProjectRestfulUtils; +import com.webank.wedatasphere.exchangis.project.server.vo.ExchangisProjectAppVo; +import com.webank.wedatasphere.exchangis.project.server.vo.ExchangisProjectAppVo; +import com.webank.wedatasphere.exchangis.project.server.vo.ExchangisProjectInfo; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.math3.util.Pair; +import org.apache.linkis.common.utils.JsonUtils; +import org.apache.linkis.server.Message; +import org.apache.linkis.server.security.SecurityFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.validation.BindingResult; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.validation.groups.Default; +import java.util.Objects; + +/** + * Restful class for dss project + */ +@RestController +@RequestMapping(value = "/dss/exchangis/main/appProject", produces = {"application/json;charset=utf-8"}) +public class ExchangisProjectDssAppConnRestfulApi { + private static final Logger LOG = LoggerFactory.getLogger(ExchangisProjectDssAppConnRestfulApi.class); + + /** + * Project service + */ + @Resource + private ProjectService projectService; + + @RequestMapping(value = "", method = RequestMethod.POST) + public Message createProject(@Validated @RequestBody ExchangisProjectAppVo project, + BindingResult result, HttpServletRequest request){ + ExchangisProjectInfo projectVo = new ExchangisProjectInfo(project); + if (result.hasErrors()){ + return Message.error(result.getFieldErrors().get(0).getDefaultMessage()); + } + String username = SecurityFilter.getLoginUsername(request); + try { + LOG.info("CreateProject from DSS AppConn, vo: {}, userName: {}", JsonUtils.jackson().writeValueAsString(projectVo), username); + if (projectService.existsProject(null, projectVo.getName())){ + return Message.error("Have the same name project (存在同名工程)"); + } + long projectId = projectService.createProject(projectVo, username); + return ExchangisProjectRestfulUtils.dealOk("创建工程成功", + new Pair<>("projectName", projectVo.getName()), + new Pair<>("projectId", projectId)); + } catch (Exception t) { + LOG.error("Failed to create project for user {} from DSS", username, t); + return Message.error("Fail to create project from DSS(创建工程失败)"); + } + } + + + /** + * Update project + * @param request request + * @param projectVo project vo + * @return + */ + @RequestMapping( value = "/{id:\\d+}", method = RequestMethod.PUT) + public Message updateProject(@PathVariable("id") Long id, @Validated({UpdateGroup.class, Default.class}) @RequestBody ExchangisProjectInfo projectVo + , BindingResult result, HttpServletRequest request) { + if (result.hasErrors()){ + return Message.error(result.getFieldErrors().get(0).getDefaultMessage()); + } + String username = SecurityFilter.getLoginUsername(request); + try { + ExchangisProjectInfo projectStored = projectService.getProjectById(Long.valueOf(projectVo.getId())); + if (!hasAuthority(username, projectStored)){ + return Message.error("You have no permission to update (没有项目的更新权限)"); + } + String domain = projectStored.getDomain(); + if (StringUtils.isNotBlank(domain) && !ExchangisProject.Domain.STANDALONE.name() + .equalsIgnoreCase(domain)){ + return Message.error("Cannot update the outer project (无法更新来自 " + domain + " 的外部项目)"); + } + LOG.info("UpdateProject vo: {}, userName: {}", JsonUtils.jackson().writeValueAsString(projectVo), username); + projectService.updateProject(projectVo, username); + return ExchangisProjectRestfulUtils.dealOk("更新工程成功", + new Pair<>("projectName", projectVo.getName()), + new Pair<>("projectId", projectVo.getId())); + } catch (Exception t) { + LOG.error("Failed to update project for user {}", username, t); + return Message.error("Fail to update project (更新工程失败)"); + } + } + + /** + * Delete project + * @param request http request + * @param name project name + * @return + */ + @RequestMapping( value = "/{name}", method = RequestMethod.POST) + public Message deleteProject(HttpServletRequest request, @PathVariable("name") String name) { + String username = SecurityFilter.getLoginUsername(request); + try { + ExchangisProjectInfo projectInfo = projectService.selectByName(name); +// if (!hasAuthority(username, projectInfo)){ +// return Message.error("You have no permission to delete (删除工程失败)"); +// } +// String domain = projectInfo.getDomain(); +// if (StringUtils.isNotBlank(domain) && !ExchangisProject.Domain.STANDALONE.name() +// .equalsIgnoreCase(domain)){ +// return Message.error("Cannot delete the outer project (无法删除来自 " + domain + " 的外部项目)"); +// } + projectService.deleteProjectByName(name); + return ExchangisProjectRestfulUtils.dealOk("删除工程成功"); + } catch (Exception t) { + LOG.error("Failed to delete project for user {}", username, t); + return Message.error("Failed to delete project (删除工程失败)"); + } + + } + + + /** + * check project name + * @param request http request + * @param name project name + * @return + */ + @RequestMapping( value = "/check/{name}", method = RequestMethod.POST) + public Message getProjectByName(HttpServletRequest request, @PathVariable("name") String name) { + String username = SecurityFilter.getLoginUsername(request); + try { + ExchangisProjectInfo projectInfo = projectService.selectByName(name); + return ExchangisProjectRestfulUtils.dealOk("根据名字获取工程成功", + new Pair<>("projectInfo",projectInfo)); + } catch (Exception t) { + LOG.error("Failed to delete project for user {}", username, t); + return Message.error("Failed to delete project (根据名字获取工程失败)"); + } + + + } + + + /** + * @param username username + * @param project project + * @return + */ + private boolean hasAuthority(String username, ExchangisProjectInfo project){ + return Objects.nonNull(project) && username.equals(project.getCreateUser()); + } +} diff --git a/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/service/ProjectService.java b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/service/ProjectService.java new file mode 100644 index 000000000..6ae561dd6 --- /dev/null +++ b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/service/ProjectService.java @@ -0,0 +1,68 @@ +package com.webank.wedatasphere.exchangis.project.server.service; + + +import com.webank.wedatasphere.exchangis.common.pager.PageResult; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.project.server.entity.ExchangisProject; +import com.webank.wedatasphere.exchangis.project.server.vo.ExchangisProjectInfo; +import com.webank.wedatasphere.exchangis.project.server.vo.ProjectQueryVo; + +import javax.servlet.http.HttpServletRequest; + +/** + * Project query + */ +public interface ProjectService { + + /** + * Create project + * @param projectVo project vo + * @return new project id + */ + long createProject(ExchangisProjectInfo projectVo, String userName); + + /** + * Exists project + * @param projectId project id + * @param projectName project name + * @return boolean + */ + boolean existsProject(Long projectId, String projectName); + + /** + * Update project + * @param projectVo project vo + * @param userName userName + */ + void updateProject(ExchangisProjectInfo projectVo, String userName); + + /** + * Query the page result + * @param queryVo result vo + * @return page result + */ + PageResult queryProjects(ProjectQueryVo queryVo); + + /** + * Delete project + * @param projectId project id + */ + void deleteProject(Long projectId) throws ExchangisJobException; + + /** + * Delete project by name + * @param name + */ + void deleteProjectByName(String name) throws ExchangisJobException; + + /** + * Query the project detail + * @param projectId project id + * @return project vo + */ + ExchangisProjectInfo getProjectDetailById(Long projectId); + + ExchangisProjectInfo getProjectById(Long projectId); + + ExchangisProjectInfo selectByName(String name); +} diff --git a/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/service/impl/ProjectServiceImpl.java b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/service/impl/ProjectServiceImpl.java new file mode 100644 index 000000000..c078133e5 --- /dev/null +++ b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/service/impl/ProjectServiceImpl.java @@ -0,0 +1,162 @@ +package com.webank.wedatasphere.exchangis.project.server.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.webank.wedatasphere.exchangis.common.pager.PageResult; +import com.webank.wedatasphere.exchangis.dao.domain.ExchangisJobDsBind; +import com.webank.wedatasphere.exchangis.dao.mapper.ExchangisJobDsBindMapper; +import com.webank.wedatasphere.exchangis.job.api.ExchangisJobOpenService; +import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobEntity; +import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException; +import com.webank.wedatasphere.exchangis.job.vo.ExchangisJobQueryVo; +import com.webank.wedatasphere.exchangis.project.server.mapper.ProjectMapper; +import com.webank.wedatasphere.exchangis.project.server.entity.ExchangisProject; +import com.webank.wedatasphere.exchangis.project.server.service.ProjectService; +import com.webank.wedatasphere.exchangis.project.server.vo.ExchangisProjectInfo; +import com.webank.wedatasphere.exchangis.project.server.vo.ProjectQueryVo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +@Service +public class ProjectServiceImpl implements ProjectService { + + private static final Logger LOGGER = LoggerFactory.getLogger(ProjectServiceImpl.class); + + @Autowired + private ProjectMapper projectMapper; + + @Resource + private ExchangisJobOpenService jobServiceOpenApi; + + @Autowired + private ExchangisJobDsBindMapper jobDataSourceBindMapper; + + @Override + @Transactional(rollbackFor = Exception.class) + public long createProject(ExchangisProjectInfo projectVo, String userName) { + // Construct the entity + ExchangisProject project = new ExchangisProject(); + project.setName(projectVo.getName()); + project.setDescription(projectVo.getDescription()); + project.setDomain(Optional.ofNullable(projectVo.getDomain()).orElse(ExchangisProject.Domain.STANDALONE.name())); + project.setLabels(projectVo.getLabel()); + project.setSourceMap(projectVo.getSource()); + project.setViewUsers(projectVo.getViewUsers()); + project.setEditUsers(projectVo.getEditUsers()); + project.setExecUsers(projectVo.getExecUsers()); + project.setCreateUser(userName); + project.setCreateTime(Calendar.getInstance().getTime()); + this.projectMapper.insertOne(project); + return project.getId(); + } + + @Override + public boolean existsProject(Long projectId, String projectName) { + Integer count = this.projectMapper.existsOne(projectId, projectName); + return null != count && count > 0; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateProject(ExchangisProjectInfo projectVo, String userName) { + ExchangisProject updatedProject = new ExchangisProject(); + updatedProject.setId(Long.valueOf(projectVo.getId())); + updatedProject.setName(projectVo.getName()); + updatedProject.setDescription(projectVo.getDescription()); + updatedProject.setLabels(projectVo.getLabel()); + updatedProject.setViewUsers(projectVo.getViewUsers()); + updatedProject.setEditUsers(projectVo.getEditUsers()); + updatedProject.setExecUsers(projectVo.getExecUsers()); + updatedProject.setDescription(projectVo.getDescription()); + // Set the updated properties + updatedProject.setLastUpdateUser(userName); + updatedProject.setLastUpdateTime(Calendar.getInstance().getTime()); + this.projectMapper.updateOne(updatedProject); + } + + @Override + public PageResult queryProjects(ProjectQueryVo queryVo) { + PageHelper.startPage(queryVo.getPage(), queryVo.getPageSize()); + try{ + List projects = this.projectMapper.queryPageList(queryVo); + PageInfo pageInfo = new PageInfo<>(projects); + List infoList = projects + .stream().map(ExchangisProjectInfo::new).collect(Collectors.toList()); + PageResult pageResult = new PageResult<>(); + pageResult.setList(infoList); + pageResult.setTotal(pageInfo.getTotal()); + return pageResult; + }finally { + PageHelper.clearPage(); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteProject(Long projectId) throws ExchangisJobException { + // First to delete the project to lock the record + this.projectMapper.deleteOne(projectId); + // Query the related job + ExchangisJobQueryVo queryVo = new ExchangisJobQueryVo(); + queryVo.setProjectId(projectId); + List jobEntities = this.jobServiceOpenApi.queryJobs(queryVo, false); + if (!jobEntities.isEmpty()){ + List ids = jobEntities.stream().map(ExchangisJobEntity::getId).collect(Collectors.toList()); + this.jobServiceOpenApi.deleteJobBatch(ids); + QueryWrapper dsBindQuery = new QueryWrapper().in("job_id", ids); + this.jobDataSourceBindMapper.delete(dsBindQuery); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteProjectByName(String name) throws ExchangisJobException { + // First to delete the project to lock the record + ExchangisProject project = this.projectMapper.selectByName(name); + this.projectMapper.deleteByName(name); + } + @Override + public ExchangisProjectInfo getProjectDetailById(Long projectId) { + ExchangisProject project = this.projectMapper.getDetailById(projectId); + if (Objects.nonNull(project)){ + ExchangisProjectInfo projectVo = new ExchangisProjectInfo(project); + projectVo.setViewUsers(project.getViewUsers()); + projectVo.setEditUsers(project.getEditUsers()); + projectVo.setExecUsers(project.getExecUsers()); + projectVo.setSource(project.getSourceMap()); + return projectVo; + } + return null; + } + + /** + * Basic info query + * @param projectId project id + * @return project info + */ + @Override + public ExchangisProjectInfo getProjectById(Long projectId) { + ExchangisProject project = projectMapper.getBasicById(projectId); + if (Objects.nonNull(project)){ + return new ExchangisProjectInfo(project); + } + return null; + } + + @Override + public ExchangisProjectInfo selectByName(String name){ + ExchangisProject project = this.projectMapper.selectByName(name); + if (Objects.nonNull(project)){ + return new ExchangisProjectInfo(project); + } + return null; + } +} diff --git a/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/utils/ExchangisProjectRestfulUtils.java b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/utils/ExchangisProjectRestfulUtils.java new file mode 100644 index 000000000..06a27f9c2 --- /dev/null +++ b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/utils/ExchangisProjectRestfulUtils.java @@ -0,0 +1,22 @@ +package com.webank.wedatasphere.exchangis.project.server.utils; + +import org.apache.commons.math3.util.Pair; +import org.apache.linkis.server.Message; + +import java.util.Arrays; + +/** + * Utils for restful + */ +public class ExchangisProjectRestfulUtils { + + + @SafeVarargs + public static Message dealOk(String msg, Pair... data){ + Message message = Message.ok(msg); + Arrays.stream(data).forEach(p -> message.data(p.getKey(), p.getValue())); + return message; + } + + +} diff --git a/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/vo/ExchangisProjectAppVo.java b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/vo/ExchangisProjectAppVo.java new file mode 100644 index 000000000..5316482e4 --- /dev/null +++ b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/vo/ExchangisProjectAppVo.java @@ -0,0 +1,196 @@ +package com.webank.wedatasphere.exchangis.project.server.vo; + +import com.fasterxml.jackson.annotation.JsonAlias; +import com.webank.wedatasphere.exchangis.common.validator.groups.UpdateGroup; +import com.webank.wedatasphere.exchangis.project.server.entity.ExchangisProject; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * @author tikazhang + * @Date 2022/3/26 15:36 + */ +public class ExchangisProjectAppVo { + /** + * ID + */ + @NotNull(message = "Project id cannot be null (工程ID不能为空)", groups = UpdateGroup.class) + private Long id; + + /** + * Project name + */ + @NotBlank(message = "Project name cannot be null (工程名不能为空)") + @Size(max = 64, message = "Length of project name should be less than 64 (工程名长度不超过64)") + @JsonAlias("projectName") + private String name; + + /** + * Description + */ + @Size(max = 200, message = "Length of desc should be less than 200 (描述长度不超过200)") + private String description; + + /** + * Request domain + */ + private String domain; + + /** + * Information from the dss + */ + private Map source = new HashMap<>(); + + /** + * User has the edit permission + */ + private String editUsers; + + /** + * User has the view permission + */ + private String viewUsers; + + /** + * User has the execute permission + */ + private String execUsers; + + /** + * labels + */ + @JsonAlias("tags") + private String label; + + /** + * Create user + */ + private String createUser; + + /** + * Create time + */ + private Date createTime; + + private String labels; + + public ExchangisProjectAppVo(){ + + } + + public ExchangisProjectAppVo(ExchangisProject project){ + this.setId(project.getId()); + this.setName(project.getName()); + this.setDescription(project.getDescription()); + this.setDomain(project.getDomain()); + this.setLabel(project.getLabels()); + this.setCreateUser(project.getCreateUser()); + this.setCreateTime(project.getCreateTime()); + } + public String getId() { + return id + ""; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDomain() { + return domain; + } + + public void setDomain(String domain) { + this.domain = domain; + } + + public Map getSource() { + return source; + } + + public void setSource(Map source) { + this.source = source; + } + + public String getEditUsers() { + return editUsers; + } + + public void setEditUsers(String editUsers) { + this.editUsers = editUsers; + } + + public String getViewUsers() { + return viewUsers; + } + + public void setViewUsers(String viewUsers) { + this.viewUsers = viewUsers; + } + + public String getExecUsers() { + return execUsers; + } + + public void setExecUsers(String execUsers) { + this.execUsers = execUsers; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + @Deprecated + public String getTags(){ + return Objects.nonNull(label)? label : ""; + } + + public String getLabels() { + return labels; + } + + public void setLabels(String labels) { + this.labels = labels; + } +} diff --git a/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/vo/ExchangisProjectInfo.java b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/vo/ExchangisProjectInfo.java new file mode 100644 index 000000000..56f3449b2 --- /dev/null +++ b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/vo/ExchangisProjectInfo.java @@ -0,0 +1,214 @@ +package com.webank.wedatasphere.exchangis.project.server.vo; + +import com.fasterxml.jackson.annotation.JsonAlias; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.webank.wedatasphere.exchangis.common.validator.groups.UpdateGroup; +import com.webank.wedatasphere.exchangis.project.server.entity.ExchangisProject; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * View object + * TODO @JsonInclude(JsonInclude.Include.NON_EMPTY) + */ +//@JsonInclude(JsonInclude.Include.NON_EMPTY) +public class ExchangisProjectInfo { + /** + * ID + */ + @NotNull(message = "Project id cannot be null (工程ID不能为空)", groups = UpdateGroup.class) + private Long id; + + /** + * Project name + */ + @NotBlank(message = "Project name cannot be null (工程名不能为空)") + @Size(max = 64, message = "Length of project name should be less than 64 (工程名长度不超过64)") + @JsonAlias("projectName") + private String name; + + /** + * Description + */ + @Size(max = 200, message = "Length of desc should be less than 200 (描述长度不超过200)") + private String description; + + /** + * Request domain + */ + private String domain; + + /** + * Information from the dss + */ + private Map source = new HashMap<>(); + + /** + * User has the edit permission + */ + private String editUsers; + + /** + * User has the view permission + */ + private String viewUsers; + + /** + * User has the execute permission + */ + private String execUsers; + + /** + * labels + */ + @JsonAlias("tags") + private String label; + + /** + * Create user + */ + private String createUser; + + /** + * Create time + */ + private Date createTime; + + private Map labels; + + public ExchangisProjectInfo(){ + + } + + public ExchangisProjectInfo(ExchangisProject project){ + this.setId(project.getId()); + this.setName(project.getName()); + this.setDescription(project.getDescription()); + this.setDomain(project.getDomain()); + this.setLabel(project.getLabels()); + this.setCreateUser(project.getCreateUser()); + this.setCreateTime(project.getCreateTime()); + } + + public ExchangisProjectInfo(ExchangisProjectAppVo project){ + Map labels = new HashMap<>(); + labels.put("route", project.getLabels()); + this.setName(project.getName()); + this.setDescription(project.getDescription()); + this.setDomain(project.getDomain()); + this.setSource(project.getSource()); + this.setEditUsers(project.getEditUsers()); + this.setViewUsers(project.getViewUsers()); + this.setExecUsers(project.getExecUsers()); + this.setLabel(project.getLabel()); + this.setCreateUser(project.getCreateUser()); + this.setCreateTime(project.getCreateTime()); + this.setLabels(labels); + } + public String getId() { + return id + ""; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDomain() { + return domain; + } + + public void setDomain(String domain) { + this.domain = domain; + } + + public Map getSource() { + return source; + } + + public void setSource(Map source) { + this.source = source; + } + + public String getEditUsers() { + return editUsers; + } + + public void setEditUsers(String editUsers) { + this.editUsers = editUsers; + } + + public String getViewUsers() { + return viewUsers; + } + + public void setViewUsers(String viewUsers) { + this.viewUsers = viewUsers; + } + + public String getExecUsers() { + return execUsers; + } + + public void setExecUsers(String execUsers) { + this.execUsers = execUsers; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + @Deprecated + public String getTags(){ + return Objects.nonNull(label)? label : ""; + } + + public Map getLabels() { + return labels; + } + + public void setLabels(Map labels) { + this.labels = labels; + } +} diff --git a/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/vo/ProjectQueryVo.java b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/vo/ProjectQueryVo.java new file mode 100644 index 000000000..7f56cc0f5 --- /dev/null +++ b/exchangis-project/exchangis-project-server/src/main/java/com/webank/wedatasphere/exchangis/project/server/vo/ProjectQueryVo.java @@ -0,0 +1,34 @@ +package com.webank.wedatasphere.exchangis.project.server.vo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.webank.wedatasphere.exchangis.project.server.domain.ProjectPageQuery; + +import java.util.Map; +import java.util.Optional; + + +/** + * Query vo + */ +@JsonInclude(JsonInclude.Include.NON_EMPTY) +public class ProjectQueryVo extends ProjectPageQuery { + + public ProjectQueryVo(){ + } + private Map labels; + + public Map getLabels() { + return labels; + } + + public void setLabels(Map labels) { + this.labels = labels; + } + + public ProjectQueryVo(String name, Integer current, Integer size){ + this.name = name; + this.current = Optional.ofNullable(current).orElse(1); + this.size = Optional.ofNullable(size).orElse(10); + } + +} diff --git a/exchangis-project/pom.xml b/exchangis-project/pom.xml new file mode 100644 index 000000000..b55ffdc8d --- /dev/null +++ b/exchangis-project/pom.xml @@ -0,0 +1,24 @@ + + + + exchangis + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-project + pom + 1.0.0-RC1 + + exchangis-project-server + + + + 8 + 8 + + + \ No newline at end of file diff --git a/exchangis-server/pom.xml b/exchangis-server/pom.xml new file mode 100644 index 000000000..8ddc8bc1e --- /dev/null +++ b/exchangis-server/pom.xml @@ -0,0 +1,115 @@ + + + + exchangis + com.webank.wedatasphere.exchangis + 1.0.0-RC1 + + 4.0.0 + + exchangis-server + + + 8 + 8 + + + + + com.webank.wedatasphere.exchangis + exchangis-datasource-server + 1.0.0-RC1 + + + com.webank.wedatasphere.exchangis + exchangis-job-server + 1.0.0-RC1 + + + + + com.webank.wedatasphere.exchangis + exchangis-project-server + 1.0.0-RC1 + + + org.apache.linkis + linkis-storage + ${linkis.version} + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + net.alchim31.maven + scala-maven-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-assembly-plugin + 3.1.0 + false + + + make-assembly + package + + single + + + + src/main/assembly/distribution.xml + + + + + + false + exchangis-server + false + false + + src/main/assembly/distribution.xml + + ${project.artifactId}_${project.version} + ${basedir}/target/packages + + + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + + + + + src/main/java + + **/*.xml + + + + + \ No newline at end of file diff --git a/exchangis-server/src/main/assembly/distribution.xml b/exchangis-server/src/main/assembly/distribution.xml new file mode 100644 index 000000000..5f7ffc96c --- /dev/null +++ b/exchangis-server/src/main/assembly/distribution.xml @@ -0,0 +1,54 @@ + + + + exchangis-server + + tar.gz + + + false + + + + + lib/${project.artifactId} + true + true + false + false + true + + + + + + ${basedir}/src/main/bin + 0755 + bin + unix + + + ${basedir}/../exchangis-datasource/exchangis-datasource-server/target/exchangis-datasource-server + 0755 + + + + \ No newline at end of file diff --git a/exchangis-server/src/main/resources/application.yml b/exchangis-server/src/main/resources/application.yml new file mode 100644 index 000000000..c94128904 --- /dev/null +++ b/exchangis-server/src/main/resources/application.yml @@ -0,0 +1,20 @@ +server: + port: 9322 +spring: + application: + name: exchangis-server +eureka: + client: + serviceUrl: + defaultZone: http://localhost:20303/eureka/ + instance: + metadata-map: + test: wedatasphere + +management: + endpoints: + web: + exposure: + include: refresh,info +logging: + config: classpath:log4j2.xml diff --git a/exchangis-server/src/main/resources/exchangis.properties b/exchangis-server/src/main/resources/exchangis.properties new file mode 100644 index 000000000..d04af6fd8 --- /dev/null +++ b/exchangis-server/src/main/resources/exchangis.properties @@ -0,0 +1,57 @@ +# +# Copyright 2019 WeBank +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +wds.linkis.test.mode=true +#wds.linkis.test.mode=false + +wds.linkis.server.mybatis.datasource.url=jdbc:mysql://localhost:3306/exchangis_v3?useSSL=false&characterEncoding=UTF-8 + +wds.linkis.server.mybatis.datasource.username=root + +wds.linkis.server.mybatis.datasource.password=123456 + +wds.linkis.log.clear=true + +wds.linkis.server.version=v1 + +## datasource client +wds.exchangis.datasource.client.serverurl= +wds.exchangis.datasource.client.authtoken.key=hdfs +wds.exchangis.datasource.client.authtoken.value=exchangis-auth +wds.exchangis.datasource.client.dws.version=v1 + +wds.exchangis.datasource.extension.dir=exchangis-extds + +##restful +wds.linkis.server.restful.scan.packages=com.webank.wedatasphere.exchangis.datasource.server.restful.api,\ + com.webank.wedatasphere.exchangis.project.server.restful,\ + com.webank.wedatasphere.exchangis.job.server.web,\ + com.webank.wedatasphere.exchangis.metrics.web +wds.linkis.server.mybatis.mapperLocations=classpath*:com/webank/wedatasphere/dss/framework/appconn/dao/impl/*.xml,classpath*:com/webank/wedatasphere/dss/workflow/dao/impl/*.xml,classpath*:com/webank/wedatasphere/exchangis/job/server/mapper/impl/*.xml + +wds.linkis.server.mybatis.BasePackage=com.webank.wedatasphere.exchangis.dao,\ + com.webank.wedatasphere.exchangis.project.server.dao,\ + com.webank.wedatasphere.linkis.configuration.dao,\ + com.webank.wedatasphere.dss.framework.appconn.dao,\ + com.webank.wedatasphere.dss.workflow.dao,\ + com.webank.wedatasphere.linkis.metadata.dao,\ + com.webank.wedatasphere.exchangis.job.server.mapper,\ + com.webank.wedatasphere.exchangis.metrics.dao + + + + diff --git a/exchangis-server/src/main/resources/log4j.properties b/exchangis-server/src/main/resources/log4j.properties new file mode 100644 index 000000000..0807e6087 --- /dev/null +++ b/exchangis-server/src/main/resources/log4j.properties @@ -0,0 +1,37 @@ +# +# Copyright 2019 WeBank +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +### set log levels ### + +log4j.rootCategory=INFO,console + +log4j.appender.console=org.apache.log4j.ConsoleAppender +log4j.appender.console.Threshold=INFO +log4j.appender.console.layout=org.apache.log4j.PatternLayout +#log4j.appender.console.layout.ConversionPattern= %d{ISO8601} %-5p (%t) [%F:%M(%L)] - %m%n +log4j.appender.console.layout.ConversionPattern= %d{ISO8601} %-5p (%t) %p %c{1} - %m%n + + +log4j.appender.com.webank.bdp.ide.core=org.apache.log4j.DailyRollingFileAppender +log4j.appender.com.webank.bdp.ide.core.Threshold=INFO +log4j.additivity.com.webank.bdp.ide.core=false +log4j.appender.com.webank.bdp.ide.core.layout=org.apache.log4j.PatternLayout +log4j.appender.com.webank.bdp.ide.core.Append=true +log4j.appender.com.webank.bdp.ide.core.File=logs/linkis.log +log4j.appender.com.webank.bdp.ide.core.layout.ConversionPattern= %d{ISO8601} %-5p (%t) [%F:%M(%L)] - %m%n + +log4j.logger.org.springframework=INFO diff --git a/exchangis-server/src/main/resources/log4j2.xml b/exchangis-server/src/main/resources/log4j2.xml new file mode 100644 index 000000000..5ae60f144 --- /dev/null +++ b/exchangis-server/src/main/resources/log4j2.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/exchangis-server/src/main/scala/com/webank/wedatasphere/exchangis/server/boot/ApplicationUtils.scala b/exchangis-server/src/main/scala/com/webank/wedatasphere/exchangis/server/boot/ApplicationUtils.scala new file mode 100644 index 000000000..975e55c25 --- /dev/null +++ b/exchangis-server/src/main/scala/com/webank/wedatasphere/exchangis/server/boot/ApplicationUtils.scala @@ -0,0 +1,49 @@ +package com.webank.wedatasphere.exchangis.server.boot + +import java.io.IOException +import java.lang.management.ManagementFactory +import java.nio.file.{Files, Paths} + +import org.apache.linkis.common.utils.Utils +import org.slf4j.LoggerFactory + +/** + * Utils for application + */ +object ApplicationUtils{ + val PROC_PID_FILE = "pid.file" + + private lazy val LOG = LoggerFactory.getLogger(getClass) + /** + * Save the progress id into file + * @param mainProgram main program + * @param args arguments + */ + def savePidAndRun( mainProgram : => Unit, args: String*): Unit ={ + Utils.tryCatch{ + mountPID(System.getProperty(PROC_PID_FILE)) + mainProgram + }{ + case e: Exception => + LOG.info("The process has been shutdown: [" + e.getMessage + "]") + System.exit(1) + } + } + + def mountPID(pidPath: String): Unit = { + Option(pidPath).foreach( path => { + val name: String = ManagementFactory.getRuntimeMXBean.getName + val pid: String = name.split("@")(0).trim + Files.write(Paths.get(path), pid.getBytes) + Runtime.getRuntime.addShutdownHook(new Thread(new Runnable { + override def run(): Unit = { + try{ + Files.delete(Paths.get(path)) + }catch{ + case e: IOException => //Ignore + } + } + })) + }) + } +} diff --git a/exchangis-server/src/main/scala/com/webank/wedatasphere/exchangis/server/boot/ExchangisServerApplication.scala b/exchangis-server/src/main/scala/com/webank/wedatasphere/exchangis/server/boot/ExchangisServerApplication.scala new file mode 100644 index 000000000..365c0cf25 --- /dev/null +++ b/exchangis-server/src/main/scala/com/webank/wedatasphere/exchangis/server/boot/ExchangisServerApplication.scala @@ -0,0 +1,36 @@ +package com.webank.wedatasphere.exchangis.server.boot + +import org.apache.commons.lang.{ArrayUtils, StringUtils} +import org.apache.linkis.DataWorkCloudApplication +import org.apache.linkis.common.utils.Utils +import org.apache.linkis.server.utils.LinkisMainHelper +import org.slf4j.{Logger, LoggerFactory} +class ExchangisServerApplication{ + +} +object ExchangisServerApplication { + + private val LOG: Logger = LoggerFactory.getLogger(classOf[ExchangisServerApplication]) + + private val MAIN_PROGRAM_NAME: String = "exchangis" + + def main(args: Array[String]): Unit = { + LOG.info("Start to run ExchangisServerApplication") + ApplicationUtils.savePidAndRun{ + val userName = Utils.getJvmUser + val hostName = Utils.getComputerName + System.setProperty("hostName", hostName) + System.setProperty("userName", userName) + val serviceName = Option(System.getProperty(LinkisMainHelper.SERVER_NAME_KEY)).getOrElse(MAIN_PROGRAM_NAME) + System.setProperty("spring.application.name", serviceName) + LinkisMainHelper.formatPropertyFiles(MAIN_PROGRAM_NAME, serviceName) + val allArgs: Array[String] = ArrayUtils.addAll(args.asInstanceOf[Array[Object]], + LinkisMainHelper.getExtraSpringOptions(MAIN_PROGRAM_NAME).asInstanceOf[Array[Object]]).asInstanceOf[Array[String]] + val argsString = StringUtils.join(allArgs.asInstanceOf[Array[Object]], '\n') + val startLog = String.format(s"Ready to start $serviceName with args: $argsString.") + LOG.info(startLog) + DataWorkCloudApplication.main(allArgs) + } + } + +} diff --git a/images/communication.png b/images/communication.png deleted file mode 100644 index 12e86727d..000000000 Binary files a/images/communication.png and /dev/null differ diff --git a/images/en_US/ch1/architecture.png b/images/en_US/ch1/architecture.png index 512168180..73ead9581 100644 Binary files a/images/en_US/ch1/architecture.png and b/images/en_US/ch1/architecture.png differ diff --git a/images/en_US/ch1/communication.png b/images/en_US/ch1/communication.png new file mode 100644 index 000000000..d8f0dc7e5 Binary files /dev/null and b/images/en_US/ch1/communication.png differ diff --git a/images/zh_CN/ch1/Hive_datasource_config.png b/images/zh_CN/ch1/Hive_datasource_config.png new file mode 100644 index 000000000..ec77d8700 Binary files /dev/null and b/images/zh_CN/ch1/Hive_datasource_config.png differ diff --git a/images/zh_CN/ch1/MySQL_datasource_config.png b/images/zh_CN/ch1/MySQL_datasource_config.png new file mode 100644 index 000000000..cfb8b1a0c Binary files /dev/null and b/images/zh_CN/ch1/MySQL_datasource_config.png differ diff --git a/images/zh_CN/ch1/add_subtask.png b/images/zh_CN/ch1/add_subtask.png new file mode 100644 index 000000000..e3b01ae29 Binary files /dev/null and b/images/zh_CN/ch1/add_subtask.png differ diff --git a/images/zh_CN/ch1/appconn_pro_create.png b/images/zh_CN/ch1/appconn_pro_create.png new file mode 100644 index 000000000..e3185ffc4 Binary files /dev/null and b/images/zh_CN/ch1/appconn_pro_create.png differ diff --git a/images/zh_CN/ch1/appconn_pro_sqoop.png b/images/zh_CN/ch1/appconn_pro_sqoop.png new file mode 100644 index 000000000..c2d70cc78 Binary files /dev/null and b/images/zh_CN/ch1/appconn_pro_sqoop.png differ diff --git a/images/zh_CN/ch1/appconn_pro_sqoop_sync.jpg b/images/zh_CN/ch1/appconn_pro_sqoop_sync.jpg new file mode 100644 index 000000000..069e69a7b Binary files /dev/null and b/images/zh_CN/ch1/appconn_pro_sqoop_sync.jpg differ diff --git a/images/zh_CN/ch1/appconn_pro_sync.jpg b/images/zh_CN/ch1/appconn_pro_sync.jpg new file mode 100644 index 000000000..f1519b9e5 Binary files /dev/null and b/images/zh_CN/ch1/appconn_pro_sync.jpg differ diff --git a/images/zh_CN/ch1/communication.png b/images/zh_CN/ch1/communication.png new file mode 100644 index 000000000..d8f0dc7e5 Binary files /dev/null and b/images/zh_CN/ch1/communication.png differ diff --git a/images/zh_CN/ch1/data_source_list.png b/images/zh_CN/ch1/data_source_list.png index 79d5154c2..c0cf332ed 100644 Binary files a/images/zh_CN/ch1/data_source_list.png and b/images/zh_CN/ch1/data_source_list.png differ diff --git a/images/zh_CN/ch1/datasource_client_class_relation.png b/images/zh_CN/ch1/datasource_client_class_relation.png new file mode 100644 index 000000000..2654806f2 Binary files /dev/null and b/images/zh_CN/ch1/datasource_client_class_relation.png differ diff --git a/images/zh_CN/ch1/datasource_client_create.png b/images/zh_CN/ch1/datasource_client_create.png new file mode 100644 index 000000000..4c964a29d Binary files /dev/null and b/images/zh_CN/ch1/datasource_client_create.png differ diff --git a/images/zh_CN/ch1/datasource_client_create2.png b/images/zh_CN/ch1/datasource_client_create2.png new file mode 100644 index 000000000..f00401afd Binary files /dev/null and b/images/zh_CN/ch1/datasource_client_create2.png differ diff --git a/images/zh_CN/ch1/datasource_client_query.png b/images/zh_CN/ch1/datasource_client_query.png new file mode 100644 index 000000000..d973f8494 Binary files /dev/null and b/images/zh_CN/ch1/datasource_client_query.png differ diff --git a/images/zh_CN/ch1/datasource_client_scructure.png b/images/zh_CN/ch1/datasource_client_scructure.png new file mode 100644 index 000000000..340d00252 Binary files /dev/null and b/images/zh_CN/ch1/datasource_client_scructure.png differ diff --git a/images/zh_CN/ch1/datasource_client_update.png b/images/zh_CN/ch1/datasource_client_update.png new file mode 100644 index 000000000..1f01aab63 Binary files /dev/null and b/images/zh_CN/ch1/datasource_client_update.png differ diff --git a/images/zh_CN/ch1/datasource_func.png b/images/zh_CN/ch1/datasource_func.png new file mode 100644 index 000000000..3202756d2 Binary files /dev/null and b/images/zh_CN/ch1/datasource_func.png differ diff --git a/images/zh_CN/ch1/datasource_list.png b/images/zh_CN/ch1/datasource_list.png new file mode 100644 index 000000000..c0cf332ed Binary files /dev/null and b/images/zh_CN/ch1/datasource_list.png differ diff --git a/images/zh_CN/ch1/datasource_structure.png b/images/zh_CN/ch1/datasource_structure.png new file mode 100644 index 000000000..5df2c9bfa Binary files /dev/null and b/images/zh_CN/ch1/datasource_structure.png differ diff --git a/images/zh_CN/ch1/datasource_timelimit.png b/images/zh_CN/ch1/datasource_timelimit.png new file mode 100644 index 000000000..95cdef515 Binary files /dev/null and b/images/zh_CN/ch1/datasource_timelimit.png differ diff --git a/images/zh_CN/ch1/datasource_type.png b/images/zh_CN/ch1/datasource_type.png new file mode 100644 index 000000000..c7d264931 Binary files /dev/null and b/images/zh_CN/ch1/datasource_type.png differ diff --git a/images/zh_CN/ch1/datasource_ui.png b/images/zh_CN/ch1/datasource_ui.png new file mode 100644 index 000000000..18b5472cc Binary files /dev/null and b/images/zh_CN/ch1/datasource_ui.png differ diff --git a/images/zh_CN/ch1/datasource_ui_mysql.png b/images/zh_CN/ch1/datasource_ui_mysql.png new file mode 100644 index 000000000..bf17a2958 Binary files /dev/null and b/images/zh_CN/ch1/datasource_ui_mysql.png differ diff --git a/images/zh_CN/ch1/eureka_exchangis.png b/images/zh_CN/ch1/eureka_exchangis.png new file mode 100644 index 000000000..68ad48c6f Binary files /dev/null and b/images/zh_CN/ch1/eureka_exchangis.png differ diff --git a/images/zh_CN/ch1/exchangis1.0_entrance.png b/images/zh_CN/ch1/exchangis1.0_entrance.png new file mode 100644 index 000000000..e779bf790 Binary files /dev/null and b/images/zh_CN/ch1/exchangis1.0_entrance.png differ diff --git a/images/zh_CN/ch1/item_list.png b/images/zh_CN/ch1/item_list.png new file mode 100644 index 000000000..864adbc82 Binary files /dev/null and b/images/zh_CN/ch1/item_list.png differ diff --git a/images/zh_CN/ch1/job_backend_datasource_design.png b/images/zh_CN/ch1/job_backend_datasource_design.png new file mode 100644 index 000000000..8f766060f Binary files /dev/null and b/images/zh_CN/ch1/job_backend_datasource_design.png differ diff --git a/images/zh_CN/ch1/job_backend_uml_1.png b/images/zh_CN/ch1/job_backend_uml_1.png new file mode 100644 index 000000000..a482dfed7 Binary files /dev/null and b/images/zh_CN/ch1/job_backend_uml_1.png differ diff --git a/images/zh_CN/ch1/job_backend_uml_2.png b/images/zh_CN/ch1/job_backend_uml_2.png new file mode 100644 index 000000000..8d5c96ce2 Binary files /dev/null and b/images/zh_CN/ch1/job_backend_uml_2.png differ diff --git a/images/zh_CN/ch1/job_backend_uml_3.png b/images/zh_CN/ch1/job_backend_uml_3.png new file mode 100644 index 000000000..c1baca583 Binary files /dev/null and b/images/zh_CN/ch1/job_backend_uml_3.png differ diff --git a/images/zh_CN/ch1/job_backend_uml_4.png b/images/zh_CN/ch1/job_backend_uml_4.png new file mode 100644 index 000000000..c738d100b Binary files /dev/null and b/images/zh_CN/ch1/job_backend_uml_4.png differ diff --git a/images/zh_CN/ch1/job_backend_uml_5.png b/images/zh_CN/ch1/job_backend_uml_5.png new file mode 100644 index 000000000..917eafcd8 Binary files /dev/null and b/images/zh_CN/ch1/job_backend_uml_5.png differ diff --git a/images/zh_CN/ch1/job_frontend_1.png b/images/zh_CN/ch1/job_frontend_1.png new file mode 100644 index 000000000..e98ee4e79 Binary files /dev/null and b/images/zh_CN/ch1/job_frontend_1.png differ diff --git a/images/zh_CN/ch1/job_frontend_2.png b/images/zh_CN/ch1/job_frontend_2.png new file mode 100644 index 000000000..e73fe548d Binary files /dev/null and b/images/zh_CN/ch1/job_frontend_2.png differ diff --git a/images/zh_CN/ch1/job_frontend_3.png b/images/zh_CN/ch1/job_frontend_3.png new file mode 100644 index 000000000..c83359895 Binary files /dev/null and b/images/zh_CN/ch1/job_frontend_3.png differ diff --git a/images/zh_CN/ch1/job_frontend_4.png b/images/zh_CN/ch1/job_frontend_4.png new file mode 100644 index 000000000..74d92e95b Binary files /dev/null and b/images/zh_CN/ch1/job_frontend_4.png differ diff --git a/images/zh_CN/ch1/job_frontend_5.png b/images/zh_CN/ch1/job_frontend_5.png new file mode 100644 index 000000000..0f79f10dc Binary files /dev/null and b/images/zh_CN/ch1/job_frontend_5.png differ diff --git a/images/zh_CN/ch1/job_frontend_backend.png b/images/zh_CN/ch1/job_frontend_backend.png new file mode 100644 index 000000000..e3d714660 Binary files /dev/null and b/images/zh_CN/ch1/job_frontend_backend.png differ diff --git a/images/zh_CN/ch1/job_overall.png b/images/zh_CN/ch1/job_overall.png new file mode 100644 index 000000000..1d4cd99f7 Binary files /dev/null and b/images/zh_CN/ch1/job_overall.png differ diff --git a/images/zh_CN/ch1/job_task_list.png b/images/zh_CN/ch1/job_task_list.png new file mode 100644 index 000000000..1b3cbf77c Binary files /dev/null and b/images/zh_CN/ch1/job_task_list.png differ diff --git a/images/zh_CN/ch1/linkis_datasource_structure.png b/images/zh_CN/ch1/linkis_datasource_structure.png new file mode 100644 index 000000000..63837904b Binary files /dev/null and b/images/zh_CN/ch1/linkis_datasource_structure.png differ diff --git a/images/zh_CN/ch1/production_center.png b/images/zh_CN/ch1/production_center.png new file mode 100644 index 000000000..c29f90138 Binary files /dev/null and b/images/zh_CN/ch1/production_center.png differ diff --git a/images/zh_CN/ch1/sqoop_config.png b/images/zh_CN/ch1/sqoop_config.png new file mode 100644 index 000000000..5e4b13d52 Binary files /dev/null and b/images/zh_CN/ch1/sqoop_config.png differ diff --git a/images/zh_CN/ch1/sqoop_execute.png b/images/zh_CN/ch1/sqoop_execute.png new file mode 100644 index 000000000..f1cd7cb90 Binary files /dev/null and b/images/zh_CN/ch1/sqoop_execute.png differ diff --git a/images/zh_CN/ch1/sqoop_user_config.png b/images/zh_CN/ch1/sqoop_user_config.png new file mode 100644 index 000000000..8f47f6fde Binary files /dev/null and b/images/zh_CN/ch1/sqoop_user_config.png differ diff --git a/images/zh_CN/ch1/sync_history.png b/images/zh_CN/ch1/sync_history.png new file mode 100644 index 000000000..8bbd27375 Binary files /dev/null and b/images/zh_CN/ch1/sync_history.png differ diff --git a/images/zh_CN/ch1/task_type_and_engine.png b/images/zh_CN/ch1/task_type_and_engine.png new file mode 100644 index 000000000..2fa4f0703 Binary files /dev/null and b/images/zh_CN/ch1/task_type_and_engine.png differ diff --git a/modules/common/pom.xml b/modules/common/pom.xml deleted file mode 100755 index f3acb0c21..000000000 --- a/modules/common/pom.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - 4.0.0 - - com.webank.wedatasphere.exchangis - exchangis - 0.5.0.RELEASE - ../../pom.xml - - exchangis-common - jar - - exchangis-common - Unified data exchange common - - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-client - - - guava - com.google.guava - - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.cloud - spring-cloud-starter-openfeign - - - org.springframework.cloud - spring-cloud-openfeign-core - - - org.springframework.cloud - spring-cloud-commons - - - org.mybatis.spring.boot - mybatis-spring-boot-starter - - - - org.fusesource - sigar - - - log4j - log4j - - - - - commons-codec - commons-codec - 1.11 - - - org.apache.commons - commons-lang3 - - - org.apache.velocity - velocity - 1.7 - - - commons-collections - commons-collections - - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - none - - - - - - diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/AuthConfiguration.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/AuthConfiguration.java deleted file mode 100755 index 3a47e0986..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/AuthConfiguration.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.auth; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.PropertySource; -import org.springframework.stereotype.Component; - -/** - * @author davidhua - * 2018/10/17 - */ -@Component -@PropertySource(value="classpath:auth.properties",ignoreResourceNotFound = true) -public class AuthConfiguration { - @Bean - public AuthTokenHelper tokenBuilder(@Value("${auth.token.api:token}")String tokenApi){ - return new AuthTokenHelper(tokenApi); - } - @Value("${auth.switch:false}") - private boolean authSwitch; - - @Value("${auth.secret:secret}") - private String authSecret; - - @Value("${auth.gateway.url:http}") - private String authGatewayUrl; - - @Value("${auth.cas.switch:false}") - private boolean authCasSwitch; - - @Value("${auth.cas.systemId:id}") - private String authCasSystemId; - - @Value("${auth.token.invalid:0}") - private long authTokenInvalid; - /** - * refresh url for token which generated for service - */ - @Value("${auth.token.servRefresh.url:http}") - private String authTokenServRefreshUrl; - - @Value("${auth.token.servRefresh.interval:0}") - private long authTokenServRefreshInterval; - - @Value("${auth.token.servRefresh.id:id}") - private String authTokenServRefreshId; - - @Value("${auth.token.servRefresh.pwd:pwd}") - private String authTokenServRefreshPwd; - - @Value("${auth.token.servRefresh.store:NO_STORE}") - private String authTokenServRefreshStore; - - @Value("${auth.login.url:/udes/auth/login}") - private String authLoginUrl; - - @Value("${auth.redirect.url:/udes/auth/redirect}") - private String authRedirectUrl; - - public boolean enable(){ - return authSwitch; - } - - public boolean authCasSwitch(){ - return authCasSwitch; - } - - public String gatewayUrl(){ - return authGatewayUrl; - } - - public String casSystemId(){ - return authCasSystemId; - } - - public long tokenInvalid(){ - return authTokenInvalid; - } - - public String authTokenServRefreshUrl() { - return authTokenServRefreshUrl; - } - - public long authTokenServRefreshInterval() { - return authTokenServRefreshInterval; - } - - public String authTokenServRefreshId(){ - return authTokenServRefreshId; - } - - public String authTokenServRefreshPwd(){ - return authTokenServRefreshPwd; - } - - public String authTokenServRefreshStore(){ - return authTokenServRefreshStore; - } - - public String authLoginUrl(){ - return authLoginUrl; - } - - public String authRedirectUrl(){ - return authRedirectUrl; - } - - public String authSecret(){ - return authSecret; - } -} - diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/AuthConstraints.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/AuthConstraints.java deleted file mode 100755 index c674aedcc..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/AuthConstraints.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.auth; - -/** - * @author davidhua - * 2018/10/12 - */ -public class AuthConstraints { - - private AuthConstraints(){ - - } - public static final String GATEWAY_CLIENT = "exchangis-gateway"; - - public static final String ENV_SERV_TOKEN = "env.serv.token"; - - public static final String ENV_SERV_TOKEN_PATH = "env.serv.token.path"; - - public static final String DEFAULT_SSO_COOKIE = "UM-SSO-BDP"; - - public static final String TICKET_NAME = "ticket"; - - public static final String HOST_PORT = "host_port"; - - public static final String TICKT_REFRESH_PARAM = "refresh_tk"; - - public static final String SSO_TOKEN_TIMESTAMP = "tk-time"; - - public static final String SSO_TOKEN_TIME_PATTERN = "yyyyMMddHHmmss"; - - public static final String SSO_REDIRECT_SERVICE = "service"; - - public static final String SSO_REDIRECT_SYSTEMID = "systemId"; - - public static final String X_AUTH_ID="X-AUTH-ID"; - - public static final String ALLOWEDURIS = "allowedUris"; - - public static final String TOKEN_REFRESH_ID = "id"; - - public static final String TOKEN_REFRESH_PWD = "pwd"; - - public static final String SCRIPT_ACCOUNT_NAME = "SC_AUTH_ID"; - - public static final String SCRIPT_PWD_NAME = "SC_AUTH_PWD"; -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/AuthTokenBean.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/AuthTokenBean.java deleted file mode 100755 index a552eef2e..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/AuthTokenBean.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.auth; - - -import java.util.HashMap; -import java.util.Map; - -/** - * Build jwt token from ticket - * @author davidhua - * 2018/10/16 - */ -public class AuthTokenBean { - /** - * simply use MD5 to validate - */ - public static final String ALG_NAME = "alg"; - enum Type{ - //md5 algorithm - MD5; - static Map types = new HashMap<>(); - static{ - types.put("md5", MD5); - } - static Type of(String name){ - Type result = types.get(name.toLowerCase()); - if(null == result){ - throw new IllegalArgumentException("type name: "+ name); - } - return result; - } - } - /** - * headers - */ - private Map headers = new HashMap<>(); - /** - * core domain - */ - private Map claims = new HashMap<>(); - - public AuthTokenBean(){ - headers.put(ALG_NAME, "MD5"); - } - - public Map getHeaders(){ - return headers; - } - - public Map getClaims(){ - return claims; - } - - public void setHeaders(Map map){ - this.headers = map; - } - - public void setClaims(Map map){ - this.claims = map; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/AuthTokenHelper.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/AuthTokenHelper.java deleted file mode 100755 index 0e9e49639..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/AuthTokenHelper.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.auth; - -import com.webank.wedatasphere.exchangis.common.auth.exceptions.ExpireTimeOutException; -import com.webank.wedatasphere.exchangis.common.util.CryptoUtils; -import com.webank.wedatasphere.exchangis.common.util.json.Json; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.*; - -/** - * @author davidhua - * 2018/10/16 - */ -public class AuthTokenHelper { - - private static final Logger logger = LoggerFactory.getLogger(AuthTokenHelper.class); - - private static final String PART_SPLIT = ","; - - private static final String DEFAULT_CHARSET = "UTF-8"; - - private static final int ONE_MINUTES = 60 * 1000; - - private static final int AUTH_TOKEN_LENGTH = 3; - private String tokenSecret = "default"; - - public AuthTokenHelper(){ - - } - - public AuthTokenHelper(String tokenSecret){ - this.tokenSecret = tokenSecret; - } - - /** - * build - * @param tokenBean - * @return 'token' - */ - public String build(AuthTokenBean tokenBean) throws UnsupportedEncodingException { - StringBuilder builder = new StringBuilder(); - Map headers = tokenBean.getHeaders(); - Map claims = tokenBean.getClaims(); - SimpleDateFormat format = new SimpleDateFormat(AuthConstraints.SSO_TOKEN_TIME_PATTERN); - String time = format.format(Calendar.getInstance().getTime()); - headers.put(AuthConstraints.SSO_TOKEN_TIMESTAMP, time); - String alg = headers.get(AuthTokenBean.ALG_NAME); - Base64.Encoder encoder = Base64.getEncoder(); - String self = encoder.encodeToString(Objects.requireNonNull(Json.toJson(headers, Map.class)).getBytes(DEFAULT_CHARSET)) - + PART_SPLIT + encoder.encodeToString(Objects.requireNonNull(Json.toJson(claims, Map.class)).getBytes(DEFAULT_CHARSET)); - builder.append(self).append(PART_SPLIT); - AuthTokenBean.Type type = AuthTokenBean.Type.of(alg); - String auth = getAuthString(type, tokenSecret +self, time); - //headers - builder.append(auth); - return URLEncoder.encode(builder.toString(), DEFAULT_CHARSET); - } - public Map getAuthMessage(String token){ - try { - token = URLDecoder.decode(token, DEFAULT_CHARSET); - String[] parts = token.split(PART_SPLIT); - if(parts.length != AUTH_TOKEN_LENGTH){ - throw new RuntimeException("invalid length in token : " + token); - } - return Json.fromJson( - new String(Base64.getDecoder().decode(parts[1]), DEFAULT_CHARSET), Map.class); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - } - public Map getAuthHeader(String token){ - try{ - token = URLDecoder.decode(token, DEFAULT_CHARSET); - String[] parts = token.split(PART_SPLIT); - if(parts.length != AUTH_TOKEN_LENGTH){ - throw new RuntimeException("invalid length in token : " + token); - } - return Json.fromJson( - new String(Base64.getDecoder().decode(parts[0]), DEFAULT_CHARSET), Map.class); - }catch(UnsupportedEncodingException e){ - throw new RuntimeException(e); - } - } - public boolean validate(String token, long minutes) { - boolean result = false; - try { - token = URLDecoder.decode(token, DEFAULT_CHARSET); - String[] parts = token.split(PART_SPLIT); - if(parts.length != AUTH_TOKEN_LENGTH){ - throw new RuntimeException("invalid length in token : " + token); - } - String self = parts[0] + PART_SPLIT + parts[1]; - String auth = parts[2]; - Map headers = Json.fromJson( - new String(Base64.getDecoder().decode(parts[0]), DEFAULT_CHARSET), Map.class); - String time = Objects.requireNonNull(headers).get(AuthConstraints.SSO_TOKEN_TIMESTAMP); - SimpleDateFormat format = new SimpleDateFormat(AuthConstraints.SSO_TOKEN_TIME_PATTERN); - Date date = format.parse(time); - if(Calendar.getInstance().getTimeInMillis() - date.getTime() > minutes * ONE_MINUTES){ - throw new ExpireTimeOutException("the token is expired, value : " + token); - } - AuthTokenBean.Type type = AuthTokenBean.Type.of(headers.get(AuthTokenBean.ALG_NAME)); - String auth0 = getAuthString(type, tokenSecret + self, time); - if(!auth.equals(auth0)){ - throw new RuntimeException("incorrect token : " + token); - } - result = true; - }catch(ExpireTimeOutException e){ - throw e; - }catch(Exception e){ - logger.info(e.getMessage()); - } - return result; - } - - private String getAuthString(AuthTokenBean.Type type, String source, String salt){ - String auth ; - switch(type){ - default: - auth = CryptoUtils.md5(source, salt, 2); - break; - } - return auth; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/AuthTokenService.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/AuthTokenService.java deleted file mode 100755 index fdbe6a99d..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/AuthTokenService.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.auth; - -import com.webank.wedatasphere.exchangis.route.feign.FeignConstants; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestParam; - -/** - * @author davidhua - * 2019/4/9 - */ -@FeignClient(name = "exchangis-gateway") -public interface AuthTokenService { - /** - * refresh token used by normal user - * @param refresh - * @param token - * @return - */ - @GetMapping("/token/refresh") - String refreshToken(@RequestHeader(FeignConstants.HOST_PORT)String hostPort, @RequestParam(AuthConstraints.TICKT_REFRESH_PARAM)boolean refresh, - @RequestParam(AuthConstraints.DEFAULT_SSO_COOKIE)String token); - - @GetMapping("/token/refresh") - String refreshToken(@RequestParam(AuthConstraints.TICKT_REFRESH_PARAM)boolean refresh, - @RequestParam(AuthConstraints.DEFAULT_SSO_COOKIE)String token); - /** - * refresh token used by containers - * @param id - * @param pwd - * @return - */ - @PostMapping("/token/serv/refresh") - String refreshServerToken(@RequestParam(AuthConstraints.TOKEN_REFRESH_ID)String id, - @RequestParam(AuthConstraints.TOKEN_REFRESH_PWD)String pwd); -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/annotations/ContainerAPI.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/annotations/ContainerAPI.java deleted file mode 100755 index 8922b84b3..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/annotations/ContainerAPI.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.auth.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @author davidhua - * 2019/4/9 - */ -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface ContainerAPI { -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/data/DataAuthScope.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/data/DataAuthScope.java deleted file mode 100755 index 8372df47f..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/data/DataAuthScope.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.auth.data; - -/** - * @author davidhua - * 2019/6/3 - */ -public enum DataAuthScope { - /** - * Authority scope - */ - ALL, READ, WRITE, DELETE, EXECUTE, DATA_READ, DATA_WRITE; -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/exceptions/ExpireTimeOutException.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/exceptions/ExpireTimeOutException.java deleted file mode 100755 index 76092eae3..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/exceptions/ExpireTimeOutException.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.auth.exceptions; - -/** - * @author davidhua - * 2018/10/25 - */ -public class ExpireTimeOutException extends RuntimeException { - public ExpireTimeOutException(String s) { - super(s); - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/interceptors/AuthenticationInterceptor.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/interceptors/AuthenticationInterceptor.java deleted file mode 100755 index 12ee09cd0..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/interceptors/AuthenticationInterceptor.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.auth.interceptors; - -import com.webank.wedatasphere.exchangis.common.auth.AuthConfiguration; -import com.webank.wedatasphere.exchangis.common.auth.AuthTokenService; -import com.webank.wedatasphere.exchangis.common.auth.exceptions.ExpireTimeOutException; -import com.webank.wedatasphere.exchangis.common.controller.Response; -import com.webank.wedatasphere.exchangis.common.auth.AuthConstraints; -import com.webank.wedatasphere.exchangis.common.auth.AuthTokenHelper; -import com.webank.wedatasphere.exchangis.common.util.json.Json; -import com.webank.wedatasphere.exchangis.common.util.spring.AppUtil; -import org.apache.commons.lang.StringUtils; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.stereotype.Component; -import org.springframework.web.servlet.HandlerInterceptor; - -import javax.annotation.Resource; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.PrintWriter; -import java.net.URLEncoder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -import static com.webank.wedatasphere.exchangis.common.auth.AuthConstraints.SSO_REDIRECT_SERVICE; -import static com.webank.wedatasphere.exchangis.common.auth.AuthConstraints.SSO_REDIRECT_SYSTEMID; - -/** - * @author davidhua - * 2018/10/16 - */ -@Component -@ConditionalOnClass(HandlerInterceptor.class) -public class AuthenticationInterceptor implements HandlerInterceptor{ - private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(AuthenticationInterceptor.class); - private static final String PROTOCOL_HEADER = "http"; - @Resource - private AuthConfiguration conf; - - @Resource - private AuthTokenHelper authTokenHelper; - - private AuthTokenService authTokenService; - - @Override - public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { - if(conf.enable() && !request.getRequestURI().equals(conf.authLoginUrl()) && - !request.getRequestURI().equals(conf.authRedirectUrl())){ - if(null == authTokenService){ - authTokenService = AppUtil.getBean(AuthTokenService.class); - } - String token = AppUtil.getCookieValue(request, AuthConstraints.DEFAULT_SSO_COOKIE); - if(StringUtils.isBlank(token)) { - LOGGER.info("cannot find token, sendRedirect..., request path: {}", request.getRequestURI()); - sendRedirect(request, response); - return false; - } - boolean ok = false; - boolean fresh = false; - try { - ok = authTokenHelper.validate(token, conf.tokenInvalid()); - }catch(ExpireTimeOutException e){//should refresh the token by ticket - token = refreshToken(token); - LOGGER.info("trigger Refresh the token by ticket"); - fresh = true; - ok = authTokenHelper.validate(token, conf.tokenInvalid()); - LOGGER.info("finish Refresh the token"); - } - if (!ok) { - LOGGER.info("validate auth token failed, sendRedirect..., request path: {}", request.getRequestURI()); - sendRedirect(request, response); - }else if(fresh){ - Cookie cookie = new Cookie(AuthConstraints.DEFAULT_SSO_COOKIE, token); - cookie.setHttpOnly(true); - cookie.setSecure(false); - cookie.setMaxAge(86400); - cookie.setPath("/"); - response.addCookie(cookie); - } - return ok; - } - return true; - } - - private void sendRedirect(HttpServletRequest request, HttpServletResponse response) throws IOException { - StringBuilder redirectBuilder = new StringBuilder(); - String loginUrl = conf.authLoginUrl(); - redirectBuilder.append(loginUrl); - if(conf.authCasSwitch()) { - //Append CAS parameters - redirectBuilder.append("?") - .append(SSO_REDIRECT_SERVICE + "=").append(URLEncoder.encode(conf.gatewayUrl(), "UTF-8")); - if (StringUtils.isNotBlank(conf.casSystemId())) { - redirectBuilder.append("&" + SSO_REDIRECT_SYSTEMID + "=").append(conf.casSystemId()); - } - } - //Jump to gateway url - sendRedirect(request, response, redirectBuilder.toString()); - } - private void sendRedirect(HttpServletRequest request, HttpServletResponse response, String redirectUrl) throws IOException { - if (AppUtil.isAjax(request)) { - response.setContentType("application/json;charset=UTF-8"); - response.setStatus(200); - Response resp = new Response<>(); - resp.setCode(302); - Map map = new HashMap<>(16); - map.put("redirect", redirectUrl); - resp.setData(map); - final PrintWriter writer = response.getWriter(); - writer.write(Objects.requireNonNull(Json.toJson(resp, Response.class))); - writer.flush(); - } else { - response.sendRedirect(redirectUrl); - } - } - - /** - * To reduce the complex of web page, do that in backend - */ - private String refreshToken(String token){ - if(null != authTokenService) { - try { - //get gateway address from token - if(conf.authCasSwitch()) { - String hostPort = authTokenHelper.getAuthHeader(token) - .getOrDefault(AuthConstraints.HOST_PORT, ""); - if (StringUtils.isNotBlank(hostPort)) { - LOGGER.info("Refresh token, gateway address: " + hostPort); - return authTokenService.refreshToken(hostPort, true, token); - } - }else{ - LOGGER.info("Refresh token to gateway in eureka "); - return authTokenService.refreshToken(false, token); - } - } catch (Exception e) { - LOGGER.info("Fail to refresh token: [" + e.getMessage() + "]"); - } - } - return null; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/interceptors/AuthorityInterceptor.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/interceptors/AuthorityInterceptor.java deleted file mode 100755 index 4a9d92aec..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/interceptors/AuthorityInterceptor.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.auth.interceptors; - -import com.webank.wedatasphere.exchangis.common.auth.AuthConfiguration; -import com.webank.wedatasphere.exchangis.common.auth.AuthConstraints; -import com.webank.wedatasphere.exchangis.common.auth.AuthTokenHelper; -import com.webank.wedatasphere.exchangis.common.auth.annotations.ContainerAPI; -import com.webank.wedatasphere.exchangis.common.controller.Response; -import com.webank.wedatasphere.exchangis.common.util.json.Json; -import com.webank.wedatasphere.exchangis.common.util.spring.AppUtil; -import com.webank.wedatasphere.exchangis.common.constant.CodeConstant; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.http.HttpStatus; -import org.springframework.stereotype.Component; -import org.springframework.web.method.HandlerMethod; -import org.springframework.web.servlet.HandlerInterceptor; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import static com.webank.wedatasphere.exchangis.common.auth.AuthConstraints.ALLOWEDURIS; -import static com.webank.wedatasphere.exchangis.common.auth.AuthConstraints.X_AUTH_ID; - -/** - * @author davidhua - * 2018/10/16 - */ -@Component -@ConditionalOnClass(HandlerInterceptor.class) -public class AuthorityInterceptor implements HandlerInterceptor { - private final Logger LOG = LoggerFactory.getLogger(AuthorityInterceptor.class); - @Resource - private AuthConfiguration conf; - @Resource - private AuthTokenHelper authTokenHelper; - @Override - public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { - if(conf.enable() && !request.getRequestURI().equals(conf.authLoginUrl()) - && !request.getRequestURI().equals(conf.authRedirectUrl())) { - String token = AppUtil.getCookieValue(request, AuthConstraints.DEFAULT_SSO_COOKIE); - Map headers = authTokenHelper.getAuthHeader(token); - String loginId = headers.get(X_AUTH_ID); - String allowUriJson = headers.get(ALLOWEDURIS); - boolean status = false; - response.setContentType("application/json;charset=UTF-8"); - if (loginId != null) { - response.setStatus(200); - status = checkUrl(request, loginId); - } else if (null != allowUriJson) { - List allowUri = Json.fromJson(allowUriJson, String.class); - assert allowUri != null; - String reqURI = request.getRequestURI(); - for(String allow : allowUri){ - if(reqURI.startsWith(allow)){ - status = true; - break; - } - } - } - if(status){ - if(handler instanceof HandlerMethod){ - HandlerMethod method = (HandlerMethod)handler; - if(method.getMethod().isAnnotationPresent(ContainerAPI.class) - && loginId != null){ - status = false; - } - } - } - if (!status) { - Response r = new Response<>(); - String m = "The current user doesn't have permission to access the interface"; - r.errorResponse(CodeConstant.AUTH_ERROR, null, m); - //illegal request - response.setStatus(HttpStatus.UNAUTHORIZED.value()); - response.getWriter().write(Objects.requireNonNull(Json.toJson(r, null))); - } - return status; - } - return true; - } - - private boolean checkUrl(HttpServletRequest request, String loginid){ - //TODO uc to validate - return true; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/scheduler/ServTokenRefresh.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/scheduler/ServTokenRefresh.java deleted file mode 100755 index aa3d33460..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/auth/scheduler/ServTokenRefresh.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.auth.scheduler; - -import com.webank.wedatasphere.exchangis.common.auth.AuthConfiguration; -import com.webank.wedatasphere.exchangis.common.auth.AuthConstraints; -import com.webank.wedatasphere.exchangis.common.auth.AuthTokenService; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import javax.annotation.PostConstruct; -import javax.annotation.Resource; -import java.io.*; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; - -/** - * @author davidhua - * 2018/11/4 - */ -@Component -public class ServTokenRefresh { - private static final Logger LOG = LoggerFactory.getLogger(ServTokenRefresh.class); - private static final String TOKEN_NO_STORE_FLAG = "NO_STORE"; - @Resource - private AuthConfiguration authConfiguration; - - @Autowired - private AuthTokenService authTokenService; - @PostConstruct - public void run(){ - LOG.info("switch status: " + authConfiguration.enable()); - if(authConfiguration.enable()) { - ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(); - Runnable runnable = () -> { - try { - refresh(); - } catch (Exception e) { - LOG.error("Refresh method happened error", e); - } - }; - service.scheduleAtFixedRate(runnable, 0, - authConfiguration.authTokenServRefreshInterval(), TimeUnit.SECONDS); - } - } - - public void refresh(){ - try{ - String body = authTokenService.refreshServerToken(authConfiguration.authTokenServRefreshId(), - authConfiguration.authTokenServRefreshPwd()); - if(StringUtils.isNotBlank(body)){ - System.setProperty(AuthConstraints.ENV_SERV_TOKEN, body); - LOG.info("Get Token:" + body.substring(0, 12) + "*******"); - String storePath = authConfiguration.authTokenServRefreshStore(); - if(StringUtils.isNotBlank(storePath) && !storePath.equals(TOKEN_NO_STORE_FLAG)){ - storeToken(body, storePath); - System.setProperty(AuthConstraints.ENV_SERV_TOKEN_PATH, storePath); - } - } - }catch(Exception e){ - LOG.info(e.getMessage()); - } - } - private void storeToken(String token, String storePath){ - File storeFile = new File(storePath); - if(storeFile.getParentFile().exists() || storeFile.getParentFile().mkdirs()) { - try (BufferedWriter writer = new BufferedWriter(new - OutputStreamWriter(new FileOutputStream(storeFile, false)))) { - writer.append(token); - writer.flush(); - } catch (IOException e) { - LOG.info("Store Token into File error, Exception:{}", e.getMessage()); - } - } - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/constant/CodeConstant.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/constant/CodeConstant.java deleted file mode 100755 index 6b9d80a7d..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/constant/CodeConstant.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.constant; - - -/** - * @author devendeng on 2018/9/18. - */ -public class CodeConstant { - - /** - * Warning - */ - public static final int WARNING_MSG = 11111; - - /** - * Login Fail - */ - public static final int LOGIN_FAIL = 80000; - /** - * Parameter error - */ - public static final int PARAMETER_ERROR=30001; - - /** - * Task not exists - */ - public static final int TASK_NOT_EXISTS=30002; - /** - * Task allocate failed - */ - public static final int TASK_ALLOCATE_FAILD =80001; - - /** - * Task execution error - */ - public static final int EXECUTER_ERROR=50001; - - /** - * System error - */ - public static final int SYS_ERROR=20001; - - /** - * Authentication error - */ - public static final int AUTH_ERROR=40001; - - /** - * Data source connection error - */ - public static final int DATASOURCE_CONN_ERROR = 10001; - /** - * Fail to add data source - */ - public static final int DATASOURCE_ADD_ERROR = 10002; - /** - * Exist jobs related data source - */ - public static final int DATASOURCE_EXIST_JOBS = 10003; - /** - * Cannot find checker for data source - */ - public static final int DATASOURCE_CHECK_NOT_EXISTS = 10004; - /** - * Cannot find file - */ - public static final int FILE_NOT_FOUND = 60001; - /** - * Fail to add data source model - */ - public static final int MODELASSEMBLIY_ADD_ERROR = 10005; -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/controller/AbstractDataAuthController.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/controller/AbstractDataAuthController.java deleted file mode 100755 index 71c40410f..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/controller/AbstractDataAuthController.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.controller; - -import com.webank.wedatasphere.exchangis.common.auth.data.DataAuthScope; -import org.apache.commons.lang3.StringUtils; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -/** - * Data authority controller - * @author davidhua - * 2020/4/3 - */ -public class AbstractDataAuthController extends ExceptionResolverContext { - - private static final String USER_DATA_AUTH_ATTRIBUTE_KEY = "_USER_DATA_AUTH_"; - - @Resource - protected SecurityUtil security; - - /** - * If has the data authority - * @param dataClass data class - * @param dataEntities data entities - * @param authScope authority scope - * @param request request - * @param entity type - * @return boolean - */ - @SafeVarargs - protected final boolean hasDataAuth(Class dataClass, DataAuthScope authScope, HttpServletRequest request, - T... dataEntities){ - return hasDataAuth(dataClass, authScope, request, null, dataEntities); - } - - @SafeVarargs - protected final boolean hasDataAuth(Class dataClass, DataAuthScope authScope, String operator, T... dataEntities){ - return hasDataAuth(dataClass, authScope, null, operator, dataEntities); - } - - @SafeVarargs - protected final boolean hasDataAuth(Class dataClass, DataAuthScope authScope, HttpServletRequest request, - String operator, T... dataEntities){ - try { - String userName = null != request ? security.getUserName(request) : operator; - List userDataAuthSet = new ArrayList<>(); - boolean userDataInit = false; - if (StringUtils.isNotBlank(userName)) { - for (int i = 0; i < dataEntities.length; i++) { - T dataEntity = dataEntities[i]; - //If is data's owner - if (userName.equals(security.getUserName(dataEntity))) { - continue; - } - if (!userDataInit) { - Object authStoredInReq = null; - if(null != request){ - authStoredInReq = request.getAttribute(userName + USER_DATA_AUTH_ATTRIBUTE_KEY + dataClass.getSimpleName()); - } - if(null != authStoredInReq){ - try { - userDataAuthSet = (List) authStoredInReq; - }catch(Exception e){ - //Ignore - } - }else { - userDataAuthSet = security.userExternalDataAuthGetter(dataClass).get(userName); - if(null != request) { - request.setAttribute(userName + USER_DATA_AUTH_ATTRIBUTE_KEY + dataClass.getSimpleName(), userDataAuthSet); - } - } - userDataInit = true; - } - if (null == userDataAuthSet) { - //Means that the user has all authorities - return true; - } else if (userDataAuthSet.size() > 0) { - if(null == dataEntity){ - continue; - } - List dataAuthSet = security.externalDataAuthGetter(dataClass).get(dataEntity); - if (null == dataAuthSet || dataAuthSet.size() <= 0) { - continue; - } - if (userDataAuthSet.containsAll(dataAuthSet)) { - List authScopes = security.externalDataAuthScopeGetter(dataClass).get(dataEntity); - boolean hasAuth = false; - if (!authScopes.isEmpty()) { - for (DataAuthScope scope : authScopes) { - if (scope.equals(DataAuthScope.ALL) || scope.equals(authScope)) { - hasAuth = true; - break; - } - } - } - if (hasAuth) { - continue; - } - } - } - //Means that the user has no authority - return false; - } - return true; - } - //UnLogin - }catch(Exception e){ - //Ignore - } - return false; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/controller/AbstractGenericController.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/controller/AbstractGenericController.java deleted file mode 100755 index 05d42791a..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/controller/AbstractGenericController.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.controller; - -import com.webank.wedatasphere.exchangis.common.auth.data.DataAuthScope; -import com.webank.wedatasphere.exchangis.common.constant.CodeConstant; -import com.webank.wedatasphere.exchangis.common.service.IBaseService; -import com.webank.wedatasphere.exchangis.common.util.page.PageList; -import com.webank.wedatasphere.exchangis.common.util.page.PageQuery; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.lang.reflect.ParameterizedType; -import java.util.List; -import java.util.Map; - -/** - * @author devendeng on 2018/8/21. - */ -public abstract class AbstractGenericController extends AbstractDataAuthController{ - public static final Logger LOG = LoggerFactory.getLogger(AbstractGenericController.class); - - public abstract IBaseService getBaseService(); - - private Class actualType; - - @SuppressWarnings("unchecked") - protected Class getActualType(){ - if(actualType == null){ - synchronized (this){ - ParameterizedType ptClass = (ParameterizedType) this.getClass().getGenericSuperclass(); - actualType = (Class) ptClass.getActualTypeArguments()[0]; - } - } - return actualType; - } - /** - * View details - */ - @RequestMapping(value = "/view/{id}", method = RequestMethod.GET) - public Response show(@PathVariable java.lang.Long id, HttpServletRequest request) throws Exception { - if(!hasDataAuth(getActualType(), DataAuthScope.READ, request, getBaseService().get(id))){ - return new Response().errorResponse(CodeConstant.AUTH_ERROR, null, "没有操作权限(Unauthorized)"); - } - T t = getBaseService().get(id); - return new Response().successResponse(t); - } - - /** - * Delete single one - */ - @RequestMapping(value = "/delete/{id}", method = RequestMethod.DELETE) - public Response delete(@PathVariable java.lang.Long id, HttpServletRequest request) { - if(!hasDataAuth(getActualType(), DataAuthScope.DELETE, request, getBaseService().get(id))){ - return new Response().errorResponse(CodeConstant.AUTH_ERROR, null, "没有操作权限(Unauthorized)"); - } - boolean result = getBaseService().delete(String.valueOf(id)); - return result ? new Response().successResponse(null) : new Response().errorResponse(1, null, "删除失败(Delete failed)"); - } - - /** - * Delete batch - */ - @RequestMapping(value = "/delBatch", method = RequestMethod.POST) - public Response delBatch(HttpServletRequest request, @RequestBody Map map) { - String ids = map.get("ids"); - boolean result = false; - if(StringUtils.isNotBlank(ids)){ - String[] idArray = ids.split(","); - //How can be more faster? - T[] dataArray = (T[])new Object[idArray.length]; - for(int i = 0 ; i < idArray.length; i ++){ - dataArray[i] = getBaseService().get(idArray[i]); - } - if(!hasDataAuth(getActualType(), DataAuthScope.DELETE, request, dataArray)){ - return new Response().errorResponse(CodeConstant.AUTH_ERROR, null, "没有操作权限(Unauthorized)"); - } - result = getBaseService().delete(ids); - } - return result ? new Response().successResponse(null) : new Response().errorResponse(1, null, "删除失败(Delete failed)"); - } - - @RequestMapping(value = "/pageList", method = {RequestMethod.POST,RequestMethod.GET}) - public Response pageList(E pageQuery, HttpServletRequest request) { - PageList list = null; - int pageSize = pageQuery.getPageSize(); - if (pageSize == 0){ - pageQuery.setPageSize(10); - } - String username = security.getUserName(request); - if(StringUtils.isNotBlank(username)) { - security.bindUserInfoAndDataAuth(pageQuery, request, - security.userExternalDataAuthGetter(getActualType()).get(username)); - } - list = getBaseService().findPage(pageQuery); - list.getData().forEach(element -> { - //Bind authority scopes - security.bindAuthScope(element, security.externalDataAuthScopeGetter(getActualType()).get(element)); - }); - return new Response<>().successResponse(list); - } - - @RequestMapping(value = "/selectAll", method = {RequestMethod.POST,RequestMethod.GET}) - public Response> selectAll(E pageQuery, HttpServletRequest request) { - String username = security.getUserName(request); - if(StringUtils.isNotBlank(username)) { - security.bindUserInfoAndDataAuth(pageQuery, request, - security.userExternalDataAuthGetter(getActualType()).get(username)); - } - List data = getBaseService().selectAllList(pageQuery); - data.forEach(element -> { - //Bind authority scopes - security.bindAuthScope(data, security.externalDataAuthScopeGetter(getActualType()).get(element)); - }); - return new Response>().successResponse(data); - } - - @RequestMapping(value = "/add", method = RequestMethod.POST) - public Response add(@Valid @RequestBody T t,HttpServletRequest request) { - security.bindUserInfo(t, request); - boolean result = getBaseService().add(t); - return result ? new Response().successResponse(null) : new Response().errorResponse(1, null, "添加失败(Add failed)"); - } - - @RequestMapping(value = "/update/{id}", method = RequestMethod.POST) - public Response update(@Valid @RequestBody T t,HttpServletRequest request) { - //TODO Cannot get id - if(!hasDataAuth(getActualType(), DataAuthScope.WRITE, request, t)){ - return new Response().errorResponse(CodeConstant.AUTH_ERROR, null, "没有操作权限(Unauthorized)"); - } - security.bindUserInfo(t, request); - boolean result = getBaseService().update(t); - return result ? new Response().successResponse(null) : new Response().errorResponse(1, null, "更新失败(Update failed)"); - } - -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/controller/ExceptionResolverContext.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/controller/ExceptionResolverContext.java deleted file mode 100755 index 26921da01..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/controller/ExceptionResolverContext.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.controller; - -import com.webank.wedatasphere.exchangis.common.constant.CodeConstant; -import com.webank.wedatasphere.exchangis.common.exceptions.EndPointException; -import com.webank.wedatasphere.exchangis.common.util.PatternInjectUtils; -import org.apache.ibatis.binding.BindingException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.MessageSource; -import org.springframework.context.NoSuchMessageException; -import org.springframework.context.i18n.LocaleContextHolder; -import org.springframework.validation.BindException; -import org.springframework.web.bind.MethodArgumentNotValidException; -import org.springframework.web.bind.annotation.ExceptionHandler; - -import javax.annotation.Resource; -import javax.validation.ConstraintViolation; -import javax.validation.ConstraintViolationException; -import java.util.Locale; - -/** - * @author davidhua - * 2019/1/18 - */ -public class ExceptionResolverContext { - - private static final Logger LOG = LoggerFactory.getLogger(ExceptionResolverContext.class); - - @Resource - private MessageSource messageSource; - - /** - * 参数检查异常 - * - * @param e - * @return - */ - @ExceptionHandler(value = ConstraintViolationException.class) - public Response errorParameterHandler(ConstraintViolationException e) { - StringBuilder message = new StringBuilder(); - for (ConstraintViolation c : e.getConstraintViolations()) { - message.append(c.getMessage()); - } - Response response = new Response<>(); - response.setCode(CodeConstant.PARAMETER_ERROR); - response.setMessage(message.toString()); - return response; - } - @ExceptionHandler(value = MethodArgumentNotValidException.class) - public Response errorParameterHandler(MethodArgumentNotValidException e){ - String message = e.getBindingResult().getFieldErrors().get(0).getDefaultMessage(); - return new Response<>().errorResponse(CodeConstant.PARAMETER_ERROR, null , message); - } - - @ExceptionHandler(value = BindingException.class) - public Response errorParameterHandler(BindingException e){ - String message = e.getMessage(); - return new Response<>().errorResponse(CodeConstant.PARAMETER_ERROR, null , message); - } - @ExceptionHandler(value = BindException.class) - public Response errorParameterHandler(BindException e){ - String message = e.getAllErrors().get(0).getDefaultMessage(); - return new Response<>().errorResponse(CodeConstant.PARAMETER_ERROR, null , message); - } - @ExceptionHandler(value = EndPointException.class) - public Response endPointErrorHandler(EndPointException e){ - String uiMessage = e.getUiMessage(); - String message = this.informationSwitch(uiMessage); - if(e.getArgs() != null && e.getArgs().length > 0){ - message = PatternInjectUtils.inject(message,e.getArgs()); - } - return new Response<>().errorResponse(CodeConstant.SYS_ERROR, null, message); - } - /** - * Caught exception - * @param e exception - * @return - */ - @ExceptionHandler(value = Exception.class) - public Response errorHandler(Exception e) { - LOG.error("SYSTEM_EXCEPTION, message: {}", e.getMessage(), e); - return new Response<>().errorResponse(CodeConstant.SYS_ERROR, null, - "系统处理异常(System Exception)[" + e.getMessage() + "]"); - } - - public String informationSwitch(String str){ - Locale locale = LocaleContextHolder.getLocale(); - try{ - return messageSource.getMessage(str,null,locale); - }catch(NoSuchMessageException e){ - return "未定义异常(Undefined Exception)[" + str + "]"; - } - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/controller/Response.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/controller/Response.java deleted file mode 100755 index 109ece22c..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/controller/Response.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.controller; - -import com.webank.wedatasphere.exchangis.common.util.PatternInjectUtils; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.io.Serializable; - -/** - * Created by devendeng on 2018/8/22. - */ -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Response implements Serializable { - private static final long serialVersionUID = -5615777667797486302L; - /** - * Operation code - */ - private int code = 0; - /** - * Return data - */ - private T data; - /** - * Payload message - */ - private String message; - - /** - * Success response - * @param t data - * @return - */ - public Response successResponse(T t) { - this.setCode(0); - this.setMessage("success"); - this.setData(t); - return this; - } - - /** - * Error response - * @param code code - * @param t data - * @param message message - * @return - */ - public Response errorResponse(int code, T t, String message, Object... args) { - this.setCode(code); - if(args != null && args.length > 0){ - this.setMessage(PatternInjectUtils.inject(message, args)); - }else{ - this.setMessage(message); - } - this.setData(t); - return this; - } - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public T getData() { - return data; - } - - public void setData(T data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/controller/SecurityUtil.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/controller/SecurityUtil.java deleted file mode 100755 index caeb9eec6..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/controller/SecurityUtil.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.controller; - -import com.webank.wedatasphere.exchangis.common.auth.AuthConstraints; -import com.webank.wedatasphere.exchangis.common.auth.AuthTokenHelper; -import com.webank.wedatasphere.exchangis.common.auth.data.DataAuthScope; -import com.webank.wedatasphere.exchangis.common.util.spring.AppUtil; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; - -/** - * @author davidhua - * 2019/4/4 - */ -@Component -public class SecurityUtil { - - public static final Logger LOG = LoggerFactory.getLogger(SecurityUtil.class); - - @Resource - private AuthTokenHelper authTokenHelper; - - /** - * Store processes of getting authority scope - */ - private Map, Getter> dataAuthScopeGetters = new ConcurrentHashMap<>(); - - /** - * Store processes of getting authority information - */ - private Map, Getter> dataAuthGetters = new ConcurrentHashMap<>(); - - /** - * Store processes of getting user's authority information - */ - private Map, Getter> userDataAuthGetters = new ConcurrentHashMap<>(); - - @SuppressWarnings("unchecked") - public void registerExternalDataAuthScopeGetter(Class dataClass, Getter getter){ - dataAuthScopeGetters.put(dataClass, (Getter) getter); - } - - @SuppressWarnings("unchecked") - public void registerExternalDataAuthGetter(Class dataClass, Getter getter){ - dataAuthGetters.put(dataClass, (Getter) getter); - } - - public void registerUserExternalDataAuthGetter(Class dataClass, Getter getter){ - userDataAuthGetters.put(dataClass, getter); - } - - @SuppressWarnings("unchecked") - public Getter externalDataAuthScopeGetter(Class dataClass){ - Getter getter = dataAuthScopeGetters.get(dataClass); - return null != getter? (Getter) getter : data -> Collections.singletonList(DataAuthScope.ALL); - } - - @SuppressWarnings("unchecked") - public Getter externalDataAuthGetter(Class dataClass){ - Getter getter = dataAuthGetters.get(dataClass); - return null != getter? (Getter) getter : data -> null; - } - - public Getter userExternalDataAuthGetter(Class dataClass){ - Getter getter = userDataAuthGetters.get(dataClass); - return null != getter? getter : userName -> Collections.emptyList(); - } - - public void bindAuthScope(R data, List authScopes){ - if(null != authScopes && authScopes.size() > 0) { - Class clazz = data.getClass(); - try { - Method method = clazz.getMethod("setAuthScopes", List.class); - List strAuthScopes = new ArrayList<>(authScopes.size()); - authScopes.forEach(item -> strAuthScopes.add(item.name())); - method.invoke(data, strAuthScopes); - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { - //Ignore - } - } - } - /** - * Set createUser,modifyUser - * @param t - * @param request - */ - public void bindUserInfoAndDataAuth(R t, HttpServletRequest request, List dataAuth) { - try { - Class clazz = t.getClass(); - Method[] methods = clazz.getMethods(); - for(Method m : methods){ - if("setCreateUser".equals(m.getName())){ - setLoginId(request, clazz,"setCreateUser",t); - } - if("setModifyUser".equals(m.getName())){ - setLoginId(request, clazz,"setModifyUser",t); - } - if("setUserDataAuth".equals(m.getName())){ - if(null == dataAuth){ - setDataAuth(clazz,"setUserDataAuth", t, null); - }else { - setDataAuth(clazz, "setUserDataAuth", t, new HashSet<>(dataAuth)); - } - } - } - } catch(Exception ne){ - //Ignore - } - } - - /** - * Set createUser,modifyUser - * @param t - * @param request - */ - public void bindUserInfo(R t, HttpServletRequest request){ - bindUserInfoAndDataAuth(t,request,null); - } - /** - * Fill username in model - * @param request request - * @param clazz class - * @throws NoSuchMethodException - * @throws IllegalAccessException - * @throws InvocationTargetException - */ - private void setLoginId(HttpServletRequest request, Class clazz,String methodName,Object t) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { - Method method = clazz.getDeclaredMethod(methodName, String.class); - method.invoke(t, getUserName(request)); - } - - /** - * Fill data auth - * @param clazz class - * @param methodName method name - * @param t data - * @param dataAuthSet authority set - * @throws NoSuchMethodException - * @throws IllegalAccessException - * @throws InvocationTargetException - */ - private void setDataAuth(Class clazz, String methodName, Object t, Set dataAuthSet) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { - Method method = clazz.getDeclaredMethod(methodName, Set.class); - method.invoke(t, dataAuthSet); - } - - /** - * Get username - * @param request request - * @return - */ - public String getUserName(HttpServletRequest request){ - String token = AppUtil.getCookieValue(request, AuthConstraints.DEFAULT_SSO_COOKIE); - return StringUtils.isNotBlank(token)? - authTokenHelper.getAuthHeader(token).get(AuthConstraints.X_AUTH_ID): null; - } - - public String getUserName(R data){ - String userName = null; - if(null != data) { - Class clazz = data.getClass(); - try { - Method method = clazz.getMethod("getCreateUser"); - userName = String.valueOf(method.invoke(data)); - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { - //Ignore - } - } - return userName; - } - /** - * Getter - * @param - */ - public interface Getter{ - - List get(T data); - } - -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/dao/IBaseDao.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/dao/IBaseDao.java deleted file mode 100755 index 742020d6f..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/dao/IBaseDao.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.dao; - - -import com.webank.wedatasphere.exchangis.common.util.page.PageQuery; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.session.RowBounds; - -import java.util.List; - -/** - * Created by devendeng on 2018/8/20. - */ -public interface IBaseDao { - /** - * Insert - * - * @param t data - * @return primary key - */ - int insert(T t); - - /** - * Delete - * - * @return affect rows - */ - int delete(@Param("ids") List ids); - - /** - * Update - * - * @param t data - * @return affect rows - */ - int update(T t); - - /** - * Count result - * - * @param pageQuery page query - * @return value - */ - long count(PageQuery pageQuery); - - /** - * Select - * - * @param key primary key - * @return data - */ - T selectOne(Object key); - - /** - * Search - * - * @return - */ - List findPage(PageQuery pageQuery, RowBounds rowBound); - - /** - * 查询所有的数据 - * - * @return - */ - List selectAllList(PageQuery pageQuery); -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/exceptions/DataAccessException.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/exceptions/DataAccessException.java deleted file mode 100755 index 327668535..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/exceptions/DataAccessException.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.exceptions; - -/** - * Exception transferred between different models or structures - * @author davidhua - * 2019/1/16 - */ -public class DataAccessException extends RuntimeException{ - public DataAccessException(Throwable cause) { - super(cause); - } - public DataAccessException(String message, Throwable cause){ - super(message, cause); - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/exceptions/EndPointException.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/exceptions/EndPointException.java deleted file mode 100755 index 53ca3625a..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/exceptions/EndPointException.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.exceptions; - - -/** - * Map inner exception to ui message - * @author davidhua - * 2019/1/16 - */ -public class EndPointException extends RuntimeException{ - private String uiMessage; - private Object[] args; - public EndPointException(String uiMessage, String message, Throwable throwable){ - super(message, throwable); - this.uiMessage = uiMessage; - } - public EndPointException(String uiMessage, Throwable throwable,Object...args){ - super(throwable); - if(args != null && args.length > 0){ - this.args = args; - } - this.uiMessage = uiMessage; - } - public String getUiMessage(){ - return this.uiMessage; - } - public Object[] getArgs(){ - return this.args; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/mybatis/plugin/MapInterceptor.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/mybatis/plugin/MapInterceptor.java deleted file mode 100755 index 6ed281edf..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/mybatis/plugin/MapInterceptor.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.mybatis.plugin; - -import com.webank.wedatasphere.exchangis.common.util.json.Json; -import org.apache.ibatis.executor.resultset.ResultSetHandler; -import org.apache.ibatis.mapping.MappedStatement; -import org.apache.ibatis.mapping.ResultMap; -import org.apache.ibatis.plugin.*; -import org.apache.ibatis.reflection.DefaultReflectorFactory; -import org.apache.ibatis.reflection.MetaObject; -import org.apache.ibatis.reflection.ReflectorFactory; -import org.apache.ibatis.reflection.factory.DefaultObjectFactory; -import org.apache.ibatis.reflection.factory.ObjectFactory; -import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory; -import org.apache.ibatis.reflection.wrapper.ObjectWrapperFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.lang.reflect.Method; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.*; - -/** - * Map handler - * @author davidhua - * 2019/5/22 - */ -@Intercepts({@Signature(type=ResultSetHandler.class, method="handleResultSets", args={Statement.class})}) -public class MapInterceptor implements Interceptor { - private static final Logger logger = LoggerFactory.getLogger(MapInterceptor.class); - private static final String MAP_TYPE = "java.util.Map"; - private static final ObjectFactory DEFAULT_OBJECT_FACTORY = new DefaultObjectFactory(); - private static final ObjectWrapperFactory DEFAULT_OBJECT_WRAPPER_FACTORY = new DefaultObjectWrapperFactory(); - private static final ReflectorFactory REFLECTOR_FACTORY = new DefaultReflectorFactory(); - private static Map mapRuleHashMap = new HashMap<>(); - - @Override - public Object intercept(Invocation invocation) throws Throwable { - ResultSetHandler handler = (ResultSetHandler)invocation.getTarget(); - MetaObject metaObject = MetaObject.forObject(handler, - DEFAULT_OBJECT_FACTORY, DEFAULT_OBJECT_WRAPPER_FACTORY, REFLECTOR_FACTORY); - MappedStatement statement = (MappedStatement)metaObject.getValue("mappedStatement"); - List resultMaps = statement.getResultMaps(); - if(resultMaps.size() > 0){ - String type = resultMaps.get(0).getType().getName(); - if(null != type && type.equals(MAP_TYPE)){ - logger.trace(MAP_TYPE + " resultMap"); - String id = statement.getId(); - MapRule mapRule = mapRuleHashMap.get(id); - if(null == mapRule){ - String className = id.substring(0, id.lastIndexOf(".")); - Class clz = Class.forName(className); - String method = id.substring(id.lastIndexOf(".") + 1); - Method[] methods = clz.getMethods(); - for(Method m : methods){ - if(m.getName().equalsIgnoreCase(method)){ - mapRule = m.getAnnotation(MapRule.class); - mapRuleHashMap.put(className, mapRule); - break; - } - } - } - if(null != mapRule){ - return map((Statement)invocation.getArgs()[0], mapRule); - } - } - } - return invocation.proceed(); - } - - @Override - public Object plugin(Object target) { - if(target instanceof ResultSetHandler){ - return Plugin.wrap(target, this); - } - return target; - } - - @Override - public void setProperties(Properties properties) { - - } - - private Object map(Statement statement, MapRule mapRule) throws SQLException { - logger.trace("Start to build map result"); - Map buildMap = new HashMap<>(8); - List result = new ArrayList<>(); - try (ResultSet resultSet = statement.getResultSet()) { - if (null != resultSet) { - while (resultSet.next()) { - buildMap.put(resultSet.getObject(mapRule.key()), - resultSet.getObject(mapRule.value())); - } - } - } - logger.trace("Build map result: " + Json.toJson(buildMap, null)); - result.add(buildMap); - return result; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/mybatis/plugin/MapRule.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/mybatis/plugin/MapRule.java deleted file mode 100755 index 30c1ad9d4..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/mybatis/plugin/MapRule.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.mybatis.plugin; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @author davidhua - * 2019/5/22 - */ -@Target({ElementType.METHOD, ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface MapRule { - String key(); - String value(); -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/mybatis/plugin/PaginationInterceptor.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/mybatis/plugin/PaginationInterceptor.java deleted file mode 100755 index 50d8381e5..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/mybatis/plugin/PaginationInterceptor.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.mybatis.plugin; - -import org.apache.ibatis.executor.statement.StatementHandler; -import org.apache.ibatis.mapping.BoundSql; -import org.apache.ibatis.mapping.MappedStatement; -import org.apache.ibatis.plugin.*; -import org.apache.ibatis.reflection.DefaultReflectorFactory; -import org.apache.ibatis.reflection.MetaObject; -import org.apache.ibatis.reflection.ReflectorFactory; -import org.apache.ibatis.reflection.factory.DefaultObjectFactory; -import org.apache.ibatis.reflection.factory.ObjectFactory; -import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory; -import org.apache.ibatis.reflection.wrapper.ObjectWrapperFactory; -import org.apache.ibatis.session.Configuration; -import org.apache.ibatis.session.RowBounds; - -import java.sql.Connection; -import java.util.Properties; - -@Intercepts({ - @Signature(method = "prepare", type = StatementHandler.class, args = {Connection.class, Integer.class})}) -public class PaginationInterceptor implements Interceptor { - - private static final ObjectFactory DEFAULT_OBJECT_FACTORY = new DefaultObjectFactory(); - private static final ObjectWrapperFactory DEFAULT_OBJECT_WRAPPER_FACTORY = new DefaultObjectWrapperFactory(); - private static final ReflectorFactory REFLECTOR_FACTORY = new DefaultReflectorFactory(); - private static String DEFAULT_PAGE_SQL_ID = ".*Page$"; - - @Override - public Object intercept(Invocation invocation) throws Throwable { - StatementHandler statementHandler = (StatementHandler) invocation.getTarget(); - MetaObject metaStatementHandler = MetaObject.forObject(statementHandler, DEFAULT_OBJECT_FACTORY, - DEFAULT_OBJECT_WRAPPER_FACTORY, REFLECTOR_FACTORY); - RowBounds rowBounds = (RowBounds) metaStatementHandler.getValue("delegate.rowBounds"); - while (metaStatementHandler.hasGetter("h")) { - Object object = metaStatementHandler.getValue("h"); - metaStatementHandler = MetaObject.forObject(object, DEFAULT_OBJECT_FACTORY, DEFAULT_OBJECT_WRAPPER_FACTORY, REFLECTOR_FACTORY); - } - while (metaStatementHandler.hasGetter("target")) { - Object object = metaStatementHandler.getValue("target"); - metaStatementHandler = MetaObject.forObject(object, DEFAULT_OBJECT_FACTORY, DEFAULT_OBJECT_WRAPPER_FACTORY, REFLECTOR_FACTORY); - } - - Configuration configuration = (Configuration) metaStatementHandler.getValue("delegate.configuration"); - String pageSqlId = null; - if (configuration != null) { - pageSqlId = configuration.getVariables().getProperty("pageSqlId"); - } - if (null == pageSqlId || "".equals(pageSqlId)) { - pageSqlId = DEFAULT_PAGE_SQL_ID; - } - - MappedStatement mappedStatement = (MappedStatement) - metaStatementHandler.getValue("delegate.mappedStatement"); - if (mappedStatement.getId().matches(pageSqlId)) { - BoundSql boundSql = (BoundSql) metaStatementHandler.getValue("delegate.boundSql"); - Object parameterObject = boundSql.getParameterObject(); - if (parameterObject == null) { - throw new NullPointerException("parameterObject is null!"); - } else { - String sql = boundSql.getSql(); - // Reconstruct sql - String pageSql = sql + " LIMIT " + rowBounds.getOffset() + "," + rowBounds.getLimit(); - metaStatementHandler.setValue("delegate.boundSql.sql", pageSql); - metaStatementHandler.setValue("delegate.rowBounds.offset", RowBounds.NO_ROW_OFFSET); - metaStatementHandler.setValue("delegate.rowBounds.limit", RowBounds.NO_ROW_LIMIT); - } - } - return invocation.proceed(); - } - - @Override - public Object plugin(Object target) { - return Plugin.wrap(target, this); - } - - @Override - public void setProperties(Properties properties) { - //To change body of implemented methods use File | Settings | File Templates. - } - -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/service/AbstractGenericService.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/service/AbstractGenericService.java deleted file mode 100755 index 5cf0437b6..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/service/AbstractGenericService.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.service; - -import com.webank.wedatasphere.exchangis.common.dao.IBaseDao; -import com.webank.wedatasphere.exchangis.common.util.page.PageList; -import com.webank.wedatasphere.exchangis.common.util.page.PageQuery; -import com.webank.wedatasphere.exchangis.common.util.page.Paginator; -import org.apache.ibatis.session.RowBounds; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.transaction.annotation.Transactional; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author devendeng on 2018/8/20. - */ - -public abstract class AbstractGenericService implements IBaseService { - - private static final Logger logger = LoggerFactory.getLogger(AbstractGenericService.class); - - protected abstract IBaseDao getDao(); - - /** - * Add - */ - @Override - public boolean add(T t) { - return getDao().insert(t) > 0; - } - - /** - * Delete - */ - @Override - public boolean delete(List ids) { - return getDao().delete(ids) > 0; - } - - /** - * Delete - */ - @Override - public boolean delete(String ids) { - String[] idsStr = ids.split(","); - List list = new ArrayList(); - for (String id : idsStr) { - list.add(Long.valueOf(id)); - } - logger.info("Delete ids: " + ids); - return delete(list); - } - - /** - * Update - */ - @Override - public boolean update(T t) { - return getDao().update(t) > 0; - } - - /** - * (non-Javadoc) - */ - @Override - @Transactional(readOnly = true) - public long getCount(PageQuery pageQuery) { - return getDao().count(pageQuery); - } - - /** - * Get - */ - @Override - @Transactional(readOnly = true) - public T get(Object id) { - return queryFilter(getDao().selectOne(id)); - } - - /** - * Find page - */ - @Override - @Transactional(readOnly = true) - public PageList findPage(PageQuery pageQuery) { - long totalCount = getDao().count(pageQuery); - int currentPage = pageQuery.getPage(); - int pageSize = pageQuery.getPageSize(); - PageList page = new PageList(new Paginator(currentPage, pageSize, (int) totalCount)); - int offset = currentPage > 0 ? (currentPage - 1) * pageSize : 0; - List result = getDao().findPage(pageQuery, new RowBounds(offset, pageSize)); - page.setData(queryFilter(result)); - return page; - } - - /** - * Select all - * - * @return - */ - @Override - @Transactional(readOnly = true) - public List selectAllList(PageQuery pageQuery) { - return queryFilter(getDao().selectAllList(pageQuery)); - } - - /** - * Filter of query - * - * @param t data - * @return - */ - protected T queryFilter(T t) { - return t; - } - - final protected List queryFilter(List list) { - List result = new ArrayList<>(); - for (T t : list) { - result.add(queryFilter(t)); - } - return result; - } - - -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/service/IBaseService.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/service/IBaseService.java deleted file mode 100755 index 00dfe7e75..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/service/IBaseService.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.service; - -import com.webank.wedatasphere.exchangis.common.util.page.PageList; -import com.webank.wedatasphere.exchangis.common.util.page.PageQuery; - -import java.util.List; - -/** - * Created by devendeng on 2018/8/20. - */ -public interface IBaseService { - - /** - * Add - * - * @param t - * @return - */ - boolean add(T t); - - /** - * s - * Delete batch(collection) - * - * @return - */ - boolean delete(List ids); - - /** - * Delete batch - * - * @param ids - */ - boolean delete(String ids); - - /** - * Update - * - * @param t - * @return - */ - boolean update(T t); - - /** - * Count - * - * @param pageQuery - * @return - */ - long getCount(PageQuery pageQuery); - - /** - * Select - * - * @param id - * @return - */ - T get(Object id); - - /** - * Find - * - * @return - */ - PageList findPage(PageQuery pageQuery); - - /** - * Select all - * - * @return - */ - List selectAllList(PageQuery pageQuery); -} \ No newline at end of file diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/AESUtils.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/AESUtils.java deleted file mode 100755 index e116b1d75..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/AESUtils.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.util; - -import org.springframework.util.FileCopyUtils; - -import javax.crypto.*; -import javax.crypto.spec.SecretKeySpec; -import java.io.*; -import java.nio.charset.StandardCharsets; -import java.security.NoSuchAlgorithmException; -import java.util.Base64; - -/** - * @author davidhua - * 2019/4/23 - */ -public class AESUtils { - public static byte[] generateKey(){ - KeyGenerator generator = null; - try { - generator = KeyGenerator.getInstance("AES"); - } catch (NoSuchAlgorithmException e) { - throw new RuntimeException(e.getMessage(), e); - } - generator.init(128); - SecretKey secretKey = generator.generateKey(); - return secretKey.getEncoded(); - } - - public static void generateKey(String keystorePath){ - try { - String base64Str = Base64.getEncoder() - .encodeToString(generateKey()); - FileCopyUtils.copy(base64Str, new BufferedWriter(new OutputStreamWriter( - new FileOutputStream(keystorePath)))); - } catch (IOException e) { - throw new RuntimeException(e.getMessage(), e); - } - } - - public static String encrypt(String src, byte[] keyRaw){ - try { - Cipher cipher = Cipher.getInstance("AES"); - SecretKeySpec keySpec = new SecretKeySpec(keyRaw, "AES"); - cipher.init(Cipher.ENCRYPT_MODE, keySpec); - byte[] encrypted = cipher - .doFinal(src.getBytes(StandardCharsets.UTF_8)); - return new String(Base64.getEncoder().encode(encrypted), StandardCharsets.UTF_8); - - } catch (Exception e) { - throw new RuntimeException(e.getMessage(), e); - } - } - - public static String decrypt(String src, byte[] keyRaw){ - try{ - SecretKeySpec keySpec = new SecretKeySpec(keyRaw, "AES"); - Cipher cipher = Cipher.getInstance("AES"); - cipher.init(Cipher.DECRYPT_MODE, keySpec); - byte[] decoded = Base64.getDecoder().decode(src); - byte[] decrypted = cipher.doFinal(decoded); - return new String(decrypted, StandardCharsets.UTF_8); - }catch(Exception ex){ - throw new RuntimeException(ex.getMessage(), ex); - } - } - -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/CryptoUtils.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/CryptoUtils.java deleted file mode 100755 index 039b2488d..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/CryptoUtils.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.util; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.nio.charset.StandardCharsets; -import java.security.*; -import java.security.interfaces.RSAPrivateKey; -import java.security.interfaces.RSAPublicKey; -import java.security.spec.PKCS8EncodedKeySpec; -import java.security.spec.X509EncodedKeySpec; -import java.sql.Time; -import java.util.concurrent.TimeUnit; - -import org.apache.commons.codec.EncoderException; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.tuple.MutablePair; -import org.apache.commons.lang3.tuple.Pair; - -import javax.crypto.Cipher; - -/** - * @author devendeng - * For cryptor - */ -public class CryptoUtils { - /** - * Random seed - */ - private static SecureRandom secureRandom = new SecureRandom(); - - private CryptoUtils(){ - } - /** - * Serialize the object to string - * @param o Object - * @return String - * @throws Exception e - */ - public static String object2String(Serializable o) throws Exception { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(bos); - oos.writeObject(o); - oos.flush(); - oos.close(); - bos.close(); - return new String(new Base64().encode(bos.toByteArray())); - } - - /** - * Deserialize the string to object - * - * @param str String - * @return Object - * @throws IOException - * @throws ClassNotFoundException - */ - public static Object string2Object(String str) throws IOException, ClassNotFoundException { - ByteArrayInputStream bis = new ByteArrayInputStream(new Base64().decode(str.getBytes())); - ObjectInputStream ois = new ObjectInputStream(bis); - Object o = ois.readObject(); - bis.close(); - ois.close(); - return o; - } - - /** - * MD5 algorithm - * @param source source string - * @param salt salt - * @param iterator iterator - * @return value encrypted - */ - public static String md5(String source, String salt, int iterator){ - StringBuilder token = new StringBuilder(); - try{ - MessageDigest digest = MessageDigest.getInstance("md5"); - if(StringUtils.isNotEmpty(salt)){ - digest.update(salt.getBytes(StandardCharsets.UTF_8)); - } - byte[] result = digest.digest(source.getBytes()); - for(int i = 0; i < iterator - 1; i++){ - digest.reset(); - result = digest.digest(result); - } - for (byte aResult : result) { - int temp = aResult & 0xFF; - if (temp <= 0xF) { - token.append("0"); - } - token.append(Integer.toHexString(temp)); - } - }catch(Exception e){ - throw new RuntimeException(e.getMessage()); - } - return token.toString(); - } - - /** - * Generate key pair - * @return - */ - public static Pair generateRSAKeyPair(){ - try { - KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("RSA"); - keyPairGen.initialize(1024, secureRandom); - KeyPair keyPair = keyPairGen.generateKeyPair(); - return new MutablePair<>((RSAPrivateKey) keyPair.getPrivate(), (RSAPublicKey) keyPair.getPublic()); - } catch (NoSuchAlgorithmException e) { - throw new RuntimeException(e); - } - } - - /** - * Encrypt by RSA algorithm - * @param source source data - * @param publicKey public key - * @return - * @throws Exception - */ - public static String encryptRSA(String source, String publicKey) throws Exception{ - byte[] publicKeyByte = Base64.decodeBase64(publicKey); - KeyFactory keyFactory = KeyFactory.getInstance("RSA"); - RSAPublicKey rsaPublicKey = (RSAPublicKey)keyFactory.generatePublic(new X509EncodedKeySpec(publicKeyByte)); - Cipher cipher = Cipher.getInstance("RSA"); - //Use publicKey to encrypt - cipher.init(Cipher.ENCRYPT_MODE, rsaPublicKey); - byte[] encrypted = cipher.doFinal(source.getBytes(StandardCharsets.UTF_8)); - return Base64.encodeBase64String(encrypted); - } - - /** - * Decrypt by RSA algorithm - * @param encrypted data encrypted - * @param privateKey private key - * @return - * @throws Exception - */ - public static String decryptRSA(String encrypted, String privateKey) throws Exception{ - byte[] privateKeyByte = Base64.decodeBase64(privateKey); - byte[] encryptedByte = Base64.decodeBase64(encrypted.getBytes(StandardCharsets.UTF_8)); - KeyFactory keyFactory = KeyFactory.getInstance("RSA"); - RSAPrivateKey rsaPrivateKey = (RSAPrivateKey)keyFactory.generatePrivate(new PKCS8EncodedKeySpec(privateKeyByte)); - Cipher cipher = Cipher.getInstance("RSA"); - //Use privateKey to decrypt - cipher.init(Cipher.DECRYPT_MODE, rsaPrivateKey); - byte[] decrypted = cipher.doFinal(encryptedByte); - return new String(decrypted, StandardCharsets.UTF_8); - } - -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/JobUtils.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/JobUtils.java deleted file mode 100755 index c94aa041e..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/JobUtils.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.util; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.StringWriter; -import java.util.Calendar; -import java.util.HashMap; -import java.util.Map; -import java.util.regex.Matcher; - -/** - * Created by devendeng on 2018/10/22. - */ -public class JobUtils { - private static Logger logger = LoggerFactory.getLogger(JobUtils.class); - - /** - * Replace the parameter in variables - * @param map - * @param key - * @param subValue - */ - private static void replaceParameters(Map map, String key, - StringBuffer subValue) { - StringBuilder subKey = new StringBuilder(); - char[] chars = key.toCharArray(); - int i=0; - boolean isParamter = false; - int count = 0; - while(i 0){ - subKey.append(chars[i]).append(chars[i+1]); - } - count++; - i=i+2; - continue; - }else if(chars[i] == '}'){ - count--; - if(count == 0){ - String parameter = subKey.toString(); - if(parameter.contains("${") && parameter.contains("}")){ - StringBuffer sb = new StringBuffer(); - replaceParameters(map, parameter, sb); - parameter = sb.toString(); - } - String v = map.get(parameter); - isParamter = false; - subKey.delete(0, subKey.length()); - if(null != v && !"".equals(v)){ - if(v.contains("${") && v.contains("}")){ - replaceParameters(map, v, subValue); - }else{ - subValue.append(v); - } - }else{ - subValue.append("${").append(parameter).append("}"); - } - i=i+1; - continue; - } - - } - if(isParamter){ - subKey.append(chars[i]); - }else{ - subValue.append(chars[i]); - } - i=i+1; - } - } - - public static String render(String template, long time){ - DateTool tool = new DateTool(); - Map map = new HashMap<>(2); - template = renderDt(template, time); - map.put("yyyyMMdd", tool.format("yyyyMMdd", time)); - map.put("yyyy-MM-dd", tool.format("yyyy-MM-dd", time)); - map.put("timestamp", tool.currentTimestamp()); - return PatternInjectUtils.inject(template, map, true, true, false); - } - - public static String render(String template){ - Calendar calendar=Calendar.getInstance(); - return render(template, calendar.getTimeInMillis()); - } - - private static String renderDt(String template, long time){ - if(template==null){ - return null; - } - Matcher matcher= DateTool.TIME_REGULAR_PATTERN.matcher(template); - while(matcher.find()){ - try { - String m = template.substring(matcher.start(), matcher.end()); - StringWriter sw = new StringWriter(); - DateTool dataTool = new DateTool(time); - String symbol = matcher.group(1); - if (null != symbol) { - if (DateTool.MONTH_BEGIN_SYMBOL.equals(symbol)) { - dataTool.getMonthBegin(0); - } else if (DateTool.MONTH_END_SYMBOL.equals(symbol)) { - dataTool.getMonthEnd(0); - } else{ - dataTool.addDay(-1); - } - } - String calculate = matcher.group(3); - String number = matcher.group(4); - if (null != calculate && null != number) { - if ("+".equals(calculate)) { - dataTool.addDay(Integer.parseInt(number)); - } else if ("-".equals(calculate)) { - dataTool.addDay(-Integer.parseInt(number)); - } - } - String formatSymbol = matcher.group(2); - if(DateTool.LINE_SYMBOL.equals(formatSymbol)){ - sw.append(dataTool.format("yyyy-MM-dd")); - }else{ - sw.append(dataTool.format("yyyyMMdd")); - } - template=template.replace(m, sw.toString()); - matcher= DateTool.TIME_REGULAR_PATTERN.matcher(template); - }catch(Exception e){ - logger.error("TASK_ERROR, cannot render job's configuration, message: {}", e.getMessage(), e); - break; - } - } - //${yesterday} - return template.replace("${yesterday}",new DateTool(time).addDay(-1).format("yyyyMMdd")); - } - -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/PatternInjectUtils.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/PatternInjectUtils.java deleted file mode 100755 index 96345ba83..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/PatternInjectUtils.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.util; - -import com.webank.wedatasphere.exchangis.common.util.json.Json; -import org.apache.commons.lang3.StringEscapeUtils; -import org.apache.commons.lang3.StringUtils; - -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * @author davidhua - * 2018/10/26 - */ -public class PatternInjectUtils { - - private PatternInjectUtils(){ - - } - - private static final String PARAMETER_PREFIX = "[#|$]"; - - private static final String ASSIGN_SYMBOL = "="; - - private static final Pattern REGEX = Pattern.compile( - "(" + ASSIGN_SYMBOL + "?)" + - "("+ PARAMETER_PREFIX + ")" + - "\\{([\\w-.]+)[|]?([^}]*)}?" - ); - - /** - * Inject pattern - * @param template - * @param params - * @param useDefault use default Value - * @return - */ - public static String inject(String template, Object[] params, boolean useDefault, boolean escape, boolean placeholder){ - Matcher matcher = REGEX.matcher(template); - StringBuffer sb = new StringBuffer(); - int offset = 0; - while(matcher.find()){ - String value = ""; - String extra = ""; - if( offset < params.length && null != params[offset] ){ - Object paramsV = params[offset]; - if( paramsV instanceof String || paramsV instanceof Enum || - paramsV.getClass().isPrimitive() || - isWrapClass(paramsV.getClass())){ - value = escape? StringEscapeUtils.escapeJava(String.valueOf(paramsV)) - : String.valueOf(paramsV); - }else{ - //For default not to escape - value = "$".equals(matcher.group(2)) ? - Json.toJson(paramsV, null) : - StringEscapeUtils.escapeJava(Json.toJson(paramsV, null)); - } - if( null != matcher.group(1) - && !"".equals(matcher.group(1))){ - extra = matcher.group(1); - } - offset ++; - }else if(null != matcher.group(4) && useDefault){ - //For default not to escape - value = matcher.group(4); - } - if(StringUtils.isBlank(value) && !useDefault){ - value = "\"" + (escape?StringEscapeUtils.escapeJava(matcher.group(3)) - : matcher.group(3)); - }else if(!"$".equals(matcher.group(2)) && placeholder){ - value = "\"" + StringEscapeUtils.escapeJava(value) + "\""; - } - String result = (extra + value).replace("$", "\\$"); - matcher.appendReplacement(sb, result); - } - matcher.appendTail(sb); - return sb.toString().replace("\\$","$"); - } - public static String inject(String pattern, Object[] params){ - return inject(pattern, params, true, true, true); - } - - /** - * Inject pattern - * @param template - * @param params - * @param useDefault - * @return - */ - public static String inject(String template, Map params, boolean useDefault, boolean escape, boolean placeholder){ - Matcher matcher = REGEX.matcher(template); - StringBuffer sb = new StringBuffer(); - //will be more faster? - while(matcher.find()){ - String injected = matcher.group(3); - if(null != injected && !"".equals(injected)){ - int flag = 0; - String value = ""; - String extra = ""; - for(Map.Entry entry : params.entrySet()){ - if(injected.equals(entry.getKey()) && null != entry.getValue()){ - Object entryV = entry.getValue(); - if(entryV instanceof String || entryV instanceof Enum || - entryV.getClass().isPrimitive() || - isWrapClass(entryV.getClass())){ - value = escape? StringEscapeUtils.escapeJava(String.valueOf(entryV)) - : String.valueOf(entryV); - }else{ - //For default not to escape - value = "$".equals(matcher.group(2)) ? - Json.toJson(entryV, null) : - StringEscapeUtils.escapeJava(Json.toJson(entryV, null)); - } - if(null != matcher.group(1) - || !"".equals(matcher.group(1))){ - extra = matcher.group(1); - } - flag = 1; - break; - } - } - if(flag == 0 && null != matcher.group(4) && useDefault){ -// value = escape? StringEscapeUtils.escapeJava(String.valueOf(matcher.group(4))) -// : matcher.group(4); - //For default not to escape - value = matcher.group(4); - } - if(StringUtils.isBlank(value) && !useDefault){ - value = "\"*#{" + (escape?StringEscapeUtils.escapeJava(matcher.group(3)) - : matcher.group(3)) + "}*\""; - } else if(!"$".equals(matcher.group(2)) && placeholder){ - value = "\"" + StringEscapeUtils.escapeJava(value) + "\""; - } - String result = (extra + value).replace("$", "\\$"); - matcher.appendReplacement(sb, result); - } - } - matcher.appendTail(sb); - String print = sb.toString(); - return print.replace("\\$","$").replace("",""); - } - - public static String injectPattern(String template, String valuePattern){ - Matcher matcher = REGEX.matcher(template); - StringBuffer sb = new StringBuffer(); - while(matcher.find()){ - String extra = matcher.group(1); - String value = StringEscapeUtils.escapeJava(matcher.group(3)); - value = (extra + value.replaceAll("[\\s\\S]+", valuePattern)) - .replace("$", "\\$"); - matcher.appendReplacement(sb, value); - } - matcher.appendTail(sb); - return sb.toString().replace("\\$", "$"); - } - - public static String inject(String template, Map params){ - return inject(template, params, true, true, true); - } - - - private static boolean isWrapClass(Class clz){ - try{ - return ((Class)clz.getField("TYPE").get(null)).isPrimitive(); - }catch(Exception e){ - return false; - } - } - -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/ProcessUtil.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/ProcessUtil.java deleted file mode 100755 index 698470de8..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/ProcessUtil.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.util; - -import org.apache.commons.lang3.StringUtils; - -import java.io.IOException; -import java.lang.management.ManagementFactory; -import java.nio.file.Files; -import java.nio.file.Paths; - -/** - * @author davidhua - * 2020/4/19 - */ -public class ProcessUtil{ - /** - * Mount PID file - * @param pidFile - * @throws IOException - */ - public static void mountPIDFile(String pidFile) throws IOException { - if(StringUtils.isNotBlank(pidFile)){ - String name = ManagementFactory.getRuntimeMXBean().getName(); - String pid = name.split("@")[0].trim(); - Files.write(Paths.get(pidFile), pid.getBytes()); - Runtime.getRuntime().addShutdownHook(new Thread(() -> { - try { - Files.delete(Paths.get(pidFile)); - } catch (IOException e) { - //Ignore - } - })); - } - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/Unicode.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/Unicode.java deleted file mode 100755 index 7849210b9..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/Unicode.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.util; - -import org.apache.commons.lang3.StringUtils; - -/** - * @author davidhua - * 2019/4/13 - */ -public class Unicode { - public static String unicodeToString(String unicode){ - if(StringUtils.isEmpty(unicode)){ - return null; - } - StringBuilder sb = new StringBuilder(); - int i = -1; - int pos = 0; - while((i = unicode.indexOf("\\u", pos)) != -1){ - sb.append(unicode.substring(pos, i)); - if(i + 5 < unicode.length()){ - pos = i + 6; - sb.append((char)Integer.parseInt(unicode.substring(i + 2, i + 6), 16)); - } - } - sb.append(unicode.substring(pos)); - return sb.toString(); - } - - public static String stringToUnicode(String string){ - if(StringUtils.isEmpty(string)){ - return null; - } - char[] bytes = string.toCharArray(); - StringBuilder unicode = new StringBuilder(); - for(int i = 0; i < bytes.length; i++){ - String hexString = Integer.toHexString(bytes[i]); - unicode.append("\\u"); - if(hexString.length() < 4){ - unicode.append("0000", hexString.length(), 4); - } - unicode.append(hexString); - } - return unicode.toString(); - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/json/Json.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/json/Json.java deleted file mode 100755 index 0c3b39c44..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/json/Json.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.util.json; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.*; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; - -/** - * @author davidhua - * Json utils - * 2018/9/3 - */ -public class Json { - private static final String PREFIX = "["; - private static final String SUFFIX = "]"; - private static final Logger logger = LoggerFactory.getLogger(Json.class); - - private static ObjectMapper mapper; - - static{ - mapper = new ObjectMapper(); - mapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true); - mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true); - mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true); - mapper.configure(DeserializationFeature.READ_ENUMS_USING_TO_STRING, true); - mapper.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true); - mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_CONTROL_CHARS, true); - //empty beans allowed - mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); - //ignore unknown properties - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - //cancel to scape non ascii - mapper.configure(JsonGenerator.Feature.ESCAPE_NON_ASCII, false); - } - private Json(){} - - @SuppressWarnings("unchecked") - public static T fromJson(String json, Class clazz, Class... parameters){ - if(StringUtils.isNotBlank(json)){ - try{ - if(parameters.length > 0){ - return (T)mapper.readValue(json, mapper.getTypeFactory().constructParametricType(clazz, parameters)); - } - if(json.startsWith(PREFIX) - && json.endsWith(SUFFIX)){ - JavaType javaType = mapper.getTypeFactory() - .constructParametricType(ArrayList.class, clazz); - return mapper.readValue(json, javaType); - } - return (T)mapper.readValue(json, clazz); - } catch (Exception e) { - logger.info(e.getLocalizedMessage()); - throw new RuntimeException(e); - } - } - return null; - } - - public static T fromJson(InputStream stream, Class clazz, Class... parameters){ - StringBuilder builder = new StringBuilder(); - String jsonStr = null; - try{ - BufferedReader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8)); - while((jsonStr = reader.readLine()) != null){ - builder.append(jsonStr); - } - reader.close(); - }catch(Exception e){ - logger.info(e.getLocalizedMessage()); - throw new RuntimeException(e); - } - return fromJson(builder.toString(), clazz, parameters); - } - - public static String toJson(Object obj, Class model){ - ObjectWriter writer = mapper.writer(); - if(null != obj){ - try{ - if(null != model){ - writer = writer.withView(model); - } - return writer.writeValueAsString(obj); - } catch (JsonProcessingException e) { - logger.info(e.getLocalizedMessage()); - throw new RuntimeException(e); - } - } - return null; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/machine/MachineInfo.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/machine/MachineInfo.java deleted file mode 100755 index 0e3af2456..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/machine/MachineInfo.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.util.machine; - -import java.lang.management.ManagementFactory; -import java.math.BigDecimal; -import java.net.Inet4Address; -import java.net.InetAddress; -import java.net.NetworkInterface; -import java.net.SocketException; -import java.util.Enumeration; - -import com.sun.management.OperatingSystemMXBean; -import org.apache.commons.lang.StringUtils; -import org.hyperic.sigar.Sigar; -import org.hyperic.sigar.SigarException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author davidhua - * 2018/9/12 - */ -public class MachineInfo{ - private static final Logger LOG = LoggerFactory.getLogger(MachineInfo.class); - private static final String LOCAL_ADDRESS = "127.0.0.1"; - private static Sigar sigar; - static{ - sigar = new Sigar(); - } - /** - * Get rate of used memory - * @return - */ - public static double memoryRate(){ - - return memoryRate(-1); - } - - public static long memoryTotal(){ - try{ - return sigar.getMem().getTotal(); - }catch(SigarException e){ - LOG.error(e.getMessage()); - } - return 0L; - } - - public static long memoryUsed(){ - try{ - return sigar.getMem().getActualUsed(); - }catch(SigarException e){ - LOG.error(e.getMessage()); - } - return 0L; - } - - public static double memoryRate(int scale){ - double result = 0.0; - try { - long free = sigar.getMem().getActualFree(); - long used = sigar.getMem().getActualUsed(); - result = (double)used/(double)(used + free); - }catch(SigarException e){ - LOG.error(e.getMessage()); - } - if(scale > 0){ - return BigDecimal.valueOf(result).setScale(scale, BigDecimal.ROUND_HALF_UP).doubleValue(); - } - return result; - } - public static double memoryRate0(int scale){ - OperatingSystemMXBean osmxb = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); - long totalMem = osmxb.getTotalPhysicalMemorySize(); - long freeMem = osmxb.getFreePhysicalMemorySize(); - double result = (double)(totalMem - freeMem) / (double) totalMem; - if(scale > 0){ - BigDecimal bd = BigDecimal.valueOf(result); - return bd.setScale(scale, BigDecimal.ROUND_HALF_UP).doubleValue(); - } - return result; - } - - /** - * use sigar - * dependencies: - * windows: sigar-amd64-winnt.dll、sigar-x86-winnt.dll、sigar-x86-winnt.lib - * Linux: libsigar-amd64-linux.so、libsigar-x86-linux.so - * @param scale - * @return - */ - public static double cpuRate(int scale){ - double result = 0.0; - try { - result = sigar.getCpuPerc().getCombined(); - } catch (SigarException e) { - LOG.error(e.getMessage()); - } - if(scale > 0){ - BigDecimal bd = BigDecimal.valueOf(result); - return bd.setScale(scale, BigDecimal.ROUND_HALF_UP).doubleValue(); - } - return result; - } - - public static String getIpAddress(String interfaceName){ - try{ - Enumeration nis = NetworkInterface.getNetworkInterfaces(); - while(nis.hasMoreElements()){ - NetworkInterface networkInterface = nis.nextElement(); - Enumeration ias = networkInterface.getInetAddresses(); - if(StringUtils.isBlank(interfaceName) || interfaceName.equalsIgnoreCase(networkInterface.getName())) { - while (ias.hasMoreElements()) { - InetAddress inetAddress = ias.nextElement(); - if (inetAddress instanceof Inet4Address && - !inetAddress.getHostAddress().equals(LOCAL_ADDRESS)) { - return inetAddress.getHostAddress(); - } - } - } - } - } catch (SocketException e) { - LOG.error(e.getMessage()); - } - return null; - } - - public static String getIpAddress(){ - return getIpAddress(""); - } - - public static String getProcPath(){ - String pid = ManagementFactory.getRuntimeMXBean().getName(); - pid = pid.substring(0, pid.indexOf('@')); - try { - return sigar.getProcArgs(pid)[0]; - } catch (SigarException e) { - LOG.error(e.getMessage()); - return ""; - } - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/page/PageList.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/page/PageList.java deleted file mode 100755 index 77e402556..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/page/PageList.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.util.page; - -import java.io.Serializable; -import java.util.List; - -/** - * Created by devendeng on 2018/8/20. - */ -public class PageList implements Serializable { - - private static final long serialVersionUID = 1412759446332294208L; - - /** - * Page size - */ - private int pageSize; - /** - * Page number - */ - private int page; - /** - * Total of items - */ - private int totalItems; - - private int totalPages; - - private int code = 0; - private String message; - - private List data; - - public PageList() { - } - - - public PageList(int page, int pageSize, int totalItems) { - this.page = page; - this.pageSize = pageSize; - this.totalItems = totalItems; - } - - public PageList(Paginator p) { - this.page = p.getPage(); - this.pageSize = p.getPageSize(); - this.totalItems = p.getTotalItems(); - } - - public int getPageSize() { - return pageSize; - } - - public void setPageSize(int pageSize) { - this.pageSize = pageSize; - } - - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getTotalItems() { - return totalItems; - } - - public void setTotalItems(int totalItems) { - this.totalItems = totalItems; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - if (totalItems <= 0) { - totalPages = 0; - } - if (pageSize <= 0) { - totalPages = 0; - } - - totalPages = totalItems / pageSize; - if (totalItems % pageSize > 0) { - totalPages++; - } - } - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public int getTotalPages() { - return totalPages; - } -} \ No newline at end of file diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/page/PageQuery.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/page/PageQuery.java deleted file mode 100755 index 1698c3643..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/page/PageQuery.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.util.page; - -/** - * Created by devendeng on 2018/8/20. - */ -public class PageQuery implements java.io.Serializable { - private static final long serialVersionUID = -8000900575354501298L; - - public static final int DEFAULT_PAGE_SIZE = 10; - /** - * Page num - */ - private int page; - /** - * Page size - */ - private int pageSize = DEFAULT_PAGE_SIZE; - - public PageQuery() { - } - - public PageQuery(int pageSize) { - this.pageSize = pageSize; - } - - public PageQuery(PageQuery query) { - this.page = query.page; - this.pageSize = query.pageSize; - } - - public PageQuery(int pageNo, int pageSize) { - this.page = pageNo; - this.pageSize = pageSize; - } - - public int getPage() { - return page; - } - - public void setPage(int pageNo) { - this.page = pageNo; - } - - public int getPageSize() { - return pageSize; - } - - public void setPageSize(int pageSize) { - this.pageSize = pageSize; - } - - @Override - public String toString() { - return "page:" + page + ",pageSize:" + pageSize; - } - -} \ No newline at end of file diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/page/Paginator.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/page/Paginator.java deleted file mode 100755 index 156649bb4..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/page/Paginator.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.util.page; - -/** - * Created by devendeng on 2018/8/20. - */ -public class Paginator implements java.io.Serializable { - private static final long serialVersionUID = 6089482156906595931L; - - private static final int DEFAULT_SLIDERS_COUNT = 7; - - /** - * Page size - */ - private int pageSize; - /** - * Page num - */ - private int page; - /** - * Total of items - */ - private int totalItems; - - public Paginator(int page, int pageSize, int totalItems) { - super(); - this.pageSize = pageSize; - this.totalItems = totalItems; - this.page = computePageNo(page); - } - - /** - * Get current page - */ - public int getPage() { - return page; - } - - public int getPageSize() { - return pageSize; - } - - /** - * Total items - * - * @return number - */ - public int getTotalItems() { - return totalItems; - } - - /** - * If is the first page - * @return page - */ - public boolean isFirstPage() { - return page <= 1; - } - - /** - * If is the last page - * @return - */ - public boolean isLastPage() { - return page >= getTotalPages(); - } - - public int getPrePage() { - if (isHasPrePage()) { - return page - 1; - } else { - return page; - } - } - - public int getNextPage() { - if (isHasNextPage()) { - return page + 1; - } else { - return page; - } - } - - /** - * If the page is disabled - * @param page Page num - * @return boolean - */ - public boolean isDisabledPage(int page) { - return ((page < 1) || (page > getTotalPages()) || (page == this.page)); - } - - /** - * If it has previous page - * @return - */ - public boolean isHasPrePage() { - return (page - 1 >= 1); - } - - /** - * If it has next page - * - * @return - */ - public boolean isHasNextPage() { - return (page + 1 <= getTotalPages()); - } - - /** - * Start line - **/ - public int getStartRow() { - if(getPageSize() <= 0 || totalItems <= 0){ - return 0; - } - return page > 0 ? (page - 1) * getPageSize() + 1 : 0; - } - - /** - * End line - **/ - public int getEndRow() { - return page > 0 ? Math.min(pageSize * page, getTotalItems()) : 0; - } - - /** - * offset - **/ - public int getOffset() { - return page > 0 ? (page - 1) * getPageSize() : 0; - } - - /** - * limit - **/ - public int getLimit() { - if (page > 0) { - return Math.min(pageSize * page, getTotalItems()) - (pageSize * (page - 1)); - } else { - return 0; - } - } - - /** - * Get total - * - * @return - */ - public int getTotalPages() { - if (totalItems <= 0) { - return 0; - } - if (pageSize <= 0) { - return 0; - } - - int count = totalItems / pageSize; - if (totalItems % pageSize > 0) { - count++; - } - return count; - } - - protected int computePageNo(int page) { - return computePageNumber(page, pageSize, totalItems); - } - - /** - * Get slider - * - * @return - */ - public Integer[] getSlider() { - return slider(DEFAULT_SLIDERS_COUNT); - } - - /** - * - * @return - */ - public Integer[] slider(int slidersCount) { - return generateLinkPageNumbers(getPage(), (int) getTotalPages(), slidersCount); - } - - private static int computeLastPageNumber(int totalItems, int pageSize) { - if(pageSize <= 0){ - return 1; - } - int result = (int) (totalItems % pageSize == 0 ? - totalItems / pageSize - : totalItems / pageSize + 1); - if(result <= 1) { - result = 1; - } - return result; - } - - private static int computePageNumber(int page, int pageSize, int totalItems) { - if (page <= 1) { - return 1; - } - if (Integer.MAX_VALUE == page - || page > computeLastPageNumber(totalItems, pageSize)) { //last page - return computeLastPageNumber(totalItems, pageSize); - } - return page; - } - - private static Integer[] generateLinkPageNumbers(int currentPageNumber, int lastPageNumber, int count) { - int avg = count / 2; - - int startPageNumber = currentPageNumber - avg; - if (startPageNumber <= 0) { - startPageNumber = 1; - } - - int endPageNumber = startPageNumber + count - 1; - if (endPageNumber > lastPageNumber) { - endPageNumber = lastPageNumber; - } - - if (endPageNumber - startPageNumber < count) { - startPageNumber = endPageNumber - count; - if (startPageNumber <= 0) { - startPageNumber = 1; - } - } - - java.util.List result = new java.util.ArrayList(); - for (int i = startPageNumber; i <= endPageNumber; i++) { - result.add(new Integer(i)); - } - return result.toArray(new Integer[result.size()]); - } - - @Override - public String toString() { - return "page:" + page + " pageSize:" + pageSize + " totalItems:" + totalItems; - } - -} \ No newline at end of file diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/spring/AppUtil.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/spring/AppUtil.java deleted file mode 100755 index 60e582ff2..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/common/util/spring/AppUtil.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.common.util.spring; - -import com.webank.wedatasphere.exchangis.common.auth.AuthConstraints; -import org.apache.commons.lang3.StringUtils; -import org.apache.tomcat.util.http.fileupload.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.BeansException; -import org.springframework.boot.web.context.WebServerInitializedEvent; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Component; - -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import java.io.*; -import java.net.*; -import java.util.UUID; - -/** - * @author davidhua - * 2018/9/4 - */ -@Component -public class AppUtil implements ApplicationContextAware,ApplicationListener { - - private static final String LOCAL_ADDR = "127.0.0.1"; - - private static final Logger logger = LoggerFactory.getLogger(AppUtil.class); - - private static String port; - - private static final String HTTP_HEADER = "http://"; - - private static ApplicationContext applicationContext; - - @Override - public void setApplicationContext(ApplicationContext app) throws BeansException { - applicationContext = app; - } - - @Override - public void onApplicationEvent(WebServerInitializedEvent webServerInitializedEvent) { - port = String.valueOf(webServerInitializedEvent.getWebServer().getPort()); - } - - public static Object getBean(String name){ - return applicationContext.getBean(name); - } - - public static T getBean(Class clazz){ - return applicationContext.getBean(clazz); - } - - public static T getBean(String name, Class clazz){ - return applicationContext.getBean(name, clazz); - } - - /** - * get the Ip and port for Application - * @return http://{ip}:{port} - */ - - public static String getIpAndPort(){ - String ip = null; - try { - ip = Inet4Address.getLocalHost().getHostAddress(); - } catch (UnknownHostException e) { - ip = "127.0.0.1"; - } - return String.format("http://%s:%s", ip, port); - } - - public static String newFileName(String originName){ - String newName = UUID.randomUUID().toString().replace("-", ""); - if(StringUtils.isNotBlank(originName)){ - int index = originName.lastIndexOf("."); - if(index >= 0){ - newName += originName.substring(index); - } - } - return newName; - } - - /** - * remove http file - * @param source - */ - public static void removeFile(String source){ - HttpURLConnection connection = null; - try{ - if(source.startsWith(HTTP_HEADER)){ - String ip; - try { - ip = InetAddress.getLocalHost().getHostAddress(); - } catch (UnknownHostException e) { - ip = LOCAL_ADDR; - } - if(source.substring(HTTP_HEADER.length()).startsWith(ip)) { - source = source.replace(ip, LOCAL_ADDR); - } - connection = (HttpURLConnection)new URL(source).openConnection(); - connection.addRequestProperty("Cookie",AuthConstraints.DEFAULT_SSO_COOKIE + "=" - + System.getProperty(AuthConstraints.ENV_SERV_TOKEN)); - connection.setRequestMethod("DELETE"); - connection.setConnectTimeout(2000); - connection.setReadTimeout(5000); - connection.setDoOutput(true); - connection.setDoOutput(true); - connection.connect(); - } - }catch(IOException e){ - throw new RuntimeException(e); - }finally{ - if(null != connection){ - connection.disconnect(); - } - } - } - /** - * Download File - * @param source - * @param dst - */ - public static void downloadFile(String source, String dst){ - FileOutputStream out = null; - InputStream in = null; - try { - out = new FileOutputStream(dst); - if(source.startsWith(HTTP_HEADER)){ - String ip; - try { - ip = InetAddress.getLocalHost().getHostAddress(); - } catch (UnknownHostException e) { - ip = LOCAL_ADDR; - } - if(source.substring(HTTP_HEADER.length()).startsWith(ip)) { - source = source.replace(ip, LOCAL_ADDR); - } - HttpURLConnection conn = null; - try { - conn = (HttpURLConnection)new URL(source).openConnection(); - conn.addRequestProperty("Cookie",AuthConstraints.DEFAULT_SSO_COOKIE + "=" - + System.getProperty(AuthConstraints.ENV_SERV_TOKEN)); - logger.info("Cookie: " + AuthConstraints.DEFAULT_SSO_COOKIE + "=" - + System.getProperty(AuthConstraints.ENV_SERV_TOKEN)); - conn.setRequestMethod("GET"); - conn.setConnectTimeout(2000); - conn.setReadTimeout(5000); - conn.setDoOutput(true); - conn.setDoInput(true); - conn.connect(); - in = conn.getInputStream(); - IOUtils.copy(in, out); - } finally{ - if(null != conn){ - conn.disconnect(); - } - } - }else{ - try { - in = new FileInputStream(dst); - IOUtils.copy(in, out); - }finally { - if(null != in){ - in.close(); - } - } - } - } catch (IOException e) { - throw new RuntimeException(e); - } finally{ - if(null != out){ - try { - out.close(); - } catch (IOException e) { - logger.error(e.getMessage()); - } - } - } - } - - /** - * Get cookie value - * @param request - * @param name - * @return - */ - public static String getCookieValue(HttpServletRequest request, String name){ - Cookie[] cookies = request.getCookies(); - if(null != cookies) { - for (Cookie cookie : cookies) { - if (cookie.getName().equals(name) && StringUtils.isNotBlank(cookie.getValue())) { - return cookie.getValue(); - } - } - } - return null; - } - - public static boolean isAjax(HttpServletRequest request){ - return request.getHeader("X-Requested-With") != null && - "XMLHttpRequest".equals(request.getHeader("X-Requested-With")); - } - -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/datasource/Constants.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/datasource/Constants.java deleted file mode 100755 index 85e7f1be8..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/datasource/Constants.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.datasource; - -/** - * @author davidhua - * 2018/9/14 - */ -public class Constants { - - public static final int CONN_DEFAULT_RETRY_COUNT = 2; - - public static final String AUTH_FILE_NAME = "auth"; - - public static final String DEFAULT_ENDPOINT_SPLIT = ","; - /** - * Common parameters - */ - public static final String PARAM_KERBEROS_FILE_PRINCILE = "kerberosPrincipal"; - public static final String PARAM_KB_FILE_PATH = "kerberosKeytabFilePath"; - public static final String PARAM_LADP_USERNAME = "ldapUserName"; - public static final String PARAM_LADP_PASSWORD = "ldapUserPassword"; - public static final String PARAM_DEFAULT_PASSWORD = "password"; - public static final String PARAM_DEFAULT_USERNAME = "username"; - public static final String PARAM_KERBEROS_HOST_NAME = "hostname"; - public static final String PARAM_KERBEROS_REALM_INFO = "realminfo"; - public static final String PARAM_AUTH_TYPE = "authType"; - public static final String PARAM_KEY_FILE_PATH = "keyfilepath"; - public static final String PARAM_KEY_TDSQL_CONFIG = "connParams"; - public static final String PARAM_NULL_FORMAT = "nullFormat"; - public static final String PARAM_SKIP_HEADER = "skipHeader"; - /** - * HIVE data source parameters - */ - public static final String PARAM_META_STORE_PATH = "hiveMetastoreUris"; - /** - * HDFS data source parameters - */ - public static final String PARAM_KERBEROS_BOOLEAN = "haveKerberos"; - public static final String PARAM_HDFS_PATH = "defaultFS"; - public static final String PARAM_HADOOP_CONF_LIST= "hadoopConfig"; - /** - * SFTP data source parameters - */ - public static final String PARAM_SFTP_HOST = "host"; - public static final String PARAM_SFTP_PORT = "port"; - /** - * Elastic search data source parameters - */ - public static final String PARAM_ES_URLS = "elasticUrls"; - - /** - * BinLog data source parameters - */ - public static final String PARAM_BINLOG_DCN = "dcn"; - public static final String PARAM_BINLOG_SET = "set"; - public static final String PARAM_BINLOG_HOST = "host"; - public static final String PARAM_BINLOG_PORT = "port"; - - /** - * Oracle data source parameters - */ - public static final String PARAM_ORACLE_HOST = "host"; - public static final String PARAM_ORACLE_PORT = "port"; - public static final String PARAM_ORACLE_SERVICE_NAME = "serviceName"; - public static final String PARAM_ORACLE_SID = "sid"; -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/datasource/domain/AuthType.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/datasource/domain/AuthType.java deleted file mode 100755 index d75fe9631..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/datasource/domain/AuthType.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.datasource.domain; - -/** - * @author davidhua - */ -public class AuthType { - public static final String KERBERS = "KERBERS"; - public static final String LDAP = "LDAP"; - public static final String KEYFILE = "KEYFILE"; - public static final String DEFAULT = "DEFAULT"; - public static final String NONE = "NONE"; -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/datasource/domain/DataSourceBase.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/datasource/domain/DataSourceBase.java deleted file mode 100755 index ee9bf94ea..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/datasource/domain/DataSourceBase.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.datasource.domain; - -import com.webank.wedatasphere.exchangis.common.util.json.Json; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import org.apache.commons.lang3.StringUtils; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Size; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -/** - * Base class of data source - * @author davidhua - * 2020/4/5 - */ -public class DataSourceBase { - /** - * Id - */ - private long id; - - /** - * Data source name - */ - @NotBlank(message = "{udes.domain.datasource.name.notBlank}") - @Size(max = 100, message = "{udes.domain.datasource.name.maxSize}") - private String sourceName; - - /** - * Description - */ - @Size(max = 100, message = "{udes.domain.datasource.desc.maxSize}") - private String sourceDesc; - - /** - * Data source type - */ - @NotBlank(message = "{udes.domain.datasource.type.notBlank}") - @Size(max = 50, message = "{udes.domain.datasource.type.maxSize}") - private String sourceType; - - /** - * Data source owner - */ - @NotBlank(message = "{udes.domain.datasource.owner.notBlank}") - @Size(max = 50, message = "{udes.domain.datasource.owner.maxSize}") - private String owner; - - /** - * ID of data source model - */ - private Integer modelId; - - /** - * Auth credential for data source connection - */ - private String authCreden; - - /** - * Auth entity for data source connection - */ -// @NotBlank(message = "{udes.domain.datasource.authentity.notBlank}") - private String authEntity; - - /** - * Create time - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date createTime; - - /** - * Create user - */ - private String createUser = "0"; - - /** - * Modify user - */ - private String modifyUser = "0"; - - /** - * Modify time - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date modifyTime; - - /** - * Parameters of connection - */ - private String parameter; - - @JsonIgnore - private Map parameterMap; - - /** - * Project id - */ - private Long projectId = 0L; - - /** - * resolve parameters - * @return - */ - public Map resolveParams(){ - if(null == parameterMap){ - if (StringUtils.isNotBlank(parameter)){ - parameterMap = Json.fromJson(getParameter(), Map.class); - }else { - parameterMap = new HashMap<>(4); - } - } - return parameterMap; - } - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getSourceName() { - return sourceName; - } - - public void setSourceName(String sourceName) { - this.sourceName = sourceName; - } - - public String getSourceDesc() { - return sourceDesc; - } - - public void setSourceDesc(String sourceDesc) { - this.sourceDesc = sourceDesc; - } - - public String getSourceType() { - return sourceType; - } - - public void setSourceType(String sourceType) { - this.sourceType = sourceType; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public Integer getModelId() { - return modelId; - } - - public void setModelId(Integer modelId) { - this.modelId = modelId; - } - - public String getAuthCreden() { - return authCreden; - } - - public void setAuthCreden(String authCreden) { - this.authCreden = authCreden; - } - - public String getAuthEntity() { - return authEntity; - } - - public void setAuthEntity(String authEntity) { - this.authEntity = authEntity; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public String getCreateUser() { - return createUser; - } - - public void setCreateUser(String createUser) { - this.createUser = createUser; - } - - public String getModifyUser() { - return modifyUser; - } - - public void setModifyUser(String modifyUser) { - this.modifyUser = modifyUser; - } - - public Date getModifyTime() { - return modifyTime; - } - - public void setModifyTime(Date modifyTime) { - this.modifyTime = modifyTime; - } - - - public String getParameter() { - return parameter; - } - - public void setParameter(String parameter) { - this.parameterMap = null; - this.parameter = parameter; - } - - public Map getParameterMap() { - return parameterMap; - } - - public void setParameterMap(Map parameterMap) { - this.parameterMap = parameterMap; - } - - @Override - public String toString(){ - return ""; - } - - public Long getProjectId() { - return projectId; - } - - public void setProjectId(Long projectId) { - this.projectId = projectId; - } - -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/executor/domain/ExecSysUser.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/executor/domain/ExecSysUser.java deleted file mode 100755 index a74c3ac01..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/executor/domain/ExecSysUser.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.domain; - -/** - * @author davidhua - * 2019/11/17 - */ -public class ExecSysUser{ - private String username; - - private Integer uid; - - private Integer gid; - - public ExecSysUser(){ - - } - - public ExecSysUser(String username, Integer uid, Integer gid){ - this.username = username; - this.uid = uid; - this.gid = gid; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public Integer getUid() { - return uid; - } - - public void setUid(Integer uid) { - this.uid = uid; - } - - public Integer getGid() { - return gid; - } - - public void setGid(Integer gid) { - this.gid = gid; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/executor/domain/ExecuteReq.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/executor/domain/ExecuteReq.java deleted file mode 100755 index e019f4430..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/executor/domain/ExecuteReq.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.domain; - -import com.webank.wedatasphere.exchangis.job.DefaultParams; -import com.webank.wedatasphere.exchangis.job.domain.JobEngine; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author devendeng on 2018/9/4. - */ -public class ExecuteReq { - - private Long jobId; - - private Long taskId; - - private String jobConfig; - - private JobEngine engine; - - private String execUser; - - private long timeout; - - private long startTime; - - @Deprecated - private String procSrcCode; - - @Deprecated - private Map params = new HashMap<>(); - - private Map engineParams = new HashMap<>(); - - private Map taskParams = new HashMap<>(); - - public Long getJobId() { - return jobId; - } - - public void setJobId(Long jobId) { - this.jobId = jobId; - } - - public Long getTaskId() { - return taskId; - } - - public void setTaskId(Long taskId) { - this.taskId = taskId; - } - - public String getJobConfig() { - return jobConfig; - } - - public void setJobConfig(String jobConfig) { - this.jobConfig = jobConfig; - } - - public long getStartTime() { - return startTime; - } - - public void setStartTime(long startTime) { - this.startTime = startTime; - } - - public String getExecUser() { - return execUser; - } - - public void setExecUser(String execUser) { - this.execUser = execUser; - } - - public long getTimeout() { - return timeout; - } - - public void setTimeout(long timeout) { - this.timeout = timeout; - } - - public Map getTaskParams() { - return taskParams; - } - - public void setTaskParams(Map taskParams) { - this.taskParams = taskParams; - } - - - public String getProcSrcCode() { - return engineParams.get(DefaultParams.Engine.PARAM_PROC_SRC_CODE) == null? - null : String.valueOf(engineParams.get(DefaultParams.Engine.PARAM_PROC_SRC_CODE)); - } - - - public JobEngine getEngine() { - return engine; - } - - public void setEngine(JobEngine engine) { - this.engine = engine; - } - - - public Map getEngineParams() { - return engineParams; - } - - public void setEngineParams(Map engineParams) { - this.engineParams = engineParams; - } - - @Override - public String toString() { - return "ExecuteReq{" + - "jobId=" + jobId + - ", taskId=" + taskId + - ", jobConfig='" + jobConfig + '\'' + - ", startTime=" + startTime + - '}'; - } - -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/executor/domain/ExecuteResp.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/executor/domain/ExecuteResp.java deleted file mode 100755 index 111c43943..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/executor/domain/ExecuteResp.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.domain; - -/** - * Created by devendeng on 2018/9/4. - */ -public class ExecuteResp { - private String executorAddress; - /** - * Status - */ - private ExecuteStatus status; - - private String message; - - private Long taskId; - - private String execUser; - - public String getExecutorAddress() { - return executorAddress; - } - - public void setExecutorAddress(String executorAddress) { - this.executorAddress = executorAddress; - } - - public ExecuteStatus getStatus() { - return status; - } - - public void setStatus(ExecuteStatus status) { - this.status = status; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public Long getTaskId() { - return taskId; - } - - public void setTaskId(Long taskId) { - this.taskId = taskId; - } - - public String getExecUser() { - return execUser; - } - - public void setExecUser(String execUser) { - this.execUser = execUser; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/executor/domain/ExecuteStatus.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/executor/domain/ExecuteStatus.java deleted file mode 100755 index db18e2f77..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/executor/domain/ExecuteStatus.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.domain; - -/** - * - * @author devendeng - * @date 2018/9/4 - */ -public enum ExecuteStatus { - /** - * COMMIT:1, RUNNING:2, KILL:3, SUCCESS:4, FAIL:5, TIMEOUT:6 - */ - NONE(-1), COMMIT(1),RUNNING(2),KILL(3),SUCCESS(4),FAILD(5), RUNNING_TIMEOUT(6); - private int value; - ExecuteStatus(int value){ - this.value = value; - } - - public int getValue() { - return value; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/DefaultParams.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/DefaultParams.java deleted file mode 100755 index e098c5f8d..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/DefaultParams.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.job; - -/** - * @author davidhua - * 2019/5/22 - */ -public class DefaultParams { - - public static class Task { - public static final String PARAM_DATE = "date"; - - public static final String PARAM_EXEC_USER = "execUser"; - - public static final String PARAM_INCR_BEGIN_TIME = "incrBeginTime"; - - public static final String PARAM_INCR_END_TIME = "incrEndTime"; - } - - public static class Engine{ - public static final String PARAM_PROC_SRC_CODE = "procSrcCode"; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExecutorNode.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExecutorNode.java deleted file mode 100755 index bad929fae..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExecutorNode.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.job.domain; - - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude; - -import javax.validation.constraints.NotBlank; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * Executor node - * @author davidhua - */ -@JsonInclude(JsonInclude.Include.NON_EMPTY) -public class ExecutorNode { - private Integer id; - @NotBlank(message = "{udes.domain.executor.address.notBlank}") - private String address; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date heartbeatTime; - private Integer status; - private Float memRate; - private Float cpuRate; - - private List taskStates = new ArrayList<>(); - - private List tabIds = new ArrayList<>(); - - private List tabNames = new ArrayList<>(); - - private boolean defaultNode = false; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public Date getHeartbeatTime() { - return heartbeatTime; - } - - public void setHeartbeatTime(Date heartbeatTime) { - this.heartbeatTime = heartbeatTime; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public Float getMemRate() { - return memRate; - } - - public void setMemRate(Float memRate) { - this.memRate = memRate; - } - - public Float getCpuRate() { - return cpuRate; - } - - public void setCpuRate(Float cpuRate) { - this.cpuRate = cpuRate; - } - - public List getTaskStates() { - return taskStates; - } - - public void setTaskStates(List taskStates) { - this.taskStates = taskStates; - } - - public List getTabIds() { - return tabIds; - } - - public void setTabIds(List tabIds) { - this.tabIds = tabIds; - } - - @Override - public boolean equals(Object obj) { - if(obj instanceof ExecutorNode){ - return address.equals(((ExecutorNode) obj).address); - } - return address.equals(obj); - } - - @Override - public int hashCode() { - return address.hashCode(); - } - - public List getTabNames() { - return tabNames; - } - - public void setTabNames(List tabNames) { - this.tabNames = tabNames; - } - - public boolean isDefaultNode() { - return defaultNode; - } - - public void setDefaultNode(boolean defaultNode) { - this.defaultNode = defaultNode; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/JobEngine.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/JobEngine.java deleted file mode 100755 index 4b2125447..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/JobEngine.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.job.domain; - -/** - * @author davidhua - * 2019/12/10 - */ -public enum JobEngine { - /** - * engine type - */ - DATAX, SQOOP -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/JobReport.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/JobReport.java deleted file mode 100755 index 8ebfb18e9..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/JobReport.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.job.domain; - -/** - * Created by devendeng on 2018/8/24. - */ - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude; - -import javax.validation.constraints.NotNull; -import java.util.Date; - -/** - * Report of job - */ -@JsonInclude(JsonInclude.Include.NON_EMPTY) -public class JobReport { - private Long id; - @NotNull(message = "{udes.domain.jobReport.id.notNull}") - private Long jobId; - private Double totalCosts; - private Long byteSpeedPerSecond; - private Long recordSpeedPerSecond; - private Long totalReadRecords; - private Long totalReadBytes; - private Long totalErrorRecords; - private Long transformerTotalRecords; - private Long transformerFailedRecords; - private Long transformerFilterRecords; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date createTime; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Long getJobId() { - return jobId; - } - - public void setJobId(Long jobId) { - this.jobId = jobId; - } - - public Double getTotalCosts() { - return totalCosts; - } - - public void setTotalCosts(Double totalCosts) { - this.totalCosts = totalCosts; - } - - public Long getByteSpeedPerSecond() { - return byteSpeedPerSecond; - } - - public void setByteSpeedPerSecond(Long byteSpeedPerSecond) { - this.byteSpeedPerSecond = byteSpeedPerSecond; - } - - public Long getRecordSpeedPerSecond() { - return recordSpeedPerSecond; - } - - public void setRecordSpeedPerSecond(Long recordSpeedPerSecond) { - this.recordSpeedPerSecond = recordSpeedPerSecond; - } - - public Long getTotalReadRecords() { - return totalReadRecords; - } - - public void setTotalReadRecords(Long totalReadRecords) { - this.totalReadRecords = totalReadRecords; - } - - public Long getTotalReadBytes() { - return totalReadBytes; - } - - public void setTotalReadBytes(Long totalReadBytes) { - this.totalReadBytes = totalReadBytes; - } - - public Long getTotalErrorRecords() { - return totalErrorRecords; - } - - public void setTotalErrorRecords(Long totalErrorRecords) { - this.totalErrorRecords = totalErrorRecords; - } - - public Long getTransformerTotalRecords() { - return transformerTotalRecords; - } - - public void setTransformerTotalRecords(Long transformerTotalRecords) { - this.transformerTotalRecords = transformerTotalRecords; - } - - public Long getTransformerFailedRecords() { - return transformerFailedRecords; - } - - public void setTransformerFailedRecords(Long transformerFailedRecords) { - this.transformerFailedRecords = transformerFailedRecords; - } - - public Long getTransformerFilterRecords() { - return transformerFilterRecords; - } - - public void setTransformerFilterRecords(Long transformerFilterRecords) { - this.transformerFilterRecords = transformerFilterRecords; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/LogResult.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/LogResult.java deleted file mode 100755 index 97c41faf9..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/LogResult.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.job.domain; - -import com.fasterxml.jackson.annotation.JsonInclude; - -/** - * Created by devendeng on 2018/9/13. - */ -@JsonInclude(JsonInclude.Include.NON_EMPTY) -public class LogResult { - private int startLineNum; - private int endLineNum; - private String logContent; - private boolean isEnd; - - public LogResult() {} - - public LogResult(int startLineNum, int endLineNum, String logContent, boolean isEnd) { - this.startLineNum = startLineNum; - this.endLineNum = endLineNum; - this.logContent = logContent; - this.isEnd = isEnd; - } - - public int getStartLineNum() { - return startLineNum; - } - - public void setStartLineNum(int startLineNum) { - this.startLineNum = startLineNum; - } - - public int getEndLineNum() { - return endLineNum; - } - - public void setEndLineNum(int endLineNum) { - this.endLineNum = endLineNum; - } - - public String getLogContent() { - return logContent; - } - - public void setLogContent(String logContent) { - this.logContent = logContent; - } - - public boolean isEnd() { - return isEnd; - } - - public void setEnd(boolean end) { - isEnd = end; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/TaskState.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/TaskState.java deleted file mode 100755 index 136cebc52..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/TaskState.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.job.domain; - -import com.fasterxml.jackson.annotation.JsonInclude; - -import javax.validation.constraints.NotNull; -import java.util.Date; - -/** - * @author davidhua - * 2019/11/12 - */ -@JsonInclude(JsonInclude.Include.NON_EMPTY) -public class TaskState { - - @NotNull - private Long taskId; - - private Long currentByteSpeed; - - private Date versionTime; - - public TaskState(TaskState other){ - this.taskId = other.taskId; - this.currentByteSpeed = other.currentByteSpeed; - this.versionTime = other.versionTime; - } - - public TaskState(){ - - } - - public TaskState(Long taskId){ - this.taskId = taskId; - } - public Long getTaskId() { - return taskId; - } - - public Long getCurrentByteSpeed() { - return currentByteSpeed; - } - - public void setCurrentByteSpeed(Long currentByteSpeed) { - this.currentByteSpeed = currentByteSpeed; - } - - - public Date getVersionTime() { - return versionTime; - } - - public void setVersionTime(Date versionTime) { - this.versionTime = versionTime; - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/route/exception/RpcReqTimeoutException.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/route/exception/RpcReqTimeoutException.java deleted file mode 100755 index b6fa893fb..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/route/exception/RpcReqTimeoutException.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.route.exception; - -/** - * @author davidhua - * 2019/10/18 - */ -public class RpcReqTimeoutException extends RuntimeException{ - private String remoteAddress; - - public RpcReqTimeoutException(String remoteAddress, String message) { - super(message); - this.remoteAddress = remoteAddress; - } - - public RpcReqTimeoutException(String remoteAddress, String message, Throwable cause) { - super(message, cause); - this.remoteAddress = remoteAddress; - } - - public RpcReqTimeoutException(String remoteAddress, Throwable cause) { - super(cause); - this.remoteAddress = remoteAddress; - } - - protected RpcReqTimeoutException(String remoteAddress, String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - this.remoteAddress = remoteAddress; - } - - public String getRemoteAddress() { - return remoteAddress; - } - -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/route/feign/FeginClientConfig.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/route/feign/FeginClientConfig.java deleted file mode 100755 index 736c97748..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/route/feign/FeginClientConfig.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.route.feign; - -import feign.Client; -import org.springframework.cloud.netflix.ribbon.SpringClientFactory; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Primary; - -/** - * @author davidhua - * 2018/9/12 - */ -public class FeginClientConfig { - @Bean - @Primary - public LabelLoadBalancerFactory labelLoadBalancerFactory(SpringClientFactory clientFactory){ - return new LabelLoadBalancerFactory(clientFactory); - } - @Bean - @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") - public Client feignClient(LabelLoadBalancerFactory lbClientFactory, SpringClientFactory clientFactory){ - return new LabelLoadBalancerFeignClient(new Client.Default(null, null), - lbClientFactory, clientFactory); - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/route/feign/FeignConstants.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/route/feign/FeignConstants.java deleted file mode 100755 index f8a1a9d58..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/route/feign/FeignConstants.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.route.feign; - -/** - * @author davidhua - * 2019/3/19 - */ -public class FeignConstants { - public static final String HOST_PORT = "host_port"; - - public static final String LB_LABEL = "lb_label"; - - public static final String LB_LABEL_PREFIX_JOB = "job_"; - - public static final String LB_LABEL_PREFIX_TAB = "tab_"; - - public static final String LB_LABEL_PREFIX_USER = "user_"; -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/route/feign/LabelLoadBalancerFactory.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/route/feign/LabelLoadBalancerFactory.java deleted file mode 100755 index bd4d629a3..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/route/feign/LabelLoadBalancerFactory.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.route.feign; - -import com.netflix.client.*; -import com.netflix.client.config.IClientConfig; -import com.netflix.loadbalancer.ILoadBalancer; -import com.netflix.loadbalancer.Server; -import com.netflix.loadbalancer.reactive.LoadBalancerCommand; -import feign.Client; -import feign.Request; -import feign.Response; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.cloud.netflix.ribbon.RibbonProperties; -import org.springframework.cloud.netflix.ribbon.ServerIntrospector; -import org.springframework.cloud.netflix.ribbon.SpringClientFactory; -import org.springframework.util.ConcurrentReferenceHashMap; -import rx.Observable; - -import java.io.IOException; -import java.net.URI; -import java.util.Collection; -import java.util.Collections; -import java.util.Map; -import static com.webank.wedatasphere.exchangis.route.feign.FeignConstants.LB_LABEL; -import static org.springframework.cloud.netflix.ribbon.RibbonUtils.updateToSecureConnectionIfNeeded; - -/** - * The factory of load-balancer which with server key(label) - * @author davidhua - * 2019/3/19 - */ -public class LabelLoadBalancerFactory { - private final SpringClientFactory factory; - private Map cache = - new ConcurrentReferenceHashMap<>(); - - public LabelLoadBalancerFactory(SpringClientFactory factory){ - this.factory = factory; - } - - public FeignLabelLoadBalancer create(String clientName){ - return this.cache.computeIfAbsent(clientName, (key)->{ - IClientConfig config = this.factory.getClientConfig(clientName); - ILoadBalancer lb = this.factory.getLoadBalancer(clientName); - ServerIntrospector serverIntrospector = this.factory.getInstance(clientName, ServerIntrospector.class); - return new FeignLabelLoadBalancer(lb, config, serverIntrospector); - }); - } - public static class FeignLabelLoadBalancer extends - AbstractLoadBalancerAwareClient { - private static final Logger logger = LoggerFactory.getLogger(FeignLabelLoadBalancer.class); - private static final int DEFAULT_CONNECT_TIMEOUT = 3000; - private static final int DEFAULT_READ_TIMEOUT = 10000; - - private int connectTimeout; - private int readTimeout; - private RibbonProperties ribbon; - private IClientConfig clientConfig; - private ServerIntrospector serverIntrospector; - - public FeignLabelLoadBalancer(ILoadBalancer lb) { - super(lb); - this.connectTimeout = DEFAULT_CONNECT_TIMEOUT; - this.readTimeout = DEFAULT_READ_TIMEOUT; - } - - FeignLabelLoadBalancer(ILoadBalancer lb, IClientConfig clientConfig, - ServerIntrospector serverIntrospector) { - super(lb, clientConfig); - this.setRetryHandler(RetryHandler.DEFAULT); - this.clientConfig = clientConfig; - RibbonProperties ribbon= RibbonProperties.from(clientConfig); - this.ribbon = ribbon; - this.connectTimeout = DEFAULT_CONNECT_TIMEOUT; - this.readTimeout = DEFAULT_READ_TIMEOUT; - this.serverIntrospector = serverIntrospector; - } - - - @Override - public RequestSpecificRetryHandler getRequestSpecificRetryHandler(LbClientRequest request, IClientConfig requestConfig) { - if(null != this.ribbon && this.ribbon.isOkToRetryOnAllOperations()){ - return new RequestSpecificRetryHandler(true, true, this.getRetryHandler(), - requestConfig); - } - if(!"GET".equals(request.toRequest().method())){ - return new RequestSpecificRetryHandler(true, false, this.getRetryHandler(), - requestConfig); - }else{ - return new RequestSpecificRetryHandler(true, true, this.getRetryHandler(), - requestConfig); - } - } - - @Override - protected void customizeLoadBalancerCommandBuilder(LbClientRequest request, IClientConfig config, LoadBalancerCommand.Builder builder) { - //set load balancer key - Object key = request.getLoadBalancerKey(); - if(null != key){ - logger.info("set load balancer label:" + request.getLoadBalancerKey()); - builder.withServerLocator(request.getLoadBalancerKey()); - } - } - - @Override - public URI reconstructURIWithServer(Server server, URI original) { - URI uri = updateToSecureConnectionIfNeeded(original, this.clientConfig, this.serverIntrospector, server); - return super.reconstructURIWithServer(server, uri); - } - - - @Override - public LbClientResponse execute(LbClientRequest lbClientRequest, IClientConfig iClientConfig) throws Exception { - Request.Options options; - if(null != iClientConfig){ - RibbonProperties override = RibbonProperties.from(iClientConfig); - options = new Request.Options(this.connectTimeout, this.readTimeout); - }else{ - options = new Request.Options(this.connectTimeout, this.readTimeout); - } - return new LbClientResponse(lbClientRequest.getUri(), - lbClientRequest.client.execute(lbClientRequest.toRequest(), options)); - } - - @Override - public LbClientResponse executeWithLoadBalancer(LbClientRequest request, IClientConfig requestConfig) throws ClientException { - LoadBalancerCommand command = buildLoadBalancerCommand(request, requestConfig); - - try { - return command.submit( - server -> { - //set the server chosen - request.chosenServer = server; - URI finalUri = reconstructURIWithServer(server, request.getUri()); - LbClientRequest requestForServer = (LbClientRequest) request.replaceUri(finalUri); - try { - return Observable.just(this.execute(requestForServer, requestConfig)); - } - catch (Exception e) { - return Observable.error(e); - } - }) - .toBlocking() - .single(); - } catch (Exception e) { - Throwable t = e.getCause(); - if (t instanceof ClientException) { - throw (ClientException) t; - } else { - throw new ClientException(e); - } - } - } - - static class LbClientRequest extends ClientRequest{ - private final Request request; - private final Client client; - private Map> headers; - private Server chosenServer; - LbClientRequest(Client client, Request request, - Map> headers, URI uri){ - this.client = client; - setUri(uri); - this.headers = headers; - if(null != headers && !headers.getOrDefault(LB_LABEL, Collections.emptyList()).isEmpty()){ - setLoadBalancerKey(headers.get(LB_LABEL).toArray()[0]); - } - this.request = toRequest(request); - } - - private Request toRequest(Request request){ - return Request.create(request.method(), getUri().toASCIIString(), this.headers, request.body(), request.charset()); - } - - Request toRequest(){ - return toRequest(this.request); - } - - public Server getChosenServer() { - return chosenServer; - } - - } - - static class LbClientResponse implements IResponse{ - - private final URI uri; - private final Response response; - LbClientResponse(URI uri, Response response){ - this.uri = uri; - this.response = response; - } - @Override - public Object getPayload() throws ClientException { - return this.response.body(); - } - - @Override - public boolean hasPayload() { - return this.response.body() != null; - } - - @Override - public boolean isSuccess() { - return this.response.status() == 200; - } - - @Override - public URI getRequestedURI() { - return this.uri; - } - - @Override - public Map getHeaders() { - return this.response.headers(); - } - - @Override - public void close() throws IOException { - if(this.response != null && this.response.body() != null){ - this.response.body().close(); - } - } - - Response toResponse(){ - return this.response; - } - } - } -} diff --git a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/route/feign/LabelLoadBalancerFeignClient.java b/modules/common/src/main/java/com/webank/wedatasphere/exchangis/route/feign/LabelLoadBalancerFeignClient.java deleted file mode 100755 index 87cb58d2f..000000000 --- a/modules/common/src/main/java/com/webank/wedatasphere/exchangis/route/feign/LabelLoadBalancerFeignClient.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.route.feign; - -import com.webank.wedatasphere.exchangis.common.auth.AuthConstraints; -import com.webank.wedatasphere.exchangis.route.exception.RpcReqTimeoutException; -import com.netflix.client.config.CommonClientConfigKey; -import com.netflix.client.config.DefaultClientConfigImpl; -import com.netflix.client.config.IClientConfig; -import com.netflix.loadbalancer.Server; -import feign.Client; -import feign.Request; -import feign.Response; -import org.apache.commons.lang.StringUtils; -import org.springframework.cloud.netflix.ribbon.SpringClientFactory; -import java.io.IOException; -import java.net.SocketTimeoutException; -import java.net.URI; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.concurrent.TimeoutException; - -import static com.webank.wedatasphere.exchangis.route.feign.FeignConstants.HOST_PORT; - -/** - * @author davidhua - * 2018/9/12 - */ -public class LabelLoadBalancerFeignClient implements Client{ - - static final Request.Options DEFAULT_OPTIONS = new Request.Options(); - - private final Client delegate; - private LabelLoadBalancerFactory lbClientFactory; - private SpringClientFactory clientFactory; - - LabelLoadBalancerFeignClient(Client delegate, LabelLoadBalancerFactory lbClientFactory, SpringClientFactory clientFactory) { - this.delegate = delegate; - this.lbClientFactory = lbClientFactory; - this.clientFactory = clientFactory; - } - - @Override - public Response execute(Request request, Request.Options options) throws IOException { - //When the request has the 'Host-Port' header - //use it instead of balancing, the header can be modified dynamically - Map> headers = new LinkedHashMap<>( - request.headers()); - Collection hostPorts = headers.getOrDefault(HOST_PORT, Collections.emptyList()); - //Put token which wrapped by sso cookie into request headers - String clientName = URI.create(request.url()).getHost(); - if(StringUtils.isNotBlank(System.getProperty(AuthConstraints.ENV_SERV_TOKEN)) && - !clientName.equals(AuthConstraints.GATEWAY_CLIENT)){ - headers.put("Cookie", - Collections.singleton(AuthConstraints.DEFAULT_SSO_COOKIE + "=" - + System.getProperty(AuthConstraints.ENV_SERV_TOKEN))); - } - headers.put("X-Requested-With", Collections.singleton("XMLHttpRequest")); - IClientConfig requestConfig = getClientConfig(options, clientName); - URI uri; - boolean withLoadBalance = true; - if(!hostPorts.isEmpty()){ - String hostPort = hostPorts.iterator().next(); - uri = replaceHost(request.url(), clientName, hostPort); - withLoadBalance = false; - }else{ - uri = replaceHost(request.url(), clientName, ""); - } - LabelLoadBalancerFactory.FeignLabelLoadBalancer.LbClientRequest - lbClientRequest = new LabelLoadBalancerFactory.FeignLabelLoadBalancer.LbClientRequest( - this.delegate, request, headers, uri); - LabelLoadBalancerFactory.FeignLabelLoadBalancer lb = this.lbClientFactory.create(clientName); - try { - return withLoadBalance ? lb.executeWithLoadBalancer(lbClientRequest, requestConfig).toResponse() - : lb.execute(lbClientRequest, requestConfig).toResponse(); - }catch(Exception e){ - Throwable timeout = findTimeoutException(e); - if(null != timeout) { - Server server = lbClientRequest.getChosenServer(); - throw new RpcReqTimeoutException(null == server?"" : server.getHostPort(), e); - } - IOException io = findIOException(e); - if(null != io){ - throw io; - } - throw new RuntimeException(e); - } - } - - private IOException findIOException(Throwable throwable){ - if(throwable == null){ - return null; - } - if (throwable instanceof IOException){ - return (IOException)throwable; - } - return findIOException(throwable.getCause()); - } - - private Throwable findTimeoutException(Throwable throwable){ - Throwable cause = throwable; - while(null != cause){ - if(cause instanceof TimeoutException || cause instanceof SocketTimeoutException){ - return cause; - } - cause = cause.getCause(); - } - return null; - } - private IClientConfig getClientConfig(Request.Options options, String clientName){ - IClientConfig requestConfig; - if(options == DEFAULT_OPTIONS){ - requestConfig = this.clientFactory.getClientConfig(clientName); - }else{ - requestConfig = new DefaultClientConfigImpl(); - requestConfig.set(CommonClientConfigKey.ConnectTimeout, - options.connectTimeoutMillis()); - requestConfig.set(CommonClientConfigKey.ReadTimeout, options.readTimeoutMillis()); - } - return requestConfig; - } - - private static URI replaceHost(String originalUrl, String clientName, String host){ - return URI.create(originalUrl.replaceFirst(clientName, host)); - } -} diff --git a/modules/eureka/pom.xml b/modules/eureka/pom.xml deleted file mode 100644 index 8534088ac..000000000 --- a/modules/eureka/pom.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - com.webank.wedatasphere.exchangis - exchangis - 0.5.0.RELEASE - ../../pom.xml - - 4.0.0 - - exchangis-eureka - - exchangis-eureka - - - UTF-8 - 1.8 - 1.8 - - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-server - - - - com.thoughtworks.xstream - xstream - 1.4.15 - - - io.micrometer - micrometer-registry-prometheus - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - **/*.yml - **/*.properties - **/*.sh - **/*.xml - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - ${basedir}/src/main/assembly/deploy.xml - - ${project.artifactId}_${project.version}_1 - ${project.parent.basedir}/packages - - - - - diff --git a/modules/eureka/src/main/assembly/deploy.xml b/modules/eureka/src/main/assembly/deploy.xml deleted file mode 100644 index 3e0156ad1..000000000 --- a/modules/eureka/src/main/assembly/deploy.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - dist - - tar.gz - - false - - - true - exchangis-eureka/lib - runtime - - - - - unix - ./src/main/bin - exchangis-eureka/bin - - **/* - - 0755 - - - ./src/main/logs - exchangis-eureka/logs - - - ./src/main/resources - exchangis-eureka/conf - - - \ No newline at end of file diff --git a/modules/eureka/src/main/bin/configure.sh b/modules/eureka/src/main/bin/configure.sh deleted file mode 100644 index 86ea1a192..000000000 --- a/modules/eureka/src/main/bin/configure.sh +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/bash -# -# Copyright 2020 WeBank -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -SHELL_LOG="${DIR}/console.out" -SERVER_NAME="exchangis-eureka" -USER=`whoami` -SAFE_MODE=true -SUDO_USER=false -ENV_FILE_PATH="${DIR}/env.properties" - -usage(){ - printf "Configure usage:\n" - printf "\t%-10s %-10s %-2s \n" --server "server-name" "Name of Exchangis server" - printf "\t%-10s %-10s %-2s \n" --unsafe "unsafe mode" "Will clean the directory existed" - printf "\t%-10s %-10s %-2s \n" --safe "safe mode" "Will not modify the directory existed (Default)" - printf "\t%-10s %-10s %-2s \n" "-h|--help" "usage" "List help document" -} - -function LOG(){ - currentTime=`date "+%Y-%m-%d %H:%M:%S.%3N"` - echo -e "$currentTime [${1}] ($$) $2" | tee -a ${SHELL_LOG} -} - -is_sudo_user(){ - sudo -v >/dev/null 2>&1 -} - -abs_path(){ - SOURCE="${BASH_SOURCE[0]}" - while [ -h "${SOURCE}" ]; do - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "${SOURCE}")" - [[ ${SOURCE} != /* ]] && SOURCE="${DIR}/${SOURCE}" - done - echo "$( cd -P "$( dirname "${SOURCE}" )" && pwd )" -} - -check_exist(){ - if test -e "$1"; then - LOG INFO "Directory or file: [$1] has been exist" - if [ $2 == true ]; then - LOG INFO "Configure program will shutdown..." - exit 0 - fi - fi -} - -copy_replace(){ - file_name=$1 - if test -e "${CONF_PATH}/${file_name}";then - if [ ${SAFE_MODE} == true ]; then - check_exist "${CONF_PATH}/${file_name}" true - fi - LOG INFO "Delete file or directory: [${CONF_PATH}/${file_name}]" - rm -rf ${CONF_PATH}/${file_name} - fi - if test -e "${DIR}/../conf/${file_name}";then - LOG INFO "Copy from ${DIR}/../conf/${file_name}" - cp -R ${DIR}/../conf/${file_name} ${CONF_PATH}/ - fi -} - -mkdir_p(){ - if [ ${SAFE_MODE} == true ]; then - check_exist $1 false - fi - if [ ! -d $1 ]; then - LOG INFO "Creating directory: ["$1"]." - #mkdir -p $1 - if [ ${SUDO_USER} == true ]; then - sudo mkdir -p $1 && sudo chown -R ${USER} $1 - else - mkdir -p $1 - fi - fi -} - -while [ 1 ]; do - case ${!OPTIND} in - --server) - SERVER_NAME=$2 - shift 2 - ;; - --unsafe) - SAFE_MODE=false - shift 1 - ;; - --safe) - SAFE_MODE=true - shift 1 - ;; - --help|-h) - usage - exit 0 - ;; - *) - break - ;; - esac -done - -is_sudo_user -if [ $? == 0 ]; then - SUDO_USER=true -fi - -BIN=`abs_path` -SERVER_NAME_SIMPLE=${SERVER_NAME/exchangis-/} - -LOG_PATH=${BIN}/../logs -if [ "x${BASE_LOG_DIR}" != "x" ]; then - LOG_PATH=${BASE_LOG_DIR}/${SERVER_NAME_SIMPLE} - sed -ri "s![#]?(EUREKA_LOG_PATH=)\S*!\1${LOG_PATH}!g" ${ENV_FILE_PATH} -fi - -CONF_PATH=${BIN}/../conf -if [ "x${BASE_CONF_DIR}" != "x" ]; then - CONF_PATH=${BASE_CONF_DIR}/${SERVER_NAME_SIMPLE} - sed -ri "s![#]?(EUREKA_CONF_PATH=)\S*!\1${CONF_PATH}!g" ${ENV_FILE_PATH} -fi - -DATA_PATH=${BIN}/../data -if [ "x${BASE_DATA_DIR}" != "x" ]; then - DATA_PATH=${BASE_DATA_DIR}/${SERVER_NAME_SIMPLE} - sed -ri "s![#]?(DATA_PATH=)\S*!\1${DATA_PATH}!g" ${ENV_FILE_PATH} -fi - -# Start to make directory -LOG INFO "\033[1m Start to build directory\033[0m" -mkdir_p ${LOG_PATH} -mkdir_p ${CONF_PATH} -mkdir_p ${DATA_PATH} -if [ "x${BASE_CONF_DIR}" != "x" ]; then - LOG INFO "\033[1m Start to copy configuration file/directory\033[0m" - # Copy the configuration file - copy_replace bootstrap.yml - copy_replace logback.xml -fi diff --git a/modules/eureka/src/main/bin/env.properties b/modules/eureka/src/main/bin/env.properties deleted file mode 100644 index 5a5b2a7fd..000000000 --- a/modules/eureka/src/main/bin/env.properties +++ /dev/null @@ -1,15 +0,0 @@ -# environment variables - -#JAVA_HOME="" - -EUREKA_LOG_PATH=${BIN}/../logs -EUREKA_CONF_PATH=${BIN}/../conf - -DATA_PATH=${BIN}/../data -SERVER_PORT=8500 - -#PID_FILE_PATH=${BIN}/eureka.pid - -#debug -#REMOTE_DEBUG_SWITCH=true -#REMOTE_DEBUG_PORT=7000 \ No newline at end of file diff --git a/modules/eureka/src/main/bin/exchangis-eureka.sh b/modules/eureka/src/main/bin/exchangis-eureka.sh deleted file mode 100644 index df4c05178..000000000 --- a/modules/eureka/src/main/bin/exchangis-eureka.sh +++ /dev/null @@ -1,285 +0,0 @@ -#!/bin/bash -# -# Copyright 2020 WeBank -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -MAIN_CLASS=com.webank.wedatasphere.exchangis.EurekaApplication -FRIEND_NAME=EXCHANGIS-EUREKA -if [ ! ${ENV_FILE} ]; then - ENV_FILE="env.properties" -fi -SLEEP_TIMEREVAL_S=2 -EUREKA_HOSTNAME=$(hostname) -abs_path(){ - SOURCE="${BASH_SOURCE[0]}" - while [ -h "${SOURCE}" ]; do - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "${SOURCE}")" - [[ ${SOURCE} != /* ]] && SOURCE="${DIR}/${SOURCE}" - done - echo "$( cd -P "$( dirname "${SOURCE}" )" && pwd )" -} - -function LOG(){ - currentTime=`date "+%Y-%m-%d %H:%M:%S.%3N"` - echo -e "$currentTime [${1}] ($$) $2" | tee -a ${SHELL_LOG} -} - -verify_java_env(){ - if [ "x${JAVA_HOME}" != "x" ]; then - ${JAVA_HOME}/bin/java -version >/dev/null 2>&1 - else - java -version >/dev/null 2>&1 - fi - if [ $? -ne 0 ]; then - cat 1>&2 </dev/null` - if [ "x"${pid_in_file} != "x" ]; then - p=`${JPS} -q | grep ${pid_in_file} | awk '{print $1}'` - fi - fi - else - p=`${JPS} -l | grep "$2" | awk '{print $1}'` - fi - if [ -n "$p" ]; then - # echo "$1 ($2) is still running with pid $p" - return 0 - else - # echo "$1 ($2) does not appear in the java process table" - return 1 - fi -} - -wait_for_startup(){ - local now_s=`date '+%s'` - local stop_s=$((${now_s} + $1)) - while [ ${now_s} -le ${stop_s} ];do - status_class ${FRIEND_NAME} ${MAIN_CLASS} - if [ $? -eq 0 ]; then - return 0 - fi - sleep ${SLEEP_TIMEREVAL_S} - now_s=`date '+%s'` - done - exit 1 -} - -wait_for_stop(){ - local now_s=`date '+%s'` - local stop_s=$((${now_s} + $1)) - while [ ${now_s} -le ${stop_s} ];do - status_class ${FRIEND_NAME} ${MAIN_CLASS} - if [ $? -eq 1 ]; then - return 0 - fi - sleep ${SLEEP_TIMEREVAL_S} - now_s=`date '+%s'` - done - return 1 -} - -start_m(){ - status_class ${FRIEND_NAME} ${MAIN_CLASS} - if [ $? -eq 0 ]; then - LOG INFO "${FRIEND_NAME} has been started in process" - exit 0 - fi - LOG INFO ${EXE_JAVA} - nohup ${EXE_JAVA} >/dev/null 2>&1 & - LOG INFO "Waiting ${FRIEND_NAME} to start complete ..." - wait_for_startup 20 - if [ $? -eq 0 ]; then - LOG INFO "${FRIEND_NAME} start success" - return 0 - else - LOG ERROR "${FRIEND_NAME} start exceeded over 20s" >&2 - return 1 - fi -} - -stop_m(){ - local p="" - if [ "x"${PID_FILE_PATH} != "x" ]; then - if [ -f ${PID_FILE_PATH} ]; then - local pid_in_file=`cat ${PID_FILE_PATH} 2>/dev/null` - if [ "x"${pid_in_file} != "x" ]; then - p=`${JPS} -q | grep ${pid_in_file} | awk '{print $1}'` - fi - fi - else - p=`${JPS} -l | grep "${MAIN_CLASS}" | awk '{print $1}'` - fi - if [ -z "${p}" ]; then - LOG INFO "${FRIEND_NAME} didn't start successfully, not found in the java process table" - return 0 - fi - LOG INFO "Killing ${FRIEND_NAME} (pid ${p}) ..." >&2 - case "`uname`" in - CYCGWIN*) taskkill /PID "${p}" ;; - *) kill -SIGTERM "${p}" ;; - esac - LOG INFO "Waiting ${FRIEND_NAME} to stop complete ..." - wait_for_stop 20 - if [ $? -eq 0 ]; then - LOG INFO "${FRIEND_NAME} stop success" - return 0 - else - LOG ERROR "${FRIEND_NAME} stop exceeded over 20s" >&2 - return 1 - fi -} - -shutdown_m(){ - local p="" - if [ "x"${PID_FILE_PATH} != "x" ]; then - if [ -f ${PID_FILE_PATH} ]; then - local pid_in_file=`cat ${PID_FILE_PATH} 2>/dev/null` - if [ "x"${pid_in_file} != "x" ]; then - p=`${JPS} -q | grep ${pid_in_file} | awk '{print $1}'` - fi - fi - else - p=`${JPS} -l | grep "${MAIN_CLASS}" | awk '{print $1}'` - fi - if [ -z "${p}" ]; then - LOG INFO "${FRIEND_NAME} didn't start successfully, not found in the java process table" - return 0 - fi - LOG INFO "Killing ${FRIEND_NAME} (pid ${p}) ..." - case "`uname`" in - CYCGWIN*) taskkill /F /PID "${p}" ;; - *) kill -9 "${p}" ;; - esac -} - -restart_m(){ - stop_m - if [ $? -eq 0 ]; then - start_m - exit $? - else - LOG ERROR "${FRIEND_NAME} restart fail" >&2 - exit 1 - fi -} -if [ ! $1 ]; then - usage - exit 1; -fi -case $1 in - start) start_m;; - stop) stop_m;; - shutdown) shutdown_m;; - restart) restart_m;; - *) - usage - exit 1 - ;; -esac -exit $? \ No newline at end of file diff --git a/modules/eureka/src/main/java/com/webank/wedatasphere/exchangis/EurekaApplication.java b/modules/eureka/src/main/java/com/webank/wedatasphere/exchangis/EurekaApplication.java deleted file mode 100644 index 43f6cdd8f..000000000 --- a/modules/eureka/src/main/java/com/webank/wedatasphere/exchangis/EurekaApplication.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis; - -import io.micrometer.core.instrument.MeterRegistry; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; -import org.springframework.context.annotation.Bean; - -import java.io.IOException; -import java.lang.management.ManagementFactory; -import java.nio.file.Files; -import java.nio.file.Paths; - -/** - * @author davidhua - */ -@SpringBootApplication -@EnableEurekaServer -public class EurekaApplication { - private static Logger LOG = LoggerFactory.getLogger(EurekaApplication.class); - - public static void main( String[] args ) { - if(StringUtils.isNotBlank(System.getProperty("pid.file", ""))){ - String pidFile = System.getProperty("pid.file"); - try { - savePID(pidFile); - Runtime.getRuntime().addShutdownHook(new Thread(() -> { - try { - removePID(pidFile); - } catch (IOException e) { - //Ignore - } - })); - }catch(IOException e){ - LOG.error("Fail to store PID file in disk path: [" + pidFile +"]", e); - return; - } - }; - SpringApplication.run(EurekaApplication.class, args); - } - - private static void savePID(String pidFile) throws IOException { - String name = ManagementFactory.getRuntimeMXBean().getName(); - String pid = name.split("@")[0].trim(); - Files.write(Paths.get(pidFile), pid.getBytes()); - } - - private static void removePID(String pidFile) throws IOException{ - Files.delete(Paths.get(pidFile)); - } - - @Bean - MeterRegistryCustomizer meterRegistryCustomizer(MeterRegistry meterRegistry) { - return meterRegistry1 -> { - meterRegistry.config() - .commonTags("application", "EurekaApplication"); - }; - } -} diff --git a/modules/eureka/src/main/resources/bootstrap.yml b/modules/eureka/src/main/resources/bootstrap.yml deleted file mode 100644 index ca0feb7a5..000000000 --- a/modules/eureka/src/main/resources/bootstrap.yml +++ /dev/null @@ -1,37 +0,0 @@ -spring: - application: - name: exchangis-eureka - -server: - port: ${server.port} - tomcat: - basedir: ${data.path}/tomcat/eureka - -eureka: - instance: - hostname: ${eureka.hostname:localhost} - lease-expiration-duration-in-seconds: 60 - lease-renewal-interval-in-seconds: 3 - client: - register-with-eureka: false - fetch-registry: false - service-url: - defaultZone: http://${eureka.hostname}:${server.port}/eureka - server: - enable-self-preservation: false - eviction-interval-timer-in-ms: 10000 - -management: - metrics: - export: - prometheus: - enabled: true - endpoints: - web: - #http暴露所有监控项 - exposure: - include: '*' - #uri,可自定义 - base-path: /actuator - - diff --git a/modules/eureka/src/main/resources/logback.xml b/modules/eureka/src/main/resources/logback.xml deleted file mode 100644 index 37228ef58..000000000 --- a/modules/eureka/src/main/resources/logback.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - ${CONSOLE_LOG_PATTERN} - - - - - - ERROR - DENY - ACCEPT - - - ${log.path}/exchangis-eureka.%d{yyyy-MM-dd}-%i.log - 30 - - 10MB - - - - ${FILE_LOG_PATTERN} - - - - - ERROR - ACCEPT - DENY - - - ${log.path}/exchangis-eureka-error.%d{yyyy-MM-dd}-%i.log - 30 - - 10MB - - - - ${FILE_LOG_PATTERN} - - - - - - - - diff --git a/modules/executor/core/pom.xml b/modules/executor/core/pom.xml deleted file mode 100644 index 59d69b854..000000000 --- a/modules/executor/core/pom.xml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - exchangis-executor - com.webank.wedatasphere.exchangis - 0.5.0.RELEASE - ../pom.xml - - 4.0.0 - - exchangis-executor-core - - - javax.servlet - javax.servlet-api - - - com.webank.wedatasphere.exchangis - exchangis-common - ${project.version} - - - org.mybatis.spring.boot - mybatis-spring-boot-starter - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-actuator - - - commons-io - commons-io - 2.4 - - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-client - - - xstream - com.thoughtworks.xstream - - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.cloud - spring-cloud-commons - - - org.springframework.cloud - spring-cloud-starter-openfeign - - - org.springframework.cloud - spring-cloud-openfeign-core - - - org.hamcrest - hamcrest-core - 1.3 - - - - com.github.ulisesbocchio - jasypt-spring-boot-starter - 2.1.0 - - - - org.quartz-scheduler - quartz - 2.3.2 - - - - com.thoughtworks.xstream - xstream - 1.4.11.1 - - - org.apache.httpcomponents - httpclient - 4.4 - - - com.google.guava - guava - - - com.thoughtworks.xstream - xstream - 1.4.15 - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - **/*.yml - **/*.properties - **/*.sh - **/*.xml - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - ${basedir}/src/main/assembly/package.xml - - exchangis-executor_${project.version}_1 - ${project.parent.basedir}/../../packages - - - - - \ No newline at end of file diff --git a/modules/executor/core/src/main/assembly/package.xml b/modules/executor/core/src/main/assembly/package.xml deleted file mode 100644 index 7df4faf37..000000000 --- a/modules/executor/core/src/main/assembly/package.xml +++ /dev/null @@ -1,54 +0,0 @@ - - core - - tar.gz - - false - - - unix - ./src/main/bin - - dxprof.py - perftrace.py - - exchangis-executor/bin - 0755 - - - ./src/main/logs - exchangis-executor/logs - - - ./src/main/resources - - *.properties - bootstrap.yml - application.yml - logback-server.xml - - exchangis-executor/conf - - - ./src/main/native - exchangis-executor/native - - - ../engine/datax/target/datax - exchangis-executor/engine/datax - - - ../engine/datax/datax-assembly/target/datax - exchangis-executor/engine/datax - - - - - true - exchangis-executor/lib - runtime - - - \ No newline at end of file diff --git a/modules/executor/core/src/main/bin/configure.sh b/modules/executor/core/src/main/bin/configure.sh deleted file mode 100644 index 696889294..000000000 --- a/modules/executor/core/src/main/bin/configure.sh +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/bash -# -# Copyright 2020 WeBank -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -SHELL_LOG="${DIR}/console.out" -SERVER_NAME="exchangis-executor" -USER=`whoami` -SAFE_MODE=true -SUDO_USER=false -ENV_FILE_PATH="${DIR}/env.properties" - -usage(){ - printf "Configure usage:\n" - printf "\t%-10s %-10s %-2s \n" --server "server-name" "Name of Exchangis server" - printf "\t%-10s %-10s %-2s \n" --unsafe "unsafe mode" "Will clean the directory existed" - printf "\t%-10s %-10s %-2s \n" --safe "safe mode" "Will not modify the directory existed (Default)" - printf "\t%-10s %-10s %-2s \n" "-h|--help" "usage" "List help document" -} - -function LOG(){ - currentTime=`date "+%Y-%m-%d %H:%M:%S.%3N"` - echo -e "$currentTime [${1}] ($$) $2" | tee -a ${SHELL_LOG} -} - -is_sudo_user(){ - sudo -v >/dev/null 2>&1 -} - -abs_path(){ - SOURCE="${BASH_SOURCE[0]}" - while [ -h "${SOURCE}" ]; do - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "${SOURCE}")" - [[ ${SOURCE} != /* ]] && SOURCE="${DIR}/${SOURCE}" - done - echo "$( cd -P "$( dirname "${SOURCE}" )" && pwd )" -} - -check_exist(){ - if test -e "$1"; then - LOG INFO "Directory or file: [$1] has been exist" - if [ $2 == true ]; then - LOG INFO "Configure program will shutdown..." - exit 0 - fi - fi -} - -copy_replace(){ - file_name=$1 - if test -e "${CONF_PATH}/${file_name}";then - if [ ${SAFE_MODE} == true ]; then - check_exist "${CONF_PATH}/${file_name}" true - fi - LOG INFO "Delete file or directory: [${CONF_PATH}/${file_name}]" - rm -rf ${CONF_PATH}/${file_name} - fi - if test -e "${DIR}/../conf/${file_name}";then - LOG INFO "Copy from ${DIR}/../conf/${file_name}" - cp -R ${DIR}/../conf/${file_name} ${CONF_PATH}/ - fi -} - -mkdir_p(){ - if [ ${SAFE_MODE} == true ]; then - check_exist $1 false - fi - if [ ! -d $1 ]; then - LOG INFO "Creating directory: ["$1"]." - #mkdir -p $1 - if [ ${SUDO_USER} == true ]; then - sudo mkdir -p $1 && sudo chown -R ${USER} $1 - else - mkdir -p $1 - fi - - fi -} - -while [ 1 ]; do - case ${!OPTIND} in - --server) - SERVER_NAME=$2 - shift 2 - ;; - --unsafe) - SAFE_MODE=false - shift 1 - ;; - --safe) - SAFE_MODE=true - shift 1 - ;; - --help|-h) - usage - exit 0 - ;; - *) - break - ;; - esac -done - -is_sudo_user -if [ $? == 0 ]; then - SUDO_USER=true -fi - -BIN=`abs_path` -SERVER_NAME_SIMPLE=${SERVER_NAME/exchangis-/} - -LOG_PATH=${BIN}/../logs -if [ "x${BASE_LOG_DIR}" != "x" ]; then - LOG_PATH=${BASE_LOG_DIR}/${SERVER_NAME_SIMPLE} - sed -ri "s![#]?(EXECUTOR_LOG_PATH=)\S*!\1${LOG_PATH}!g" ${ENV_FILE_PATH} -fi - -CONF_PATH=${BIN}/../conf -if [ "x${BASE_CONF_DIR}" != "x" ]; then - CONF_PATH=${BASE_CONF_DIR}/${SERVER_NAME_SIMPLE} - sed -ri "s![#]?(EXECUTOR_CONF_PATH=)\S*!\1${CONF_PATH}!g" ${ENV_FILE_PATH} -fi - -DATA_PATH=${BIN}/../data -if [ "x${BASE_DATA_DIR}" != "x" ]; then - DATA_PATH=${BASE_DATA_DIR}/${SERVER_NAME_SIMPLE} - sed -ri "s![#]?(DATA_PATH=)\S*!\1${DATA_PATH}!g" ${ENV_FILE_PATH} -fi - -# Start to make directory -LOG INFO "\033[1m Start to build directory\033[0m" -mkdir_p ${LOG_PATH} -mkdir_p ${CONF_PATH} -mkdir_p ${DATA_PATH} -if [ "x${BASE_CONF_DIR}" != "x" ]; then - LOG INFO "\033[1m Start to copy configuration file/directory\033[0m" - # Copy the configuration file - copy_replace application.yml - copy_replace bootstrap.properties - copy_replace bootstrap.yml - copy_replace logback-server.xml - copy_replace auth.properties -fi diff --git a/modules/executor/core/src/main/bin/env.properties b/modules/executor/core/src/main/bin/env.properties deleted file mode 100644 index 0a65fe18f..000000000 --- a/modules/executor/core/src/main/bin/env.properties +++ /dev/null @@ -1,15 +0,0 @@ -# environment variables - -#JAVA_HOME="" - -EXECUTOR_LOG_PATH=${BIN}/../logs -EXECUTOR_CONF_PATH=${BIN}/../conf - -DATA_PATH=${BIN}/../data -SERVER_PORT=9501 - -#PID_FILE_PATH=${BIN}/executor.pid - -#debug -#REMOTE_DEBUG_SWITCH=true -#REMOTE_DEBUG_PORT=8090 \ No newline at end of file diff --git a/modules/executor/core/src/main/bin/exchangis-executor.sh b/modules/executor/core/src/main/bin/exchangis-executor.sh deleted file mode 100644 index 18a10b7c5..000000000 --- a/modules/executor/core/src/main/bin/exchangis-executor.sh +++ /dev/null @@ -1,296 +0,0 @@ -#!/bin/bash -# -# Copyright 2020 WeBank -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -DIR=$(pwd) -FRIEND_NAME=EXCHANGIS-EXECUTOR -MAIN_CLASS=com.webank.wedatasphere.exchangis.ExecutorApplication -USER=`whoami` -if [ ! ${ENV_FILE} ]; then - ENV_FILE="env.properties" -fi -SLEEP_TIMEREVAL_S=2 - -abs_path(){ - SOURCE="${BASH_SOURCE[0]}" - while [ -h "${SOURCE}" ]; do - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "${SOURCE}")" - [[ ${SOURCE} != /* ]] && SOURCE="${DIR}/${SOURCE}" - done - echo "$( cd -P "$( dirname "${SOURCE}" )" && pwd )" -} - -function LOG(){ - currentTime=`date "+%Y-%m-%d %H:%M:%S.%3N"` - echo -e "$currentTime [${1}] ($$) $2" | tee -a ${SHELL_LOG} -} - -verify_java_env(){ - if [ "x${JAVA_HOME}" != "x" ]; then - ${JAVA_HOME}/bin/java -version >/dev/null 2>&1 - else - java -version >/dev/null 2>&1 - fi - if [ $? -ne 0 ]; then - cat 1>&2 </dev/null 2>&1 -} - -load_env(){ - LOG INFO "load environment variables" - while read line - do - if [[ ! -z $(echo "${line}" | grep "=") ]]; then - key=${line%%=*} - value=${line#*=} - key1=$(echo ${key} | tr '.' '_') - if [ -z $(echo "${key1}" | grep -P '\s*#+.*') ]; then - eval "${key1}=${value}" - fi - fi - done < "${BIN}/${ENV_FILE}" -} - -BIN=`abs_path` -SHELL_LOG="${BIN}/console.out" -export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${BIN}/../native -load_env - -#verify environment -verify_java_env -if [ $? -ne 0 ]; then - exit $? -fi - - -if [[ ! ${EXECUTOR_LOG_PATH} ]]; then - EXECUTOR_LOG_PATH=${BIN}/../logs -fi -if [[ ! ${EXECUTOR_CONF_PATH} ]]; then - EXECUTOR_CONF_PATH=${BIN}/../conf -fi - -if [[ ! ${DATA_PATH} ]]; then - DATA_PATH=${BIN}/../data -fi - -if [[ ! ${SERVER_PORT} ]]; then - SERVER_PORT=9001 -fi - -if [[ ! ${JAVA_OPTS} ]]; then - JAVA_OPTS=" -Xms2g -Xmx2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" -fi - -if [[ ! ${REMOTE_DEBUG_SWITCH} ]]; then - REMOTE_DEBUG_SWITCH=false -fi - -if [[ ! ${REMOTE_DEBUG_PORT} ]]; then - REMOTE_DEBUG_PORT="8089" -fi - -LIB_PATH=${BIN}/../lib -USER_DIR=${BIN}/../ -CLASSPATH=${LIB_PATH}"/*:"${EXECUTOR_CONF_PATH}":." -if [ ${REMOTE_DEBUG_SWITCH} == true ]; then - JAVA_OPTS=${JAVA_OPTS}" -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=${REMOTE_DEBUG_PORT}" -fi -JAVA_OPTS=${JAVA_OPTS}" -XX:HeapDumpPath="${EXECUTOR_LOG_PATH}" -Dlog.path="${EXECUTOR_LOG_PATH} -is_sudo_user -if [ $? == 0 ]; then - JAVA_OPTS=${JAVA_OPTS}" -Dsudo.user="${USER} -fi -JAVA_OPTS=${JAVA_OPTS}" -Duser.dir="${USER_DIR} -JAVA_OPTS=${JAVA_OPTS}" -Dserver.port="${SERVER_PORT}" -Ddata.path="${DATA_PATH} -if [ "x"${PID_FILE_PATH} != "x" ]; then - JAVA_OPTS=${JAVA_OPTS}" -Dpid.file="${PID_FILE_PATH} -fi -JAVA_OPTS=${JAVA_OPTS}" -Dlogging.config="${EXECUTOR_CONF_PATH}"/logback-server.xml" -JAVA_OPTS=${JAVA_OPTS}" -classpath "${CLASSPATH} - -if [ "x${JAVA_HOME}" != "x" ]; then - EXE_JAVA=${JAVA_HOME}"/bin/java "${JAVA_OPTS}" "${MAIN_CLASS} - JPS=${JAVA_HOME}/bin/jps -else - EXE_JAVA="java "${JAVA_OPTS}" "${MAIN_CLASS} - JPS="jps" -fi - -usage(){ - echo " usage is [start|stop|shutdown|restart]" -} - -# check if the process still in jvm -status_class(){ - local p="" - if [ "x"${PID_FILE_PATH} != "x" ]; then - if [ -f ${PID_FILE_PATH} ]; then - local pid_in_file=`cat ${PID_FILE_PATH} 2>/dev/null` - if [ "x"${pid_in_file} != "x" ]; then - p=`${JPS} -q | grep ${pid_in_file} | awk '{print $1}'` - fi - fi - else - p=`${JPS} -l | grep "$2" | awk '{print $1}'` - fi - if [ -n "$p" ]; then - # echo "$1 ($2) is still running with pid $p" - return 0 - else - # echo "$1 ($2) does not appear in the java process table" - return 1 - fi -} - -wait_for_startup(){ - local now_s=`date '+%s'` - local stop_s=$((${now_s} + $1)) - while [ ${now_s} -le ${stop_s} ];do - status_class ${FRIEND_NAME} ${MAIN_CLASS} - if [ $? -eq 0 ]; then - return 0 - fi - sleep ${SLEEP_TIMEREVAL_S} - now_s=`date '+%s'` - done - exit 1 -} - -wait_for_stop(){ - local now_s=`date '+%s'` - local stop_s=$((${now_s} + $1)) - while [ ${now_s} -le ${stop_s} ];do - status_class ${FRIEND_NAME} ${MAIN_CLASS} - if [ $? -eq 1 ]; then - return 0 - fi - sleep ${SLEEP_TIMEREVAL_S} - now_s=`date '+%s'` - done - return 1 -} - -start_m(){ - status_class ${FRIEND_NAME} ${MAIN_CLASS} - if [ $? -eq 0 ]; then - LOG INFO "${FRIEND_NAME} has been started in process" - exit 0 - fi - LOG INFO ${EXE_JAVA} - nohup ${EXE_JAVA} >/dev/null 2>&1 & - LOG INFO "Waiting ${FRIEND_NAME} to start complete ..." - wait_for_startup 20 - if [ $? -eq 0 ]; then - LOG INFO "${FRIEND_NAME} start success" - return 0 - else - LOG ERROR "${FRIEND_NAME} start exceeded over 20s" >&2 - return 1 - fi -} - -stop_m(){ - local p="" - if [ "x"${PID_FILE_PATH} != "x" ]; then - if [ -f ${PID_FILE_PATH} ]; then - local pid_in_file=`cat ${PID_FILE_PATH} 2>/dev/null` - if [ "x"${pid_in_file} != "x" ]; then - p=`${JPS} -q | grep ${pid_in_file} | awk '{print $1}'` - fi - fi - else - p=`${JPS} -l | grep "${MAIN_CLASS}" | awk '{print $1}'` - fi - if [ -z "${p}" ]; then - LOG INFO "${FRIEND_NAME} didn't start successfully, not found in the java process table" - return 0 - fi - LOG INFO "Killing ${FRIEND_NAME} (pid ${p}) ..." >&2 - case "`uname`" in - CYCGWIN*) taskkill /PID "${p}" ;; - *) kill -SIGTERM "${p}" ;; - esac - LOG INFO "Waiting ${FRIEND_NAME} to stop complete" - wait_for_stop 20 - if [ $? -eq 0 ]; then - LOG INFO "${FRIEND_NAME} stop success" - return 0 - else - LOG ERROR "${FRIEND_NAME} stop exceeded over 20s" >&2 - return 1 - fi -} - -shutdown_m(){ - local p="" - if [ "x"${PID_FILE_PATH} != "x" ]; then - if [ -f ${PID_FILE_PATH} ]; then - local pid_in_file=`cat ${PID_FILE_PATH} 2>/dev/null` - if [ "x"${pid_in_file} != "x" ]; then - p=`${JPS} -q | grep ${pid_in_file} | awk '{print $1}'` - fi - fi - else - p=`${JPS} -l | grep "${MAIN_CLASS}" | awk '{print $1}'` - fi - if [ -z "${p}" ]; then - LOG INFO "${FRIEND_NAME} didn't start successfully, not found in the java process table" - return 0 - fi - LOG INFO "Killing ${FRIEND_NAME} (pid ${p}) ..." - case "`uname`" in - CYCGWIN*) taskkill /F /PID "${p}" ;; - *) kill -9 "${p}" ;; - esac -} - -restart_m(){ - stop_m - if [ $? -eq 0 ]; then - start_m - exit $? - else - LOG ERROR "${FRIEND_NAME} restart fail" >&2 - exit 1 - fi -} - -if [ ! $1 ]; then - usage - exit 1; -fi -case $1 in - start) start_m;; - stop) stop_m;; - shutdown) shutdown_m;; - restart) restart_m;; - *) - usage - exit 1 - ;; -esac -exit $? \ No newline at end of file diff --git a/modules/executor/core/src/main/bin/task-kill.sh b/modules/executor/core/src/main/bin/task-kill.sh deleted file mode 100644 index 540398bd0..000000000 --- a/modules/executor/core/src/main/bin/task-kill.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# -# Copyright 2020 WeBank -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -SLEEP_TIMEREVAL_S=2 - -if [ "x$1" == "x" ]; then - echo "you should add a process ID of the task which needs to be killed!" >&2 - exit 1 -fi - - -status_pid(){ - local p_tree=`pstree $1 -p` - if [ -n "${p_tree}" ]; then - echo "Task $1 is still alive..." - return 0 - else - echo "Task $1 has been killed" - return 1 - fi -} - -wait_for_shutdown(){ - local now_s=`date '+%s'` - local stop_s=$((${now_s} + $1)) - while [ ${now_s} -le ${stop_s} ]; do - status_pid $2 - if [ $? -eq 1 ]; then - return 0 - fi - sleep ${SLEEP_TIMEREVAL_S} - now_s=`date '+%s'` - done - return 1 -} - -kill_task(){ - echo "start to kill task whose pid is ${1}" - case "`uname`" in - CYGWIN*) taskkill /T /PID "$1";; - *) pstree "$1" -p | awk -F "[()]" '{print $2}' | sudo xargs kill -SIGTERM;; - esac - echo "wait for shutdown ..." - wait_for_shutdown 5 $1 - if [ $? -eq 1 ]; then - local status=`ps -aux | grep $1 | grep -v grep | awk '{print $8}'` - if [ "$status" == "Z" ]; then - echo "this task seems to be blocked, force to kill it" - case "`uname`" in - CYGWIN*) taskkill /F /T /PID "$1";; - *) pstree "$1" -p | awk -F "[()]" '{print $2}' | sudo xargs kill -9;; - esac - fi - fi -} - -kill_task $1 diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/ExecutorApplication.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/ExecutorApplication.java deleted file mode 100644 index 852c73338..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/ExecutorApplication.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis; - -import com.webank.wedatasphere.exchangis.common.util.ProcessUtil; -import com.webank.wedatasphere.exchangis.route.feign.FeginClientConfig; -import io.micrometer.core.instrument.MeterRegistry; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration; -import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration; -import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration; -import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration; -import org.springframework.boot.autoconfigure.elasticsearch.jest.JestAutoConfiguration; -import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.openfeign.EnableFeignClients; -import org.springframework.context.annotation.Bean; - -/** - * Created by devendeng on 2018/8/28. - */ -@SpringBootApplication(exclude = {MongoAutoConfiguration.class, MongoDataAutoConfiguration.class, JestAutoConfiguration.class, ElasticsearchAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class, ElasticsearchRepositoriesAutoConfiguration.class}) -@EnableDiscoveryClient -@EnableFeignClients(defaultConfiguration = {FeginClientConfig.class}) -public class ExecutorApplication { - private static Logger LOG = LoggerFactory.getLogger(ExecutorApplication.class); - - public static void main(String[] args) { - String pidFile = System.getProperty("pid.file", ""); - try { - ProcessUtil.mountPIDFile(pidFile); - }catch(Exception e){ - LOG.error("Fail to store PID file in disk path: [" + pidFile +"]", e); - return; - } - SpringApplication.run(ExecutorApplication.class, args); - } - - @Bean - MeterRegistryCustomizer meterRegistryCustomizer(MeterRegistry meterRegistry) { - return meterRegistry1 -> { - meterRegistry.config() - .commonTags("application", "ExecutorApplication"); - //所有指标添加统一标签: application = Tenantapp - }; - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/auth/AuthWebConfiguer.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/auth/AuthWebConfiguer.java deleted file mode 100644 index da7d7cdcd..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/auth/AuthWebConfiguer.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.auth; - -import com.webank.wedatasphere.exchangis.common.auth.interceptors.AuthenticationInterceptor; -import com.webank.wedatasphere.exchangis.common.auth.interceptors.AuthorityInterceptor; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -import javax.annotation.Resource; - -/** - * @author davidhua - * 2018/11/5 - */ -@Configuration -public class AuthWebConfiguer implements WebMvcConfigurer { - @Resource - private AuthenticationInterceptor authenticationInterceptor; - - @Resource - private AuthorityInterceptor authorityInterceptor; - - @Resource - private TaskProcessAuthInterceptor taskProcessAuthInterceptor; - @Override - public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(authenticationInterceptor).order(1).addPathPatterns("/api/v1/executor/**"); - registry.addInterceptor(authorityInterceptor).order(2).addPathPatterns("/api/v1/executor/**"); - registry.addInterceptor(taskProcessAuthInterceptor).order(3).addPathPatterns("/api/v1/task/process"); - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/auth/TaskProcessAuthInterceptor.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/auth/TaskProcessAuthInterceptor.java deleted file mode 100644 index b468e3584..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/auth/TaskProcessAuthInterceptor.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.auth; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; -import org.springframework.web.servlet.HandlerInterceptor; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.net.Inet4Address; - -/** - * @author davidhua - * 2019/4/15 - */ -@Component -public class TaskProcessAuthInterceptor implements HandlerInterceptor { - private static final Logger LOG = LoggerFactory.getLogger(TaskProcessAuthInterceptor.class); - @Override - public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { - String remote = request.getRemoteAddr(); - String localIp = Inet4Address.getLocalHost().getHostAddress(); - return StringUtils.isNotBlank(remote) && remote.equals(localIp); - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/ExecutorConfiguration.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/ExecutorConfiguration.java deleted file mode 100644 index 25b38bf88..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/ExecutorConfiguration.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor; - -import com.webank.wedatasphere.exchangis.executor.util.LinuxPlatFormUtil; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - -/** - * @author davidhua - * 2019/8/27 - */ -@Component -public class ExecutorConfiguration { - - @Value("${executor.linux.sudo_user:hadoop}") - private String linuxSudoUser = LinuxPlatFormUtil.DEFAULT_HADOOP_USER; - - @Value("${executor.heartbeat.interval-in-sec.active}") - private Long activeHeartBeat; - - @Value("${executor.heartbeat.interval-in-sec.idle}") - private Long idleHeartBeat; - - @Value("${executor.job.allocate.time-in-seconds:5}") - private int waitAllocTimeInSec; - - @Value("${executor.job.logger.dir}") - private String jobLogDir; - - @Value("${executor.job.logger.history}") - private String jobLogHistory; - - @Value("${executor.job.logger.limit.number:10000}") - private Long jobLogLimitNum; - - @Value("${executor.job.engine.dataX.home}") - private String engineDataXHome; - - @Value("${executor.job.engine.dataX.python.shell}") - private String engineDataXPythonShell; - - @Value("${executor.job.engine.dataX.python.script}") - private String engineDataXPythonScript; - - @Value("${executor.job.engine.dataX.java.mainClass}") - private String engineDataXJavaMainClass; - - @Value("${executor.job.engine.dataX.java.classPath}") - private String engineDataXJavaClassPath; - - @Value("${executor.job.engine.dataX.java.logConfFile}") - private String engineDataXJavaLogConf; - - @Value("${executor.job.engine.dataX.method}") - private String engineDataXMethod; - - @Value("${executor.network.interface.name}") - private String networkInterface; - /** - * DataX log file name - */ - @Value("${executor.job.engine.dataX.logger-file-name}") - private String engineDataXLogFile; - - /** - * DataX config file name - */ - @Value("${executor.job.engine.dataX.config-file-name}") - private String engineDataXConfFile; - - /** - * DataX processors source path - */ - @Value("${executor.job.engine.dataX.proc-src-dir}") - private String engineDataXProcSrc; - - @Value("${executor.job.engine.sqoop.shell}") - private String engineSqoopShell; - - @Value("${executor.node.default:true}") - private boolean nodeDefault; - - @Value("${executor.node.tab}") - private String nodeTabs; - - public Long getActiveHeartBeat() { - return activeHeartBeat; - } - - public void setActiveHeartBeat(Long activeHeartBeat) { - this.activeHeartBeat = activeHeartBeat; - } - - public Long getIdleHeartBeat() { - return idleHeartBeat; - } - - public void setIdleHeartBeat(Long idleHeartBeat) { - this.idleHeartBeat = idleHeartBeat; - } - - public int getWaitAllocTimeInSec() { - return waitAllocTimeInSec; - } - - public String getJobLogDir() { - return jobLogDir; - } - - public String getJobLogHistory() { - return jobLogHistory; - } - - public String getEngineDataXHome() { - return engineDataXHome; - } - - public String getEngineDataXLogFile() { - return engineDataXLogFile; - } - - public String getEngineDataXConfFile() { - return engineDataXConfFile; - } - - public String getEngineDataXProcSrc() { - return engineDataXProcSrc; - } - - - public String getNetworkInterface() { - return networkInterface; - } - - public String getEngineSqoopShell() { - return engineSqoopShell; - } - - public Long getJobLogLimitNum() { - return jobLogLimitNum; - } - - public String getLinuxSudoUser() { - return linuxSudoUser; - } - - public String getEngineDataXPythonShell() { - return engineDataXPythonShell; - } - - public String getEngineDataXPythonScript() { - return engineDataXPythonScript; - } - - public String getEngineDataXJavaMainClass() { - return engineDataXJavaMainClass; - } - - public String getEngineDataXJavaClassPath() { - return engineDataXJavaClassPath; - } - - public String getEngineDataXMethod() { - return engineDataXMethod; - } - - public String getEngineDataXJavaLogConf() { - return engineDataXJavaLogConf; - } - - public boolean isNodeDefault() { - return nodeDefault; - } - - public String getNodeTabs() { - return nodeTabs; - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/JobContainer.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/JobContainer.java deleted file mode 100644 index 438b65ff0..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/JobContainer.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor; - -import com.webank.wedatasphere.exchangis.job.domain.LogResult; -import com.webank.wedatasphere.exchangis.job.domain.TaskState; - -import java.util.Calendar; -import java.util.concurrent.atomic.AtomicLong; - -/** - * @author davidhua - * 2019/11/12 - */ -public class JobContainer { - - public static final Integer TASK_CODE_SUCCESS = 0; - public static final Integer TASK_CODE_KILL = 143; - public static final String LOG_SYS_NAME = "out.log"; - public static final String LOG_STDOUT_NAME = "stdout.log"; - public static final String LOG_STDERR_NAME = "stderr.log"; - public static final String PID_NAME = "pid"; - - private JobExecutor jobExecutor; - private TaskState taskState; - private Runtime runtime; - - public class Runtime{ - private AtomicLong maxByteSpeed = new AtomicLong(0); - - public void limit(Long maxByteSpeed){ - //Just update the value simply - this.maxByteSpeed.set(maxByteSpeed); - } - - public Long getMaxByteSpeed(){ - return this.maxByteSpeed.get(); - } - - public void toStop(){ - if(jobExecutor.isAlive()) { - jobExecutor.toStop(); - } - } - - public LogResult log(long startLine, long windSize){ - return jobExecutor.log(startLine, windSize); - } - } - public JobContainer(JobExecutor jobExecutor){ - this.jobExecutor = jobExecutor; - this.taskState = jobExecutor.getTaskState(); - this.runtime = new Runtime(); - } - - /** - * Update the task state information - * @param state - */ - public void updateTaskState(TaskState state){ - if(state.getCurrentByteSpeed() != null) { - taskState.setCurrentByteSpeed(state.getCurrentByteSpeed()); - } - taskState.setVersionTime(Calendar.getInstance().getTime()); - } - - - public TaskState getState(){ - return new TaskState(this.taskState); - } - - public Runtime getRuntime() { - return this.runtime; - } - - public long getJobId(){ - return this.jobExecutor.getJobId(); - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/JobContainerManager.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/JobContainerManager.java deleted file mode 100644 index 8efe873bf..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/JobContainerManager.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor; - - -import com.webank.wedatasphere.exchangis.job.domain.TaskState; -import org.springframework.stereotype.Component; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.ConcurrentHashMap; - -/** - * @author davidhua - * 2019/11/12 - */ -@Component -public class JobContainerManager { - private ConcurrentHashMap jobContainers = new ConcurrentHashMap<>(); - - public JobContainerManager(){ - } - - public JobContainer removeContainer(Object containerId){ - return this.jobContainers.remove(String.valueOf(containerId)); - } - - public boolean addContainer(Object containerId, JobContainer jobContainer){ - return this.jobContainers.putIfAbsent(String.valueOf(containerId), jobContainer) == null; - } - - public JobContainer getContainer(Object containerId){ - return this.jobContainers.get(String.valueOf(containerId)); - } - - /** - * Collect all the task states - * @return - */ - public List collectStateList(){ - List stateList = new ArrayList<>(); - jobContainers.forEach((key, value) -> stateList.add(value.getState())); - return stateList; - } - - public boolean updateTaskState(Object containerId, TaskState state){ - JobContainer container = getContainer(containerId); - if(null != container){ - container.updateTaskState(state); - return true; - } - return false; - } - -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/JobExecutor.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/JobExecutor.java deleted file mode 100644 index da6ffba4b..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/JobExecutor.java +++ /dev/null @@ -1,331 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor; - -import com.webank.wedatasphere.exchangis.common.util.json.Json; -import com.webank.wedatasphere.exchangis.executor.exception.TaskResAllocException; -import com.webank.wedatasphere.exchangis.executor.listener.TaskHandleListener; -import com.webank.wedatasphere.exchangis.executor.resource.Resource; -import com.webank.wedatasphere.exchangis.executor.resource.ResourceManager; -import com.webank.wedatasphere.exchangis.executor.task.TaskDaemonPoolManager; -import com.webank.wedatasphere.exchangis.executor.task.TaskProcess; -import com.webank.wedatasphere.exchangis.executor.task.TaskProcessBuilder; -import com.webank.wedatasphere.exchangis.executor.task.process.TaskProcessUtils; -import com.webank.wedatasphere.exchangis.executor.domain.ExecuteStatus; -import com.webank.wedatasphere.exchangis.executor.listener.TaskCompleteListener; -import com.webank.wedatasphere.exchangis.executor.daemons.ClockDaemon; -import com.webank.wedatasphere.exchangis.executor.daemons.LoggerDaemon; -import com.webank.wedatasphere.exchangis.job.domain.LogResult; -import com.webank.wedatasphere.exchangis.job.domain.TaskState; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.locks.Condition; -import java.util.concurrent.locks.ReentrantLock; - -/** - * Created by devendeng on 2018/9/5. - * - * @author devendeng - */ -public class JobExecutor extends Thread { - private Logger LOG = LoggerFactory.getLogger(JobExecutor.class); - - private TaskProcess taskProcess; - private final int timeout; - private TaskCompleteListener completeListener; - private Map handleListenerMap = new HashMap<>(); - - private TaskDaemonPoolManager daemonPoolManager; - - private ExecuteStatus status; - - private ReentrantLock exec = new ReentrantLock(); - private ReentrantLock alloc = new ReentrantLock(); - - private ResourceManager resourceManager; - private Condition notAlloc = alloc.newCondition(); - private boolean init = false; - - private long jobId; - - public JobExecutor(long jobId, TaskProcessBuilder processBuilder, int timeout, - TaskCompleteListener completeListener){ - this(jobId, processBuilder.build(), timeout, completeListener); - } - - public JobExecutor(long jobId, TaskProcess taskProcess, int timeout, - TaskCompleteListener completeListener){ - this.jobId = jobId; - this.taskProcess = taskProcess; - this.timeout = timeout; - this.completeListener = completeListener; - this.daemonPoolManager = new TaskDaemonPoolManager(taskProcess); - } - /** - * Kill job thread - */ - public void toStop() { - LOG.info("Stop task, info {}", taskProcess); - try { - //first to destroy the process - taskProcess.destroy(); - //second to clean it - status = ExecuteStatus.KILL; - } catch (Exception e) { - long taskId = TaskProcessUtils.getTaskId(taskProcess); - LOG.error("TASK_KILL_ERROR, kill task error, jobId: {} , taskId: {}, message: {}", - TaskProcessUtils.getJobId(taskProcess), taskId, e.getMessage(), e); - throw new RuntimeException(e); - } - - } - - /** - * Fetch log - * @param startLine - * @param windSize - * @return - */ - public LogResult log(long startLine, long windSize){ - return this.taskProcess.log(startLine, windSize); - } - public Resource getResource(){ - return taskProcess.getResource(); - } - - /** - * Wait for allocating resource for executor - * @return is allocated - */ - public boolean waitForAlloc(int interval, TimeUnit timeUnit){ - alloc.lock(); - try{ - if(!TaskProcessUtils.isAllocate(taskProcess)){ - if(notAlloc.await(interval, timeUnit)){ - //Do nothing - } - } - } catch (InterruptedException e) { - LOG.error("Interrupt when waiting for allocating resource for 'jobExecutor'"); - Thread.currentThread().interrupt(); - } finally{ - alloc.unlock(); - } - return TaskProcessUtils.isAllocate(taskProcess); - } - - public void init() throws Exception { - taskProcess.init(); - init = true; - } - - public void clean(){ - if(null != taskProcess) { - taskProcess.clean(); - } - } - @Override - public void run() { - status = ExecuteStatus.NONE; - String message = ""; - long jobId = TaskProcessUtils.getJobId(taskProcess); - long taskId = TaskProcessUtils.getTaskId(taskProcess); - Exception ex = null; - try { - if(!init) { - taskProcess.init(); - } - try { - Future taskFuture = allocAndExec(taskProcess); - LOG.info("Task {} 's status change to RUNNING", taskId); - status = ExecuteStatus.RUNNING; - int exitCode; - if(!taskFuture.isDone()) { - //Get lock for executing - exec.lock(); - LOG.info("Open daemon threads for taskId: [{}]", taskId); - openDaemons(taskProcess, jobId + "_" + taskId); - try { - exitCode = taskFuture.get(); - } catch (InterruptedException e) { - LOG.error("Task [{}] process have been interrupted", taskId); - throw e; - } finally { - //Release lock for executing - exec.unlock(); - } - }else{ - exitCode = taskFuture.get(); - } - if(exitCode == JobContainer.TASK_CODE_SUCCESS){ - status = ExecuteStatus.SUCCESS; - }else if (exitCode == JobContainer.TASK_CODE_KILL){ - status = ExecuteStatus.KILL; - }else{ - status = ExecuteStatus.FAILD; - } - }catch(TaskResAllocException e){ - try { - LOG.info("Allocate task [{}] failed, message: [{}] try to destroy the process...", taskId, e.getMessage()); - taskProcess.destroy(); - }catch(Exception e0){ - //ignore - } - } - } catch (Exception e) { - if(status == ExecuteStatus.RUNNING) { - ex = e; - //this must to be failed - status = ExecuteStatus.FAILD; - message = e.getMessage(); - }else{ - LOG.error("Task allocate failed, [{}], message: [{}]", taskId, e.getMessage()); - } - } finally { - clean(taskProcess); - if(status != ExecuteStatus.NONE && status != ExecuteStatus.KILL){ - if(null == ex | !(ex instanceof InterruptedException)) { - try { - //任务完成情况 - completeListener.handleComplete(taskProcess, status, message); - } catch (Exception e) { - LOG.error("TASK_ERROR, notify server task [{}] complete error.", String.valueOf(taskId), e); - } - try { - LOG.info("Start to close the daemon pool of task [{}]", taskId); - long record = System.currentTimeMillis(); - daemonPoolManager.shutdown(); - LOG.info("Finish closing the daemon pool of task [{}], spend time in millis: [{}]", - taskId, System.currentTimeMillis() - record); - }catch(Exception e){ - //ignore error - LOG.error("Cannot shutdown the task [{}] 's daemons thread completely.", String.valueOf(taskId), e); - } - } - } - TaskHandleListener listener = handleListenerMap.get(String.valueOf(Hook.TASK_END)); - if(null != listener){ - listener.handle(taskProcess, message); - } - } - - } - - /** - * Add hook - * @param hook - */ - public void addHook(Hook hook, TaskHandleListener handleListener){ - handleListenerMap.put(String.valueOf(hook), handleListener); - } - - /** - * Get task state - * @return task state - */ - public TaskState getTaskState(){ - return TaskProcessUtils.getTaskState(taskProcess); - } - - private void openDaemons(TaskProcess process, String namePrefix){ - daemonPoolManager.addDaemon( - new LoggerDaemon(namePrefix , JobContainer.LOG_STDOUT_NAME, - this.taskProcess, process.getInputStream()) - ); - daemonPoolManager.addDaemon( - new LoggerDaemon(namePrefix, JobContainer.LOG_STDERR_NAME, - this.taskProcess, process.getErrorStream()) - ); - daemonPoolManager.addDaemon( - new ClockDaemon(namePrefix + "-clock", this.taskProcess, this.exec, - this.timeout, this.handleListenerMap.get(String.valueOf(Hook.TASK_TIMEOUT))) - ); - } - - public ResourceManager getResourceManager() { - return resourceManager; - } - - public void setResourceManager(ResourceManager resourceManager) { - this.resourceManager = resourceManager; - } - - /** - * Allocate resource for process and execute - * @param taskProcess - * @return - */ - private Future allocAndExec(TaskProcess taskProcess) throws TaskResAllocException{ - //Get lock for allocating - alloc.lock(); - boolean exec = false; - boolean preAlloc = true; - try{ - Resource resource = this.taskProcess.getResource(); - //Pre allocate - if(null != resourceManager){ - preAlloc = resourceManager.allocate(resource); - } - if(preAlloc) { - LOG.info("Pre-allocate task [{}] resource success, " + - "resource:["+ Json.toJson(resource, null) + "]", TaskProcessUtils.getTaskId(taskProcess)); - //execute and allocate actually - return taskProcess.executeAsync(); - }else{ - LOG.info("Pre-allocate task:[" + TaskProcessUtils.getTaskId(taskProcess) + "] resource failed," + - " resource:[" + Json.toJson(resource, null)+ "]"); - throw new TaskResAllocException(); - } - }finally{ - notAlloc.signalAll(); - alloc.unlock(); - } - } - - private void clean(TaskProcess taskProcess){ - long taskId = TaskProcessUtils.getTaskId(taskProcess); - LOG.info("Task [{}] finish, start to release the resource", taskId); - try { - if(null != resourceManager){ - resourceManager.collect(taskProcess.getResource()); - } - taskProcess.clean(); - }catch(Exception e){ - LOG.error("IO_ERROR: release the resource of task [{}] failed", taskId, e); - } - } - public long getJobId() { - return jobId; - } - - public enum Hook{ - /** - * Condition: timeout - */ - TASK_TIMEOUT, - /** - * Condition: end - */ - TASK_END - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/backend/BackendScheduler.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/backend/BackendScheduler.java deleted file mode 100644 index a4bd33cba..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/backend/BackendScheduler.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.backend; - -import org.quartz.*; -import org.quartz.impl.StdSchedulerFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import javax.annotation.PostConstruct; -import java.util.concurrent.TimeUnit; - -/** - * Scheduler for backend processes - * @author davidhua - * 2020/3/28 - */ -@Component -public class BackendScheduler { - - private static Logger LOG = LoggerFactory.getLogger(BackendScheduler.class); - - private Scheduler scheduler; - @PostConstruct - public void init() { - try { - this.scheduler = StdSchedulerFactory.getDefaultScheduler(); - this.scheduler.start(); - initScheduleJobs(); - }catch(Exception e){ - LOG.error("SCHEDULE_ERROR: [" + e.getMessage() +"]", e); - System.exit(1); - } - } - - public void scheduleInterval(String id, Class jobClass, long interval, TimeUnit timeUnit) { - JobDetail job = JobBuilder.newJob(jobClass) - .withIdentity(id).build(); - Trigger trigger = TriggerBuilder.newTrigger() - .withIdentity(id).withSchedule( - SimpleScheduleBuilder.simpleSchedule() - .withIntervalInSeconds(Math.toIntExact(timeUnit.toSeconds(interval))) - .repeatForever() - ).build(); - try { - this.scheduler.scheduleJob(job, trigger); - } catch (SchedulerException e) { - LOG.error("SCHEDULE_ERROR: Fail to schedule interval: [" + e.getMessage() +"]", e); - } - } - - public void scheduleCorn(String id, Class jobClass, String cornExpression){ - JobDetail job = JobBuilder.newJob(jobClass) - .withIdentity(id).build(); - CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(cornExpression) - .withMisfireHandlingInstructionDoNothing(); - CronTrigger trigger = TriggerBuilder.newTrigger() - .withIdentity(id).withSchedule(cronScheduleBuilder).build(); - try { - this.scheduler.scheduleJob(job, trigger); - } catch (SchedulerException e) { - LOG.error("SCHEDULE_ERROR: Fail to schedule corn: [" + e.getMessage() +"]", e); - } - } - - public void stopSchedule(String id){ - try { - this.scheduler.pauseJob(JobKey.jobKey(id)); - } catch (SchedulerException e) { - LOG.error("SCHEDULE_ERROR: Fail to stop schedule job[" + id + "]: [" + e.getMessage() +"]", e); - } - } - - public void shutdown(){ - try { - this.scheduler.shutdown(); - } catch (SchedulerException e) { - //Ignore - } - } - public void initScheduleJobs(){ - this.scheduleInterval("BACKEND-LOG-CLEAN", LogCleanerJob.class,1, TimeUnit.HOURS); - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/backend/LogCleanerJob.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/backend/LogCleanerJob.java deleted file mode 100644 index 7ebe3473e..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/backend/LogCleanerJob.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.backend; - -import com.webank.wedatasphere.exchangis.common.util.spring.AppUtil; -import com.webank.wedatasphere.exchangis.executor.ExecutorConfiguration; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.filefilter.IOFileFilter; -import org.apache.commons.lang3.StringUtils; -import org.quartz.Job; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.*; - -/** - * @author davidhua - * 2020/3/28 - */ -public class LogCleanerJob implements Job { - private static final Logger LOG = LoggerFactory.getLogger(LogCleanerJob.class); - @Override - public void execute(JobExecutionContext context) throws JobExecutionException { - ExecutorConfiguration configuration = null; - try { - configuration = AppUtil.getBean(ExecutorConfiguration.class); - }catch(Exception e){ - //Ignore - } - if(null == configuration){ - return; - } - String historyPath = configuration.getJobLogHistory(); - Long limitNum = configuration.getJobLogLimitNum(); - if(StringUtils.isNotBlank(historyPath)){ - File historyDir = new File(historyPath); - if(historyDir.isDirectory()){ - List logFiles = new ArrayList<>(FileUtils.listFiles(historyDir, new IOFileFilter() { - @Override - public boolean accept(File file) { - return true; - } - - @Override - public boolean accept(File file, String s) { - return true; - } - }, null)); - LOG.info("Scan to clean history log in [" + historyPath + "], actual number: [" + logFiles.size() + "/" + limitNum + "]"); - StringBuilder cleanPrint = new StringBuilder(""); - if(logFiles.size() > limitNum) { - long count = 0; - //First to do sort - logFiles.sort((o1, o2) -> { - long diff = o1.lastModified() - o2.lastModified(); - if (diff > 0) - return -1; - else if (diff == 0) - return 0; - else - return 1; - }); - for(int i = Math.toIntExact(limitNum); i < logFiles.size(); i ++, count++){ - File f = logFiles.get(i); - if(!f.delete()){ - LOG.trace("Fail to delete logFile:[" + f.getName() +"] in history log directory"); - }else{ - if(count == 0){ - cleanPrint.append(f.getName()); - }else if(count < 10){ - cleanPrint.append(",").append(f.getName()); - } - } - } - LOG.info("Final to delete [" + count + "] logs, [" + cleanPrint.toString() + " ...]"); - } - } - } - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/controller/ExecutorController.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/controller/ExecutorController.java deleted file mode 100644 index 10505dc3b..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/controller/ExecutorController.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.controller; - -import com.webank.wedatasphere.exchangis.common.constant.CodeConstant; -import com.webank.wedatasphere.exchangis.common.controller.Response; -import com.webank.wedatasphere.exchangis.common.util.machine.MachineInfo; -import com.webank.wedatasphere.exchangis.executor.JobContainer; -import com.webank.wedatasphere.exchangis.executor.ExecutorConfiguration; -import com.webank.wedatasphere.exchangis.executor.domain.ExecuteReq; -import com.webank.wedatasphere.exchangis.executor.domain.ExecuteResp; -import com.webank.wedatasphere.exchangis.executor.domain.ExecuteStatus; -import com.webank.wedatasphere.exchangis.executor.exception.TaskResAllocException; -import com.webank.wedatasphere.exchangis.executor.service.ExecutorService; -import com.webank.wedatasphere.exchangis.job.domain.LogResult; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.validation.ConstraintViolation; -import javax.validation.ConstraintViolationException; -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; - -/** - * @author davidhua - */ -@RestController -@RequestMapping("/api/v1/executor") -public class ExecutorController { - - private static Logger LOG = LoggerFactory.getLogger(ExecutorController.class); - - private static final Integer DEFAULT_WINDOW_SIZE = 100; - @Resource - private ExecutorService executorService; - - @Resource - private ExecutorConfiguration configuration; - - @Value("${server.port}") - private Integer port; - - /** - * Parameter Exception - * @param e - * @return - */ - @ExceptionHandler(value = ConstraintViolationException.class) - public Response errorParameterHandler(ConstraintViolationException e) { - StringBuilder message = new StringBuilder(); - for (ConstraintViolation c : e.getConstraintViolations()) { - message.append(c.getMessage()); - } - return new Response<>().errorResponse(CodeConstant.PARAMETER_ERROR, null, message.toString()); - } - - @ExceptionHandler(value = TaskResAllocException.class) - public Response errorHandler(TaskResAllocException e){ - return new Response<>().errorResponse(CodeConstant.TASK_ALLOCATE_FAILD, null, e.getMessage()); - } - /** - * Global Exception - * @param e - * @return - */ - @ExceptionHandler(value = Exception.class) - public Response errorHandler(Exception e) { - LOG.error("SYSTEM EXCEPTION, message:", e); - return new Response<>().errorResponse(CodeConstant.SYS_ERROR, null, "系统处理异常"); - } - /** - * Execute task - */ - @RequestMapping(value = "/run", method = RequestMethod.POST) - public Response run(@Valid @RequestBody ExecuteReq req) { - LOG.trace("Run job {}", req); - ExecuteResp resp = new ExecuteResp(); - String host = MachineInfo.getIpAddress(configuration.getNetworkInterface()); - resp.setExecutorAddress(host + ":" + port); - boolean status = false; - String execUser = req.getExecUser(); - try { - if(StringUtils.isBlank(execUser)){ - execUser = System.getProperty("user.name", ""); - } - status = executorService.run(req, execUser); - }catch(TaskResAllocException e){ - return new Response().errorResponse(CodeConstant.TASK_ALLOCATE_FAILD, null, e.getMessage()); - }catch (Exception e){ - LOG.error("Execute task "+req.getTaskId()+" error",e); - resp.setMessage(e.getMessage()); - } - if(status){ - resp.setStatus(ExecuteStatus.RUNNING); - }else{ - resp.setStatus(ExecuteStatus.FAILD); - } - resp.setExecUser(execUser); - return new Response().successResponse(resp); - } - - /** - * Fetch log - */ - @RequestMapping(value = "/log/{jobId}/{taskId}/{startLine}/{windSize}", method = RequestMethod.GET) - public Response log(@Valid @NotBlank(message = "jobId不能为空") @PathVariable long jobId, - @Valid @NotBlank(message = "taskId不能为空") @PathVariable long taskId, - @PathVariable int startLine, @PathVariable("windSize") int windSize) { - if(windSize == 0){ - windSize = DEFAULT_WINDOW_SIZE; - } - LogResult log = executorService.log(jobId,taskId,startLine, windSize); - return new Response().successResponse(log); - } - - /** - * Kill task - */ - @RequestMapping(value = "/kill/{jobId}/{taskId}", method = RequestMethod.GET) - public Response kill(@Valid @NotBlank(message = "jobId不能为空") @PathVariable long jobId, @Valid @NotBlank(message = "taskId不能为空") @PathVariable long taskId) { - try { - executorService.kill(jobId, taskId); - }catch(Exception e){ - return new Response().errorResponse(CodeConstant.SYS_ERROR, null, "停止任务失败"); - } - return new Response().successResponse("success"); - } - - /** - * Check alive - * @return - */ - @RequestMapping(value = "/alive/{jobId}/{taskId}", method = RequestMethod.GET) - public Response alive(@Valid @NotBlank(message = "jobId不能为空") @PathVariable long jobId, @Valid @NotBlank(message = "taskId不能为空") @PathVariable long taskId){ - return new Response().successResponse( - executorService.isAlive(jobId, taskId) - ); - } - - @RequestMapping(value = "/runtime/{jobId}/{taskId}/limit/speed/{byteSpeedLimit:\\w+}", method = RequestMethod.PUT) - public Response runtimeLimitSpeed(@PathVariable("jobId")long jobId, - @PathVariable("taskId")long taskId, - @PathVariable("byteSpeedLimit")long byteSpeedLimit){ - JobContainer jobContainer = executorService.getJobContainer(taskId); - if(null != jobContainer){ - jobContainer.getRuntime().limit(byteSpeedLimit); - } - return new Response<>().successResponse("success"); - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/controller/SystemEnvController.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/controller/SystemEnvController.java deleted file mode 100644 index c1f24535d..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/controller/SystemEnvController.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.controller; - -import com.webank.wedatasphere.exchangis.common.constant.CodeConstant; -import com.webank.wedatasphere.exchangis.common.controller.Response; -import com.webank.wedatasphere.exchangis.executor.util.LinuxPlatFormUtil; -import com.webank.wedatasphere.exchangis.executor.domain.ExecSysUser; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang3.tuple.MutablePair; -import org.apache.commons.lang3.tuple.Pair; -import org.apache.commons.lang3.tuple.Triple; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.PostConstruct; - -/** - * @author davidhua - * 2019/10/28 - */ -@RestController -@RequestMapping("/api/v1/executor/env") -public class SystemEnvController { - private static final String ENV_WIND_TAG = "wind"; - - private static Logger LOG = LoggerFactory.getLogger(SystemEnvController.class); - - private Pair procUserInfo = new MutablePair<>(null, null); - @PostConstruct - public void init(){ - String osName = System.getProperty("os.name"); - if(StringUtils.isBlank(osName) || !osName.toLowerCase().equalsIgnoreCase(ENV_WIND_TAG)){ - procUserInfo = LinuxPlatFormUtil.currentUser(); - LOG.info("Get current process's user UID: " + procUserInfo.getLeft() + ", GID: " + procUserInfo.getRight()); - } - } - - /** - * Create system user - * @param username - * @param uid - * @param gid - * @return - */ - @RequestMapping(value = "/user/{username}/{uid:\\d+}/{gid:\\d+}", method = RequestMethod.POST) - public Response createSysUser(@PathVariable("username")String username, - @PathVariable("uid")Integer uid, @PathVariable("gid")Integer gid){ - String osName = System.getProperty("os.name"); - if(StringUtils.isNotBlank(osName) && osName.toLowerCase().equalsIgnoreCase(ENV_WIND_TAG)){ - return new Response().errorResponse(CodeConstant.SYS_ERROR, null, "System Environment is: " + osName); - } - try{ - if(procUserInfo.getRight() != null){ - gid = procUserInfo.getRight(); - } - Triple triple = LinuxPlatFormUtil.existUser(username); - if(!triple.getLeft()){ - Pair pair = LinuxPlatFormUtil.createUser(username, uid, gid); - if(!pair.getLeft()){ - return new Response().errorResponse(CodeConstant.SYS_ERROR, null, - "Cannot create user: " + username + ", uid:" + uid + ", gid:" + gid + ", " + - "message:" + pair.getRight()); - } - if(uid <= 0 || gid <= 0){ - triple = LinuxPlatFormUtil.existUser(username); - if(triple.getLeft()){ - uid = triple.getMiddle(); - gid = triple.getRight(); - } - } - }else{ - return new Response().successResponse(new ExecSysUser(username, - triple.getMiddle(), triple.getRight())); - } - - return new Response().successResponse(new ExecSysUser(username, - uid, gid)); - }catch(Exception e){ - LOG.error(e.getMessage(), e); - return new Response().errorResponse(CodeConstant.SYS_ERROR, null, e.getMessage()); - } - } - - /** - * Delete system user - * @param username - * @return - */ - @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) - public Response deleteSysUser(@PathVariable("username")String username){ - String osName = System.getProperty("os.name"); - if(StringUtils.isNotBlank(osName) && osName.toLowerCase().equalsIgnoreCase(ENV_WIND_TAG)){ - return new Response<>().errorResponse(CodeConstant.SYS_ERROR, null, "System Environment is: " + osName); - } - try { - Triple triple = LinuxPlatFormUtil.existUser(username); - if(!triple.getLeft()){ - return new Response<>().errorResponse(CodeConstant.SYS_ERROR, null, "User: " + username + " doesn't exist"); - }else if(triple.getMiddle().equals(procUserInfo.getLeft())){ - return new Response<>().errorResponse(CodeConstant.SYS_ERROR, null, "User: " + username + " is processor's user"); - }else if(!triple.getRight().equals(procUserInfo.getRight())){ - return new Response<>().errorResponse(CodeConstant.SYS_ERROR, null, "Cannot delete user: " + username + - ", GID: " + triple.getRight()); - } - Pair pair = LinuxPlatFormUtil.deleteUser(username); - if(!pair.getLeft()){ - return new Response<>().errorResponse(CodeConstant.SYS_ERROR, null, - "Cannot delete user: " + username + ", message:" + pair.getRight()); - } - }catch(Exception e){ - LOG.error(e.getMessage(), e); - return new Response<>().errorResponse(CodeConstant.SYS_ERROR, null, e.getMessage()); - } - return new Response<>().successResponse("success"); - } - -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/controller/TaskProcessController.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/controller/TaskProcessController.java deleted file mode 100644 index 06c7cea10..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/controller/TaskProcessController.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.controller; -import com.webank.wedatasphere.exchangis.executor.JobContainer; -import com.webank.wedatasphere.exchangis.job.domain.JobReport; -import com.webank.wedatasphere.exchangis.common.controller.Response; -import com.webank.wedatasphere.exchangis.common.util.json.Json; -import com.webank.wedatasphere.exchangis.executor.service.CallBackService; -import com.webank.wedatasphere.exchangis.executor.service.ExecutorService; -import com.webank.wedatasphere.exchangis.job.domain.TaskState; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.Map; - -/** - * @author davidhua - * 2019/4/15 - */ -@RestController -@RequestMapping("/api/v1/task/process") -public class TaskProcessController{ - private static final Logger LOG = LoggerFactory.getLogger(TaskProcessController.class); - @Resource - private ExecutorService executorService; - @Resource - private CallBackService callBackService; - - @RequestMapping(value = "/report", method = RequestMethod.POST) - public Response report(@RequestBody JobReport jobReport){ - LOG.info("Report obj : {}", Json.toJson(jobReport,null)); - JobContainer jobContainer = executorService.getJobContainer(jobReport.getId()); - if(null != jobContainer){ - jobReport.setJobId(jobContainer.getJobId()); - return callBackService.report(jobReport); - } - return new Response<>().successResponse(true); - } - - @RequestMapping(value = "/report/state", method = RequestMethod.POST) - public Response state(@RequestBody TaskState taskState){ - Map runtimeParams = new HashMap<>(1); - JobContainer jobContainer = executorService.getJobContainer(taskState.getTaskId()); - if(null != jobContainer){ - jobContainer.updateTaskState(taskState); - runtimeParams.put("maxByteSpeed", jobContainer.getRuntime().getMaxByteSpeed()); - } - //return runtime parameters - return new Response<>().successResponse(runtimeParams); - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/daemons/AbstractTaskDaemon.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/daemons/AbstractTaskDaemon.java deleted file mode 100644 index 6d2bc713b..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/daemons/AbstractTaskDaemon.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.daemons; - -import com.webank.wedatasphere.exchangis.executor.task.TaskProcess; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author davidhua - * 2019/2/19 - */ -public abstract class AbstractTaskDaemon implements Runnable{ - protected final Logger logger; - TaskProcess taskProcess; - - AbstractTaskDaemon(String daemonName, TaskProcess taskProcess){ - this.taskProcess = taskProcess; - this.logger = LoggerFactory.getLogger( - AbstractTaskDaemon.class.getName() + "-" + daemonName); - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/daemons/ClockDaemon.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/daemons/ClockDaemon.java deleted file mode 100644 index 96317b2de..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/daemons/ClockDaemon.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.daemons; - -import com.webank.wedatasphere.exchangis.executor.listener.TaskHandleListener; -import com.webank.wedatasphere.exchangis.executor.task.TaskProcess; -import com.webank.wedatasphere.exchangis.executor.task.process.TaskProcessUtils; - -import java.util.concurrent.TimeUnit; -import java.util.concurrent.locks.ReentrantLock; - -/** - * @author davidhua - * 2019/2/18 - */ -public class ClockDaemon extends AbstractTaskDaemon{ - private final ReentrantLock exec; - private long timeoutDuration; - private TimeUnit timeUnit; - private TaskHandleListener listener; - - - public ClockDaemon(String daemonName, TaskProcess taskProcess, ReentrantLock exec ){ - super(daemonName, taskProcess); - this.exec = exec; - } - - public ClockDaemon(String daemonName, TaskProcess taskProcess, - ReentrantLock exec, long timeoutDuration, TaskHandleListener listener){ - super(daemonName, taskProcess); - this.exec = exec; - this.timeoutDuration = timeoutDuration; - this.timeUnit = TimeUnit.SECONDS; - this.listener = listener; - } - - public ClockDaemon(String daemonName,TaskProcess taskProcess, - ReentrantLock exec, long timeoutDuration, TimeUnit timeUnit, TaskHandleListener listener) { - super(daemonName, taskProcess); - this.exec = exec; - this.timeoutDuration = timeoutDuration; - this.timeUnit = timeUnit; - this.listener = listener; - } - - @Override - public void run() { - TimeUnit unit = timeUnit; - long timeStamp = System.currentTimeMillis(); - try { - if(null != listener && timeoutDuration > 0){ - if(null == unit){ - unit = TimeUnit.SECONDS; - } - long clock = System.currentTimeMillis(); - int count = 0; - while(!exec.tryLock(timeoutDuration, unit)){ - //The task is timeout, invoke the listener - try { - listener.handle(taskProcess, "RUN " + - TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis() - clock) - + " " +unit.name()); - if(++ count >= 3){ - break; - } - }catch(Exception e){ - logger.error("Notify server task {} timeout error", TaskProcessUtils.getTaskId(taskProcess), e); - } - exec.lock(); - } - }else{ - exec.lock(); - } - } catch (InterruptedException e) { - logger.error(e.getMessage(), e); - Thread.currentThread().interrupt(); - } finally{ - if(exec.isHeldByCurrentThread()){ - exec.unlock(); - if(logger.isInfoEnabled()) { - logger.info("Task finished, spent time in seconds: {}", - TimeUnit.SECONDS.convert(System.currentTimeMillis() - timeStamp, TimeUnit.MILLISECONDS)); - } - } - } - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/daemons/LoggerDaemon.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/daemons/LoggerDaemon.java deleted file mode 100644 index a75c48849..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/daemons/LoggerDaemon.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.daemons; - -import com.webank.wedatasphere.exchangis.executor.task.TaskProcess; -import com.webank.wedatasphere.exchangis.executor.task.process.TaskProcessUtils; -import org.slf4j.Logger; - -import java.io.*; -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; - -/** - * @author davidhua - * 2019/2/18 - */ -public class LoggerDaemon extends AbstractTaskDaemon{ - private InputStream inputStream; - private String loggerName; - private boolean immediateFlush = true; - private Parser parser = new Parser() { - @Override - public boolean acceptLogger(String loggerName) { - return false; - } - - @Override - public void parseLoggerOutput(String output) { - - } - }; - public LoggerDaemon(String daemonName, String loggerName, - TaskProcess taskProcess, InputStream inputStream){ - super(daemonName, taskProcess); - if(taskProcess instanceof Parser){ - Parser parser = (Parser)taskProcess; - if(parser.acceptLogger(loggerName)){ - this.parser = parser; - } - } - this.inputStream = inputStream; - this.loggerName = loggerName; - } - @Override - public void run() { - if(null != this.inputStream) { - BufferedWriter writer = null; - File workDir = TaskProcessUtils.getWorkDir(taskProcess); - Logger fileLogger = logger; - try{ - if(null != workDir){ - writer = new BufferedWriter(new FileWriter(new File(workDir, loggerName), true)); - BufferedWriter finalWriter = writer; - fileLogger = (Logger) Proxy.newProxyInstance(logger.getClass().getClassLoader(), - new Class[]{Logger.class}, (proxy, method, args) -> { - String pattern = "debug|trace|info|error"; - if(method.getName().matches(pattern)){ - finalWriter.write(args[0] + "\n"); - if(immediateFlush){ - finalWriter.flush(); - } - return null; - } - return method.invoke(proxy, args); - }); - } - BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); - String line; - while ((line = reader.readLine()) != null) { - parser.parseLoggerOutput(line); - fileLogger.info(line); - } - } catch (Exception e) { - //Ignore - } finally{ - if(null != writer){ - try { - writer.flush(); - writer.close(); - } catch (IOException e) { - //Ignore - } - } - } - } - } - - public boolean isImmediateFlush() { - return immediateFlush; - } - - public void setImmediateFlush(boolean immediateFlush) { - this.immediateFlush = immediateFlush; - } - - public interface Parser{ - /** - * If accept - * @param loggerName - * @return - */ - boolean acceptLogger(String loggerName); - - /** - * Parse - * @param output output - */ - void parseLoggerOutput(String output); - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/exception/TaskResAllocException.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/exception/TaskResAllocException.java deleted file mode 100644 index 8c4224cad..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/exception/TaskResAllocException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.exception; - -/** - * @author davidhua - * 2019/4/26 - */ -public class TaskResAllocException extends RuntimeException{ - public TaskResAllocException(){ - super(); - } - - public TaskResAllocException(String message){ super(message);} - - public TaskResAllocException(String message, Throwable e){ - super(message, e); - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/exception/TaskTimeoutException.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/exception/TaskTimeoutException.java deleted file mode 100644 index 0aa4c8b24..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/exception/TaskTimeoutException.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.exception; - -/** - * @author davidhua - * 2019/12/22 - */ -public class TaskTimeoutException extends RuntimeException{ -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/listener/TaskCompleteListener.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/listener/TaskCompleteListener.java deleted file mode 100644 index df830191e..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/listener/TaskCompleteListener.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.listener; - -import com.webank.wedatasphere.exchangis.executor.task.TaskProcess; -import com.webank.wedatasphere.exchangis.executor.domain.ExecuteStatus; - -/** - * When the task is completed (fail or success), invoke the listener - * Created by devendeng on 2018/9/6. - * @author devendeng - */ -public interface TaskCompleteListener { - - /** - * Handle - * @param process - * @param status - * @param message - */ - void handleComplete(TaskProcess process, ExecuteStatus status, String message); -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/listener/TaskHandleListener.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/listener/TaskHandleListener.java deleted file mode 100644 index 5d73f5bc7..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/listener/TaskHandleListener.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.listener; - - -import com.webank.wedatasphere.exchangis.executor.task.TaskProcess; - -/** - * When executor run out of time, invoke the method - * @author davidhua - * 2019/2/20 - */ -@FunctionalInterface -public interface TaskHandleListener { - /** - * handle timeout - * @param taskProcess - * @param message - */ - void handle(TaskProcess taskProcess, String message); -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/resource/LocalResourceManager.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/resource/LocalResourceManager.java deleted file mode 100644 index ee5aee08b..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/resource/LocalResourceManager.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.resource; - -import com.webank.wedatasphere.exchangis.common.util.machine.MachineInfo; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import javax.annotation.PostConstruct; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.locks.ReentrantLock; - - -/** - * @author davidhua - * 2019/9/10 - */ -@Component -public class LocalResourceManager implements ResourceManager { - private static Logger LOG = LoggerFactory.getLogger(LocalResourceManager.class); - @javax.annotation.Resource - private ResourceConfiguration resourceConfiguration; - - private ReentrantLock resourceLock = new ReentrantLock(); - - /** - * resource held - */ - private Resource resWareHouse; - - private ConcurrentHashMap allocated = new ConcurrentHashMap<>(); - @PostConstruct - public void init(){ - resWareHouse = new Resource(-1L, 0, MachineInfo.memoryTotal() - MachineInfo.memoryUsed()); - } - @Override - public boolean allocate(Resource resource) { - resourceLock.lock(); - try{ - if(allocated.size() <= 0){ - resWareHouse.setMemByte(MachineInfo.memoryTotal() - MachineInfo.memoryUsed()); - } - if(resWareHouse.getMemByte() >= resource.getMemByte() - && resWareHouse.getCpuCore() >= resource.getCpuCore()){ - long memRequire = resource.getMemByte(); - long totalMem = MachineInfo.memoryTotal(); - double actualRate = (double)(MachineInfo.memoryUsed() + memRequire)/(double)totalMem; - double virtualRate = (double)(totalMem - resWareHouse.getMemByte() + memRequire)/(double)totalMem; - LOG.info("ActualRate:[" + actualRate +"], virtualRate:[" + virtualRate +"]," + - " threshold:["+resourceConfiguration.getThresholdMem() + "]"); - if(Math.max(actualRate, virtualRate) >= resourceConfiguration.getThresholdMem()){ - return false; - } - - resWareHouse.allocate(resource); - return null == allocated.putIfAbsent(String.valueOf(resource.getResourceId()), resource); - } - return false; - }finally{ - resourceLock.unlock(); - } - } - - @Override - public void collect(Resource resource) { - if(null != allocated.remove(String.valueOf(resource.getResourceId()))){ - resWareHouse.collect(resource); - if(allocated.size() <= 0){ - resourceLock.lock(); - try { - resWareHouse.setMemByte(MachineInfo.memoryTotal() - MachineInfo.memoryUsed()); - }finally{ - resourceLock.unlock(); - } - } - } - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/resource/Resource.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/resource/Resource.java deleted file mode 100644 index 73029e0dd..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/resource/Resource.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.resource; - -import java.util.concurrent.atomic.AtomicLong; - -/** - * @author davidhua - * 2019/9/10 - */ -public class Resource { - - private long resourceId; - - private AtomicLong memByte; - private AtomicLong cpuCore; - - public Resource(long resourceId, long cpuCore, long memByte){ - this.resourceId = resourceId; - this.memByte = new AtomicLong(memByte); - this.cpuCore = new AtomicLong(cpuCore); - } - - public Resource(long resourceId){ - this(resourceId, 0, 0); - } - - void collect(Resource resource){ - this.memByte.addAndGet(resource.getMemByte()); - this.cpuCore.addAndGet(resource.getCpuCore()); - } - - void allocate(Resource resource){ - this.memByte.addAndGet(-resource.getMemByte()); - this.cpuCore.addAndGet(-resource.getCpuCore()); - } - - public void addMem(long memByte){ - this.memByte.addAndGet(memByte); - } - - public void addCpu(long cpuCore){ - this.cpuCore.addAndGet(cpuCore); - } - - public long getMemByte() { - return memByte.get(); - } - - public void setMemByte(long memByte) { - this.memByte.set(memByte); - } - - public long getCpuCore() { - return cpuCore.get(); - } - - public void setCpuCore(int cpuCore) { - this.cpuCore.set(cpuCore); - } - - public long getResourceId() { - return resourceId; - } - - public void setResourceId(long resourceId) { - this.resourceId = resourceId; - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/resource/ResourceConfiguration.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/resource/ResourceConfiguration.java deleted file mode 100644 index 62c02f727..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/resource/ResourceConfiguration.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.resource; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - -/** - * @author davidhua - * 2019/9/10 - */ -@Component -public class ResourceConfiguration { - @Value("${executor.resource.threshold.cpu}") - private double thresholdCpu; - - @Value("${executor.resource.threshold.memory}") - private double thresholdMem; - - public double getThresholdCpu() { - return thresholdCpu; - } - - - public double getThresholdMem() { - return thresholdMem; - } - -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/resource/ResourceManager.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/resource/ResourceManager.java deleted file mode 100644 index f7592ccd8..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/resource/ResourceManager.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.resource; - -/** - * @author davidhua - * 2019/9/10 - */ -public interface ResourceManager { - /** - * Allocate resource - * @param resource resurce - * @return if succeed - */ - boolean allocate(Resource resource); - - /** - * Collect the resource - * @param resource - */ - void collect(Resource resource); -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/service/CallBackService.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/service/CallBackService.java deleted file mode 100644 index 053d82fc9..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/service/CallBackService.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.service; - -import com.webank.wedatasphere.exchangis.common.controller.Response; -import com.webank.wedatasphere.exchangis.datasource.domain.DataSourceBase; -import com.webank.wedatasphere.exchangis.executor.domain.ExecuteStatus; -import com.webank.wedatasphere.exchangis.job.domain.ExecutorNode; -import com.webank.wedatasphere.exchangis.job.domain.JobReport; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; - -/** - * Created by devendeng on 2018/9/11. - * @author devendeng - */ -@FeignClient(name = "exchangis-service") -public interface CallBackService { - @PostMapping(value = "/api/v1/jobtask/notifyJobComplete") - Response notifyJobComplete(@RequestParam("taskId") long taskId, - @RequestParam("status") ExecuteStatus status, - @RequestParam("address") String address,@RequestParam("message")String message); - - @PostMapping(value = "/api/v1/jobtask/notifyTaskTimeout") - Response notifyTaskTimeout(@RequestParam("taskId") long taskId, @RequestParam("message")String message); - - @RequestMapping("/api/v1/exec/node/register") - Response regiseter(@Valid @RequestBody ExecutorNode node); - - @RequestMapping("/api/v1/exec/node/heartbeat") - Response heartbeat(@Valid @RequestBody ExecutorNode node); - - @RequestMapping("/api/v1/admin/datasource/view/{id}") - Response getDataSource(@PathVariable("id") int id); - - @RequestMapping("/api/v1/report/add") - Response report(@RequestBody JobReport jobReport); -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/service/ExecutorService.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/service/ExecutorService.java deleted file mode 100644 index 7e3a69f25..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/service/ExecutorService.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.service; - -import com.webank.wedatasphere.exchangis.common.controller.Response; -import com.webank.wedatasphere.exchangis.executor.domain.ExecuteReq; -import com.webank.wedatasphere.exchangis.executor.JobContainer; -import com.webank.wedatasphere.exchangis.job.domain.LogResult; - -/** - * Created by devendeng on 2018/9/6. - * @author devendeng - */ -public interface ExecutorService { - /** - * Run - * @param req - * @param execUser - * @return - */ - boolean run(ExecuteReq req, String execUser); - - /** - * Kill - * @param jobId - * @param taskId - * @return - */ - Response kill(long jobId, long taskId); - - /** - * Get container - * @param containerId - * @return - */ - JobContainer getJobContainer(Object containerId); - - /** - * log - * @param jobId - * @param taskId - * @param startLine - * @return - */ - LogResult log(long jobId,long taskId,int startLine, int windSize); - - /** - * is alive - * @param jobId - * @param taskId - * @return - */ - boolean isAlive(long jobId, long taskId); -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/service/impl/ExecutorServiceImpl.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/service/impl/ExecutorServiceImpl.java deleted file mode 100644 index 585928bb4..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/service/impl/ExecutorServiceImpl.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.service.impl; - -import com.webank.wedatasphere.exchangis.common.controller.Response; -import com.webank.wedatasphere.exchangis.common.util.machine.MachineInfo; -import com.webank.wedatasphere.exchangis.common.util.spring.AppUtil; -import com.webank.wedatasphere.exchangis.executor.JobContainer; -import com.webank.wedatasphere.exchangis.executor.JobContainerManager; -import com.webank.wedatasphere.exchangis.executor.JobExecutor; -import com.webank.wedatasphere.exchangis.executor.ExecutorConfiguration; -import com.webank.wedatasphere.exchangis.executor.domain.ExecuteReq; -import com.webank.wedatasphere.exchangis.executor.exception.TaskResAllocException; -import com.webank.wedatasphere.exchangis.executor.resource.ResourceManager; -import com.webank.wedatasphere.exchangis.executor.task.TaskConfigBuilder; -import com.webank.wedatasphere.exchangis.executor.task.log.DefaultLocalTaskLog; -import com.webank.wedatasphere.exchangis.executor.task.process.AbstractJavaInternalTaskProcess; -import com.webank.wedatasphere.exchangis.executor.task.process.datax.DataxTaskProcess; -import com.webank.wedatasphere.exchangis.executor.service.CallBackService; -import com.webank.wedatasphere.exchangis.executor.service.ExecutorService; -import com.webank.wedatasphere.exchangis.executor.task.process.TaskProcessUtils; -import com.webank.wedatasphere.exchangis.executor.util.OperateBarrier; -import com.webank.wedatasphere.exchangis.executor.util.TaskConfiguration; -import com.webank.wedatasphere.exchangis.job.DefaultParams; -import com.webank.wedatasphere.exchangis.job.domain.ExecutorNode; -import com.webank.wedatasphere.exchangis.job.domain.TaskState; -import com.webank.wedatasphere.exchangis.job.domain.LogResult; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -import javax.annotation.PostConstruct; -import java.io.*; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicLong; - -/** - * Created by devendeng on 2018/9/5. - * - * @author devendeng - */ -@Service -public class ExecutorServiceImpl implements ExecutorService { - private static Logger LOG = LoggerFactory.getLogger(ExecutorServiceImpl.class); - - - @javax.annotation.Resource - private ExecutorConfiguration configuration; - - @Value("${server.port}") - private Integer port; - - - @javax.annotation.Resource - private CallBackService callBackService; - - @javax.annotation.Resource - private ResourceManager resourceManager; - - @javax.annotation.Resource - private JobContainerManager jobContainerManager; - - /** - * Operation barriers - */ - private Map operationBarriers = new ConcurrentHashMap<>(); - @PostConstruct - /** - * Heartbeat schedule - */ - public void init() { - AtomicLong lastTime = new AtomicLong(0); - Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(() -> { - try { - List taskStates = jobContainerManager.collectStateList(); - if(!taskStates.isEmpty() || System.currentTimeMillis() - lastTime.get() >= TimeUnit.SECONDS.toMillis(configuration.getIdleHeartBeat())) { - lastTime.set(System.currentTimeMillis()); - String host = MachineInfo.getIpAddress(configuration.getNetworkInterface()); - if (StringUtils.isBlank(host)) { - throw new RuntimeException("Cannot get IP address"); - } - ExecutorNode node = new ExecutorNode(); - node.setAddress(host + ":" + port); - node.setCpuRate((float) MachineInfo.cpuRate(4)); - node.setMemRate((float) MachineInfo.memoryRate(4)); - node.setDefaultNode(configuration.isNodeDefault()); - if(StringUtils.isNotBlank(configuration.getNodeTabs())){ - node.setTabNames(Arrays.asList(configuration.getNodeTabs().split(","))); - } - node.setTaskStates(taskStates); - Response rsp = callBackService.heartbeat(node); - if (rsp.getCode() != 0) { - LOG.error("Heartbeat error,{}", rsp.getMessage()); - } - } - } catch (Exception e) { - LOG.error("Heartbeat error", e); - } - }, 5, configuration.getActiveHeartBeat(), TimeUnit.SECONDS); - } - - @Override - public boolean run(ExecuteReq req, String execUser) { - Long jobId = req.getJobId(); - Long taskId = req.getTaskId(); - String jobConfig = req.getJobConfig(); - Map params = req.getTaskParams(); - Long timeout = req.getTimeout(); - boolean result; - try { - JobExecutor newJobExecutor = new JobExecutor(jobId, () ->{ - TaskConfiguration taskConfig = TaskConfiguration.from("{}"); - TaskConfigBuilder configBuilder = null; - LOG.info("Start to build task configuration, jobId: [{}], taskId: [{}]", jobId, taskId); - try { - configBuilder = AppUtil.getBean(TaskConfigBuilder.PREFIX + - String.valueOf(req.getEngine()).toLowerCase(), TaskConfigBuilder.class); - }catch(BeansException e){ - //cannot find the handler - LOG.info(e.getMessage()); - } - if(null != configBuilder){ - taskConfig = configBuilder.build(jobId, taskId, jobConfig, params); - } - LOG.info("Build task configuration succeed, jobId:[{}], taskId: [{}]", jobId, taskId); - String taskExecUser = String.valueOf(params.getOrDefault(DefaultParams.Task.PARAM_EXEC_USER, "")); - String execUser0 = execUser; - if(StringUtils.isNotBlank(taskExecUser)){ - //Overwrite executive user - execUser0 = taskExecUser; - } - return TaskProcessUtils.buildTaskProcess(req.getEngine(), jobId, taskId, execUser0, taskConfig, - configuration, req.getEngineParams()); - }, Math.toIntExact(timeout), (process, status, message) -> { - //complete listener - LOG.info("Task jobId [{}],taskId [{}],execute complete.status {},message {}", - jobId, taskId,status,message); - Response rsp = callBackService.notifyJobComplete(taskId,status, AppUtil.getIpAndPort(), message); - if(rsp.getCode() == 0){ - LOG.info("Notify task [{}] complete, success",taskId); - }else{ - LOG.error("TASK_ERROR, notify task [{}] complete error, message {}", taskId, rsp.getMessage()); - } - }); - if(!jobContainerManager.addContainer(taskId, new JobContainer(newJobExecutor))){ - return true; - } - addHooksToJobExecutor(newJobExecutor); - //set resourceManager - newJobExecutor.setResourceManager(resourceManager); - LOG.trace("Task jobId [{}], taskId [{}] has started to init", jobId, taskId); - try { - newJobExecutor.init(); - }catch(Exception e){ - newJobExecutor.clean(); - throw e; - } - newJobExecutor.start(); - //allocate actually - LOG.trace("Waiting for allocating resource for taskId [{}]", taskId); - if(newJobExecutor.waitForAlloc(configuration.getWaitAllocTimeInSec(), TimeUnit.SECONDS)){ - //CN: 任务调度成功,返回 - LOG.info("Allocate task success, jobId:[{}], taskId:[{}]", new Object[]{jobId, taskId}); - return true; - }else{ - LOG.trace("Allocate task failed., jobId: [{}], taskId: [{}], reason: cannot allocate resource", jobId, taskId); - throw new TaskResAllocException("task: ["+ taskId +"] allocate resource failed"); - } - } catch (Exception e) { - jobContainerManager.removeContainer(taskId); - if(e instanceof TaskResAllocException){ - throw (TaskResAllocException)e; - } - LOG.error("Scheduler task failed., jobId: [" + jobId + "], taskId: [" + taskId +"]"); - throw new RuntimeException(e); - } - } - - - @Override - public Response kill(long jobId, long taskId) { - return OperateBarrier.operate(String.valueOf(taskId), () ->{ - LOG.info("Kill job {},task {}", jobId, taskId); - if(killIfExist(jobId, taskId)){ - return new Response().successResponse("success"); - }else{ - LOG.info("Job {},task {},is not exist", jobId, taskId); - isAlive(jobId, taskId); - return new Response().errorResponse(501, null, "job " + jobId + ",task " + taskId + ",is not exist"); - } - }); - } - - @Override - public JobContainer getJobContainer(Object containerId) { - return jobContainerManager.getContainer(containerId); - } - - @Override - public LogResult log(long jobId, long taskId, int startLine, int windSize) { - JobContainer jobContainer = jobContainerManager.getContainer(taskId); - if(null != jobContainer){ - return jobContainer.getRuntime().log(startLine, windSize); - } - //history log - DefaultLocalTaskLog taskLog = new DefaultLocalTaskLog(new File(this.configuration.getJobLogHistory(), jobId + "_" + taskId + ".log")); - return taskLog.fetchLog(startLine, windSize); - } - - @Override - public boolean isAlive(long jobId, long taskId) { - return OperateBarrier.operate(String.valueOf(taskId), () -> { - LOG.info("Check if is alive. jobId: {}, taskId: {}", jobId, taskId); - JobContainer jobContainer = jobContainerManager.getContainer(taskId); - if(null == jobContainer){ - //TODO choose the process - AbstractJavaInternalTaskProcess process = new DataxTaskProcess(jobId, taskId, - null,TaskConfiguration.from("{}"), configuration, new HashMap<>()); - //clean the work directory - process.clean(); - return false; - } - return true; - }); - } - - /** - * - * @param taskId task id - * @return if exists - */ - private boolean killIfExist(long jobId, long taskId){ - JobContainer container = jobContainerManager.getContainer(taskId); - boolean exists = container != null; - if (exists) { - container.getRuntime().toStop(); - } - return exists; - } - - private void addHooksToJobExecutor(JobExecutor newJobExecutor){ - //add timeout hook - newJobExecutor.addHook(JobExecutor.Hook.TASK_TIMEOUT, (taskProcess, message)->{ - long jobId = TaskProcessUtils.getJobId(taskProcess); - long taskId = TaskProcessUtils.getTaskId(taskProcess); - LOG.info("Task jobId [{}],taskId [{}] timeout ,message {}", jobId, taskId, message); - Response rsp = callBackService.notifyTaskTimeout(taskId, message); - if(rsp.getCode() == 0){ - LOG.info("Notify task [{}] timeout, success", taskId); - }else{ - LOG.error("Notify task [{}] timeout error, message {}", taskId, rsp.getMessage()); - } - }); - //add hook to remove container when the task ends - newJobExecutor.addHook(JobExecutor.Hook.TASK_END, (taskProcess, message) -> - jobContainerManager.removeContainer(TaskProcessUtils.getTaskId(taskProcess))); - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/AbstractTaskConfigBuilder.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/AbstractTaskConfigBuilder.java deleted file mode 100644 index 71a7d3e2f..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/AbstractTaskConfigBuilder.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.task; - -import com.webank.wedatasphere.exchangis.common.util.json.Json; -import com.webank.wedatasphere.exchangis.datasource.domain.DataSourceBase; -import com.webank.wedatasphere.exchangis.executor.service.CallBackService; -import com.webank.wedatasphere.exchangis.executor.util.TaskConfiguration; -import org.apache.commons.lang3.StringUtils; - -import java.util.Map; - -/** - * @author davidhua - * 2019/12/24 - */ -public abstract class AbstractTaskConfigBuilder implements TaskConfigBuilder{ - private static final String DATASOURCE_ID_PARAMETER = "datasource"; - /** - * Inject data source parameters into task configuration - * @param callBackService call back service api - * @param configuration task configuration - * @param path the path to inject - */ - protected DataSourceBase injectDataSourceParamToConf(CallBackService callBackService, - TaskConfiguration configuration, String path){ - Integer ds = null; - try{ - ds = configuration.getInt(StringUtils.join(new String[]{path, DATASOURCE_ID_PARAMETER}, TaskConfiguration.SPLIT_CHAR)); - }catch(Exception e){ - //ignore - } - DataSourceBase dataSourceBase = null; - if(ds != null && ds > 0){ - dataSourceBase = callBackService.getDataSource(ds).getData(); - if(StringUtils.isNotBlank(dataSourceBase.getParameter())) { - Map map = Json.fromJson(dataSourceBase.getParameter(), Map.class); - map.forEach((key, value) -> { - //Search and insert (key, value) - if (!TaskConfiguration.searchKeyToInsertValue(configuration, path, key, value)) { - //Not found, set the value to {path}.key node - String key0 = StringUtils.join(new String[]{path, key}, TaskConfiguration.SPLIT_CHAR); - configuration.set(key0, value); - } - }); - } - } - return dataSourceBase; - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/TaskConfigBuilder.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/TaskConfigBuilder.java deleted file mode 100644 index f7d82a347..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/TaskConfigBuilder.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.task; - -import com.webank.wedatasphere.exchangis.executor.util.TaskConfiguration; - -import java.util.Map; - -/** - * @author davidhua - * 2019/2/22 - */ -public interface TaskConfigBuilder { - String PREFIX = "taskConfigBuilder-"; - /** - * Build from job configuration - * @param jobId job id - * @param taskId task id - * @param jobConfig job configuration - * @param taskParams task parameters - * @return task configuration - */ - TaskConfiguration build(long jobId, long taskId, String jobConfig, Map taskParams); -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/TaskDaemonPoolManager.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/TaskDaemonPoolManager.java deleted file mode 100644 index 85b5145aa..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/TaskDaemonPoolManager.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.task; - -import com.webank.wedatasphere.exchangis.executor.daemons.AbstractTaskDaemon; -import com.webank.wedatasphere.exchangis.executor.task.process.TaskProcessUtils; - -import java.util.concurrent.SynchronousQueue; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * Each task thread has a daemonPool - * @author davidhua - * 2019/2/18 - */ -public class TaskDaemonPoolManager { - - private static final long SHUTDOWN_WAIT_SECOND = 5; - - private TaskProcess taskProcess; - - private final ThreadPoolExecutor internalPool; - - public TaskDaemonPoolManager(TaskProcess taskProcess){ - this.taskProcess = taskProcess; - this.internalPool = new ThreadPoolExecutor(0, Integer.MAX_VALUE, - 60L, TimeUnit.SECONDS, - new SynchronousQueue<>(), new DaemonThreadFactory()); - } - - public void addDaemon(AbstractTaskDaemon daemon){ - this.internalPool.execute(daemon); - } - - public boolean shutdown() throws InterruptedException { - internalPool.shutdown(); - return internalPool.awaitTermination(SHUTDOWN_WAIT_SECOND, TimeUnit.SECONDS); - } - private class DaemonThreadFactory implements ThreadFactory{ - private static final String TASK_DAEMON = "taskDaemon-"; - private final ThreadGroup group; - private final AtomicInteger threadNumber = new AtomicInteger(1); - private final String namePrefix; - DaemonThreadFactory(){ - SecurityManager s = System.getSecurityManager(); - group = (s != null) ? s.getThreadGroup() : - Thread.currentThread().getThreadGroup(); - namePrefix = TASK_DAEMON + TaskProcessUtils.getJobId(taskProcess) + "-" - + TaskProcessUtils.getTaskId(taskProcess) + "-"; - } - @Override - public Thread newThread(Runnable r) { - Thread t = new Thread(group, r, - namePrefix + threadNumber.getAndIncrement(), 0); - if(t.isDaemon()){ - t.setDaemon(false); - } - if (t.getPriority() != Thread.NORM_PRIORITY){ - t.setPriority(Thread.NORM_PRIORITY); - } - return t; - } - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/TaskLog.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/TaskLog.java deleted file mode 100644 index 9cab8c6ad..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/TaskLog.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.task; - -import com.webank.wedatasphere.exchangis.job.domain.LogResult; - -/** - * @author davidhua - * 2019/12/25 - */ -public interface TaskLog { - - /** - * Fetch log - * @param startLine - * @param windSize - * @return - */ - LogResult fetchLog(long startLine, long windSize); -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/TaskProcess.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/TaskProcess.java deleted file mode 100644 index e121faf3d..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/TaskProcess.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.task; - -import com.webank.wedatasphere.exchangis.executor.exception.TaskResAllocException; -import com.webank.wedatasphere.exchangis.executor.resource.Resource; -import com.webank.wedatasphere.exchangis.job.domain.LogResult; - -import java.io.InputStream; -import java.util.concurrent.Future; - -/** - * @author devendeng - * @date 2018/9/6 - */ -public interface TaskProcess { - /** - * Init task - */ - void init(); - - /** - * Run task (blocking) - * @throws TaskResAllocException if cannot allocate resource - * @return run result - */ - int execute() throws TaskResAllocException; - - /** - * Run task (Non-blocking) - * @throws TaskResAllocException if cannot allocate resource - * @return future - */ - Future executeAsync() throws TaskResAllocException; - - /** - * Get the task log in window size - * @param startLine start line - * @param windSize wind size - * @return log - */ - LogResult log(long startLine, long windSize); - - - /** - * Get input stream if it has - * @return input stream - */ - InputStream getInputStream(); - - /** - * Get error stream if it has - * @return error stream - */ - InputStream getErrorStream(); - - /** - * Finish task - */ - void destroy(); - - /** - * Check if the process is alive - * @return if alive - */ - boolean isAlive(); - - - /** - * get resource requirement - * @return resource - */ - Resource getResource(); - /** - * release resource - */ - void clean(); - -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/TaskProcessBuilder.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/TaskProcessBuilder.java deleted file mode 100644 index f51b3b73f..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/TaskProcessBuilder.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.task; - -/** - * @author davidhua - * 2019/2/22 - */ -@FunctionalInterface -public interface TaskProcessBuilder { - /** - * Build methods - * @return - */ - TaskProcess build(); -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/log/DefaultLocalTaskLog.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/log/DefaultLocalTaskLog.java deleted file mode 100644 index a484edb89..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/log/DefaultLocalTaskLog.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.task.log; - -import com.webank.wedatasphere.exchangis.executor.task.TaskLog; -import com.webank.wedatasphere.exchangis.job.domain.LogResult; -import com.google.common.collect.EvictingQueue; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.*; -import java.util.Queue; - -/** - * @author davidhua - * 2019/12/25 - */ -public class DefaultLocalTaskLog implements TaskLog { - private static final Logger LOG = LoggerFactory.getLogger(DefaultLocalTaskLog.class); - private File localFile; - public DefaultLocalTaskLog(File localFile){ - this.localFile = localFile; - } - @Override - public LogResult fetchLog(long startLine, long windSize) { - if(localFile.exists()){ - // Read file - StringBuilder logContentBuffer = new StringBuilder(); - Queue queue = EvictingQueue.create(Math.abs((int) windSize)); - long toLineNum = 0; - LineNumberReader reader = null; - boolean isEnd = false; - try { - //reader = new LineNumberReader(new FileReader(logFile)); - reader = new LineNumberReader(new InputStreamReader(new FileInputStream(localFile), "utf-8")); - String line; - while ((line = reader.readLine()) != null) { - toLineNum = reader.getLineNumber(); - if(windSize >= 0 && toLineNum > startLine){ - queue.offer(line); - if(queue.size() >= windSize){ - break; - } - }else if (windSize < 0){ - if(startLine >= 0 && toLineNum >= startLine){ - toLineNum = startLine - queue.size(); - break; - } - queue.offer(line); - } - } - if(startLine < 0){ - if(windSize >= 0){ - startLine = 0; - }else{ - startLine = toLineNum; - toLineNum = startLine - queue.size(); - } - } - while(!queue.isEmpty()){ - line = queue.poll(); - logContentBuffer.append(line).append("\n"); - } - // Result - return new LogResult((int)startLine, (int)toLineNum, logContentBuffer.toString(), isEnd); - } catch (IOException e) { - LOG.error(e.getMessage(), e); - } finally { - if (reader != null) { - try { - reader.close(); - } catch (IOException e) { - LOG.error(e.getMessage(), e); - } - } - } - } - return new LogResult((int)startLine, -1, "Read log fail, seems that the node has lost the task process", true); - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/AbstractJavaInternalTaskProcess.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/AbstractJavaInternalTaskProcess.java deleted file mode 100644 index 877af1967..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/AbstractJavaInternalTaskProcess.java +++ /dev/null @@ -1,539 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.task.process; - -import com.webank.wedatasphere.exchangis.common.util.MemUtils; -import com.webank.wedatasphere.exchangis.executor.ExecutorConfiguration; -import com.webank.wedatasphere.exchangis.executor.JobContainer; -import com.webank.wedatasphere.exchangis.executor.exception.TaskResAllocException; -import com.webank.wedatasphere.exchangis.executor.exception.TaskTimeoutException; -import com.webank.wedatasphere.exchangis.executor.resource.Resource; -import com.webank.wedatasphere.exchangis.executor.task.log.DefaultLocalTaskLog; -import com.webank.wedatasphere.exchangis.executor.task.TaskLog; -import com.webank.wedatasphere.exchangis.executor.util.RunShell; -import com.webank.wedatasphere.exchangis.executor.util.TaskConfiguration; -import com.webank.wedatasphere.exchangis.executor.util.WorkSpace; -import com.webank.wedatasphere.exchangis.job.domain.LogResult; -import org.apache.commons.io.FileUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.tuple.MutablePair; -import org.apache.commons.lang3.tuple.MutableTriple; -import org.apache.commons.lang3.tuple.Pair; -import org.apache.commons.lang3.tuple.Triple; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.lang.Nullable; - -import java.io.*; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - - -/** - * @author davidhua - * 2019/2/20 - */ -public abstract class AbstractJavaInternalTaskProcess extends AbstractTaskProcess { - - private static final Logger LOG = LoggerFactory.getLogger(AbstractJavaInternalTaskProcess.class); - private static final String WINDOWS_TAG = "window"; - - private static final int WAIT_FOR_ALLOCATE_TIME = 5; - private static final int CHECK_ALLOCATE_INTERVAL = 200; - - private Process process; - - private TaskLog taskLog; - public AbstractJavaInternalTaskProcess(long jobId, long taskId, String execUser, - TaskConfiguration taskConfig, ExecutorConfiguration execConfig, - Map engineParams){ - super(jobId, taskId, execUser, taskConfig, execConfig, engineParams); - } - protected final Process getProcess(){ - return process; - } - - @Override - public void init() { - workDir = new File(WorkSpace.createLocalDirIfNotExist(getExecConfig().getJobLogDir(), - getJobId(), getTaskId())); - taskLog = new DefaultLocalTaskLog(new File(workDir, logFileName())); - initInternal(); - String execUser = getExecUser(); - //try to switch user, change the owner of working directory - if(needToSwitchUser(execUser)){ - int code = changeOwnerRecursive(workDir, execUser); - if(code != 0){ - throw new RuntimeException("Task: " + getTaskId() + " switch to user:'" + execUser + "' failed"); - } - } - } - - @Override - public void clean() { - if(null == workDir){ - workDir = new File(WorkSpace.getLocalSpace(getExecConfig().getJobLogDir(), - getJobId(), getTaskId())); - } - if(workDir.exists()){ - try { - clean(workDir); - }finally{ - deleteRecurse(workDir); - } - } - } - - @Override - public final int execute() { - process = executeInternal(); - if(null == process){ - throw new TaskResAllocException("process == null"); - } - try { - return process.waitFor(); - } catch (InterruptedException e) { - //If is necessary ? - Thread.currentThread().interrupt(); - return -1; - } - } - - @Override - public Future executeAsync() { - try { - process = executeInternal(); - if (process == null){ - throw new TaskResAllocException("process == null"); - } - long end = System.currentTimeMillis() + WAIT_FOR_ALLOCATE_TIME * 1000; - boolean allocate = checkIfAlloc(); - boolean alive = true; - while(!allocate && System.currentTimeMillis() < end){ - Thread.sleep(CHECK_ALLOCATE_INTERVAL); - allocate = checkIfAlloc(); - if (!alive){ - break; - } - alive = process.isAlive(); - } - if(!allocate){ - throw new TaskResAllocException(); - } - return new JavaProcessFuture(); - }catch(Exception e){ - throw new TaskResAllocException(e.getMessage(), e); - } - } - - @Override - public LogResult log(long startLine, long windSize) { - if(null != taskLog){ - return taskLog.fetchLog(startLine, windSize); - } - return new LogResult((int)startLine, -1, "Cannot read log, this task doesn't init", true); - } - - @Override - public final void destroy() { - if(null != process) { - try { - destroy(process); - } finally { - if (!process.isAlive()) { - process = null; - } - } - } - } - - @Override - public Resource getResource() { - return new Resource(getTaskId(), 0, 0); - } - - @Override - public boolean isAlive() { - return null != process && process.isAlive(); - } - - - private class JavaProcessFuture implements Future{ - - @Override - public boolean cancel(boolean mayInterruptIfRunning) { - if(mayInterruptIfRunning){ - process.destroy(); - } - return false; - } - - @Override - public boolean isCancelled() { - return true; - } - - @Override - public boolean isDone() { - return !process.isAlive(); - } - - @Override - public Integer get() throws InterruptedException, ExecutionException { - return process.waitFor(); - } - - @Override - public Integer get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { - boolean result = process.waitFor(timeout, unit); - if(!result){ - throw new TaskTimeoutException(); - } - return process.waitFor(); - } - } - - - @Override - public InputStream getInputStream() { - if(process == null){ - return null; - } - return process.getInputStream(); - } - - @Override - public InputStream getErrorStream() { - if(process == null){ - return null; - } - return process.getErrorStream(); - } - - private int changeOwnerRecursive(File workDir, String execUser){ - int code = 0; - try{ - ProcessBuilder builder = RunShell.createProcBuilder(StringUtils.join(new String[]{"sudo chown -R ", execUser, - workDir.getPath()}, " "), null, workDir); - code = builder.start().waitFor(); - }catch(IOException e){ - throw new RuntimeException("IO error while switching user", e); - }catch(InterruptedException e){ - Thread.currentThread().interrupt(); - throw new RuntimeException(e); - } - return code; - } - - private int getProcessId(Process process){ - int processId = -1; - try{ - File pidFile = new File(workDir + File.separator + pidFileName()); - if(pidFile.exists()){ - try (BufferedReader reader = new BufferedReader( - new InputStreamReader(new FileInputStream(pidFile), "UTF-8"))) { - processId = Integer.parseInt(reader.readLine()); - } catch (IOException e) { - LOG.error("Read 'pid' file error: " + e.getMessage()); - } catch (Exception e) { - LOG.error("Get pid error:" + e.getMessage()); - } - if (processId < 0 && process != null) { - Field f = process.getClass().getDeclaredField("pid"); - f.setAccessible(true); - processId = f.getInt(process); - } - } - }catch(Throwable throwable){ - LOG.error("Pid get occur exception: " + throwable.getMessage(), throwable); - } - return processId; - } - - private void deletePidFile(){ - File pidFile = new File(workDir + File.separator + pidFileName()); - if(pidFile.exists()){ - deleteRecurse(pidFile); - } - } - - private void deleteRecurse(File file){ - if(file.isDirectory()){ - File[] files = file.listFiles(); - if(null != files){ - for(File f : files){ - deleteRecurse(f); - } - } - if(!file.delete() && file.exists()){ - LOG.error("IO_ERROR: cannot delete directory: {}, please check the permission", file.getAbsolutePath()); - } - }else{ - if(!file.delete() && file.exists()){ - LOG.error("IO_ERROR: cannot delete file: {}, please check the permission", file.getAbsolutePath()); - } - } - } - - protected void killProcess(int pid) throws IOException, InterruptedException { - String osName = System.getProperty("os.name"); - if(StringUtils.isNotBlank(osName) && osName.toLowerCase().contains(WINDOWS_TAG)){ - // kill all process (sub) windows - Runtime.getRuntime().exec("taskkill -PID" + pid + " -T -F"); - }else{ - LOG.debug("Attempt to kill the process with cmd [kill -SIGTERM ]"); - String userDir = System.getProperty("user.dir", ""); - int code = Runtime.getRuntime().exec(userDir + "/bin/task-kill.sh " + pid).waitFor(); - if(code != 0){ - throw new RuntimeException("Return code is " + code); - } - } - } - /** - * destroy internally - * @param process java process object - */ - protected void destroy(@Nullable Process process){ - try{ - int pid = getProcessId(process); - if(pid != -1){ - killProcess(pid); - //delete pid - deletePidFile(); - LOG.info("Destroy job {} taskId {} complete.", getJobId(), getTaskId()); - } - }catch (Exception e){ - LOG.error("Kill process of task{} error.", getTaskId(), e); - throw new RuntimeException(e); - } - - } - - /** - * clean local working directory - * @param workDir - */ - protected void clean(File workDir){ - if(needToSwitchUser(getExecUser())){ - changeOwnerRecursive(workDir, System.getProperty("user.name", "")); - } - LOG.info("Clean the job {} task {} working directory: {}", getJobId(), getTaskId(), workDir.getPath()); - File[] files = workDir.listFiles(); - if(null != files){ - for(File file : files){ - if(file.getName().equals(logFileName())){ - File dist = new File(getExecConfig().getJobLogHistory(), getJobId() + "_" + getTaskId() + ".log"); - try{ - FileUtils.copyFile(file, dist); - }catch(IOException e){ - throw new RuntimeException("IO_ERROR: copy file: " + file.getAbsolutePath() + - " to dist: " + dist.getAbsolutePath(), e); - } - } - if(file.getName().equals(pidFileName())){ - try { - //try to kill process - String pidStr = FileUtils.readFileToString(file); - if(StringUtils.isNotBlank(pidStr)){ - killProcess(Integer.parseInt(pidStr.trim())); - } - } catch (Exception e) { - //ignore - } - } - } - } - } - - protected boolean needToSwitchUser(String execUser){ - String procUser = System.getProperty("user.name", ""); - return StringUtils.isNotBlank(execUser) && - procUser.equals(getExecConfig().getLinuxSudoUser()) && - !execUser.equals(procUser); - } - - protected boolean checkIfAlloc(){ - return true; - } - - /** - * If allocate resource (memory) succeed - * @return result - */ - protected boolean isAlloc(){ - return true; - } - - /** - * Get log file name - * @return log file name - */ - protected String logFileName(){ - return JobContainer.LOG_SYS_NAME; - } - - /** - * Get pid file name - * @return pid file name - */ - protected String pidFileName(){ - return JobContainer.PID_NAME; - } - /** - * Init - */ - protected abstract void initInternal(); - /** - * Execute internally - * @return java process object - */ - protected abstract Process executeInternal(); - - /** - * Java cmd builder - */ - protected static final class JavaCommandBuilder{ - - private static final String DEFAULT_CLASSPATH_SEPARATOR ; - private static final MutablePair HEAP_DUMP = new MutablePair<>("", "-XX:+HeapDumpOnOutOfMemoryError"); - private static final MutablePair FILE_ENCODING_PROP = new MutablePair<>("-Dfile.encoding", "UTF-8"); - private static final MutablePair SECURITY_EGD = new MutablePair<>("-Djava.security.egd", "file:///dev/urandom"); - /** - * Java execute Path - */ - private String javaPath; - - /** - * Main class - */ - private String mainClass; - /** - * Classpath - */ - private MutablePair classPath = new MutablePair<>("-classpath", "."); - /** - * Xmx - */ - private Triple jvmXmx; - /** - * Xms - */ - private Triple jvmXms; - /** - * Default props - */ - private List> props = new ArrayList<>(); - - /** - * Command props - */ - private List> cmdProps = new ArrayList<>(); - - static{ - String osName = System.getProperty("os.name", "").toLowerCase(); - if(osName.indexOf("windows") > 0){ - DEFAULT_CLASSPATH_SEPARATOR = ";"; - }else{ - DEFAULT_CLASSPATH_SEPARATOR = ":"; - } - } - public JavaCommandBuilder(String javaPath, String mainClass){ - this.javaPath = javaPath; - this.mainClass = mainClass; - this.props.add(HEAP_DUMP); - this.props.add(FILE_ENCODING_PROP); - this.props.add(SECURITY_EGD); - } - - public JavaCommandBuilder Xmx(long size, MemUtils.StoreUnit unit){ - this.jvmXmx = new MutableTriple<>("-Xmx", size, unit); - return this; - } - - public JavaCommandBuilder Xms(long size, MemUtils.StoreUnit unit){ - this.jvmXms = new MutableTriple<>("-Xms", size, unit); - return this; - } - - public JavaCommandBuilder classPath(String name){ - //Just support linux - this.classPath.setRight(name + DEFAULT_CLASSPATH_SEPARATOR + this.classPath.getRight()); - return this; - } - public JavaCommandBuilder prop(String name, String value){ - props.add(new MutablePair<>(name, value)); - return this; - } - - public JavaCommandBuilder prop(String value){ - props.add(new MutablePair<>("", value)); - return this; - } - - public JavaCommandBuilder prop(MutablePair pair){ - props.add(pair); - return this; - } - - public JavaCommandBuilder cmdProp(String name, String value){ - cmdProps.add(new MutablePair<>(name, value)); - return this; - } - - public JavaCommandBuilder cmdProp(String value){ - cmdProps.add(new MutablePair<>("", value)); - return this; - } - - public JavaCommandBuilder cmdProp(MutablePair pair){ - cmdProps.add(pair); - return this; - } - - public String build(){ - List commandSliceList = new ArrayList<>(); - commandSliceList.add(javaPath); - commandSliceList.add(jvmXmx.getLeft() + jvmXmx.getRight().toMB(jvmXmx.getMiddle()) + "m"); - commandSliceList.add(jvmXms.getLeft() + jvmXms.getRight().toMB(jvmXms.getMiddle()) + "m"); - commandSliceList.add(classPath.getLeft()); - commandSliceList.add(classPath.getRight()); - props.forEach(prop -> { - if(StringUtils.isNotBlank(prop.getLeft())) { - commandSliceList.add(prop.getLeft() + "=" + prop.getRight()); - }else { - commandSliceList.add(prop.getRight()); - } - }); - commandSliceList.add(mainClass); - cmdProps.forEach(prop -> { - if(StringUtils.isNotBlank(prop.getLeft())) { - commandSliceList.add(prop.getLeft() + " " + prop.getRight()); - }else { - commandSliceList.add(prop.getRight()); - } - }); - return StringUtils.join(commandSliceList, " "); - } - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/AbstractTaskProcess.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/AbstractTaskProcess.java deleted file mode 100644 index 86963087e..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/AbstractTaskProcess.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.task.process; - -import com.webank.wedatasphere.exchangis.executor.ExecutorConfiguration; -import com.webank.wedatasphere.exchangis.executor.task.TaskProcess; -import com.webank.wedatasphere.exchangis.executor.util.TaskConfiguration; -import com.webank.wedatasphere.exchangis.job.domain.TaskState; - -import java.io.File; -import java.util.HashMap; -import java.util.Map; - - -/** - * @author davidhua - * 2019/12/22 - */ -public abstract class AbstractTaskProcess implements TaskProcess { - private final long jobId; - - private final long taskId; - - private final String execUser; - - private final TaskConfiguration taskConfig; - - private final ExecutorConfiguration execConfig; - - private final Map engineParams; - - protected File workDir; - - private final TaskState taskState; - - - AbstractTaskProcess(long jobId, long taskId, - String execUser, - TaskConfiguration taskConfig, ExecutorConfiguration execConfig, - Map engineParams){ - this.jobId = jobId; - this.taskId = taskId; - this.execUser = execUser; - this.taskConfig = taskConfig; - this.execConfig = execConfig; - if(null == engineParams){ - this.engineParams = new HashMap<>(); - }else{ - this.engineParams = engineParams; - } - this.taskState = new TaskState(taskId); - } - /** - * Get jobId - * @return value - */ - protected final long getJobId(){ - return this.jobId; - } - /** - * Get taskId - * @return value - */ - protected final long getTaskId(){ - return this.taskId; - } - - protected final String getExecUser(){ - return execUser; - } - - protected final TaskConfiguration getTaskConfig(){ - return taskConfig; - } - - protected final Map getEngineParams(){ - return engineParams; - } - - protected final TaskState getTaskState(){ - return taskState; - } - - protected final ExecutorConfiguration getExecConfig(){ - return execConfig; - } - - public final File getWorkDir() { - return workDir; - } - -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/TaskProcessUtils.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/TaskProcessUtils.java deleted file mode 100644 index 157ec5e47..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/TaskProcessUtils.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.task.process; - -import com.webank.wedatasphere.exchangis.executor.task.TaskProcess; -import com.webank.wedatasphere.exchangis.executor.task.process.datax.DataxTaskProcess; -import com.webank.wedatasphere.exchangis.executor.task.process.sqoop.SqoopTaskProcess; -import com.webank.wedatasphere.exchangis.job.domain.JobEngine; -import com.webank.wedatasphere.exchangis.job.domain.TaskState; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.lang.reflect.Constructor; -import java.util.HashMap; -import java.util.Map; - - -/** - * @author davidhua - * 2019/2/20 - */ -public class TaskProcessUtils { - private static final Logger LOG = LoggerFactory.getLogger(TaskProcessUtils.class); - private static Map> engineProcessMap = new HashMap<>(); - static{ - engineProcessMap.put(JobEngine.DATAX, DataxTaskProcess.class); - engineProcessMap.put(JobEngine.SQOOP, SqoopTaskProcess.class); - } - - public static TaskProcess buildTaskProcess(JobEngine engine, Object... args){ - if(null == engine){ - engine = JobEngine.DATAX; - } - Class clazz = engineProcessMap.get(engine); - if(null != clazz){ - try { - Constructor constructor = clazz.getConstructors()[0]; - return (TaskProcess) constructor.newInstance(args); - } catch (Exception e) { - LOG.error("New task process fail, message:[" + e.getMessage() + "]", e); - //ignore - } - } - return null; - } - - public static Process getProcess(TaskProcess taskProcess){ - if(taskProcess instanceof AbstractJavaInternalTaskProcess){ - return ((AbstractJavaInternalTaskProcess)taskProcess).getProcess(); - } - return null; - } - - public static long getJobId(TaskProcess taskProcess){ - if(taskProcess instanceof AbstractTaskProcess){ - return ((AbstractTaskProcess)taskProcess).getJobId(); - } - return -1; - } - - public static long getTaskId(TaskProcess taskProcess){ - if(taskProcess instanceof AbstractTaskProcess){ - return ((AbstractTaskProcess)taskProcess).getTaskId(); - } - return -1; - } - - public static boolean isAllocate(TaskProcess taskProcess){ - if(taskProcess instanceof AbstractJavaInternalTaskProcess){ - return ((AbstractJavaInternalTaskProcess)taskProcess).isAlloc(); - } - return taskProcess.isAlive(); - } - - public static File getWorkDir(TaskProcess taskProcess){ - if(taskProcess instanceof AbstractTaskProcess){ - return ((AbstractTaskProcess)taskProcess).getWorkDir(); - } - return null; - } - - public static TaskState getTaskState(TaskProcess taskProcess){ - if(taskProcess instanceof AbstractTaskProcess){ - return ((AbstractTaskProcess)taskProcess).getTaskState(); - } - return null; - } - -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/datax/DataxTaskConfigBuilder.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/datax/DataxTaskConfigBuilder.java deleted file mode 100644 index 5e61a568d..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/datax/DataxTaskConfigBuilder.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.task.process.datax; - -import com.webank.wedatasphere.exchangis.common.util.JobUtils; -import com.webank.wedatasphere.exchangis.datasource.Constants; -import com.webank.wedatasphere.exchangis.datasource.domain.AuthType; -import com.webank.wedatasphere.exchangis.executor.ExecutorConfiguration; -import com.webank.wedatasphere.exchangis.executor.task.AbstractTaskConfigBuilder; -import com.webank.wedatasphere.exchangis.executor.task.TaskConfigBuilder; -import com.webank.wedatasphere.exchangis.executor.util.HttpClientUtil; -import com.webank.wedatasphere.exchangis.executor.service.CallBackService; -import com.webank.wedatasphere.exchangis.executor.util.TaskConfiguration; -import com.webank.wedatasphere.exchangis.executor.util.WorkSpace; -import com.webank.wedatasphere.exchangis.job.DefaultParams; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.Map; - -import static com.webank.wedatasphere.exchangis.executor.util.TaskConfiguration.SPLIT_CHAR; - - -/** - * @author davidhua - * 2019/2/22 - */ -@Service(TaskConfigBuilder.PREFIX + "datax") -public class DataxTaskConfigBuilder extends AbstractTaskConfigBuilder { - private static final Logger LOG = LoggerFactory.getLogger(DataxTaskConfigBuilder.class); - private static final String READER_PARAM_PATH = "job.content[0].reader.parameter"; - private static final String WRITER_PARAM_PATH = "job.content[0].writer.parameter"; - - @Resource - private CallBackService callBackService; - - @Resource - private ExecutorConfiguration execConfig; - @Override - public TaskConfiguration build(long jobId, long taskId, String jobConfig, Map params) { - //Work directory - String workDir = WorkSpace.createLocalDirIfNotExist(execConfig.getJobLogDir(), jobId, taskId); - //Render time placeholder in job configuration - String taskConfig; - try { - if (null != params.get(DefaultParams.Task.PARAM_DATE)) { - long time = Long.parseLong(String.valueOf(params.get(DefaultParams.Task.PARAM_DATE))); - taskConfig = JobUtils.render(jobConfig, time); - } else { - taskConfig = JobUtils.render(jobConfig); - } - //Parse to task configuration - TaskConfiguration configuration = TaskConfiguration.from(taskConfig); - injectDataSourceParam(workDir, configuration, READER_PARAM_PATH, 0); - injectDataSourceParam(workDir, configuration, WRITER_PARAM_PATH, 1); - //Inject increment parameters - injectIncrementParam(configuration, params, READER_PARAM_PATH); - LOG.info("Task configuration {}" + configuration.toJson()); - return configuration; - } catch (RuntimeException e){ - WorkSpace.deleteLocalSpace(workDir); - throw e; - } - } - - private void injectIncrementParam(TaskConfiguration configuration, Map taskParams, String name){ - if(taskParams.containsKey(DefaultParams.Task.PARAM_INCR_BEGIN_TIME)){ - configuration.set(StringUtils.join(new String[]{name, DefaultParams.Task.PARAM_INCR_BEGIN_TIME}, SPLIT_CHAR), - taskParams.getOrDefault(DefaultParams.Task.PARAM_INCR_BEGIN_TIME, 0)); - } - if(taskParams.containsKey(DefaultParams.Task.PARAM_INCR_END_TIME)){ - configuration.set(StringUtils.join(new String[]{name, DefaultParams.Task.PARAM_INCR_END_TIME}, SPLIT_CHAR), - taskParams.getOrDefault(DefaultParams.Task.PARAM_INCR_END_TIME, 0)); - } - } - private void injectDataSourceParam(String workDir, TaskConfiguration configuration, - String path, int position){ - HttpClientUtil httpClientUtil = HttpClientUtil.getHttpClientUtil(); - super.injectDataSourceParamToConf(callBackService, configuration, path); - String authType = configuration - .getString(StringUtils.join(new String[]{path, Constants.PARAM_AUTH_TYPE}, SPLIT_CHAR),""); - String[] urlKeysToSearch = new String[]{}; - if(AuthType.KERBERS.equals(authType)){ - urlKeysToSearch = new String[]{Constants.PARAM_KB_FILE_PATH}; - }else if(AuthType.KEYFILE.equals(authType)){ - urlKeysToSearch = new String[]{Constants.PARAM_KEY_FILE_PATH}; - }else if(StringUtils.isBlank(authType)){ - //If auth type is null or empty, means that the job configuration doesn't have the data source id, - // In order to find url key, search all possibilities - urlKeysToSearch = new String[]{Constants.PARAM_KB_FILE_PATH, Constants.PARAM_KEY_FILE_PATH}; - } - //Search key path - for(String searchKey : urlKeysToSearch){ - List keyPaths = TaskConfiguration.searchKeyPaths(configuration, path, searchKey); - if(!keyPaths.isEmpty()){ - String absKeyPath = StringUtils.join(new String[]{path, keyPaths.get(0)}, SPLIT_CHAR); - String url = configuration.getString(absKeyPath); - if(StringUtils.isNotBlank(url)){ - String localPath = downloadAuthFile(httpClientUtil, url, workDir, position); - configuration.set(absKeyPath, localPath); - } - } - } - } - - private String downloadAuthFile(HttpClientUtil httpClientUtil, String url, - String workDir, int position){ - String localPath = workDir + IOUtils.DIR_SEPARATOR_UNIX + - Constants.AUTH_FILE_NAME + position; - httpClientUtil.downLoad(url, localPath); - return localPath; - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/datax/DataxTaskProcess.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/datax/DataxTaskProcess.java deleted file mode 100644 index fa6d349a4..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/datax/DataxTaskProcess.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.task.process.datax; - -import ch.qos.logback.core.status.NopStatusListener; -import com.webank.wedatasphere.exchangis.common.auth.AuthConstraints; -import com.webank.wedatasphere.exchangis.common.util.MemUtils; -import com.webank.wedatasphere.exchangis.common.util.machine.MachineInfo; -import com.webank.wedatasphere.exchangis.common.util.spring.AppUtil; -import com.webank.wedatasphere.exchangis.executor.ExecutorConfiguration; -import com.webank.wedatasphere.exchangis.executor.resource.Resource; -import com.webank.wedatasphere.exchangis.executor.task.process.AbstractJavaInternalTaskProcess; -import com.webank.wedatasphere.exchangis.executor.util.RunShell; -import com.webank.wedatasphere.exchangis.executor.util.TaskConfiguration; -import com.webank.wedatasphere.exchangis.job.DefaultParams; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.*; -import java.util.*; - -/** - * Created by devendeng on 2018/9/6. - * - * @author devendeng - */ -public class DataxTaskProcess extends AbstractJavaInternalTaskProcess { - - private static Logger LOG = LoggerFactory.getLogger(DataxTaskProcess.class); - private static final String PID_F_NAME = "pid"; - private static final String PROC_FILE_NAME_PREFIX = "PROC_"; - private static final String JOB_ADVANCE_MAX_MEMORY = "job.setting.advance.mMemory"; - private static final String DEFAULT_JVM_HEAP_MEMORY = "1g"; - private static final String LOG_LEVEL_CMD = "loglevel"; - private static final String LOGBACK_LISTENER_CMD = "logback.statusListenerClass"; - private static final String LOGBACK_CONF_CMD = "logback.configurationFile"; - private static final String HOME_CMD = "datax.home"; - private static final String JOB_ID_CMD = "jobid"; - private static final String MODE_CMD = "mode"; - private static final String JOB_CMD = "job"; - private static final String LOG_FILE_NAME_CMD = "log.file.name"; - private static final String SERVER_ADDRESS_CMD = "server.address"; - private static final String EXEC_USER_CMD = "exec.user"; - - private enum Method{ - JAVA, PYTHON; - } - - /** - * If allocate enough resource, default: false - */ - private volatile boolean alloc = false; - - private String procSrcCode; - - private String loggerDir; - private String dataXHome; - private String procSrcPath; - - public DataxTaskProcess(long jobId, long taskId, String execUser, - TaskConfiguration taskConfig, ExecutorConfiguration configuration, - Map engineParams) { - super(jobId, taskId, execUser, taskConfig, configuration, engineParams); - this.loggerDir = configuration.getJobLogDir(); - this.procSrcCode = String.valueOf(engineParams.getOrDefault(DefaultParams.Engine.PARAM_PROC_SRC_CODE, "")); - this.procSrcPath = configuration.getEngineDataXProcSrc(); - this.dataXHome = configuration.getEngineDataXHome(); - } - - @Override - protected void initInternal() { - try { - //Write configuration to file - FileUtils.writeStringToFile(new File(workDir, getExecConfig().getEngineDataXConfFile()), getTaskConfig().toJson()); - LOG.debug("Write {}/{} success.", workDir.getPath(), getExecConfig().getEngineDataXConfFile()); - //Write processor code to file - if(StringUtils.isNotBlank(procSrcCode)) { - FileUtils.writeStringToFile(new File(workDir.getAbsolutePath() + IOUtils.DIR_SEPARATOR_UNIX + procSrcPath, - PROC_FILE_NAME_PREFIX + System.currentTimeMillis()), procSrcCode); - } - }catch (Exception e){ - LOG.error("Write job config error",e); - } - } - - @Override - public boolean isAlloc() { - return alloc; - } - - - @Override - protected boolean checkIfAlloc() { - File file = new File(workDir + "/" + PID_F_NAME); - alloc = file.exists(); - return alloc; - } - - @Override - public Process executeInternal() { - String execUser = getExecUser(); - Method method = getMethod(); - String command = ""; - // --jvm=-Xms -Xmx - String maxMemory = getTaskConfig().getString(JOB_ADVANCE_MAX_MEMORY, DEFAULT_JVM_HEAP_MEMORY).toLowerCase(); - long mMemory = MemUtils.convertToMB(Long.parseLong(maxMemory.substring(0, maxMemory.length() - 1)), - maxMemory.substring(maxMemory.length() - 1)); - if(method == Method.PYTHON){ - command = StringUtils.join(new String[]{ - getExecConfig().getEngineDataXPythonShell(), getExecConfig().getEngineDataXPythonScript(), - getExecConfig().getEngineDataXConfFile(), - "--" + JOB_ID_CMD + "=" + getTaskId(), - "--jvm='-Xms" + mMemory + "m -Xmx" + mMemory + "m'", - "-p'" + - " -D" + EXEC_USER_CMD + "=" + execUser + - " -D" + LOG_FILE_NAME_CMD + "=" + logFileName() + - " -D" + SERVER_ADDRESS_CMD + "=" + StringUtils.substringAfter(AppUtil.getIpAndPort(), "http://") + - "'"}, " "); - }else{ - JavaCommandBuilder builder = new JavaCommandBuilder(MachineInfo.getProcPath(), - getExecConfig().getEngineDataXJavaMainClass()) - .Xmx(mMemory, MemUtils.StoreUnit.MB).Xms(mMemory, MemUtils.StoreUnit.MB) - .classPath(getExecConfig().getEngineDataXJavaClassPath()) - .prop("-D" + LOG_LEVEL_CMD, "info") - .prop("-D" + LOGBACK_LISTENER_CMD, NopStatusListener.class.getName()) - .prop("-D" + HOME_CMD, dataXHome) - .prop("-D" + LOG_FILE_NAME_CMD, logFileName()) - .prop("-D" + LOGBACK_CONF_CMD, getExecConfig().getEngineDataXJavaLogConf()) - .prop("-D" + SERVER_ADDRESS_CMD, StringUtils.substringAfter(AppUtil.getIpAndPort(), "http://")) - .cmdProp("-" + JOB_ID_CMD, String.valueOf(getTaskId())) - .cmdProp("-" + JOB_CMD, this.workDir.getAbsolutePath() + File.separator + getExecConfig().getEngineDataXConfFile()) - .cmdProp("-" + MODE_CMD, "standalone"); - command = builder.build(); - } - if(needToSwitchUser(execUser)){ - command = "sudo su " + execUser + " -c \"" + command + "\""; - } - LOG.info("Run Command:{}", command); - Map env = new HashMap<>(4); - LOG.trace("Add token path {} to env", System.getProperty(AuthConstraints.ENV_SERV_TOKEN_PATH)); - try { - ProcessBuilder builder = RunShell.createProcBuilder(command, env, this.workDir); - return builder.start(); - } catch (Exception e) { - LOG.error("Execute DataX occurred error: "+ e.getMessage(), e); - throw new RuntimeException(e); - } - } - - @Override - public Resource getResource() { - String maxMemory = getTaskConfig().getString(JOB_ADVANCE_MAX_MEMORY, DEFAULT_JVM_HEAP_MEMORY).toLowerCase(); - return new Resource(getTaskId(), 0, - MemUtils.convertToByte(Long.parseLong(maxMemory.substring(0, maxMemory.length() - 1)), - maxMemory.substring(maxMemory.length() - 1))); - } - - @Override - protected void clean(File workDir) { - super.clean(workDir); - //Finally change the allocate status - alloc = false; - } - - @Override - public String toString() { - return "DataxTaskProcess{" + - "jobId=" + getJobId() + - ", taskId=" + getTaskId() + - ", loggerDir='" + loggerDir + '\'' + - ", taskConfig='" + getTaskConfig() + '\'' + - '}'; - } - - /** - * Get execute method - * @return - */ - private Method getMethod(){ - String method = getExecConfig().getEngineDataXMethod(); - Method methodType = null; - try{ - methodType = Method.valueOf(StringUtils.isNotBlank(method)? method : "java"); - }catch(Exception e){ - //Ignore - } - if(null == methodType){ - methodType = Method.JAVA; - } - return methodType; - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/sqoop/SqoopOptionVo.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/sqoop/SqoopOptionVo.java deleted file mode 100644 index 8543866a4..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/sqoop/SqoopOptionVo.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.task.process.sqoop; - -import com.fasterxml.jackson.annotation.JsonAlias; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.HashMap; -import java.util.Map; - -/** - * Sqoop Option - * @author davidhua - * 2019/12/24 - */ -@JsonInclude(JsonInclude.Include.NON_EMPTY) -public class SqoopOptionVo { - @JsonAlias("@name") - private String name; - - @JsonAlias("@require") - private boolean require; - - @JsonAlias("@condition") - private Map condition = new HashMap<>(); - - @JsonAlias("@params") - private Map params = new HashMap<>(); - - @JsonAlias("@value") - private String value; - - public boolean isRequire() { - return require; - } - - public void setRequire(boolean require) { - this.require = require; - } - - public Map getCondition() { - return condition; - } - - public void setCondition(Map condition) { - this.condition = condition; - } - - public Map getParams() { - return params; - } - - public void setParams(Map params) { - this.params = params; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/sqoop/SqoopTaskConfigBuilder.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/sqoop/SqoopTaskConfigBuilder.java deleted file mode 100644 index 4e5ee2ef5..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/sqoop/SqoopTaskConfigBuilder.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.task.process.sqoop; - -import com.webank.wedatasphere.exchangis.common.util.CryptoUtils; -import com.webank.wedatasphere.exchangis.common.util.JobUtils; -import com.webank.wedatasphere.exchangis.common.util.json.Json; -import com.webank.wedatasphere.exchangis.executor.service.CallBackService; -import com.webank.wedatasphere.exchangis.executor.task.AbstractTaskConfigBuilder; -import com.webank.wedatasphere.exchangis.executor.task.TaskConfigBuilder; -import com.webank.wedatasphere.exchangis.executor.util.TaskConfiguration; -import com.webank.wedatasphere.exchangis.job.DefaultParams; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.tuple.MutablePair; -import org.apache.commons.lang3.tuple.Pair; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - - -/** - * Build task configuration for SQOOP - * @author davidhua - * 2019/12/18 - */ -@Service(TaskConfigBuilder.PREFIX + "sqoop") -public class SqoopTaskConfigBuilder extends AbstractTaskConfigBuilder { - - public static final String CONFIG_COMMAND = "command"; - - private static final String READER_PARAM_PATH = "reader"; - private static final String WRITER_PARAM_PATH = "writer"; - private static final String TOOL_PARAM_PATH = "tool"; - private static final String SETTINGS_PARAM_PATH = "settings"; - - private static final String OPTION_KEY_PATTERN = "[-]{1,2}[.\\d\\w_-]+"; - private static final Pattern OPTION_PARAM_PATTERN = Pattern.compile("\\{(\\w+)}?"); - @Resource - private CallBackService callBackService; - - @Override - public TaskConfiguration build(long jobId, long taskId, String jobConfig, Map taskParams) { - String taskConfJson; - if(null != taskParams.get(DefaultParams.Task.PARAM_DATE)){ - long time = Long.parseLong(String.valueOf(taskParams.get(DefaultParams.Task.PARAM_DATE))); - taskConfJson = JobUtils.render(jobConfig, time); - }else{ - taskConfJson = JobUtils.render(jobConfig); - } - TaskConfiguration taskConfig = TaskConfiguration.from(taskConfJson); - Map optionMap = new TreeMap<>( - String::compareTo - ); - injectDataSourceParamToConf(callBackService, taskConfig, READER_PARAM_PATH); - injectDataSourceParamToConf(callBackService, taskConfig, WRITER_PARAM_PATH); - StringBuilder builder = new StringBuilder(); - parseTaskConfig(taskConfig, "", TOOL_PARAM_PATH, optionMap); - if(optionMap.size() != 1){ - throw new IllegalArgumentException("Cannot find the SQOOP Tool option: [" + Json.toJson(optionMap.toString(), null) +"]"); - } - optionMap.forEach((key, value) -> builder.append(" ").append(value).append(" ")); - optionMap.clear(); - parseTaskConfig(taskConfig, READER_PARAM_PATH, OPTION_KEY_PATTERN, optionMap); - parseTaskConfig(taskConfig, WRITER_PARAM_PATH, OPTION_KEY_PATTERN, optionMap); - parseTaskConfig(taskConfig, SETTINGS_PARAM_PATH, OPTION_KEY_PATTERN, optionMap); - taskParams.forEach((key, value) ->{ - if(key.matches(OPTION_KEY_PATTERN)){ - optionMap.put(key, String.valueOf(value)); - } - }); - try { - String password = optionMap.get("--password"); - if (StringUtils.isNotBlank(password)) { - optionMap.put("--password", String.valueOf(CryptoUtils.string2Object(password))); - } - }catch(Exception e){ - //ignore - } - optionMap.forEach((key, value) -> builder.append(" ").append(key).append(" ").append(value).append(" ")); - taskConfig.set(CONFIG_COMMAND, builder.toString()); - return taskConfig; - } - - /** - * Parse task configuration and build option map - * @param jobConfig - * @param path - * @param optionMap - */ - private void parseTaskConfig(TaskConfiguration jobConfig, String path, String pattern, - Map optionMap){ - TaskConfiguration subConf = jobConfig.getConfiguration(path); - Set keys = subConf.getKeys(1); - keys.forEach(key ->{ - if(key.trim().matches(pattern)){ - String jsonStr = subConf.getString(key, "{}").trim(); - List sqoopOptionVos = new ArrayList<>(); - if(jsonStr.startsWith("[") && jsonStr.endsWith("]")){ - sqoopOptionVos = Json.fromJson(jsonStr, SqoopOptionVo.class); - }else { - sqoopOptionVos.add(Json.fromJson(jsonStr, SqoopOptionVo.class)); - } - assert sqoopOptionVos != null; - sqoopOptionVos.forEach(sqoopOptionVo -> { - assert sqoopOptionVo != null; - Pair option = parseToOption(key, sqoopOptionVo, subConf); - if(StringUtils.isNotBlank(option.getLeft())){ - optionMap.put(option.getLeft(), option.getRight()); - } - }); - } - }); - } - - /** - * Parse the option object to option parameter - * @param optionName - * @param sqoopOptionVo - * @param configuration - * @return - */ - private Pair parseToOption(String optionName, SqoopOptionVo sqoopOptionVo, TaskConfiguration configuration){ - if(StringUtils.isNotBlank(sqoopOptionVo.getName())){ - //replace option name - optionName = sqoopOptionVo.getName(); - } - MutablePair option = new MutablePair<>(); - Map relateMap = sqoopOptionVo.getCondition(); - for(Map.Entry entry : relateMap.entrySet()){ - String value = configuration.getString(entry.getKey()); - boolean match = (StringUtils.isBlank(value) && StringUtils.isBlank(entry.getValue())) || - (StringUtils.isNotBlank(value) && value.matches(entry.getValue())); - if(match){ - continue; - } - return option; - } - String value = sqoopOptionVo.getValue(); - if(StringUtils.isNotBlank(value)){ - Map params = sqoopOptionVo.getParams(); - Matcher matcher = OPTION_PARAM_PATTERN.matcher(value); - StringBuffer sb = new StringBuffer(); - while (matcher.find()) { - Object paramValue = params.getOrDefault(matcher.group(1), ""); - String result; - if(paramValue instanceof List){ - result = StringUtils.join((List)paramValue, ","); - }else if (paramValue instanceof Map){ - result = Json.toJson(paramValue, null); - }else{ - result = String.valueOf(paramValue); - } - if (StringUtils.isNotBlank(result)) { - matcher.appendReplacement(sb, result); - } else { - matcher.appendReplacement(sb, ""); - } - } - matcher.appendTail(sb); - value = sb.toString(); - } - if(StringUtils.isNotBlank(value) || sqoopOptionVo.isRequire()){ - option.setLeft(optionName); - option.setRight(StringUtils.isBlank(value)?"":value); - } - return option; - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/sqoop/SqoopTaskProcess.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/sqoop/SqoopTaskProcess.java deleted file mode 100644 index 95faffe06..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/task/process/sqoop/SqoopTaskProcess.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.task.process.sqoop; - -import com.webank.wedatasphere.exchangis.common.util.MemUtils; -import com.webank.wedatasphere.exchangis.executor.ExecutorConfiguration; -import com.webank.wedatasphere.exchangis.executor.JobContainer; -import com.webank.wedatasphere.exchangis.executor.daemons.LoggerDaemon; -import com.webank.wedatasphere.exchangis.executor.resource.Resource; -import com.webank.wedatasphere.exchangis.executor.task.process.AbstractJavaInternalTaskProcess; -import com.webank.wedatasphere.exchangis.executor.util.RunShell; -import com.webank.wedatasphere.exchangis.executor.util.TaskConfiguration; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * @author davidhua - * 2019/12/11 - */ -public class SqoopTaskProcess extends AbstractJavaInternalTaskProcess implements LoggerDaemon.Parser { - - private static final Logger LOG = LoggerFactory.getLogger(SqoopTaskProcess.class); - private static final String SETTINGS_MAX_MEMORY = "settings.mMemory"; - private static final String JOB_SUBMIT_PREFIX = "Submitting tokens for job:"; - private static final Pattern JOB_ID_PATTERN = Pattern.compile(JOB_SUBMIT_PREFIX + "\\s+?([\\S]+)"); - - private String clusterJobId; - - public SqoopTaskProcess(long jobId, long taskId, String execUser, - TaskConfiguration taskConfig, ExecutorConfiguration execConfig, - Map engineParams) { - super(jobId, taskId, execUser, taskConfig, execConfig, engineParams); - } - - @Override - protected void initInternal() { - //do nothing - } - - @Override - protected Process executeInternal() { - String execUser = getExecUser(); - String maxMemory = getTaskConfig().getString(SETTINGS_MAX_MEMORY, "1g"); - //unit conversion - long headSizeM = MemUtils.convertToMB(Integer.parseInt(maxMemory.substring(0, maxMemory.length()-1)), - maxMemory.substring(maxMemory.length() - 1)); - TaskConfiguration taskConfig = getTaskConfig(); - String sqoopCmd = getExecConfig().getEngineSqoopShell() + " " + taskConfig.getString(SqoopTaskConfigBuilder.CONFIG_COMMAND); - String command = StringUtils.join(new String[]{ - "echo $$ > " + pidFileName(), "&&", - "echo " + mask(sqoopCmd) + "", "&&", - sqoopCmd , "2>&1", "&&", - "rm " + pidFileName() - - }, " "); - if(needToSwitchUser(execUser)){ - command = "sudo su " + execUser + " -c \"" + command +"\""; - } - LOG.info("Run command:{}", command); - Map env = new HashMap<>(1); - //hadoop config - env.put("HADOOP_CLIENT_OPTS", "-Xmx" + headSizeM + "m"); - env.put("HADOOP_HEAPSIZE", String.valueOf(headSizeM)); - try{ - ProcessBuilder builder = RunShell.createProcBuilder(command ,env, this.workDir); - return builder.start(); - }catch(Exception e){ - LOG.error("Execute Sqoop occurred error: " + e.getMessage(), e); - throw new RuntimeException(e); - } - } - - @Override - public Resource getResource() { - String maxMemory = getTaskConfig().getString(SETTINGS_MAX_MEMORY, "1g"); - return new Resource(getTaskId(), 0, - MemUtils.convertToByte(Long.parseLong(maxMemory.substring(0, maxMemory.length() - 1)), - maxMemory.substring(maxMemory.length() - 1))); - } - - @Override - protected String logFileName() { - return JobContainer.LOG_STDOUT_NAME; - } - - @Override - public boolean acceptLogger(String loggerName){ - return loggerName.equals(JobContainer.LOG_STDOUT_NAME); - } - - @Override - public void parseLoggerOutput(String output) { - if(StringUtils.isBlank(clusterJobId) && output.contains(JOB_SUBMIT_PREFIX)){ - Matcher matcher = JOB_ID_PATTERN.matcher(output); - if(matcher.find()){ - this.clusterJobId = matcher.group(1); - } - } - } - - @Override - protected void killProcess(int pid) throws IOException, InterruptedException { - super.killProcess(pid); - if(StringUtils.isNotBlank(this.clusterJobId)){ - RunShell shell = new RunShell("hadoop job -kill " + - this.clusterJobId); - shell.run(); - } - } - - @Override - public String toString() { - return "DataxTaskProcess{" + - "jobId=" + getJobId() + - ", taskId=" + getTaskId() + - ", taskConfig='" + getTaskConfig() + '\'' + - '}'; - } - - private static String mask(String command){ - String[] commandsSpliced = command.split("\\s+"); - for(int i = 0; i < commandsSpliced.length; i++){ - if(commandsSpliced[i].contains("password") && i + 1 < commandsSpliced.length){ - commandsSpliced[i + 1] = ""; - } - } - return StringUtils.join(commandsSpliced, " "); - } - -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/Commnads.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/Commnads.java deleted file mode 100644 index 85f5251b5..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/Commnads.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.util; - -/** - * @author davidhua - * 2019/10/28 - */ -public class Commnads { - public static final String LINUX_CREATE_USER = "id $1 >/dev/null 2>&1 || sudo useradd -g hadoop $1"; -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/HttpClientUtil.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/HttpClientUtil.java deleted file mode 100644 index 818c9f289..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/HttpClientUtil.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.util; - -import com.webank.wedatasphere.exchangis.common.auth.AuthConstraints; -import org.apache.commons.lang.StringUtils; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.CredentialsProvider; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.client.methods.*; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClientBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.*; -import java.util.concurrent.ThreadPoolExecutor; - - -/** - * @author davidhua - */ -public class HttpClientUtil { - - private static Logger logger = LoggerFactory.getLogger(HttpClientUtil.class); - - private static CredentialsProvider provider; - - private CloseableHttpClient httpClient; - - private static HttpClientUtil clientUtil; - - private static int HTTP_TIMEOUT_IN_MILLISECONDS = 5000; - - private static final int POOL_SIZE = 20; - - public static void setHttpTimeoutInMillionSeconds(int httpTimeoutInMillionSeconds) { - HTTP_TIMEOUT_IN_MILLISECONDS = httpTimeoutInMillionSeconds; - } - - public static synchronized HttpClientUtil getHttpClientUtil() { - if (null == clientUtil) { - synchronized (HttpClientUtil.class) { - if (null == clientUtil) { - clientUtil = new HttpClientUtil(); - } - } - } - return clientUtil; - } - - private HttpClientUtil() { - initApacheHttpClient(); - } - - public void destroy() { - destroyApacheHttpClient(); - } - - private void initApacheHttpClient() { - RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(HTTP_TIMEOUT_IN_MILLISECONDS) - .setConnectTimeout(HTTP_TIMEOUT_IN_MILLISECONDS).setConnectionRequestTimeout(HTTP_TIMEOUT_IN_MILLISECONDS) - .setStaleConnectionCheckEnabled(true).build(); - - if (null == provider) { - httpClient = HttpClientBuilder.create().setMaxConnTotal(POOL_SIZE).setMaxConnPerRoute(POOL_SIZE) - .setDefaultRequestConfig(requestConfig).build(); - } else { - httpClient = HttpClientBuilder.create().setMaxConnTotal(POOL_SIZE).setMaxConnPerRoute(POOL_SIZE) - .setDefaultRequestConfig(requestConfig).setDefaultCredentialsProvider(provider).build(); - } - } - - private void destroyApacheHttpClient() { - try { - if (httpClient != null) { - httpClient.close(); - httpClient = null; - } - } catch (IOException e) { - logger.info(e.getMessage(), e); - } - } - - public String downLoad(String url,String localPath) { - OutputStream out = null; - InputStream in = null; - try { - HttpGet httpGet = new HttpGet(url); - addTokenHeader(httpGet); - HttpResponse httpResponse = httpClient.execute(httpGet); - HttpEntity entity = httpResponse.getEntity(); - in = entity.getContent(); - - long length = entity.getContentLength(); - if (length <= 0) { - throw new RuntimeException("Download "+url+" file not exist."); - } - File file = new File(localPath); - if(!file.exists()){ - file.createNewFile(); - } - out = new FileOutputStream(file); - byte[] buffer = new byte[4096]; - int readLength = 0; - while ((readLength=in.read(buffer)) > 0) { - byte[] bytes = new byte[readLength]; - System.arraycopy(buffer, 0, bytes, 0, readLength); - out.write(bytes); - } - out.flush(); - } catch (Exception e) { - throw new RuntimeException("Down file [" + url + "] exception.",e); - }finally{ - try { - if(in != null){ - in.close(); - } - } catch (IOException e) { - logger.warn("Close input stream exception.",e); - } - - try { - if(out != null){ - out.close(); - } - } catch (IOException e) { - logger.warn("Close output stream exception.",e); - } - } - return localPath; - } - - private void addTokenHeader(HttpRequestBase requestBase) throws IOException { - String token = System.getProperty(AuthConstraints.ENV_SERV_TOKEN); - if(StringUtils.isBlank(token)){ - //try to read token from file - String tokenPath = System.getProperty(AuthConstraints.ENV_SERV_TOKEN_PATH); - if(StringUtils.isNotBlank(tokenPath)){ - token = readToken(tokenPath); - } - } - requestBase.addHeader("Cookie", AuthConstraints.DEFAULT_SSO_COOKIE + "=" + token); - } - - private String readToken(String tokenPath) throws IOException { - String token = null; - File file = new File(tokenPath); - if (file.exists()) { - try(BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)))){ - StringBuilder buffer = new StringBuilder(); - String str; - while((str = reader.readLine()) != null){ - buffer.append(str); - } - token = buffer.toString(); - } - } - return token; - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/LinuxPlatFormUtil.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/LinuxPlatFormUtil.java deleted file mode 100644 index fa8f9867f..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/LinuxPlatFormUtil.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.util; - -import com.webank.wedatasphere.exchangis.common.util.PatternInjectUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.tuple.MutablePair; -import org.apache.commons.lang3.tuple.MutableTriple; -import org.apache.commons.lang3.tuple.Pair; -import org.apache.commons.lang3.tuple.Triple; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * @author davidhua - * 2019/11/16 - */ -public class LinuxPlatFormUtil { - - public static final String DEFAULT_HADOOP_USER = "hadoop"; - private static final Pattern LINUX_USER_INFO_PATTERN = Pattern.compile("([\\S]+)?=([\\d]+)"); - public static Triple existUser(String username){ - String linuxIdCommand = "id ${userName}"; - RunShell runShell = new RunShell(PatternInjectUtils.inject(linuxIdCommand, - new String[]{username})); - if(runShell.run() == 0){ - String result = runShell.getResult(); - String uid = null, gid = null; - Matcher matcher = LINUX_USER_INFO_PATTERN.matcher(result); - while(matcher.find()){ - String name = matcher.group(1); - if("uid".equalsIgnoreCase(name)){ - uid = matcher.group(2); - }else if("gid".equalsIgnoreCase(name)){ - gid = matcher.group(2); - } - } - if(StringUtils.isNotBlank(uid) && StringUtils.isNotBlank(gid)){ - return new MutableTriple<>(true, Integer.valueOf(uid), Integer.valueOf(gid)); - } - } - return new MutableTriple<>(false, null, null); - } - - public static Pair createUser(String username, Integer uid, Integer gid){ - String linuxUserAddCommand = "sudo useradd ${userName}"; - List params = new ArrayList<>(); - params.add(username); - if(Optional.ofNullable(uid).filter(e -> e > 0).isPresent()){ - linuxUserAddCommand += " -u ${uid}"; - params.add(String.valueOf(uid)); - } - if(Optional.ofNullable(gid).filter(e -> e > 0).isPresent()){ - linuxUserAddCommand += " -g ${gid}"; - params.add(String.valueOf(gid)); - } - String[] paramArray = new String[params.size()]; - params.toArray(paramArray); - RunShell runShell = new RunShell(PatternInjectUtils.inject(linuxUserAddCommand, paramArray)); - return runShell.run() == 0? new MutablePair<>(true, null) : new MutablePair<>(false, runShell.getResult()); - } - - public static Pair currentUser(){ - String username = System.getProperty("user.name", ""); - if(StringUtils.isNotBlank(username)){ - Triple triple = existUser(username); - if(triple.getLeft()){ - return new MutablePair<>(triple.getMiddle(), triple.getRight()); - } - } - return new MutablePair<>(null, null); - } - public static Pair deleteUser(String username){ - String linuxUserDeleteCommand = "sudo userdel ${userName}"; - RunShell runShell = new RunShell(PatternInjectUtils.inject(linuxUserDeleteCommand, new String[]{username})); - return runShell.run() == 0?new MutablePair<>(true, null) : new MutablePair<>(false, runShell.getResult()); - } - -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/OperateBarrier.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/OperateBarrier.java deleted file mode 100644 index c559f8079..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/OperateBarrier.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.util; - -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.locks.Condition; -import java.util.concurrent.locks.ReentrantLock; -import java.util.function.Supplier; - -/** - * @author davidhua - * 2020/3/26 - */ -public class OperateBarrier { - /** - * Barriers - */ - private static ConcurrentHashMap barrierMap = new ConcurrentHashMap<>(); - /** - * Active time of barrier - */ - private static final int BARRIER_EXIST_IN_SECONDS = 5; - public static R operate(String operateId, Supplier operate){ - Barrier barrier = barrierMap.computeIfAbsent(operateId, key -> new Barrier(operateId)); - boolean signal = inQueue(barrier); - try{ - //Execute in async - return operate.get(); - }finally{ - deQueue(barrier, signal); - - } - } - - private static boolean inQueue(Barrier barrier){ - boolean signal = true; - barrier.barrierLock.lock(); - try { - if(barrier.enQueueCount.get() > 0){ - //Just wait in certain time - signal = barrier.enQueueCondition.await(BARRIER_EXIST_IN_SECONDS, TimeUnit.SECONDS); - } - barrier.enQueueCount.incrementAndGet(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - //Ignore - } finally{ - barrier.barrierLock.unlock(); - } - return signal; - } - - private static void deQueue(Barrier barrier, boolean signal){ - barrier.barrierLock.lock(); - try{ - if(barrier.enQueueCount.get() > 0 ){ - if(signal) { - //Just signal one thread - barrier.enQueueCondition.signal(); - } - barrier.enQueueCount.decrementAndGet(); - } - if(!barrier.barrierLock.hasWaiters(barrier.enQueueCondition)) { - barrierMap.remove(barrier.id); - } - }finally{ - barrier.barrierLock.unlock(); - } - } - private static class Barrier{ - - private final ReentrantLock barrierLock; - /** - * In queue - */ - private final Condition enQueueCondition; - - private String id; - - private final AtomicInteger enQueueCount = new AtomicInteger(0); - Barrier(String id){ - this.id = id; - barrierLock = new ReentrantLock(); - enQueueCondition = barrierLock.newCondition(); - } - } -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/RunShell.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/RunShell.java deleted file mode 100644 index 8f05284b6..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/RunShell.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.util; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - * Created by devendeng on 2018/9/11. - */ -public class RunShell { - private static Logger log = LoggerFactory.getLogger(RunShell.class); - private List cmd; - private Process process; - private int exitCode = -999; - - public RunShell(String command) { - cmd = new ArrayList<>(); - cmd.add("/bin/bash"); - cmd.add("-c"); - cmd.add(command); - - } - - public static ProcessBuilder createProcBuilder(String command, - Map env, File workDir){ - - ProcessBuilder builder = new ProcessBuilder("/bin/bash", "-c", command); - if(null != env){ - builder.environment().putAll(env); - } - builder.directory(workDir); - return builder; - } - - public int run() { - ProcessBuilder builder = new ProcessBuilder(cmd); - try { - process = builder.start(); - exitCode = process.waitFor(); - } catch (IOException | InterruptedException e) { - if(e instanceof InterruptedException){ - Thread.currentThread().interrupt(); - } - log.error("Run shell: [" + cmd +"] Error", e); - } - return exitCode; - } - - public String getResult(){ - StringBuilder result = new StringBuilder(); - BufferedReader input; - try { - if (exitCode == 0) { - input = new BufferedReader(new InputStreamReader(process.getInputStream())); - } else { - input = new BufferedReader(new InputStreamReader(process.getErrorStream())); - } - String line; - while ((line = input.readLine()) != null) { - result.append(line); - } - }catch(IOException e){ - String message = "Get result from cmd: ["+ cmd+"] Error"; - throw new RuntimeException(message, e); - } - return result.toString().trim(); - } - -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/StrUtil.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/StrUtil.java deleted file mode 100644 index 4b802a208..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/StrUtil.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.util; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.Validate; - -import java.text.DecimalFormat; -import java.util.HashMap; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class StrUtil { - - private final static long KB_IN_BYTES = 1024; - - private final static long MB_IN_BYTES = 1024 * KB_IN_BYTES; - - private final static long GB_IN_BYTES = 1024 * MB_IN_BYTES; - - private final static long TB_IN_BYTES = 1024 * GB_IN_BYTES; - - private final static DecimalFormat df = new DecimalFormat("0.00"); - - private static final Pattern VARIABLE_PATTERN = Pattern - .compile("(\\$)\\{?(\\w+)\\}?"); - - private static String SYSTEM_ENCODING = System.getProperty("file.encoding"); - - static { - if (SYSTEM_ENCODING == null) { - SYSTEM_ENCODING = "UTF-8"; - } - } - - private StrUtil() { - } - - public static String stringify(long byteNumber) { - if (byteNumber / TB_IN_BYTES > 0) { - return df.format((double) byteNumber / (double) TB_IN_BYTES) + "TB"; - } else if (byteNumber / GB_IN_BYTES > 0) { - return df.format((double) byteNumber / (double) GB_IN_BYTES) + "GB"; - } else if (byteNumber / MB_IN_BYTES > 0) { - return df.format((double) byteNumber / (double) MB_IN_BYTES) + "MB"; - } else if (byteNumber / KB_IN_BYTES > 0) { - return df.format((double) byteNumber / (double) KB_IN_BYTES) + "KB"; - } else { - return String.valueOf(byteNumber) + "B"; - } - } - - - public static String replaceVariable(final String param) { - Map mapping = new HashMap(); - - Matcher matcher = VARIABLE_PATTERN.matcher(param); - while (matcher.find()) { - String variable = matcher.group(2); - String value = System.getProperty(variable); - if (StringUtils.isBlank(value)) { - value = matcher.group(); - } - mapping.put(matcher.group(), value); - } - - String retString = param; - for (final String key : mapping.keySet()) { - retString = retString.replace(key, mapping.get(key)); - } - - return retString; - } - - public static String compressMiddle(String s, int headLength, int tailLength) { - Validate.notNull(s, "Input string must not be null"); - Validate.isTrue(headLength > 0, "Head length must be larger than 0"); - Validate.isTrue(tailLength > 0, "Tail length must be larger than 0"); - - if (headLength + tailLength >= s.length()) { - return s; - } - return s.substring(0, headLength) + "..." + s.substring(s.length() - tailLength); - } - -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/TaskConfiguration.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/TaskConfiguration.java deleted file mode 100644 index 075b31b05..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/TaskConfiguration.java +++ /dev/null @@ -1,364 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.util; - -import com.webank.wedatasphere.exchangis.common.util.PatternInjectUtils; -import com.webank.wedatasphere.exchangis.common.util.json.Json; -import org.apache.commons.lang3.StringUtils; - -import java.util.*; - -/** - * Copy and simplify from 'Configuration' in 'DataX' - * @author davidhua - * 2019/12/20 - */ -public class TaskConfiguration { - public static final String SPLIT_CHAR = "."; - private Object root; - - public static TaskConfiguration from(String json){ - json = PatternInjectUtils.inject(json, new String[]{}); - return new TaskConfiguration(json); - } - - public static boolean searchKeyToInsertValue(TaskConfiguration configuration, String path, - String key, Object value){ - TaskConfiguration subConf = configuration.getConfiguration(path); - Set keys = subConf.getKeys(); - //search key - for(String key0 : keys){ - if(key0.endsWith(SPLIT_CHAR + key)){ - configuration.set(StringUtils.join(new String[]{path, key0}, SPLIT_CHAR), value); - return true; - } - } - return false; - } - - public static List searchKeyPaths(TaskConfiguration configuration, String path, - String key){ - List result = new ArrayList<>(); - TaskConfiguration subConf = configuration.getConfiguration(path); - Set keys = subConf.getKeys(); - keys.forEach(key0 -> { - if(key0.equals(key) || key0.endsWith(SPLIT_CHAR + key)){ - result.add(key0); - } - }); - return result; - } - /** - * Serialize the configuration - * @return - */ - public String toJson(){ - return Json.toJson(root, null); - } - - /** - * Set value to path - * @param path path - * @param object object value - * @return - */ - public Object set(final String path, final Object object) { - if(!checkPath(path)){ - return null; - } - Object result = this.get(path); - setObject(path, extract(object)); - return result; - } - - /** - * Get value by path - * @param path path - * @return - */ - public Object get(final String path){ - this.checkPath(path); - return this.findObject(path); - } - - /** - * Get string value by path - * if the result is null, use the default value - * @param path path - * @param defaultValue default value - * @return - */ - public String getString(final String path, String defaultValue){ - Object result = this.get(path); - if(null == result){ - return defaultValue; - } - if(result instanceof String){ - return (String)result; - }else if(result.getClass().isPrimitive() || isWrapClass(result.getClass())){ - return String.valueOf(result); - }else{ - return Json.toJson(result, null); - } - } - - /** - * get integer value by path - * @param path path - * @return - */ - public Integer getInt(final String path){ - String result = this.getString(path); - if(null == result){ - return null; - } - return Integer.valueOf(result); - } - - /** - * Get string value by path - * @param path path - * @return - */ - public String getString(final String path){ - return getString(path, null); - } - - /** - * Get keys - * @return - */ - public Set getKeys(){ - return getKeys(Integer.MAX_VALUE); - } - - public Set getKeys(int maxDepth){ - Set collect = new HashSet<>(); - this.getKeysRecursive(this.root, "", collect, maxDepth); - return collect; - } - - public TaskConfiguration getConfiguration(final String path){ - Object object = this.get(path); - if(null == object){ - return null; - } - return TaskConfiguration.from(Json.toJson(object, null)); - } - - private Object findObject(final String path){ - if(StringUtils.isBlank(path)){ - return this.root; - } - Object target = this.root; - for(final String each : split2List(path)){ - if(isPathMap(each) && target instanceof Map){ - target = ((Map)target).get(each); - }else if (isPathList(each) && target instanceof List){ - String index = each.replace("[", "").replace("]", ""); - if(!StringUtils.isNumeric(index)){ - throw new IllegalArgumentException("index value must be numeric, value: " + index); - } - target = ((List)target).get(Integer.valueOf(index)); - }else{ - target = null; - break; - } - } - return target; - } - - private void setObject(final String path, final Object object){ - Object newRoot = setObjectRecursive(this.root, split2List(path), 0, object); - boolean isSuit = null != newRoot && (newRoot instanceof List || object instanceof Map); - if(isSuit){ - this.root = newRoot; - } - } - - private Object setObjectRecursive(Object current, final List paths, - int index, final Object value){ - if(index >= paths.size()){ - return value; - } - String path = paths.get(index).trim(); - if(isPathMap(path)){ - //current object is not map - Map mapping; - if(!(current instanceof Map)){ - mapping = new HashMap<>(1); - mapping.put(path, buildObject(paths.subList(index + 1, paths.size()), value)); - return mapping; - } - mapping = (Map)current; - //current map does not have key - if(!mapping.containsKey(path)){ - mapping.put(path, buildObject(paths.subList(index + 1, paths.size()), value)); - return mapping; - } - mapping.put(path, setObjectRecursive(mapping.get(path), - paths, index + 1, value)); - return mapping; - } - if(isPathList(path)){ - List lists; - int listIndex = getIndex(path); - //current object is not list - if(!(current instanceof List)){ - lists = expand(new ArrayList<>(listIndex + 1), listIndex + 1); - lists.set(listIndex, buildObject(paths.subList(index + 1, paths.size()), value)); - return lists; - } - lists = (List) current; - lists = expand(lists, listIndex + 1); - //current list does not have the index - if(null == lists.get(listIndex)){ - lists.set(listIndex, buildObject(paths.subList(index + 1, paths.size()), value)); - return lists; - } - lists.set(listIndex, setObjectRecursive(lists.get(listIndex), - paths, index + 1, value)); - return lists; - } - throw new RuntimeException("system error"); - } - - private Object buildObject(final List paths, final Object object){ - if(null == paths ){ - throw new IllegalArgumentException("paths cannot be null"); - } - if(1 == paths.size() && StringUtils.isBlank(paths.get(0))){ - return object; - } - Object child = object; - for(int i = paths.size() - 1; i >= 0; i--){ - String path = paths.get(i); - if(isPathMap(path)){ - Map mapping = new HashMap<>(1); - mapping.put(path, child); - child = mapping; - continue; - } - if(isPathList(path)){ - int index = getIndex(path); - List lists = new ArrayList<>(index + 1); - expand(lists, index + 1); - lists.set(index, child); - child = lists; - continue; - } - throw new IllegalArgumentException("illegal path"); - } - return child; - } - - private Object extract(final Object object){ - if(object instanceof TaskConfiguration){ - return ((TaskConfiguration)object).root; - } - if(object instanceof List){ - List result = new ArrayList<>(); - for(final Object each : (List)object){ - result.add(extract(each)); - } - return result; - } - if(object instanceof Map){ - Map map = (Map)object; - Map result = new HashMap<>(map.size()); - for(final Object key : map.keySet()){ - result.put(String.valueOf(key), extract(map.get(key))); - } - return result; - } - return object; - } - - private boolean isPathList(final String path){ - return path.contains("[") && path.contains("]"); - } - - private boolean isPathMap(final String path){ - return StringUtils.isNotBlank(path) && !isPathList(path); - } - - private List split2List(final String path){ - return Arrays.asList(StringUtils.split(path.replace("[", ".["), ".")); - } - - private int getIndex(final String index) { - return Integer.valueOf(index.replace("[", "").replace("]", "")); - } - - private boolean checkPath(final String path){ - if(null == path){ - return false; - } - for(String each : StringUtils.split(SPLIT_CHAR)){ - if(StringUtils.containsWhitespace(each)){ - throw new IllegalArgumentException("cannot contains white space in : " + path); - } - } - return true; - } - - private List expand(List list, int size) { - int expand = size - list.size(); - while (expand-- > 0) { - list.add(null); - } - return list; - } - - private void getKeysRecursive(final Object current, String path, Set collect,int depth){ - if(depth-- <= 0){ - collect.add(path); - return; - } - if(current instanceof Map){ - Map mapping = (Map)current; - for(final Object key : mapping.keySet()){ - String keyStr = String.valueOf(key).trim(); - if(StringUtils.isBlank(path)){ - getKeysRecursive(mapping.get(key), keyStr, collect, depth); - }else{ - getKeysRecursive(mapping.get(key), path + SPLIT_CHAR + keyStr, collect, depth); - } - } - }else if(current instanceof List){ - List lists = (List) current; - for(int i = 0; i < lists.size(); i++){ - getKeysRecursive(lists.get(i), path + String.format("[%d]", i), collect, depth); - } - }else{ - collect.add(path); - } - } - - private static boolean isWrapClass(Class clz){ - try{ - return ((Class)clz.getField("TYPE").get(null)).isPrimitive(); - }catch(Exception e){ - return false; - } - } - private TaskConfiguration(final String json){ - this.root = Json.fromJson(json, Map.class); - } - -} diff --git a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/WorkSpace.java b/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/WorkSpace.java deleted file mode 100644 index e4d1d0eab..000000000 --- a/modules/executor/core/src/main/java/com/webank/wedatasphere/exchangis/executor/util/WorkSpace.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.executor.util; - -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; - -/** - * @author davidhua - * 2019/12/23 - */ -public class WorkSpace { - private static final Logger LOG = LoggerFactory.getLogger(WorkSpace.class); - - public static String createLocalDir(String baseDir, long jobId, long taskId){ - String directory = baseDir + IOUtils.DIR_SEPARATOR_UNIX + jobId + "_" + taskId; - File workDir = new File(directory); - if (!workDir.exists() && !workDir.mkdirs()) { - throw new RuntimeException("Create workspace directory: " + workDir + " failed"); - } - return directory; - } - - public static String createLocalDirIfNotExist(String baseDir, long jobId, long taskId){ - String directory = baseDir + IOUtils.DIR_SEPARATOR_UNIX + jobId + "_" + taskId; - File workDir = new File(directory); - if(workDir.mkdirs()){ - LOG.trace("Create directory: " + directory); - } - return directory; - } - - public static String getLocalSpace(String baseDir, long jobId, long taskId){ - return baseDir + IOUtils.DIR_SEPARATOR_UNIX + jobId + "_" + taskId; - } - - /** - * Must be an empty directory - * @param space - */ - public static boolean deleteLocalSpace(String space){ - if(StringUtils.isNotBlank(space)) { - return new File(space).delete(); - } - return false; - } -} diff --git a/modules/executor/core/src/main/native/libsigar-amd64-linux.so b/modules/executor/core/src/main/native/libsigar-amd64-linux.so deleted file mode 100644 index 5a2e4c24f..000000000 Binary files a/modules/executor/core/src/main/native/libsigar-amd64-linux.so and /dev/null differ diff --git a/modules/executor/core/src/main/resources/application.yml b/modules/executor/core/src/main/resources/application.yml deleted file mode 100644 index 7bed38cc9..000000000 --- a/modules/executor/core/src/main/resources/application.yml +++ /dev/null @@ -1,39 +0,0 @@ - - -server: - port: ${server.port} - tomcat: - basedir: ${data.path}/tomcat/executor - -jasypt: - encryptor: - password: bdp - -eureka: - instance: - prefer-ip-address: true - lease-renewal-interval-in-seconds: 4 - lease-expiration-duration-in-seconds: 12 - client: - serviceUrl: - defaultZone: ${EUREKA_SERVICE_URL} - fetch-registry: true - registry-fetch-interval-seconds: 8 - -auth: - token: - api: ENC(doiaIecpZ6QpeVvqcayuWuuWC1C5Nf1V) - - -management: - metrics: - export: - prometheus: - enabled: true - endpoints: - web: - #http暴露所有监控项 - exposure: - include: '*' - #uri,可自定义 - base-path: /actuator diff --git a/modules/executor/core/src/main/resources/auth.properties b/modules/executor/core/src/main/resources/auth.properties deleted file mode 100644 index 1d2e9a0a5..000000000 --- a/modules/executor/core/src/main/resources/auth.properties +++ /dev/null @@ -1,8 +0,0 @@ -auth.switch=true -auth.login.url=/api/v1/auth/login -auth.token.invalid=30 -#token\u5237\u65B0\u95F4\u9694 -auth.token.servRefresh.interval=300 -auth.token.servRefresh.id=exchangis_executor -auth.token.servRefresh.pwd=udes@2018 -auth.token.servRefresh.store=${data.path}/token/server.tk \ No newline at end of file diff --git a/modules/executor/core/src/main/resources/bootstrap.properties b/modules/executor/core/src/main/resources/bootstrap.properties deleted file mode 100644 index a6512bedc..000000000 --- a/modules/executor/core/src/main/resources/bootstrap.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Eureka -EUREKA_SERVICE_URL=http://127.0.0.1:8500/eureka/ \ No newline at end of file diff --git a/modules/executor/core/src/main/resources/bootstrap.yml b/modules/executor/core/src/main/resources/bootstrap.yml deleted file mode 100644 index 3c1ccc4b0..000000000 --- a/modules/executor/core/src/main/resources/bootstrap.yml +++ /dev/null @@ -1,46 +0,0 @@ -spring: - application: - name: exchangis-executor - -executor: - linux: - sudo_user: ${sudo.user:root} - resource: - threshold: - cpu: 0.85 - memory: 0.85 - node: - default: true - tab: DATAX - heartbeat: - interval-in-sec: - idle: 60 - active: 5 - storePath: ${data.path} - job: - allocate: - time-in-seconds: 5 - logger: - dir: ${executor.storePath}/ - history: ${executor.storePath}/history - limit: - number: 10000 - engine: - dataX: - home: ${user.dir}/engine/datax - python: - shell: python - script: ${executor.job.engine.dataX.home}/bin/datax.py - java: - mainClass: com.alibaba.datax.core.Engine - classPath: ${executor.job.engine.dataX.home}/lib/* - logConfFile: ${executor.job.engine.dataX.home}/conf/log/logback.xml - method: JAVA - logger-file-name: out.log - config-file-name: job.json - proc-src-dir: proc/src - sqoop: - shell: sqoop - network: - interface: - name: "" \ No newline at end of file diff --git a/modules/executor/core/src/main/resources/logback-server.xml b/modules/executor/core/src/main/resources/logback-server.xml deleted file mode 100644 index fd1c75f41..000000000 --- a/modules/executor/core/src/main/resources/logback-server.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - ${CONSOLE_LOG_PATTERN} - - - - - - ERROR - DENY - ACCEPT - - - ${log.path}/exchangis-executor.%d{yyyy-MM-dd}-%i.log - 30 - - 10MB - - - - ${FILE_LOG_PATTERN} - - - - - ERROR - ACCEPT - DENY - - - ${log.path}/exchangis-executor-error.%d{yyyy-MM-dd}-%i.log - 30 - - 10MB - - - - ${FILE_LOG_PATTERN} - - - - - - - - diff --git a/modules/executor/engine/datax/datax-assembly/package.xml b/modules/executor/engine/datax/datax-assembly/package.xml deleted file mode 100644 index 154b4cb5e..000000000 --- a/modules/executor/engine/datax/datax-assembly/package.xml +++ /dev/null @@ -1,66 +0,0 @@ - - core - - dir - - false - - - ../datax-core/target/core - / - - - ../datax-hdfsreader/target/plugin - / - - - ../datax-hdfswriter/target/plugin - / - - - ../datax-textfilereader/target/plugin - / - - - ../datax-textfilewriter/target/plugin - / - - - ../datax-ftpreader/target/plugin - / - - - ../datax-ftpwriter/target/plugin - / - - - ../datax-elasticsearchwriter/target/plugin - / - - - ../datax-mysqlreader/target/plugin - / - - - ../datax-mysqlwriter/target/plugin - / - - - ../datax-oraclereader/target/plugin - / - - - ../datax-oraclewriter/target/plugin - / - - - - - true - lib - runtime - - - \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-assembly/pom.xml b/modules/executor/engine/datax/datax-assembly/pom.xml deleted file mode 100644 index 3f97a5aa6..000000000 --- a/modules/executor/engine/datax/datax-assembly/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - exchangis-executor-engine-datax - com.webank.wedatasphere.exchangis - 0.5.0.RELEASE - ../pom.xml - - 4.0.0 - - datax-assembly - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - ${basedir}/package.xml - - datax - ${project.parent.build.directory} - - - - - \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-core/pom.xml b/modules/executor/engine/datax/datax-core/pom.xml deleted file mode 100644 index de3e80015..000000000 --- a/modules/executor/engine/datax/datax-core/pom.xml +++ /dev/null @@ -1,197 +0,0 @@ - - - - exchangis-executor-engine-datax - com.webank.wedatasphere.exchangis - 0.5.0.RELEASE - ../pom.xml - - 4.0.0 - jar - ${datax.engine.version} - datax-core - - - com.alibaba - druid - 1.0.15 - - - com.alibaba - fastjson - - - commons-configuration - commons-configuration - - - org.apache.commons - commons-lang3 - - - commons-cli - commons-cli - - - commons-pool - commons-pool - - - commons-beanutils - commons-beanutils - - - org.apache.httpcomponents - httpclient - 4.4 - - - org.apache.httpcomponents - fluent-hc - 4.4 - - - org.codehaus.janino - janino - 2.5.16 - - - org.codehaus.groovy - groovy-all - 2.1.9 - - - net.sourceforge.javacsv - javacsv - 2.0 - - - org.anarres.lzo - lzo-core - 1.0.5 - - - ch.qos.logback - logback-classic - - - org.slf4j - slf4j-api - - - io.airlift - aircompressor - 0.3 - - - com.facebook.presto.hadoop - hadoop-apache2 - 0.3 - provided - - - junit - junit - test - - - org.apache.commons - commons-math3 - - - org.apache.commons - commons-compress - - - commons-io - commons-io - - - com.google.guava - guava - - - com.google.code.gson - gson - - - com.dm - dm - 16 - system - ${basedir}/src/main/lib/Dm7JdbcDriver16.jar - - - com.sybase - jconn3 - 1.0.0-SNAPSHOT - system - ${basedir}/src/main/lib/jconn3-1.0.0-SNAPSHOT.jar - - - ppas - ppas - 16 - system - ${basedir}/src/main/lib/edb-jdbc16.jar - - - - org.apache.hadoop - hadoop-common - ${hadoop.version} - - - org.apache.commons - commons-compress - - - slf4j-log4j12 - org.slf4j - - - - - - - - src/main/resources - - **/* - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - - com.alibaba.datax.core.Engine - - - - ${basedir}/src/main/assembly/package.xml - - core - - - - - \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-elasticsearchwriter/pom.xml b/modules/executor/engine/datax/datax-elasticsearchwriter/pom.xml deleted file mode 100644 index a8c830f35..000000000 --- a/modules/executor/engine/datax/datax-elasticsearchwriter/pom.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - exchangis-executor-engine-datax - com.webank.wedatasphere.exchangis - 0.5.0.RELEASE - ../pom.xml - - 4.0.0 - jar - ${datax.engine.version} - datax-elasticsearchwriter - - - com.webank.wedatasphere.exchangis - datax-core - ${datax.engine.version} - provided - - - slf4j-log4j12 - org.slf4j - - - - - org.slf4j - slf4j-api - provided - - - ch.qos.logback - logback-classic - provided - - - io.searchbox - jest-common - 2.4.0 - - - io.searchbox - jest - 2.4.0 - - - joda-time - joda-time - 2.9.9 - - - org.elasticsearch.client - elasticsearch-rest-high-level-client - 6.7.1 - - - elasticsearch - org.elasticsearch - - - - - org.elasticsearch - elasticsearch - 6.7.1 - - - commons-logging - commons-logging - - - - - com.alibaba - fastjson - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - ${basedir}/src/main/assembly/package.xml - - plugin - - - - - \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-ftpreader/pom.xml b/modules/executor/engine/datax/datax-ftpreader/pom.xml deleted file mode 100644 index 341f31c9e..000000000 --- a/modules/executor/engine/datax/datax-ftpreader/pom.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - exchangis-executor-engine-datax - com.webank.wedatasphere.exchangis - 0.5.0.RELEASE - ../pom.xml - - 4.0.0 - jar - ${datax.engine.version} - datax-ftpreader - - - com.webank.wedatasphere.exchangis - datax-core - ${datax.engine.version} - provided - - - slf4j-log4j12 - org.slf4j - - - - - org.slf4j - slf4j-api - provided - - - commons-io - commons-io - provided - - - org.apache.commons - commons-lang3 - provided - - - commons-codec - commons-codec - provided - - - com.alibaba - fastjson - provided - - - ch.qos.logback - logback-classic - provided - - - com.jcraft - jsch - - 0.1.54 - - - commons-net - commons-net - 3.3 - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - ${basedir}/src/main/assembly/package.xml - - plugin - - - - - \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-ftpwriter/pom.xml b/modules/executor/engine/datax/datax-ftpwriter/pom.xml deleted file mode 100644 index 353f56d73..000000000 --- a/modules/executor/engine/datax/datax-ftpwriter/pom.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - exchangis-executor-engine-datax - com.webank.wedatasphere.exchangis - 0.5.0.RELEASE - ../pom.xml - - 4.0.0 - jar - ${datax.engine.version} - datax-ftpwriter - - - com.webank.wedatasphere.exchangis - datax-core - ${datax.engine.version} - provided - - - slf4j-log4j12 - org.slf4j - - - - provided - org.slf4j - slf4j-api - - - - ch.qos.logback - logback-classic - provided - - - commons-io - commons-io - provided - - - org.apache.commons - commons-lang3 - provided - - - commons-codec - commons-codec - provided - - - com.alibaba - fastjson - provided - - - com.jcraft - jsch - 0.1.54 - - - commons-net - commons-net - 3.3 - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - ${basedir}/src/main/assembly/package.xml - - plugin - - - - - \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-hdfsreader/pom.xml b/modules/executor/engine/datax/datax-hdfsreader/pom.xml deleted file mode 100644 index 7459d68fd..000000000 --- a/modules/executor/engine/datax/datax-hdfsreader/pom.xml +++ /dev/null @@ -1,154 +0,0 @@ - - - - exchangis-executor-engine-datax - com.webank.wedatasphere.exchangis - 0.5.0.RELEASE - ../pom.xml - - 4.0.0 - datax-hdfsreader - jar - ${datax.engine.version} - - 1.2.1 - 2.7.2 - 1.2.2 - 2.9.1 - - - - - com.webank.wedatasphere.exchangis - datax-core - provided - - - org.apache.hadoop - hadoop-common - - - slf4j-log4j12 - org.slf4j - - - ${datax.engine.version} - - - org.slf4j - slf4j-api - provided - - - ch.qos.logback - logback-classic - provided - - - org.apache.hadoop - hadoop-hdfs - ${hadoop.version} - - - netty-all - io.netty - - - - - - io.netty - netty-all - 4.1.46.Final - - - org.apache.hadoop - hadoop-common - ${hadoop.version} - - - org.apache.hadoop - hadoop-yarn-common - ${hadoop.version} - - - org.apache.hadoop - hadoop-mapreduce-client-core - ${hadoop.version} - - - com.alibaba - fastjson - - - org.apache.hive - hive-exec - ${hive.version} - - - org.codehaus.groovy - groovy-all - - - zookeeper - org.apache.zookeeper - - - - - xalan - xalan - 2.7.1 - - - - org.apache.hbase - hbase-server - ${hbase.version} - - - - - xerces - xercesImpl - ${xerces.version} - - - - - - src/main/resources - - **/* - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - ${basedir}/src/main/assembly/package.xml - - plugin - - - - - \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-hdfswriter/pom.xml b/modules/executor/engine/datax/datax-hdfswriter/pom.xml deleted file mode 100644 index cfad21165..000000000 --- a/modules/executor/engine/datax/datax-hdfswriter/pom.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - - exchangis-executor-engine-datax - com.webank.wedatasphere.exchangis - 0.5.0.RELEASE - ../pom.xml - - 4.0.0 - - datax-hdfswriter - jar - ${datax.engine.version} - - 1.2.1 - 2.7.2 - 2.9.1 - - - - - com.webank.wedatasphere.exchangis - datax-core - provided - - - org.apache.hadoop - hadoop-common - - - slf4j-log4j12 - org.slf4j - - - ${datax.engine.version} - - - com.alibaba - fastjson - - - org.slf4j - slf4j-api - provided - - - ch.qos.logback - logback-classic - provided - - - - org.apache.hadoop - hadoop-hdfs - ${hadoop.version} - - - xml-apis - xml-apis - - - netty-all - io.netty - - - - - - io.netty - netty-all - 4.1.46.Final - - - org.apache.hadoop - hadoop-common - ${hadoop.version} - - - commons-logging - commons-logging - - - - - - org.apache.hadoop - hadoop-mapreduce-client-core - ${hadoop.version} - - - - org.apache.hive - hive-serde - ${hive.version} - - - org.apache.hive - hive-service - ${hive.version} - - - geronimo-jaspic_1.0_spec - org.apache.geronimo.specs - - - - - org.apache.hive - hive-common - ${hive.version} - - - org.apache.hive.hcatalog - hive-hcatalog-core - ${hive.version} - - - xalan - xalan - 2.7.1 - - - xerces - xercesImpl - ${xerces.version} - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - ${basedir}/src/main/assembly/package.xml - - plugin - - - - - \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-mysqlreader/pom.xml b/modules/executor/engine/datax/datax-mysqlreader/pom.xml deleted file mode 100644 index fc483064f..000000000 --- a/modules/executor/engine/datax/datax-mysqlreader/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - exchangis-executor-engine-datax - com.webank.wedatasphere.exchangis - 0.5.0.RELEASE - ../pom.xml - - 4.0.0 - ${datax.engine.version} - datax-mysqlreader - jar - - - com.webank.wedatasphere.exchangis - datax-core - provided - - - org.apache.hadoop - hadoop-common - - - slf4j-log4j12 - org.slf4j - - - ${datax.engine.version} - - - org.slf4j - slf4j-api - provided - - - ch.qos.logback - logback-classic - provided - - - mysql - mysql-connector-java - 5.1.38 - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - ${basedir}/src/main/assembly/package.xml - - plugin - - - - - \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-mysqlwriter/pom.xml b/modules/executor/engine/datax/datax-mysqlwriter/pom.xml deleted file mode 100644 index 3d180f5a3..000000000 --- a/modules/executor/engine/datax/datax-mysqlwriter/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - exchangis-executor-engine-datax - com.webank.wedatasphere.exchangis - 0.5.0.RELEASE - ../pom.xml - - 4.0.0 - jar - ${datax.engine.version} - datax-mysqlwriter - - - com.webank.wedatasphere.exchangis - datax-core - provided - - - org.apache.hadoop - hadoop-common - - - slf4j-log4j12 - org.slf4j - - - ${datax.engine.version} - - - org.slf4j - slf4j-api - provided - - - ch.qos.logback - logback-classic - provided - - - mysql - mysql-connector-java - 5.1.38 - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - ${basedir}/src/main/assembly/package.xml - - plugin - - - - - \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-oraclereader/pom.xml b/modules/executor/engine/datax/datax-oraclereader/pom.xml deleted file mode 100644 index 3c86ffa58..000000000 --- a/modules/executor/engine/datax/datax-oraclereader/pom.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - exchangis-executor-engine-datax - com.webank.wedatasphere.exchangis - 0.5.0.RELEASE - ../pom.xml - - 4.0.0 - ${datax.engine.version} - datax-oraclereader - jar - - - com.webank.wedatasphere.exchangis - datax-core - provided - - - org.apache.hadoop - hadoop-common - - - slf4j-log4j12 - org.slf4j - - - ${datax.engine.version} - - - org.slf4j - slf4j-api - provided - - - ch.qos.logback - logback-classic - provided - - - org.apache.commons - commons-lang3 - provided - - - com.oracle - ojdbc6 - 11.2.0.3 - system - ${basedir}/src/main/lib/ojdbc6-11.2.0.3.jar - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - ${basedir}/src/main/assembly/package.xml - - plugin - - - - - \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-oraclewriter/pom.xml b/modules/executor/engine/datax/datax-oraclewriter/pom.xml deleted file mode 100644 index 09beff175..000000000 --- a/modules/executor/engine/datax/datax-oraclewriter/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - exchangis-executor-engine-datax - com.webank.wedatasphere.exchangis - 0.5.0.RELEASE - ../pom.xml - - 4.0.0 - - ${datax.engine.version} - datax-oraclewriter - jar - - - - com.webank.wedatasphere.exchangis - datax-core - provided - - - org.apache.hadoop - hadoop-common - - - slf4j-log4j12 - org.slf4j - - - ${datax.engine.version} - - - org.slf4j - slf4j-api - provided - - - ch.qos.logback - logback-classic - provided - - - com.oracle - ojdbc6 - 11.2.0.3 - system - ${basedir}/src/main/lib/ojdbc6-11.2.0.3.jar - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - ${basedir}/src/main/assembly/package.xml - - plugin - - - - - - \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-textfilereader/pom.xml b/modules/executor/engine/datax/datax-textfilereader/pom.xml deleted file mode 100644 index d0ada3034..000000000 --- a/modules/executor/engine/datax/datax-textfilereader/pom.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - exchangis-executor-engine-datax - com.webank.wedatasphere.exchangis - 0.5.0.RELEASE - ../pom.xml - - 4.0.0 - ${datax.engine.version} - datax-textfilereader - jar - - - com.webank.wedatasphere.exchangis - datax-core - provided - - - slf4j-log4j12 - org.slf4j - - - ${datax.engine.version} - - - org.slf4j - slf4j-api - provided - - - ch.qos.logback - logback-classic - provided - - - commons-io - commons-io - provided - - - org.apache.commons - commons-lang3 - provided - - - commons-codec - commons-codec - provided - - - com.alibaba - fastjson - provided - - - com.google.guava - guava - provided - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - ${basedir}/src/main/assembly/package.xml - - plugin - - - - - \ No newline at end of file diff --git a/modules/executor/engine/datax/datax-textfilewriter/pom.xml b/modules/executor/engine/datax/datax-textfilewriter/pom.xml deleted file mode 100644 index c4f25904a..000000000 --- a/modules/executor/engine/datax/datax-textfilewriter/pom.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - exchangis-executor-engine-datax - com.webank.wedatasphere.exchangis - 0.5.0.RELEASE - ../pom.xml - - 4.0.0 - ${datax.engine.version} - datax-textfilewriter - jar - - - com.webank.wedatasphere.exchangis - datax-core - provided - - - slf4j-log4j12 - org.slf4j - - - ${datax.engine.version} - - - org.slf4j - slf4j-api - provided - - - ch.qos.logback - logback-classic - provided - - - commons-io - commons-io - provided - - - org.apache.commons - commons-lang3 - provided - - - commons-codec - commons-codec - provided - - - com.alibaba - fastjson - provided - - - com.google.guava - guava - provided - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - ${basedir}/src/main/assembly/package.xml - - plugin - - - - - \ No newline at end of file diff --git a/modules/executor/engine/datax/pom.xml b/modules/executor/engine/datax/pom.xml deleted file mode 100644 index 24dc12e8d..000000000 --- a/modules/executor/engine/datax/pom.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - exchangis-executor - com.webank.wedatasphere.exchangis - 0.5.0.RELEASE - ../../pom.xml - - 4.0.0 - - exchangis-executor-engine-datax - pom - - 1.7.25 - 1.2.3 - 1.2.68 - 3.1.1 - 16.0.1 - 2.8.2 - 1.19 - 2.4 - 1.6 - 1.10 - 1.2 - 1.9.4 - 3.0.0-Plus-2 - - - datax-core - datax-ftpreader - datax-ftpwriter - datax-hdfsreader - datax-hdfswriter - datax-textfilereader - datax-textfilewriter - datax-elasticsearchwriter - datax-mysqlreader - datax-mysqlwriter - datax-oraclereader - datax-oraclewriter - datax-assembly - - - - - org.apache.commons - commons-lang3 - ${commons.lang3.version} - - - commons-pool - commons-pool - ${commons-pool} - - - com.alibaba - fastjson - ${fastjson-version} - - - com.google.guava - guava - ${guava-version} - - - ch.qos.logback - logback-classic - ${logback-classic-version} - - - org.slf4j - slf4j-api - ${slf4j-api-version} - - - org.apache.commons - commons-math3 - ${commons-math3-version} - - - org.apache.commons - commons-compress - ${commons-compress-version} - - - commons-io - commons-io - ${commons-io} - - - commons-beanutils - commons-beanutils - ${commons-beanutils} - - - com.google.code.gson - gson - ${gson-version} - - - commons-cli - commons-cli - ${commons-cli-version} - - - commons-configuration - commons-configuration - ${commons-configuration-version} - - - - \ No newline at end of file diff --git a/modules/executor/pom.xml b/modules/executor/pom.xml deleted file mode 100644 index 839af54ad..000000000 --- a/modules/executor/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - 4.0.0 - - engine/datax - core - - - - io.micrometer - micrometer-registry-prometheus - - - - com.webank.wedatasphere.exchangis - exchangis - 0.5.0.RELEASE - ../../pom.xml - - exchangis-executor - pom - - exchangis-executor - Unified data exchange service executor - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - none - - - - - - diff --git a/modules/gateway/pom.xml b/modules/gateway/pom.xml deleted file mode 100644 index 383b5e158..000000000 --- a/modules/gateway/pom.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - 4.0.0 - - com.webank.wedatasphere.exchangis - exchangis - 0.5.0.RELEASE - ../../pom.xml - - exchangis-gateway - jar - - exchangis-gateway - Unified data exchange service web - - - - UTF-8 - UTF-8 - 1.8 - - - - - com.webank.wedatasphere.exchangis - exchangis-common - ${project.version} - - - org.springframework.boot - spring-boot-starter-web - - - org.mybatis.spring.boot - mybatis-spring-boot-starter - - - io.springfox - springfox-swagger2 - - - io.springfox - springfox-swagger-ui - - - org.springframework.cloud - spring-cloud-starter-openfeign - - - org.springframework.cloud - spring-cloud-openfeign-core - - - - - org.springframework.cloud - spring-cloud-starter-gateway - - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-client - - - xstream - com.thoughtworks.xstream - - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.cloud - spring-cloud-starter-netflix-hystrix - - - com.github.vladimir-bukhtoyarov - bucket4j-core - 4.0.0 - - - - org.projectlombok - lombok - 1.18.4 - provided - - - - org.springframework.boot - spring-boot-starter-test - test - - - commons-lang - commons-lang - 2.6 - - - - com.github.ulisesbocchio - jasypt-spring-boot-starter - 2.1.0 - - - com.thoughtworks.xstream - xstream - 1.4.15 - - - - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - **/*.yml - **/*.properties - **/*.sh - **/*.xml - **/static/** - **.key - - - - - org.codehaus.mojo - exec-maven-plugin - 1.4.0 - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - assemble - - single - - - install - - - - false - false - - ${basedir}/src/main/assembly/deploy.xml - - ${project.artifactId}_${project.version}_1 - ${project.parent.basedir}/packages - - - - - - diff --git a/modules/gateway/src/main/assembly/deploy.xml b/modules/gateway/src/main/assembly/deploy.xml deleted file mode 100644 index 81b7daa4d..000000000 --- a/modules/gateway/src/main/assembly/deploy.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - dist - - tar.gz - - false - - - true - exchangis-gateway/lib - runtime - - - - - unix - ./src/main/bin - exchangis-gateway/bin - - **/* - - 0755 - - - ./src/main/logs - exchangis-gateway/logs - - - ./src/main/resources - - **/* - - exchangis-gateway/conf - - - \ No newline at end of file diff --git a/modules/gateway/src/main/bin/configure.sh b/modules/gateway/src/main/bin/configure.sh deleted file mode 100644 index eb013b551..000000000 --- a/modules/gateway/src/main/bin/configure.sh +++ /dev/null @@ -1,154 +0,0 @@ -#!/bin/bash -# -# Copyright 2020 WeBank -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -SHELL_LOG="${DIR}/console.out" -SERVER_NAME="exchangis-gateway" -USER=`whoami` -SAFE_MODE=true -SUDO_USER=false -ENV_FILE_PATH="${DIR}/env.properties" - -usage(){ - printf "Configure usage:\n" - printf "\t%-10s %-10s %-2s \n" --server "server-name" "Name of Exchangis server" - printf "\t%-10s %-10s %-2s \n" --unsafe "unsafe mode" "Will clean the directory existed" - printf "\t%-10s %-10s %-2s \n" --safe "safe mode" "Will not modify the directory existed (Default)" - printf "\t%-10s %-10s %-2s \n" "-h|--help" "usage" "List help document" -} - -function LOG(){ - currentTime=`date "+%Y-%m-%d %H:%M:%S.%3N"` - echo -e "$currentTime [${1}] ($$) $2" | tee -a ${SHELL_LOG} -} - -is_sudo_user(){ - sudo -v >/dev/null 2>&1 -} - -abs_path(){ - SOURCE="${BASH_SOURCE[0]}" - while [ -h "${SOURCE}" ]; do - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "${SOURCE}")" - [[ ${SOURCE} != /* ]] && SOURCE="${DIR}/${SOURCE}" - done - echo "$( cd -P "$( dirname "${SOURCE}" )" && pwd )" -} - -check_exist(){ - if test -e "$1"; then - LOG INFO "Directory or file: [$1] has been exist" - if [ $2 == true ]; then - LOG INFO "Configure program will shutdown..." - exit 0 - fi - fi -} - -copy_replace(){ - file_name=$1 - if test -e "${CONF_PATH}/${file_name}";then - if [ ${SAFE_MODE} == true ]; then - check_exist "${CONF_PATH}/${file_name}" true - fi - LOG INFO "Delete file or directory: [${CONF_PATH}/${file_name}]" - rm -rf ${CONF_PATH}/${file_name} - fi - if test -e "${DIR}/../conf/${file_name}";then - LOG INFO "Copy from ${DIR}/../conf/${file_name}" - cp -R ${DIR}/../conf/${file_name} ${CONF_PATH}/ - fi -} - -mkdir_p(){ - if [ ${SAFE_MODE} == true ]; then - check_exist $1 false - fi - if [ ! -d $1 ]; then - LOG INFO "Creating directory: ["$1"]." - #mkdir -p $1 - if [ ${SUDO_USER} == true ]; then - sudo mkdir -p $1 && sudo chown -R ${USER} $1 - else - mkdir -p $1 - fi - fi -} - -while [ 1 ]; do - case ${!OPTIND} in - --server) - SERVER_NAME=$2 - shift 2 - ;; - --unsafe) - SAFE_MODE=false - shift 1 - ;; - --safe) - SAFE_MODE=true - shift 1 - ;; - --help|-h) - usage - exit 0 - ;; - *) - break - ;; - esac -done - -is_sudo_user -if [ $? == 0 ]; then - SUDO_USER=true -fi - -BIN=`abs_path` -SERVER_NAME_SIMPLE=${SERVER_NAME/exchangis-/} - -LOG_PATH=${BIN}/../logs -if [ "x${BASE_LOG_DIR}" != "x" ]; then - LOG_PATH=${BASE_LOG_DIR}/${SERVER_NAME_SIMPLE} - sed -ri "s![#]?(WEB_LOG_PATH=)\S*!\1${LOG_PATH}!g" ${ENV_FILE_PATH} -fi - -CONF_PATH=${BIN}/../conf -if [ "x${BASE_CONF_DIR}" != "x" ]; then - CONF_PATH=${BASE_CONF_DIR}/${SERVER_NAME_SIMPLE} - sed -ri "s![#]?(WEB_CONF_PATH=)\S*!\1${CONF_PATH}!g" ${ENV_FILE_PATH} -fi - -DATA_PATH=${BIN}/../data -if [ "x${BASE_DATA_DIR}" != "x" ]; then - DATA_PATH=${BASE_DATA_DIR}/${SERVER_NAME_SIMPLE} - sed -ri "s![#]?(DATA_PATH=)\S*!\1${DATA_PATH}!g" ${ENV_FILE_PATH} -fi -# Start to make directory -LOG INFO "\033[1m Start to build directory\033[0m" -mkdir_p ${LOG_PATH} -mkdir_p ${CONF_PATH} -mkdir_p ${DATA_PATH} -if [ "x${BASE_CONF_DIR}" != "x" ]; then - LOG INFO "\033[1m Start to copy configuration file/directory\033[0m" - # Copy the configuration file - copy_replace bootstrap.properties - copy_replace application.yml - copy_replace encrypt.key - copy_replace logback.xml - copy_replace nginx -fi \ No newline at end of file diff --git a/modules/gateway/src/main/bin/env.properties b/modules/gateway/src/main/bin/env.properties deleted file mode 100644 index 796ea7d5e..000000000 --- a/modules/gateway/src/main/bin/env.properties +++ /dev/null @@ -1,15 +0,0 @@ -# environment variables - -#JAVA_HOME="" - -WEB_LOG_PATH=${BIN}/../logs -WEB_CONF_PATH=${BIN}/../conf - -DATA_PATH=${BIN}/../data -SERVER_PORT=9503 - -#PID_FILE_PATH=${BIN}/gateway.pid - -#debug -#REMOTE_DEBUG_SWITCH=true -#REMOTE_DEBUG_PORT=7003 \ No newline at end of file diff --git a/modules/gateway/src/main/bin/exchangis-gateway.sh b/modules/gateway/src/main/bin/exchangis-gateway.sh deleted file mode 100644 index 5c22a5693..000000000 --- a/modules/gateway/src/main/bin/exchangis-gateway.sh +++ /dev/null @@ -1,285 +0,0 @@ -#!/bin/bash -# -# Copyright 2020 WeBank -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -MAIN_CLASS=com.webank.wedatasphere.exchangis.WebApplication -FRIEND_NAME=EXCHANGIS-GATEWAY -if [ ! ${ENV_FILE} ]; then - ENV_FILE="env.properties" -fi -SLEEP_TIMEREVAL_S=2 - -abs_path(){ - SOURCE="${BASH_SOURCE[0]}" - while [ -h "${SOURCE}" ]; do - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "${SOURCE}")" - [[ ${SOURCE} != /* ]] && SOURCE="${DIR}/${SOURCE}" - done - echo "$( cd -P "$( dirname "${SOURCE}" )" && pwd )" -} - -function LOG(){ - currentTime=`date "+%Y-%m-%d %H:%M:%S.%3N"` - echo -e "$currentTime [${1}] ($$) $2" | tee -a ${SHELL_LOG} -} - -verify_java_env(){ - if [ "x${JAVA_HOME}" != "x" ]; then - ${JAVA_HOME}/bin/java -version >/dev/null 2>&1 - else - java -version >/dev/null 2>&1 - fi - if [ $? -ne 0 ]; then - cat 1>&2 </dev/null` - if [ "x"${pid_in_file} != "x" ]; then - p=`${JPS} -q | grep ${pid_in_file} | awk '{print $1}'` - fi - fi - else - p=`${JPS} -l | grep "$2" | awk '{print $1}'` - fi - if [ -n "$p" ]; then - # echo "$1 ($2) is still running with pid $p" - return 0 - else - # echo "$1 ($2) does not appear in the java process table" - return 1 - fi -} - -wait_for_startup(){ - local now_s=`date '+%s'` - local stop_s=$((${now_s} + $1)) - while [ ${now_s} -le ${stop_s} ];do - status_class ${FRIEND_NAME} ${MAIN_CLASS} - if [ $? -eq 0 ]; then - return 0 - fi - sleep ${SLEEP_TIMEREVAL_S} - now_s=`date '+%s'` - done - exit 1 -} - -wait_for_stop(){ - local now_s=`date '+%s'` - local stop_s=$((${now_s} + $1)) - while [ ${now_s} -le ${stop_s} ];do - status_class ${FRIEND_NAME} ${MAIN_CLASS} - if [ $? -eq 1 ]; then - return 0 - fi - sleep ${SLEEP_TIMEREVAL_S} - now_s=`date '+%s'` - done - return 1 -} - - -start_m(){ - status_class ${FRIEND_NAME} ${MAIN_CLASS} - if [ $? -eq 0 ]; then - LOG INFO "${FRIEND_NAME} has been started in process" - exit 0 - fi - LOG INFO ${EXE_JAVA} - nohup ${EXE_JAVA} >/dev/null 2>&1 & - LOG INFO "Waiting ${FRIEND_NAME} to start complete ..." - wait_for_startup 20 - if [ $? -eq 0 ]; then - LOG INFO "${FRIEND_NAME} start success" - return 0 - else - LOG ERROR "${FRIEND_NAME} start exceeded over 20s" >&2 - return 1 - fi -} - -stop_m(){ - local p="" - if [ "x"${PID_FILE_PATH} != "x" ]; then - if [ -f ${PID_FILE_PATH} ]; then - local pid_in_file=`cat ${PID_FILE_PATH} 2>/dev/null` - if [ "x"${pid_in_file} != "x" ]; then - p=`${JPS} -q | grep ${pid_in_file} | awk '{print $1}'` - fi - fi - else - p=`${JPS} -l | grep "${MAIN_CLASS}" | awk '{print $1}'` - fi - if [ -z "${p}" ]; then - LOG INFO "${FRIEND_NAME} didn't start successfully, not found in the java process table" - return 0 - fi - LOG INFO "Killing ${FRIEND_NAME} (pid ${p}) ..." >&2 - case "`uname`" in - CYCGWIN*) taskkill /PID "${p}" ;; - *) kill -SIGTERM "${p}" ;; - esac - LOG INFO "Waiting ${FRIEND_NAME} to stop complete ..." - wait_for_stop 20 - if [ $? -eq 0 ]; then - LOG INFO "${FRIEND_NAME} stop success" - return 0 - else - LOG ERROR "${FRIEND_NAME} stop exceeded over 20s" >&2 - return 1 - fi -} - -shutdown_m(){ - local p="" - if [ "x"${PID_FILE_PATH} != "x" ]; then - if [ -f ${PID_FILE_PATH} ]; then - local pid_in_file=`cat ${PID_FILE_PATH} 2>/dev/null` - if [ "x"${pid_in_file} != "x" ]; then - p=`${JPS} -q | grep ${pid_in_file} | awk '{print $1}'` - fi - fi - else - p=`${JPS} -l | grep "${MAIN_CLASS}" | awk '{print $1}'` - fi - if [ -z "${p}" ]; then - LOG INFO "${FRIEND_NAME} didn't start successfully, not found in the java process table" - return 0 - fi - LOG INFO "Killing ${FRIEND_NAME} (pid ${p}) ..." - case "`uname`" in - CYCGWIN*) taskkill /F /PID "${p}" ;; - *) kill -9 "${p}" ;; - esac -} - -restart_m(){ - stop_m - if [ $? -eq 0 ]; then - start_m - exit $? - else - LOG ERROR "${FRIEND_NAME} restart fail" >&2 - exit 1 - fi -} - -if [ ! $1 ]; then - usage - exit 1; -fi -case $1 in - start) start_m;; - stop) stop_m;; - shutdown) shutdown_m;; - restart) restart_m;; - *) - usage - exit 1 - ;; -esac -exit $? \ No newline at end of file diff --git a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/WebApplication.java b/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/WebApplication.java deleted file mode 100644 index 10beedbdb..000000000 --- a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/WebApplication.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis; - -import com.webank.wedatasphere.exchangis.common.util.ProcessUtil; -import com.webank.wedatasphere.exchangis.gateway.auth.AuthEntranceFilter; -import com.webank.wedatasphere.exchangis.gateway.auth.pwd.filters.ScriptAuthPwdFilter; -import com.webank.wedatasphere.exchangis.common.auth.AuthConfiguration; -import com.webank.wedatasphere.exchangis.common.auth.AuthTokenHelper; -import com.webank.wedatasphere.exchangis.common.auth.AuthTokenService; -import com.webank.wedatasphere.exchangis.common.auth.scheduler.ServTokenRefresh; -import com.webank.wedatasphere.exchangis.common.controller.SecurityUtil; -import com.webank.wedatasphere.exchangis.common.util.spring.AppUtil; -import com.webank.wedatasphere.exchangis.gateway.filters.CorsGatewayFilter; -import io.micrometer.core.instrument.MeterRegistry; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.FilterType; -import org.springframework.core.io.ClassPathResource; -import org.springframework.core.io.InputStreamResource; -import org.springframework.http.HttpHeaders; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; - -import java.io.IOException; - -/** - * @author davidhua - * 2018/9/21 - */ -@SpringBootApplication -@ComponentScan( - excludeFilters = { - @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes= - { - AppUtil.class, - AuthConfiguration.class, - ServTokenRefresh.class, - AuthTokenService.class, - SecurityUtil.class - }) - } -) -@Controller -public class WebApplication{ - - private static Logger LOG = LoggerFactory.getLogger(WebApplication.class); - - @Bean - public AuthTokenHelper tokenBuilder(@Value("${auth.token.secret}")String tokenSecret){ - return new AuthTokenHelper(tokenSecret); - } - @Bean - public AuthEntranceFilter authLoginFilter(){return new AuthEntranceFilter();} - - @Bean - public ScriptAuthPwdFilter scriptAuthPwdFilter(){return new ScriptAuthPwdFilter();} - - - @Bean - public CorsGatewayFilter corsHeadersFilter(){ - return new CorsGatewayFilter(); - } - - @Value("${web.server.path}") - private String serverPath; - - @GetMapping(value= {"/", "/api/v1"}) - public ResponseEntity index() throws IOException { - HttpHeaders headers = new HttpHeaders(); - headers.add("Content-Type", "text/html;charset=utf-8"); - return ResponseEntity.ok().headers(headers).body(new InputStreamResource(new ClassPathResource(serverPath).getInputStream())); - } - - public static void main(String[] args) { - String pidFile = System.getProperty("pid.file", ""); - try { - ProcessUtil.mountPIDFile(pidFile); - }catch(Exception e){ - LOG.error("Fail to store PID file in disk path: [" + pidFile +"]", e); - return; - } - SpringApplication.run(WebApplication.class, args); - } - - @Bean - MeterRegistryCustomizer meterRegistryCustomizer(MeterRegistry meterRegistry) { - return meterRegistry1 -> { - meterRegistry.config() - .commonTags("application", "WebApplication"); - //所有指标添加统一标签: application = Tenantapp - }; - } -} diff --git a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/AuthController.java b/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/AuthController.java deleted file mode 100644 index 3918908ba..000000000 --- a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/AuthController.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.gateway.auth; - -import com.webank.wedatasphere.exchangis.common.auth.AuthConstraints; -import com.webank.wedatasphere.exchangis.common.controller.Response; -import com.webank.wedatasphere.exchangis.common.util.json.Json; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.cloud.gateway.route.RouteLocator; -import org.springframework.http.HttpHeaders; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.Map; - -/** - * Authentication related method - * @author davidhua - * 2018/10/18 - */ -@Controller -@RequestMapping("/") -public class AuthController { - - private static final Logger logger = LoggerFactory.getLogger(AuthController.class); - @Resource - private RouteLocator routeLocator; - - @Value("${sso.logoutUrl}") - private String ssoLogoutUrl; - /** - * To destroy 'sso cookie' - */ - @RequestMapping(value="/api/v1/logout", method = RequestMethod.POST) - public ResponseEntity ssoLogout(){ - // To destroy SSO cookie(token) - logger.info("Destroy the SSO token"); - HttpHeaders httpHeaders = new HttpHeaders(); - httpHeaders.add("Set-Cookie", AuthConstraints.DEFAULT_SSO_COOKIE+"=\"\"; Max-Age=0; Path=/; HTTPOnly"); - httpHeaders.add("Content-Type", "application/json;charset=UTF-8"); - Map body = new HashMap<>(10); - //Jump other url(Login page) - body.put("redirect", ssoLogoutUrl); - return ResponseEntity.ok().headers(httpHeaders) - .body(Json.toJson(new Response<>().errorResponse(302, body, ""), null)); - } - -} diff --git a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/AuthEntranceFilter.java b/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/AuthEntranceFilter.java deleted file mode 100644 index 017e94459..000000000 --- a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/AuthEntranceFilter.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.gateway.auth; - -import com.webank.wedatasphere.exchangis.common.auth.AuthConstraints; -import com.webank.wedatasphere.exchangis.common.auth.AuthTokenBean; -import com.webank.wedatasphere.exchangis.common.auth.AuthTokenHelper; -import com.webank.wedatasphere.exchangis.common.controller.Response; -import com.webank.wedatasphere.exchangis.common.util.json.Json; -import org.apache.commons.lang3.StringUtils; -import org.reactivestreams.Publisher; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.cloud.gateway.filter.GatewayFilterChain; -import org.springframework.cloud.gateway.filter.GlobalFilter; -import org.springframework.cloud.gateway.filter.NettyWriteResponseFilter; -import org.springframework.core.Ordered; -import org.springframework.core.io.buffer.DataBuffer; -import org.springframework.core.io.buffer.DataBufferFactory; -import org.springframework.core.io.buffer.DataBufferUtils; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseCookie; -import org.springframework.http.server.reactive.ServerHttpResponseDecorator; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import javax.annotation.Resource; -import java.net.InetAddress; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.Map; - -import static com.webank.wedatasphere.exchangis.common.auth.AuthConstraints.DEFAULT_SSO_COOKIE; - -/** - * Entrance filter: - * 1)Log request information - * 2)Intercept the login request and modify the response entity - * 3)Intercept the request of refreshing token - * @author davidhua - * 2020/4/2 - */ -public class AuthEntranceFilter implements GlobalFilter, Ordered { - - private static final Logger LOG = LoggerFactory.getLogger(AuthEntranceFilter.class); - @Value("${sso.loginUrl}") - private String loginUrl; - - @Value("${server.port}") - private Integer serverPort; - - @Resource - private AuthTokenHelper tokenBuilder; - - @Override - public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { - LOG.info(Json.toJson(exchange.getRequest(), null)); - if(exchange.getRequest().getPath().value().equals(loginUrl)) { - DataBufferFactory bufferFactory = exchange.getResponse().bufferFactory(); - ServerHttpResponseDecorator responseDecorator = new ServerHttpResponseDecorator(exchange.getResponse()) { - @Override - @SuppressWarnings("unchecked") - public Mono writeWith(Publisher body) { - if (body instanceof Flux) { - Flux fluxBody = (Flux) body; - return super.writeWith(fluxBody.map(dataBuffer -> { - byte[] content = new byte[dataBuffer.readableByteCount()]; - dataBuffer.read(content); - DataBufferUtils.release(dataBuffer); - if(getStatusCode() == HttpStatus.OK) { - String jsonStr = new String(content, StandardCharsets.UTF_8); - try { - Response> response = Json.fromJson(jsonStr, Response.class, Map.class); - assert response != null; - if(response.getCode() == 0) { - Map jsonMap = response.getData(); - String loginId = jsonMap.getOrDefault(AuthConstraints.X_AUTH_ID, ""); - if (StringUtils.isNotBlank(loginId)) { - AuthTokenBean tokenBean = new AuthTokenBean(); - tokenBean.getHeaders().put(AuthConstraints.X_AUTH_ID, loginId); - tokenBean.getHeaders().put(AuthConstraints.HOST_PORT, - String.format("%s:%s", InetAddress.getLocalHost().getHostAddress() , serverPort)); - tokenBean.getClaims().putAll(jsonMap); - String token = tokenBuilder.build(tokenBean); - addCookie(ResponseCookie.from(DEFAULT_SSO_COOKIE, token) - .path("/").httpOnly(true).secure(false) - .maxAge(Duration.ofDays(1)).build()); - LOG.info("Add token: " + token.substring(0, 6) + "**** to login response"); - } - } - } catch (Exception e) { - LOG.error("Generate Token Fail: [" + e.getMessage() +"]", e); - //Ignore - } - } - //Just trainst data - return bufferFactory.wrap(content); - })); - } - return super.writeWith(body); - } - }; - return chain.filter(exchange.mutate().response(responseDecorator).build()); - } - return chain.filter(exchange); - } - - @Override - public int getOrder() { - return NettyWriteResponseFilter.WRITE_RESPONSE_FILTER_ORDER - 1; - } - -} diff --git a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/TokenController.java b/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/TokenController.java deleted file mode 100644 index b766e2ac3..000000000 --- a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/TokenController.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.gateway.auth; - -import com.webank.wedatasphere.exchangis.common.auth.AuthConstraints; -import com.webank.wedatasphere.exchangis.common.auth.AuthTokenBean; -import com.webank.wedatasphere.exchangis.common.auth.AuthTokenHelper; -import com.webank.wedatasphere.exchangis.common.auth.exceptions.ExpireTimeOutException; -import com.webank.wedatasphere.exchangis.common.util.json.Json; -import com.webank.wedatasphere.exchangis.gateway.auth.cas.CasSessionStorage; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.annotation.Resource; -import java.io.UnsupportedEncodingException; -import java.util.List; -import java.util.Map; - -/** - * @author davidhua - * 2018/10/30 - */ -@RequestMapping("/token") -@Controller -public class TokenController { - private static final Logger LOG = LoggerFactory.getLogger(TokenController.class); - @Resource - private AuthTokenHelper tokenBuilder; - @Resource - private WhiteList whiteList; - - @Resource - private CasSessionStorage storage; - - @Value("${auth.token.session-in-minutes:30}") - private Long sessionInMinutes; - - @RequestMapping("refresh") - public ResponseEntity refresh(@RequestParam(AuthConstraints.TICKT_REFRESH_PARAM)boolean ticketRefresh, - @RequestParam(AuthConstraints.DEFAULT_SSO_COOKIE)String token){ - Map claims = tokenBuilder.getAuthMessage(token); - if(ticketRefresh) { - String ticket = claims.getOrDefault(AuthConstraints.TICKET_NAME, ""); - if (StringUtils.isBlank(ticket) || !storage.exist(ticket)) { - return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(null); - } - }else{ - try { - tokenBuilder.validate(token, sessionInMinutes); - }catch(ExpireTimeOutException e){ - LOG.info("Token Session expired: " + token.substring(0, 6) + "****"); - return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(null); - } - } - Map headers = tokenBuilder.getAuthHeader(token); - AuthTokenBean tokenBean = new AuthTokenBean(); - tokenBean.setClaims(claims); - tokenBean.setHeaders(headers); - try{ - String newToken = tokenBuilder.build(tokenBean); - LOG.info("Refresh TOKEN: " + newToken.substring(0, 6) + "****"); - return ResponseEntity.ok().body(newToken); - } catch(UnsupportedEncodingException e){ - return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null); - } - } - @RequestMapping(value = "/serv/refresh", method = RequestMethod.POST) - public ResponseEntity servRefresh(@RequestParam(value = AuthConstraints.TOKEN_REFRESH_ID)String id, - @RequestParam(value = AuthConstraints.TOKEN_REFRESH_PWD)String pwd){ - List allowedUris = whiteList.getList(id, pwd, null); - if(allowedUris.isEmpty()){ - return ResponseEntity.status(401).body(null); - } - AuthTokenBean tokenBean = new AuthTokenBean(); - Map headers = tokenBean.getHeaders(); - headers.put(AuthConstraints.ALLOWEDURIS, Json.toJson(allowedUris, String.class)); - try { - String token = tokenBuilder.build(tokenBean); - LOG.info("Refresh SERVICE-TOKEN: " + token.substring(0, 6) + "****"); - return ResponseEntity.ok().body(token); - } catch (UnsupportedEncodingException e) { - return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null); - } - } - -} diff --git a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/TokenSecretEncoder.java b/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/TokenSecretEncoder.java deleted file mode 100644 index ee5d45a94..000000000 --- a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/TokenSecretEncoder.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.gateway.auth; - -import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; -import org.jasypt.encryption.pbe.config.EnvironmentPBEConfig; - -/** - * @author davidhua - * 2018/10/16 - */ -public class TokenSecretEncoder { - - public static String encode(String password){ - StandardPBEStringEncryptor standardPBEStringEncryptor = - new StandardPBEStringEncryptor(); - EnvironmentPBEConfig config = new EnvironmentPBEConfig(); - config.setAlgorithm("PBEWithMD5AndDES"); - config.setPassword("bdp"); - standardPBEStringEncryptor.setConfig(config); - return standardPBEStringEncryptor.encrypt(password); - } - -} diff --git a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/WhiteList.java b/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/WhiteList.java deleted file mode 100644 index 1a4b3c2da..000000000 --- a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/WhiteList.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.gateway.auth; - -import com.webank.wedatasphere.exchangis.common.util.CryptoUtils; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -import java.util.*; - -/** - * @author davidhua - * 2018/11/3 - */ -@Component -@ConfigurationProperties(prefix = "auth.token") -public class WhiteList { - private List whiteList; - public List getList(String id, String pwd, String address){ - pwd = CryptoUtils.md5(pwd, id, 2); - for(Pair pair : whiteList){ - if (pair.id.equals(id) && pair.pwd.equals(pwd)) { - if(!pair.address.isEmpty()){ - return pair.address.contains(address)? pair.allowedUris : Collections.emptyList(); - } - return pair.allowedUris; - } - } - return Collections.emptyList(); - } - - public List getWhiteList() { - return whiteList; - } - - public void setWhiteList(List whiteList) { - this.whiteList = whiteList; - } - - public static class Pair{ - private String id; - private String pwd; - private List address = new ArrayList<>(); - private List allowedUris = new ArrayList<>(); - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPwd() { - return pwd; - } - - public void setPwd(String pwd) { - this.pwd = pwd; - } - - public List getAddress() { - return address; - } - - public void setAddress(List address) { - this.address = address; - } - - public List getAllowedUris() { - return allowedUris; - } - - public void setAllowedUris(List allowedUris) { - this.allowedUris = allowedUris; - } - } - -} diff --git a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/cas/CasSessionStorage.java b/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/cas/CasSessionStorage.java deleted file mode 100644 index f581222d5..000000000 --- a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/cas/CasSessionStorage.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.gateway.auth.cas; - -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.Weigher; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; -import org.springframework.web.server.WebSession; - -import java.util.concurrent.TimeUnit; - -/** - * @author davidhua - * 2018/10/18 - */ -@Component -public class CasSessionStorage { - private static final Logger LOG = LoggerFactory.getLogger(CasSessionStorage.class); - private static final Integer GB_PER = 1000000; - private Cache cache = CacheBuilder.newBuilder() - .maximumWeight(GB_PER).expireAfterAccess(1, TimeUnit.DAYS).weigher((Weigher) (key, value) -> 5).build(); - public void addSession(String ticket, WebSession session){ - if(!session.isExpired()){ - if(null == cache.getIfPresent(ticket)) { - if(LOG.isInfoEnabled()){ - LOG.info("Store CAS session, CAS ticket: "+ticket+", sessionId: "+session.getId()); - } - cache.put(ticket, session); - } - } - } - - public boolean exist(String ticket){ - return null != cache.getIfPresent(ticket); - } - public WebSession removeSession(String ticket){ - WebSession session = cache.getIfPresent(ticket); - if(null != session){ - if(LOG.isInfoEnabled()){ - LOG.info("Remove CAS session, CAS ticket: " + ticket); - } - cache.invalidate(ticket); - } - return session; - } -} diff --git a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/pwd/AuthPwdController.java b/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/pwd/AuthPwdController.java deleted file mode 100644 index bc894ae7d..000000000 --- a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/pwd/AuthPwdController.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.gateway.auth.pwd; - -import com.webank.wedatasphere.exchangis.common.util.AESUtils; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.util.FileCopyUtils; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -import java.io.BufferedReader; -import java.io.FileInputStream; -import java.io.InputStreamReader; -import java.util.Base64; -import java.util.Map; - -/** - * @author davidhua - * 2019/4/30 - */ -@RequestMapping("/pwd") -@Controller -public class AuthPwdController { - @Value("${auth.script.secret-key}") - private String secretKeyPath; - - private static final String ENCRYPT_PWD_KEY = "src_pwd"; - private static final Logger LOG = LoggerFactory.getLogger(AuthPwdController.class); - - @RequestMapping(value = "/encrypt", method = RequestMethod.POST) - public ResponseEntity encrypt(@RequestBody Map map){ - String srcPwd = map.get(ENCRYPT_PWD_KEY); - if(StringUtils.isBlank(srcPwd)){ - return ResponseEntity.status(403).body(""); - } - String encryptPwd = ""; - try { - String keyContent = FileCopyUtils.copyToString(new BufferedReader - (new InputStreamReader(new FileInputStream(secretKeyPath)))); - if(StringUtils.isNotBlank(keyContent)){ - encryptPwd = AESUtils.encrypt(srcPwd, Base64.getDecoder().decode( - keyContent)); - }else{ - return ResponseEntity.status(500).body(""); - } - }catch(Exception e){ - LOG.error(e.getMessage()); - return ResponseEntity.status(500).body(""); - } - return ResponseEntity.ok(encryptPwd); - } -} diff --git a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/pwd/filters/ScriptAuthPwdFilter.java b/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/pwd/filters/ScriptAuthPwdFilter.java deleted file mode 100644 index 395349521..000000000 --- a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/auth/pwd/filters/ScriptAuthPwdFilter.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.gateway.auth.pwd.filters; - -import com.webank.wedatasphere.exchangis.common.auth.AuthConstraints; -import com.webank.wedatasphere.exchangis.common.auth.AuthTokenBean; -import com.webank.wedatasphere.exchangis.common.auth.AuthTokenHelper; -import com.webank.wedatasphere.exchangis.common.util.AESUtils; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.server.reactive.ServerHttpRequest; -import org.springframework.util.FileCopyUtils; -import org.springframework.web.server.ServerWebExchange; -import org.springframework.web.server.WebFilter; -import org.springframework.web.server.WebFilterChain; -import reactor.core.publisher.Mono; - -import javax.annotation.Resource; -import java.io.BufferedReader; -import java.io.FileInputStream; -import java.io.InputStreamReader; -import java.util.Base64; -import java.util.Objects; - -/** - * @author davidhua - * 2018/11/12 - */ -public class ScriptAuthPwdFilter implements WebFilter { - private static final Logger LOG = LoggerFactory.getLogger(ScriptAuthPwdFilter.class); - @Resource - private AuthTokenHelper tokenBuilder; - - @Value("${auth.script.secret-key}") - private String secretKeyPath; - - @Override - public Mono filter(ServerWebExchange exchange, WebFilterChain chain) { - HttpHeaders headers = exchange.getRequest().getHeaders(); - if(headers.containsKey(AuthConstraints.SCRIPT_ACCOUNT_NAME) && - headers.containsKey(AuthConstraints.SCRIPT_PWD_NAME)){ - String userName = String.valueOf(Objects.requireNonNull(headers.get(AuthConstraints.SCRIPT_ACCOUNT_NAME)).get(0)); - String pwd = String.valueOf(Objects.requireNonNull(headers.get(AuthConstraints.SCRIPT_PWD_NAME)).get(0)); - LOG.info("start to validate script auth, user:" + userName +", pwd:*****"); - try { - String keyContent = FileCopyUtils. - copyToString(new BufferedReader(new InputStreamReader(new FileInputStream(secretKeyPath)))); - if(StringUtils.isNotBlank(keyContent)){ - pwd = AESUtils.decrypt(pwd, Base64.getDecoder().decode(keyContent)); - } - String umPwd = pwd.substring(userName.length()); - //TODO Use Feign to do login - boolean loginResult = true; - if(loginResult) { - AuthTokenBean tokenBean = new AuthTokenBean(); - tokenBean.getHeaders().put(AuthConstraints.X_AUTH_ID, userName); - String token = tokenBuilder.build(tokenBean); - ServerHttpRequest request = exchange.getRequest() - .mutate().header("Cookie", AuthConstraints.DEFAULT_SSO_COOKIE + "=" + token) - .header("X-Requested-With", "XMLHttpRequest").build(); - LOG.info("Add sso cookie to script request"); - return chain.filter(exchange.mutate().request(request).build()); - } - }catch(Exception e){ - LOG.info("Basic authenticate failed in script request, username: " + userName + ", message: " + e.getMessage(), e); - } - exchange.getResponse().setStatusCode(HttpStatus.UNAUTHORIZED); - return Mono.empty(); - } - return chain.filter(exchange); - } - -} diff --git a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/filters/CorsGatewayFilter.java b/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/filters/CorsGatewayFilter.java deleted file mode 100644 index 28781f674..000000000 --- a/modules/gateway/src/main/java/com/webank/wedatasphere/exchangis/gateway/filters/CorsGatewayFilter.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * - * Copyright 2020 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.webank.wedatasphere.exchangis.gateway.filters; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpStatus; -import org.springframework.http.server.reactive.ServerHttpRequest; -import org.springframework.http.server.reactive.ServerHttpResponse; -import org.springframework.web.server.ServerWebExchange; -import org.springframework.web.server.WebFilter; -import org.springframework.web.server.WebFilterChain; -import reactor.core.publisher.Mono; - -import java.util.List; - - -/** - * @author davidhua - * 2018/9/28 - */ -public class CorsGatewayFilter implements WebFilter { - - private static final Logger LOG = LoggerFactory.getLogger(CorsGatewayFilter.class); - @Value("${cors.switch}") - private boolean open; - - @Value("${cors.origin}") - private String origin; - - @Override - public Mono filter(ServerWebExchange exchange, WebFilterChain chain) { - if(open){ - ServerHttpResponse response = exchange.getResponse(); - ServerHttpRequest request = exchange.getRequest(); - HttpHeaders headers = response.getHeaders(); - List origins =request.getHeaders().get("Origin"); - String host = origin; - if(null != origins && !origins.isEmpty()){ - host = origins.get(0); - } - - headers.add("Access-Control-Allow-Origin", host); - headers.add("Access-Control-Allow-Methods", "POST,GET,OPTIONS,DELETE,PUT,GET"); - headers.add("Access-Control-Max-Age", "3600"); - headers.add("Access-Control-Allow-Headers", "x-requested-with,Content-Type,Origin"); - headers.add("Access-Control-Allow-Credentials", "true"); - if(exchange.getRequest().getMethod() == HttpMethod.OPTIONS){ - if(LOG.isDebugEnabled()){ - LOG.debug("Get HttpMethod 'OPTIONS', enable Cross-Domain"); - } - response.setStatusCode(HttpStatus.OK); - return Mono.empty(); - } - } - return chain.filter(exchange); - } -} diff --git a/modules/gateway/src/main/resources/application.yml b/modules/gateway/src/main/resources/application.yml deleted file mode 100644 index f2bf9053a..000000000 --- a/modules/gateway/src/main/resources/application.yml +++ /dev/null @@ -1,87 +0,0 @@ -server: - port: ${server.port} - tomcat: - basedir: ${data.path}/tomcat/gateway -jasypt: - encryptor: - password: bdp - -cors: - switch: true #switch - origin: "*" - -sso: - logoutUrl: / - loginUrl: /api/v1/auth/login - -auth: - token: - secret: ENC(doiaIecpZ6QpeVvqcayuWuuWC1C5Nf1V) - session-in-minutes: 1440 - whiteList: - - id: exchangis_executor - pwd: d0026ed6c07cad6fbe0287c48ed376f4 - allowedUris: - - /api/v1/report/add - - /api/v1/jobtask/notifyJobComplete - - /api/v1/jobtask/notifyTaskTimeout - - /api/v1/exec/node/regiseter - - /api/v1/exec/node/heartbeat - - /api/v1/admin/datasource/view - - /api/v1/datasource/kb - - /api/v1/datasource/key - - id: exchangis_service - pwd: 6341e6dfb5ff3ad32d04a1fe4e555144 - allowedUris: - - /api/v1/executor/run - - /api/v1/executor/log - - /api/v1/executor/kill - - /api/v1/executor/alive - - /api/v1/datasource/kb - - /api/v1/datasource/key - - /api/v1/executor/env/user - script: - secret-key: ${user.dir}/conf/encrypt.key - -web: - server: - path: /static/index.html - -spring: - application: - name: exchangis-gateway - cloud: - gateway: - discovery: - locator: - enabled: true - routes: - - id: c_exchangis_service - uri: lb://EXCHANGIS-SERVICE - order: 0 - predicates: - - Path=/api/v1/** - filters: - - StripPrefix=0 - - AddResponseHeader=Cache-Control, no-store - -eureka: - instance: - prefer-ip-address: true #IP - client: - serviceUrl: - defaultZone: ${EUREKA_SERVICE_URL} - - -management: - metrics: - export: - prometheus: - enabled: true - endpoints: - web: - #http暴露所有监控项 - exposure: - include: '*' - #uri,可自定义 - base-path: /actuator \ No newline at end of file diff --git a/modules/gateway/src/main/resources/bootstrap.properties b/modules/gateway/src/main/resources/bootstrap.properties deleted file mode 100644 index 7c4f69d03..000000000 --- a/modules/gateway/src/main/resources/bootstrap.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Eureka -EUREKA_SERVICE_URL=http://127.0.0.1:8500/eureka/ \ No newline at end of file diff --git a/modules/gateway/src/main/resources/encrypt.key b/modules/gateway/src/main/resources/encrypt.key deleted file mode 100644 index 159af3693..000000000 --- a/modules/gateway/src/main/resources/encrypt.key +++ /dev/null @@ -1 +0,0 @@ -wDvuB3UroxbXa9TcuGyH+Q== \ No newline at end of file diff --git a/modules/gateway/src/main/resources/logback.xml b/modules/gateway/src/main/resources/logback.xml deleted file mode 100644 index 03df64e1c..000000000 --- a/modules/gateway/src/main/resources/logback.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - ${CONSOLE_LOG_PATTERN} - - - - - - ERROR - DENY - ACCEPT - - - ${log.path}/exchangis-web.%d{yyyy-MM-dd}-%i.log - 30 - - 10MB - - - - ${FILE_LOG_PATTERN} - - - - - ERROR - ACCEPT - DENY - - - ${log.path}/exchangis-web-error.%d{yyyy-MM-dd}-%i.log - 30 - - 10MB - - - - ${FILE_LOG_PATTERN} - - - - - - - - diff --git a/modules/gateway/src/main/resources/static/css/app.c7e943de.css b/modules/gateway/src/main/resources/static/css/app.c7e943de.css deleted file mode 100644 index 31b06652b..000000000 --- a/modules/gateway/src/main/resources/static/css/app.c7e943de.css +++ /dev/null @@ -1,18 +0,0 @@ -@font-face{font-family:Ionicons;src:url(../fonts/addiconfont.dc4f4b98.eot);src:url(../fonts/addiconfont.dc4f4b98.eot#iefix) format("embedded-opentype"),url("data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAChYAAsAAAAARdgAACgIAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCGPAr5FNsMATYCJANgCzIABCAFhG0Hgi4b1DVFB3LYOABYZF6X7P/DcceECg8UDRbOhmM2BiwUasEx4il9cNk6uDF9smDZwYKyKRLYpNZz1Wz7bFjmN9kPJQT2V4dS8vD9fv9b+1x5IpK+WlemkwjRLCVSIXRCJhOZ+ZrJf4Dm1t3ubtn0CpAQRo6Uba4YCKNCGbWB9ABHPYwwklHaGCiKiYLRqJiPjVEY75dv5vO/czZkdTLCDOXUMdsr/cBemjRUElKc0ECD7zRf2lhqhwLDwcDQjgADA+Zn/9q/gtgp3jnc4/IBUOz8vzSHPkdA3dYpROX8+L/9fefX9zOJvTMLIIlVla3DaZDXF/fL/7lpX9L0gMjdbTNySgIL4VgK7gECANP/v87XVQoAbKgSDkt+1nYc9CTXX0/vfbiGNM/QHMsh2QVLISlIU4En4LnDomc4x3JIUgidogo0tRvgiFu3DtOU061rp67d5+qmGkv/JGphHYP5IKefl+DvO7pipaQRa1W7cbePT6BuzRP46vT6udKRs/TAOp8Z8SsdLi2XTA7V/lJwyJweVohqWpjGAPCTffvxDG4LLCApMsBq+/rtSVTZv8M9Xre8WEDmZC3Ij8E8FBkOAHLSVFiOPsjFB4zURW7YHQDs4ZE/t/rdxYZdQUpFy8grJqMuT7Eqw+8H3t+vvPx1/5MAqA33LJw7QrEnrGcLe/Zwz4W9RPH/wgN0DGA1jSGS0hBBWw9G6CMZgU3g1HVBRAlg7SbEBr1/ArjDrW+iwx3pJgaAO/pNVLljgyaoHXRh6ghQgAoAEuhUgBLUC2AIKgFogIYDtEE1AD3QXIAKaB5AgBZDVydaBdACHQYYgR4AyEHf4yYmgHsFqDGqBKiDlgN0QddBvVzyTLeHOAH4B4DhJQAmHytW3y/mbmirKcRahlka4m+tbQ1VNZLLNC5oAEP0nGxtKMx1VglFjRpg9YIc9QofCmtSLuZTjOllMtbacLahyvzcBRdcMsmLCaWv5PlN71OrXMnKDBnhok0hF6orO1eX1Ngp1ZQcGd/8z2iIgkqj2iB6CNeSr+nZNlRj2IiOHWEJg3KQvLOBSaVTWM1sqIGzAcuYO24IQuNqVE0loMgrR2tCGg6r7eeG1AdHJctTz+4h2gQbSHbotm5zfbjBx18x5N3lWdEVY0UQ8hCuHeCcGoCkYGN/bMBDO1xEr7Upn67NOGm611hXqnVcrHthl6Gs/bFsI/QqquBYh4ohgCCWnWoZVW4oxXIDqmqNHZa1A/VEsfSt7ChkbkBA+iVkEQzjN+K4If4bcxQptlUSD+VGBQTSd8GSShECuJTmMhAIPYivw7rOKgW4495k17sxqKG0OEy3aZx8yJFSYSuLsOMdt4IprihFBCnh6o3oswE3wcJRFXJgOl+HhNjfURgLtodhcGp+7SA1iwpmjDzznfYhM5o/4UU5BRwPfDuvLQnyXXmAcXzYQSXFWURFfbI6ntNbzq8ZuyHk9JehqAsvLHtdqDmWYCU7UJX/6TjugG9efhG88FK1BMpV+ImvV3UK4VW+rrTi7ltLQvGqfDQtS1L6fjgO0FAUVgIHjc6Gb/CprwbDSaB3YUf0skwcGCxz6AAzwmi8u4oxlbA7dy+VFEgg/44O2Ssb4MRN1cTdPsjtLLI7+un2lFnqnojChYFpTVHdR/TTeQTktnqwafSZ7hFhb8PKQW5KrWrncI8UyjXwcQXXFKedG00THEhW5lnxJ+1aO25aBQWpjTlZl00MfHVbsdSaWKV2gdRmW7fo3L2S3jk3epxCYk7fWJddUtmg2x+UCSWOaJLModL9SrEIqTbtmK3JCruLKbbjqeaiUdtkmlKzJTWTVF8YUYm2NwXd67qfxNWxXCOpiJPTiXjQkpRKmm2442/DnK5FBRrw++7SkPWrk5Fds/GIatiLO5QH0QpPafy2AnkeNWjz1Y9UF55vbHSeaH8fddm5iS7fOUH7TZZ6Ct3NIVOKLXuK3XTT+vvUPAqYaqJIEAECKilBgnYgp6EYM2VCJY5tJiM7cJautxgRNZKu5rrnyilTkOpYZhwPJGaf5dzMyUppIXHTnNtnZJRrpoh6O8gVw5NrYXjb0Mbv0SYQTK3AR6t2d7hAx8jOi3Od4R/169vzwCfDG/vpI2xvP820mHOANXcOQt/HuDVoXqn1jRAg2W2JNaOySlZOpg1Sc+fubNi6zutrLSzpGRtbo2VrHgBBRjJz3ahs9bju2RsGujprerxx2CHdxs7VtRnPzZqwbq9+tuHu56HJgTb3YBERbZIJM5kyqtmYoVDdJiIvK2G63uK+ypgPPaZbPN3hpYX1APHjbJ+9vcs+c4NIqKSjj0tyhVqI7fff3/IXVq25Jg1tSaevzv0ZtM8OmRcPeJXi9Yku69obbtbpZE6fQL4nKNO87laDDl28R7HrlSAsWL1XSXFawpgowYiVFJtcPYnjFt43L2WsORFCUeM/odpj5t8hA2v/kBSKchCY4yMCfmD6Xunea4wdfrW1tG3n7WljUaPrbuwcdGluO527M74mtWzWoEs9A5p2gUfdhmtWTdylaiT56XrW9R7qLnsFyZOqszZpVxWP9elpsdWUV7JtBkhM2fh2fGXiRGiAk89a/swNq1u1UdkZN4Sk6/anWkdtWvMtlTXXKFabMqdBUnMy557Fh1TaeKdmj1ynmEr57Xbv+sd7B21oy6DRyBWN7aYgglCXENmiIstqRFLNNec1Q+L6pF860jGm2tc9rmM6vnK8r97Yrza951bUxhq+Yo0N9tg2r2l1j1iJK6kkY313bZGIdsa6N6V+222hJWAtu2aXoGJkqLForeHN39XsJOcaq0AFH5eCbVFzjzLUvOffmrw1tkLIaKc5FyJSTLF08uNoxY+vpFUK1j4dlTWnWtMRnqu6MGuPBGXFyVuqG+zT1N/UvPn9AwSt1UfWKgRwtewKKglWCTD4FBTyIf6t+3/zbN9dmelrLgRLMogt9uEOccWke6c82FoYxJ7Yx6SV6tz2O1/OOU770rDwVutFc76/EiRUiKbGkwiUMQkkkdS1JwqQC76WpD1flYLUNo702bAkpHt/zufFLLGrsYwkNTr+C+ppxirZolHXWNN32kWyYKaCx2b6hvG800hoJ5/bw6q+5lqxAyxZjnNYX2QLhh7PKYznWK23unuSsjFaLk8OlHuKijVyKKnNXrPpaF9TzZpFtDzndjZV5W5JMm5OWCplPqs3kVtpOoIQ3SoL4Ygmc6X/VM0QYsQe8JRSVx7Ve2+4JwSpc92ggPKSahIhgNYV3aIi4aTl380U0injzdkyUU3EpCSCsAsu9SsqEpJrqstaQ4WYEFL+QJdyPLrYF9LLDuemguHpPNM5nlA3C6atbwi2LciO25jzU2vHWru5bK2Zc8z2TWYj7RlHZIRErDkiZoyx3NFZZ8pxKuWVz+37mrd8IUi3pZLpa2mkdTk0/IXnnxf9qFJMKa158x7E5ALPABRbXU4rhR2XSs4jwZpdZmmNXclNSee22kt56ix/eSBZ5vF6ytTGshTzCJU0ySWyBr8W1ZrLBNTGjJld5tkx72of0KqUvSBGdWggNpmjktJO33ogybonnGqztbnA3HTdzcQsuSNziuPMsnSNhVLW3ZOxy4b1DdfHrlty7s47Kw8MtnXn9S06k5wmllx5XLHp6iSBTEHZwKrLJgqp2iHXOOyaLyxxpjqhc+6RSY0QMUZq4xSGnN/eLJM21zBsKFhdZZgnxfq2SZN5y/epYmP5ulqbiGQOiZliDV/TxunXQ5fGjwZB8Ggfp/s7CoE83L8NCoZy+s9X8dy05wzDKL8ShZWh/hUMD2b7ZGy4YEcnOR4yc3p62TMDPs/Alxvu88NiptZGl0WPyiD1nn95o2P+gWDYRUNRGwDUkYIOvjTuhd3fsm3B9nhnuKMUde+qoYP29x7kXDNLKeIwWyvmNQlBQR09QvkGYspxBAAm8RBcgkpKgSPerhtI6gIibKaU3KfXRZcrseYcm9E3xFpDG1Osc9Y4rJrbdcZgsAOEWt1wBxGEjBKPsTI1CTPMFWgVUy9lwmyOqQ7jq+6Cd3ONCmLcpUDZEYrcaryyPsb11CCszH1KyLPfCSrtHFNifAgZUwgRxjULvdUEIIiFbVVcUylCYM5KZUErYzSPS6FiXr0NqJmVUOkmIUy8j1A2SyFFnO6YRzwVkTIFJOqo4VhGCuMPMVCIemfXY9QzJZacA0qY6oZENydTIlckOv0ATg8g8jANCYIarTZNrbjARyJS6dwXcwxkmdhqlfLZk4GPq6N8PpJzo2y6wDlefXTgHGUHBAIQCmAjEVYGSSQQKsZAkUJGnvPrvpVCBSExYKghQQOGNhXAY42pgWOJaZ6Q0e0qGkgAoFdGrmLqpZmIJZaB+PuyO7TPBcl29/LWTvvCdMcfgTjpf/cUvDDU+PJYgm9QkDTiVh2m3ahdDhzu56FIBBIPx1qp0pDQxXQbkfXPSyLFoC5yNQouvfAS8HhEPDqT1pH0AiF+Wxy9FBmIkp/6sJgKJ5YPeJIiBwWfXjCQ74OKYEJ8Pq9osXZQ208NU300e/p++2/ct3NwSzP3rC9uyPhBA4UD/vJGH+gW0T4Rkmtk0vAztDS+L57MrJE4uccE43A5w9fsgXXXAwhg741ANF4IJFSVk1j74E0nMJcIxdYAkJx9pIrxh/Va9QxEEg4YviEJqycAx0qkAEiojoneMK6gVi4Spu9ORV5yYpoxHVh5TETsP2EL1s/zGNi8o+/ZAAA8/y8ngcTC8ExX0pZnLyL2q+Rr8IuWCpiwuDZ2ivDwDqeHFVM599c09m+3BdfsiP24UhcFvnr9+PPEW38m3fk75fZfNQOHrr6h6pREJI0Wnzwba+13dKaNqX5Y1OKjU7MVhAsDPFk4dxTTI8waps0oq/3daPSu4KDxac15Y6cEcnRGe/7kWXH2DXnIMKAhJXtAZaPVg6N828C+ZXmxXcoug3urWTof76v6zni7ieNGEtQyBZ9mGtZb+G9t6x6dWzlBx2MTyDpKGGP9pPIS0w42jebvisiIIO19zvU3qTpHY0YtuiVQduBLZ9/XZMvXhHWteW9VCqFqMjVhpWdtZcJWUN3jffGLtK7XPV9zvpdDY2n0wc6oNL9YlAzZOkT37CzCXpRaxq4V5HV0i98F53frkfawcL+yPiTtYe1sbjUcbBHzj7IRIegy7Kul1ofx3S2rklrfCUJ1Okspfr94z2wGq1Om6svOR6VFDNLzflhd2ljfTDUe+fuSSwJfcBFEGO6uguHeGH77BzGLomXLTwbRYMqbP1Y6f8IwaCypeR3TUV0U6eDm38idayQgqCKAweRaL28VVhUZEc4+L6ayYwRvwXJJmRjXG8NM3W9GAkgKMDQqqhIJ4h1vs4qiRQCCJRe3ejZMl0uBIEjdzgg++bGZuoEE4G+VEYLETxR8umlar3NdZ2z9TekR8IgQKGIFaqKosxjZ9kRF6m3rZyRdt1uR4OrkEE03zVxMWDg6tapoBktRNqiMwZDTypqK32szHsMC60raudOVtIHjgWvEmGkp8thNwMoeMLEgRhyjO2HryfQGMLVWPTF7x+ykDlD0HG6y7up6r+m4kVbWQald4b3re25MDyeW7n328OydQ6lvKVZ09VYV9FMUnAy8LEjMA05JnZXIcEfurgCPy8b1AeinZ0oMvxVq2PLBu3XTrZIeYWPb80jONiAQKtCPCKzl/RVJBSm99NjXjC0k3cwplw6ojarXw3WdO8r33B0vjfKJM/B8/nkcNTBu1S3lftMfTmUkPeE71IwWkX2eZI0mWG9Kxq05D6IBngx1c3TLfKPJFBfFzyaCCBJxIskKtoMnk7whCCb3H1Q2u1uAQ8p+04LD6hagyWtQM/+wqiOfcNOamgfaxjlkR40EUt9L+JIPqaBmBpacTKH4O2giZZhVlJX6uBJ2i/FJkoGqrbcJy1stHhbncSPrAq79ljOcBKn3oWqT1lKzHqzqb1cT0AIcVi+oKvBnuMGEUSj5SEo7aAVPpkByTIHsUzp7PHU0q4UJSPVa3/YQ3AsbZW+szX289/oQWqowtTQ5DlJA2vaoyFf2hCdEdRpVGyg1E41or5+cn5iRt4RRB7BAWAD60BdAhbRiwluCN3GyPUmcmidqybLQwTcghShuD6WlQUaggOLZzvBNFHb40oAThOGmNHjIUzcBd5MiaiHp3cRNoHh3EiFpbcSdpAfj++mnsw+kUdGiDJ9uzEh87z8zc+3B0l+Hg2f15rhtAu4kRez3HE34sJclGXmrP8DIYEXNTooEfnjEiJ4FP08CIpO996YCghnx4FsHV+fjyshUlrYoWQP8sIcx8+CfqPzQA4KxkFdBnR/innAIEHpq2IEwjSIlKWhERqY3IpXo0OQGlq8HvIwsqQHOVKoPoXjw9GmVa8P2N2itDWqVrNHu+/ZuuC90X73aWp/aD+r3qUKLceavxwZ2b/2aeXi+MHs7e+r82ffGE/PyC1TKidvA4zSAJ+WtWdbqEQch6+Qfqj15ElXc3l7cGmoj9PqnvfRc6iYFpkyrMKPn7S6zp//SaTRII1jdvrOSfa85otvv9T2Wf6/mYV4SnIK3AQKsl3ihmDYF6EZWRjtZyZZcjCsXk2vqyMFIJBeLEwRpI371d0LlAKxSSXVKFRNApzv1SkxaDqjm10syuNE8gcYs0ElZJyhOLsjOcZyqdWmep8hhJ9CkiWFytQE010iHeIPZoO0fMntveUMovB14z8/4BQaiE6sQ0ZKo/8AMQkKnu9kS15fPJrHnDfWWD2QU37jouGggCbtvYXKpnWx30zVycpe572DvtgrXlI4UuOp6+SmICsSSzFmFQyjUDeoArsTlArbMNEepyu9pyMnrfqM93derY5M5yqx1VV1ppIxD4Kc0eHqTrR/TDoOHwI+BY5HFx40XmGNj8PPRur9mrs2kzDosIiMxjouXt8PhSI352ImHCf6UaLz0fdIQKBty0gFMvph7SQtHSp5+vFPb9u88cGmwr+WTJGSLwjokuh2daCMCG2KQkGL/xnbOvRQFa8g0OxrJZmnQPBRJYCsg7o6wylqv0Uhskl6PyCbSMreQ6MQyolQre66CFeGr3xfzIXMuUohS0L3+ixe4Q2tP/uvIBpOWLyYjff5JJFxaQEF+IB1icfVuhtlZSn9u94p8LM2Xk2ZIvVidXVvxNCU+NW9+G/7K6TDczkZ36YOdPti/WqvjW7AjrZVbcmrmHpo1a/z2Fb4LKgFmGwILqj0PfDsfF2DrlJ+VdGxtqoUHhM8V4pSXoyyNfCUhDrs26BdByW+0/BqJUWMw9fb1T3PyNUyPzk5Jbw3UpzvTFEm3cpqAabO5NqvCClSZrU7ykLS4qSlpbZI73M1pAK7NtmPFBEgCnfiDsTx+dEY0zjcMCX6aDW9R4xleBY5K/2/8RbE1KWv66a5eq8MLpuMRIUx5QZQAay+WfyE52W00bYzqg8pOnGkc+/XjWrdT8jrx30RKQFOQ5KrrwFbX6oRuv9CTbIYwfsPdc8GxfqoXqNSGlHE97Xidfz+3JNCjexWU0rqlnI/KauyPX9QQmDC7336wMjOhC4vOKzkwb/AK9QA/Uvbf+taAUc9L/UHp56IvxkjYU5p6w7bhAphMk+Yhauu9YrM7DR/MFRv9kcJanMyRVSsetV1WMHvcGBuSYypbb//YNclkfXJYZ5+9HMyE9bFGBFfr64vowJcU5og2hEZdtqovdtc55q8vIrl5TLU0Z31fqBuKOiWNSj301xkRPo6Q2XvdbRn3hdMBeUefyhOuXDm8eVf422Q811whpcJYrluUopAtxqKCUh71xmJ9o15gwTjrb3uuAZN8VzuP3Ve9f04rDdmv0Xgs+b1awBveK1kb4cVW1i7ynPDW8PtkX67np/otWhNt1p9oYT19X/d07MPmCUFshfx4lxxbPvVSbYCU3r+L0aYmlGudNekr+H7Wo3Ho1OquNvf6v9WFuq98Xuwg30kQK4jOqN878G5DTj53wqG91JTrHmscn13Q5D4srmVOI8jqCmFnI8DRhoCfmDWZ9/ppYxoTIvK3WRm+rikIPSXmQnTRuSn9Fz1GWwOtD7Qy6jnqycG9QwdmVaK/tOVm7jXZHUjn80sWKRJ6ZjXyIf1wK5y8rTss4Ddcv9+iXfSs5+oGVOp/gbG+wbfudsQL3U9E7Svvlldzth7mjKglTQFkc8/fEb1OSZtHCK8flN08mYXqC9toGrQn8wHlYpqE9IIKiaQ2CQXhaxxc+Su3q2pdMQsF/3jHQtlgZvZy8UUGXt2DZD8NRkL9hI7ZlyLatuXCnsldHfJzTi+4vW4QtGvzjg7Rmb8PUqlT0sRu34u56xvic3fF9q1aBvI0AacYFMvfJJT4rg1ikHgrDY9C11eobB7O1wH9Mx8E5hPyA8czjhA3N+BBAOa+2/1p/g+JINJMkYg4c6zgQUGw1cY+2J4d4ntjAaFQ3iDWbEiEh7ia5TGRM3dsW8UISp5aQCirDq02hn2p2f1VbyEq2URZXDRwWW5y0Sa9JNeap5VZCTmNaXxbt6kzC50aylNbEz7rwxAyAcYg8eIX7U2+QRDwPgHGrs3dpH4st5O5NI76L5bTE75LVHYuRFaEIjhiVq2P2E4lrH91tVW75LVPvNXe+Qt2MaoZdGQfobtuxHEQD6ZcxDrT3oAaHawgz0mxHSxUqFrJUIZnQXQTbVFvvF2mtHf1L30qQxdmKPR+Om/fWQEOWZ8qvL59SpyP0hhxJCxVmjHlqLTQ9lK5zY20Waqv7PhkPzDLAtv5bZyb55slbBSjddWX7xvVf6plHknPzL9bp6DaEr5yBvfxwaWxOJdoUH8+v8x4MVcSwjNRLVfhocvp0qYIGqOM2dIWwA57XPCpJOmI8zOukd26tX/1qh35zFOFmpmhsifUb88X3pldRxVbKje9nrPxDXVoCG0q7cuTnqHOi0Ie/YlqB3wAtC9wKVi6cagT9FHSbs4z7nOKwzEIG/nNIhrTTfdDj+21ZZCUjrwkK1zPADkQA62juTEH0R7ltApHHQEv1qJEOxB21quFYjng0WyfMp3+3CBMfnbrgo+NG6+Iurhh17pF8WGvQuu4u1Hc5Xp+5yb9yhtz/9bF+xd8+v/oQLiKttfBlzMyiLaGsHuj4ha7qI7mn+4qGZzB4EtPPXl6jdZ2qi+fwzgoesFIy3AfXBk2ueQVMXGM018ut9yS5iA5+vcKmqv0w6mOIUjfdU2/bYT4RBrXcsanMoHFvv/x5gcxOCg7JvT/5hKPVFiat0XffajsCNYjTSRRy5Y3evObbCuDBZS3v8qesYBCoPJhI3+6f5mTlioe/HDkulUJsS7PU//4lI9ED/w+52bxx3pl6fwgDcnt1meMq78qSwozuGPxG7DKE/q5ENIlnp7iz78p8epYvzlKNOfdU8Egb++IFRx5NZBT6OvOBvIVNOdRwd7xGMdYpYtwrl7kTDFgssuTyNWBK/mPPy2+nvNJOw/wmoqOY6KpG7QtFI1z7Sn3O6ix5LyBzzM2ypT+pg/U/yTywjSexDVCMokhBwACAhMge3bw/XmRDBgX2dfz1bbgWNeZU33u9+ZfuPKvneDW/WLBgdtRM8Qea+i29YLr6At5jBl08bJk/hrgqd4yJMn2jIzKum2sU7YK9i5KK6EkB2V7SvYvtJMnVyyVC4tnC6dLq+4vxTNfFywiPa9QiNyUMW5KhajiT5qqMzKSphpmqjqZqv1U1W1I5lJQKphucZCmlaD6EhqSTXbyhRahvHg2EHLG4qnTaBApWqOO88xWq9nSQLUGOIH9xfbkvuFIMb90nuWPEeSM/xiLTCU7kwEy6xLVn+dH/U714/mHbLBS/Wn+NH+qTRbVn+fH8+MlUmbLkZ+/sdXnk8bj1fyqwEb/YvTaK4gCM4B2wK7CMJGJJejiKhypim8mVU4/74oO5k0iT5SvRtN4ymXIL0Gp+pz65nQ1PS+gUdRgwrZCV9EK7GGdQ/kqrAi5KvyU11A5za9KoI5/rjyvP/QTSRcTxiFoEZvjhg5x745UrRhIzV0xu6p7MnK0r7xTRqow6fvGI69259WNzlE2dKu1r7e6h6DdmaTYXQmNJr2MVHfXGRO31latmIwc79N3xpEqOvV9myK7qwpXzAvY3qlF3BKtRduwSOtjrpnDzOHGMKNjBd3gbHvP6zm5CZrjC0LYYiG1vzSb6TZ+fvD08z4tqFqUG5yMUGADbA+ZGS0yGr5C8DzhRsBogGfcRegZtgbNRa/U0SBHPowEjvrTYQJHMEdEqYyWv0WuQk6Y+WguphYdCz2lw/r4hkQPPxOfKadIRllhPi9QSedgOOiFmOWXEjwDdG6/iGqKTjjNGoO8sJqAPSMadF0A63LPoyPpm/z8xH4NQiEsXQ51wvkwdU1P13pCA4OodYBsKsynIMmwJ8osBGDseYHsc6qlbfRpERYzuKit0EY4GaaiEody47ZcVW8yeuAzcsorR92uVstSzLmp5mpO+sNud8NZ/CgHI3Gr/pnMrDIHzDOnyExjajM+Ax9lKq/sTLnaI1OrFbvPjhw77WYexZ91RUvcq35qXauNqrnGvS0CBMWCRN9Ep+QKhVZuxnajclAIH8NHWCATq1amVdA5A1vlLhALhQiwfDTCoFwrzM6dCn6TzIwfRcVDCA2ryTgDmUItj2bSlZuZ5hwOyhmF0JEZHrRkXjJ/fYIUKf4h8xHzMnMMCIKKgEEhPhkvHEQroLIHtwMP4HfgkrW2ncenEoejuFHDRNQClwUeLz7ikDD0uoUuCz3+FTum7evB76SOYWfjY5Rj2Ls91h20wHOBo9jbQk8gpLz2b8IE/jh+gp3VzUPzhrrdILvxjwh/Ex7hD+MnLsydQ3jEniDgdRPsR/ht30nvjhD2ayMjDKgFC1CtGTeC4svQDGhn3KMDi4pQcShdUbEOjAsoBnfVoiL07ZRchqTgnGJISqFCiicw+dGi1WIx2ihLeW3M4Wq1ktu81yq7doddqU26p8HXsSndoBLE1rrC5Votl5OjKppHYbD9QWp/4Il7G339+OkydaJzVoIzQ7ZG5iCNRhkrnlYpj1JPCKNHAZMMphlgNGg0gUm+qKTy8RakA4/X8xRgaiqosFhGQQFaOJ5TVrkBY8EYyp882TzSYpGneDyWHf3tHVtQeLK+SdCbWlV7uij8SYwiGeIdeASPh+xvTw4qsToBWMgiteD9NgAb/PAW6XJ5EEB6sQ5w/Q7keHvvGdOEf7CrqVFslSqJFo4UCNd/+ptmoJ1b38OO6VrsyjkrT4b8TTNSL9Dygb+BfNoFgVDT58SpakgC12JoifaH9uqr+Ifrqs5g0G3t2roDVvkX5hNMG9vHpLIHkoAtQLLAQNtCy6fW0ZKBzdzczTQDtcLcAiQJ8sUeBoAHWe7BPB7c2r2NoPqjkLsOUtfBY/D37zC0Ywuhl35wT/5J44aZcKTnW2ZObfMN+nKlSngj7VlJCLvvGtFIETgIKDHHambQVYvY8a9lmRy3GUGUf3sde/91JG8OQK6kswlJ9jvtDHh2msgPOgf7iZ47C+FzkJ8I9Zq+SrSKXqCd4ytSyDA3rWHHHQ6FsYA+SAod5qQ3bL/DptJXqTwYCsQZLHU5TxU7r5eaAGraw1Oj6maOTxufWUsuuWN3p4S8kv3lAZJNbWNPi1DPkM67hTidXVRdql/+s68+fZE8r8ceC+sULt7T1kr2DsP8OUeWeqg1w6Gl4b+8ru1Wu/InqU/2NFjjQOyLaF+MdN2jlCAUlut1tlC9fpxmC/6DTtVtt/otEKeL1BVRKkIrY1c/Q+pfd7HMS47puuzbLOa/Pj3gu6FyQ1gXNOvqmdKHrwkjmx2T10XccaAElEvUVzlHtrlULSpvcxVhCBI2nr8dzTfwB5hanPI8i75rkfAAtsQltHsA1n6dsoktK9eUTE8/YGfaOzO39Qu6auaBOa9e54rCLsQEoYOa1oXHafgzkebUy7T+iyVmN3qIluNjDIDJVXiZFzM6Dbs3GevGDdKQ3OZSi+cbbfS7bfYecCak945dJt+uNnn1CoHr1DUibjL1BentCQD5GUEkP79Q2O1pNtKjxjOOXrrU6gQMxiDy6Mwp7w5uEncl4+8Nx62X88I6Txviu2xVV9bOs3Tw/y/lZKaHyi2Nf/DOTZEPJ4Pgdtfp/zWNFb2pKuYe8n+AR24jQ0dDotA03YNPuEu8TuAG8ECdsZTEFmZEj/Nb3OmMttxqm0XnuF3ze3Ljh54Qnpnk/wWkSZ/b82isxH48wlTGHcTVfqaQlpsyPWN5sTqXYy1bnYLWuq4N4q1Yk5IxteOG1UbjOhIu2PSxGKHlYTs7OoyPKngMfybnYyMGb0j0PY4bw5NHnShOo2TcMVw+cRIrQuyJlMSQ01wK9xyHUn7GMolm/1Dxv6LNOqvOjNQjZjTbAT7u8RBxYKPN6HogVJZXZz1wFgYE0O43pbhD3EXHp7FAV1r7w8+RfNsNE8YuCHsnW1IhdKYIipIfJC1mWbU1WDAWX2C88duJKnY1FqgiZaxs8U2v0sjTId33626+LJCkRDCYDX9rJStRoGBH4ZD5J0cxfnl1HQPxQcCztZ6VgmdPfKhTZXZLNnC0cof0ruO27fxo8e9R0zeSQNG/ktA6xkUN7nPXp88sPJHtem5bgXbOvAoMa3zNtpONZ5MSaITTIvb4Hx2Wd0ly4XxfmspKeu7bHeen3Vl46FahOncB4XFJODVhfB2PaTd5pfLGhpag6ugjtt82dXQy4KcjLi50YvHiUIdV1/0gCK8p3fdjoBk73oAmgG4JAuaK+QdLdmhjZtiowZgpS1oYwRgeAkvtYkXUAJRA0doY66tMlFpx8vgskmuoDPyZOFWcbLsKaPCtCLp56souVhJuFqsmm8NlfV7ftuLfUysS25BnzriK8xtTU4CmyT0DvFhMQBZtdnKoZu5Wb6BZ+SYYEM29Ct2BZuSbu8rP3e4AxJ57wmlI3ugKDEO6ye+TLZXJ8jXQLTq1Ja+5PUagIst8p6AqwCplFtQkqW7wBNKXPXQyv9oYrVyBsZAOs6HDUBO+UEZf0P9MNJuO84tM/DYO+2+Gf61Y8TetmwyVT/P6VVQllh4lKf8PAfl1ifDR+5W0MtP8oyi/Zsn1gf7wU3/8fx3oWLQ7RC1t/jQLxDcT6vbD+D+IpX0TdeobKSf+M6Rv5EtJxUrKVG2I+fADqdBwIZWqLqW6ferDNwyY1EWOA9gzV5NC1x4pafstZboui/nwR1Jh7JVU6gYk1b0JRsCGrSjsTdfgW4hQUCAWSoG92PacdR+BOO7rYJLNeQVt2Aq0vumW/QfPQIDOw8ekZGMtRljLGJ1qJwacS5RouYPQLqi1yXZ582ci30Uo40rPLQ347Pb6ESRHcedCIUnAz271Qt/8I0A4nE9Ldvh551dAM1ge8fn3lB0qiGdEKO2wLu5KKWKjijAMrTfXpBiiIgxwuyoh5eJGOyBkLRSkMBNb3uRABlWyKL8vPieI0bdTq/MxXFGSFVXT6X97GrvRZLZYbXaH0+X2eH2h9wcTpKTOF6R1p/2Qw97x4/FTwASXpARBOIv2N9Rp1yqkINS1dwyiiA2aN4VRvBlvT354wn1jWWjA1yFt0gibdeNnKUQOfSoNcmbTY1JSXc6aGkTmRsJPxwh3HhmdJeWMOlYcuh+DKJ1KelCGEgHSSpBeN2W0JUyEU5tGidaGwTZp0FJTFQAAAAA=") format("woff2"),url(../fonts/addiconfont.aa9cec27.woff) format("woff"),url(../fonts/addiconfont.fed05cb5.ttf) format("truetype"),url(../img/addiconfont.d327a749.svg#iconfont) format("svg")}.iconfont{font-family:Ionicons!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-xingzhuang:before{content:"\e664"}.icon-Oracle:before{content:"\e622"}.icon-DRDSbinlogzengliangshuru:before{content:"\e79d"}.icon-yonghu:before{content:"\e6b6"}.icon-jiedian:before{content:"\e61e"}.icon-Mysql:before{content:"\e62d"}.icon-mysql:before{content:"\e663"}.icon-Elasticsearch:before{content:"\e612"}.icon-hdfs1:before{content:"\e744"}.icon-Hive:before{content:"\e745"}.icon-ElasticSearch:before{content:"\e637"}.icon-xitongguanli:before{content:"\e616"}.icon-renwu:before{content:"\e674"}.icon-navicon-dsrwpz:before{content:"\e63d"}.icon-huiyuanfenzuguanli:before{content:"\e609"}.icon-ziyuanguanli:before{content:"\e770"}.icon-renwu1:before{content:"\e648"}.icon-fenzu:before{content:"\e66c"}.icon-ziyuan:before{content:"\e60d"}.icon-renwu2:before{content:"\e62e"}.icon-hdfs:before{content:"\e6b4"}.icon-sftp:before{content:"\e61b"}.icon-hive:before{content:"\e6f2"} - -/*! - * Copyright 2019 WeBank - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */.layout-left-logo img{display:none}.layout-left-logo p{font-weight:700;font-size:20px}.ui-modal-dialog{overflow:visible!important}.breadcrumb{padding:15px!important;border-bottom:1px solid #d7dde4;position:relative;margin-bottom:0}.button-row{padding-top:15px!important;padding-left:15px!important;padding-bottom:10px!important}.page-loc{text-align:center;margin:15px;justify-content:center}.loading-w{text-align:center;margin-top:30px;margin-bottom:30px}.form-inner-panel{margin-top:20px;margin-bottom:6px;height:100px}.loading-position{margin-left:50%}.last-loading{margin-top:10px}.next-button{margin-left:80px}.custom-input{padding-top:3px}.layout-left{width:240px!important}.layout-right{position:absolute;left:240px!important;right:0;top:0;bottom:0;min-width:1150px}.layout-right .layout-right-body{overflow-y:hidden}.layout.layout-left-hidden{left:-240px!important}.full-height{height:100%;overflow:auto}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb,::-webkit-scrollbar-track{box-shadow:inset 0 0 2px rgba(0,0,0,.2);-webkit-box-shadow:inset 0 0 2px rgba(0,0,0,.2);border-radius:8px;-webkit-border-radius:8px;-moz-border-radius:8px;-ms-border-radius:8px;-o-border-radius:8px}::-webkit-scrollbar-thumb,::-webkit-scrollbar-thumb:window-inactive{background:#cdcdcd}.page-pagination{position:absolute;left:50%;bottom:20px;z-index:10px;transform:translateX(-50%)}.icon-plus{padding:3px}.mask[data-v-f7578088]{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.6);z-index:999;overflow-y:auto}.mask .modal-content[data-v-f7578088]{position:relative;background-color:#fff;border-radius:8px;padding:6px 15px;margin:auto;margin-top:10%}.mask .modal-content .modal-header[data-v-f7578088]{height:50px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #e3e8ee}.mask .modal-content .modal-body[data-v-f7578088]{padding:12px 0;min-height:60px;padding-bottom:42px}.mask .modal-content .modal-footer[data-v-f7578088]{position:absolute;bottom:0;left:0;width:100%;text-align:center;padding-bottom:10px}.mask[data-v-74ad308b]{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.6)}.mask .sub-loading[data-v-74ad308b]{position:absolute;top:40%;left:50%;margin-left:-25px}.main[data-v-17eccd81]{background-color:#f7f7f7;height:100%;overflow:auto}.main .header-bar[data-v-17eccd81]{height:95px;padding:0 30px;font-size:18px;background-color:#fff;box-shadow:0 0 5px 0 rgba(0,0,0,.2);display:flex;flex-direction:column;justify-content:center;align-items:flex-start}.main .header-bar .header-title[data-v-17eccd81]{color:#000}.main .header-bar .header-des[data-v-17eccd81]{font-size:14px;padding-top:15px}.main .main-content[data-v-17eccd81]{width:97%;margin:0 auto;background-color:#fff;margin-top:25px;padding-bottom:25px;border-radius:10px;box-shadow:0 0 5px 0 rgba(0,0,0,.2);min-height:80%;position:relative}.main .main-content .top-bar[data-v-17eccd81]{padding:25px 25px;border:1px solid #e8e8e8;display:-webkit-flex;justify-content:flex-start;align-items:center}.main .main-content .top-bar .margin-left[data-v-17eccd81]{margin-left:40px}.main .main-content .template-lsit[data-v-17eccd81]{padding:25px 30px;display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.main .main-content .template-lsit .template-item[data-v-17eccd81]{width:23.5%;height:185px;border-radius:8px;margin-right:2%;margin-bottom:2%;border:1px solid #e8e8e8;transition:transform .15s linear,box-shadow .2s linear}.main .main-content .template-lsit .template-item[data-v-17eccd81]:hover{box-shadow:0 0 5px 0 rgba(0,0,0,.2);transform:translateY(-3px)}.main .main-content .template-lsit .template-item[data-v-17eccd81]:nth-child(4n){margin-right:0}.main .main-content .template-lsit .current-item[data-v-17eccd81]{display:flex;flex-direction:column;justify-content:space-between;align-items:center;overflow:hidden}.main .main-content .template-lsit .current-item .item-content[data-v-17eccd81]{width:100%;flex:1;display:flex;justify-content:center;align-items:flex-start;padding:20px}.main .main-content .template-lsit .current-item .item-content .icon-box[data-v-17eccd81]{flex-basis:60px}.main .main-content .template-lsit .current-item .item-content .icon-box .icon-bar[data-v-17eccd81]{display:inline-block;line-height:55px;width:55px;height:55px;color:rgba(0,0,0,.5);border-radius:50%;background-color:#e8e8e8;text-align:center;font-style:normal;font-weight:800;font-size:10px}.main .main-content .template-lsit .current-item .item-content .icon-box .icon-bar[data-v-17eccd81]:before{font-size:40px}.main .main-content .template-lsit .current-item .item-content .icon-box .template-type[data-v-17eccd81]{display:block;font-size:14px;text-align:center;margin-top:10px;max-width:60px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.main .main-content .template-lsit .current-item .item-content .content[data-v-17eccd81]{flex:1;margin-left:20px;position:relative;height:100%;overflow:hidden}.main .main-content .template-lsit .current-item .item-content .content .name[data-v-17eccd81]{font-size:15px;color:rgba(0,0,0,.8);max-width:100%;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.main .main-content .template-lsit .current-item .item-content .content .params[data-v-17eccd81]{margin-top:10px;max-width:100%;display:inline-block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.main .main-content .template-lsit .current-item .item-content .content .content-footer[data-v-17eccd81]{position:absolute;left:0;bottom:0;width:100%;display:flex;justify-content:space-between;align-items:center}.main .main-content .template-lsit .current-item .item-option[data-v-17eccd81]{flex-basis:46px;background-color:#fafafa;width:100%;box-sizing:border-box;padding:10px 0;display:flex;justify-content:space-around;align-items:center;font-size:14px;color:rgba(0,0,0,.45);border-top:1px solid #e8e8e8}.main .main-content .template-lsit .current-item .item-option .delete[data-v-17eccd81],.main .main-content .template-lsit .current-item .item-option .detail[data-v-17eccd81],.main .main-content .template-lsit .current-item .item-option .modify[data-v-17eccd81]{cursor:pointer;flex:1;text-align:center}.main .main-content .template-lsit .add-item[data-v-17eccd81]{display:flex;justify-content:center;align-items:center;font-size:14px;cursor:pointer}.main .modal-select[data-v-17eccd81]{width:85%}.main .parameter-item[data-v-17eccd81],.margin-bottom[data-v-78d99f2e]{margin-bottom:10px}.margin-bottom .icon-plus[data-v-78d99f2e]{cursor:pointer}.margin-bottom .text-dec[data-v-78d99f2e]{text-align:left;margin-left:5px}.display-none[data-v-78d99f2e]{padding-bottom:0;display:none}.float-right[data-v-78d99f2e]{float:right;margin-right:25px}.template-selecct[data-v-78d99f2e]{width:70%}.refresh[data-v-78d99f2e]{padding:3px 6px;margin-right:10px;color:#39f;cursor:pointer}.create-template[data-v-78d99f2e]{color:#39f;cursor:pointer}.main[data-v-c91c522c]{background-color:#f7f7f7;height:100%;overflow:auto}.header-bar[data-v-c91c522c]{height:95px;padding:0 30px;font-size:18px;background-color:#fff;box-shadow:0 0 5px 0 rgba(0,0,0,.2);display:flex;flex-direction:column;justify-content:center;align-items:flex-start}.header-bar .header-title[data-v-c91c522c]{color:#000}.header-bar .header-des[data-v-c91c522c]{font-size:14px;padding-top:15px}.main-content[data-v-c91c522c]{width:97%;margin:0 auto;background-color:#fff;margin-top:25px;min-height:500px;border-radius:10px;box-shadow:0 0 5px 0 rgba(0,0,0,.2);overflow:hidden;padding-bottom:65px;position:relative}.main-content .top-bar[data-v-c91c522c]{padding:25px 25px;display:flex;justify-content:flex-start;align-items:center;border-bottom:1px solid #e8e8e8}.main-content .top-bar .data-source[data-v-c91c522c],.main-content .top-bar .query-button[data-v-c91c522c]{margin-left:40px}.main-content .add-button[data-v-c91c522c]{padding:20px 0 0 0}.main-content .add-button .button[data-v-c91c522c]{width:100%;border-style:dashed}.main-content .lists-bar[data-v-c91c522c]{padding:0 25px}.main-content .lists-bar .list-item[data-v-c91c522c]{display:flex;justify-content:flex-start;align-items:center;padding:15px 0;border-bottom:1px solid #e8e8e8}.main-content .lists-bar .list-item .item-icon[data-v-c91c522c]{height:55px;border-radius:50%;color:rgba(0,0,0,.5);background-color:#e8e8e8;flex-basis:55px;line-height:55px;text-align:center;font-style:normal;font-weight:800;font-size:10px}.main-content .lists-bar .list-item .item-icon[data-v-c91c522c]:before{font-size:30px}.main-content .lists-bar .list-item .item-col[data-v-c91c522c]{display:flex;flex-direction:column;justify-content:space-around;align-items:flex-start}.main-content .lists-bar .list-item .item-col .project-name[data-v-c91c522c]{padding:0 10px;background-color:#f98;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:90px;border-radius:5px;color:#f7f7f7}.main-content .lists-bar .list-item .item-name[data-v-c91c522c]{flex:3;padding:0 15px}.main-content .lists-bar .list-item .item-name .title[data-v-c91c522c]{font-size:15px;color:rgba(0,0,0,.8)}.main-content .lists-bar .list-item .item-name .desc[data-v-c91c522c]{font-size:14px;margin-top:6px;color:rgba(0,0,0,.45)}.main-content .lists-bar .list-item .createUser[data-v-c91c522c],.main-content .lists-bar .list-item .Owner[data-v-c91c522c],.main-content .lists-bar .list-item .time[data-v-c91c522c],.main-content .lists-bar .list-item .type[data-v-c91c522c]{flex:1;padding:0 15px;font-size:14px;color:rgba(0,0,0,.45);line-height:25px}.main-content .lists-bar .list-item .option[data-v-c91c522c]{flex:1;display:flex;justify-content:space-around;align-items:center;color:#39f;cursor:pointer;box-sizing:border-box}.main-content .lists-bar .list-item .option .text[data-v-c91c522c]{flex:1;text-align:center;font-size:14px}.main-content .lists-bar .list-item .option .line[data-v-c91c522c]{color:rgba(0,0,0,.3);padding:0 5px}.group-box[data-v-0303e37c]{height:100%;overflow:auto}.group-box .group-header[data-v-0303e37c]{height:70px;line-height:70px}.group-box .group-header .header-item[data-v-0303e37c]{text-align:center}.group-box .group-content[data-v-0303e37c]{margin-top:15px}.group-box .group-content .groupPagination[data-v-0303e37c]{text-align:center;padding:15px 0}.detail-box[data-v-e5677446]{height:100%;padding:20px;overflow:auto}.detail-box .group-detail-form[data-v-e5677446]{width:90%;margin:0 auto}.detail-box .detail-header[data-v-e5677446]{height:70px;display:flex;justify-content:space-between;align-items:center}.detail-box .detail-save[data-v-e5677446]{text-align:center}.detail-box .group-user-panel[data-v-e5677446]{margin-top:20px}.detail-box .group-user-panel .ui-panel-content[data-v-e5677446]{padding:0}.detail-box .group-user-panel .group-header[data-v-e5677446]{height:70px;line-height:70px}.detail-box .group-user-panel .group-header .header-item[data-v-e5677446]{text-align:center}.detail-box .group-user-panel .group-content .group-pagination[data-v-e5677446]{text-align:center;padding:15px 0}.help[data-v-686be216]{width:100%;height:50%;display:flex;flex-direction:column;justify-content:center;align-items:center}.help h1[data-v-686be216]{margin-bottom:10px}.help .goto-detali[data-v-686be216]{font-size:16px;font-weight:600}.stander-height{height:32px;padding:3px;line-height:30px}.btn-wrap{text-align:center;margin-top:50px}.button-row{margin-bottom:20px}.left-list-wrap{padding:10px;border-right:1px solid #ddd;overflow:auto}.project-right{overflow:auto}.ul-style{border:1px solid #ccc;padding:10px;height:500px;margin-top:10px;overflow-y:auto}.list-title{margin-top:20px;margin-bottom:10px;position:relative}.query-btn{margin-left:10px}.single-list{height:25px;line-height:25px;cursor:pointer;padding-left:5px}.single-list:hover{background:#ccc}.three-part-btn-wrap{margin-top:20px}.project-add-btn{position:absolute;top:0;right:0;padding:3px 5px;color:#39f;cursor:pointer;font-size:10px}.component-button{padding:0 5px}.search-bar{padding-left:15px}.udes-login[data-v-247e3fe6]{background:url(../img/login.2270163f.svg) 50% no-repeat;height:100%;width:100%;position:fixed;top:0;left:0}.login-content[data-v-247e3fe6]{width:400px;border:1px solid #eee;position:absolute;top:30%;left:50%;margin-left:-200px;padding:20px 40px;text-align:center;background-color:#fff;border-radius:5px}.login-content .sys-title[data-v-247e3fe6]{color:#39f}.main[data-v-1613cddb]{background-color:#f7f7f7;min-height:100%}.header-bar[data-v-1613cddb]{height:95px;padding:0 30px;font-size:18px;background-color:#fff;box-shadow:0 0 5px 0 rgba(0,0,0,.2);display:flex;flex-direction:column;justify-content:center;align-items:flex-start}.header-bar .header-title[data-v-1613cddb]{color:#000}.header-bar .header-des[data-v-1613cddb]{font-size:14px;padding-top:15px}.main-content[data-v-1613cddb]{width:97%;margin:0 auto;background-color:#fff;margin-top:25px;min-height:500px;border-radius:10px;box-shadow:0 0 5px 0 rgba(0,0,0,.2);overflow:hidden;padding-bottom:65px;position:relative}.main-content .top-bar[data-v-1613cddb]{padding:25px 25px;display:flex;justify-content:flex-start;align-items:center;border-bottom:1px solid #e8e8e8}.main-content .top-bar .data-source[data-v-1613cddb],.main-content .top-bar .query-button[data-v-1613cddb]{margin-left:40px}.main-content .add-button[data-v-1613cddb]{padding:20px 0 0 0}.main-content .add-button .button[data-v-1613cddb]{width:100%;border-style:dashed}.main-content .lists-bar[data-v-1613cddb]{padding:0 25px}.main-content .lists-bar .list-item[data-v-1613cddb]{display:flex;justify-content:flex-start;align-items:center;padding:15px 0;border-bottom:1px solid #e8e8e8}.main-content .lists-bar .list-item .item-icon[data-v-1613cddb]{width:50px;height:50px;border-radius:50%;color:rgba(0,0,0,.5);background-color:#e8e8e8;flex-basis:50px;line-height:50px;text-align:center}.main-content .lists-bar .list-item .item-icon[data-v-1613cddb]:before{font-size:30px}.main-content .lists-bar .list-item .item-col[data-v-1613cddb]{flex:2;display:flex;flex-direction:column;justify-content:space-around;align-items:flex-start;padding:0 15px}.main-content .lists-bar .list-item .item-col .title[data-v-1613cddb]{font-size:15px;color:rgba(0,0,0,.8)}.main-content .lists-bar .list-item .item-col .desc[data-v-1613cddb]{font-size:14px;margin-top:6px;color:rgba(0,0,0,.45)}.main-content .lists-bar .list-item .createUser[data-v-1613cddb],.main-content .lists-bar .list-item .Owner[data-v-1613cddb],.main-content .lists-bar .list-item .time[data-v-1613cddb],.main-content .lists-bar .list-item .type[data-v-1613cddb]{flex:1;padding:0 15px;font-size:14px;color:rgba(0,0,0,.45);line-height:25px}.main-content .lists-bar .list-item .option[data-v-1613cddb]{flex:1;display:flex;justify-content:space-around;align-items:center;color:#39f;cursor:pointer;box-sizing:border-box}.main-content .lists-bar .list-item .option .text[data-v-1613cddb]{flex:1;text-align:center;font-size:14px}.main-content .lists-bar .list-item .option .line[data-v-1613cddb]{color:rgba(0,0,0,.3)}.bind-main[data-v-55344934]{background-color:#f7f7f7;min-height:100%}.bind-main .header-bar[data-v-55344934]{height:95px;padding:0 30px;font-size:16px;background-color:#fff;box-shadow:0 0 5px 0 rgba(0,0,0,.2);display:flex;flex-direction:column;justify-content:center;align-items:flex-start}.bind-main .header-bar .header-title[data-v-55344934]{color:#000}.bind-main .header-bar .header-content[data-v-55344934]{font-size:14px;padding:0 15px;display:flex;align-items:center;justify-content:flex-start}.bind-main .header-bar .header-content .content-item[data-v-55344934]{padding:0 25px;display:flex;flex-direction:column;justify-content:center;align-content:center;text-align:center}.bind-main .header-bar .header-content .content-item .button[data-v-55344934]{font-weight:600;margin-top:5px}.bind-main .header-bar .header-content .content-item .status-bar[data-v-55344934]{display:inline-block;width:10px;height:10px;border-radius:10px}.bind-main .header-bar .header-content .content-item .green[data-v-55344934]{background-color:#0f3}.bind-main .header-bar .header-content .content-item .orange[data-v-55344934]{background-color:#ff6801}.bind-main .main-content[data-v-55344934]{width:97%;margin:0 auto;background-color:#fff;margin-top:25px;border-radius:10px;box-shadow:0 0 5px 0 rgba(0,0,0,.2);min-height:80%;position:relative}.bind-main .main-content .top-bar[data-v-55344934]{padding:25px 25px;border:1px solid #e8e8e8;display:-webkit-flex;justify-content:flex-start;align-items:center}.bind-main .main-content .top-bar .margin-left[data-v-55344934]{margin-left:40px}.bind-main .main-content .top-bar .float-right[data-v-55344934]{float:right}.bind-main .main-content .template-lsit[data-v-55344934]{padding:25px 30px 50px 30px;display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.bind-main .main-content .template-lsit .template-item[data-v-55344934]{width:23.5%;height:185px;border-radius:8px;margin-right:2%;margin-bottom:2%;border:1px solid #e8e8e8;transition:transform .15s linear,box-shadow .2s linear}.bind-main .main-content .template-lsit .template-item[data-v-55344934]:hover{box-shadow:0 0 5px 0 rgba(0,0,0,.2);transform:translateY(-3px)}.bind-main .main-content .template-lsit .template-item[data-v-55344934]:nth-child(4n){margin-right:0}.bind-main .main-content .template-lsit .current-item[data-v-55344934]{display:flex;flex-direction:column;justify-content:space-between;align-items:center;overflow:hidden}.bind-main .main-content .template-lsit .current-item .item-content[data-v-55344934]{width:100%;flex:1;display:flex;justify-content:center;align-items:flex-start;padding:20px}.bind-main .main-content .template-lsit .current-item .item-content .icon-box[data-v-55344934]{flex-basis:60px}.bind-main .main-content .template-lsit .current-item .item-content .icon-box .icon-bar[data-v-55344934]{width:100%;color:rgba(0,0,0,.5);border-radius:50%;background-color:#e8e8e8}.bind-main .main-content .template-lsit .current-item .item-content .icon-box .icon-bar[data-v-55344934]:before{font-size:40px}.bind-main .main-content .template-lsit .current-item .item-content .icon-box .template-type[data-v-55344934]{display:block;font-size:14px;text-align:center;margin-top:10px;max-width:60px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:600}.bind-main .main-content .template-lsit .current-item .item-content .content[data-v-55344934]{flex:1;margin-left:20px;position:relative;height:100%;overflow:hidden}.bind-main .main-content .template-lsit .current-item .item-content .content .name[data-v-55344934]{font-size:15px;color:rgba(0,0,0,.8);max-width:100%;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.bind-main .main-content .template-lsit .current-item .item-content .content .params[data-v-55344934]{max-width:100%;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:14px;line-height:20px}.bind-main .main-content .template-lsit .current-item .item-content .content .params .label[data-v-55344934]{font-weight:600}.bind-main .main-content .template-lsit .current-item .item-content .content .content-footer[data-v-55344934]{position:absolute;left:0;bottom:0;width:100%;display:flex;justify-content:space-between;align-items:center}.bind-main .main-content .template-lsit .current-item .item-option[data-v-55344934]{flex-basis:46px;background-color:#fafafa;width:100%;box-sizing:border-box;padding:10px 0;display:flex;justify-content:space-around;align-items:center;font-size:14px;color:rgba(0,0,0,.45);border-top:1px solid #e8e8e8}.bind-main .main-content .template-lsit .current-item .item-option .delete[data-v-55344934],.bind-main .main-content .template-lsit .current-item .item-option .detail[data-v-55344934],.bind-main .main-content .template-lsit .current-item .item-option .modify[data-v-55344934]{cursor:pointer;flex:1;text-align:center}.bind-main .main-content .template-lsit .add-item[data-v-55344934]{display:flex;justify-content:center;align-items:center;font-size:14px;cursor:pointer}.bind-main .main-content .page-pagination[data-v-55344934]{position:absolute;left:50%;bottom:20px;z-index:10px;transform:translateX(-50%)}.bind-main .main-content .pagination[data-v-55344934]{text-align:center;padding:20px}.bind-main .modal-select[data-v-55344934]{width:85%}.bind-main .parameter-item[data-v-55344934]{margin-bottom:10px}.bind-main .component-button[data-v-55344934]{cursor:pointer;padding:0 5px;color:#39f;border-right:1px solid #e3e8ee}.bind-main .last-button[data-v-55344934]{border:none}.bind-main .blue[data-v-55344934]{color:#39f}.bind-main .orange[data-v-55344934]{color:#ff6801}.bind-main .red[data-v-55344934]{color:rbb(255,0,0)}.owner-box[data-v-18c1f524]{height:100%;overflow:auto}.submit-button-container[data-v-18c1f524]{text-align:center}.search-form[data-v-18c1f524]{padding-left:15px}.submit-button-container{text-align:center}.main[data-v-ee32ff88]{background-color:#f7f7f7;min-height:100%}.main .header-bar[data-v-ee32ff88]{height:95px;padding:0 30px;font-size:18px;background-color:#fff;box-shadow:0 0 5px 0 rgba(0,0,0,.2);display:flex;flex-direction:column;justify-content:center;align-items:flex-start}.main .header-bar .header-title[data-v-ee32ff88]{color:#000}.main .header-bar .header-des[data-v-ee32ff88]{font-size:14px;padding-top:15px}.main .main-content[data-v-ee32ff88]{width:97%;margin:0 auto;background-color:#fff;margin-top:25px;padding:20px 25px 0 25px;border-radius:10px;box-shadow:0 0 5px 0 rgba(0,0,0,.2);min-height:80%;position:relative}.main .main-content .top-bar[data-v-ee32ff88]{padding:25px 25px;border:1px solid #e8e8e8;display:-webkit-flex;justify-content:flex-start;align-items:center}.main .main-content .top-bar .margin-left[data-v-ee32ff88]{margin-left:40px}.main .main-content .template-lsit[data-v-ee32ff88]{padding:25px 30px 50px 30px;display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.main .main-content .template-lsit .template-item[data-v-ee32ff88]{width:23.5%;height:185px;border-radius:8px;margin-right:2%;margin-bottom:2%;border:1px solid #e8e8e8;transition:transform .15s linear,box-shadow .2s linear}.main .main-content .template-lsit .template-item[data-v-ee32ff88]:hover{box-shadow:0 0 5px 0 rgba(0,0,0,.2);transform:translateY(-3px)}.main .main-content .template-lsit .template-item[data-v-ee32ff88]:nth-child(4n){margin-right:0}.main .main-content .template-lsit .current-item[data-v-ee32ff88]{display:flex;flex-direction:column;justify-content:space-between;align-items:center;overflow:hidden}.main .main-content .template-lsit .current-item .item-content[data-v-ee32ff88]{width:100%;flex:1;display:flex;justify-content:center;align-items:flex-start;padding:20px}.main .main-content .template-lsit .current-item .item-content .icon-box[data-v-ee32ff88]{flex-basis:60px}.main .main-content .template-lsit .current-item .item-content .icon-box .icon-bar[data-v-ee32ff88]{width:100%;color:rgba(0,0,0,.5);border-radius:50%;background-color:#e8e8e8;line-height:60px;text-align:center}.main .main-content .template-lsit .current-item .item-content .icon-box .icon-bar[data-v-ee32ff88]:before{font-size:40px}.main .main-content .template-lsit .current-item .item-content .icon-box .template-type[data-v-ee32ff88]{display:block;font-size:14px;text-align:center;margin-top:10px;max-width:60px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:600}.main .main-content .template-lsit .current-item .item-content .content[data-v-ee32ff88]{flex:1;margin-left:20px;position:relative;height:100%;overflow:hidden}.main .main-content .template-lsit .current-item .item-content .content .name[data-v-ee32ff88]{font-size:15px;color:rgba(0,0,0,.8);max-width:100%;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.main .main-content .template-lsit .current-item .item-content .content .params[data-v-ee32ff88]{max-width:100%;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:14px;line-height:20px}.main .main-content .template-lsit .current-item .item-content .content .params .label[data-v-ee32ff88]{font-weight:600}.main .main-content .template-lsit .current-item .item-content .content .content-footer[data-v-ee32ff88]{position:absolute;left:0;bottom:0;width:100%;display:flex;justify-content:space-between;align-items:center}.main .main-content .template-lsit .current-item .item-option[data-v-ee32ff88]{flex-basis:46px;background-color:#fafafa;width:100%;box-sizing:border-box;padding:10px 0;display:flex;justify-content:space-around;align-items:center;font-size:14px;color:rgba(0,0,0,.45);border-top:1px solid #e8e8e8}.main .main-content .template-lsit .current-item .item-option .delete[data-v-ee32ff88],.main .main-content .template-lsit .current-item .item-option .detail[data-v-ee32ff88],.main .main-content .template-lsit .current-item .item-option .modify[data-v-ee32ff88]{cursor:pointer;flex:1;text-align:center}.main .main-content .template-lsit .add-item[data-v-ee32ff88]{display:flex;justify-content:center;align-items:center;font-size:14px;cursor:pointer}.main .main-content .page-pagination[data-v-ee32ff88]{position:absolute;left:50%;bottom:20px;z-index:10px;transform:translateX(-50%)}.main .modal-select[data-v-ee32ff88]{width:85%}.main .parameter-item[data-v-ee32ff88]{margin-bottom:10px}.task-main{height:100%;overflow:auto}.ui-input-swap textarea.ui-input{height:100%;resize:none}.textarea-height{height:450px}.component-button{cursor:pointer;padding:0 8px;color:#39f;border-right:1px solid #e3e8ee}.last-button{border:none}.button-box{display:flex;justify-content:center;align-items:center;margin-top:15px}.prepage{margin-right:40px}.error{background-color:#f60}.warnig{background-color:#ffad33}.normal{background-color:#33d685}.SUCCESS{color:#33d685}.RUNNING{color:#39f}.FAILD{color:#f60}.RUNNING_TIMEOUT{color:#ffad33}.COMMIT{color:#2db7f5}.KILL{color:red}.page-center{justify-content:center}.language-switching[data-v-28dca72e]{padding:0 20px}.language-switching[data-v-28dca72e]:hover{cursor:pointer;color:#fff}.we-editor[data-v-023705ca]{height:100%;width:100%}.we-editor a[data-v-023705ca]{color:#646465!important}.we-editor .glyphMarginClass[data-v-023705ca]{background:#f90}.we-editor .contentClass[data-v-023705ca]{background:rgba(250,216,164,.5137254901960784)}.we-editor .inlineDecoration[data-v-023705ca]{position:relative;color:#f90!important;cursor:pointer;font-style:oblique}.we-editor .inlineDecoration[data-v-023705ca]:after{content:"";position:absolute;bottom:-2px;left:5%;width:90%;height:2px;background:-webkit-linear-gradient(315deg,transparent,transparent 45%,#ed4014,transparent 55%,transparent),-webkit-linear-gradient(45deg,transparent,transparent 45%,#ed4014,transparent 55%,transparent);background-size:4px 4px;background-repeat:repeat-x}.we-editor .highRiskGrammar[data-v-023705ca]{color:red}.editor-content[data-v-3167c3cf]{width:100%;height:400px;padding-bottom:15px}.footer-bar[data-v-3167c3cf]{text-align:center;margin-bottom:24px}.cron-input{margin-bottom:10px}.title-span{text-align:center}.red-icon{color:red}.option-margin{margin-top:15px}.ui-select .ui-select-selection{min-height:30px}.parameter-item{margin-bottom:2px}.icon-plus{cursor:pointer}.form-item-padding[data-v-4645eaf4]{padding-left:120px}.linkCoditionView[data-v-52da4597]{border:1px solid #d7dde4;border-radius:4px;padding:8px;overflow:auto;max-height:140px;min-height:32px}.linkCoditionView[data-v-52da4597]::-webkit-scrollbar{width:0;height:8px}.linkCoditionView[data-v-52da4597]::-webkit-scrollbar-thumb{border-radius:6px;box-shadow:inset 0 0 5px rgba(0,0,0,.2);background:#808695}.linkCoditionView[data-v-52da4597]::-webkit-scrollbar-track{border-radius:6px;box-shadow:inset 0 0 5px rgba(0,0,0,.2);background:#fff}.ui-select-selection[data-v-52da4597],.ui-select-selection[data-v-e18105f6]{height:30px}.text-center[data-v-59342238]{text-align:center}.icon-plus[data-v-59342238]{cursor:pointer}.table-margin[data-v-1519341c]{min-width:20px;height:50px}.table-header[data-v-1519341c]{width:100%;height:51px;line-height:51px;text-align:center;background:#f7f7f7;border-top:1px solid #e3e8ee;border-bottom:1px solid #e3e8ee}.raw-style[data-v-1519341c]{height:51px;padding-top:9px;padding-bottom:0;border-bottom:1px solid #e3e8ee}.source-word-block[data-v-1519341c]{min-height:300px;max-height:300px}.arg-btn[data-v-1519341c]{margin-top:9px;width:40px;padding:6px 6px}.modal-btn-wrap[data-v-1519341c]{text-align:center;margin-top:15px}.arg-margin[data-v-1519341c]{margin-top:10px;margin-bottom:10px}.parmas-bar[data-v-1519341c]{flex-wrap:wrap}.arg-width[data-v-1519341c],.parmas-bar[data-v-1519341c]{display:flex;justify-content:flex-start;align-items:center}.arg-width[data-v-1519341c]{flex:33%;margin-right:10px;margin-bottom:10px}.arg-width .label[data-v-1519341c]{margin-right:5px;white-space:nowrap}.form-box[data-v-1519341c]{max-height:400px;overflow:auto}.pagination[data-v-1519341c]{text-align:center;padding:15px 0}.ui-select-selection[data-v-2518aca2],.ui-select-selection[data-v-34211381]{height:30px}.web-steps.ui-steps[data-v-34254569]{display:flex;justify-content:space-around;align-items:center}.web-steps.ui-steps .ui-step[data-v-34254569]{flex:1}.project-tree .not-data{text-align:center;display:block;margin-top:20px}.project-tree .ui-tree-node{margin:0}.project-tree .ui-tree-node .ui-tree-node-text{width:calc(100% - 16px);display:block;padding:5px 5px}.project-tree .ui-tree-node .ui-tree-node-text .ui-contextmenu{width:100%}.project-tree .ui-tree-node .ui-tree-node-text .ui-contextmenu .ui-contextmenu-slot span{display:inline-block;width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.project-tree .ui-tree-node .ui-tree-node-text.selected,.project-tree .ui-tree-node .ui-tree-node-text:hover{border-right:2px solid #00a1d6}.project-tree .ui-tree.ui-tree-inline .ui-tree-just-data .ui-tree-node{width:100%;display:block} \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/css/chunk-vendors.33d66a59.css b/modules/gateway/src/main/resources/static/css/chunk-vendors.33d66a59.css deleted file mode 100644 index 84fcf03a2..000000000 --- a/modules/gateway/src/main/resources/static/css/chunk-vendors.33d66a59.css +++ /dev/null @@ -1,3 +0,0 @@ -@charset "UTF-8";@keyframes loading{0%{transform:rotate(0deg) scale(1)}50%{transform:rotate(180deg) scale(.8)}to{transform:rotate(1turn) scale(1)}}.fade-transition{transition:opacity .3s;opacity:1}.fade-enter,.fade-leave{opacity:0}@keyframes tabfadeIn{0%{opacity:0}70%{opacity:.8}to{opacity:1}}@keyframes tabfadeOut{0%{opacity:1}70%{opacity:.2}to{opacity:0}}.tabfade-enter{opacity:0}.tabfade-enter-active{animation-name:tabfadeIn;animation-duration:.3s;animation-fill-mode:both}.tabfade-leave,.tabfade-leave-active{position:absolute;left:0;top:0;right:0;bottom:0}.tabfade-leave-active{animation-name:tabfadeOut;animation-duration:.3s;animation-fill-mode:both}@keyframes slideDownIn{0%{opacity:0;transform-origin:0 0;transform:scaleY(.8)}to{opacity:1;transform-origin:0 0;transform:scaleY(1)}}@keyframes slideUpOut{0%{opacity:1;transform-origin:0 0;transform:scaleY(1)}to{opacity:0;transform-origin:0 0;transform:scaleY(.8)}}.slide-transition{animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.645,.045,.355,1)}.slide-enter{animation-name:slideDownIn}.slide-leave{animation-name:slideUpOut}.slide-to-down-enter-active{animation-duration:.3s;animation-name:slideDownIn}.slide-to-down-leave-active{animation-duration:.3s;animation-name:slideUpOut} - -/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:inherit;font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}[hidden],template{display:none}@font-face{font-family:Ionicons;src:url(../fonts/ionicons.a558ac78.eot);src:url(../fonts/ionicons.a558ac78.eot?#iefix) format("embedded-opentype"),url(../fonts/ionicons.96f1c901.woff2) format("woff2"),url(../fonts/ionicons.99b86349.woff) format("woff"),url(../fonts/ionicons.ef4a9f28.ttf) format("truetype"),url(../img/ionicons.d6592091.svg#iconfont) format("svg");font-weight:400;font-style:normal}.ui-icon,.ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before{display:inline-block;vertical-align:baseline;font-family:Ionicons;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;text-rendering:auto;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ui-icon-ios-add:before{content:""}.ui-icon-ios-add-circle:before{content:""}.ui-icon-ios-add-circle-outline:before{content:""}.ui-icon-ios-airplane:before{content:""}.ui-icon-ios-alarm:before{content:""}.ui-icon-ios-albums:before{content:""}.ui-icon-ios-alert:before{content:""}.ui-icon-ios-american-football:before{content:""}.ui-icon-ios-analytics:before{content:""}.ui-icon-ios-aperture:before{content:""}.ui-icon-ios-apps:before{content:""}.ui-icon-ios-appstore:before{content:""}.ui-icon-ios-archive:before{content:""}.ui-icon-ios-arrow-back:before{content:""}.ui-icon-ios-arrow-down:before{content:""}.ui-icon-ios-arrow-dropdown:before{content:""}.ui-icon-ios-arrow-dropdown-circle:before{content:""}.ui-icon-ios-arrow-dropleft:before{content:""}.ui-icon-ios-arrow-dropleft-circle:before{content:""}.ui-icon-ios-arrow-dropright:before{content:""}.ui-icon-ios-arrow-dropright-circle:before{content:""}.ui-icon-ios-arrow-dropup:before{content:""}.ui-icon-ios-arrow-dropup-circle:before{content:""}.ui-icon-ios-arrow-forward:before{content:""}.ui-icon-ios-arrow-round-back:before{content:""}.ui-icon-ios-arrow-round-down:before{content:""}.ui-icon-ios-arrow-round-forward:before{content:""}.ui-icon-ios-arrow-round-up:before{content:""}.ui-icon-ios-arrow-up:before{content:""}.ui-icon-ios-at:before{content:""}.ui-icon-ios-attach:before{content:""}.ui-icon-ios-backspace:before{content:""}.ui-icon-ios-barcode:before{content:""}.ui-icon-ios-baseball:before{content:""}.ui-icon-ios-basket:before{content:""}.ui-icon-ios-basketball:before{content:""}.ui-icon-ios-battery-charging:before{content:""}.ui-icon-ios-battery-dead:before{content:""}.ui-icon-ios-battery-full:before{content:""}.ui-icon-ios-beaker:before{content:""}.ui-icon-ios-bed:before{content:""}.ui-icon-ios-beer:before{content:""}.ui-icon-ios-bicycle:before{content:""}.ui-icon-ios-bluetooth:before{content:""}.ui-icon-ios-boat:before{content:""}.ui-icon-ios-body:before{content:""}.ui-icon-ios-bonfire:before{content:""}.ui-icon-ios-book:before{content:""}.ui-icon-ios-bookmark:before{content:""}.ui-icon-ios-bookmarks:before{content:""}.ui-icon-ios-bowtie:before{content:""}.ui-icon-ios-briefcase:before{content:""}.ui-icon-ios-browsers:before{content:""}.ui-icon-ios-brush:before{content:""}.ui-icon-ios-bug:before{content:""}.ui-icon-ios-build:before{content:""}.ui-icon-ios-bulb:before{content:""}.ui-icon-ios-bus:before{content:""}.ui-icon-ios-business:before{content:""}.ui-icon-ios-cafe:before{content:""}.ui-icon-ios-calculator:before{content:""}.ui-icon-ios-calendar:before{content:""}.ui-icon-ios-call:before{content:""}.ui-icon-ios-camera:before{content:""}.ui-icon-ios-car:before{content:""}.ui-icon-ios-card:before{content:""}.ui-icon-ios-cart:before{content:""}.ui-icon-ios-cash:before{content:""}.ui-icon-ios-cellular:before{content:""}.ui-icon-ios-chatboxes:before{content:""}.ui-icon-ios-chatbubbles:before{content:""}.ui-icon-ios-checkbox:before{content:""}.ui-icon-ios-checkbox-outline:before{content:""}.ui-icon-ios-checkmark:before{content:""}.ui-icon-ios-checkmark-circle:before{content:""}.ui-icon-ios-checkmark-circle-outline:before{content:""}.ui-icon-ios-clipboard:before{content:""}.ui-icon-ios-clock:before{content:""}.ui-icon-ios-close:before{content:""}.ui-icon-ios-close-circle:before{content:""}.ui-icon-ios-close-circle-outline:before{content:""}.ui-icon-ios-cloud:before{content:""}.ui-icon-ios-cloud-circle:before{content:""}.ui-icon-ios-cloud-done:before{content:""}.ui-icon-ios-cloud-download:before{content:""}.ui-icon-ios-cloud-outline:before{content:""}.ui-icon-ios-cloud-upload:before{content:""}.ui-icon-ios-cloudy:before{content:""}.ui-icon-ios-cloudy-night:before{content:""}.ui-icon-ios-code:before{content:""}.ui-icon-ios-code-download:before{content:""}.ui-icon-ios-code-working:before{content:""}.ui-icon-ios-cog:before{content:""}.ui-icon-ios-color-fill:before{content:""}.ui-icon-ios-color-filter:before{content:""}.ui-icon-ios-color-palette:before{content:""}.ui-icon-ios-color-wand:before{content:""}.ui-icon-ios-compass:before{content:""}.ui-icon-ios-construct:before{content:""}.ui-icon-ios-contact:before{content:""}.ui-icon-ios-contacts:before{content:""}.ui-icon-ios-contract:before{content:""}.ui-icon-ios-contrast:before{content:""}.ui-icon-ios-copy:before{content:""}.ui-icon-ios-create:before{content:""}.ui-icon-ios-crop:before{content:""}.ui-icon-ios-cube:before{content:""}.ui-icon-ios-cut:before{content:""}.ui-icon-ios-desktop:before{content:""}.ui-icon-ios-disc:before{content:""}.ui-icon-ios-document:before{content:""}.ui-icon-ios-done-all:before{content:""}.ui-icon-ios-download:before{content:""}.ui-icon-ios-easel:before{content:""}.ui-icon-ios-egg:before{content:""}.ui-icon-ios-exit:before{content:""}.ui-icon-ios-expand:before{content:""}.ui-icon-ios-eye:before{content:""}.ui-icon-ios-eye-off:before{content:""}.ui-icon-ios-fastforward:before{content:""}.ui-icon-ios-female:before{content:""}.ui-icon-ios-filing:before{content:""}.ui-icon-ios-film:before{content:""}.ui-icon-ios-finger-print:before{content:""}.ui-icon-ios-fitness:before{content:""}.ui-icon-ios-flag:before{content:""}.ui-icon-ios-flame:before{content:""}.ui-icon-ios-flash:before{content:""}.ui-icon-ios-flash-off:before{content:""}.ui-icon-ios-flashlight:before{content:""}.ui-icon-ios-flask:before{content:""}.ui-icon-ios-flower:before{content:""}.ui-icon-ios-folder:before{content:""}.ui-icon-ios-folder-open:before{content:""}.ui-icon-ios-football:before{content:""}.ui-icon-ios-funnel:before{content:""}.ui-icon-ios-gift:before{content:""}.ui-icon-ios-git-branch:before{content:""}.ui-icon-ios-git-commit:before{content:""}.ui-icon-ios-git-compare:before{content:""}.ui-icon-ios-git-merge:before{content:""}.ui-icon-ios-git-network:before{content:""}.ui-icon-ios-git-pull-request:before{content:""}.ui-icon-ios-glasses:before{content:""}.ui-icon-ios-globe:before{content:""}.ui-icon-ios-grid:before{content:""}.ui-icon-ios-hammer:before{content:""}.ui-icon-ios-hand:before{content:""}.ui-icon-ios-happy:before{content:""}.ui-icon-ios-headset:before{content:""}.ui-icon-ios-heart:before{content:""}.ui-icon-ios-heart-dislike:before{content:""}.ui-icon-ios-heart-empty:before{content:""}.ui-icon-ios-heart-half:before{content:""}.ui-icon-ios-help:before{content:""}.ui-icon-ios-help-buoy:before{content:""}.ui-icon-ios-help-circle:before{content:""}.ui-icon-ios-help-circle-outline:before{content:""}.ui-icon-ios-home:before{content:""}.ui-icon-ios-hourglass:before{content:""}.ui-icon-ios-ice-cream:before{content:""}.ui-icon-ios-image:before{content:""}.ui-icon-ios-images:before{content:""}.ui-icon-ios-infinite:before{content:""}.ui-icon-ios-informatui-icon-circle:before{content:""}.ui-icon-ios-informatui-icon-circle-outline:before{content:""}.ui-icon-ios-jet:before{content:""}.ui-icon-ios-journal:before{content:""}.ui-icon-ios-key:before{content:""}.ui-icon-ios-keypad:before{content:""}.ui-icon-ios-laptop:before{content:""}.ui-icon-ios-leaf:before{content:""}.ui-icon-ios-link:before{content:""}.ui-icon-ios-list:before{content:""}.ui-icon-ios-list-box:before{content:""}.ui-icon-ios-locate:before{content:""}.ui-icon-ios-lock:before{content:""}.ui-icon-ios-log-in:before{content:""}.ui-icon-ios-log-out:before{content:""}.ui-icon-ios-magnet:before{content:""}.ui-icon-ios-mail:before{content:""}.ui-icon-ios-mail-open:before{content:""}.ui-icon-ios-mail-unread:before{content:""}.ui-icon-ios-male:before{content:""}.ui-icon-ios-man:before{content:""}.ui-icon-ios-map:before{content:""}.ui-icon-ios-medal:before{content:""}.ui-icon-ios-medical:before{content:""}.ui-icon-ios-medkit:before{content:""}.ui-icon-ios-megaphone:before{content:""}.ui-icon-ios-menu:before{content:""}.ui-icon-ios-mic:before{content:""}.ui-icon-ios-mic-off:before{content:""}.ui-icon-ios-microphone:before{content:""}.ui-icon-ios-moon:before{content:""}.ui-icon-ios-more:before{content:""}.ui-icon-ios-move:before{content:""}.ui-icon-ios-musical-note:before{content:""}.ui-icon-ios-musical-notes:before{content:""}.ui-icon-ios-navigate:before{content:""}.ui-icon-ios-notifications:before{content:""}.ui-icon-ios-notifications-off:before{content:""}.ui-icon-ios-notifications-outline:before{content:""}.ui-icon-ios-nuclear:before{content:""}.ui-icon-ios-nutrition:before{content:""}.ui-icon-ios-open:before{content:""}.ui-icon-ios-options:before{content:""}.ui-icon-ios-outlet:before{content:""}.ui-icon-ios-paper:before{content:""}.ui-icon-ios-paper-plane:before{content:""}.ui-icon-ios-partly-sunny:before{content:""}.ui-icon-ios-pause:before{content:""}.ui-icon-ios-paw:before{content:""}.ui-icon-ios-people:before{content:""}.ui-icon-ios-person:before{content:""}.ui-icon-ios-person-add:before{content:""}.ui-icon-ios-phone-landscape:before{content:""}.ui-icon-ios-phone-portrait:before{content:""}.ui-icon-ios-photos:before{content:""}.ui-icon-ios-pie:before{content:""}.ui-icon-ios-pin:before{content:""}.ui-icon-ios-pint:before{content:""}.ui-icon-ios-pizza:before{content:""}.ui-icon-ios-planet:before{content:""}.ui-icon-ios-play:before{content:""}.ui-icon-ios-play-circle:before{content:""}.ui-icon-ios-podium:before{content:""}.ui-icon-ios-power:before{content:""}.ui-icon-ios-pricetag:before{content:""}.ui-icon-ios-pricetags:before{content:""}.ui-icon-ios-print:before{content:""}.ui-icon-ios-pulse:before{content:""}.ui-icon-ios-qr-scanner:before{content:""}.ui-icon-ios-quote:before{content:""}.ui-icon-ios-radio:before{content:""}.ui-icon-ios-radio-button-off:before{content:""}.ui-icon-ios-radio-button-on:before{content:""}.ui-icon-ios-rainy:before{content:""}.ui-icon-ios-recording:before{content:""}.ui-icon-ios-redo:before{content:""}.ui-icon-ios-refresh:before{content:""}.ui-icon-ios-refresh-circle:before{content:""}.ui-icon-ios-remove:before{content:""}.ui-icon-ios-remove-circle:before{content:""}.ui-icon-ios-remove-circle-outline:before{content:""}.ui-icon-ios-reorder:before{content:""}.ui-icon-ios-repeat:before{content:""}.ui-icon-ios-resize:before{content:""}.ui-icon-ios-restaurant:before{content:""}.ui-icon-ios-return-left:before{content:""}.ui-icon-ios-return-right:before{content:""}.ui-icon-ios-reverse-camera:before{content:""}.ui-icon-ios-rewind:before{content:""}.ui-icon-ios-ribbon:before{content:""}.ui-icon-ios-rocket:before{content:""}.ui-icon-ios-rose:before{content:""}.ui-icon-ios-sad:before{content:""}.ui-icon-ios-save:before{content:""}.ui-icon-ios-school:before{content:""}.ui-icon-ios-search:before{content:""}.ui-icon-ios-send:before{content:""}.ui-icon-ios-settings:before{content:""}.ui-icon-ios-share:before{content:""}.ui-icon-ios-share-alt:before{content:""}.ui-icon-ios-shirt:before{content:""}.ui-icon-ios-shuffle:before{content:""}.ui-icon-ios-skip-backward:before{content:""}.ui-icon-ios-skip-forward:before{content:""}.ui-icon-ios-snow:before{content:""}.ui-icon-ios-speedometer:before{content:""}.ui-icon-ios-square:before{content:""}.ui-icon-ios-square-outline:before{content:""}.ui-icon-ios-star:before{content:""}.ui-icon-ios-star-half:before{content:""}.ui-icon-ios-star-outline:before{content:""}.ui-icon-ios-stats:before{content:""}.ui-icon-ios-stopwatch:before{content:""}.ui-icon-ios-subway:before{content:""}.ui-icon-ios-sunny:before{content:""}.ui-icon-ios-swap:before{content:""}.ui-icon-ios-switch:before{content:""}.ui-icon-ios-sync:before{content:""}.ui-icon-ios-tablet-landscape:before{content:""}.ui-icon-ios-tablet-portrait:before{content:""}.ui-icon-ios-tennisball:before{content:""}.ui-icon-ios-text:before{content:""}.ui-icon-ios-thermometer:before{content:""}.ui-icon-ios-thumbs-down:before{content:""}.ui-icon-ios-thumbs-up:before{content:""}.ui-icon-ios-thunderstorm:before{content:""}.ui-icon-ios-time:before{content:""}.ui-icon-ios-timer:before{content:""}.ui-icon-ios-today:before{content:""}.ui-icon-ios-train:before{content:""}.ui-icon-ios-transgender:before{content:""}.ui-icon-ios-trash:before{content:""}.ui-icon-ios-trending-down:before{content:""}.ui-icon-ios-trending-up:before{content:""}.ui-icon-ios-trophy:before{content:""}.ui-icon-ios-tv:before{content:""}.ui-icon-ios-umbrella:before{content:""}.ui-icon-ios-undo:before{content:""}.ui-icon-ios-unlock:before{content:""}.ui-icon-ios-videocam:before{content:""}.ui-icon-ios-volume-high:before{content:""}.ui-icon-ios-volume-low:before{content:""}.ui-icon-ios-volume-mute:before{content:""}.ui-icon-ios-volume-off:before{content:""}.ui-icon-ios-walk:before{content:""}.ui-icon-ios-wallet:before{content:""}.ui-icon-ios-warning:before{content:""}.ui-icon-ios-watch:before{content:""}.ui-icon-ios-water:before{content:""}.ui-icon-ios-wifi:before{content:""}.ui-icon-ios-wine:before{content:""}.ui-icon-ios-woman:before{content:""}.ui-icon-md-add:before{content:""}.ui-icon-md-add-circle:before{content:""}.ui-icon-md-add-circle-outline:before{content:""}.ui-icon-md-airplane:before{content:""}.ui-icon-md-alarm:before{content:""}.ui-icon-md-albums:before{content:""}.ui-icon-md-alert:before{content:""}.ui-icon-md-american-football:before{content:""}.ui-icon-md-analytics:before{content:""}.ui-icon-md-aperture:before{content:""}.ui-icon-md-apps:before{content:""}.ui-icon-md-appstore:before{content:""}.ui-icon-md-archive:before{content:""}.ui-icon-md-arrow-back:before{content:""}.ui-icon-md-arrow-down:before{content:""}.ui-icon-md-arrow-dropdown:before{content:""}.ui-icon-md-arrow-dropdown-circle:before{content:""}.ui-icon-md-arrow-dropleft:before{content:""}.ui-icon-md-arrow-dropleft-circle:before{content:""}.ui-icon-md-arrow-dropright:before{content:""}.ui-icon-md-arrow-dropright-circle:before{content:""}.ui-icon-md-arrow-dropup:before{content:""}.ui-icon-md-arrow-dropup-circle:before{content:""}.ui-icon-md-arrow-forward:before{content:""}.ui-icon-md-arrow-round-back:before{content:""}.ui-icon-md-arrow-round-down:before{content:""}.ui-icon-md-arrow-round-forward:before{content:""}.ui-icon-md-arrow-round-up:before{content:""}.ui-icon-md-arrow-up:before{content:""}.ui-icon-md-at:before{content:""}.ui-icon-md-attach:before{content:""}.ui-icon-md-backspace:before{content:""}.ui-icon-md-barcode:before{content:""}.ui-icon-md-baseball:before{content:""}.ui-icon-md-basket:before{content:""}.ui-icon-md-basketball:before{content:""}.ui-icon-md-battery-charging:before{content:""}.ui-icon-md-battery-dead:before{content:""}.ui-icon-md-battery-full:before{content:""}.ui-icon-md-beaker:before{content:""}.ui-icon-md-bed:before{content:""}.ui-icon-md-beer:before{content:""}.ui-icon-md-bicycle:before{content:""}.ui-icon-md-bluetooth:before{content:""}.ui-icon-md-boat:before{content:""}.ui-icon-md-body:before{content:""}.ui-icon-md-bonfire:before{content:""}.ui-icon-md-book:before{content:""}.ui-icon-md-bookmark:before{content:""}.ui-icon-md-bookmarks:before{content:""}.ui-icon-md-bowtie:before{content:""}.ui-icon-md-briefcase:before{content:""}.ui-icon-md-browsers:before{content:""}.ui-icon-md-brush:before{content:""}.ui-icon-md-bug:before{content:""}.ui-icon-md-build:before{content:""}.ui-icon-md-bulb:before{content:""}.ui-icon-md-bus:before{content:""}.ui-icon-md-business:before{content:""}.ui-icon-md-cafe:before{content:""}.ui-icon-md-calculator:before{content:""}.ui-icon-md-calendar:before{content:""}.ui-icon-md-call:before{content:""}.ui-icon-md-camera:before{content:""}.ui-icon-md-car:before{content:""}.ui-icon-md-card:before{content:""}.ui-icon-md-cart:before{content:""}.ui-icon-md-cash:before{content:""}.ui-icon-md-cellular:before{content:""}.ui-icon-md-chatboxes:before{content:""}.ui-icon-md-chatbubbles:before{content:""}.ui-icon-md-checkbox:before{content:""}.ui-icon-md-checkbox-outline:before{content:""}.ui-icon-md-checkmark:before,.ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before{content:""}.ui-icon-md-checkmark-circle:before{content:""}.ui-icon-md-checkmark-circle-outline:before{content:""}.ui-icon-md-clipboard:before{content:""}.ui-icon-md-clock:before{content:""}.ui-icon-md-close:before{content:""}.ui-icon-md-close-circle:before{content:""}.ui-icon-md-close-circle-outline:before{content:""}.ui-icon-md-cloud:before{content:""}.ui-icon-md-cloud-circle:before{content:""}.ui-icon-md-cloud-done:before{content:""}.ui-icon-md-cloud-download:before{content:""}.ui-icon-md-cloud-outline:before{content:""}.ui-icon-md-cloud-upload:before{content:""}.ui-icon-md-cloudy:before{content:""}.ui-icon-md-cloudy-night:before{content:""}.ui-icon-md-code:before{content:""}.ui-icon-md-code-download:before{content:""}.ui-icon-md-code-working:before{content:""}.ui-icon-md-cog:before{content:""}.ui-icon-md-color-fill:before{content:""}.ui-icon-md-color-filter:before{content:""}.ui-icon-md-color-palette:before{content:""}.ui-icon-md-color-wand:before{content:""}.ui-icon-md-compass:before{content:""}.ui-icon-md-construct:before{content:""}.ui-icon-md-contact:before{content:""}.ui-icon-md-contacts:before{content:""}.ui-icon-md-contract:before{content:""}.ui-icon-md-contrast:before{content:""}.ui-icon-md-copy:before{content:""}.ui-icon-md-create:before{content:""}.ui-icon-md-crop:before{content:""}.ui-icon-md-cube:before{content:""}.ui-icon-md-cut:before{content:""}.ui-icon-md-desktop:before{content:""}.ui-icon-md-disc:before{content:""}.ui-icon-md-document:before{content:""}.ui-icon-md-done-all:before{content:""}.ui-icon-md-download:before{content:""}.ui-icon-md-easel:before{content:""}.ui-icon-md-egg:before{content:""}.ui-icon-md-exit:before{content:""}.ui-icon-md-expand:before{content:""}.ui-icon-md-eye:before{content:""}.ui-icon-md-eye-off:before{content:""}.ui-icon-md-fastforward:before{content:""}.ui-icon-md-female:before{content:""}.ui-icon-md-filing:before{content:""}.ui-icon-md-film:before{content:""}.ui-icon-md-finger-print:before{content:""}.ui-icon-md-fitness:before{content:""}.ui-icon-md-flag:before{content:""}.ui-icon-md-flame:before{content:""}.ui-icon-md-flash:before{content:""}.ui-icon-md-flash-off:before{content:""}.ui-icon-md-flashlight:before{content:""}.ui-icon-md-flask:before{content:""}.ui-icon-md-flower:before{content:""}.ui-icon-md-folder:before{content:""}.ui-icon-md-folder-open:before{content:""}.ui-icon-md-football:before{content:""}.ui-icon-md-funnel:before{content:""}.ui-icon-md-gift:before{content:""}.ui-icon-md-git-branch:before{content:""}.ui-icon-md-git-commit:before{content:""}.ui-icon-md-git-compare:before{content:""}.ui-icon-md-git-merge:before{content:""}.ui-icon-md-git-network:before{content:""}.ui-icon-md-git-pull-request:before{content:""}.ui-icon-md-glasses:before{content:""}.ui-icon-md-globe:before{content:""}.ui-icon-md-grid:before{content:""}.ui-icon-md-hammer:before{content:""}.ui-icon-md-hand:before{content:""}.ui-icon-md-happy:before{content:""}.ui-icon-md-headset:before{content:""}.ui-icon-md-heart:before{content:""}.ui-icon-md-heart-dislike:before{content:""}.ui-icon-md-heart-empty:before{content:""}.ui-icon-md-heart-half:before{content:""}.ui-icon-md-help:before{content:""}.ui-icon-md-help-buoy:before{content:""}.ui-icon-md-help-circle:before{content:""}.ui-icon-md-help-circle-outline:before{content:""}.ui-icon-md-home:before{content:""}.ui-icon-md-hourglass:before{content:""}.ui-icon-md-ice-cream:before{content:""}.ui-icon-md-image:before{content:""}.ui-icon-md-images:before{content:""}.ui-icon-md-infinite:before{content:""}.ui-icon-md-informatui-icon-circle:before{content:""}.ui-icon-md-informatui-icon-circle-outline:before{content:""}.ui-icon-md-jet:before{content:""}.ui-icon-md-journal:before{content:""}.ui-icon-md-key:before{content:""}.ui-icon-md-keypad:before{content:""}.ui-icon-md-laptop:before{content:""}.ui-icon-md-leaf:before{content:""}.ui-icon-md-link:before{content:""}.ui-icon-md-list:before{content:""}.ui-icon-md-list-box:before{content:""}.ui-icon-md-locate:before{content:""}.ui-icon-md-lock:before{content:""}.ui-icon-md-log-in:before{content:""}.ui-icon-md-log-out:before{content:""}.ui-icon-md-magnet:before{content:""}.ui-icon-md-mail:before{content:""}.ui-icon-md-mail-open:before{content:""}.ui-icon-md-mail-unread:before{content:""}.ui-icon-md-male:before{content:""}.ui-icon-md-man:before{content:""}.ui-icon-md-map:before{content:""}.ui-icon-md-medal:before{content:""}.ui-icon-md-medical:before{content:""}.ui-icon-md-medkit:before{content:""}.ui-icon-md-megaphone:before{content:""}.ui-icon-md-menu:before{content:""}.ui-icon-md-mic:before{content:""}.ui-icon-md-mic-off:before{content:""}.ui-icon-md-microphone:before{content:""}.ui-icon-md-moon:before{content:""}.ui-icon-md-more:before{content:""}.ui-icon-md-move:before{content:""}.ui-icon-md-musical-note:before{content:""}.ui-icon-md-musical-notes:before{content:""}.ui-icon-md-navigate:before{content:""}.ui-icon-md-notifications:before{content:""}.ui-icon-md-notifications-off:before{content:""}.ui-icon-md-notifications-outline:before{content:""}.ui-icon-md-nuclear:before{content:""}.ui-icon-md-nutrition:before{content:""}.ui-icon-md-open:before{content:""}.ui-icon-md-options:before{content:""}.ui-icon-md-outlet:before{content:""}.ui-icon-md-paper:before{content:""}.ui-icon-md-paper-plane:before{content:""}.ui-icon-md-partly-sunny:before{content:""}.ui-icon-md-pause:before{content:""}.ui-icon-md-paw:before{content:""}.ui-icon-md-people:before{content:""}.ui-icon-md-person:before{content:""}.ui-icon-md-person-add:before{content:""}.ui-icon-md-phone-landscape:before{content:""}.ui-icon-md-phone-portrait:before{content:""}.ui-icon-md-photos:before{content:""}.ui-icon-md-pie:before{content:""}.ui-icon-md-pin:before{content:""}.ui-icon-md-pint:before{content:""}.ui-icon-md-pizza:before{content:""}.ui-icon-md-planet:before{content:""}.ui-icon-md-play:before{content:""}.ui-icon-md-play-circle:before{content:""}.ui-icon-md-podium:before{content:""}.ui-icon-md-power:before{content:""}.ui-icon-md-pricetag:before{content:""}.ui-icon-md-pricetags:before{content:""}.ui-icon-md-print:before{content:""}.ui-icon-md-pulse:before{content:""}.ui-icon-md-qr-scanner:before{content:""}.ui-icon-md-quote:before{content:""}.ui-icon-md-radio:before{content:""}.ui-icon-md-radio-button-off:before{content:""}.ui-icon-md-radio-button-on:before{content:""}.ui-icon-md-rainy:before{content:""}.ui-icon-md-recording:before{content:""}.ui-icon-md-redo:before{content:""}.ui-icon-md-refresh:before{content:""}.ui-icon-md-refresh-circle:before{content:""}.ui-icon-md-remove:before{content:""}.ui-icon-md-remove-circle:before{content:""}.ui-icon-md-remove-circle-outline:before{content:""}.ui-icon-md-reorder:before{content:""}.ui-icon-md-repeat:before{content:""}.ui-icon-md-resize:before{content:""}.ui-icon-md-restaurant:before{content:""}.ui-icon-md-return-left:before{content:""}.ui-icon-md-return-right:before{content:""}.ui-icon-md-reverse-camera:before{content:""}.ui-icon-md-rewind:before{content:""}.ui-icon-md-ribbon:before{content:""}.ui-icon-md-rocket:before{content:""}.ui-icon-md-rose:before{content:""}.ui-icon-md-sad:before{content:""}.ui-icon-md-save:before{content:""}.ui-icon-md-school:before{content:""}.ui-icon-md-search:before{content:""}.ui-icon-md-send:before{content:""}.ui-icon-md-settings:before{content:""}.ui-icon-md-share:before{content:""}.ui-icon-md-share-alt:before{content:""}.ui-icon-md-shirt:before{content:""}.ui-icon-md-shuffle:before{content:""}.ui-icon-md-skip-backward:before{content:""}.ui-icon-md-skip-forward:before{content:""}.ui-icon-md-snow:before{content:""}.ui-icon-md-speedometer:before{content:""}.ui-icon-md-square:before{content:""}.ui-icon-md-square-outline:before{content:""}.ui-icon-md-star:before{content:""}.ui-icon-md-star-half:before{content:""}.ui-icon-md-star-outline:before{content:""}.ui-icon-md-stats:before{content:""}.ui-icon-md-stopwatch:before{content:""}.ui-icon-md-subway:before{content:""}.ui-icon-md-sunny:before{content:""}.ui-icon-md-swap:before{content:""}.ui-icon-md-switch:before{content:""}.ui-icon-md-sync:before{content:""}.ui-icon-md-tablet-landscape:before{content:""}.ui-icon-md-tablet-portrait:before{content:""}.ui-icon-md-tennisball:before{content:""}.ui-icon-md-text:before{content:""}.ui-icon-md-thermometer:before{content:""}.ui-icon-md-thumbs-down:before{content:""}.ui-icon-md-thumbs-up:before{content:""}.ui-icon-md-thunderstorm:before{content:""}.ui-icon-md-time:before{content:""}.ui-icon-md-timer:before{content:""}.ui-icon-md-today:before{content:""}.ui-icon-md-train:before{content:""}.ui-icon-md-transgender:before{content:""}.ui-icon-md-trash:before{content:""}.ui-icon-md-trending-down:before{content:""}.ui-icon-md-trending-up:before{content:""}.ui-icon-md-trophy:before{content:""}.ui-icon-md-tv:before{content:""}.ui-icon-md-umbrella:before{content:""}.ui-icon-md-undo:before{content:""}.ui-icon-md-unlock:before{content:""}.ui-icon-md-videocam:before{content:""}.ui-icon-md-volume-high:before{content:""}.ui-icon-md-volume-low:before{content:""}.ui-icon-md-volume-mute:before{content:""}.ui-icon-md-volume-off:before{content:""}.ui-icon-md-walk:before{content:""}.ui-icon-md-wallet:before{content:""}.ui-icon-md-warning:before{content:""}.ui-icon-md-watch:before{content:""}.ui-icon-md-water:before{content:""}.ui-icon-md-wifi:before{content:""}.ui-icon-md-wine:before{content:""}.ui-icon-md-woman:before{content:""}.ui-icon-ios-information:before{content:""}.ui-icon-ios-information-circle:before{content:""}.ui-icon-ios-information-circle-outline:before{content:""}.ui-icon-md-information:before{content:""}.ui-icon-md-information-circle:before{content:""}.ui-icon-md-information-circle-outline:before{content:""}*{-webkit-tap-highlight-color:rgba(0,0,0,0)}*,:after,:before{box-sizing:border-box}body{font-family:Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Arial,sans-serif;font-size:12px;line-height:1.5;color:#657180;background-color:#fff;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}article,aside,blockquote,body,button,dd,details,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,input,legend,li,menu,nav,ol,p,section,td,textarea,th,ul{margin:0;padding:0}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}ol,ul{list-style:none}input::-ms-clear,input::-ms-reveal{display:none}input::-moz-placeholder,textarea::-moz-placeholder{color:#c3cbd6}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#c3cbd6}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#c3cbd6}a{color:#39f;background:transparent;text-decoration:none;outline:none;cursor:pointer;transition:color .2s ease}a:hover{color:#5cadff}a:active{color:#3091f2}a:active,a:hover{outline:0;text-decoration:none}a[disabled]{color:#ccc;cursor:not-allowed;pointer-events:none}code,kbd,pre,samp{font-family:Consolas,Menlo,Courier,monospace}.ui-button{position:relative;display:inline-block;vertical-align:middle;margin:0;padding:6px 15px;line-height:1.5;font-size:12px;font-weight:500;text-align:center;touch-action:manipulation;cursor:pointer;border:1px solid #d7dde4;white-space:nowrap;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:all .2s cubic-bezier(.645,.045,.355,1);color:#657180;background-color:#f7f7f7;background-image:none;outline:none}.ui-button:focus,.ui-button:hover{color:#5cadff;border-color:#5cadff}.ui-button:focus.ui-button-disabled,.ui-button:hover.ui-button-disabled{color:#657180;border-color:#d7dde4}.ui-button.ui-button-long{width:100%}.ui-button.ui-button-circle{border-radius:30px}.ui-button.ui-button-type-ghost{background-color:transparent}.ui-button.ui-button-type-text{background-color:transparent;border:1px solid transparent}.ui-button.ui-button-type-text.ui-button-disabled:focus,.ui-button.ui-button-type-text.ui-button-disabled:hover{border-color:transparent}.ui-button.ui-button-type-primary,.ui-message-buttons .ui-button:first-child{background-color:#39f;border:1px solid #39f;color:#fff}.ui-button.ui-button-type-primary:focus,.ui-button.ui-button-type-primary:hover,.ui-message-buttons .ui-button:focus:first-child,.ui-message-buttons .ui-button:hover:first-child{background-color:rgba(51,153,255,.8)}.ui-button.ui-button-type-primary.ui-button-disabled:focus,.ui-button.ui-button-type-primary.ui-button-disabled:hover,.ui-message-buttons .ui-button.ui-button-disabled:focus:first-child,.ui-message-buttons .ui-button.ui-button-disabled:hover:first-child{color:#fff;border-color:#39f;background-color:#39f}.ui-button.ui-button-type-info{background-color:#2db7f5;border:1px solid #2db7f5;color:#fff}.ui-button.ui-button-type-info:focus,.ui-button.ui-button-type-info:hover{background-color:rgba(45,183,245,.8)}.ui-button.ui-button-type-info.ui-button-disabled:focus,.ui-button.ui-button-type-info.ui-button-disabled:hover{color:#fff;border-color:#2db7f5;background-color:#2db7f5}.ui-button.ui-button-type-success{background-color:#0c6;border:1px solid #0c6;color:#fff}.ui-button.ui-button-type-success:focus,.ui-button.ui-button-type-success:hover{background-color:rgba(0,204,102,.8)}.ui-button.ui-button-type-success.ui-button-disabled:focus,.ui-button.ui-button-type-success.ui-button-disabled:hover{color:#fff;border-color:#0c6;background-color:#0c6}.ui-button.ui-button-type-warn{background-color:#f90;border:1px solid #f90;color:#fff}.ui-button.ui-button-type-warn:focus,.ui-button.ui-button-type-warn:hover{background-color:rgba(255,153,0,.8)}.ui-button.ui-button-type-warn.ui-button-disabled:focus,.ui-button.ui-button-type-warn.ui-button-disabled:hover{color:#fff;border-color:#f90;background-color:#f90}.ui-button.ui-button-type-error{background-color:#f50;border:1px solid #f50;color:#fff}.ui-button.ui-button-type-error:focus,.ui-button.ui-button-type-error:hover{background-color:rgba(255,85,0,.8)}.ui-button.ui-button-type-error.ui-button-disabled:focus,.ui-button.ui-button-type-error.ui-button-disabled:hover{color:#fff;border-color:#f50;background-color:#f50}.ui-button.ui-button-icon-only{padding:0;height:32px;line-height:32px;width:32px}.ui-button.ui-button-icon-only.ui-button-circle{border-radius:32px}.ui-button.ui-button-icon-only .ui-icon,.ui-button.ui-button-icon-only .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before,.ui-select.ui-select-multiple .ui-button.ui-button-icon-only .ui-select-item.ui-select-item-selected:before{margin:0;vertical-align:baseline}.ui-button.ui-button-disabled{cursor:not-allowed;opacity:.6}.ui-button .ui-icon,.ui-button .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before,.ui-select.ui-select-multiple .ui-button .ui-select-item.ui-select-item-selected:before{font-size:14px;margin-right:2px;vertical-align:middle}.ui-button .content{vertical-align:middle}.ui-carousel{position:relative;width:100%;overflow:hidden;opacity:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ui-carousel .ui-carousel-list{position:relative;width:100%;margin:0;padding:0;font-size:0;transition:transform .5s cubic-bezier(.23,1,.32,1)}.ui-carousel .ui-carousel-list .ui-carousel-list-item{display:inline-block;width:100%}.ui-carousel .ui-carousel-list .ui-carousel-list-item img{width:100%;height:auto}.ui-carousel .ui-carousel-dot{position:absolute;bottom:30px;width:100%;text-align:center}.ui-carousel .ui-carousel-dot .ui-carousel-dot-item{display:inline-block;width:16px;height:16px;margin:8px 8px;background-color:hsla(0,0%,100%,.5);cursor:pointer}.ui-carousel .ui-carousel-dot .ui-carousel-dot-item.current{background-color:#fff}.ui-table-swap{position:relative;border-top:1px solid #d7dde4;box-sizing:border-box}.ui-table-swap.ui-table-swap-border .ui-table .ui-table-tbody>tr>td,.ui-table-swap.ui-table-swap-border .ui-table .ui-table-thead>tr>th{border-right:1px solid #e3e8ee}.ui-table-swap.ui-table-swap-border .ui-table .ui-table-tbody>tr>td:first-child,.ui-table-swap.ui-table-swap-border .ui-table .ui-table-thead>tr>th:first-child{border-left:1px solid #e3e8ee}.ui-table-swap.ui-table-swap-border .ui-table-empty{border:1px solid #e3e8ee;border-top:0}.ui-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12px;color:#657180;text-align:left;overflow:hidden;color:#495060;background-color:#fff}.ui-table-tbody>tr>td,.ui-table-thead>tr>th{border-bottom:1px solid #e3e8ee;padding:16px 8px;word-break:break-all;position:relative}.ui-table-thead>tr>th{background:#f7f7f7;font-weight:700;color:#333}.ui-table-tbody>tr{transition:all .3s ease}.ui-table-tbody>tr:hover{background:#f3f3f3}.ui-table-thead>tr:hover{background:none}.ui-table .ui-table-action .ui-table-action-text{cursor:pointer;padding:0 16px;color:#39f;border-right:1px solid #e3e8ee}.ui-table .ui-table-action .ui-table-action-text:hover{color:#5cadff}.ui-table .ui-table-action .ui-table-action-text:last-child{border-right:none;padding-right:0}.ui-table .ui-table-action .ui-table-action-text:first-child{padding-left:0}.ui-table .ui-table-column-sorter{margin-left:4px;display:inline-block;width:14px;height:16px;line-height:16px;vertical-align:middle;text-align:center}.ui-table .ui-table-column-sorter .ui-table-column-sorter-down,.ui-table .ui-table-column-sorter .ui-table-column-sorter-up{display:block;height:7px;line-height:7px;cursor:pointer}.ui-select.ui-select-multiple .ui-table .ui-table-column-sorter .ui-table-column-sorter-down .ui-select-item.ui-select-item-selected:before,.ui-select.ui-select-multiple .ui-table .ui-table-column-sorter .ui-table-column-sorter-up .ui-select-item.ui-select-item-selected:before,.ui-table .ui-table-column-sorter .ui-table-column-sorter-down .ui-icon,.ui-table .ui-table-column-sorter .ui-table-column-sorter-down .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before,.ui-table .ui-table-column-sorter .ui-table-column-sorter-up .ui-icon,.ui-table .ui-table-column-sorter .ui-table-column-sorter-up .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before{height:7px;line-height:7px;font-size:16px;color:#c3cbd6}.ui-select.ui-select-multiple .ui-table .ui-table-column-sorter .ui-table-column-sorter-down.on .ui-select-item.ui-select-item-selected:before,.ui-select.ui-select-multiple .ui-table .ui-table-column-sorter .ui-table-column-sorter-down:hover .ui-select-item.ui-select-item-selected:before,.ui-select.ui-select-multiple .ui-table .ui-table-column-sorter .ui-table-column-sorter-up.on .ui-select-item.ui-select-item-selected:before,.ui-select.ui-select-multiple .ui-table .ui-table-column-sorter .ui-table-column-sorter-up:hover .ui-select-item.ui-select-item-selected:before,.ui-table .ui-table-column-sorter .ui-table-column-sorter-down.on .ui-icon,.ui-table .ui-table-column-sorter .ui-table-column-sorter-down.on .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before,.ui-table .ui-table-column-sorter .ui-table-column-sorter-down:hover .ui-icon,.ui-table .ui-table-column-sorter .ui-table-column-sorter-down:hover .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before,.ui-table .ui-table-column-sorter .ui-table-column-sorter-up.on .ui-icon,.ui-table .ui-table-column-sorter .ui-table-column-sorter-up.on .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before,.ui-table .ui-table-column-sorter .ui-table-column-sorter-up:hover .ui-icon,.ui-table .ui-table-column-sorter .ui-table-column-sorter-up:hover .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before{color:#333}.ui-table.ui-table-type-check .ui-table-first-th{margin-left:20px;margin-right:20px}.ui-table.ui-table-type-check .ui-checkbox-wrapper{margin-left:8px}.ui-table .ui-table-icon{cursor:pointer}.ui-table .ui-table-expanded-cell{width:100%;padding:20px 50px;background-color:#fbfdff}.ui-table .ui-table-detail-cell{width:100%;padding:20px 20px}.ui-table .ui-table-detail-icon{margin-left:4px;cursor:pointer}.ui-table .ui-table-edit-cell{display:flex;justify-content:space-evenly;align-items:center}.ui-table .ui-table-edit-cell .edit-icon{color:#39f;padding-left:6px;cursor:pointer}.ui-table .ui-table-th-headtip .ui-tooltip{width:100%}.ui-table-empty{padding:20px;text-align:center;font-size:12px;border-bottom:1px solid #e3e8ee}.ui-date-picker{display:inline-block;vertical-align:middle;position:relative;width:100%;height:32px}.ui-date-picker>.ui-readonly-input{width:100%}.ui-date-picker .range{min-width:196px}.ui-date-picker .range .range-separator{padding:0 12px}.ui-calendars{position:absolute;padding:1px}.ui-calendars.position{position:relative}.ui-calendars.inline{display:inline-block;background:#fff;border-radius:4px;border:1px solid #e3e8ee}.ui-calendars-range{display:flex;flex-direction:row}.ui-calendars-range .ui-calendar:first-child .ui-calendar-times-wrapper{border-right:1px solid #e3e8ee}.ui-calendars-footer{border-top:1px solid #e3e8ee}.ui-calendars-footer .inner-footer{text-align:right;padding:4px 8px}.ui-calendars-footer .inner-footer>.ui-button{padding:2px 8px}.ui-calendars-footer .inner-footer .select-time{margin-right:8px;cursor:pointer;color:#39f}.ui-calendars-footer .inner-footer .select-time.disabled{cursor:not-allowed;color:#657180}.ui-calendar{background:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:228px}.ui-calendar-head{display:flex;flex-direction:row;justify-content:space-between;line-height:34px;height:34px;border-bottom:1px solid #e3e8ee}.ui-calendar-head-middle{flex:2;text-align:center}.ui-calendar-head-left{flex:1;padding-left:8px}.ui-calendar-head-right{flex:1;padding-right:8px;text-align:right}.ui-calendar-head a{color:#666;font-weight:700;cursor:pointer;display:inline-block;text-align:center;font-size:13px;padding:0 2px;position:relative}.ui-calendar-head a:hover{color:#3091f2}.ui-calendar-head .icon{color:#9ea7b4!important;cursor:pointer;padding:0 2px}.ui-calendar-head .icon:hover{color:#5cadff!important}.ui-calendar-head .next-icon{margin-left:-4px}.ui-calendar-body{position:relative;width:100%;height:228px;padding:8px 12px}.ui-calendar-days{width:100%;height:100%;display:-ms-grid;display:grid;-ms-grid-columns:(1fr)[7];grid-template-columns:repeat(7,1fr)}.ui-calendar-date,.ui-calendar-week{font-weight:400;width:24px;height:24px;line-height:24px;text-align:center;box-sizing:border-box;overflow:hidden;border-radius:2px;place-self:center center}.ui-calendar-date:before,.ui-calendar-week:before{content:"";display:inline-block;height:100%;vertical-align:middle}.ui-calendar-date{cursor:pointer}.ui-calendar-date:hover{background:#f3f3f3}.ui-calendar-date-out{color:#ccc}.ui-calendar-date-on{background:#ebf5fd}.ui-calendar-date-today{border:1px solid #3091f2;color:#3091f2}.ui-calendar-date-today:hover{background:#fff}.ui-calendar-date-selected,.ui-calendar-date-selected:hover{color:#fff;font-weight:700;background:#3091f2}.ui-calendar-date-disabled{cursor:not-allowed!important;color:#bcbcbc!important;background:#f3f3f3!important}.ui-calendar-months,.ui-calendar-times-wrapper,.ui-calendar-years{width:100%;height:100%;position:absolute;background:#fff;left:0;top:0}.ui-calendar-times-wrapper{height:262px;top:-34px}.ui-calendar-months,.ui-calendar-years{display:-ms-grid;display:grid;-ms-grid-columns:(1fr)[3];grid-template-columns:repeat(3,1fr)}.ui-calendar-months span,.ui-calendar-years span{width:52px;padding:0 8px}.ui-calendar-times{width:100%;height:228px}.ui-calendar-times .ui-time-picker-content{padding:0;height:100%}.ui-calendar-times .ui-time-picker-content .picker-item{padding-bottom:196px;height:100%;flex:1}.ui-calendar-title{height:34px;line-height:34px;border-bottom:1px solid #e3e8ee;background:#fff;text-align:center;font-weight:700}.ui-table .tree-level-1{padding-left:16px!important}.ui-table .tree-level-2{padding-left:32px!important}.ui-table .tree-level-3{padding-left:48px!important}.ui-table .tree-level-4{padding-left:64px!important}.ui-loading{display:inline-block;vertical-align:top;background:transparent;border-radius:100%;animation:loading .75s linear 0s infinite;animation-fill-mode:both}.ui-message{position:fixed;top:0;right:0;bottom:0;left:0;-webkit-overflow-scrolling:touch;background-color:rgba(55,55,55,.6);overflow:hidden;outline:0;z-index:1000}.ui-message-swap{width:400px;padding:30px 40px;position:absolute;left:50%;top:40%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);background-color:#fff;background-clip:padding-box;border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.2);overflow:hidden}.ui-message-title-text{vertical-align:middle;line-height:24px;color:#666;font-weight:700;font-size:14px}.ui-message-title+.ui-message-content{margin-left:42px}.ui-message-content{margin-top:8px;margin-left:0}.ui-message-buttons{margin-top:30px;float:right}.ui-message-buttons .ui-button+.ui-button{margin-left:10px;margin-bottom:0}.ui-message .ui-icon-md-help-circle{color:#f90;font-size:24px;margin-right:16px;vertical-align:middle}.ui-modal-open{overflow:hidden}.ui-modal-open .ui-modal{overflow-x:hidden;overflow-y:auto}.ui-modal{position:fixed;top:0;right:0;bottom:0;left:0;background-color:rgba(55,55,55,.6);overflow:hidden;outline:0;-webkit-overflow-scrolling:touch;z-index:1000}.ui-modal.scroll{text-align:center}.ui-modal.scroll .ui-modal-dialog{text-align:left;position:relative;display:inline-block;left:0;top:0;margin:25px auto;transform:translate(0);-ms-transform:translate(0)}.ui-modal.full-screen .ui-modal-dialog{left:0;top:0;transform:inherit;width:100%;height:100%;margin:0}.ui-modal-dialog{position:absolute;padding:6px 20px;left:50%;top:20%;background-color:#fff;background-clip:padding-box;transform:translateX(-50%);-ms-transform:translateX(-50%);border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.2);overflow:hidden}.ui-modal-title{width:100%;border-bottom:1px solid #e3e8ee;position:relative}.ui-modal-title-main{display:inline-block;padding:14px 0;line-height:21px;font-size:14px;color:#464c5b;border-bottom:2px solid #39f}.ui-modal-title-sub{margin-left:10px;font-size:13px;color:#9ea7b4}.ui-modal-title .ui-icon-md-close,.ui-modal-title .ui-icon-md-resize{float:right;margin-top:16px;width:16px;height:16px;font-size:16px;font-weight:700;color:#999;cursor:pointer}.ui-modal-title .ui-icon-md-resize{font-size:14px;margin-right:10px}.ui-modal-body{position:relative;padding:16px 0}.ui-switch{position:relative;display:inline-block;min-width:44px;height:22px;line-height:22px;vertical-align:middle;text-align:left;color:#fff;border-radius:11px;cursor:pointer;outline:none}.ui-switch:focus:not(.ui-switch-disabled):not(.ui-switch-readonly){box-shadow:0 0 0 3px rgba(51,153,255,.2)}.ui-switch.ui-switch-disabled,.ui-switch.ui-switch-readonly{cursor:default}.ui-switch.ui-switch-on{background:#39f;padding-left:6px;padding-right:22px}.ui-switch.ui-switch-on .ui-switch-circle{top:1px;left:calc(100% - 21px)}.ui-switch.ui-switch-off{background:#ccc;padding-left:22px;padding-right:6px}.ui-switch.ui-switch-off .ui-switch-circle{top:1px;left:1px}.ui-switch .ui-switch-circle{position:absolute;width:20px;height:20px;background-color:#fff;border-radius:50%;transition:all .3s}.ui-toast-swap{position:fixed;width:100%;left:0;pointer-events:none;z-index:1010;text-align:center}.ui-toast-swap.ui-toast-swap-center{top:40%;transform:translateY(-50%);-ms-transform:translateY(-50%)}.ui-toast-swap.ui-toast-swap-top{top:20px}.ui-toast-parent{text-align:center;margin:10px auto}.ui-toast{display:inline-block;font-size:14px;padding:8px 16px;border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.2);background:#fff}.ui-select.ui-select-multiple .ui-toast-success .ui-select-item.ui-select-item-selected:before,.ui-toast-success .ui-icon,.ui-toast-success .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before{color:#0c6}.ui-select.ui-select-multiple .ui-toast-error .ui-select-item.ui-select-item-selected:before,.ui-toast-error .ui-icon,.ui-toast-error .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before{color:#f50}.ui-select.ui-select-multiple .ui-toast-warn .ui-select-item.ui-select-item-selected:before,.ui-toast-warn .ui-icon,.ui-toast-warn .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before{color:#f90}.ui-select.ui-select-multiple .ui-toast-info .ui-select-item.ui-select-item-selected:before,.ui-select.ui-select-multiple .ui-toast-loading .ui-select-item.ui-select-item-selected:before,.ui-toast-info .ui-icon,.ui-toast-info .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before,.ui-toast-loading .ui-icon,.ui-toast-loading .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before{color:#2db7f5}.ui-select.ui-select-multiple .ui-toast .ui-select-item.ui-select-item-selected:before,.ui-toast .ui-icon,.ui-toast .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before{margin-right:5px;font-size:16px;top:1px;position:relative}.ui-upload{display:inline-block}.ui-upload .ui-upload-file{display:none}.ui-zoom{position:fixed;left:0;right:0;margin:0 auto;top:0;z-index:1000;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;background-color:rgba(55,55,55,.6)}.ui-zoom-image{display:inline-block;margin:0;padding:0;background:#fff;box-shadow:0 2px 8px rgba(0,0,0,.2);position:relative}.ui-zoom-image .ui-zoom-close{cursor:pointer;position:absolute;width:20px;height:20px;right:-10px;top:-10px;background-color:#fff;border-radius:100%}.ui-zoom-image .ui-icon-md-close-circle{margin:0;color:#000;font-size:30px;line-height:20px}.ui-zoom-image img{display:block;height:auto}.ui-expand-arrow,.ui-expand-null{display:inline-block;margin:0;width:16px;height:16px;line-height:16px;vertical-align:middle;border:0;cursor:pointer;outline:none;position:relative;font-size:16px;margin-top:-2px;color:#657180;font-weight:700;transition:transform .3s ease}.ui-tree{width:100%;margin:0;padding:0;list-style:none;border:none}.ui-tree.ui-child-tree{padding:0 0 0 25px!important}.ui-tree-node{position:relative;margin:8px 0 0 0;padding:0;outline:0;list-style:none;white-space:nowrap;width:100%}.ui-tree-node i,.ui-tree-node input,.ui-tree-node span{cursor:pointer;vertical-align:middle}.ui-tree-node-text{display:inline-block;margin:0;padding:1px 5px;cursor:pointer;text-decoration:none;border-radius:2px;transition:all .3s cubic-bezier(.215,.61,.355,1)}.ui-tree-node-text.selected,.ui-tree-node-text:hover{background-color:#cfe8fb}.ui-tree .loading{display:inline-block;width:16px;height:16px;line-height:16px;margin-top:2px;vertical-align:middle;border:0 none;cursor:pointer;outline:none}.ui-tree.ui-tree-inline .ui-tree-just-data .ui-tree-node{display:inline-block;width:200px}.ui-steps{font-size:0;line-height:1.5}.ui-step{position:relative;display:inline-block;vertical-align:top;margin:0;padding:0}.ui-step .ui-step-tail{position:absolute;left:0;top:12px;width:100%;padding:0 10px}.ui-step .ui-step-tail i{width:100%;height:1px;background:#e3e8ee;border-radius:1px}.ui-step .ui-step-head,.ui-step .ui-step-tail i{position:relative;display:inline-block;vertical-align:top}.ui-step .ui-step-head{background-color:#fff;font-size:12px}.ui-step .ui-step-head-swap{width:24px;height:24px;line-height:23px;text-align:center;margin-right:6px;border-radius:100%;border:1px solid #39f;transition:background-color .2s cubic-bezier(.645,.045,.355,1)}.ui-step .ui-step-main{position:relative;display:inline;vertical-align:top;background-color:#fff}.ui-step .ui-step-title{display:inline-block;height:24px;line-height:24px;padding-right:6px;font-size:14px;font-weight:700;background-color:#fff}.ui-step .ui-step-desc{padding:0 0 10px 0;margin-left:32px;font-size:12px}.ui-select.ui-select-multiple .ui-step .ui-select-item.ui-select-item-selected,.ui-step .ui-icon-md-checkmark,.ui-step .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected{font-size:13px;font-weight:bolder;color:#39f}.ui-step.ui-step-ready .ui-step-head-swap{border-color:#ccc;color:#999}.ui-step.ui-step-ready .ui-step-main{color:#999}.ui-step.ui-step-doing .ui-step-head-swap{border-color:#39f;background-color:#39f;color:#fff}.ui-step.ui-step-doing .ui-step-main{color:#666}.ui-step.ui-step-doing .ui-step-tail i{background-color:#39f}.ui-step.ui-step-done .ui-step-main{color:#999}.ui-step.ui-step-done .ui-step-tail i{background-color:#39f}.ui-steps.ui-steps-small .ui-step-tail{top:9px;padding:0 5px}.ui-steps.ui-steps-small .ui-step-head-swap{width:18px;height:18px;line-height:17px;margin-right:5px}.ui-steps.ui-steps-small .ui-step-title{height:18px;line-height:18px;padding-right:5px;font-size:12px}.ui-steps.ui-steps-small .ui-step-desc{display:none}.ui-select.ui-select-multiple .ui-steps.ui-steps-small .ui-select-item.ui-select-item-selected,.ui-steps.ui-steps-small .ui-icon-md-checkmark,.ui-steps.ui-steps-small .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected{font-size:12px;font-size:7px\9;transform:scale(.7) rotate(0deg);-ms-transform:scale(.7) rotate(0deg)}.ui-steps.ui-steps-vertical .ui-step{display:block}.ui-steps.ui-steps-vertical .ui-step .ui-step-tail{left:12px;top:30px;width:0;height:auto;bottom:10px;padding:0}.ui-steps.ui-steps-vertical .ui-step .ui-step-tail i{width:1px;height:100%}.ui-steps.ui-steps-vertical .ui-step .ui-step-desc{padding:5px 0 20px 0}.ui-tooltip{z-index:1060;display:block;padding:2px}.ui-tooltip .ui-tooltip-swap{position:relative}.ui-tooltip-inner{min-height:34px;padding:8px 10px;color:#fff;background-color:rgba(70,76,91,.9);border-radius:4px;box-shadow:0 1px 6px rgba(0,0,0,.2);letter-spacing:normal;text-align:left;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal}.ui-tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid;box-sizing:content-box}.ui-tooltip-arrow:after{display:block;position:absolute;left:-5px;top:-6px;content:"";width:0;height:0}.ui-tooltip.ui-tooltip-direction-top{transform:translateY(-100%);-ms-transform:translateY(-100%)}.ui-tooltip.ui-tooltip-direction-top .ui-tooltip-swap{padding:5px 0}.ui-tooltip.ui-tooltip-direction-top .ui-tooltip-inner{box-shadow:0 -1px 6px rgba(0,0,0,.2)}.ui-tooltip.ui-tooltip-direction-top .ui-tooltip-arrow{bottom:1px;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:rgba(70,76,91,.9)}.ui-tooltip.ui-tooltip-direction-top.ui-tooltip-align-left .ui-tooltip-arrow{left:0;margin-left:15px}.ui-tooltip.ui-tooltip-direction-top.ui-tooltip-align-center{transform:translate(-50%,-100%);-ms-transform:translate(-50%,-100%)}.ui-tooltip.ui-tooltip-direction-top.ui-tooltip-align-right{transform:translate(-100%,-100%);-ms-transform:translate(-100%,-100%)}.ui-tooltip.ui-tooltip-direction-top.ui-tooltip-align-right .ui-tooltip-arrow{left:auto;right:0;margin-right:15px}.ui-tooltip.ui-tooltip-direction-top.ui-tooltip-confirm .ui-tooltip-arrow,.ui-tooltip.ui-tooltip-direction-top.ui-tooltip-rich .ui-tooltip-arrow{border-top-color:hsla(0,0%,85.1%,.5)}.ui-tooltip.ui-tooltip-direction-top.ui-tooltip-confirm .ui-tooltip-arrow:after,.ui-tooltip.ui-tooltip-direction-top.ui-tooltip-rich .ui-tooltip-arrow:after{border-color:transparent;border-style:solid;border-width:5px;border-bottom-width:0;border-top-color:#fff}.ui-tooltip.ui-tooltip-direction-bottom .ui-tooltip-swap{padding:5px 0}.ui-tooltip.ui-tooltip-direction-bottom .ui-tooltip-inner{box-shadow:0 1px 6px rgba(0,0,0,.2)}.ui-tooltip.ui-tooltip-direction-bottom .ui-tooltip-arrow{top:1px;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:rgba(70,76,91,.9)}.ui-tooltip.ui-tooltip-direction-bottom.ui-tooltip-align-left .ui-tooltip-arrow{left:0;margin-left:15px}.ui-tooltip.ui-tooltip-direction-bottom.ui-tooltip-align-center{transform:translateX(-50%);-ms-transform:translateX(-50%)}.ui-tooltip.ui-tooltip-direction-bottom.ui-tooltip-align-right{transform:translateX(-100%);-ms-transform:translateX(-100%)}.ui-tooltip.ui-tooltip-direction-bottom.ui-tooltip-align-right .ui-tooltip-arrow{left:auto;right:0;margin-right:15px}.ui-tooltip.ui-tooltip-direction-bottom.ui-tooltip-confirm .ui-tooltip-arrow,.ui-tooltip.ui-tooltip-direction-bottom.ui-tooltip-rich .ui-tooltip-arrow{border-bottom-color:hsla(0,0%,85.1%,.5)}.ui-tooltip.ui-tooltip-direction-bottom.ui-tooltip-confirm .ui-tooltip-arrow:after,.ui-tooltip.ui-tooltip-direction-bottom.ui-tooltip-rich .ui-tooltip-arrow:after{border-color:transparent;border-style:solid;border-width:5px;border-top-width:0;border-bottom-color:#fff;top:1px}.ui-tooltip.ui-tooltip-direction-left{transform:translate(-100%);-ms-transform:translate(-100%)}.ui-tooltip.ui-tooltip-direction-left .ui-tooltip-swap{padding:0 5px}.ui-tooltip.ui-tooltip-direction-left .ui-tooltip-inner{box-shadow:-1px 0 6px rgba(0,0,0,.2)}.ui-tooltip.ui-tooltip-direction-left .ui-tooltip-arrow{top:50%;right:1px;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:rgba(70,76,91,.9)}.ui-tooltip.ui-tooltip-direction-left.ui-tooltip-align-top .ui-tooltip-arrow{top:0;margin-top:8px}.ui-tooltip.ui-tooltip-direction-left.ui-tooltip-align-center{transform:translate(-100%,-50%);-ms-transform:translate(-100%,-50%)}.ui-tooltip.ui-tooltip-direction-left.ui-tooltip-align-bottom{transform:translate(-100%,-100%);-ms-transform:translate(-100%,-100%)}.ui-tooltip.ui-tooltip-direction-left.ui-tooltip-align-bottom .ui-tooltip-arrow{top:auto;bottom:0;margin-bottom:8px}.ui-tooltip.ui-tooltip-direction-left.ui-tooltip-confirm .ui-tooltip-arrow,.ui-tooltip.ui-tooltip-direction-left.ui-tooltip-rich .ui-tooltip-arrow{border-left-color:hsla(0,0%,85.1%,.5)}.ui-tooltip.ui-tooltip-direction-left.ui-tooltip-confirm .ui-tooltip-arrow:after,.ui-tooltip.ui-tooltip-direction-left.ui-tooltip-rich .ui-tooltip-arrow:after{border-color:transparent;border-style:solid;border-width:5px;border-right-width:0;border-left-color:#fff;left:-6px;top:-5px}.ui-tooltip.ui-tooltip-direction-right .ui-tooltip-swap{padding:0 5px}.ui-tooltip.ui-tooltip-direction-right .ui-tooltip-inner{box-shadow:1px 0 6px rgba(0,0,0,.2)}.ui-tooltip.ui-tooltip-direction-right .ui-tooltip-arrow{top:50%;left:1px;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:rgba(70,76,91,.9)}.ui-tooltip.ui-tooltip-direction-right.ui-tooltip-align-top .ui-tooltip-arrow{top:0;margin-top:8px}.ui-tooltip.ui-tooltip-direction-right.ui-tooltip-align-center{transform:translateY(-50%);-ms-transform:translateY(-50%)}.ui-tooltip.ui-tooltip-direction-right.ui-tooltip-align-bottom{transform:translateY(-100%);-ms-transform:translateY(-100%)}.ui-tooltip.ui-tooltip-direction-right.ui-tooltip-align-bottom .ui-tooltip-arrow{top:auto;bottom:0;margin-bottom:8px}.ui-tooltip.ui-tooltip-direction-right.ui-tooltip-confirm .ui-tooltip-arrow,.ui-tooltip.ui-tooltip-direction-right.ui-tooltip-rich .ui-tooltip-arrow{border-right-color:hsla(0,0%,85.1%,.5)}.ui-tooltip.ui-tooltip-direction-right.ui-tooltip-confirm .ui-tooltip-arrow:after,.ui-tooltip.ui-tooltip-direction-right.ui-tooltip-rich .ui-tooltip-arrow:after{border-color:transparent;border-style:solid;border-width:5px;border-left-width:0;border-right-color:#fff;left:auto;right:-6px;top:-5px}.ui-tooltip.ui-tooltip-confirm .ui-tooltip-inner,.ui-tooltip.ui-tooltip-rich .ui-tooltip-inner{color:#657180;background-color:#fff;box-shadow:0 1px 6px rgba(0,0,0,.2)}.ui-tooltip.ui-tooltip-confirm .ui-icon-md-help-circle{color:#f90;font-size:16px;margin-right:8px}.ui-tooltip.ui-tooltip-confirm .ui-tooltip-buttons{text-align:right;padding:8px 6px}.ui-tooltip.ui-tooltip-confirm .ui-tooltip-buttons button:first-child{color:#fff;background-color:#39f;border-color:#39f}.ui-tooltip.ui-tooltip-confirm .ui-tooltip-buttons button+button{margin-left:10px;margin-bottom:0}.ui-tooltip.ui-tooltip-confirm .ui-button{font-size:12px;margin:0;padding:4px 6px}.ui-tooltip.ui-tooltip-confirm .ui-tooltip-text{padding:8px 6px}.ui-tooltip.ui-tooltip-confirm .ui-tooltip-inner{min-width:160px}.ui-tabs{box-sizing:border-box;position:relative;zoom:1;color:#657180}.ui-tabs .ui-tabs-header{display:flex;width:100%;margin-bottom:16px;font-size:0;border-bottom:1px solid #e3e8ee}.ui-tabs .ui-tabs-header .ui-tabs-header-container{position:relative;overflow:hidden;flex:1}.ui-tabs .ui-tabs-header .ui-tabs-header-scroll{padding:0 30px}.ui-tabs .ui-tabs-header .ui-tabs-header-scroll .button-left,.ui-tabs .ui-tabs-header .ui-tabs-header-scroll .button-right{position:absolute;padding:10px 6px;color:#909399;background:#fff;z-index:100;cursor:pointer}.ui-tabs .ui-tabs-header .ui-tabs-header-scroll .button-left:hover,.ui-tabs .ui-tabs-header .ui-tabs-header-scroll .button-right:hover{color:rgba(51,153,255,.9)}.ui-tabs .ui-tabs-header .ui-tabs-header-scroll .button-left.disabled,.ui-tabs .ui-tabs-header .ui-tabs-header-scroll .button-right.disabled{color:#ccc;cursor:not-allowed}.ui-tabs .ui-tabs-header .ui-tabs-header-scroll .button-left{left:-1px}.ui-tabs .ui-tabs-header .ui-tabs-header-scroll .button-right{right:-1px}.ui-tabs .ui-tabs-header.ui-tabs-header-card .ui-tabs-header-item{padding:0;position:relative}.ui-tabs .ui-tabs-header.ui-tabs-header-card .ui-tabs-header-item .ui-tabs-header-label{padding:8px 30px;border-left:1px solid #e3e8ee;border-bottom:1px solid transparent;border-top:1px solid #e3e8ee;margin-left:0;border-right:none}.ui-tabs .ui-tabs-header.ui-tabs-header-card .ui-tabs-header-item:last-child .ui-tabs-header-label{border-right:1px solid #e3e8ee}.ui-tabs .ui-tabs-header.ui-tabs-header-card .ui-tabs-header-item.ui-tabs-header-current .ui-tabs-header-label:after{bottom:-1px}.ui-tabs .ui-tabs-header .ui-tabs-header-swap{white-space:nowrap;float:left;transition:.5s cubic-bezier(.645,.045,.355,1)}.ui-tabs .ui-tabs-header .ui-tabs-header-item{position:relative;padding:0 10px;display:inline-block;vertical-align:middle;font-size:14px;cursor:pointer;transition:color .3s cubic-bezier(.645,.045,.355,1)}.ui-tabs .ui-tabs-header .ui-tabs-header-item .ui-tabs-header-label{position:relative;padding:8px 20px}.ui-select.ui-select-multiple .ui-tabs .ui-tabs-header .ui-tabs-header-item.ui-tabs-header-current .ui-select-item.ui-select-item-selected:before,.ui-tabs .ui-tabs-header .ui-tabs-header-item.ui-tabs-header-current,.ui-tabs .ui-tabs-header .ui-tabs-header-item.ui-tabs-header-current .ui-icon,.ui-tabs .ui-tabs-header .ui-tabs-header-item.ui-tabs-header-current .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before{color:rgba(51,153,255,.9)}.ui-tabs .ui-tabs-header .ui-tabs-header-item.ui-tabs-header-current .ui-tabs-header-label:after{content:"";position:absolute;z-index:1;bottom:0;left:0;width:100%;height:2px;background:rgba(51,153,255,.9)}.ui-tabs .ui-tabs-header .ui-tabs-header-item.ui-tabs-header-disabled{pointer-events:none;cursor:default;color:#ccc}.ui-select.ui-select-multiple .ui-tabs .ui-tabs-header .ui-tabs-header-item.ui-tabs-header-disabled .ui-select-item.ui-select-item-selected:before,.ui-tabs .ui-tabs-header .ui-tabs-header-item.ui-tabs-header-disabled .ui-icon,.ui-tabs .ui-tabs-header .ui-tabs-header-item.ui-tabs-header-disabled .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before{color:#ccc}.ui-tabs .ui-tabs-header .ui-tabs-header-item.ui-tabs-header-draging{opacity:.5;background:#f3f3f3}.ui-tabs .ui-tabs-header .ui-tabs-header-item:hover .button-close{display:inline-block}.ui-tabs .ui-tabs-header .ui-tabs-header-item .button-close{display:none;position:absolute;right:6px;top:10px}.ui-tabs .ui-tabs-header .ui-tabs-header-item .button-close:hover{color:rgba(51,153,255,.9)}.ui-tabs .ui-tab-buttons{padding:0 16px}.ui-tabs .ui-tabs-body{width:100%;position:relative}.ui-tab{width:100%}.ui-page{font-size:0;display:flex;align-items:center}.ui-page-item{display:block;margin-right:4px;padding:0 10px;height:32px;line-height:30px;text-align:center;list-style:none;background-color:#fff;color:#657180;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;font-family:Arial;font-size:12px;border:1px solid #d7dde4;border-radius:6px;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ui-page-item:hover{border-color:#39f;color:#39f}.ui-page-item-active{background-color:#39f;border-color:#39f;color:#fff}.ui-page-item-active:hover{color:#fff}.ui-page-item-jump-next:after,.ui-page-item-jump-prev:after{content:"•••";display:block;letter-spacing:1px;color:#657180;text-align:center}.ui-page-item-jump-next:hover:after,.ui-page-item-jump-next i,.ui-page-item-jump-prev:hover:after,.ui-page-item-jump-prev i{display:none}.ui-page-item-jump-next:hover i,.ui-page-item-jump-prev:hover i{display:inline-block}.ui-page-item-jump-next,.ui-page-item-jump-prev{margin-right:4px}.ui-page-prev{margin-right:8px}.ui-page-next{margin-left:4px}.ui-page-item-jump-next,.ui-page-item-jump-prev,.ui-page-next,.ui-page-prev{display:block;width:32px;height:32px;line-height:30px;list-style:none;text-align:center;cursor:pointer;color:#666;font-size:12px;font-family:Arial;border:1px solid #d7dde4;border-radius:6px;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ui-page-next,.ui-page-prev{background-color:#fff}.ui-page-next:hover,.ui-page-prev:hover{border-color:#39f;color:#39f}.ui-page-disabled,.ui-page-disabled:hover{cursor:not-allowed;color:#ccc}.ui-page-disabled:hover{border-color:#d7dde4}.ui-page .ui-page-select{width:75px;height:32px;text-align:center;list-style:none;background-color:#fff;cursor:pointer;font-family:Arial}.ui-page .ui-page-quick-jumper,.ui-page .ui-page-select{display:block;margin-left:16px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:12px}.ui-page .ui-page-quick-jumper .jumper-input{width:44px;margin:0 4px}.ui-page .ui-select .ui-select-selection{border-radius:6px}.ui-page .second-icon{margin-left:-4px}.ui-row{position:relative;display:block;margin-left:0;margin-right:0;height:auto;zoom:1}.ui-row:after,.ui-row:before{content:" ";display:table}.ui-row:after{clear:both;visibility:hidden;font-size:0;height:0}.ui-cell{position:relative;display:block}.ui-cell-span-1{width:4.16667%;float:left;flex:0 0 auto}.ui-cell-offset-1{margin-left:4.16667%}.ui-cell-span-2{width:8.33333%;float:left;flex:0 0 auto}.ui-cell-offset-2{margin-left:8.33333%}.ui-cell-span-3{width:12.5%;float:left;flex:0 0 auto}.ui-cell-offset-3{margin-left:12.5%}.ui-cell-span-4{width:16.66667%;float:left;flex:0 0 auto}.ui-cell-offset-4{margin-left:16.66667%}.ui-cell-span-5{width:20.83333%;float:left;flex:0 0 auto}.ui-cell-offset-5{margin-left:20.83333%}.ui-cell-span-6{width:25%;float:left;flex:0 0 auto}.ui-cell-offset-6{margin-left:25%}.ui-cell-span-7{width:29.16667%;float:left;flex:0 0 auto}.ui-cell-offset-7{margin-left:29.16667%}.ui-cell-span-8{width:33.33333%;float:left;flex:0 0 auto}.ui-cell-offset-8{margin-left:33.33333%}.ui-cell-span-9{width:37.5%;float:left;flex:0 0 auto}.ui-cell-offset-9{margin-left:37.5%}.ui-cell-span-10{width:41.66667%;float:left;flex:0 0 auto}.ui-cell-offset-10{margin-left:41.66667%}.ui-cell-span-11{width:45.83333%;float:left;flex:0 0 auto}.ui-cell-offset-11{margin-left:45.83333%}.ui-cell-span-12{width:50%;float:left;flex:0 0 auto}.ui-cell-offset-12{margin-left:50%}.ui-cell-span-13{width:54.16667%;float:left;flex:0 0 auto}.ui-cell-offset-13{margin-left:54.16667%}.ui-cell-span-14{width:58.33333%;float:left;flex:0 0 auto}.ui-cell-offset-14{margin-left:58.33333%}.ui-cell-span-15{width:62.5%;float:left;flex:0 0 auto}.ui-cell-offset-15{margin-left:62.5%}.ui-cell-span-16{width:66.66667%;float:left;flex:0 0 auto}.ui-cell-offset-16{margin-left:66.66667%}.ui-cell-span-17{width:70.83333%;float:left;flex:0 0 auto}.ui-cell-offset-17{margin-left:70.83333%}.ui-cell-span-18{width:75%;float:left;flex:0 0 auto}.ui-cell-offset-18{margin-left:75%}.ui-cell-span-19{width:79.16667%;float:left;flex:0 0 auto}.ui-cell-offset-19{margin-left:79.16667%}.ui-cell-span-20{width:83.33333%;float:left;flex:0 0 auto}.ui-cell-offset-20{margin-left:83.33333%}.ui-cell-span-21{width:87.5%;float:left;flex:0 0 auto}.ui-cell-offset-21{margin-left:87.5%}.ui-cell-span-22{width:91.66667%;float:left;flex:0 0 auto}.ui-cell-offset-22{margin-left:91.66667%}.ui-cell-span-23{width:95.83333%;float:left;flex:0 0 auto}.ui-cell-offset-23{margin-left:95.83333%}.ui-cell-span-24{width:100%;float:left;flex:0 0 auto}.ui-cell-offset-24{margin-left:100%}.ui-input-swap,.ui-input-swap .ui-input{display:inline-block;width:100%;position:relative;vertical-align:middle}.ui-input-swap{font-size:0}.ui-input-swap.ui-input-disabled .ui-input-icon,.ui-input-swap.ui-input-readonly .ui-input-icon{cursor:default}.ui-input-swap.ui-input-group{display:table;width:100%;border-collapse:separate;position:relative;font-size:12px}.ui-input-swap.ui-input-group .ui-input{display:table-cell}.ui-input-swap.ui-input-group-prepend .ui-input{border-bottom-left-radius:0!important;border-top-left-radius:0!important}.ui-input-swap.ui-input-group-append .ui-input{border-bottom-right-radius:0!important;border-top-right-radius:0!important}.ui-input-swap .ui-input{height:32px;padding:4px 8px;border:1px solid #d7dde4;outline:0;background-image:none;line-height:1.5;font-size:12px;border-radius:4px;color:#657180;background-color:#fff;cursor:text;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out}.ui-input-swap .ui-input:hover{border-color:#5cadff}.ui-input-swap .ui-input:focus{border-color:#5cadff;box-shadow:0 0 0 3px rgba(51,153,255,.2)}.ui-input-swap .ui-input[readonly]{cursor:auto}.ui-input-swap .ui-input[readonly]:focus,.ui-input-swap .ui-input[readonly]:hover{border-color:#d7dde4;box-shadow:none}.ui-input-swap .ui-input[disabled]{opacity:1;background-color:#f3f3f3;cursor:not-allowed}.ui-input-swap .ui-input[disabled]:focus,.ui-input-swap .ui-input[disabled]:hover{border-color:#d7dde4;box-shadow:none}.ui-input-swap .ui-input:not(:last-child){border-bottom-right-radius:0!important;border-top-right-radius:0!important}.ui-input-swap textarea.ui-input{max-width:100%;height:auto;word-wrap:break-word;word-break:break-all;overflow:auto}.ui-input-swap .ui-input-content{position:relative}.ui-input-swap .ui-input-icon{width:32px;height:32px;line-height:32px;font-size:16px;text-align:center;color:#9ea7b4;cursor:pointer;position:absolute;right:0;z-index:1}.ui-input-swap .ui-input-icon+.ui-input-icon{right:32px}.ui-input-swap .ui-input-icon+.ui-input-icon+.ui-input-icon{right:64px}.ui-input-swap .ui-input-icon+.ui-input{padding-right:32px}.ui-input-swap .ui-input-icon+.ui-input-icon+.ui-input{padding-right:64px}.ui-input-swap .ui-input-append,.ui-input-swap .ui-input-prepend{display:table-cell;width:1px;padding:4px 8px;vertical-align:middle;white-space:nowrap;font-size:inherit;font-weight:400;line-height:1;color:#657180;text-align:center;background-color:#eee;border:1px solid #d7dde4;border-radius:4px}.ui-input-swap .ui-input-prepend{border-bottom-right-radius:0!important;border-top-right-radius:0!important;border-right:0}.ui-input-swap .ui-input-append{border-bottom-left-radius:0!important;border-top-left-radius:0!important;border-left:0}.ui-input-swap.ui-input-password,.ui-input-swap.ui-input-text{vertical-align:middle}.ui-input-swap.ui-input-password input{letter-spacing:.3em}.ui-input-swap.ui-input-password input::-moz-placeholder,.ui-input-swap.ui-input-password textarea::-moz-placeholder{letter-spacing:normal}.ui-input-swap.ui-input-password input:-ms-input-placeholder,.ui-input-swap.ui-input-password textarea:-ms-input-placeholder{letter-spacing:normal}.ui-input-swap.ui-input-password input::-webkit-input-placeholder,.ui-input-swap.ui-input-password textarea::-webkit-input-placeholder{letter-spacing:normal}.ui-input-swap.ui-input-number{vertical-align:middle}.ui-input-swap.ui-input-textarea{line-height:1.5;vertical-align:top}.ui-input-swap .ui-input-file-text{display:inline-block;margin-left:8px;vertical-align:middle;font-size:12px}.ui-select{display:inline-block;width:100%;vertical-align:middle;color:#657180;font-size:14px;position:relative;line-height:normal}.ui-select.ui-select-visible .ui-icon-md-arrow-dropdown{transform:translateX(-3px) translateY(-50%) rotate(180deg);-ms-transform:translateX(-3px) translateY(-50%) rotate(180deg)}.ui-select.ui-select-visible .ui-select-selection{border-color:#5cadff}.ui-select.ui-select-visible .ui-select-selection .ui-icon-md-arrow-dropdown,.ui-select.ui-select-visible .ui-select-selection .ui-icon-md-close-circle{color:#5cadff}.ui-select.ui-select-disabled{background-color:#f3f3f3}.ui-select.ui-select-disabled .ui-select-selection{cursor:not-allowed;background-color:#f3f3f3}.ui-select.ui-select-disabled .ui-select-selection:focus,.ui-select.ui-select-disabled .ui-select-selection:hover{border-color:#d7dde4;box-shadow:none}.ui-select.ui-select-disabled .ui-select-selection:focus .ui-icon-md-arrow-dropdown,.ui-select.ui-select-disabled .ui-select-selection:focus .ui-icon-md-close-circle,.ui-select.ui-select-disabled .ui-select-selection:hover .ui-icon-md-arrow-dropdown,.ui-select.ui-select-disabled .ui-select-selection:hover .ui-icon-md-close-circle{color:#9ea7b4}.ui-select.ui-select-readonly .ui-select-selection{cursor:default}.ui-select.ui-select-readonly .ui-select-selection:focus,.ui-select.ui-select-readonly .ui-select-selection:hover{border-color:#d7dde4;box-shadow:none}.ui-select.ui-select-readonly .ui-select-selection:focus .ui-icon-md-arrow-dropdown,.ui-select.ui-select-readonly .ui-select-selection:focus .ui-icon-md-close-circle,.ui-select.ui-select-readonly .ui-select-selection:hover .ui-icon-md-arrow-dropdown,.ui-select.ui-select-readonly .ui-select-selection:hover .ui-icon-md-close-circle{color:#9ea7b4}.ui-select .ui-select-selection{position:relative;width:100%;border:1px solid #d7dde4;outline:0;font-size:12px;border-radius:4px;background-color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;transition:all .2s ease-in-out}.ui-select .ui-select-selection:focus,.ui-select .ui-select-selection:hover{border-color:#5cadff}.ui-select .ui-select-selection:focus .ui-icon-md-arrow-dropdown,.ui-select .ui-select-selection:focus .ui-icon-md-close-circle,.ui-select .ui-select-selection:hover .ui-icon-md-arrow-dropdown,.ui-select .ui-select-selection:hover .ui-icon-md-close-circle{color:#5cadff}.ui-select .ui-select-selection:focus{box-shadow:0 0 0 3px rgba(51,153,255,.2)}.ui-select .ui-select-selection-icons{position:absolute;right:8px;top:0;bottom:0;width:12px}.ui-select .ui-icon-md-arrow-dropdown,.ui-select .ui-icon-md-close-circle{position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);color:#9ea7b4;z-index:1;font-size:18px}.ui-select .ui-icon-md-close-circle{z-index:2}.ui-select .ui-select-placeholder,.ui-select .ui-select-selected-value{border:0;border-radius:4px}.ui-select .ui-select-placeholder,.ui-select .ui-select-selected-input,.ui-select .ui-select-selected-value{display:block;width:100%;height:30px;line-height:30px;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-left:8px;padding-right:24px;color:#657180}.ui-select .ui-select-selected-input{margin-bottom:5px;border:0;outline:0;border-bottom:1px solid #e3e8ee}.ui-select .ui-select-placeholder{color:#c3cbd6}.ui-select .ui-select-dropdown{position:absolute;top:32px;width:100%;max-height:200px;margin:5px 0;padding:5px 0;overflow-y:auto;overflow-x:hidden;background-color:#fff;z-index:900;border-radius:4px;box-shadow:0 1px 6px rgba(0,0,0,.2)}.ui-select .ui-select-dropdown.no-option-children{max-height:250px}.ui-select .ui-select-dropdown-list{margin:0}.ui-select .ui-select-item{margin:0;padding:7px 16px;color:#657180;font-size:12px!important;line-height:normal;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;list-style:none;cursor:pointer;clear:both;transition:background .2s ease-in-out}.ui-select .ui-select-item.focus{background:#f3f3f3}.ui-select .ui-select-item.ui-select-item-disabled,.ui-select .ui-select-item.ui-select-item-disabled.focus{color:#c3cbd6;cursor:not-allowed;background:transparent}.ui-select .ui-select-item.ui-select-item-selected,.ui-select .ui-select-item.ui-select-item-selected.focus{color:rgba(51,153,255,.9)}.ui-select .ui-select-pagination{margin:0;padding:0 16px;color:#657180;font-size:16px;line-height:normal;white-space:nowrap;list-style:none;clear:both;text-align:center}.ui-select .ui-select-pagination .ui-button{margin-right:8px;margin-left:8px}.ui-select.ui-select-multiple .ui-select-multiple-selected{min-height:30px}.ui-select.ui-select-multiple .ui-select-selected-value{display:inline-block;padding:0 6px;margin:3px 4px 2px 4px;height:22px;line-height:20px;width:auto;border:1px solid #e3e8ee;background-color:#f7f7f7}.ui-select.ui-select-multiple .ui-select-selected-value .ui-icon,.ui-select.ui-select-multiple .ui-select-selected-value .ui-select-item.ui-select-item-selected:before{margin-left:6px}.ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before{display:block;float:right;color:rgba(51,153,255,.9)}.ui-radio-wrapper{display:inline-block;position:relative;vertical-align:middle;white-space:nowrap;margin-right:8px;cursor:pointer;outline:none;transition:all .2s ease-in-out}.ui-radio-wrapper.ui-radio-wrapper-readonly,.ui-radio-wrapper.ui-radio-wrapper-readonly .ui-radio,.ui-radio-wrapper.ui-radio-wrapper-readonly .ui-radio-input{cursor:default}.ui-radio-wrapper.ui-radio-wrapper-disabled{color:#9ea7b4;cursor:not-allowed}.ui-radio-wrapper.ui-radio-wrapper-disabled .ui-radio,.ui-radio-wrapper.ui-radio-wrapper-disabled .ui-radio-input{cursor:not-allowed}.ui-radio-wrapper:hover:not(.ui-radio-wrapper-disabled):not(.ui-radio-wrapper-readonly) .ui-radio-inner{border-color:#39f}.ui-radio-wrapper.ui-radio-wrapper-focus:not(.ui-radio-wrapper-disabled):not(.ui-radio-wrapper-readonly) .ui-radio-inner,.ui-radio-wrapper:focus:not(.ui-radio-wrapper-disabled):not(.ui-radio-wrapper-readonly) .ui-radio-inner{box-shadow:0 0 0 3px rgba(51,153,255,.2)}.ui-radio{display:inline-block;position:relative;margin-right:2px;white-space:nowrap;outline:0;line-height:1;vertical-align:middle;cursor:pointer}.ui-radio.ui-radio-checked .ui-radio-inner{border-color:#39f}.ui-radio.ui-radio-checked .ui-radio-inner:before{opacity:1;transform:scale(1)}.ui-radio-inner{display:block;position:relative;height:14px;width:14px;background-color:#fff;border:1px solid #d7dde4;border-radius:50%;transition:all .2s ease-in-out}.ui-radio-inner:before{position:absolute;left:2px;top:2px;height:8px;width:8px;background-color:#39f;border-radius:8px;content:" ";transition:all .2s ease-in-out;opacity:0;transform:scale(0)}.ui-radio-input{position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;opacity:0;cursor:pointer}.ui-radio-content{vertical-align:middle}.ui-radio-group{display:inline-block;outline:none}.ui-radio-group .ui-radio-wrapper{margin-right:16px}.ui-radio-group.ui-radio-group-vertical .ui-radio-wrapper{display:block;height:30px;line-height:30px}.ui-radio-group.ui-radio-group-button{font-size:0}.ui-radio-group.ui-radio-group-button .ui-radio-wrapper{position:relative;height:32px;line-height:30px;padding:0 16px;margin:0;font-size:12px;border:1px solid #d7dde4;background-color:#fff;border-left-width:0;cursor:pointer}.ui-radio-group.ui-radio-group-button .ui-radio-wrapper:first-child{border-left-width:1px;border-radius:4px 0 0 4px}.ui-radio-group.ui-radio-group-button .ui-radio-wrapper:last-child{border-radius:0 4px 4px 0}.ui-radio-group.ui-radio-group-button .ui-radio-wrapper:first-child:last-child{border-radius:4px 4px 4px 4px}.ui-radio-group.ui-radio-group-button .ui-radio-wrapper:hover{color:#5cadff}.ui-radio-group.ui-radio-group-button .ui-radio-wrapper.ui-radio-wrapper-focus,.ui-radio-group.ui-radio-group-button .ui-radio-wrapper:focus{color:#5cadff;box-shadow:0 0 0 3px rgba(51,153,255,.2);z-index:2}.ui-radio-group.ui-radio-group-button .ui-radio-wrapper.ui-radio-wrapper-checked{border-color:#39f;color:#39f}.ui-radio-group.ui-radio-group-button .ui-radio-wrapper.ui-radio-wrapper-checked:after{position:absolute;top:0;bottom:0;left:-1px;width:1px;content:" ";background:#39f;z-index:1}.ui-radio-group.ui-radio-group-button .ui-radio-wrapper.ui-radio-wrapper-readonly{cursor:default}.ui-radio-group.ui-radio-group-button .ui-radio-wrapper.ui-radio-wrapper-readonly.ui-radio-wrapper-focus,.ui-radio-group.ui-radio-group-button .ui-radio-wrapper.ui-radio-wrapper-readonly:focus,.ui-radio-group.ui-radio-group-button .ui-radio-wrapper.ui-radio-wrapper-readonly:hover{color:#657180;box-shadow:none}.ui-radio-group.ui-radio-group-button .ui-radio-wrapper.ui-radio-wrapper-disabled{background-color:#f7f7f7;border-color:#d7dde4;cursor:not-allowed}.ui-radio-group.ui-radio-group-button .ui-radio-wrapper.ui-radio-wrapper-disabled.ui-radio-wrapper-focus,.ui-radio-group.ui-radio-group-button .ui-radio-wrapper.ui-radio-wrapper-disabled:focus,.ui-radio-group.ui-radio-group-button .ui-radio-wrapper.ui-radio-wrapper-disabled:hover{color:#9ea7b4;box-shadow:none}.ui-radio-group.ui-radio-group-button .ui-radio-wrapper .ui-radio{display:none}.ui-checkbox-wrapper{display:inline-block;position:relative;vertical-align:middle;white-space:nowrap;margin-right:8px;cursor:pointer;outline:none;transition:all .2s ease-in-out}.ui-checkbox-wrapper.ui-checkbox-wrapper-readonly,.ui-checkbox-wrapper.ui-checkbox-wrapper-readonly .ui-checkbox,.ui-checkbox-wrapper.ui-checkbox-wrapper-readonly .ui-checkbox-input{cursor:default}.ui-checkbox-wrapper.ui-checkbox-wrapper-disabled{color:#9ea7b4;cursor:not-allowed}.ui-checkbox-wrapper.ui-checkbox-wrapper-disabled .ui-checkbox,.ui-checkbox-wrapper.ui-checkbox-wrapper-disabled .ui-checkbox-input{cursor:not-allowed}.ui-checkbox-wrapper:hover:not(.ui-checkbox-wrapper-disabled):not(.ui-checkbox-wrapper-readonly) .ui-checkbox-inner{border-color:#39f}.ui-checkbox-wrapper.ui-checkbox-wrapper-focus:not(.ui-checkbox-wrapper-disabled):not(.ui-checkbox-wrapper-readonly) .ui-checkbox-inner,.ui-checkbox-wrapper:focus:not(.ui-checkbox-wrapper-disabled):not(.ui-checkbox-wrapper-readonly) .ui-checkbox-inner{border-color:#39f;box-shadow:0 0 0 3px rgba(51,153,255,.2)}.ui-checkbox{display:inline-block;position:relative;margin-right:2px;white-space:nowrap;outline:0;line-height:1;vertical-align:middle;font-size:0;cursor:pointer}.ui-checkbox.ui-checkbox-checked .ui-checkbox-inner{border-color:#39f;background-color:#39f}.ui-checkbox.ui-checkbox-checked .ui-checkbox-inner:before{opacity:1;transform:rotate(45deg) scale(1)}.ui-checkbox.ui-checkbox-indeterminate .ui-checkbox-inner{border-color:#39f;background-color:#39f}.ui-checkbox.ui-checkbox-indeterminate .ui-checkbox-inner:before{opacity:1;content:"";width:8px;height:1px;transform:scale(1);position:absolute;left:2px;top:5px}.ui-checkbox-inner{display:block;position:relative;height:14px;width:14px;background-color:#fff;border:1px solid #d7dde4;border-radius:2px;transition:all .2s ease-in-out}.ui-checkbox-inner:before{position:absolute;left:4px;top:1px;height:8px;width:4px;border-bottom:2px solid #fff;border-right:2px solid #fff;content:" ";transition:all .2s ease-in-out;opacity:0;transform:rotate(45deg) scale(0)}.ui-checkbox-input{position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;opacity:0;cursor:pointer}.ui-checkbox-content{vertical-align:middle}.ui-checkbox-group{display:inline-block;outline:none}.ui-checkbox-group .ui-checkbox-wrapper{margin-right:16px}.ui-checkbox-group.ui-checkbox-group-vertical .ui-checkbox-wrapper{display:block;height:30px;line-height:30px}.ui-form-item{width:100%;padding-bottom:24px;zoom:1}.ui-form-item:after,.ui-form-item:before{content:"";display:table}.ui-form-item.ui-form-item-required .ui-form-label:before{content:"*";line-height:1;margin-right:4px;color:#f50;font-family:SimSun;font-size:12px}.ui-form-item.ui-form-item-error .ui-input,.ui-form-item.ui-form-item-error .ui-input:hover{border-color:#f50}.ui-form-item.ui-form-item-error .ui-input:focus{border-color:#f50;box-shadow:0 0 0 2px rgba(255,85,0,.2)}.ui-form-item.ui-form-item-error .ui-readonly-input-content{border-color:#f50;color:#f50}.ui-form-item.ui-form-item-error .ui-select .ui-select-selection,.ui-form-item.ui-form-item-error .ui-select .ui-select-selection:hover{border-color:#f50}.ui-form-item.ui-form-item-error .ui-select.ui-select-visible .ui-select-selection{box-shadow:0 0 0 2px rgba(255,85,0,.2)}.ui-form-item.ui-form-item-error .ui-checkbox .ui-checkbox-inner,.ui-form-item.ui-form-item-error .ui-radio .ui-radio-inner{border-color:#f50}.ui-form-item.ui-form-item-error .ui-icon,.ui-form-item.ui-form-item-error .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before,.ui-select.ui-select-multiple .ui-form-item.ui-form-item-error .ui-select-item.ui-select-item-selected:before{color:#f50}.ui-form-label{float:left;display:block;height:32px;line-height:32px;padding-right:12px;text-align:right;color:#657180;font-size:12px}.ui-form-content{position:relative;line-height:32px;font-size:12px}.ui-form-error-tip{position:absolute;left:0;top:100%;line-height:1;margin-top:6px;color:#f50}.ui-form{padding-top:24px;display:block}.ui-form .ui-form-position-left .ui-form-label,.ui-form .ui-form-position-top .ui-form-label{text-align:left;padding-right:0}.ui-form .ui-form-position-top .ui-form-label{float:none;height:auto;line-height:1.2;padding-right:0;padding-bottom:10px}.ui-form.ui-form-type-query{padding:16px 0 8px 0;font-size:0}.ui-form.ui-form-type-query .ui-form-item{padding-bottom:8px}.ui-menu{position:relative;line-height:48px;width:100%}.ui-menu li{list-style:none!important}.ui-menu ul{padding:0!important}.ui-menu:before{content:"";width:1px;background:#d7dde4;position:absolute;bottom:0;top:0;right:0;display:block}.ui-menu .ui-menu-arrow{color:#999;float:right;position:absolute;top:1px;right:24px;text-indent:0}.ui-menu .ui-menu-item,.ui-menu .ui-menu-submenu-title{text-indent:24px;cursor:pointer;position:relative;color:#657180;border-right:1px solid #d7dde4}.ui-menu .ui-menu-item:hover,.ui-menu .ui-menu-submenu-title:hover{background-color:#f3f3f3}.ui-menu .ui-menu-item-actived{color:#128bd6;border-right:2px solid #128bd6}.ui-menu .ui-menu-group-title{color:#999;text-indent:32px}.ui-menu .ui-menu-arrow-active{transform:rotate(180deg);top:0}.ui-menu .ui-menu-submenu li{text-indent:48px}.ui-menu .ui-menu-item .ui-menu-item-icon,.ui-menu .ui-menu-submenu .ui-menu-submenu-icon{vertical-align:middle;margin-top:-2px;height:14px;width:auto;margin-right:8px}.ui-menu.ui-menu-type-dark{background:#128bd6}.ui-menu.ui-menu-type-dark:before{display:none}.ui-menu.ui-menu-type-dark .ui-menu-arrow{color:#fff}.ui-menu.ui-menu-type-dark .ui-menu-group-title{color:#ddd}.ui-menu.ui-menu-type-dark .ui-menu-item,.ui-menu.ui-menu-type-dark .ui-menu-submenu-title{color:#fff;border-right:none}.ui-menu.ui-menu-type-dark .ui-menu-item:hover,.ui-menu.ui-menu-type-dark .ui-menu-submenu-title:hover{background-color:#077cc5}.ui-menu.ui-menu-type-dark .ui-menu-item-actived{color:#fff;background-color:#077cc5;border-right:2px solid #077cc5}.ui-menu.ui-menu-mode-horizontal{position:relative;height:60px;line-height:60px;box-sizing:border-box}.ui-menu.ui-menu-mode-horizontal:before{display:none}.ui-menu.ui-menu-mode-horizontal:after{content:"";display:block;width:100%;height:1px;background:#d7dde4;position:absolute;bottom:0;left:0}.ui-menu.ui-menu-mode-horizontal .ui-menu-item,.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu{float:left;padding:0 20px;text-align:center;text-indent:0;border-right:none}.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu{padding:0}.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu-title{padding:0 20px;text-align:center;text-indent:0;border-right:none}.ui-menu.ui-menu-mode-horizontal .ui-menu-arrow{position:relative;display:block;top:0;right:0;margin-left:4px}.ui-menu.ui-menu-mode-horizontal .ui-menu-item:hover,.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu-title:hover{color:#128bd6;background-color:#fff}.ui-menu.ui-menu-mode-horizontal .ui-menu-item:hover:after,.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu-title:hover:after{content:"";display:block;width:100%;height:2px;background:#128bd6;position:absolute;bottom:0;left:0;z-index:2}.ui-menu.ui-menu-mode-horizontal .ui-menu-item:hover .ui-menu-arrow,.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu-title:hover .ui-menu-arrow{color:#128bd6}.ui-menu.ui-menu-mode-horizontal .ui-menu-item.ui-menu-item-actived,.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu-title.ui-menu-item-actived{color:#128bd6;background-color:#fff}.ui-menu.ui-menu-mode-horizontal .ui-menu-item.ui-menu-item-actived:after,.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu-title.ui-menu-item-actived:after{content:"";display:block;width:100%;height:2px;background:#128bd6;position:absolute;bottom:0;left:0;z-index:2}.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu-choosed .ui-menu-submenu-title,.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu:hover .ui-menu-submenu-title{color:#128bd6;background-color:#fff}.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu-choosed .ui-menu-submenu-title:after,.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu:hover .ui-menu-submenu-title:after{content:"";display:block;width:100%;height:2px;background:#128bd6;position:absolute;bottom:0;left:0;z-index:2}.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu-choosed .ui-menu-submenu-title .ui-menu-arrow,.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu:hover .ui-menu-submenu-title .ui-menu-arrow{color:#128bd6}.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu-ul{min-width:inherit;max-height:300px;overflow:auto;margin:5px 0;padding:5px 0!important;background-color:#fff;box-sizing:border-box;border-radius:4px;box-shadow:0 1px 6px rgba(0,0,0,.2);position:absolute;z-index:900;text-align:left}.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu-ul .ui-menu-group-title{line-height:30px;text-indent:10px}.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu-ul .ui-menu-item{float:none;clear:both;margin:0;padding:8px 20px;line-height:normal;text-align:left}.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu-ul .ui-menu-item:hover{color:#657180;background-color:#f3f3f3}.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu-ul .ui-menu-item:hover:after{display:none}.ui-menu.ui-menu-mode-horizontal .ui-menu-submenu-ul .ui-menu-item.ui-menu-item-actived{border-bottom:none;background-color:#128bd6;color:#fff}.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark:after{display:none}.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-item:hover,.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-submenu-title:hover{color:#fff;background-color:#077cc5}.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-item:hover:after,.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-submenu-title:hover:after{display:none}.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-item:hover .ui-menu-arrow,.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-submenu-title:hover .ui-menu-arrow{color:#fff}.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-item.ui-menu-item-actived,.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-submenu-title.ui-menu-item-actived{color:#fff;background-color:#077cc5}.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-item.ui-menu-item-actived:after,.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-submenu-title.ui-menu-item-actived:after{display:none}.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-submenu-choosed .ui-menu-submenu-title,.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-submenu:hover .ui-menu-submenu-title{color:#fff;background-color:#077cc5}.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-submenu-choosed .ui-menu-submenu-title:after,.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-submenu:hover .ui-menu-submenu-title:after{display:none}.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-submenu-choosed .ui-menu-submenu-title .ui-menu-arrow,.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-submenu:hover .ui-menu-submenu-title .ui-menu-arrow{color:#fff}.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-submenu-ul .ui-menu-item{color:#657180}.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-submenu-ul .ui-menu-item:hover{background-color:#f3f3f3}.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-submenu-ul .ui-menu-item.ui-menu-item-actived,.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-submenu-ul .ui-menu-item.ui-menu-item-actived:hover{color:#fff;background-color:#077cc5}.ui-menu.ui-menu-mode-horizontal.ui-menu-type-dark .ui-menu-submenu-ul .ui-menu-group-title{color:#999}.ui-panel{position:relative;border:1px solid #d7dde4;border-radius:4px;background-color:#fff}.ui-panel:hover{box-shadow:0 2px 8px rgba(0,0,0,.2)}.ui-panel .ui-panel-title{padding:0 20px;color:#464c5b;height:40px;line-height:40px;border-bottom:1px solid #e3e8ee}.ui-panel .ui-panel-title-button{float:right;display:block;height:40px;line-height:40px}.ui-panel .ui-panel-title-button>.ui-icon,.ui-panel .ui-select.ui-select-multiple .ui-panel-title-button>.ui-select-item.ui-select-item-selected:before,.ui-select.ui-select-multiple .ui-panel .ui-panel-title-button>.ui-select-item.ui-select-item-selected:before{width:24px;height:24px;line-height:24px;margin-top:8px;cursor:pointer}.ui-panel .ui-panel-title-button>.ui-icon:hover,.ui-panel .ui-select.ui-select-multiple .ui-panel-title-button>.ui-select-item.ui-select-item-selected:hover:before,.ui-select.ui-select-multiple .ui-panel .ui-panel-title-button>.ui-select-item.ui-select-item-selected:hover:before{color:#fff;background:#2db7f5;border-radius:4px}.ui-panel .ui-panel-title-button>.ui-icon+.ui-icon,.ui-panel .ui-select.ui-select-multiple .ui-panel-title-button>.ui-icon+.ui-select-item.ui-select-item-selected:before,.ui-panel .ui-select.ui-select-multiple .ui-panel-title-button>.ui-select-item.ui-select-item-selected:before+.ui-icon,.ui-panel .ui-select.ui-select-multiple .ui-panel-title-button>.ui-select-item.ui-select-item-selected:before+.ui-select-item.ui-select-item-selected:before,.ui-select.ui-select-multiple .ui-panel .ui-panel-title-button>.ui-icon+.ui-select-item.ui-select-item-selected:before,.ui-select.ui-select-multiple .ui-panel .ui-panel-title-button>.ui-select-item.ui-select-item-selected:before+.ui-icon,.ui-select.ui-select-multiple .ui-panel .ui-panel-title-button>.ui-select-item.ui-select-item-selected:before+.ui-select-item.ui-select-item-selected:before{margin-left:8px}.ui-panel .ui-panel-content{position:relative;padding:8px 20px}.ui-panel .ui-icon+.ui-icon,.ui-panel .ui-select.ui-select-multiple .ui-icon+.ui-select-item.ui-select-item-selected:before,.ui-panel .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before+.ui-icon,.ui-panel .ui-select.ui-select-multiple .ui-select-item.ui-select-item-selected:before+.ui-select-item.ui-select-item-selected:before,.ui-select.ui-select-multiple .ui-panel .ui-icon+.ui-select-item.ui-select-item-selected:before,.ui-select.ui-select-multiple .ui-panel .ui-select-item.ui-select-item-selected:before+.ui-icon,.ui-select.ui-select-multiple .ui-panel .ui-select-item.ui-select-item-selected:before+.ui-select-item.ui-select-item-selected:before{margin-left:8px}.ui-affix,.ui-back-top-outer{position:fixed;z-index:10}.ui-back-top-outer{right:100px;bottom:50px;height:40px;width:40px;cursor:pointer}.ui-back-top-outer .ui-back-top-inner{display:flex;align-items:center;justify-content:center;height:40px;width:40px;border-radius:20px;background-color:rgba(64,64,64,.2);color:#fff;text-align:center;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ui-back-top-outer .ui-back-top-inner:hover{background-color:rgba(64,64,64,.4);transition:all .3s cubic-bezier(.645,.045,.355,1)}.wb-dropdown{position:relative;display:inline-block}.wb-dropdown-slot{width:100%;height:100%}.wb-dropdown-menu{position:absolute;padding:5px 0!important;margin:0!important;z-index:100;left:0;top:calc(100% + 5px);text-align:left;border-radius:4px;box-shadow:0 1px 6px rgba(0,0,0,.2);background-color:#fff;color:#657180;list-style-type:none}.wb-dropdown-menu .wb-dropdown-menu-sub{top:1px;left:100%;margin-left:2px!important}.wb-dropdown-menu .wb-dropdown-menu-item{position:relative;padding:8px 16px;margin:0!important;clear:both;font-size:12px;font-weight:400;white-space:nowrap;cursor:pointer;list-style-type:none!important;background-color:#fff;transition:background .3s ease}.wb-dropdown-menu .wb-dropdown-menu-item:hover{background-color:#f3f3f3}.wb-dropdown-menu .wb-dropdown-menu-item.wb-dropdown-menu-item-disabled,.wb-dropdown-menu .wb-dropdown-menu-item.wb-dropdown-menu-item-disabled:hover{color:#c3cbd6;cursor:not-allowed;pointer-events:none}.wb-dropdown-menu .wb-dropdown-menu-item.wb-dropdown-menu-item-divider{border-top:1px solid #e9e9e9}.wb-dropdown-menu .wb-dropdown-menu-item.wb-dropdown-menu-item-swap:after{position:absolute;display:inline-block;content:">";right:7px;color:rgba(0,0,0,.6);font-size:12px}.ui-process-circle{display:inline-block;position:relative}.ui-process-circle-inner{position:absolute;width:100%;left:0;top:50%;text-align:center;line-height:1;transform:translateY(-50%);-ms-transform:translateY(-50%)}.ui-contextmenu{position:relative;display:inline-block}.ui-contextmenu-slot{width:100%;height:100%}.ui-contextmenu-list{position:absolute;max-height:200px;margin:5px 0;padding:5px 0;overflow:auto;background-color:#fff;z-index:900;border-radius:4px;box-shadow:0 1px 6px rgba(0,0,0,.2)}.ui-contextmenu-item{margin:0;padding:7px 16px;color:#657180;font-size:12px!important;line-height:normal;white-space:nowrap;list-style:none;cursor:pointer;clear:both;transition:background .2s ease-in-out}.ui-contextmenu-item:hover{background:#f3f3f3}.ui-split{position:relative;width:100%;height:100%}.ui-split.ui-split-horizontal .ui-split-dash{cursor:ew-resize}.ui-split.ui-split-vertical .ui-split-dash{cursor:ns-resize}.ui-split-item{position:absolute;background:#fff}.ui-split-dash{position:absolute;background:transparent;z-index:2000}.ui-time-picker{position:relative;display:inline-block;vertical-align:middle;width:100%;height:32px}.ui-time-picker>.ui-readonly-input{width:100%}.ui-time-picker .addon{padding:8px;border-top:1px solid #e3e8ee}.ui-time-picker-content{display:flex;flex-direction:row;padding:5px;outline:none}.ui-time-picker-content .picker-item{display:flex;flex-direction:column;height:192px;padding-bottom:160px;border-right:1px solid #e3e8ee;overflow:hidden}.ui-time-picker-content .picker-item:last-child{border-right:0}.ui-time-picker-content .picker-item:hover{overflow-y:auto}.ui-time-picker-content .picker-item .picker-item-child{box-sizing:border-box;padding-right:12px;width:100%;min-width:56px;height:32px;line-height:32px;text-align:center;cursor:pointer}.ui-time-picker-content .picker-item .picker-item-child.focus,.ui-time-picker-content .picker-item .picker-item-child:hover{background-color:#f3f3f3}.ui-time-picker-content .picker-item .picker-item-child.disabled{cursor:not-allowed;color:#c3cbd6;background:transparent}.ui-time-picker-content .picker-item .active{font-weight:700;color:rgba(51,153,255,.9)}.ui-time-picker-content .picker-item .active:hover{color:rgba(51,153,255,.9)}.ui-readonly-input{position:relative;display:inline-block;font-size:12px;outline:none;cursor:pointer}.ui-readonly-input-content{font-variant:tabular-nums;box-sizing:border-box;margin:0;list-style:none;position:relative;display:block;padding:0 35px 0 11px;width:100%;height:32px;line-height:30px;text-overflow:ellipsis;white-space:nowrap;outline:none;color:#657180;background-color:#fff;border:1px solid #d9d9d9;border-radius:4px;transition:all .2s ease-in-out;overflow:hidden}.ui-readonly-input-content.placeholder{color:#c3cbd6}.ui-readonly-input>.ui-icon,.ui-select.ui-select-multiple .ui-readonly-input>.ui-select-item.ui-select-item-selected:before{position:absolute;line-height:1.5;top:16px;right:12px;margin-top:-9px;font-size:14px;color:#9ea7b4}.ui-readonly-input:focus .ui-readonly-input-content,.ui-readonly-input:hover .ui-readonly-input-content{border-color:#5cadff}.ui-readonly-input:focus>.ui-icon,.ui-readonly-input:hover>.ui-icon,.ui-select.ui-select-multiple .ui-readonly-input:focus>.ui-select-item.ui-select-item-selected:before,.ui-select.ui-select-multiple .ui-readonly-input:hover>.ui-select-item.ui-select-item-selected:before{color:#5cadff}.ui-readonly-input:focus .ui-readonly-input-content{box-shadow:0 0 0 3px rgba(51,153,255,.2)}.ui-readonly-input.disabled{cursor:not-allowed}.ui-readonly-input.disabled .ui-readonly-input-content{background-color:#f3f3f3}.ui-readonly-input.disabled:focus .ui-readonly-input-content,.ui-readonly-input.disabled:hover .ui-readonly-input-content{border-color:#d7dde4;box-shadow:none}.ui-readonly-input.disabled:focus>.ui-icon,.ui-readonly-input.disabled:hover>.ui-icon,.ui-select.ui-select-multiple .ui-readonly-input.disabled:focus>.ui-select-item.ui-select-item-selected:before,.ui-select.ui-select-multiple .ui-readonly-input.disabled:hover>.ui-select-item.ui-select-item-selected:before{color:#9ea7b4}.ui-picker-popup{position:absolute;transition:all .2s ease;opacity:1;transform:scaleY(1);transform-origin:center top;font-size:12px;background:#fff;outline:0;border-radius:3px;box-shadow:0 2px 8px rgba(0,0,0,.2);z-index:999}.ui-picker-popup:after,.ui-picker-popup:before{content:"";position:absolute;display:block;pointer-events:none;border:solid transparent;height:0;width:0}.ui-picker-popup:before{border-width:5px;margin:0 -5px}.ui-picker-popup:after{border-width:4px;margin:0 -4px}.ui-picker-popup.bottomLeft{left:0}.ui-picker-popup.bottomLeft:after,.ui-picker-popup.bottomLeft:before{left:22px}.ui-picker-popup.bottomRight{right:0}.ui-picker-popup.bottomRight:after,.ui-picker-popup.bottomRight:before{right:22px}.ui-picker-popup.bottomLeft,.ui-picker-popup.bottomRight{top:auto;margin-top:8px}.ui-picker-popup.bottomLeft:after,.ui-picker-popup.bottomLeft:before,.ui-picker-popup.bottomRight:after,.ui-picker-popup.bottomRight:before{bottom:100%}.ui-picker-popup.bottomLeft:before,.ui-picker-popup.bottomRight:before{border-bottom-color:#eee}.ui-picker-popup.bottomLeft:after,.ui-picker-popup.bottomRight:after{border-bottom-color:#fff}.ui-picker-popup.topLeft{left:0}.ui-picker-popup.topLeft:after,.ui-picker-popup.topLeft:before{left:22px}.ui-picker-popup.topRight{right:0}.ui-picker-popup.topRight:after,.ui-picker-popup.topRight:before{right:22px}.ui-picker-popup.topLeft,.ui-picker-popup.topRight{bottom:100%;margin-bottom:8px}.ui-picker-popup.topLeft:after,.ui-picker-popup.topLeft:before,.ui-picker-popup.topRight:after,.ui-picker-popup.topRight:before{top:100%}.ui-picker-popup.topLeft:before,.ui-picker-popup.topRight:before{border-top-color:#eee}.ui-picker-popup.topLeft:after,.ui-picker-popup.topRight:after{border-top-color:#fff}.ui-collapse.bordered{border:1px solid #e3e8ee;border-radius:4px}.ui-collapse.bordered .ui-collapse-panel-title{padding-left:12px;background-color:#f7f7f7}.ui-collapse.bordered .ui-collapse-panel-content{padding:4px 0 12px 12px}.ui-collapse.bordered .ui-collapse-panel-content.left-icon{padding-left:32px}.ui-collapse-panel{border-bottom:1px solid #e3e8ee}.ui-collapse-panel-title{display:flex;flex-direction:row;justify-content:space-between;align-items:center;height:46px;color:#464c5b;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.ui-collapse-panel-title>.ui-icon,.ui-select.ui-select-multiple .ui-collapse-panel-title>.ui-select-item.ui-select-item-selected:before{color:#464c5b;font-size:12px;margin-right:12px;transition:transform .24s}.ui-collapse-panel-title>.ui-icon.active,.ui-select.ui-select-multiple .ui-collapse-panel-title>.active.ui-select-item.ui-select-item-selected:before{transform:rotate(90deg)}.ui-collapse-panel-title.disabled{color:#c3cbd6;cursor:not-allowed}.ui-collapse-panel-title.disabled>.ui-icon,.ui-select.ui-select-multiple .ui-collapse-panel-title.disabled>.ui-select-item.ui-select-item-selected:before{color:#c3cbd6}.ui-collapse-panel-title.left-icon{padding-left:12px;justify-content:flex-start}.ui-collapse-panel-content{padding-bottom:12px}.ui-collapse-panel-content.left-icon{padding-left:32px}.layout{position:absolute;left:0;right:0;top:0;bottom:0;background-color:#fff}.layout.layout-left-hide{left:-200px}.layout.layout-animate{transition:left .3s}.layout.layout-left-hidden{left:-200px}.layout.layout-left-hidden .layout-left-fold-menu{border-left:none;border-radius:0 4px 4px 0;right:-16px;display:block}.layout.layout-header-hide .layout-right-body{top:0}.layout.layout-theme-blue .layout-left{color:#fff}.layout.layout-theme-blue .layout-left-body{background:#128bd6}.layout.layout-theme-blue .layout-left-fold-menu{border-color:#077cc5;background-color:#077cc5}.layout.layout-theme-blue .layout-left-logo{background:#128bd6}.layout.layout-theme-blue .layout-left-logo.hasLogoEvent:hover{background-color:#077cc5;cursor:pointer}.layout.layout-theme-blue .layout-left-user-logout{background-color:#077cc5}.layout.layout-theme-dark .layout-left{color:hsla(0,0%,100%,.65)}.layout.layout-theme-dark .layout-left-body{background:#001529}.layout.layout-theme-dark .layout-left-fold-menu{color:#fff;border-color:#077cc5;background-color:#077cc5}.layout.layout-theme-dark .layout-left-logo{background:#001529;color:#fff}.layout.layout-theme-dark .layout-left-logo.hasLogoEvent:hover{background:#001529;cursor:pointer}.layout.layout-theme-dark .layout-left-user-logout{background:#000c17}.layout.layout-theme-dark .ui-menu.ui-menu-type-dark{background:#001529}.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-arrow,.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-item,.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu-title{color:hsla(0,0%,100%,.65)}.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-item:hover,.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu-title:hover{color:#fff;background:#001529}.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-item:hover .ui-menu-arrow,.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu-title:hover .ui-menu-arrow{color:#fff}.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-item.ui-menu-item-actived,.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu-title.ui-menu-item-actived{color:#fff;background:#1890ff}.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-item.ui-menu-item-actived:hover,.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu-title.ui-menu-item-actived:hover{background:#1890ff}.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu-ul{background:#000c17}.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu-ul .ui-menu-item{color:hsla(0,0%,100%,.65)}.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu-ul .ui-menu-item:hover{color:#fff;background:#000c17}.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu-ul .ui-menu-item.ui-menu-item-actived{color:#fff;background:#1890ff}.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu-ul .ui-menu-item.ui-menu-item-actived:hover{background:#1890ff}.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu.ui-menu-submenu-actived .ui-menu-arrow,.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu.ui-menu-submenu-actived .ui-menu-submenu-title,.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu.ui-menu-submenu-choosed .ui-menu-arrow,.layout.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu.ui-menu-submenu-choosed .ui-menu-submenu-title{color:#fff}.layout.layout-mode-vertical.layout-theme-blue .layout-left{box-shadow:2px 0 6px rgba(0,21,41,.35)}.layout.layout-mode-vertical.layout-theme-blue .ui-menu-mode-vertical.ui-menu-type-dark .ui-menu-submenu:hover{background:#077cc5}.layout.layout-mode-vertical.layout-theme-blue .ui-menu-mode-vertical.ui-menu-type-dark .ui-menu-submenu .ui-menu-item{color:#8dcff8}.layout.layout-mode-vertical.layout-theme-blue .ui-menu-mode-vertical.ui-menu-type-dark .ui-menu-submenu .ui-menu-item:hover{color:#fff}.layout.layout-mode-vertical.layout-theme-blue .ui-menu-mode-vertical.ui-menu-type-dark .ui-menu-submenu .ui-menu-item.ui-menu-item-actived{color:#fff;background:transparent}.layout.layout-mode-vertical.layout-theme-blue .ui-menu-mode-vertical.ui-menu-type-dark .ui-menu-submenu.ui-menu-submenu-actived,.layout.layout-mode-vertical.layout-theme-blue .ui-menu-mode-vertical.ui-menu-type-dark .ui-menu-submenu.ui-menu-submenu-choosed{background:#077cc5}.layout.layout-mode-vertical.layout-theme-dark .layout-left{box-shadow:2px 0 6px rgba(0,21,41,.35)}.layout.layout-mode-horizontal .layout-left{left:0;top:0;width:100%;min-width:1240px;height:60px}.layout.layout-mode-horizontal .layout-right{top:60px;bottom:0;left:0;right:0}.layout.layout-mode-horizontal .layout-left-body{flex-direction:row}.layout.layout-mode-horizontal .layout-left-menu{margin-bottom:0;margin-left:40px;margin-right:40px}.layout.layout-mode-horizontal .layout-left-logo{width:200px;height:100%;padding:6px 0}.layout.layout-mode-horizontal .layout-left-logo img{height:24px;width:auto}.layout.layout-mode-horizontal .layout-left-menu{overflow:inherit}.layout.layout-mode-horizontal .layout-left-user{display:flex;flex-direction:row;width:240px}.layout.layout-mode-horizontal .layout-left-user .layout-left-user-name{flex:2}.layout.layout-mode-horizontal .layout-left-user .layout-left-user-logout{flex:1;height:60px;line-height:60px;background:#128bd6;border-left:1px solid #077cc5}.layout.layout-mode-horizontal.layout-theme-blue .layout-left{box-shadow:0 2px 6px rgba(0,21,41,.35)}.layout.layout-mode-horizontal.layout-theme-blue .ui-menu.ui-menu-type-dark .ui-menu-submenu.ui-menu-submenu-actived .ui-menu-submenu-title{background:#077cc5}.layout.layout-mode-horizontal.layout-theme-dark .layout-left{box-shadow:0 2px 6px rgba(0,21,41,.35)}.layout.layout-mode-horizontal.layout-theme-dark .layout-left-user .layout-left-user-logout{background:#001529;border-left-color:hsla(0,0%,100%,.3)}.layout.layout-mode-horizontal.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu.ui-menu-submenu-actived .ui-menu-submenu-title{color:#fff;background:#001529}.layout.layout-mode-horizontal.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu.ui-menu-submenu-choosed .ui-menu-submenu-title{background:#1890ff}.layout.layout-mode-horizontal.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu-ul{background:#fff}.layout.layout-mode-horizontal.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu-ul .ui-menu-item{color:#657180}.layout.layout-mode-horizontal.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu-ul .ui-menu-item:hover{color:#fff;background:#1890ff}.layout.layout-mode-horizontal.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu-ul .ui-menu-item.ui-menu-item-actived{color:#fff}.layout.layout-mode-horizontal.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu-ul .ui-menu-item.ui-menu-item-actived:hover{color:#fff;background:#1890ff}.layout.layout-mode-horizontal.layout-theme-dark .ui-menu.ui-menu-type-dark .ui-menu-submenu-ul .ui-menu-group-title{color:#999}.layout-left{position:absolute;top:0;left:0;width:200px;height:100%;font-size:14px}.layout-left:hover .layout-left-fold-menu{display:block}.layout-left ::-webkit-scrollbar{width:10px;height:10px}.layout-left ::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);border-radius:10px}.layout-left ::-webkit-scrollbar-thumb{border-radius:10px;background:rgba(0,0,0,.1);-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.5)}.layout-left ::-webkit-scrollbar-thumb:window-inactive{background:rgba(0,0,0,.1)}.layout-left-fold-menu{display:none;position:absolute;top:80px;right:0;overflow:hidden;width:16px;height:36px;line-height:36px;border:1px solid;border-radius:4px 0 0 4px;z-index:2;font-size:14px;text-align:center;cursor:pointer}.layout-left-body{width:100%;height:100%;display:flex;flex-direction:column}.layout-left-menu{display:flex;flex:1;overflow:auto;margin-bottom:24px}.layout-left-logo{padding:50px 20px 40px;text-align:center}.layout-left-logo img{width:auto;max-height:30px}.layout-left-logo p{font-size:16px}.layout-left-logo.hasLogoEvent:hover{cursor:pointer}.layout-left-user-name{padding:0 20px}.layout-left-user-name p{margin:10px 0;line-height:15px}.layout-left-user-logout{height:70px;line-height:70px;text-align:center}.layout-left-user-logout .ui-icon{cursor:pointer;vertical-align:middle}.layout-right{position:absolute;left:200px;right:0;top:0;bottom:0;min-width:1240px}.layout-right-header{width:100%;min-width:1240px;height:60px;line-height:60px;position:relative}.layout-right-body{position:absolute;left:0;right:0;top:60px;bottom:0;overflow-y:auto}.query-page .query-page-search{position:relative;background-color:#f7f7f7}.query-page .query-page-search .query-page-search-buttons{position:absolute;margin-bottom:16px;margin-left:50px;height:32px;line-height:32px;bottom:0;right:40px}.query-page .query-page-search .query-page-search-buttons .ui-button+.ui-button{margin-left:8px}.query-page .query-page-search .ui-form{width:75%}.query-page .query-page-search .ui-form-item{display:inline-block;width:33.33%}.query-page .query-page-table .ui-page{margin:20px;text-align:center}.query-page .ui-modal-dialog{overflow:auto}.query-page .ui-modal-body{width:500px;padding-right:30px}.query-page .link{color:#39f;cursor:pointer}.query-page .link:hover{color:#5cadff}.query-page .link:active{color:#3091f2}@media (min-width:0\0) and (min-resolution:0.001dpcm){.layout-left-menu{padding-bottom:24px;margin-bottom:0;position:absolute;width:200px;top:143px;bottom:130px}.layout-left-user{position:fixed;width:200px;bottom:0;left:0}}input[type=text]::-ms-clear{display:none}.monaco-editor{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,Ubuntu,Droid Sans,sans-serif}.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-editor-hover p{margin:0}.monaco-editor.hc-black{-ms-high-contrast-adjust:none}@media screen and (-ms-high-contrast:active){.monaco-editor.vs-dark .view-overlays .current-line,.monaco-editor.vs .view-overlays .current-line{border-color:windowtext!important;border-left:0;border-right:0}.monaco-editor.vs-dark .cursor,.monaco-editor.vs .cursor{background-color:windowtext!important}.monaco-editor.vs-dark .dnd-target,.monaco-editor.vs .dnd-target{border-color:windowtext!important}.monaco-editor.vs-dark .selected-text,.monaco-editor.vs .selected-text{background-color:highlight!important}.monaco-editor.vs-dark .view-line,.monaco-editor.vs .view-line{-ms-high-contrast-adjust:none}.monaco-editor.vs-dark .view-line span,.monaco-editor.vs .view-line span{color:windowtext!important}.monaco-editor.vs-dark .view-line span.inline-selected-text,.monaco-editor.vs .view-line span.inline-selected-text{color:highlighttext!important}.monaco-editor.vs-dark .view-overlays,.monaco-editor.vs .view-overlays{-ms-high-contrast-adjust:none}.monaco-editor.vs-dark .reference-decoration,.monaco-editor.vs-dark .selectionHighlight,.monaco-editor.vs-dark .wordHighlight,.monaco-editor.vs-dark .wordHighlightStrong,.monaco-editor.vs .reference-decoration,.monaco-editor.vs .selectionHighlight,.monaco-editor.vs .wordHighlight,.monaco-editor.vs .wordHighlightStrong{border:2px dotted highlight!important;background:transparent!important;box-sizing:border-box}.monaco-editor.vs-dark .rangeHighlight,.monaco-editor.vs .rangeHighlight{background:transparent!important;border:1px dotted activeborder!important;box-sizing:border-box}.monaco-editor.vs-dark .bracket-match,.monaco-editor.vs .bracket-match{border-color:windowtext!important;background:transparent!important}.monaco-editor.vs-dark .currentFindMatch,.monaco-editor.vs-dark .findMatch,.monaco-editor.vs .currentFindMatch,.monaco-editor.vs .findMatch{border:2px dotted activeborder!important;background:transparent!important;box-sizing:border-box}.monaco-editor.vs-dark .find-widget,.monaco-editor.vs .find-widget{border:1px solid windowtext}.monaco-editor.vs-dark .monaco-list .monaco-list-row,.monaco-editor.vs .monaco-list .monaco-list-row{-ms-high-contrast-adjust:none;color:windowtext!important}.monaco-editor.vs-dark .monaco-list .monaco-list-row.focused,.monaco-editor.vs .monaco-list .monaco-list-row.focused{color:highlighttext!important;background-color:highlight!important}.monaco-editor.vs-dark .monaco-list .monaco-list-row:hover,.monaco-editor.vs .monaco-list .monaco-list-row:hover{background:transparent!important;border:1px solid highlight;box-sizing:border-box}.monaco-editor.vs-dark .monaco-tree .monaco-tree-row,.monaco-editor.vs .monaco-tree .monaco-tree-row{-ms-high-contrast-adjust:none;color:windowtext!important}.monaco-editor.vs-dark .monaco-tree .monaco-tree-row.focused,.monaco-editor.vs-dark .monaco-tree .monaco-tree-row.selected,.monaco-editor.vs .monaco-tree .monaco-tree-row.focused,.monaco-editor.vs .monaco-tree .monaco-tree-row.selected{color:highlighttext!important;background-color:highlight!important}.monaco-editor.vs-dark .monaco-tree .monaco-tree-row:hover,.monaco-editor.vs .monaco-tree .monaco-tree-row:hover{background:transparent!important;border:1px solid highlight;box-sizing:border-box}.monaco-editor.vs-dark .monaco-scrollable-element>.scrollbar,.monaco-editor.vs .monaco-scrollable-element>.scrollbar{-ms-high-contrast-adjust:none;background:background!important;border:1px solid windowtext;box-sizing:border-box}.monaco-editor.vs-dark .monaco-scrollable-element>.scrollbar>.slider,.monaco-editor.vs .monaco-scrollable-element>.scrollbar>.slider{background:windowtext!important}.monaco-editor.vs-dark .monaco-scrollable-element>.scrollbar>.slider.active,.monaco-editor.vs-dark .monaco-scrollable-element>.scrollbar>.slider:hover,.monaco-editor.vs .monaco-scrollable-element>.scrollbar>.slider.active,.monaco-editor.vs .monaco-scrollable-element>.scrollbar>.slider:hover{background:highlight!important}.monaco-editor.vs-dark .decorationsOverviewRuler,.monaco-editor.vs .decorationsOverviewRuler{opacity:0}.monaco-editor.vs-dark .minimap,.monaco-editor.vs .minimap{display:none}.monaco-editor.vs-dark .squiggly-d-error,.monaco-editor.vs .squiggly-d-error{background:transparent!important;border-bottom:4px double #e47777}.monaco-editor.vs-dark .squiggly-b-info,.monaco-editor.vs-dark .squiggly-c-warning,.monaco-editor.vs .squiggly-b-info,.monaco-editor.vs .squiggly-c-warning{border-bottom:4px double #71b771}.monaco-editor.vs-dark .squiggly-a-hint,.monaco-editor.vs .squiggly-a-hint{border-bottom:4px double #6c6c6c}.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.vs .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label{-ms-high-contrast-adjust:none;color:highlighttext!important;background-color:highlight!important}.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .action-label,.monaco-editor.vs .monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .action-label{-ms-high-contrast-adjust:none;background:transparent!important;border:1px solid highlight;box-sizing:border-box}.monaco-diff-editor.vs-dark .diffOverviewRuler,.monaco-diff-editor.vs .diffOverviewRuler{display:none}.monaco-editor.vs-dark .line-delete,.monaco-editor.vs-dark .line-insert,.monaco-editor.vs .line-delete,.monaco-editor.vs .line-insert{background:transparent!important;border:1px solid highlight!important;box-sizing:border-box}.monaco-editor.vs-dark .char-delete,.monaco-editor.vs-dark .char-insert,.monaco-editor.vs .char-delete,.monaco-editor.vs .char-insert{background:transparent!important}}.monaco-aria-container{position:absolute;left:-999em}::-ms-clear{display:none}.monaco-editor .editor-widget input{color:inherit}.monaco-editor{position:relative;overflow:visible;-webkit-text-size-adjust:100%;-webkit-font-feature-settings:"liga" off,"calt" off;font-feature-settings:"liga" off,"calt" off}.monaco-editor.enable-ligatures{-webkit-font-feature-settings:"liga" on,"calt" on;font-feature-settings:"liga" on,"calt" on}.monaco-editor .overflow-guard{position:relative;overflow:hidden}.monaco-editor .view-overlays{position:absolute;top:0}.monaco-editor .vs-whitespace{display:inline-block}.monaco-editor .inputarea{min-width:0;min-height:0;margin:0;padding:0;position:absolute;outline:none!important;resize:none;border:none;overflow:hidden;color:transparent;background-color:transparent}.monaco-editor .inputarea.ime-input{z-index:10}.monaco-editor .margin-view-overlays .line-numbers{position:absolute;text-align:right;display:inline-block;vertical-align:middle;box-sizing:border-box;cursor:default;height:100%}.monaco-editor .relative-current-line-number{text-align:left;display:inline-block;width:100%}.monaco-editor .margin-view-overlays .line-numbers{cursor:-webkit-image-set(url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNSIgaGVpZ2h0PSIyMSI+PHBhdGggZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMDAwIiBkPSJNMTQuNSAxLjJMMS45IDEzLjhoNS4ybC0yLjYgNS4zIDMuMiAxIDIuNi01LjIgNC4yIDMuMXoiLz48L3N2Zz4=") 1x,url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSI0MiI+PHBhdGggZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMDAwIiBzdHJva2Utd2lkdGg9IjIiIGQ9Ik0yOSAyLjRMMy44IDI3LjZoMTAuNUw5IDM4LjFsNi40IDIuMSA1LjItMTAuNUwyOSAzNnoiLz48L3N2Zz4=") 2x) 30 0,default}.monaco-editor.mac .margin-view-overlays .line-numbers{cursor:-webkit-image-set(url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxOCI+PHBhdGggZD0iTTQuMyAxNi41bDEuNi00LjZIMS4xTDExLjUgMS4ydjE0LjRMOC43IDEzbC0xLjYgNC41eiIvPjxwYXRoIGQ9Ik0xMSAxNC41bC0yLjUtMi4zTDcgMTYuNyA1IDE2bDEuNi00LjVoLTRsOC41LTlNMCAxMi41aDUuMmwtMS41IDQuMUw3LjUgMTggOSAxNC4ybDIuOSAyLjNWMEwwIDEyLjV6IiBmaWxsPSIjZmZmIi8+PC9zdmc+") 1x,url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIzNiIgdmlld0JveD0iMCAwIDI0IDM2LjEiPjxwYXRoIGQ9Ik04LjYgMzMuMWwzLjItOS4ySDIuMkwyMyAyLjV2MjguOGwtNS42LTUuMi0zLjIgOS01LjYtMnoiLz48cGF0aCBkPSJNMjIgMjkuMWwtNS00LjYtMy4wNjIgOC45MzgtNC4wNjItMS41TDEzIDIzSDVMMjIgNU0wIDI1aDEwLjRsLTMgOC4zIDcuNiAyLjggMy4xMjUtNy42NjJMMjQgMzNWMHoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=") 2x) 24 3,default}.monaco-editor .margin-view-overlays .line-numbers.lh-odd{margin-top:1px}.monaco-editor .margin-view-overlays .current-line,.monaco-editor .view-overlays .current-line{display:block;position:absolute;left:0;top:0;box-sizing:border-box}.monaco-editor .margin-view-overlays .current-line.current-line-margin.current-line-margin-both{border-right:0}.monaco-editor .lines-content .cdr{position:absolute}.monaco-scrollable-element>.scrollbar>.up-arrow{background:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTEgMTEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTkuNDggOC45NjFsMS4yNi0xLjI2LTUuMDQtNS4wNC01LjQ2IDUuMDQgMS4yNiAxLjI2IDQuMi0zLjc4IDMuNzggMy43OHoiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=");cursor:pointer}.monaco-scrollable-element>.scrollbar>.down-arrow{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMSAxMSI+PHBhdGggZmlsbD0iIzQyNDI0MiIgZD0iTTEuNSAyLjY2MkwuMjQgMy45MjJsNS4wNCA1LjA0IDUuNDYtNS4wNC0xLjI2LTEuMjYtNC4yIDMuNzgtMy43OC0zLjc4eiIvPjwvc3ZnPg==");cursor:pointer}.monaco-scrollable-element>.scrollbar>.left-arrow{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMSAxMSI+PHBhdGggZmlsbD0iIzQyNDI0MiIgZD0iTTguNjQgMS40NDFMNy4zOC4xODFsLTUuMDQgNS4wNCA1LjA0IDUuNDYgMS4yNi0xLjI2LTMuNzgtNC4yIDMuNzgtMy43OHoiLz48L3N2Zz4=");cursor:pointer}.monaco-scrollable-element>.scrollbar>.right-arrow{background:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTEgMTEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzQyNDI0MiIgZD0iTTIuNDY3IDkuNTQ4bDEuMjYgMS4yNiA1LjA0LTUuMDQtNS4wNC01LjQ2LTEuMjYgMS4yNiAzLjc4IDQuMi0zLjc4IDMuNzh6Ii8+PC9zdmc+");cursor:pointer}.hc-black .monaco-scrollable-element>.scrollbar>.up-arrow,.vs-dark .monaco-scrollable-element>.scrollbar>.up-arrow{background:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTEgMTEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTkuNDggOC45NjFsMS4yNi0xLjI2LTUuMDQtNS4wNC01LjQ2IDUuMDQgMS4yNiAxLjI2IDQuMi0zLjc4IDMuNzggMy43OHoiIGZpbGw9IiNFOEU4RTgiLz48L3N2Zz4=")}.hc-black .monaco-scrollable-element>.scrollbar>.down-arrow,.vs-dark .monaco-scrollable-element>.scrollbar>.down-arrow{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMSAxMSI+PHBhdGggZmlsbD0iI0U4RThFOCIgZD0iTTEuNSAyLjY2MkwuMjQgMy45MjJsNS4wNCA1LjA0IDUuNDYtNS4wNC0xLjI2LTEuMjYtNC4yIDMuNzgtMy43OC0zLjc4eiIvPjwvc3ZnPg==")}.hc-black .monaco-scrollable-element>.scrollbar>.left-arrow,.vs-dark .monaco-scrollable-element>.scrollbar>.left-arrow{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMSAxMSI+PHBhdGggZmlsbD0iI0U4RThFOCIgZD0iTTguNjQgMS40NDFMNy4zOC4xODFsLTUuMDQgNS4wNCA1LjA0IDUuNDYgMS4yNi0xLjI2LTMuNzgtNC4yIDMuNzgtMy43OHoiLz48L3N2Zz4=")}.hc-black .monaco-scrollable-element>.scrollbar>.right-arrow,.vs-dark .monaco-scrollable-element>.scrollbar>.right-arrow{background:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTEgMTEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI0U4RThFOCIgZD0iTTIuNDY3IDkuNTQ4bDEuMjYgMS4yNiA1LjA0LTUuMDQtNS4wNC01LjQ2LTEuMjYgMS4yNiAzLjc4IDQuMi0zLjc4IDMuNzh6Ii8+PC9zdmc+")}.monaco-scrollable-element>.visible{opacity:1;background:transparent;transition:opacity .1s linear}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{transition:opacity .8s linear}.monaco-scrollable-element>.shadow{position:absolute;display:none}.monaco-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:inset 0 6px 6px -6px #ddd}.monaco-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:inset 6px 0 6px -6px #ddd}.monaco-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.monaco-scrollable-element>.shadow.top.left{box-shadow:inset 6px 6px 6px -6px #ddd}.vs .monaco-scrollable-element>.scrollbar>.slider{background:hsla(0,0%,39.2%,.4)}.vs-dark .monaco-scrollable-element>.scrollbar>.slider{background:hsla(0,0%,47.5%,.4)}.hc-black .monaco-scrollable-element>.scrollbar>.slider{background:rgba(111,195,223,.6)}.monaco-scrollable-element>.scrollbar>.slider:hover{background:hsla(0,0%,39.2%,.7)}.hc-black .monaco-scrollable-element>.scrollbar>.slider:hover{background:rgba(111,195,223,.8)}.monaco-scrollable-element>.scrollbar>.slider.active{background:rgba(0,0,0,.6)}.vs-dark .monaco-scrollable-element>.scrollbar>.slider.active{background:hsla(0,0%,74.9%,.4)}.hc-black .monaco-scrollable-element>.scrollbar>.slider.active{background:#6fc3df}.vs-dark .monaco-scrollable-element .shadow.top{box-shadow:none}.vs-dark .monaco-scrollable-element .shadow.left{box-shadow:inset 6px 0 6px -6px #000}.vs-dark .monaco-scrollable-element .shadow.top.left{box-shadow:inset 6px 6px 6px -6px #000}.hc-black .monaco-scrollable-element .shadow.left,.hc-black .monaco-scrollable-element .shadow.top,.hc-black .monaco-scrollable-element .shadow.top.left{box-shadow:none}.monaco-editor .glyph-margin{position:absolute;top:0}.monaco-editor .lines-content .cigr,.monaco-editor .lines-content .cigra,.monaco-editor .margin-view-overlays .cgmr{position:absolute}.monaco-editor.safari .lines-content,.monaco-editor.safari .view-line,.monaco-editor.safari .view-lines{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.monaco-editor .lines-content,.monaco-editor .view-line,.monaco-editor .view-lines{-webkit-user-select:none;-ms-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none}.monaco-editor .view-lines{cursor:text;white-space:nowrap}.monaco-editor.hc-black.mac .view-lines,.monaco-editor.vs-dark.mac .view-lines{cursor:-webkit-image-set(url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAL0lEQVQoz2NgCD3x//9/BhBYBWdhgFVAiVW4JBFKGIa4AqD0//9D3pt4I4tAdAMAHTQ/j5Zom30AAAAASUVORK5CYII=) 1x,url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAz0lEQVRIx2NgYGBY/R8I/vx5eelX3n82IJ9FxGf6tksvf/8FiTMQAcAGQMDvSwu09abffY8QYSAScNk45G198eX//yev73/4///701eh//kZSARckrNBRvz//+8+6ZohwCzjGNjdgQxkAg7B9WADeBjIBqtJCbhRA0YNoIkBSNmaPEMoNmA0FkYNoFKhapJ6FGyAH3nauaSmPfwI0v/3OukVi0CIZ+F25KrtYcx/CTIy0e+rC7R1Z4KMICVTQQ14feVXIbR695u14+Ir4gwAAD49E54wc1kWAAAAAElFTkSuQmCC) 2x) 5 8,text}.monaco-editor .view-line{position:absolute;width:100%}.monaco-editor .lines-decorations{position:absolute;top:0;background:#fff}.monaco-editor .margin-view-overlays .cldr{position:absolute;height:100%}.monaco-editor .margin-view-overlays .cmdr{position:absolute;left:0;width:100%;height:100%}.monaco-editor .minimap.slider-mouseover .minimap-slider{opacity:0;transition:opacity .1s linear}.monaco-editor .minimap.slider-mouseover .minimap-slider.active,.monaco-editor .minimap.slider-mouseover:hover .minimap-slider{opacity:1}.monaco-editor .minimap-shadow-hidden{position:absolute;width:0}.monaco-editor .minimap-shadow-visible{position:absolute;left:-6px;width:6px}.monaco-editor .overlayWidgets{position:absolute;top:0;left:0}.monaco-editor .view-ruler{position:absolute;top:0}.monaco-editor .scroll-decoration{position:absolute;top:0;left:0;height:6px}.monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{position:absolute;cursor:text;overflow:hidden}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{box-sizing:border-box;background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{border-bottom-width:2px;border-bottom-style:solid;background:transparent!important;box-sizing:border-box}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{border-bottom-width:1px;border-bottom-style:solid;background:transparent!important;box-sizing:border-box}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-expand{0%,20%{transform:scaleY(1)}80%,to{transform:scaleY(0)}}.cursor-smooth{animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}.monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor.vs .diffOverview{background:rgba(0,0,0,.03)}.monaco-diff-editor.vs-dark .diffOverview{background:hsla(0,0%,100%,.01)}.monaco-diff-editor .diffViewport{box-shadow:inset 0 0 1px 0 #b9b9b9;background:rgba(0,0,0,.1)}.monaco-diff-editor.hc-black .diffViewport,.monaco-diff-editor.vs-dark .diffViewport{background:hsla(0,0%,100%,.1)}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar{background:transparent}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:hsla(0,0%,67.1%,.4)}.modified-in-monaco-diff-editor.hc-black .slider.active{background:none}.monaco-diff-editor .delete-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-editor .insert-sign{background-size:60%;opacity:.7;background-repeat:no-repeat;background-position:50% 50%;background-position:50%;background-size:11px 11px}.monaco-diff-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-editor.hc-black .insert-sign{opacity:1}.monaco-diff-editor .insert-sign,.monaco-editor .insert-sign{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzQyNDI0MiIgZD0iTTcgM2gzdjExSDd6Ii8+PHBhdGggZmlsbD0iIzQyNDI0MiIgZD0iTTMgN2gxMXYzSDN6Ii8+PC9zdmc+")}.monaco-diff-editor .delete-sign,.monaco-editor .delete-sign{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzQyNDI0MiIgZD0iTTMgN2gxMXYzSDN6Ii8+PC9zdmc+")}.monaco-diff-editor.hc-black .insert-sign,.monaco-diff-editor.vs-dark .insert-sign,.monaco-editor.hc-black .insert-sign,.monaco-editor.vs-dark .insert-sign{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI0M1QzVDNSIgZD0iTTcgM2gzdjExSDd6Ii8+PHBhdGggZmlsbD0iI0M1QzVDNSIgZD0iTTMgN2gxMXYzSDN6Ii8+PC9zdmc+")}.monaco-diff-editor.hc-black .delete-sign,.monaco-diff-editor.vs-dark .delete-sign,.monaco-editor.hc-black .delete-sign,.monaco-editor.vs-dark .delete-sign{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI0M1QzVDNSIgZD0iTTMgN2gxMXYzSDN6Ii8+PC9zdmc+")}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .inline-deleted-margin-view-zone{text-align:right}.monaco-editor .diagonal-fill{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAChJREFUKFNjOH/+fAMDDgCSu3Dhwn9c8gwwBTgNGR4KQP4HhQOhsAIAZCBTkhtqePcAAAAASUVORK5CYII=")}.monaco-editor.vs-dark .diagonal-fill{opacity:.2}.monaco-editor.hc-black .diagonal-fill{background:none}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-sash{position:absolute;z-index:90;touch-action:none}.monaco-sash.disabled{pointer-events:none}.monaco-sash.vertical{cursor:ew-resize;top:0;width:4px;height:100%}.monaco-sash.mac.vertical{cursor:col-resize}.monaco-sash.vertical.minimum{cursor:e-resize}.monaco-sash.vertical.maximum{cursor:w-resize}.monaco-sash.horizontal{cursor:ns-resize;left:0;width:100%;height:4px}.monaco-sash.mac.horizontal{cursor:row-resize}.monaco-sash.horizontal.minimum{cursor:s-resize}.monaco-sash.horizontal.maximum{cursor:n-resize}.monaco-sash:not(.disabled).orthogonal-end:after,.monaco-sash:not(.disabled).orthogonal-start:before{content:" ";height:8px;width:8px;z-index:100;display:block;cursor:all-scroll;position:absolute}.monaco-sash.orthogonal-start.vertical:before{left:-2px;top:-4px}.monaco-sash.orthogonal-end.vertical:after{left:-2px;bottom:-4px}.monaco-sash.orthogonal-start.horizontal:before{top:-2px;left:-4px}.monaco-sash.orthogonal-end.horizontal:after{top:-2px;right:-4px}.monaco-sash.disabled{cursor:default!important}.monaco-sash.touch.vertical{width:20px}.monaco-sash.touch.horizontal{height:20px}.monaco-sash.debug:not(.disabled){background:#0ff}.monaco-sash.debug:not(.disabled).orthogonal-end:after,.monaco-sash.debug:not(.disabled).orthogonal-start:before{background:red}.monaco-diff-editor .diff-review-line-number{text-align:right;display:inline-block}.monaco-diff-editor .diff-review{position:absolute;-webkit-user-select:none;-ms-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none}.monaco-diff-editor .diff-review-summary{padding-left:10px}.monaco-diff-editor .diff-review-shadow{position:absolute}.monaco-diff-editor .diff-review-row{white-space:pre}.monaco-diff-editor .diff-review-table{display:table;min-width:100%}.monaco-diff-editor .diff-review-row{display:table-row;width:100%}.monaco-diff-editor .diff-review-cell{display:table-cell}.monaco-diff-editor .diff-review-spacer{display:inline-block;width:10px}.monaco-diff-editor .diff-review-actions{display:inline-block;position:absolute;right:10px;top:2px}.monaco-diff-editor .diff-review-actions .action-label{width:16px;height:16px;margin:2px 0}.monaco-diff-editor .action-label.icon.close-diff-review{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMyAzIDE2IDE2Ij48cGF0aCBmaWxsPSIjNDI0MjQyIiBkPSJNMTIuNTk3IDExLjA0MmwyLjgwMyAyLjgwMy0xLjU1NiAxLjU1NS0yLjgwMi0yLjgwMkw4LjIzOSAxNS40bC0xLjU1Ni0xLjU1NSAyLjgwMi0yLjgwMy0yLjgwMi0yLjgwMyAxLjU1NS0xLjU1NiAyLjgwNCAyLjgwMyAyLjgwMy0yLjgwM0wxNS40IDguMjM5eiIvPjwvc3ZnPg==") 50% no-repeat}.monaco-diff-editor.hc-black .action-label.icon.close-diff-review,.monaco-diff-editor.vs-dark .action-label.icon.close-diff-review{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMyAzIDE2IDE2Ij48cGF0aCBmaWxsPSIjZThlOGU4IiBkPSJNMTIuNTk3IDExLjA0MmwyLjgwMyAyLjgwMy0xLjU1NiAxLjU1NS0yLjgwMi0yLjgwMkw4LjIzOSAxNS40bC0xLjU1Ni0xLjU1NSAyLjgwMi0yLjgwMy0yLjgwMi0yLjgwMyAxLjU1NS0xLjU1NiAyLjgwNCAyLjgwMyAyLjgwMy0yLjgwM0wxNS40IDguMjM5eiIvPjwvc3ZnPg==") 50% no-repeat}.monaco-action-bar{text-align:right;overflow:hidden;white-space:nowrap}.monaco-action-bar .actions-container{display:flex;margin:0 auto;padding:0;width:100%;justify-content:flex-end}.monaco-action-bar.vertical .actions-container{display:inline-block}.monaco-action-bar.reverse .actions-container{flex-direction:row-reverse}.monaco-action-bar .action-item{cursor:pointer;display:inline-block;transition:transform 50ms ease;position:relative}.monaco-action-bar .action-item.disabled{cursor:default}.monaco-action-bar.animated .action-item.active{transform:scale(1.272019649)}.monaco-action-bar .action-item .icon{display:inline-block}.monaco-action-bar .action-label{font-size:11px;margin-right:4px}.monaco-action-bar .action-label.octicon{font-size:15px;line-height:35px;text-align:center}.monaco-action-bar .action-item.disabled .action-label,.monaco-action-bar .action-item.disabled .action-label:hover{opacity:.4}.monaco-action-bar.vertical{text-align:left}.monaco-action-bar.vertical .action-item{display:block}.monaco-action-bar.vertical .action-label.separator{display:block;border-bottom:1px solid #bbb;padding-top:1px;margin-left:.8em;margin-right:.8em}.monaco-action-bar.animated.vertical .action-item.active{transform:translate(5px)}.secondary-actions .monaco-action-bar .action-label{margin-left:6px}.monaco-action-bar .action-item.select-container{overflow:hidden;flex:1;max-width:170px;min-width:60px;display:flex;align-items:center;justify-content:center}.context-view .monaco-menu{min-width:130px}.monaco-menu .monaco-action-bar.vertical{margin-left:0;overflow:visible}.monaco-menu .monaco-action-bar.vertical .actions-container{display:block}.monaco-menu .monaco-action-bar.vertical .action-item{padding:0;transform:none;display:flex}.monaco-menu .monaco-action-bar.vertical .action-item.active{transform:none}.monaco-menu .monaco-action-bar.vertical .action-menu-item{flex:1 1 auto;display:flex;height:2em;align-items:center}.monaco-menu .monaco-action-bar.vertical .action-label{flex:1 1 auto;text-decoration:none;padding:0 1em;background:none;font-size:12px;line-height:1}.monaco-menu .monaco-action-bar.vertical .keybinding,.monaco-menu .monaco-action-bar.vertical .submenu-indicator{display:inline-block;flex:2 1 auto;padding:0 1em;text-align:right;font-size:12px;line-height:1}.monaco-menu .monaco-action-bar.vertical .submenu-indicator{height:100%;-webkit-mask:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuNTIgMTIuMzY0TDkuODc5IDcgNC41MiAxLjYzNmwuNjE1LS42MTVMMTEuMTIyIDdsLTUuOTg2IDUuOTgtLjYxNS0uNjE2eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==") no-repeat 90% 50%/13px 13px;mask:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuNTIgMTIuMzY0TDkuODc5IDcgNC41MiAxLjYzNmwuNjE1LS42MTVMMTEuMTIyIDdsLTUuOTg2IDUuOTgtLjYxNS0uNjE2eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==") no-repeat 90% 50%/13px 13px}.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator{opacity:.4}.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator){display:inline-block;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;margin:0}.monaco-menu .monaco-action-bar.vertical .action-label.separator{padding:.5em 0 0 0;margin-bottom:.5em;width:100%}.monaco-menu .monaco-action-bar.vertical .action-label.separator.text{padding:.7em 1em .1em 1em;font-weight:700;opacity:1}.monaco-menu .monaco-action-bar.vertical .action-label:hover{color:inherit}.monaco-menu .monaco-action-bar.vertical .menu-item-check{position:absolute;visibility:hidden;-webkit-mask:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iLTIgLTIgMTYgMTYiPjxwYXRoIGZpbGw9IiM0MjQyNDIiIGQ9Ik05IDBMNC41IDkgMyA2SDBsMyA2aDNsNi0xMnoiLz48L3N2Zz4=") no-repeat 50% 56%/15px 15px;mask:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iLTIgLTIgMTYgMTYiPjxwYXRoIGZpbGw9IiM0MjQyNDIiIGQ9Ik05IDBMNC41IDkgMyA2SDBsMyA2aDNsNi0xMnoiLz48L3N2Zz4=") no-repeat 50% 56%/15px 15px;width:1em;height:100%}.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check{visibility:visible}.context-view.monaco-menu-container{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,Ubuntu,Droid Sans,sans-serif;outline:0;border:none;animation:fadeIn 83ms linear}.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,.context-view.monaco-menu-container .monaco-action-bar.vertical :focus,.context-view.monaco-menu-container :focus{outline:0}.monaco-menu .monaco-action-bar.vertical .action-item{border:1px solid transparent}.hc-black .context-view.monaco-menu-container{box-shadow:none}.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused{background:none}.context-view{position:absolute;z-index:2000}.monaco-tree{height:100%;width:100%;white-space:nowrap;-webkit-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;-o-user-select:none;user-select:none;position:relative}.monaco-tree>.monaco-scrollable-element{height:100%}.monaco-tree>.monaco-scrollable-element>.monaco-tree-wrapper{height:100%;width:100%;position:relative}.monaco-tree .monaco-tree-rows{position:absolute;width:100%;height:100%}.monaco-tree .monaco-tree-rows>.monaco-tree-row{-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;cursor:pointer;overflow:hidden;width:100%;touch-action:none}.monaco-tree .monaco-tree-rows>.monaco-tree-row>.content{position:relative;height:100%}.monaco-tree-drag-image{display:inline-block;padding:1px 7px;border-radius:10px;font-size:12px;position:absolute}.monaco-tree .monaco-tree-rows>.monaco-tree-row.scrolling{display:none}.monaco-tree .monaco-tree-rows.show-twisties>.monaco-tree-row.has-children>.content:before{content:" ";position:absolute;display:block;background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0iIzY0NjQ2NSIgZD0iTTYgNHY4bDQtNC00LTR6bTEgMi40MTRMOC41ODYgOCA3IDkuNTg2VjYuNDE0eiIvPjwvc3ZnPg==") 50% 50% no-repeat;width:16px;height:100%;top:0;left:-16px}.monaco-tree .monaco-tree-rows.show-twisties>.monaco-tree-row.expanded>.content:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0iIzY0NjQ2NSIgZD0iTTExIDEwSDUuMzQ0TDExIDQuNDE0VjEweiIvPjwvc3ZnPg==")}.monaco-tree .monaco-tree-rows>.monaco-tree-row.has-children.loading>.content:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCI+PHN0eWxlPmNpcmNsZXthbmltYXRpb246YmFsbCAuNnMgbGluZWFyIGluZmluaXRlfWNpcmNsZTpudGgtY2hpbGQoMil7YW5pbWF0aW9uLWRlbGF5Oi4wNzVzfWNpcmNsZTpudGgtY2hpbGQoMyl7YW5pbWF0aW9uLWRlbGF5Oi4xNXN9Y2lyY2xlOm50aC1jaGlsZCg0KXthbmltYXRpb24tZGVsYXk6LjIyNXN9Y2lyY2xlOm50aC1jaGlsZCg1KXthbmltYXRpb24tZGVsYXk6LjNzfWNpcmNsZTpudGgtY2hpbGQoNil7YW5pbWF0aW9uLWRlbGF5Oi4zNzVzfWNpcmNsZTpudGgtY2hpbGQoNyl7YW5pbWF0aW9uLWRlbGF5Oi40NXN9Y2lyY2xlOm50aC1jaGlsZCg4KXthbmltYXRpb24tZGVsYXk6LjUyNXN9PC9zdHlsZT48Y2lyY2xlIGN4PSI1IiBjeT0iMSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSI3LjgyOCIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjkiIGN5PSI1IiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjcuODI4IiBjeT0iNy44MjgiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iNSIgY3k9IjkiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iMi4xNzIiIGN5PSI3LjgyOCIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIxIiBjeT0iNSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIyLjE3MiIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjwvc3ZnPg==")}.monaco-tree.highlighted .monaco-tree-rows>.monaco-tree-row:not(.highlighted){opacity:.3}.vs-dark .monaco-tree .monaco-tree-rows.show-twisties>.monaco-tree-row.has-children>.content:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0iI0U4RThFOCIgZD0iTTYgNHY4bDQtNC00LTR6bTEgMi40MTRMOC41ODYgOCA3IDkuNTg2VjYuNDE0eiIvPjwvc3ZnPg==")}.vs-dark .monaco-tree .monaco-tree-rows.show-twisties>.monaco-tree-row.expanded>.content:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0iI0U4RThFOCIgZD0iTTExIDEwSDUuMzQ0TDExIDQuNDE0VjEweiIvPjwvc3ZnPg==")}.vs-dark .monaco-tree .monaco-tree-rows>.monaco-tree-row.has-children.loading>.content:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCI+PHN0eWxlPmNpcmNsZXthbmltYXRpb246YmFsbCAuNnMgbGluZWFyIGluZmluaXRlfWNpcmNsZTpudGgtY2hpbGQoMil7YW5pbWF0aW9uLWRlbGF5Oi4wNzVzfWNpcmNsZTpudGgtY2hpbGQoMyl7YW5pbWF0aW9uLWRlbGF5Oi4xNXN9Y2lyY2xlOm50aC1jaGlsZCg0KXthbmltYXRpb24tZGVsYXk6LjIyNXN9Y2lyY2xlOm50aC1jaGlsZCg1KXthbmltYXRpb24tZGVsYXk6LjNzfWNpcmNsZTpudGgtY2hpbGQoNil7YW5pbWF0aW9uLWRlbGF5Oi4zNzVzfWNpcmNsZTpudGgtY2hpbGQoNyl7YW5pbWF0aW9uLWRlbGF5Oi40NXN9Y2lyY2xlOm50aC1jaGlsZCg4KXthbmltYXRpb24tZGVsYXk6LjUyNXN9PC9zdHlsZT48ZyBmaWxsPSJncmF5Ij48Y2lyY2xlIGN4PSI1IiBjeT0iMSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSI3LjgyOCIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjkiIGN5PSI1IiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjcuODI4IiBjeT0iNy44MjgiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iNSIgY3k9IjkiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iMi4xNzIiIGN5PSI3LjgyOCIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIxIiBjeT0iNSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIyLjE3MiIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjwvZz48L3N2Zz4=")}.hc-black .monaco-tree .monaco-tree-rows.show-twisties>.monaco-tree-row.has-children>.content:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTYgNHY4bDQtNC00LTR6bTEgMi40MTRMOC41ODYgOCA3IDkuNTg2VjYuNDE0eiIvPjwvc3ZnPg==")}.hc-black .monaco-tree .monaco-tree-rows.show-twisties>.monaco-tree-row.expanded>.content:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTExIDEwLjA3SDUuMzQ0TDExIDQuNDE0djUuNjU2eiIvPjwvc3ZnPg==")}.hc-black .monaco-tree .monaco-tree-rows>.monaco-tree-row.has-children.loading>.content:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCI+PHN0eWxlPmNpcmNsZXthbmltYXRpb246YmFsbCAuNnMgbGluZWFyIGluZmluaXRlfWNpcmNsZTpudGgtY2hpbGQoMil7YW5pbWF0aW9uLWRlbGF5Oi4wNzVzfWNpcmNsZTpudGgtY2hpbGQoMyl7YW5pbWF0aW9uLWRlbGF5Oi4xNXN9Y2lyY2xlOm50aC1jaGlsZCg0KXthbmltYXRpb24tZGVsYXk6LjIyNXN9Y2lyY2xlOm50aC1jaGlsZCg1KXthbmltYXRpb24tZGVsYXk6LjNzfWNpcmNsZTpudGgtY2hpbGQoNil7YW5pbWF0aW9uLWRlbGF5Oi4zNzVzfWNpcmNsZTpudGgtY2hpbGQoNyl7YW5pbWF0aW9uLWRlbGF5Oi40NXN9Y2lyY2xlOm50aC1jaGlsZCg4KXthbmltYXRpb24tZGVsYXk6LjUyNXN9PC9zdHlsZT48ZyBmaWxsPSIjZmZmIj48Y2lyY2xlIGN4PSI1IiBjeT0iMSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSI3LjgyOCIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjkiIGN5PSI1IiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjcuODI4IiBjeT0iNy44MjgiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iNSIgY3k9IjkiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iMi4xNzIiIGN5PSI3LjgyOCIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIxIiBjeT0iNSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIyLjE3MiIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjwvZz48L3N2Zz4=")}.monaco-tree-action.collapse-all{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iLTEgMCAxNiAxNiI+PHBhdGggZmlsbD0iIzQyNDI0MiIgZD0iTTE0IDF2OWgtMVYySDVWMWg5ek0zIDN2MWg4djhoMVYzSDN6bTcgMnY5SDFWNWg5ek04IDdIM3Y1aDVWN3oiLz48cGF0aCBmaWxsPSIjMDA1MzlDIiBkPSJNNCA5aDN2MUg0eiIvPjwvc3ZnPg==") 50% no-repeat}.hc-black .monaco-tree-action.collapse-all,.vs-dark .monaco-tree-action.collapse-all{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iLTEgMCAxNiAxNiI+PHBhdGggZmlsbD0iI0M1QzVDNSIgZD0iTTE0IDF2OWgtMVYySDVWMWg5ek0zIDN2MWg4djhoMVYzSDN6bTcgMnY5SDFWNWg5ek04IDdIM3Y1aDVWN3oiLz48cGF0aCBmaWxsPSIjNzVCRUZGIiBkPSJNNCA5aDN2MUg0eiIvPjwvc3ZnPg==") 50% no-repeat}.monaco-editor .bracket-match{box-sizing:border-box}.monaco-menu .monaco-action-bar.vertical .action-label.hover{background-color:#eee}.monaco-editor .monaco-editor-overlaymessage{padding-bottom:8px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.monaco-editor .monaco-editor-overlaymessage.fadeIn{animation:fadeIn .15s ease-out}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.monaco-editor .monaco-editor-overlaymessage.fadeOut{animation:fadeOut .1s ease-out}.monaco-editor .monaco-editor-overlaymessage .message{padding:1px 4px}.monaco-editor .monaco-editor-overlaymessage .anchor{width:0!important;height:0!important;border-color:transparent;border-style:solid;z-index:1000;border-width:8px;position:absolute}.monaco-editor .lightbulb-glyph{display:flex;align-items:center;justify-content:center;height:16px;width:20px;padding-left:2px}.monaco-editor .lightbulb-glyph:hover{cursor:pointer}.monaco-editor.vs .lightbulb-glyph{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiI+PHBhdGggZmlsbD0iI0Y2RjZGNiIgZD0iTTEzLjUgNC4yQzEzLjEgMi4xIDEwLjggMCA5LjMgMEg2LjdjLS40IDAtLjYuMi0uNi4yQzQgLjggMi41IDIuNyAyLjUgNC45YzAgLjUtLjEgMi4zIDEuNyAzLjguNS41IDEuMiAyIDEuMyAyLjR2My4zTDcuMSAxNmgybDEuNS0xLjZWMTFjLjEtLjQuOC0xLjkgMS4zLTIuMyAxLjEtLjkgMS41LTEuOSAxLjYtMi43VjQuMnoiLz48cGF0aCBkPSJNNi41IDEyaDN2MWgtM3ptMSAzaDEuMWwuOS0xaC0zeiIgZmlsbD0iIzg0ODQ4NCIvPjxwYXRoIGZpbGw9IiNmYzAiIGQ9Ik0xMi42IDVjMC0yLjMtMS44LTQuMS00LjEtNC4xLS4xIDAtMS40LjEtMS40LjEtMi4xLjMtMy43IDItMy43IDQgMCAuMS0uMiAxLjYgMS40IDMgLjcuNyAxLjUgMi40IDEuNiAyLjlsLjEuMWgzbC4xLS4yYy4xLS41LjktMi4yIDEuNi0yLjkgMS42LTEuMyAxLjQtMi44IDEuNC0yLjl6bS0zIDFsLS41IDNoLS42VjZjMS4xIDAgLjktMSAuOS0xSDYuNXYuMWMwIC4yLjEuOSAxIC45djNIN2wtLjItLjdMNi41IDZjLS43IDAtLjktLjQtMS0uN3YtLjRjMC0uOC45LS45LjktLjloMy4xczEgLjEgMSAxYzAgMCAuMSAxLS45IDF6Ii8+PHBhdGggZmlsbD0iI0YwRUZGMSIgZD0iTTEwLjUgNWMwLS45LTEtMS0xLTFINi40cy0uOS4xLS45Ljl2LjRjMCAuMy4zLjcuOS43bC40IDIuMy4yLjdoLjVWNmMtMSAwLTEtLjctMS0uOVY1aDNzLjEgMS0uOSAxdjNoLjZsLjUtM2MuOSAwIC44LTEgLjgtMXoiLz48L3N2Zz4=") 50% no-repeat}.monaco-editor.hc-black .lightbulb-glyph,.monaco-editor.vs-dark .lightbulb-glyph{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiI+PHBhdGggZmlsbD0iIzFFMUUxRSIgZD0iTTEzLjUgNC4yQzEzLjEgMi4xIDEwLjggMCA5LjMgMEg2LjdjLS40IDAtLjYuMi0uNi4yQzQgLjggMi41IDIuNyAyLjUgNC45YzAgLjUtLjEgMi4zIDEuNyAzLjguNS41IDEuMiAyIDEuMyAyLjR2My4zTDcuMSAxNmgybDEuNS0xLjZWMTFjLjEtLjQuOC0xLjkgMS4zLTIuMyAxLjEtLjkgMS41LTEuOSAxLjYtMi43VjQuMnoiLz48cGF0aCBkPSJNNi41IDEyaDN2MWgtM3ptMSAzaDEuMWwuOS0xaC0zeiIgZmlsbD0iI0M1QzVDNSIvPjxwYXRoIGZpbGw9IiNEREIyMDQiIGQ9Ik0xMi42IDVjMC0yLjMtMS44LTQuMS00LjEtNC4xLS4xIDAtMS40LjEtMS40LjEtMi4xLjMtMy43IDItMy43IDQgMCAuMS0uMiAxLjYgMS40IDMgLjcuNyAxLjUgMi40IDEuNiAyLjlsLjEuMWgzbC4xLS4yYy4xLS41LjktMi4yIDEuNi0yLjkgMS42LTEuMyAxLjQtMi44IDEuNC0yLjl6bS0zIDFsLS41IDNoLS42VjZjMS4xIDAgLjktMSAuOS0xSDYuNXYuMWMwIC4yLjEuOSAxIC45djNIN2wtLjItLjdMNi41IDZjLS43IDAtLjktLjQtMS0uN3YtLjRjMC0uOC45LS45LjktLjloMy4xczEgLjEgMSAxYzAgMCAuMSAxLS45IDF6Ii8+PHBhdGggZmlsbD0iIzI1MjUyNiIgZD0iTTEwLjUgNWMwLS45LTEtMS0xLTFINi40cy0uOS4xLS45Ljl2LjRjMCAuMy4zLjcuOS43bC40IDIuMy4yLjdoLjVWNmMtMSAwLTEtLjctMS0uOVY1aDNzLjEgMS0uOSAxdjNoLjZsLjUtM2MuOSAwIC44LTEgLjgtMXoiLz48L3N2Zz4=") 50% no-repeat}.monaco-editor .codelens-decoration{overflow:hidden;display:inline-block;text-overflow:ellipsis}.monaco-editor .codelens-decoration>a,.monaco-editor .codelens-decoration>span{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;vertical-align:sub}.monaco-editor .codelens-decoration>a{text-decoration:none}.monaco-editor .codelens-decoration>a:hover{text-decoration:underline;cursor:pointer}.monaco-editor .codelens-decoration.invisible-cl{opacity:0}@keyframes fadein{0%{opacity:0;visibility:visible}to{opacity:1}}.monaco-editor .codelens-decoration.fadein{animation:fadein .5s linear}.monaco-editor.vs .dnd-target{border-right:2px dotted #000;color:#fff}.monaco-editor.vs-dark .dnd-target{border-right:2px dotted #aeafad;color:#51504f}.monaco-editor.hc-black .dnd-target{border-right:2px dotted #fff;color:#000}.monaco-editor.hc-black.mac.mouse-default .view-lines,.monaco-editor.mouse-default .view-lines,.monaco-editor.vs-dark.mac.mouse-default .view-lines{cursor:default}.monaco-editor.hc-black.mac.mouse-copy .view-lines,.monaco-editor.mouse-copy .view-lines,.monaco-editor.vs-dark.mac.mouse-copy .view-lines{cursor:copy}.monaco-custom-checkbox{margin-left:2px;float:left;cursor:pointer;overflow:hidden;opacity:.7;width:20px;height:20px;border:1px solid transparent;padding:1px;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-o-user-select:none;-ms-user-select:none;user-select:none}.monaco-custom-checkbox.checked,.monaco-custom-checkbox:hover{opacity:1}.hc-black .monaco-custom-checkbox,.hc-black .monaco-custom-checkbox:hover{background:none}.vs .monaco-custom-checkbox.monaco-case-sensitive{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHN0eWxlPi5zdDJ7ZmlsbDojNDI0MjQyfTwvc3R5bGU+PHBhdGggZD0iTTE0LjE3NiA1LjU5MmMtLjU1NS0uNi0xLjMzNi0uOTA0LTIuMzIyLS45MDQtLjI1OCAwLS41MjEuMDI0LS43ODQuMDcyYTUuOTI0IDUuOTI0IDAgMDAtLjcuMTY5IDUuMTUgNS4xNSAwIDAwLS42MTMuMjI5IDMuMDIgMy4wMiAwIDAwLS41MTIuMjg0bC0uNDE5LjI5OXYyLjcwMWEyLjQ3NyAyLjQ3NyAwIDAwLS4yMjkuMzQ0bC0yLjQ1LTYuMzU0SDMuNzUzTDAgMTIuMjM2di41OThoMy4wMjVsLjgzOC0yLjM1SDYuMDNsLjg5MSAyLjM1aDMuMjM3bC0uMDAxLS4wMDNjLjMwNS4wOTIuNjMzLjE1Ljk5My4xNS4zNDQgMCAuNjcxLS4wNDkuOTc4LS4xNDZoMi44NTNWNy45MzJjLS4wMDEtLjk3NS0uMjcxLTEuNzYzLS44MDUtMi4zNHoiIGZpbGw9IiNmNmY2ZjYiIGlkPSJvdXRsaW5lIi8+PGcgaWQ9Imljb25feDVGX2JnIj48cGF0aCBjbGFzcz0ic3QyIiBkPSJNNy42MTEgMTEuODM0bC0uODkxLTIuMzVIMy4xNThsLS44MzggMi4zNUgxLjIyNWwzLjIxNy04LjQwMmgxLjAybDMuMjQgOC40MDJINy42MTF6TTUuMDggNS4wMmwtLjA0NC0uMTM1LS4wMzgtLjE1Ni0uMDI5LS4xNTItLjAyNC0uMTI2aC0uMDIzbC0uMDIxLjEyNi0uMDMyLjE1Mi0uMDM4LjE1Ni0uMDQ0LjEzNUwzLjQ4IDguNTk0aDIuOTE4TDUuMDggNS4wMnpNMTMuMDIgMTEuODM0di0uOTM4aC0uMDIzYy0uMTk5LjM1Mi0uNDU2LjYyLS43NzEuODA2cy0uNjczLjI3OC0xLjA3NS4yNzhjLS4zMTMgMC0uNTg4LS4wNDUtLjgyNi0uMTM1cy0uNDM4LS4yMTItLjU5OC0uMzY2LS4yODEtLjMzOC0uMzYzLS41NTEtLjEyNC0uNDQyLS4xMjQtLjY4OGMwLS4yNjIuMDM5LS41MDIuMTE3LS43MjFzLjE5OC0uNDEyLjM2LS41OC4zNjctLjMwOC42MTUtLjQxOS41NDQtLjE5Ljg4OC0uMjM3bDEuODExLS4yNTJjMC0uMjczLS4wMjktLjUwNy0uMDg4LS43cy0uMTQzLS4zNTEtLjI1Mi0uNDcyLS4yNDEtLjIxLS4zOTYtLjI2Ny0uMzI1LS4wODUtLjUxMy0uMDg1Yy0uMzYzIDAtLjcxNC4wNjQtMS4wNTIuMTkzcy0uNjM4LjMxLS45MDQuNTR2LS45ODRjLjA4Mi0uMDU5LjE5Ni0uMTIxLjM0My0uMTg4cy4zMTItLjEyOC40OTUtLjE4NS4zNzgtLjEwNC41ODMtLjE0MS40MDctLjA1Ni42MDYtLjA1NmMuNjk5IDAgMS4yMjkuMTk0IDEuNTg4LjU4M3MuNTM5Ljk0Mi41MzkgMS42NjF2My45MDJoLS45NnptLTEuNDU0LTIuODNjLS4yNzMuMDM1LS40OTguMDg1LS42NzQuMTQ5cy0uMzEzLjE0NC0uNDEuMjM3LS4xNjUuMjA1LS4yMDIuMzM0LS4wNTUuMjc2LS4wNTUuNDRjMCAuMTQxLjAyNS4yNzEuMDc2LjM5M3MuMTI0LjIyNy4yMi4zMTYuMjE1LjE2LjM1Ny4yMTEuMzA4LjA3Ni40OTUuMDc2Yy4yNDIgMCAuNDY1LS4wNDUuNjY4LS4xMzVzLjM3OC0uMjE0LjUyNC0uMzcyLjI2MS0uMzQ0LjM0My0uNTU3LjEyMy0uNDQyLjEyMy0uNjg4di0uNjA5bC0xLjQ2NS4yMDV6Ii8+PC9nPjwvc3ZnPg==") 50% no-repeat}.hc-black .monaco-custom-checkbox.monaco-case-sensitive,.hc-black .monaco-custom-checkbox.monaco-case-sensitive:hover,.vs-dark .monaco-custom-checkbox.monaco-case-sensitive{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHN0eWxlPi5zdDJ7ZmlsbDojYzVjNWM1fTwvc3R5bGU+PHBhdGggZD0iTTE0LjE3NiA1LjU5MmMtLjU1NS0uNi0xLjMzNi0uOTA0LTIuMzIyLS45MDQtLjI1OCAwLS41MjEuMDI0LS43ODQuMDcyYTUuOTI0IDUuOTI0IDAgMDAtLjcuMTY5IDUuMTUgNS4xNSAwIDAwLS42MTMuMjI5IDMuMDIgMy4wMiAwIDAwLS41MTIuMjg0bC0uNDE5LjI5OXYyLjcwMWEyLjQ3NyAyLjQ3NyAwIDAwLS4yMjkuMzQ0bC0yLjQ1LTYuMzU0SDMuNzUzTDAgMTIuMjM2di41OThoMy4wMjVsLjgzOC0yLjM1SDYuMDNsLjg5MSAyLjM1aDMuMjM3bC0uMDAxLS4wMDNjLjMwNS4wOTIuNjMzLjE1Ljk5My4xNS4zNDQgMCAuNjcxLS4wNDkuOTc4LS4xNDZoMi44NTNWNy45MzJjLS4wMDEtLjk3NS0uMjcxLTEuNzYzLS44MDUtMi4zNHoiIGZpbGw9IiMyNjI2MjYiIGlkPSJvdXRsaW5lIi8+PGcgaWQ9Imljb25feDVGX2JnIj48cGF0aCBjbGFzcz0ic3QyIiBkPSJNNy42MTEgMTEuODM0bC0uODkxLTIuMzVIMy4xNThsLS44MzggMi4zNUgxLjIyNWwzLjIxNy04LjQwMmgxLjAybDMuMjQgOC40MDJINy42MTF6TTUuMDggNS4wMmwtLjA0NC0uMTM1LS4wMzgtLjE1Ni0uMDI5LS4xNTItLjAyNC0uMTI2aC0uMDIzbC0uMDIxLjEyNi0uMDMyLjE1Mi0uMDM4LjE1Ni0uMDQ0LjEzNUwzLjQ4IDguNTk0aDIuOTE4TDUuMDggNS4wMnpNMTMuMDIgMTEuODM0di0uOTM4aC0uMDIzYy0uMTk5LjM1Mi0uNDU2LjYyLS43NzEuODA2cy0uNjczLjI3OC0xLjA3NS4yNzhjLS4zMTMgMC0uNTg4LS4wNDUtLjgyNi0uMTM1cy0uNDM4LS4yMTItLjU5OC0uMzY2LS4yODEtLjMzOC0uMzYzLS41NTEtLjEyNC0uNDQyLS4xMjQtLjY4OGMwLS4yNjIuMDM5LS41MDIuMTE3LS43MjFzLjE5OC0uNDEyLjM2LS41OC4zNjctLjMwOC42MTUtLjQxOS41NDQtLjE5Ljg4OC0uMjM3bDEuODExLS4yNTJjMC0uMjczLS4wMjktLjUwNy0uMDg4LS43cy0uMTQzLS4zNTEtLjI1Mi0uNDcyLS4yNDEtLjIxLS4zOTYtLjI2Ny0uMzI1LS4wODUtLjUxMy0uMDg1Yy0uMzYzIDAtLjcxNC4wNjQtMS4wNTIuMTkzcy0uNjM4LjMxLS45MDQuNTR2LS45ODRjLjA4Mi0uMDU5LjE5Ni0uMTIxLjM0My0uMTg4cy4zMTItLjEyOC40OTUtLjE4NS4zNzgtLjEwNC41ODMtLjE0MS40MDctLjA1Ni42MDYtLjA1NmMuNjk5IDAgMS4yMjkuMTk0IDEuNTg4LjU4M3MuNTM5Ljk0Mi41MzkgMS42NjF2My45MDJoLS45NnptLTEuNDU0LTIuODNjLS4yNzMuMDM1LS40OTguMDg1LS42NzQuMTQ5cy0uMzEzLjE0NC0uNDEuMjM3LS4xNjUuMjA1LS4yMDIuMzM0LS4wNTUuMjc2LS4wNTUuNDRjMCAuMTQxLjAyNS4yNzEuMDc2LjM5M3MuMTI0LjIyNy4yMi4zMTYuMjE1LjE2LjM1Ny4yMTEuMzA4LjA3Ni40OTUuMDc2Yy4yNDIgMCAuNDY1LS4wNDUuNjY4LS4xMzVzLjM3OC0uMjE0LjUyNC0uMzcyLjI2MS0uMzQ0LjM0My0uNTU3LjEyMy0uNDQyLjEyMy0uNjg4di0uNjA5bC0xLjQ2NS4yMDV6Ii8+PC9nPjwvc3ZnPg==") 50% no-repeat}.vs .monaco-custom-checkbox.monaco-whole-word{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHN0eWxlPi5zdDJ7ZmlsbDojNDI0MjQyfTwvc3R5bGU+PHBhdGggZD0iTTE2IDQuMDIyVjFILS4wMTR2My4wMjJoMy4wNDZsLTMuMDQzIDcuOTQ1aC0uMDA0di4wMUwwIDEzaC0uMDE0djEuOTkxSDE2di0zLjAyM2gtMVY0LjAyMmgxem0tNS45MTQgNS4zMDFjMCAuMjMzLS4wMjMuNDQxLS4wNjYuNTk1YS44Ni44NiAwIDAxLS4xMjcuMjg0bC0uMDc4LjA2OS0uMTUxLjAyNi0uMTE1LS4wMTctLjEzOS0uMTM3YTEuNzc0IDEuNzc0IDAgMDEtLjExMi0uNTY2YzAtLjI1NC4wOTEtLjU2MS4xMjYtLjY1NmwuMDY5LS4xNDEuMTA5LS4wODIuMTc4LS4wMjdjLjA3NyAwIC4xMTcuMDE0LjE3Ny4wNTZsLjA4Ny4xNzkuMDUxLjIzNy0uMDA5LjE4ek02LjM5MSA0LjAyMnYyLjg5M0w1LjI3NSA0LjAyMmgxLjExNnptLTMuMDI2IDcuMDJoMS41NzNsLjM1MS45MjZIMy4wMzVsLjMzLS45MjZ6TTEyIDYuNjg4Yy0uMjA2LS4yLS40MzEtLjM4LS42OTUtLjUxMmEzLjAwNiAzLjAwNiAwIDAwLTEuMzU1LS4yOThjLS4yMTUgMC0uNDIzLjAyLS42MjEuMDU4VjQuMDIySDEydjIuNjY2eiIgZmlsbD0iI2Y2ZjZmNiIgaWQ9Im91dGxpbmUiLz48ZyBpZD0iaWNvbl94NUZfYmciPjxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik0xMyA0aDF2OGgtMXpNMTEuMjI1IDguMzg3Yy0uMDc4LS4yOTktLjE5OS0uNTYyLS4zNi0uNzg2cy0uMzY1LS40MDEtLjYwOS0uNTMtLjUzNC0uMTkzLS44NjYtLjE5M2MtLjE5OCAwLS4zOC4wMjQtLjU0Ny4wNzNhMS43NiAxLjc2IDAgMDAtLjQ1My4yMDUgMS43MjQgMS43MjQgMCAwMC0uMzY1LjMxOGwtLjE3OS4yNThWNC41NzhoLS44OTNWMTJoLjg5M3YtLjU3NWwuMTI2LjE3NWMuMDg3LjEwMi4xODkuMTkuMzA0LjI2OS4xMTcuMDc4LjI0OS4xNC4zOTguMTg2LjE0OS4wNDYuMzE0LjA2OC40OTguMDY4LjM1MyAwIC42NjYtLjA3MS45MzctLjIxMi4yNzItLjE0My40OTktLjMzOC42ODItLjU4Ni4xODMtLjI1LjMyMS0uNTQzLjQxNC0uODc5LjA5My0uMzM4LjE0LS43MDMuMTQtMS4wOTdhMy43NTYgMy43NTYgMCAwMC0uMTItLjk2MnpNOS43NDYgNy43OGMuMTUxLjA3MS4yODIuMTc2LjM5LjMxNC4xMDkuMTQuMTk0LjMxMy4yNTUuNTE3LjA1MS4xNzQuMDgyLjM3MS4wODkuNTg3bC0uMDA3LjEyNWMwIC4zMjctLjAzMy42Mi0uMS44NjlhMS44ODYgMS44ODYgMCAwMS0uMjc4LjYxNGMtLjExNy4xNjItLjI2LjI4NS0uNDIxLjM2Ni0uMzIyLjE2Mi0uNzYuMTY2LTEuMDY5LjAxNWExLjI2NCAxLjI2NCAwIDAxLS4zOTMtLjI5NiAxLjI3MyAxLjI3MyAwIDAxLS4yMTgtLjM2N3MtLjE3OS0uNDQ3LS4xNzktLjk0N2MwLS41LjE3OS0xLjAwMi4xNzktMS4wMDIuMDYyLS4xNzcuMTM2LS4zMTguMjI0LS40My4xMTQtLjE0My4yNTYtLjI1OS40MjQtLjM0NS4xNjgtLjA4Ni4zNjUtLjEyOS41ODctLjEyOS4xOSAwIC4zNjQuMDM3LjUxNy4xMDl6TS45ODcgMkgxNXYxLjAyM0guOTg3ek0uOTg3IDEyLjk2OEgxNXYxLjAyM0guOTg3ek0xLjk5MSAxMi4wMzFMMi43MTkgMTBoMi4yMTlsLjc3OCAyLjAzMWgxLjA4Mkw0LjMxMyA0Ljg3M2gtLjk0MUwuOTMxIDExLjk1OWwtLjAyNS4wNzJoMS4wODV6bTEuODI3LTUuNjA5aC4wMjJsLjkxNCAyLjc1M0gyLjkxM2wuOTA1LTIuNzUzeiIvPjwvZz48L3N2Zz4=") 50% no-repeat}.hc-black .monaco-custom-checkbox.monaco-whole-word,.hc-black .monaco-custom-checkbox.monaco-whole-word:hover,.vs-dark .monaco-custom-checkbox.monaco-whole-word{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHN0eWxlPi5zdDJ7ZmlsbDojYzVjNWM1fTwvc3R5bGU+PHBhdGggZD0iTTE2IDQuMDIyVjFILS4wMTR2My4wMjJoMy4wNDZsLTMuMDQzIDcuOTQ1aC0uMDA0di4wMUwwIDEzaC0uMDE0djEuOTkxSDE2di0zLjAyM2gtMVY0LjAyMmgxem0tNS45MTQgNS4zMDFjMCAuMjMzLS4wMjMuNDQxLS4wNjYuNTk1YS44Ni44NiAwIDAxLS4xMjcuMjg0bC0uMDc4LjA2OS0uMTUxLjAyNi0uMTE1LS4wMTctLjEzOS0uMTM3YTEuNzc0IDEuNzc0IDAgMDEtLjExMi0uNTY2YzAtLjI1NC4wOTEtLjU2MS4xMjYtLjY1NmwuMDY5LS4xNDEuMTA5LS4wODIuMTc4LS4wMjdjLjA3NyAwIC4xMTcuMDE0LjE3Ny4wNTZsLjA4Ny4xNzkuMDUxLjIzNy0uMDA5LjE4ek02LjM5MSA0LjAyMnYyLjg5M0w1LjI3NSA0LjAyMmgxLjExNnptLTMuMDI2IDcuMDJoMS41NzNsLjM1MS45MjZIMy4wMzVsLjMzLS45MjZ6TTEyIDYuNjg4Yy0uMjA2LS4yLS40MzEtLjM4LS42OTUtLjUxMmEzLjAwNiAzLjAwNiAwIDAwLTEuMzU1LS4yOThjLS4yMTUgMC0uNDIzLjAyLS42MjEuMDU4VjQuMDIySDEydjIuNjY2eiIgZmlsbD0iIzI2MjYyNiIgaWQ9Im91dGxpbmUiLz48ZyBpZD0iaWNvbl94NUZfYmciPjxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik0xMyA0aDF2OGgtMXpNMTEuMjI1IDguMzg3Yy0uMDc4LS4yOTktLjE5OS0uNTYyLS4zNi0uNzg2cy0uMzY1LS40MDEtLjYwOS0uNTMtLjUzNC0uMTkzLS44NjYtLjE5M2MtLjE5OCAwLS4zOC4wMjQtLjU0Ny4wNzNhMS43NiAxLjc2IDAgMDAtLjQ1My4yMDUgMS43MjQgMS43MjQgMCAwMC0uMzY1LjMxOGwtLjE3OS4yNThWNC41NzhoLS44OTNWMTJoLjg5M3YtLjU3NWwuMTI2LjE3NWMuMDg3LjEwMi4xODkuMTkuMzA0LjI2OS4xMTcuMDc4LjI0OS4xNC4zOTguMTg2LjE0OS4wNDYuMzE0LjA2OC40OTguMDY4LjM1MyAwIC42NjYtLjA3MS45MzctLjIxMi4yNzItLjE0My40OTktLjMzOC42ODItLjU4Ni4xODMtLjI1LjMyMS0uNTQzLjQxNC0uODc5LjA5My0uMzM4LjE0LS43MDMuMTQtMS4wOTdhMy43NTYgMy43NTYgMCAwMC0uMTItLjk2MnpNOS43NDYgNy43OGMuMTUxLjA3MS4yODIuMTc2LjM5LjMxNC4xMDkuMTQuMTk0LjMxMy4yNTUuNTE3LjA1MS4xNzQuMDgyLjM3MS4wODkuNTg3bC0uMDA3LjEyNWMwIC4zMjctLjAzMy42Mi0uMS44NjlhMS44ODYgMS44ODYgMCAwMS0uMjc4LjYxNGMtLjExNy4xNjItLjI2LjI4NS0uNDIxLjM2Ni0uMzIyLjE2Mi0uNzYuMTY2LTEuMDY5LjAxNWExLjI2NCAxLjI2NCAwIDAxLS4zOTMtLjI5NiAxLjI3MyAxLjI3MyAwIDAxLS4yMTgtLjM2N3MtLjE3OS0uNDQ3LS4xNzktLjk0N2MwLS41LjE3OS0xLjAwMi4xNzktMS4wMDIuMDYyLS4xNzcuMTM2LS4zMTguMjI0LS40My4xMTQtLjE0My4yNTYtLjI1OS40MjQtLjM0NS4xNjgtLjA4Ni4zNjUtLjEyOS41ODctLjEyOS4xOSAwIC4zNjQuMDM3LjUxNy4xMDl6TS45ODcgMkgxNXYxLjAyM0guOTg3ek0uOTg3IDEyLjk2OEgxNXYxLjAyM0guOTg3ek0xLjk5MSAxMi4wMzFMMi43MTkgMTBoMi4yMTlsLjc3OCAyLjAzMWgxLjA4Mkw0LjMxMyA0Ljg3M2gtLjk0MUwuOTMxIDExLjk1OWwtLjAyNS4wNzJoMS4wODV6bTEuODI3LTUuNjA5aC4wMjJsLjkxNCAyLjc1M0gyLjkxM2wuOTA1LTIuNzUzeiIvPjwvZz48L3N2Zz4=") 50% no-repeat}.vs .monaco-custom-checkbox.monaco-regex{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iI0Y2RjZGNiIgZD0iTTEzLjY0IDcuMzk2bC0xLjQ3MS00LjQ5OC0xLjQ2My44NjNMMTEuMDg3IDJoLTQuNTNsLjM3OSAxLjc2Mi0xLjQ2My0uODY0TDQgNy4zOTZsMS42ODIuMTU4LTEuMTY5IDEuMDA3LjUuNDM5SDJ2NWg1di0zLjI1M2wuOTc4Ljg1OS44NDItMS44ODEuODQxIDEuODc3IDMuNDgzLTMuMDQtMS4xNzYtMS4wMDh6Ii8+PGcgZmlsbD0iIzQyNDI0MiI+PHBhdGggZD0iTTEyLjMwMSA2LjUxOGwtMi43NzIuMjYyIDIuMDg2IDEuNzg4LTEuNTk0IDEuMzkyTDguODIgNy4yNzggNy42MTkgOS45NiA2LjAzNiA4LjU2OCA4LjExMSA2Ljc4IDUuMzQgNi41MThsLjY5Ni0yLjEyNiAyLjM1OCAxLjM5Mkw3Ljc5NSAzaDIuMDUzbC0uNjAyIDIuNzgzIDIuMzU5LTEuMzkyLjY5NiAyLjEyN3pNMyAxMGgzdjNIM3oiLz48L2c+PC9zdmc+") 50% no-repeat}.hc-black .monaco-custom-checkbox.monaco-regex,.hc-black .monaco-custom-checkbox.monaco-regex:hover,.vs-dark .monaco-custom-checkbox.monaco-regex{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iIzJkMmQzMCIgZD0iTTEzLjY0IDcuMzk2bC0xLjQ3MS00LjQ5OC0xLjQ2My44NjNMMTEuMDg3IDJoLTQuNTNsLjM3OSAxLjc2Mi0xLjQ2My0uODY0TDQgNy4zOTZsMS42ODIuMTU4LTEuMTY5IDEuMDA3LjUuNDM5SDJ2NWg1di0zLjI1M2wuOTc4Ljg1OS44NDItMS44ODEuODQxIDEuODc3IDMuNDgzLTMuMDQtMS4xNzYtMS4wMDh6Ii8+PGcgZmlsbD0iI0M1QzVDNSI+PHBhdGggZD0iTTEyLjMwMSA2LjUxOGwtMi43NzIuMjYyIDIuMDg2IDEuNzg4LTEuNTk0IDEuMzkyTDguODIgNy4yNzggNy42MTkgOS45NiA2LjAzNiA4LjU2OCA4LjExMSA2Ljc4IDUuMzQgNi41MThsLjY5Ni0yLjEyNiAyLjM1OCAxLjM5Mkw3Ljc5NSAzaDIuMDUzbC0uNjAyIDIuNzgzIDIuMzU5LTEuMzkyLjY5NiAyLjEyN3pNMyAxMGgzdjNIM3oiLz48L2c+PC9zdmc+") 50% no-repeat}.monaco-checkbox .label{width:12px;height:12px;border:1px solid #000;background-color:transparent;display:inline-block}.monaco-checkbox .checkbox{position:absolute;overflow:hidden;clip:rect(0 0 0 0);height:1px;width:1px;margin:-1px;padding:0;border:0}.monaco-checkbox .checkbox:checked+.label{background-color:#000}.monaco-editor .find-widget{position:absolute;z-index:10;top:-44px;height:34px;overflow:hidden;line-height:19px;transition:top .2s linear;padding:0 4px}.monaco-editor .find-widget.replaceToggled{top:-74px;height:64px}.monaco-editor .find-widget.replaceToggled>.replace-part{display:flex;display:-webkit-flex;align-items:center}.monaco-editor .find-widget.replaceToggled.visible,.monaco-editor .find-widget.visible{top:0}.monaco-editor .find-widget .monaco-inputbox .input{background-color:transparent;min-height:0}.monaco-editor .find-widget .replace-input .input{font-size:13px}.monaco-editor .find-widget>.find-part,.monaco-editor .find-widget>.replace-part{margin:4px 0 0 17px;font-size:12px;display:flex;display:-webkit-flex;align-items:center}.monaco-editor .find-widget>.find-part .monaco-inputbox,.monaco-editor .find-widget>.replace-part .monaco-inputbox{height:25px}.monaco-editor .find-widget>.find-part .monaco-inputbox>.wrapper>.input{width:100%!important;padding-right:66px}.monaco-editor .find-widget>.find-part .monaco-inputbox>.wrapper>.input,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.wrapper>.input{padding-top:2px;padding-bottom:2px}.monaco-editor .find-widget .monaco-findInput{vertical-align:middle;display:flex;display:-webkit-flex;flex:1}.monaco-editor .find-widget .matchesCount{display:flex;display:-webkit-flex;flex:initial;margin:0 1px 0 3px;padding:2px 2px 0 2px;height:25px;vertical-align:middle;box-sizing:border-box;text-align:center;line-height:23px}.monaco-editor .find-widget .button{min-width:20px;width:20px;height:20px;display:flex;display:-webkit-flex;flex:initial;margin-left:3px;background-position:50%;background-repeat:no-repeat;cursor:pointer}.monaco-editor .find-widget .button:not(.disabled):hover{background-color:rgba(0,0,0,.1)}.monaco-editor .find-widget .button.left{margin-left:0;margin-right:3px}.monaco-editor .find-widget .button.wide{width:auto;padding:1px 6px;top:-1px}.monaco-editor .find-widget .button.toggle{position:absolute;top:0;left:0;width:18px;height:100%;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.monaco-editor .find-widget .button.toggle.disabled{display:none}.monaco-editor .find-widget .previous{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iLTEgLTMgMTYgMTYiPjxwYXRoIGZpbGw9IiM0MjQyNDIiIGQ9Ik0xMyA0SDZsMy0zSDZMMiA1bDQgNGgzTDYgNmg3eiIvPjwvc3ZnPg==")}.monaco-editor .find-widget .next{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iLTEgLTMgMTYgMTYiPjxwYXRoIGZpbGw9IiM0MjQyNDIiIGQ9Ik0xIDRoN0w1IDFoM2w0IDQtNCA0SDVsMy0zSDFWNHoiLz48L3N2Zz4=")}.monaco-editor .find-widget .disabled{opacity:.3;cursor:default}.monaco-editor .find-widget .monaco-checkbox{width:20px;height:20px;display:inline-block;vertical-align:middle;margin-left:3px}.monaco-editor .find-widget .monaco-checkbox .label{content:"";display:inline-block;background-repeat:no-repeat;background-position:0 0;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PGcgZmlsbD0iIzQyNDI0MiI+PHBhdGggZD0iTTIgMTRoOXYySDJ6TTIgMTFoMTN2Mkgyek0yIDhoNnYySDJ6TTIgNWgxMnYySDJ6Ii8+PC9nPjwvc3ZnPg==");width:20px;height:20px;border:none}.monaco-editor .find-widget .monaco-checkbox .checkbox:disabled+.label{opacity:.3;cursor:default}.monaco-editor .find-widget .monaco-checkbox .checkbox:not(:disabled)+.label{cursor:pointer}.monaco-editor .find-widget .monaco-checkbox .checkbox:not(:disabled):hover:before+.label{background-color:#ddd}.monaco-editor .find-widget .monaco-checkbox .checkbox:checked+.label{background-color:hsla(0,0%,39.2%,.2)}.monaco-editor .find-widget .close-fw{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMyAzIDE2IDE2Ij48cGF0aCBmaWxsPSIjNDI0MjQyIiBkPSJNMTIuNTk3IDExLjA0MmwyLjgwMyAyLjgwMy0xLjU1NiAxLjU1NS0yLjgwMi0yLjgwMkw4LjIzOSAxNS40bC0xLjU1Ni0xLjU1NSAyLjgwMi0yLjgwMy0yLjgwMi0yLjgwMyAxLjU1NS0xLjU1NiAyLjgwNCAyLjgwMyAyLjgwMy0yLjgwM0wxNS40IDguMjM5eiIvPjwvc3ZnPg==")}.monaco-editor .find-widget .expand{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iIzY0NjQ2NSIgZD0iTTExIDEwLjA3SDUuMzQ0TDExIDQuNDE0djUuNjU2eiIvPjwvc3ZnPg==")}.monaco-editor .find-widget .collapse{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iIzY0NjQ2NSIgZD0iTTYgNHY4bDQtNC00LTR6bTEgMi40MTRMOC41ODYgOCA3IDkuNTg2VjYuNDE0eiIvPjwvc3ZnPg==")}.monaco-editor .find-widget .replace{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PGcgZmlsbD0iIzQyNDI0MiI+PHBhdGggZD0iTTExIDNWMWgtMXY2aDRWM2gtM3ptMiAzaC0yVjRoMnYyek0yIDE1aDdWOUgydjZ6bTItNWgzdjFINXYyaDJ2MUg0di00eiIvPjwvZz48cGF0aCBmaWxsPSIjMDA1MzlDIiBkPSJNMy45NzkgMy41TDQgNiAzIDV2MS41TDQuNSA4IDYgNi41VjVMNSA2bC0uMDIxLTIuNWMwLS4yNzUuMjI1LS41LjUtLjVIOVYySDUuNDc5Yy0uODI4IDAtMS41LjY3My0xLjUgMS41eiIvPjwvc3ZnPg==")}.monaco-editor .find-widget .replace-all{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iIzQyNDI0MiIgZD0iTTExIDE1VjlIMXY2aDEwem0tOS0xdi0yaDF2LTFIMnYtMWgzdjRIMnptOC0zSDh2MmgydjFIN3YtNGgzdjF6bS03IDJ2LTFoMXYxSDN6bTEwLTZ2NmgtMVY4SDVWN2g4em0wLTVWMWgtMXY1aDNWMmgtMnptMSAzaC0xVjNoMXYyem0tMy0zdjRIOFY0aDF2MWgxVjRIOVYzSDhWMmgzeiIvPjxwYXRoIGZpbGw9IiMwMDUzOUMiIGQ9Ik0xLjk3OSAzLjVMMiA2IDEgNXYxLjVMMi41IDggNCA2LjVWNUwzIDZsLS4wMjEtMi41YzAtLjI3NS4yMjUtLjUuNS0uNUg3VjJIMy40NzljLS44MjggMC0xLjUuNjczLTEuNSAxLjV6Ii8+PC9zdmc+")}.monaco-editor .find-widget>.replace-part{display:none}.monaco-editor .find-widget>.replace-part>.replace-input{display:flex;display:-webkit-flex;vertical-align:middle;width:auto!important}.monaco-editor .find-widget.reduced-find-widget .matchesCount,.monaco-editor .find-widget.reduced-find-widget .monaco-checkbox{display:none}.monaco-editor .find-widget.narrow-find-widget{max-width:257px!important}.monaco-editor .find-widget.collapsed-find-widget{max-width:170px!important}.monaco-editor .find-widget.collapsed-find-widget .button.next,.monaco-editor .find-widget.collapsed-find-widget .button.previous,.monaco-editor .find-widget.collapsed-find-widget .button.replace,.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,.monaco-editor .find-widget.collapsed-find-widget>.find-part .monaco-findInput .controls{display:none}.monaco-editor .findMatch{-webkit-animation-duration:0;-webkit-animation-name:inherit!important;-moz-animation-duration:0;-moz-animation-name:inherit!important;-ms-animation-duration:0;-ms-animation-name:inherit!important;animation-duration:0;animation-name:inherit!important}.monaco-editor .find-widget .monaco-sash{width:2px!important;margin-left:-4px}.monaco-editor.hc-black .find-widget .previous,.monaco-editor.vs-dark .find-widget .previous{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iLTEgLTMgMTYgMTYiPjxwYXRoIGZpbGw9IiNDNUM1QzUiIGQ9Ik0xMyA0SDZsMy0zSDZMMiA1bDQgNGgzTDYgNmg3eiIvPjwvc3ZnPg==")}.monaco-editor.hc-black .find-widget .next,.monaco-editor.vs-dark .find-widget .next{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iLTEgLTMgMTYgMTYiPjxwYXRoIGZpbGw9IiNDNUM1QzUiIGQ9Ik0xIDRoN0w1IDFoM2w0IDQtNCA0SDVsMy0zSDFWNHoiLz48L3N2Zz4=")}.monaco-editor.hc-black .find-widget .monaco-checkbox .label,.monaco-editor.vs-dark .find-widget .monaco-checkbox .label{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PGcgZmlsbD0iI2M1YzVjNSI+PHBhdGggZD0iTTIgMTRoOXYySDJ6TTIgMTFoMTN2Mkgyek0yIDhoNnYySDJ6TTIgNWgxMnYySDJ6Ii8+PC9nPjwvc3ZnPg==")}.monaco-editor.vs-dark .find-widget .monaco-checkbox .checkbox:checked+.label,.monaco-editor.vs-dark .find-widget .monaco-checkbox .checkbox:not(:disabled):hover:before+.label{background-color:hsla(0,0%,100%,.1)}.monaco-editor.hc-black .find-widget .close-fw,.monaco-editor.vs-dark .find-widget .close-fw{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMyAzIDE2IDE2Ij48cGF0aCBmaWxsPSIjZThlOGU4IiBkPSJNMTIuNTk3IDExLjA0MmwyLjgwMyAyLjgwMy0xLjU1NiAxLjU1NS0yLjgwMi0yLjgwMkw4LjIzOSAxNS40bC0xLjU1Ni0xLjU1NSAyLjgwMi0yLjgwMy0yLjgwMi0yLjgwMyAxLjU1NS0xLjU1NiAyLjgwNCAyLjgwMyAyLjgwMy0yLjgwM0wxNS40IDguMjM5eiIvPjwvc3ZnPg==")}.monaco-editor.hc-black .find-widget .replace,.monaco-editor.vs-dark .find-widget .replace{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PGcgZmlsbD0iI0M1QzVDNSI+PHBhdGggZD0iTTExIDNWMWgtMXY2aDRWM2gtM3ptMiAzaC0yVjRoMnYyek0yIDE1aDdWOUgydjZ6bTItNWgzdjFINXYyaDJ2MUg0di00eiIvPjwvZz48cGF0aCBmaWxsPSIjNzVCRUZGIiBkPSJNMy45NzkgMy41TDQgNiAzIDV2MS41TDQuNSA4IDYgNi41VjVMNSA2bC0uMDIxLTIuNWMwLS4yNzUuMjI1LS41LjUtLjVIOVYySDUuNDc5Yy0uODI4IDAtMS41LjY3My0xLjUgMS41eiIvPjwvc3ZnPg==")}.monaco-editor.hc-black .find-widget .replace-all,.monaco-editor.vs-dark .find-widget .replace-all{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iI0M1QzVDNSIgZD0iTTExIDE1VjlIMXY2aDEwem0tOS0xdi0yaDF2LTFIMnYtMWgzdjRIMnptOC0zSDh2MmgydjFIN3YtNGgzdjF6bS03IDJ2LTFoMXYxSDN6bTEwLTZ2NmgtMVY4SDVWN2g4em0wLTVWMWgtMXY1aDNWMmgtMnptMSAzaC0xVjNoMXYyem0tMy0zdjRIOFY0aDF2MWgxVjRIOVYzSDhWMmgzeiIvPjxwYXRoIGZpbGw9IiM3NUJFRkYiIGQ9Ik0xLjk3OSAzLjVMMiA2IDEgNXYxLjVMMi41IDggNCA2LjVWNUwzIDZsLS4wMjEtMi41YzAtLjI3NS4yMjUtLjUuNS0uNUg3VjJIMy40NzljLS44MjggMC0xLjUuNjczLTEuNSAxLjV6Ii8+PC9zdmc+")}.monaco-editor.hc-black .find-widget .expand,.monaco-editor.vs-dark .find-widget .expand{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iI2U4ZThlOCIgZD0iTTExIDEwLjA3SDUuMzQ0TDExIDQuNDE0djUuNjU2eiIvPjwvc3ZnPg==")}.monaco-editor.hc-black .find-widget .collapse,.monaco-editor.vs-dark .find-widget .collapse{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iI2U4ZThlOCIgZD0iTTYgNHY4bDQtNC00LTR6bTEgMi40MTRMOC41ODYgOCA3IDkuNTg2VjYuNDE0eiIvPjwvc3ZnPg==")}.monaco-editor.hc-black .find-widget .button:not(.disabled):hover,.monaco-editor.vs-dark .find-widget .button:not(.disabled):hover{background-color:hsla(0,0%,100%,.1)}.monaco-editor.hc-black .find-widget .button:before{position:relative;top:1px;left:2px}.monaco-editor.hc-black .find-widget .monaco-checkbox .checkbox:checked+.label{background-color:hsla(0,0%,100%,.1)}.monaco-inputbox{position:relative;display:block;padding:0;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;line-height:auto!important;font-size:inherit}.monaco-inputbox.idle{border:1px solid transparent}.monaco-inputbox>.wrapper>.input,.monaco-inputbox>.wrapper>.mirror{padding:4px}.monaco-inputbox>.wrapper{position:relative;width:100%;height:100%}.monaco-inputbox>.wrapper>.input{display:inline-block;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;line-height:inherit;border:none;font-family:inherit;font-size:inherit;resize:none;color:inherit}.monaco-inputbox>.wrapper>input{text-overflow:ellipsis}.monaco-inputbox>.wrapper>textarea.input{display:block;overflow:hidden}.monaco-inputbox>.wrapper>.mirror{position:absolute;display:inline-block;width:100%;top:0;left:0;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;white-space:pre-wrap;visibility:hidden;min-height:26px;word-wrap:break-word}.monaco-inputbox-container{text-align:right}.monaco-inputbox-container .monaco-inputbox-message{display:inline-block;overflow:hidden;text-align:left;width:100%;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;padding:.4em;font-size:12px;line-height:17px;min-height:34px;margin-top:-1px;word-wrap:break-word}.monaco-inputbox .monaco-action-bar{position:absolute;right:2px;top:4px}.monaco-inputbox .monaco-action-bar .action-item{margin-left:2px}.monaco-inputbox .monaco-action-bar .action-item .icon{background-repeat:no-repeat;width:16px;height:16px}.monaco-findInput{position:relative}.monaco-findInput .monaco-inputbox{font-size:13px;width:100%;height:25px}.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.vs .monaco-findInput.disabled{background-color:#e1e1e1}.vs-dark .monaco-findInput.disabled{background-color:#333}.monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-0 .1s linear 0s}.monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-1 .1s linear 0s}.hc-black .monaco-findInput.highlight-0 .controls,.vs-dark .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-dark-0 .1s linear 0s}.hc-black .monaco-findInput.highlight-1 .controls,.vs-dark .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-dark-1 .1s linear 0s}@keyframes monaco-findInput-highlight-0{0%{background:rgba(253,255,0,.8)}to{background:transparent}}@keyframes monaco-findInput-highlight-1{0%{background:rgba(253,255,0,.8)}99%{background:transparent}}@keyframes monaco-findInput-highlight-dark-0{0%{background:hsla(0,0%,100%,.44)}to{background:transparent}}@keyframes monaco-findInput-highlight-dark-1{0%{background:hsla(0,0%,100%,.44)}99%{background:transparent}}.monaco-editor .margin-view-overlays .folding{cursor:pointer;background-repeat:no-repeat;background-origin:border-box;background-position:calc(50% + 2px) 50%;background-size:auto calc(100% - 3px);opacity:0;transition:opacity .5s;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNSAxNSI+PHBhdGggZD0iTTExIDR2N0g0VjRoN20xLTFIM3Y5aDlWM3oiIGZpbGw9IiNiNmI2YjYiLz48cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiM2YjZiNmIiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgZD0iTTEwIDcuNUg1Ii8+PC9zdmc+")}.monaco-editor.hc-black .margin-view-overlays .folding,.monaco-editor.vs-dark .margin-view-overlays .folding{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNSAxNSI+PHBhdGggZD0iTTExIDR2N0g0VjRoN20xLTFIM3Y5aDlWM3oiIGZpbGw9IiM1YTVhNWEiLz48cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNjNWM1YzUiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgZD0iTTEwIDcuNUg1Ii8+PC9zdmc+")}.monaco-editor .margin-view-overlays .folding.alwaysShowFoldIcons,.monaco-editor .margin-view-overlays:hover .folding{opacity:1}.monaco-editor .margin-view-overlays .folding.collapsed{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNSAxNSI+PHBhdGggZmlsbD0iI2U4ZThlOCIgZD0iTTMgM2g5djlIM3oiLz48cGF0aCBkPSJNMTEgNHY3SDRWNGg3bTEtMUgzdjloOVYzeiIgZmlsbD0iI2I2YjZiNiIvPjxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZiNmI2YiIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBkPSJNMTAgNy41SDVNNy41IDV2NSIvPjwvc3ZnPg==");opacity:1}.monaco-editor.hc-black .margin-view-overlays .folding.collapsed,.monaco-editor.vs-dark .margin-view-overlays .folding.collapsed{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNSAxNSI+PHBhdGggb3BhY2l0eT0iLjEiIGZpbGw9IiNmZmYiIGQ9Ik0zIDNoOXY5SDN6Ii8+PHBhdGggZD0iTTExIDR2N0g0VjRoN20xLTFIM3Y5aDlWM3oiIGZpbGw9IiM1YTVhNWEiLz48cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNjNWM1YzUiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgZD0iTTEwIDcuNUg1TTcuNSA1djUiLz48L3N2Zz4=")}.monaco-editor .inline-folded:after{color:grey;margin:.1em .2em 0 .2em;content:"⋯";display:inline;line-height:1em;cursor:pointer}.monaco-editor .peekview-widget .head{-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;display:flex}.monaco-editor .peekview-widget .head .peekview-title{display:inline-block;font-size:13px;margin-left:20px;cursor:pointer}.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.monaco-editor .peekview-widget .head .peekview-actions{flex:1;text-align:right;padding-right:2px}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar{display:inline-block}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar,.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar>.actions-container{height:100%}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar .action-item{margin-left:4px}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar .action-label{width:16px;height:100%;margin:0;line-height:inherit;background-repeat:no-repeat;background-position:50%}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar .action-label.octicon{margin:0}.monaco-editor .peekview-widget .head .peekview-actions .action-label.icon.close-peekview-action{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMyAzIDE2IDE2Ij48cGF0aCBmaWxsPSIjNDI0MjQyIiBkPSJNMTIuNTk3IDExLjA0MmwyLjgwMyAyLjgwMy0xLjU1NiAxLjU1NS0yLjgwMi0yLjgwMkw4LjIzOSAxNS40bC0xLjU1Ni0xLjU1NSAyLjgwMi0yLjgwMy0yLjgwMi0yLjgwMyAxLjU1NS0xLjU1NiAyLjgwNCAyLjgwMyAyLjgwMy0yLjgwM0wxNS40IDguMjM5eiIvPjwvc3ZnPg==") 50% no-repeat}.monaco-editor .peekview-widget>.body{border-top:1px solid;position:relative}.monaco-editor.hc-black .peekview-widget .head .peekview-actions .action-label.icon.close-peekview-action,.monaco-editor.vs-dark .peekview-widget .head .peekview-actions .action-label.icon.close-peekview-action{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMyAzIDE2IDE2Ij48cGF0aCBmaWxsPSIjZThlOGU4IiBkPSJNMTIuNTk3IDExLjA0MmwyLjgwMyAyLjgwMy0xLjU1NiAxLjU1NS0yLjgwMi0yLjgwMkw4LjIzOSAxNS40bC0xLjU1Ni0xLjU1NSAyLjgwMi0yLjgwMy0yLjgwMi0yLjgwMyAxLjU1NS0xLjU1NiAyLjgwNCAyLjgwMyAyLjgwMy0yLjgwM0wxNS40IDguMjM5eiIvPjwvc3ZnPg==") 50% no-repeat}.monaco-editor .zone-widget{position:absolute;z-index:10}.monaco-editor .zone-widget .zone-widget-container{border-top-style:solid;border-bottom-style:solid;border-top-width:0;border-bottom-width:0;position:relative}.monaco-count-badge{padding:.3em .5em;border-radius:1em;font-size:85%;min-width:1.6em;line-height:1em;font-weight:400;text-align:center;display:inline-block;box-sizing:border-box}.monaco-icon-label{display:flex;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label:before{background-size:16px;background-position:0;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;display:inline-block;-webkit-font-smoothing:antialiased;vertical-align:top;flex-shrink:0}.monaco-icon-label>.monaco-icon-label-description-container{overflow:hidden;text-overflow:ellipsis}.monaco-icon-label>.monaco-icon-label-description-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-description-container>.label-description{opacity:.7;margin-left:.5em;font-size:.9em;white-space:pre}.monaco-icon-label.italic>.monaco-icon-label-description-container>.label-description,.monaco-icon-label.italic>.monaco-icon-label-description-container>.label-name{font-style:italic}.monaco-icon-label:after{opacity:.75;font-size:90%;font-weight:600;padding:0 12px 0 5px;margin-left:auto;text-align:center}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after,.monaco-tree.focused .selected .monaco-icon-label,.monaco-tree.focused .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description,.monaco-tree-row.focused.selected .label-description,.monaco-tree-row.selected .label-description{opacity:.8}.monaco-editor .zone-widget .zone-widget-container.reference-zone-widget{border-top-width:1px;border-bottom-width:1px}.monaco-editor .reference-zone-widget .inline{display:inline-block;vertical-align:top}.monaco-editor .reference-zone-widget .messages{height:100%;width:100%;text-align:center;padding:3em 0}.monaco-editor .reference-zone-widget .ref-tree{line-height:23px}.monaco-editor .reference-zone-widget .ref-tree .reference{text-overflow:ellipsis;overflow:hidden}.monaco-editor .reference-zone-widget .ref-tree .reference-file{display:inline-flex;width:100%;height:100%}.monaco-editor .reference-zone-widget .ref-tree .reference-file .count{margin-right:12px;margin-left:auto}.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file{font-weight:700}.monaco-editor .goto-definition-link{text-decoration:underline;cursor:pointer}.monaco-editor .marker-widget{padding:6px 12px;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .marker-widget>.stale{opacity:.6;font-style:italic}.monaco-editor .marker-widget div.block{display:inline-block;vertical-align:top}.monaco-editor .marker-widget .title{display:inline-block;padding-right:5px}.monaco-editor .marker-widget .descriptioncontainer{position:relative;white-space:pre;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.monaco-editor .marker-widget .descriptioncontainer .filename{cursor:pointer;opacity:.6}.monaco-editor-hover{cursor:default;position:absolute;overflow:hidden;z-index:50;-webkit-user-select:text;-ms-user-select:text;-moz-user-select:text;-o-user-select:text;user-select:text;box-sizing:initial;animation:fadein .1s linear;line-height:1.5em}.monaco-editor-hover.hidden{display:none}.monaco-editor-hover .monaco-editor-hover-content{max-width:500px}.monaco-editor-hover .hover-row{padding:4px 5px}.monaco-editor-hover p,.monaco-editor-hover ul{margin:8px 0}.monaco-editor-hover p:first-child,.monaco-editor-hover ul:first-child{margin-top:0}.monaco-editor-hover p:last-child,.monaco-editor-hover ul:last-child{margin-bottom:0}.monaco-editor-hover ul{padding-left:20px}.monaco-editor-hover li>p{margin-bottom:0}.monaco-editor-hover li>ul{margin-top:0}.monaco-editor-hover code{border-radius:3px;padding:0 .4em}.monaco-editor-hover .monaco-tokenized-source{white-space:pre-wrap;word-break:break-all}.colorpicker-widget{height:190px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.monaco-editor .colorpicker-hover:focus{outline:none}.colorpicker-header{display:flex;height:24px;position:relative;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=");background-size:9px 9px;image-rendering:-moz-crisp-edges;image-rendering:pixelated}.colorpicker-header .picked-color{width:216px;line-height:24px;cursor:pointer;color:#fff;flex:1;text-align:center}.colorpicker-header .picked-color.light{color:#000}.colorpicker-header .original-color{width:74px;z-index:inherit;cursor:pointer}.colorpicker-body{display:flex;padding:8px;position:relative}.colorpicker-body .saturation-wrap{overflow:hidden;height:150px;position:relative;min-width:220px;flex:1}.colorpicker-body .saturation-box{height:150px;position:absolute}.colorpicker-body .saturation-selection{width:9px;height:9px;margin:-5px 0 0 -5px;border:1px solid #fff;border-radius:100%;box-shadow:0 0 2px rgba(0,0,0,.8);position:absolute}.colorpicker-body .strip{width:25px;height:150px}.colorpicker-body .hue-strip{position:relative;margin-left:8px;cursor:-webkit-grab;background:linear-gradient(180deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.colorpicker-body .opacity-strip{position:relative;margin-left:8px;cursor:-webkit-grab;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=");background-size:9px 9px;image-rendering:-moz-crisp-edges;image-rendering:pixelated}.colorpicker-body .strip.grabbing{cursor:-webkit-grabbing}.colorpicker-body .slider{position:absolute;top:0;left:-2px;width:calc(100% + 4px);height:4px;box-sizing:border-box;border:1px solid hsla(0,0%,100%,.71);box-shadow:0 0 1px rgba(0,0,0,.85)}.colorpicker-body .strip .overlay{height:150px;pointer-events:none}.monaco-editor .detected-link,.monaco-editor .detected-link-active{text-decoration:underline;text-underline-position:under}.monaco-editor .detected-link-active{cursor:pointer}.monaco-editor .parameter-hints-widget{z-index:10;display:flex;flex-direction:column;line-height:1.5em}.monaco-editor .parameter-hints-widget>.wrapper{max-width:440px;display:flex;flex-direction:column}.monaco-editor .parameter-hints-widget.multiple{min-height:3.3em;padding:0 0 0 1.9em}.monaco-editor .parameter-hints-widget.visible{transition:left .05s ease-in-out}.monaco-editor .parameter-hints-widget p,.monaco-editor .parameter-hints-widget ul{margin:8px 0}.monaco-editor .parameter-hints-widget .body,.monaco-editor .parameter-hints-widget .monaco-scrollable-element{display:flex;flex-direction:column}.monaco-editor .parameter-hints-widget .signature{padding:4px 5px}.monaco-editor .parameter-hints-widget .docs{padding:0 10px 0 5px;white-space:pre-wrap}.monaco-editor .parameter-hints-widget .docs .markdown-docs{white-space:normal}.monaco-editor .parameter-hints-widget .docs .code{white-space:pre-wrap}.monaco-editor .parameter-hints-widget .docs code{border-radius:3px;padding:0 .4em}.monaco-editor .parameter-hints-widget .buttons{position:absolute;display:none;bottom:0;left:0}.monaco-editor .parameter-hints-widget.multiple .buttons{display:block}.monaco-editor .parameter-hints-widget.multiple .button{position:absolute;left:2px;width:16px;height:16px;background-repeat:no-repeat;cursor:pointer}.monaco-editor .parameter-hints-widget .button.previous{bottom:24px;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0iIzQyNDI0MiIgZD0iTTEwLjggOS41bC45LS45TDguMSA1IDQuMiA4LjZsLjkuOSAzLTIuNyAyLjcgMi43eiIvPjwvc3ZnPg==")}.monaco-editor .parameter-hints-widget .button.next{bottom:0;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0iIzQyNDI0MiIgZD0iTTUuMSA1bC0uOS45IDMuNiAzLjYgMy45LTMuNi0xLS45LTMgMi43TDUuMSA1eiIvPjwvc3ZnPg==")}.monaco-editor .parameter-hints-widget .overloads{position:absolute;display:none;text-align:center;bottom:14px;left:0;width:22px;height:12px;line-height:12px;opacity:.5}.monaco-editor .parameter-hints-widget.multiple .overloads{display:block}.monaco-editor .parameter-hints-widget .signature .parameter.active{font-weight:700;text-decoration:underline}.monaco-editor .parameter-hints-widget .documentation-parameter>.parameter{font-weight:700;margin-right:.5em}.monaco-editor.hc-black .parameter-hints-widget .button.previous,.monaco-editor.vs-dark .parameter-hints-widget .button.previous{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0iI0U4RThFOCIgZD0iTTEwLjggOS41bC45LS45TDguMSA1IDQuMiA4LjZsLjkuOSAzLTIuNyAyLjcgMi43eiIvPjwvc3ZnPg==")}.monaco-editor.hc-black .parameter-hints-widget .button.next,.monaco-editor.vs-dark .parameter-hints-widget .button.next{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0iI0U4RThFOCIgZD0iTTUuMSA1bC0uOS45IDMuNiAzLjYgMy45LTMuNi0xLS45LTMgMi43TDUuMSA1eiIvPjwvc3ZnPg==")}.monaco-editor .rename-box{z-index:100;color:inherit}.monaco-editor .rename-box .rename-input{padding:4px}.monaco-editor .snippet-placeholder{min-width:2px}.monaco-editor .finish-snippet-placeholder,.monaco-editor .snippet-placeholder{outline-style:solid;outline-width:1px}.monaco-editor .suggest-widget{z-index:40;width:430px}.monaco-editor .suggest-widget>.details,.monaco-editor .suggest-widget>.message,.monaco-editor .suggest-widget>.tree{width:100%;border-style:solid;border-width:1px;box-sizing:border-box}.monaco-editor.hc-black .suggest-widget>.details,.monaco-editor.hc-black .suggest-widget>.message,.monaco-editor.hc-black .suggest-widget>.tree{border-width:2px}.monaco-editor .suggest-widget.docs-side{width:660px}.monaco-editor .suggest-widget.docs-side>.details,.monaco-editor .suggest-widget.docs-side>.tree{width:50%;float:left}.monaco-editor .suggest-widget.docs-side.list-right>.details,.monaco-editor .suggest-widget.docs-side.list-right>.tree{float:right}.monaco-editor .suggest-widget>.message{padding-left:22px}.monaco-editor .suggest-widget>.tree{height:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row{display:flex;-mox-box-sizing:border-box;box-sizing:border-box;padding-right:10px;background-repeat:no-repeat;background-position:2px 2px;white-space:nowrap}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents{flex:1;height:100%;overflow:hidden;padding-left:2px}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main{display:flex;overflow:hidden;text-overflow:ellipsis;white-space:pre}.monaco-editor .suggest-widget:not(.frozen) .monaco-highlighted-label .highlight{font-weight:700}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.header>.close,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.readMore{opacity:.6;background-position:50%;background-repeat:no-repeat;background-size:70%;cursor:pointer}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.header>.close{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMyAzIDE2IDE2Ij48cGF0aCBmaWxsPSIjNDI0MjQyIiBkPSJNMTIuNTk3IDExLjA0MmwyLjgwMyAyLjgwMy0xLjU1NiAxLjU1NS0yLjgwMi0yLjgwMkw4LjIzOSAxNS40bC0xLjU1Ni0xLjU1NSAyLjgwMi0yLjgwMy0yLjgwMi0yLjgwMyAxLjU1NS0xLjU1NiAyLjgwNCAyLjgwMyAyLjgwMy0yLjgwM0wxNS40IDguMjM5eiIvPjwvc3ZnPg==");float:right;margin-right:5px}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.readMore{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTggMUM0LjEzNSAxIDEgNC4xMzUgMSA4czMuMTM1IDcgNyA3IDctMy4xMzUgNy03LTMuMTM1LTctNy03em0xIDEySDdWNmgydjd6bTAtOEg3VjNoMnYyeiIgZmlsbD0iIzFCQTFFMiIvPjxwYXRoIGQ9Ik03IDZoMnY3SDdWNnptMC0xaDJWM0g3djJ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+")}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.header>.close:hover,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.readMore:hover{opacity:1}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.type-label{margin-left:.8em;flex:1;text-align:right;overflow:hidden;text-overflow:ellipsis;opacity:.7}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.type-label>.monaco-tokenized-source{display:inline}.monaco-editor .suggest-widget.docs-below .monaco-list .monaco-list-row.focused>.contents>.main>.readMore,.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused>.contents>.main>.readMore,.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused>.contents>.main>.type-label,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.readMore,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.type-label{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused>.contents>.main>.readMore,.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused>.contents>.main>.type-label{display:inline}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label:before{height:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon{display:block;height:16px;width:16px;margin-left:2px;background-repeat:no-repeat;background-size:80%;background-position:50%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.hide,.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .icon,.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .monaco-icon-label.suggest-icon:before{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.suggest-icon:before{content:" ";background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE2IDEwYzAgMi4yMDUtMS43OTQgNC00IDQtMS44NTggMC0zLjQxMS0xLjI3OS0zLjg1OC0zaC0uOTc4bDIuMzE4IDRIMHYtMS43MDNsMi0zLjQwOFYwaDExdjYuMTQyYzEuNzIxLjQ0NyAzIDIgMyAzLjg1OHoiIGZpbGw9IiNmNmY2ZjYiLz48cGF0aCBkPSJNMTIgMXY0Ljc1QTQuMjU1IDQuMjU1IDAgMDA3Ljc1IDEwaC0uNzMyTDQuMjc1IDUuMjY5IDMgNy40NDJWMWg5ek03Ljc0NyAxNEw0LjI2OSA4IC43NDggMTRoNi45OTl6TTE1IDEwYTMgMyAwIDExLTYgMCAzIDMgMCAwMTYgMHoiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=");background-repeat:no-repeat;background-position:50%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.constructor:before,.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.function:before,.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.method:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE1IDMuMzQ5djguNDAzTDguOTc1IDE2SDguMDdMMSAxMS41ODJWMy4zMjdMNy41OTUgMGgxLjExOEwxNSAzLjM0OXoiIGZpbGw9IiNmNmY2ZjYiLz48cGF0aCBkPSJNMTIuNzE1IDQuMzk4TDguNDg3IDcuMDIgMy41NjUgNC4yNzJsNC41NzgtMi4zMDkgNC41NzIgMi40MzV6TTMgNS4xMDJsNSAyLjc5MnY1LjcwNWwtNS0zLjEyNVY1LjEwMnptNiA4LjQzNFY3Ljg3OGw0LTIuNDh2NS4zMTdsLTQgMi44MjF6IiBmaWxsPSIjZjBlZmYxIi8+PHBhdGggZD0iTTguMTU2LjgzN0wyIDMuOTQydjcuMDg1TDguNTE3IDE1LjEgMTQgMTEuMjMzVjMuOTVMOC4xNTYuODM3em00LjU1OSAzLjU2MUw4LjQ4NyA3LjAyIDMuNTY1IDQuMjcybDQuNTc4LTIuMzA5IDQuNTcyIDIuNDM1ek0zIDUuMTAybDUgMi43OTJ2NS43MDVsLTUtMy4xMjVWNS4xMDJ6bTYgOC40MzRWNy44NzhsNC0yLjQ4djUuMzE3bC00IDIuODIxeiIgZmlsbD0iIzY1MmQ5MCIvPjwvc3ZnPg==")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.field:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTAgMTAuNzM2VjQuNUw5IDBsNyAzLjV2Ni4yMzZsLTkgNC41LTctMy41eiIgZmlsbD0iI2Y2ZjZmNiIvPjxwYXRoIGQ9Ik05IDFMMSA1djVsNiAzIDgtNFY0TDkgMXpNNyA2Ljg4MkwzLjIzNiA1IDkgMi4xMTggMTIuNzY0IDQgNyA2Ljg4MnoiIGZpbGw9IiMwMDUzOWMiLz48cGF0aCBkPSJNOSAyLjExOEwxMi43NjQgNCA3IDYuODgyIDMuMjM2IDUgOSAyLjExOHoiIGZpbGw9IiNmMGVmZjEiLz48L3N2Zz4=")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.event:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTcgN2g2bC04IDhINGwyLjk4NS02SDNsNC04aDZMNyA3eiIgZmlsbD0iI2MyN2QxYSIvPjwvc3ZnPg==")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.operator:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTEgMXYxNGgxNFYxSDF6bTYgMTJIM3YtMWg0djF6bTAtM0gzVjloNHYxem0wLTVINXYySDRWNUgyVjRoMlYyaDF2MmgydjF6bTMuMjgxIDhIOC43MTlsMy00aDEuNTYzbC0zLjAwMSA0ek0xNCA1SDlWNGg1djF6IiBmaWxsPSIjMDA1MzljIi8+PC9zdmc+")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.variable:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTIgNXY2aDJ2MUgxVjRoM3YxSDJ6bTEwIDZ2MWgzVjRoLTN2MWgydjZoLTJ6IiBmaWxsPSIjNDI0MjQyIi8+PHBhdGggZD0iTTguNzMzIDRMNCA2LjM2N3YzLjE1Nkw3LjE1NiAxMS4xbDQuNzMzLTIuMzY3VjUuNTc4TDguNzMzIDR6TTcuMTU2IDcuMTU2bC0xLjU3OC0uNzg5IDMuMTU2LTEuNTc4IDEuNTc4Ljc4OS0zLjE1NiAxLjU3OHoiIGZpbGw9IiMwMDUzOWMiLz48L3N2Zz4=")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.class:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE2IDYuNTg2bC0zLTNMMTEuNTg2IDVIOS40MTRsMS0xLTQtNGgtLjgyOEwwIDUuNTg2di44MjhsNCA0TDYuNDE0IDhIN3Y1aDEuNTg2bDMgM2guODI4TDE2IDEyLjQxNHYtLjgyOEwxMy45MTQgOS41IDE2IDcuNDE0di0uODI4eiIgZmlsbD0iI2Y2ZjZmNiIvPjxwYXRoIGQ9Ik0xMyAxMGwyIDItMyAzLTItMiAxLTFIOFY3SDZMNCA5IDEgNmw1LTUgMyAzLTIgMmg1bDEtMSAyIDItMyAzLTItMiAxLTFIOXY0bDIuOTk5LjAwMkwxMyAxMHoiIGZpbGw9IiNjMjdkMWEiLz48L3N2Zz4=")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.interface:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTExLjUgMTJjLTEuOTE1IDAtMy42MDItMS4yNDEtNC4yMjgtM2gtMS40MWEzLjExIDMuMTEgMCAwMS0yLjczNyAxLjYyNUMxLjQwMiAxMC42MjUgMCA5LjIyMyAwIDcuNXMxLjQwMi0zLjEyNSAzLjEyNS0zLjEyNWMxLjE2NSAwIDIuMjAxLjYzOSAyLjczNyAxLjYyNWgxLjQxYy42MjYtMS43NTkgMi4zMTMtMyA0LjIyOC0zQzEzLjk4MSAzIDE2IDUuMDE5IDE2IDcuNVMxMy45ODEgMTIgMTEuNSAxMnoiIGZpbGw9IiNmNmY2ZjYiLz48cGF0aCBkPSJNMTEuNSA5QTEuNTAxIDEuNTAxIDAgMTExMyA3LjVjMCAuODI2LS42NzMgMS41LTEuNSAxLjV6IiBmaWxsPSIjZjBlZmYxIi8+PHBhdGggZD0iTTExLjUgNGEzLjQ5IDMuNDkgMCAwMC0zLjQ1IDNINS4xODVBMi4xMjIgMi4xMjIgMCAwMDEgNy41YTIuMTIzIDIuMTIzIDAgMTA0LjE4NS41SDguMDVhMy40OSAzLjQ5IDAgMDAzLjQ1IDMgMy41IDMuNSAwIDEwMC03em0wIDVjLS44MjcgMC0xLjUtLjY3My0xLjUtMS41UzEwLjY3MyA2IDExLjUgNnMxLjUuNjczIDEuNSAxLjVTMTIuMzI3IDkgMTEuNSA5eiIgZmlsbD0iIzAwNTM5YyIvPjwvc3ZnPg==")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.struct:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTEwIDloNHY0aC00Vjl6bS04IDRoNFY5SDJ2NHpNMiAzdjRoMTJWM0gyeiIgZmlsbD0iIzAwNTM5YyIvPjwvc3ZnPg==")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.type-parameter:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTQgM2g4djJoLTF2LS41YS41LjUgMCAwMC0uNS0uNUg5djcuNWEuNS41IDAgMDAuNS41aC41djFINnYtMWguNWEuNS41IDAgMDAuNS0uNVY0SDUuNWEuNS41IDAgMDAtLjUuNVY1SDRWM3pNMyA1LjYxNUwuMTE2IDguNSAzIDExLjM4M2wuODg0LS44ODMtMi0yIDItMkwzIDUuNjE1em0xMCAwbC0uODg0Ljg4NSAyIDItMiAyIC44ODQuODgzTDE1Ljg4NCA4LjUgMTMgNS42MTV6IiBmaWxsPSIjNDI0MjQyIi8+PC9zdmc+")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.module:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTkuMjYgMTEuOTg0bC45NzgtLjAyMWEuOTYyLjk2MiAwIDAwLjA5LS4wMDZjLjAxMS0uMDYzLjAyNi0uMTc5LjAyNi0uMzYxVjkuNjg4YzAtLjY3OS4xODUtMS4yNTcuNTMtMS43MDctLjM0Ni0uNDUyLS41My0xLjAzLS41My0xLjcwNVY0LjM1YzAtLjE2Ny0uMDIxLS4yNTktLjAzNC0uMzAyTDkuMjYgNC4wMlYuOTczbDEuMDExLjAxMWMyLjE2Ny4wMjQgMy40MDkgMS4xNTYgMy40MDkgMy4xMDV2MS45NjJjMCAuMzUxLjA3MS40NjEuMDcyLjQ2MmwuOTM2LjA2LjA1My45Mjd2MS45MzZsLS45MzYuMDYxYy0uMDc2LjAxNi0uMTI1LjE0Ni0uMTI1LjQyNHYyLjAxN2MwIC45MTQtLjMzMiAzLjA0My0zLjQwOCAzLjA3OGwtMS4wMTIuMDExdi0zLjA0M3ptLTMuNTIxIDMuMDMyYy0zLjA4OS0uMDM1LTMuNDIyLTIuMTY0LTMuNDIyLTMuMDc4VjkuOTIxYzAtLjMyNy0uMDY2LS40MzItLjA2Ny0uNDMzbC0uOTM3LS4wNi0uMDYzLS45MjlWNi41NjNsLjk0Mi0uMDZjLjA1OCAwIC4xMjUtLjExNC4xMjUtLjQ1MlY0LjA5YzAtMS45NDkgMS4yNDgtMy4wODEgMy40MjItMy4xMDVMNi43NS45NzNWNC4wMmwtLjk3NS4wMjNhLjU3Mi41NzIgMCAwMC0uMDkzLjAxYy4wMDYuMDIxLS4wMTkuMTE1LS4wMTkuMjk3djEuOTI4YzAgLjY3NS0uMTg2IDEuMjUzLS41MzQgMS43MDUuMzQ4LjQ1LjUzNCAxLjAyOC41MzQgMS43MDd2MS45MDdjMCAuMTc1LjAxNC4yOTEuMDI3LjM2My4wMjMuMDAyIDEuMDYuMDI1IDEuMDYuMDI1djMuMDQzbC0xLjAxMS0uMDEyeiIgZmlsbD0iI2Y2ZjZmNiIvPjxwYXRoIGQ9Ik01Ljc1IDE0LjAxNmMtMS42MjMtLjAxOS0yLjQzNC0uNzExLTIuNDM0LTIuMDc4VjkuOTIxYzAtLjkwMi0uMzU1LTEuMzc2LTEuMDY2LTEuNDIydi0uOTk4Yy43MTEtLjA0NSAxLjA2Ni0uNTI5IDEuMDY2LTEuNDQ5VjQuMDljMC0xLjM4NS44MTEtMi4wODcgMi40MzQtMi4xMDV2MS4wNmMtLjcyNS4wMTctMS4wODcuNDUzLTEuMDg3IDEuMzA1djEuOTI4YzAgLjkyLS40NTQgMS40ODgtMS4zNiAxLjcwMlY4Yy45MDcuMjAxIDEuMzYuNzYzIDEuMzYgMS42ODh2MS45MDdjMCAuNDg4LjA4MS44MzUuMjQzIDEuMDQyLjE2Mi4yMDguNDQzLjMxNi44NDQuMzI1djEuMDU0em03Ljk5LTUuNTE3Yy0uNzA2LjA0NS0xLjA2LjUyLTEuMDYgMS40MjJ2Mi4wMTdjMCAxLjM2Ny0uODA3IDIuMDYtMi40MiAyLjA3OHYtMS4wNTNjLjM5Ni0uMDA5LjY3OC0uMTE4Ljg0NC0uMzI4LjE2Ny0uMjEuMjUtLjU1Ni4yNS0xLjAzOVY5LjY4OGMwLS45MjUuNDQ5LTEuNDg4IDEuMzQ3LTEuNjg4di0uMDIxYy0uODk4LS4yMTQtMS4zNDctLjc4Mi0xLjM0Ny0xLjcwMlY0LjM1YzAtLjg1Mi0uMzY0LTEuMjg4LTEuMDk0LTEuMzA2di0xLjA2YzEuNjEzLjAxOCAyLjQyLjcyIDIuNDIgMi4xMDV2MS45NjJjMCAuOTIuMzU0IDEuNDA0IDEuMDYgMS40NDl2Ljk5OXoiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.property:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE2IDUuNWE1LjUgNS41IDAgMDEtNS41IDUuNWMtLjI3NSAwLS41NDMtLjAyNy0uODA3LS4wNjZsLS4wNzktLjAxMmE1LjQyOSA1LjQyOSAwIDAxLS44MS0uMTkybC00LjUzNyA0LjUzN2MtLjQ3Mi40NzMtMS4xLjczMy0xLjc2Ny43MzNzLTEuMjk1LS4yNi0xLjc2OC0uNzMyYTIuNTAyIDIuNTAyIDAgMDEwLTMuNTM1bDQuNTM3LTQuNTM3YTUuNDUyIDUuNDUyIDAgMDEtLjE5MS0uODEyYy0uMDA1LS4wMjUtLjAwOC0uMDUxLS4wMTItLjA3N0E1LjUwMyA1LjUwMyAwIDAxNSA1LjVhNS41IDUuNSAwIDExMTEgMHoiIGZpbGw9IiNmNmY2ZjYiLz48cGF0aCBkPSJNMTUgNS41YTQuNSA0LjUgMCAwMS00LjUgNC41Yy0uNjkzIDAtMS4zNDItLjE3LTEuOTI5LS40NWwtNS4wMSA1LjAxYy0uMjkzLjI5NC0uNjc3LjQ0LTEuMDYxLjQ0cy0uNzY4LS4xNDYtMS4wNjEtLjQzOWExLjUgMS41IDAgMDEwLTIuMTIxbDUuMDEtNS4wMUE0LjQ4MyA0LjQ4MyAwIDAxNiA1LjUgNC41IDQuNSAwIDAxMTAuNSAxYy42OTMgMCAxLjM0Mi4xNyAxLjkyOS40NUw5LjYzNiA0LjI0M2wyLjEyMSAyLjEyMSAyLjc5My0yLjc5M2MuMjguNTg3LjQ1IDEuMjM2LjQ1IDEuOTI5eiIgZmlsbD0iIzQyNDI0MiIvPjwvc3ZnPg==")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.unit:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE2IDExLjAxM0gxVjRoMTV2Ny4wMTN6IiBmaWxsPSIjZjZmNmY2Ii8+PHBhdGggZD0iTTggOUg3VjZoM3YzSDlWN0g4djJ6TTQgN2gxdjJoMVY2SDN2M2gxVjd6bTggMGgxdjJoMVY2aC0zdjNoMVY3eiIgZmlsbD0iI2YwZWZmMSIvPjxwYXRoIGQ9Ik0yIDV2NWgxM1Y1SDJ6bTQgNEg1VjdINHYySDNWNmgzdjN6bTQgMEg5VjdIOHYySDdWNmgzdjN6bTQgMGgtMVY3aC0xdjJoLTFWNmgzdjN6IiBmaWxsPSIjNDI0MjQyIi8+PC9zdmc+")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.constant:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTIuODc5IDE0TDEgMTIuMTIxVjMuODc5TDIuODc5IDJoMTAuMjQyTDE1IDMuODc5djguMjQyTDEzLjEyMSAxNEgyLjg3OXoiIGZpbGw9IiNmNmY2ZjYiLz48cGF0aCBkPSJNMTIuMjkzIDRIMy43MDdMMyA0LjcwN3Y2LjU4NmwuNzA3LjcwN2g4LjU4NmwuNzA3LS43MDdWNC43MDdMMTIuMjkzIDR6TTExIDEwSDVWOWg2djF6bTAtM0g1VjZoNnYxeiIgZmlsbD0iI2YwZWZmMSIvPjxwYXRoIGQ9Ik0xMi43MDcgMTNIMy4yOTNMMiAxMS43MDdWNC4yOTNMMy4yOTMgM2g5LjQxNEwxNCA0LjI5M3Y3LjQxNEwxMi43MDcgMTN6bS05LTFoOC41ODZsLjcwNy0uNzA3VjQuNzA3TDEyLjI5MyA0SDMuNzA3TDMgNC43MDd2Ni41ODZsLjcwNy43MDd6IiBmaWxsPSIjNDI0MjQyIi8+PHBhdGggZD0iTTExIDdINVY2aDZ2MXptMCAySDV2MWg2Vjl6IiBmaWxsPSIjMDA1MzljIi8+PC9zdmc+")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.enum:before,.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.value:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE0LjQxNCAxTDE2IDIuNTg2djUuODI4TDE0LjQxNCAxMEgxMHYzLjQxNkw4LjQxNCAxNUgxLjU4NkwwIDEzLjQxNnYtNS44M0wxLjU4NiA2SDZWMi41ODZMNy41ODYgMWg2LjgyOHoiIGZpbGw9IiNmNmY2ZjYiLz48cGF0aCBkPSJNMiAxM2g2VjhIMnY1em0xLTRoNHYxSDNWOXptMCAyaDR2MUgzdi0xem0xMS01VjNIOHYzaC40MTRMOSA2LjU4NlY2aDR2MUg5LjQxNGwuNTg2LjU4NlY4aDRWNnptLTEtMUg5VjRoNHYxeiIgZmlsbD0iI2YwZWZmMSIvPjxwYXRoIGQ9Ik0zIDExaDQuMDAxdjFIM3YtMXptMC0xaDQuMDAxVjlIM3Yxem02LTJ2NWwtMSAxSDJsLTEtMVY4bDEtMWg2bDEgMXpNOCA4SDJ2NWg2Vjh6bTEtMmwxIDFoM1Y2SDl6bTAtMWg0VjRIOXYxem01LTNIOEw3IDN2M2gxVjNoNnY1aC00djFoNGwxLTFWM2wtMS0xeiIgZmlsbD0iI2MyN2QxYSIvPjwvc3ZnPg==")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.enum-member:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTAgMTVWNmg2VjIuNTg2TDcuNTg1IDFoNi44MjlMMTYgMi41ODZ2NS44MjlMMTQuNDE0IDEwSDEwdjVIMHptMy02eiIgZmlsbD0iI2Y2ZjZmNiIvPjxwYXRoIGQ9Ik04IDN2M2g1djFoLTN2MWg0VjNIOHptNSAySDlWNGg0djF6TTIgOHY1aDZWOEgyem01IDNIM3YtMWg0djF6IiBmaWxsPSIjZjBlZmYxIi8+PHBhdGggZD0iTTEwIDZoM3YxaC0zVjZ6TTkgNHYxaDRWNEg5em01LTJIOEw3IDN2M2gxVjNoNnY1aC00djFoNGwxLTFWM2wtMS0xem0tNyA4SDN2MWg0di0xem0yLTN2N0gxVjdoOHpNOCA4SDJ2NWg2Vjh6IiBmaWxsPSIjMDA1MzljIi8+PC9zdmc+")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.keyword:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE2IDVWMkg5VjFIMHYxNGgxM3YtM2gzVjloLTFWNkg5VjVoN3ptLTggN1Y5aDF2M0g4eiIgZmlsbD0iI2Y2ZjZmNiIvPjxwYXRoIGQ9Ik0yIDNoNXYxSDJWM3oiIGZpbGw9IiNmMGVmZjEiLz48cGF0aCBkPSJNMTUgNGgtNVYzaDV2MXptLTEgM2gtMnYxaDJWN3ptLTQgMEgxdjFoOVY3em0yIDZIMXYxaDExdi0xem0tNS0zSDF2MWg2di0xem04IDBoLTV2MWg1di0xek04IDJ2M0gxVjJoN3pNNyAzSDJ2MWg1VjN6IiBmaWxsPSIjNDI0MjQyIi8+PC9zdmc+")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.text:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE2IDE1SDBWMWgxNnYxNHoiIGZpbGw9IiNmNmY2ZjYiLz48cGF0aCBkPSJNOS4yMjkgNy4zNTRjLjAzNS4xNDYuMDUyLjMxLjA1Mi40OTQgMCAuMjM0LS4wMi40NDEtLjA2LjYyMS0uMDM5LjE4LS4wOTUuMzI4LS4xNjguNDQ1YS42ODcuNjg3IDAgMDEtLjkxNC4yODEuNzYuNzYgMCAwMS0uMjM3LS4yMDcuOTg4Ljk4OCAwIDAxLS4xNTQtLjMwNiAxLjI2MiAxLjI2MiAwIDAxLS4wNTctLjM4MXYtLjUwNmMwLS4xNy4wMi0uMzI2LjA2MS0uNDY1cy4wOTYtLjI1OC4xNjgtLjM1OWEuNzU2Ljc1NiAwIDAxLjI1Ny0uMjMyYy4xLS4wNTUuMjEtLjA4Mi4zMzEtLjA4MmEuNjQ2LjY0NiAwIDAxLjU3MS4zMmMuMDY3LjEwNS4xMTYuMjMuMTUuMzc3em0tNS4xMjYuODY5YS41NTcuNTU3IDAgMDAtLjE5Ni4xMzJjLS4wNDcuMDUzLS4wOC4xMTItLjA5Ny4xOHMtLjAyOC4xNDctLjAyOC4yMzNhLjUxMy41MTMgMCAwMC4xNTcuMzkuNTI4LjUyOCAwIDAwLjE4Ni4xMTMuNjgyLjY4MiAwIDAwLjI0Mi4wNDEuNzYuNzYgMCAwMC41OTMtLjI3MS44OTcuODk3IDAgMDAuMTY1LS4yOTVjLjAzOC0uMTEzLjA1OS0uMjM0LjA1OS0uMzY1di0uMzQ2bC0uNzYxLjExYTEuMjkgMS4yOSAwIDAwLS4zMi4wNzh6TTE0IDN2MTBIMlYzaDEyek01Ljk2MiA3LjQ2OWMwLS4yMzgtLjAyNy0uNDUxLS4wODMtLjYzN2ExLjI4NiAxLjI4NiAwIDAwLS4yNDktLjQ3MSAxLjA4IDEuMDggMCAwMC0uNDI0LS4yOTUgMS42NDQgMS42NDQgMCAwMC0uNjA4LS4xMDFjLS4xMTkgMC0uMjQxLjAxMi0uMzY4LjAzM2EzLjIxMyAzLjIxMyAwIDAwLS42NzMuMTk1IDEuMzEzIDEuMzEzIDAgMDAtLjIxMi4xMTR2Ljc2OGMuMTU4LS4xMzIuMzQxLS4yMzUuNTQ0LS4zMTMuMjA0LS4wNzguNDEzLS4xMTcuNjI3LS4xMTcuMjEzIDAgLjM3Ny4wNjMuNDk0LjE4Ni4xMTYuMTI1LjE3NC4zMjQuMTc0LjZsLTEuMDMuMTU0Yy0uMjA1LjAyNi0uMzguMDc3LS41MjYuMTUxYTEuMDgzIDEuMDgzIDAgMDAtLjU2My42NkExLjU2MiAxLjU2MiAwIDAwMyA4Ljg1N2MwIC4xNy4wMjUuMzIzLjA3NC40NjNhLjk0NS45NDUgMCAwMC41NjguNTk2Yy4xMzkuMDU3LjI5Ny4wODQuNDc4LjA4NC4yMjkgMCAuNDMxLS4wNTMuNjA0LS4xNmExLjMgMS4zIDAgMDAuNDM5LS40NjNoLjAxNHYuNTI5aC43ODVWNy40Njl6TTEwIDcuODYxYTMuNTQgMy41NCAwIDAwLS4wNzQtLjczNCAyLjA0NyAyLjA0NyAwIDAwLS4yMjgtLjYxMSAxLjIwMyAxLjIwMyAwIDAwLS4zOTQtLjQxNiAxLjAzIDEuMDMgMCAwMC0uNTc0LS4xNTNjLS4xMjMgMC0uMjM0LjAxOC0uMzM2LjA1MWExIDEgMCAwMC0uMjc4LjE0NyAxLjE1MyAxLjE1MyAwIDAwLS4yMjUuMjIyIDIuMDIyIDIuMDIyIDAgMDAtLjE4MS4yODloLS4wMTNWNUg3djQuODg3aC42OTd2LS40ODVoLjAxM2MuMDQ0LjA4Mi4wOTUuMTU4LjE1MS4yMjkuMDU3LjA3LjExOS4xMzMuMTkxLjE4NmEuODM1LjgzNSAwIDAwLjIzOC4xMjEuOTQzLjk0MyAwIDAwLjI5My4wNDJjLjIzIDAgLjQzNC0uMDUzLjYwOS0uMTZhMS4zNCAxLjM0IDAgMDAuNDQzLS40NDNjLjEyLS4xODguMjExLS40MTIuMjcyLS42NzJBMy42MiAzLjYyIDAgMDAxMCA3Ljg2MXptMy0xLjY1OGEuNy43IDAgMDAtLjEwNi0uMDY2IDEuMTgzIDEuMTgzIDAgMDAtLjE0Mi0uMDYzIDEuMjMzIDEuMjMzIDAgMDAtLjM2My0uMDY1Yy0uMjA5IDAtLjM5OS4wNTEtLjU2OS4xNWExLjM1NSAxLjM1NSAwIDAwLS40MzMuNDI0Yy0uMTE4LjE4Mi0uMjEuNDAyLS4yNzMuNjZhMy42MyAzLjYzIDAgMDAtLjAwOCAxLjYxNWMuMDYuMjMuMTQzLjQzLjI1Mi42MDIuMTA5LjE2OC4yNDEuMzAzLjM5Ni4zOTZhLjk3Mi45NzIgMCAwMC41MjQuMTQ0Yy4xNTggMCAuMjk2LS4wMjEuNDEzLS4wNjguMTE3LS4wNDUuMjE5LS4xMDguMzA5LS4xODR2LS43N2ExLjA5NCAxLjA5NCAwIDAxLS4yODguMjI1LjgxOS44MTkgMCAwMS0uMTU4LjA2OC40OC40OCAwIDAxLS4xNTMuMDI3LjYyLjYyIDAgMDEtLjI3NC0uMDc0Yy0uMjQxLS4xMzYtLjQyMy0uNDc5LS40MjMtMS4xNDYgMC0uNzE1LjIwNi0xLjEyLjQ2OS0xLjMwMS4wNzctLjAzMi4xNTMtLjA2NC4yMzgtLjA2NC4xMTMgMCAuMjIuMDI3LjMxNy4wODIuMDk2LjA1Ny4xODguMTMxLjI3Mi4yMjN2LS44MTV6IiBmaWxsPSIjZjBlZmYxIi8+PHBhdGggZD0iTTEgMnYxMmgxNFYySDF6bTEzIDExSDJWM2gxMnYxMHpNNS42MyA2LjM2MWExLjA4IDEuMDggMCAwMC0uNDI0LS4yOTUgMS42NDQgMS42NDQgMCAwMC0uNjA4LS4xMDFjLS4xMTkgMC0uMjQxLjAxMi0uMzY4LjAzM2EzLjIxMyAzLjIxMyAwIDAwLS42NzMuMTk1IDEuMzEzIDEuMzEzIDAgMDAtLjIxMi4xMTR2Ljc2OGMuMTU4LS4xMzIuMzQxLS4yMzUuNTQ0LS4zMTMuMjA0LS4wNzguNDEzLS4xMTcuNjI3LS4xMTcuMjEzIDAgLjM3Ny4wNjMuNDk0LjE4Ni4xMTYuMTI1LjE3NC4zMjQuMTc0LjZsLTEuMDMuMTU0Yy0uMjA1LjAyNi0uMzguMDc3LS41MjYuMTUxYTEuMDgzIDEuMDgzIDAgMDAtLjU2My42NkExLjU2MiAxLjU2MiAwIDAwMyA4Ljg1N2MwIC4xNy4wMjUuMzIzLjA3NC40NjNhLjk0NS45NDUgMCAwMC41NjguNTk2Yy4xMzkuMDU3LjI5Ny4wODQuNDc4LjA4NC4yMjkgMCAuNDMxLS4wNTMuNjA0LS4xNmExLjMgMS4zIDAgMDAuNDM5LS40NjNoLjAxNHYuNTI5aC43ODVWNy40NjljMC0uMjM4LS4wMjctLjQ1MS0uMDgzLS42MzdhMS4yODYgMS4yODYgMCAwMC0uMjQ5LS40NzF6bS0uNDQ2IDIuMDJjMCAuMTMxLS4wMi4yNTItLjA1OS4zNjVhLjg5Ny44OTcgMCAwMS0uMTY1LjI5NS43NTguNzU4IDAgMDEtLjU5My4yNzIuNjgyLjY4MiAwIDAxLS4yNDItLjA0MS41MDcuNTA3IDAgMDEtLjMwMi0uMjg2LjU4My41ODMgMCAwMS0uMDQxLS4yMThjMC0uMDg2LjAxLS4xNjQuMDI3LS4yMzJzLjA1MS0uMTI3LjA5OC0uMThhLjU0Ni41NDYgMCAwMS4xOTYtLjEzM2MuMDgzLS4wMzMuMTg5LS4wNjEuMzItLjA3OGwuNzYxLS4xMDl2LjM0NXptNC41MTQtMS44NjVhMS4yMDMgMS4yMDMgMCAwMC0uMzk0LS40MTYgMS4wMyAxLjAzIDAgMDAtLjU3NC0uMTUzYy0uMTIzIDAtLjIzNC4wMTgtLjMzNi4wNTFhMSAxIDAgMDAtLjI3OC4xNDcgMS4xNTMgMS4xNTMgMCAwMC0uMjI1LjIyMiAyLjAyMiAyLjAyMiAwIDAwLS4xODEuMjg5aC0uMDEzVjVIN3Y0Ljg4N2guNjk3di0uNDg1aC4wMTNjLjA0NC4wODIuMDk1LjE1OC4xNTEuMjI5LjA1Ny4wNy4xMTkuMTMzLjE5MS4xODZhLjgzNS44MzUgMCAwMC4yMzguMTIxLjk0My45NDMgMCAwMC4yOTMuMDQyYy4yMyAwIC40MzQtLjA1My42MDktLjE2YTEuMzQgMS4zNCAwIDAwLjQ0My0uNDQzYy4xMi0uMTg4LjIxMS0uNDEyLjI3Mi0uNjcyQTMuNjIgMy42MiAwIDAwMTAgNy44NjFhMy41NCAzLjU0IDAgMDAtLjA3NC0uNzM0IDIuMDQ3IDIuMDQ3IDAgMDAtLjIyOC0uNjExem0tLjQ3NiAxLjk1M2MtLjAzOS4xOC0uMDk1LjMyOC0uMTY4LjQ0NWEuNzU1Ljc1NSAwIDAxLS4yNjQuMjY2LjY4Ny42ODcgMCAwMS0uNjUxLjAxNS43Ni43NiAwIDAxLS4yMzctLjIwNy45ODguOTg4IDAgMDEtLjE1NC0uMzA2IDEuMjYyIDEuMjYyIDAgMDEtLjA1Ny0uMzgxdi0uNTA2YzAtLjE3LjAyLS4zMjYuMDYxLS40NjVzLjA5Ni0uMjU4LjE2OC0uMzU5YS43NTYuNzU2IDAgMDEuMjU3LS4yMzJjLjEtLjA1NS4yMS0uMDgyLjMzMS0uMDgyYS42NDYuNjQ2IDAgMDEuNTcxLjMyYy4wNjYuMTA1LjExNi4yMy4xNS4zNzcuMDM1LjE0Ni4wNTIuMzEuMDUyLjQ5NCAwIC4yMzQtLjAxOS40NDEtLjA1OS42MjF6bTMuNjcyLTIuMzMyYS43LjcgMCAwMS4xMDYuMDY2di44MTRhMS4xNzggMS4xNzggMCAwMC0uMjczLS4yMjMuNjQ1LjY0NSAwIDAwLS4zMTctLjA4MWMtLjA4NSAwLS4xNjEuMDMyLS4yMzguMDY0LS4yNjMuMTgxLS40NjkuNTg2LS40NjkgMS4zMDEgMCAuNjY4LjE4MiAxLjAxMS40MjMgMS4xNDYuMDg0LjA0LjE3MS4wNzQuMjc0LjA3NC4wNDkgMCAuMTAxLS4wMS4xNTMtLjAyN2EuODU2Ljg1NiAwIDAwLjE1OC0uMDY4IDEuMTYgMS4xNiAwIDAwLjI4OC0uMjI1di43N2MtLjA5LjA3Ni0uMTkyLjEzOS0uMzA5LjE4NGExLjA5OCAxLjA5OCAwIDAxLS40MTIuMDY4Ljk3NC45NzQgMCAwMS0uNTIzLS4xNDMgMS4yNTcgMS4yNTcgMCAwMS0uMzk2LS4zOTYgMi4wOTggMi4wOTggMCAwMS0uMjUyLS42MDIgMy4xMTggMy4xMTggMCAwMS0uMDg4LS43NTRjMC0uMzE2LjAzMi0uNjA0LjA5Ni0uODYxLjA2My0uMjU4LjE1NS0uNDc5LjI3My0uNjYuMTE5LS4xODIuMjY1LS4zMjIuNDMzLS40MjRhMS4xMDIgMS4xMDIgMCAwMTEuMDczLS4wMjN6IiBmaWxsPSIjNDI0MjQyIi8+PC9zdmc+")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.color:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE2IDhjMCA0LjQxMS0zLjU4OSA4LTggOGEyLjgwMyAyLjgwMyAwIDAxLTIuOC0yLjhjMC0uODMzLjI3Mi0xLjYyOS43NjYtMi4yNDFhLjU5Ni41OTYgMCAwMC4xMDEtLjM1OS42NjcuNjY3IDAgMDAtLjY2Ny0uNjY2LjU4LjU4IDAgMDAtLjM1OC4xMDJBMy41ODQgMy41ODQgMCAwMTIuOCAxMC44IDIuODAzIDIuODAzIDAgMDEwIDhjMC00LjQxMSAzLjU4OS04IDgtOHM4IDMuNTg5IDggOHoiIGZpbGw9IiNmNmY2ZjYiLz48cGF0aCBkPSJNNS40IDcuOTMzYTIuNjcgMi42NyAwIDAxMi42NjcgMi42NjZjMCAuNjA2LS4xOTMgMS4xNzktLjU0NCAxLjYxNGExLjU5OSAxLjU5OSAwIDAwLS4zMjMuOTg3LjguOCAwIDAwLjguOGMzLjMwOSAwIDYtMi42OTEgNi02cy0yLjY5MS02LTYtNi02IDIuNjkxLTYgNmMwIC40NDEuMzU5LjguOC44LjM3OCAwIC43MjktLjExNC45ODYtLjMyMkEyLjU2OCAyLjU2OCAwIDAxNS40IDcuOTMzeiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik04IDE1Yy0uOTkyIDAtMS44LS44MDgtMS44LTEuOCAwLS42MDYuMTkzLTEuMTc5LjU0NC0xLjYxMy4yMDgtLjI1OS4zMjMtLjYwOS4zMjMtLjk4NyAwLS45MTktLjc0OC0xLjY2Ni0xLjY2Ny0xLjY2Ni0uMzc3IDAtLjcyOC4xMTUtLjk4Ni4zMjNBMi41OCAyLjU4IDAgMDEyLjggOS44QzEuODA4IDkuOCAxIDguOTkyIDEgOGMwLTMuODYgMy4xNC03IDctNyAzLjg1OSAwIDcgMy4xNCA3IDcgMCAzLjg1OS0zLjE0MSA3LTcgN3pNNS40IDcuOTMzYTIuNjcgMi42NyAwIDAxMi42NjcgMi42NjZjMCAuNjA2LS4xOTMgMS4xNzktLjU0NCAxLjYxNGExLjU5OSAxLjU5OSAwIDAwLS4zMjMuOTg3LjguOCAwIDAwLjguOGMzLjMwOSAwIDYtMi42OTEgNi02cy0yLjY5MS02LTYtNi02IDIuNjkxLTYgNmMwIC40NDEuMzU5LjguOC44LjM3OCAwIC43MjktLjExNC45ODYtLjMyMkEyLjU2OCAyLjU2OCAwIDAxNS40IDcuOTMzeiIgZmlsbD0iIzQyNDI0MiIvPjxwYXRoIGQ9Ik00LjUgNS4zNzVhLjg3NS44NzUgMCAxMDAgMS43NS44NzUuODc1IDAgMDAwLTEuNzV6IiBmaWxsPSIjNjUyZDkwIi8+PHBhdGggZD0iTTcuMTI1IDMuNjI1YS44NzUuODc1IDAgMTAwIDEuNzUuODc1Ljg3NSAwIDAwMC0xLjc1eiIgZmlsbD0iIzFiYTFlMiIvPjxwYXRoIGQ9Ik0xMC42MjUgNC41YS44NzUuODc1IDAgMTAwIDEuNzUuODc1Ljg3NSAwIDAwMC0xLjc1eiIgZmlsbD0iIzM5MyIvPjxwYXRoIGQ9Ik0xMS41IDhhLjg3NS44NzUgMCAxMDAgMS43NS44NzUuODc1IDAgMDAwLTEuNzV6IiBmaWxsPSIjZmMwIi8+PHBhdGggZD0iTTkuNzUgMTAuNjI1YS44NzUuODc1IDAgMTAwIDEuNzUuODc1Ljg3NSAwIDAwMC0xLjc1eiIgZmlsbD0iI2U1MTQwMCIvPjwvc3ZnPg==")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.file:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE1IDE2SDJWMGg4LjYyMUwxNSA0LjM3OVYxNnoiIGZpbGw9IiNmNmY2ZjYiLz48cGF0aCBkPSJNMTMgMTRINFYyaDV2NGg0djh6bS0zLTlWMi4yMDdMMTIuNzkzIDVIMTB6IiBmaWxsPSIjZjBlZmYxIi8+PHBhdGggZD0iTTMgMXYxNGgxMVY0Ljc5M0wxMC4yMDcgMUgzem0xMCAxM0g0VjJoNXY0aDR2OHptLTMtOVYyLjIwN0wxMi43OTMgNUgxMHoiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.reference:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTEzIDV2OHMtLjAzNSAxLTEuMDM1IDFoLThTMyAxNCAzIDEzVjloMXY0aDhWNkg5LjM5N2wuNTE3LS41Mkw5IDQuNTcyVjNINy40MTlMNi40MTMgMmgzLjIyOEwxMyA1eiIgZmlsbD0iIzQyNDI0MiIvPjxwYXRoIGQ9Ik01Ljk4OCA2SDMuNWEyLjUgMi41IDAgMTEwLTVINHYxaC0uNUMyLjY3MyAyIDIgMi42NzMgMiAzLjVTMi42NzMgNSAzLjUgNWgyLjUxM0w0IDNoMmwyLjUgMi40ODRMNiA4SDRsMS45ODgtMnoiIGZpbGw9IiMwMDUzOWMiLz48L3N2Zz4=")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.snippet:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgaWQ9InN2ZzQ2OTQiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHN0eWxlIGlkPSJzdHlsZTQ2OTYiPjwvc3R5bGU+PGcgaWQ9Imc0NzA3IiB0cmFuc2Zvcm09Im1hdHJpeCgxLjMzMzMzIDAgMCAxLjMzMzMzIC0yNDYgLTUuMzMzKSI+PHBhdGggZD0iTTE4NSA0aDExdjEyaC0xMXoiIGlkPSJwYXRoNDUzNCIgZmlsbD0iI2Y2ZjZmNiIvPjxwYXRoIGQ9Ik0xOTQgMTNWNmgtN3Y3aC0xVjVoOXY4aC0xem0tNyAyaC0xdi0xaDF2MXptMi0xaC0xdjFoMXYtMXptMiAwaC0xdjFoMXYtMXptMiAxaC0xdi0xaDF2MXptMi0xaC0xdjFoMXYtMXoiIGlkPSJwYXRoNDUzNiIgZmlsbD0iIzQyNDI0MiIvPjxwYXRoIGQ9Ik0xODcgMTNWNmg3djdoLTd6IiBpZD0icGF0aDQ1MzgiIGZpbGw9IiNmMGVmZjEiLz48L2c+PC9zdmc+")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.customcolor:before{background-image:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.folder:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTE0LjUgMkg3LjAwOGwtMSAySDIuNTA0YS41LjUgMCAwMC0uNS41djhhLjUuNSAwIDAwLjUuNUgxNC41YS41LjUgMCAwMC41LS41di0xMGEuNS41IDAgMDAtLjUtLjV6bS0uNDk2IDJINy41MDhsLjUtMWg1Ljk5NnYxeiIgZmlsbD0iIzY1NjU2NSIvPjxwYXRoIGQ9Ik0xNCAzdjFINy41TDggM2g2eiIgZmlsbD0iI2YwZWZmMSIvPjwvc3ZnPg==")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.customcolor .colorspan{margin:0 0 0 .3em;border:.1em solid #000;width:.7em;height:.7em;display:inline-block}.monaco-editor .suggest-widget .details{display:flex;flex-direction:column;cursor:default}.monaco-editor .suggest-widget .details.no-docs{display:none}.monaco-editor .suggest-widget.docs-below .details{border-top-width:0}.monaco-editor .suggest-widget .details>.monaco-scrollable-element{flex:1}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body{position:absolute;box-sizing:border-box;height:100%;width:100%}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.header>.type{flex:2;overflow:hidden;text-overflow:ellipsis;opacity:.7;word-break:break-all;margin:0;padding:4px 0 12px 5px}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.docs{margin:0;padding:4px 5px;white-space:pre-wrap}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.docs.markdown-docs{padding:0;white-space:normal}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.docs.markdown-docs>div,.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.docs.markdown-docs>span:not(:empty){padding:4px 5px}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:first-child{margin-top:0}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:last-child{margin-bottom:0}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.docs .code{white-space:pre-wrap;word-wrap:break-word}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>p:empty{display:none}.monaco-editor .suggest-widget .details code{border-radius:3px;padding:0 .4em}.monaco-editor.hc-black .suggest-widget .details>.monaco-scrollable-element>.body>.header>.close,.monaco-editor.vs-dark .suggest-widget .details>.monaco-scrollable-element>.body>.header>.close{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMyAzIDE2IDE2Ij48cGF0aCBmaWxsPSIjZThlOGU4IiBkPSJNMTIuNTk3IDExLjA0MmwyLjgwMyAyLjgwMy0xLjU1NiAxLjU1NS0yLjgwMi0yLjgwMkw4LjIzOSAxNS40bC0xLjU1Ni0xLjU1NSAyLjgwMi0yLjgwMy0yLjgwMi0yLjgwMyAxLjU1NS0xLjU1NiAyLjgwNCAyLjgwMyAyLjgwMy0yLjgwM0wxNS40IDguMjM5eiIvPjwvc3ZnPg==")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE2IDEwYzAgMi4yMDUtMS43OTQgNC00IDQtMS44NTggMC0zLjQxMS0xLjI3OS0zLjg1OC0zaC0uOTc4bDIuMzE4IDRIMHYtMS43MDNsMi0zLjQwOFYwaDExdjYuMTQyYzEuNzIxLjQ0NyAzIDIgMyAzLjg1OHoiIGZpbGw9IiMyZDJkMzAiLz48cGF0aCBkPSJNMTIgMXY0Ljc1QTQuMjU1IDQuMjU1IDAgMDA3Ljc1IDEwaC0uNzMyTDQuMjc1IDUuMjY5IDMgNy40NDJWMWg5ek03Ljc0NyAxNEw0LjI2OSA4IC43NDggMTRoNi45OTl6TTE1IDEwYTMgMyAwIDExLTYgMCAzIDMgMCAwMTYgMHoiIGZpbGw9IiNjNWM1YzUiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.constructor:before,.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.function:before,.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.method:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.constructor:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.function:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.method:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE1IDMuMzQ5djguNDAzTDguOTc1IDE2SDguMDdMMSAxMS41ODJWMy4zMjdMNy41OTUgMGgxLjExOEwxNSAzLjM0OXoiIGZpbGw9IiMyZDJkMzAiLz48cGF0aCBkPSJNMTIuNzE1IDQuMzk4TDguNDg3IDcuMDIgMy41NjUgNC4yNzJsNC41NzgtMi4zMDkgNC41NzIgMi40MzV6TTMgNS4xMDJsNSAyLjc5MnY1LjcwNWwtNS0zLjEyNVY1LjEwMnptNiA4LjQzNFY3Ljg3OGw0LTIuNDh2NS4zMTdsLTQgMi44MjF6IiBmaWxsPSIjMmIyODJlIi8+PHBhdGggZD0iTTguMTU2LjgzN0wyIDMuOTQydjcuMDg1TDguNTE3IDE1LjEgMTQgMTEuMjMzVjMuOTVMOC4xNTYuODM3em00LjU1OSAzLjU2MUw4LjQ4NyA3LjAyIDMuNTY1IDQuMjcybDQuNTc4LTIuMzA5IDQuNTcyIDIuNDM1ek0zIDUuMTAybDUgMi43OTJ2NS43MDVsLTUtMy4xMjVWNS4xMDJ6bTYgOC40MzRWNy44NzhsNC0yLjQ4djUuMzE3bC00IDIuODIxeiIgZmlsbD0iI2IxODBkNyIvPjwvc3ZnPg==")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.field:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.field:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTAgMTAuNzM2VjQuNUw5IDBsNyAzLjV2Ni4yMzZsLTkgNC41LTctMy41eiIgZmlsbD0iIzJkMmQzMCIvPjxwYXRoIGQ9Ik05IDFMMSA1djVsNiAzIDgtNFY0TDkgMXpNNyA2Ljg4MkwzLjIzNiA1IDkgMi4xMTggMTIuNzY0IDQgNyA2Ljg4MnoiIGZpbGw9IiM3NWJlZmYiLz48cGF0aCBkPSJNOSAyLjExOEwxMi43NjQgNCA3IDYuODgyIDMuMjM2IDUgOSAyLjExOHoiIGZpbGw9IiMyYjI4MmUiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.event:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.event:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTcgN2g2bC04IDhINGwyLjk4NS02SDNsNC04aDZMNyA3eiIgZmlsbD0iI2U4YWI1MyIvPjwvc3ZnPg==")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.operator:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.operator:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTEgMXYxNGgxNFYxSDF6bTYgMTJIM3YtMWg0djF6bTAtM0gzVjloNHYxem0wLTVINXYySDRWNUgyVjRoMlYyaDF2MmgydjF6bTMuMjgxIDhIOC43MTlsMy00aDEuNTYzbC0zLjAwMSA0ek0xNCA1SDlWNGg1djF6IiBmaWxsPSIjNzViZWZmIi8+PC9zdmc+")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.variable:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.variable:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTIgNXY2aDJ2MUgxVjRoM3YxSDJ6bTEwIDZ2MWgzVjRoLTN2MWgydjZoLTJ6IiBmaWxsPSIjYzVjNWM1Ii8+PHBhdGggZD0iTTguNzMzIDRMNCA2LjM2N3YzLjE1Nkw3LjE1NiAxMS4xbDQuNzMzLTIuMzY3VjUuNTc4TDguNzMzIDR6TTcuMTU2IDcuMTU2bC0xLjU3OC0uNzg5IDMuMTU2LTEuNTc4IDEuNTc4Ljc4OS0zLjE1NiAxLjU3OHoiIGZpbGw9IiM3NWJlZmYiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.class:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.class:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE2IDYuNTg2bC0zLTNMMTEuNTg2IDVIOS40MTRsMS0xLTQtNGgtLjgyOEwwIDUuNTg2di44MjhsNCA0TDYuNDE0IDhIN3Y1aDEuNTg2bDMgM2guODI4TDE2IDEyLjQxNHYtLjgyOEwxMy45MTQgOS41IDE2IDcuNDE0di0uODI4eiIgZmlsbD0iIzJkMmQzMCIvPjxwYXRoIGQ9Ik0xMyAxMGwyIDItMyAzLTItMiAxLTFIOFY3SDZMNCA5IDEgNmw1LTUgMyAzLTIgMmg1bDEtMSAyIDItMyAzLTItMiAxLTFIOXY0bDIuOTk5LjAwMkwxMyAxMHoiIGZpbGw9IiNlOGFiNTMiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.interface:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.interface:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTExLjUgMTJjLTEuOTE1IDAtMy42MDItMS4yNDEtNC4yMjgtM2gtMS40MWEzLjExIDMuMTEgMCAwMS0yLjczNyAxLjYyNUMxLjQwMiAxMC42MjUgMCA5LjIyMyAwIDcuNXMxLjQwMi0zLjEyNSAzLjEyNS0zLjEyNWMxLjE2NSAwIDIuMjAxLjYzOSAyLjczNyAxLjYyNWgxLjQxYy42MjYtMS43NTkgMi4zMTMtMyA0LjIyOC0zQzEzLjk4MSAzIDE2IDUuMDE5IDE2IDcuNVMxMy45ODEgMTIgMTEuNSAxMnoiIGZpbGw9IiMyZDJkMzAiLz48cGF0aCBkPSJNMTEuNSA5QTEuNTAxIDEuNTAxIDAgMTExMyA3LjVjMCAuODI2LS42NzMgMS41LTEuNSAxLjV6IiBmaWxsPSIjMmIyODJlIi8+PHBhdGggZD0iTTExLjUgNGEzLjQ5IDMuNDkgMCAwMC0zLjQ1IDNINS4xODVBMi4xMjIgMi4xMjIgMCAwMDEgNy41YTIuMTIzIDIuMTIzIDAgMTA0LjE4NS41SDguMDVhMy40OSAzLjQ5IDAgMDAzLjQ1IDMgMy41IDMuNSAwIDEwMC03em0wIDVjLS44MjcgMC0xLjUtLjY3My0xLjUtMS41UzEwLjY3MyA2IDExLjUgNnMxLjUuNjczIDEuNSAxLjVTMTIuMzI3IDkgMTEuNSA5eiIgZmlsbD0iIzc1YmVmZiIvPjwvc3ZnPg==")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.struct:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.struct:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTEwIDloNHY0aC00Vjl6bS04IDRoNFY5SDJ2NHpNMiAzdjRoMTJWM0gyeiIgZmlsbD0iIzc1YmVmZiIvPjwvc3ZnPg==")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.type-parameter:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.type-parameter:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTQgM2g4djJoLTF2LS41YS41LjUgMCAwMC0uNS0uNUg5djcuNWEuNS41IDAgMDAuNS41aC41djFINnYtMWguNWEuNS41IDAgMDAuNS0uNVY0SDUuNWEuNS41IDAgMDAtLjUuNVY1SDRWM3pNMyA1LjYxNUwuMTE2IDguNSAzIDExLjM4M2wuODg0LS44ODMtMi0yIDItMkwzIDUuNjE1em0xMCAwbC0uODg0Ljg4NSAyIDItMiAyIC44ODQuODgzTDE1Ljg4NCA4LjUgMTMgNS42MTV6IiBmaWxsPSIjYzVjNWM1Ii8+PC9zdmc+")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.module:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.module:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTkuMjYgMTEuOTg0bC45NzgtLjAyMWEuOTYyLjk2MiAwIDAwLjA5LS4wMDZjLjAxMS0uMDYzLjAyNi0uMTc5LjAyNi0uMzYxVjkuNjg4YzAtLjY3OS4xODUtMS4yNTcuNTMtMS43MDctLjM0Ni0uNDUyLS41My0xLjAzLS41My0xLjcwNVY0LjM1YzAtLjE2Ny0uMDIxLS4yNTktLjAzNC0uMzAyTDkuMjYgNC4wMlYuOTczbDEuMDExLjAxMWMyLjE2Ny4wMjQgMy40MDkgMS4xNTYgMy40MDkgMy4xMDV2MS45NjJjMCAuMzUxLjA3MS40NjEuMDcyLjQ2MmwuOTM2LjA2LjA1My45Mjd2MS45MzZsLS45MzYuMDYxYy0uMDc2LjAxNi0uMTI1LjE0Ni0uMTI1LjQyNHYyLjAxN2MwIC45MTQtLjMzMiAzLjA0My0zLjQwOCAzLjA3OGwtMS4wMTIuMDExdi0zLjA0M3ptLTMuNTIxIDMuMDMyYy0zLjA4OS0uMDM1LTMuNDIyLTIuMTY0LTMuNDIyLTMuMDc4VjkuOTIxYzAtLjMyNy0uMDY2LS40MzItLjA2Ny0uNDMzbC0uOTM3LS4wNi0uMDYzLS45MjlWNi41NjNsLjk0Mi0uMDZjLjA1OCAwIC4xMjUtLjExNC4xMjUtLjQ1MlY0LjA5YzAtMS45NDkgMS4yNDgtMy4wODEgMy40MjItMy4xMDVMNi43NS45NzNWNC4wMmwtLjk3NS4wMjNhLjU3Mi41NzIgMCAwMC0uMDkzLjAxYy4wMDYuMDIxLS4wMTkuMTE1LS4wMTkuMjk3djEuOTI4YzAgLjY3NS0uMTg2IDEuMjUzLS41MzQgMS43MDUuMzQ4LjQ1LjUzNCAxLjAyOC41MzQgMS43MDd2MS45MDdjMCAuMTc1LjAxNC4yOTEuMDI3LjM2My4wMjMuMDAyIDEuMDYuMDI1IDEuMDYuMDI1djMuMDQzbC0xLjAxMS0uMDEyeiIgZmlsbD0iIzJkMmQzMCIvPjxwYXRoIGQ9Ik01Ljc1IDE0LjAxNmMtMS42MjMtLjAxOS0yLjQzNC0uNzExLTIuNDM0LTIuMDc4VjkuOTIxYzAtLjkwMi0uMzU1LTEuMzc2LTEuMDY2LTEuNDIydi0uOTk4Yy43MTEtLjA0NSAxLjA2Ni0uNTI5IDEuMDY2LTEuNDQ5VjQuMDljMC0xLjM4NS44MTEtMi4wODcgMi40MzQtMi4xMDV2MS4wNmMtLjcyNS4wMTctMS4wODcuNDUzLTEuMDg3IDEuMzA1djEuOTI4YzAgLjkyLS40NTQgMS40ODgtMS4zNiAxLjcwMlY4Yy45MDcuMjAxIDEuMzYuNzYzIDEuMzYgMS42ODh2MS45MDdjMCAuNDg4LjA4MS44MzUuMjQzIDEuMDQyLjE2Mi4yMDguNDQzLjMxNi44NDQuMzI1djEuMDU0em03Ljk5LTUuNTE3Yy0uNzA2LjA0NS0xLjA2LjUyLTEuMDYgMS40MjJ2Mi4wMTdjMCAxLjM2Ny0uODA3IDIuMDYtMi40MiAyLjA3OHYtMS4wNTNjLjM5Ni0uMDA5LjY3OC0uMTE4Ljg0NC0uMzI4LjE2Ny0uMjEuMjUtLjU1Ni4yNS0xLjAzOVY5LjY4OGMwLS45MjUuNDQ5LTEuNDg4IDEuMzQ3LTEuNjg4di0uMDIxYy0uODk4LS4yMTQtMS4zNDctLjc4Mi0xLjM0Ny0xLjcwMlY0LjM1YzAtLjg1Mi0uMzY0LTEuMjg4LTEuMDk0LTEuMzA2di0xLjA2YzEuNjEzLjAxOCAyLjQyLjcyIDIuNDIgMi4xMDV2MS45NjJjMCAuOTIuMzU0IDEuNDA0IDEuMDYgMS40NDl2Ljk5OXoiIGZpbGw9IiNjNWM1YzUiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.property:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.property:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE2IDUuNWE1LjUgNS41IDAgMDEtNS41IDUuNWMtLjI3NSAwLS41NDMtLjAyNy0uODA3LS4wNjZsLS4wNzktLjAxMmE1LjQyOSA1LjQyOSAwIDAxLS44MS0uMTkybC00LjUzNyA0LjUzN2MtLjQ3Mi40NzMtMS4xLjczMy0xLjc2Ny43MzNzLTEuMjk1LS4yNi0xLjc2OC0uNzMyYTIuNTAyIDIuNTAyIDAgMDEwLTMuNTM1bDQuNTM3LTQuNTM3YTUuNDUyIDUuNDUyIDAgMDEtLjE5MS0uODEyYy0uMDA1LS4wMjUtLjAwOC0uMDUxLS4wMTItLjA3N0E1LjUwMyA1LjUwMyAwIDAxNSA1LjVhNS41IDUuNSAwIDExMTEgMHoiIGZpbGw9IiMyZDJkMzAiLz48cGF0aCBkPSJNMTUgNS41YTQuNSA0LjUgMCAwMS00LjUgNC41Yy0uNjkzIDAtMS4zNDItLjE3LTEuOTI5LS40NWwtNS4wMSA1LjAxYy0uMjkzLjI5NC0uNjc3LjQ0LTEuMDYxLjQ0cy0uNzY4LS4xNDYtMS4wNjEtLjQzOWExLjUgMS41IDAgMDEwLTIuMTIxbDUuMDEtNS4wMUE0LjQ4MyA0LjQ4MyAwIDAxNiA1LjUgNC41IDQuNSAwIDAxMTAuNSAxYy42OTMgMCAxLjM0Mi4xNyAxLjkyOS40NUw5LjYzNiA0LjI0M2wyLjEyMSAyLjEyMSAyLjc5My0yLjc5M2MuMjguNTg3LjQ1IDEuMjM2LjQ1IDEuOTI5eiIgZmlsbD0iI2M1YzVjNSIvPjwvc3ZnPg==")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.unit:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.unit:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE2IDExLjAxM0gxVjRoMTV2Ny4wMTN6IiBmaWxsPSIjMmQyZDMwIi8+PHBhdGggZD0iTTggOUg3VjZoM3YzSDlWN0g4djJ6TTQgN2gxdjJoMVY2SDN2M2gxVjd6bTggMGgxdjJoMVY2aC0zdjNoMVY3eiIgZmlsbD0iIzJiMjgyZSIvPjxwYXRoIGQ9Ik0yIDV2NWgxM1Y1SDJ6bTQgNEg1VjdINHYySDNWNmgzdjN6bTQgMEg5VjdIOHYySDdWNmgzdjN6bTQgMGgtMVY3aC0xdjJoLTFWNmgzdjN6IiBmaWxsPSIjYzVjNWM1Ii8+PC9zdmc+")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.constant:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.constant:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTIuODc5IDE0TDEgMTIuMTIxVjMuODc5TDIuODc5IDJoMTAuMjQyTDE1IDMuODc5djguMjQyTDEzLjEyMSAxNEgyLjg3OXoiIGZpbGw9IiMyNTI1MjYiLz48cGF0aCBkPSJNMTIuMjkzIDRIMy43MDdMMyA0LjcwN3Y2LjU4NmwuNzA3LjcwN2g4LjU4NmwuNzA3LS43MDdWNC43MDdMMTIuMjkzIDR6TTExIDEwSDVWOWg2djF6bTAtM0g1VjZoNnYxeiIgZmlsbD0iIzJiMjgyZSIvPjxwYXRoIGQ9Ik0xMi43MDcgMTNIMy4yOTNMMiAxMS43MDdWNC4yOTNMMy4yOTMgM2g5LjQxNEwxNCA0LjI5M3Y3LjQxNEwxMi43MDcgMTN6bS05LTFoOC41ODZsLjcwNy0uNzA3VjQuNzA3TDEyLjI5MyA0SDMuNzA3TDMgNC43MDd2Ni41ODZsLjcwNy43MDd6IiBmaWxsPSIjYzVjNWM1Ii8+PHBhdGggZD0iTTExIDdINVY2aDZ2MXptMCAySDV2MWg2Vjl6IiBmaWxsPSIjNzViZWZmIi8+PC9zdmc+")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.enum:before,.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.value:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.enum:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.value:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE0LjQxNCAxTDE2IDIuNTg2djUuODI4TDE0LjQxNCAxMEgxMHYzLjQxNkw4LjQxNCAxNUgxLjU4NkwwIDEzLjQxNnYtNS44M0wxLjU4NiA2SDZWMi41ODZMNy41ODYgMWg2LjgyOHoiIGZpbGw9IiMyZDJkMzAiLz48cGF0aCBkPSJNMiAxM2g2VjhIMnY1em0xLTRoNHYxSDNWOXptMCAyaDR2MUgzdi0xem0xMS01VjNIOHYzaC40MTRMOSA2LjU4NlY2aDR2MUg5LjQxNGwuNTg2LjU4NlY4aDRWNnptLTEtMUg5VjRoNHYxeiIgZmlsbD0iIzJiMjgyZSIvPjxwYXRoIGQ9Ik0zIDExaDQuMDAxdjFIM3YtMXptMC0xaDQuMDAxVjlIM3Yxem02LTJ2NWwtMSAxSDJsLTEtMVY4bDEtMWg2bDEgMXpNOCA4SDJ2NWg2Vjh6bTEtMmwxIDFoM1Y2SDl6bTAtMWg0VjRIOXYxem01LTNIOEw3IDN2M2gxVjNoNnY1aC00djFoNGwxLTFWM2wtMS0xeiIgZmlsbD0iI2U4YWI1MyIvPjwvc3ZnPg==")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.enum-member:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.enum-member:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTAgMTVWNmg2VjIuNTg2TDcuNTg1IDFoNi44MjlMMTYgMi41ODZ2NS44MjlMMTQuNDE0IDEwSDEwdjVIMHptMy02eiIgZmlsbD0iIzJkMmQzMCIvPjxwYXRoIGQ9Ik04IDN2M2g1djFoLTN2MWg0VjNIOHptNSAySDlWNGg0djF6TTIgOHY1aDZWOEgyem01IDNIM3YtMWg0djF6IiBmaWxsPSIjMmIyODJlIi8+PHBhdGggZD0iTTEwIDZoM3YxaC0zVjZ6TTkgNHYxaDRWNEg5em01LTJIOEw3IDN2M2gxVjNoNnY1aC00djFoNGwxLTFWM2wtMS0xem0tNyA4SDN2MWg0di0xem0yLTN2N0gxVjdoOHpNOCA4SDJ2NWg2Vjh6IiBmaWxsPSIjNzViZWZmIi8+PC9zdmc+")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.keyword:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.keyword:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE2IDVWMkg5VjFIMHYxNGgxM3YtM2gzVjloLTFWNkg5VjVoN3ptLTggN1Y5aDF2M0g4eiIgZmlsbD0iIzJkMmQzMCIvPjxwYXRoIGQ9Ik0yIDNoNXYxSDJWM3oiIGZpbGw9IiMyYjI4MmUiLz48cGF0aCBkPSJNMTUgNGgtNVYzaDV2MXptLTEgM2gtMnYxaDJWN3ptLTQgMEgxdjFoOVY3em0yIDZIMXYxaDExdi0xem0tNS0zSDF2MWg2di0xem04IDBoLTV2MWg1di0xek04IDJ2M0gxVjJoN3pNNyAzSDJ2MWg1VjN6IiBmaWxsPSIjYzVjNWM1Ii8+PC9zdmc+")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.text:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.text:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE2IDE1SDBWMWgxNnYxNHoiIGZpbGw9IiMyZDJkMzAiLz48cGF0aCBkPSJNOS4yMjkgNy4zNTRjLjAzNS4xNDYuMDUyLjMxLjA1Mi40OTQgMCAuMjM0LS4wMi40NDEtLjA2LjYyMS0uMDM5LjE4LS4wOTUuMzI4LS4xNjguNDQ1YS42ODcuNjg3IDAgMDEtLjkxNC4yODEuNzYuNzYgMCAwMS0uMjM3LS4yMDcuOTg4Ljk4OCAwIDAxLS4xNTQtLjMwNiAxLjI2MiAxLjI2MiAwIDAxLS4wNTctLjM4MXYtLjUwNmMwLS4xNy4wMi0uMzI2LjA2MS0uNDY1cy4wOTYtLjI1OC4xNjgtLjM1OWEuNzU2Ljc1NiAwIDAxLjI1Ny0uMjMyYy4xLS4wNTUuMjEtLjA4Mi4zMzEtLjA4MmEuNjQ2LjY0NiAwIDAxLjU3MS4zMmMuMDY3LjEwNS4xMTYuMjMuMTUuMzc3em0tNS4xMjYuODY5YS41NTcuNTU3IDAgMDAtLjE5Ni4xMzJjLS4wNDcuMDUzLS4wOC4xMTItLjA5Ny4xOHMtLjAyOC4xNDctLjAyOC4yMzNhLjUxMy41MTMgMCAwMC4xNTcuMzkuNTI4LjUyOCAwIDAwLjE4Ni4xMTMuNjgyLjY4MiAwIDAwLjI0Mi4wNDEuNzYuNzYgMCAwMC41OTMtLjI3MS44OTcuODk3IDAgMDAuMTY1LS4yOTVjLjAzOC0uMTEzLjA1OS0uMjM0LjA1OS0uMzY1di0uMzQ2bC0uNzYxLjExYTEuMjkgMS4yOSAwIDAwLS4zMi4wNzh6TTE0IDN2MTBIMlYzaDEyek01Ljk2MiA3LjQ2OWMwLS4yMzgtLjAyNy0uNDUxLS4wODMtLjYzN2ExLjI4NiAxLjI4NiAwIDAwLS4yNDktLjQ3MSAxLjA4IDEuMDggMCAwMC0uNDI0LS4yOTUgMS42NDQgMS42NDQgMCAwMC0uNjA4LS4xMDFjLS4xMTkgMC0uMjQxLjAxMi0uMzY4LjAzM2EzLjIxMyAzLjIxMyAwIDAwLS42NzMuMTk1IDEuMzEzIDEuMzEzIDAgMDAtLjIxMi4xMTR2Ljc2OGMuMTU4LS4xMzIuMzQxLS4yMzUuNTQ0LS4zMTMuMjA0LS4wNzguNDEzLS4xMTcuNjI3LS4xMTcuMjEzIDAgLjM3Ny4wNjMuNDk0LjE4Ni4xMTYuMTI1LjE3NC4zMjQuMTc0LjZsLTEuMDMuMTU0Yy0uMjA1LjAyNi0uMzguMDc3LS41MjYuMTUxYTEuMDgzIDEuMDgzIDAgMDAtLjU2My42NkExLjU2MiAxLjU2MiAwIDAwMyA4Ljg1N2MwIC4xNy4wMjUuMzIzLjA3NC40NjNhLjk0NS45NDUgMCAwMC41NjguNTk2Yy4xMzkuMDU3LjI5Ny4wODQuNDc4LjA4NC4yMjkgMCAuNDMxLS4wNTMuNjA0LS4xNmExLjMgMS4zIDAgMDAuNDM5LS40NjNoLjAxNHYuNTI5aC43ODVWNy40Njl6TTEwIDcuODYxYTMuNTQgMy41NCAwIDAwLS4wNzQtLjczNCAyLjA0NyAyLjA0NyAwIDAwLS4yMjgtLjYxMSAxLjIwMyAxLjIwMyAwIDAwLS4zOTQtLjQxNiAxLjAzIDEuMDMgMCAwMC0uNTc0LS4xNTNjLS4xMjMgMC0uMjM0LjAxOC0uMzM2LjA1MWExIDEgMCAwMC0uMjc4LjE0NyAxLjE1MyAxLjE1MyAwIDAwLS4yMjUuMjIyIDIuMDIyIDIuMDIyIDAgMDAtLjE4MS4yODloLS4wMTNWNUg3djQuODg3aC42OTd2LS40ODVoLjAxM2MuMDQ0LjA4Mi4wOTUuMTU4LjE1MS4yMjkuMDU3LjA3LjExOS4xMzMuMTkxLjE4NmEuODM1LjgzNSAwIDAwLjIzOC4xMjEuOTQzLjk0MyAwIDAwLjI5My4wNDJjLjIzIDAgLjQzNC0uMDUzLjYwOS0uMTZhMS4zNCAxLjM0IDAgMDAuNDQzLS40NDNjLjEyLS4xODguMjExLS40MTIuMjcyLS42NzJBMy42MiAzLjYyIDAgMDAxMCA3Ljg2MXptMy0xLjY1OGEuNy43IDAgMDAtLjEwNi0uMDY2IDEuMTgzIDEuMTgzIDAgMDAtLjE0Mi0uMDYzIDEuMjMzIDEuMjMzIDAgMDAtLjM2My0uMDY1Yy0uMjA5IDAtLjM5OS4wNTEtLjU2OS4xNWExLjM1NSAxLjM1NSAwIDAwLS40MzMuNDI0Yy0uMTE4LjE4Mi0uMjEuNDAyLS4yNzMuNjZhMy42MyAzLjYzIDAgMDAtLjAwOCAxLjYxNWMuMDYuMjMuMTQzLjQzLjI1Mi42MDIuMTA5LjE2OC4yNDEuMzAzLjM5Ni4zOTZhLjk3Mi45NzIgMCAwMC41MjQuMTQ0Yy4xNTggMCAuMjk2LS4wMjEuNDEzLS4wNjguMTE3LS4wNDUuMjE5LS4xMDguMzA5LS4xODR2LS43N2ExLjA5NCAxLjA5NCAwIDAxLS4yODguMjI1LjgxOS44MTkgMCAwMS0uMTU4LjA2OC40OC40OCAwIDAxLS4xNTMuMDI3LjYyLjYyIDAgMDEtLjI3NC0uMDc0Yy0uMjQxLS4xMzYtLjQyMy0uNDc5LS40MjMtMS4xNDYgMC0uNzE1LjIwNi0xLjEyLjQ2OS0xLjMwMS4wNzctLjAzMi4xNTMtLjA2NC4yMzgtLjA2NC4xMTMgMCAuMjIuMDI3LjMxNy4wODIuMDk2LjA1Ny4xODguMTMxLjI3Mi4yMjN2LS44MTV6IiBmaWxsPSIjMmIyODJlIi8+PHBhdGggZD0iTTEgMnYxMmgxNFYySDF6bTEzIDExSDJWM2gxMnYxMHpNNS42MyA2LjM2MWExLjA4IDEuMDggMCAwMC0uNDI0LS4yOTUgMS42NDQgMS42NDQgMCAwMC0uNjA4LS4xMDFjLS4xMTkgMC0uMjQxLjAxMi0uMzY4LjAzM2EzLjIxMyAzLjIxMyAwIDAwLS42NzMuMTk1IDEuMzEzIDEuMzEzIDAgMDAtLjIxMi4xMTR2Ljc2OGMuMTU4LS4xMzIuMzQxLS4yMzUuNTQ0LS4zMTMuMjA0LS4wNzguNDEzLS4xMTcuNjI3LS4xMTcuMjEzIDAgLjM3Ny4wNjMuNDk0LjE4Ni4xMTYuMTI1LjE3NC4zMjQuMTc0LjZsLTEuMDMuMTU0Yy0uMjA1LjAyNi0uMzguMDc3LS41MjYuMTUxYTEuMDgzIDEuMDgzIDAgMDAtLjU2My42NkExLjU2MiAxLjU2MiAwIDAwMyA4Ljg1N2MwIC4xNy4wMjUuMzIzLjA3NC40NjNhLjk0NS45NDUgMCAwMC41NjguNTk2Yy4xMzkuMDU3LjI5Ny4wODQuNDc4LjA4NC4yMjkgMCAuNDMxLS4wNTMuNjA0LS4xNmExLjMgMS4zIDAgMDAuNDM5LS40NjNoLjAxNHYuNTI5aC43ODVWNy40NjljMC0uMjM4LS4wMjctLjQ1MS0uMDgzLS42MzdhMS4yODYgMS4yODYgMCAwMC0uMjQ5LS40NzF6bS0uNDQ2IDIuMDJjMCAuMTMxLS4wMi4yNTItLjA1OS4zNjVhLjg5Ny44OTcgMCAwMS0uMTY1LjI5NS43NTguNzU4IDAgMDEtLjU5My4yNzIuNjgyLjY4MiAwIDAxLS4yNDItLjA0MS41MDcuNTA3IDAgMDEtLjMwMi0uMjg2LjU4My41ODMgMCAwMS0uMDQxLS4yMThjMC0uMDg2LjAxLS4xNjQuMDI3LS4yMzJzLjA1MS0uMTI3LjA5OC0uMThhLjU0Ni41NDYgMCAwMS4xOTYtLjEzM2MuMDgzLS4wMzMuMTg5LS4wNjEuMzItLjA3OGwuNzYxLS4xMDl2LjM0NXptNC41MTQtMS44NjVhMS4yMDMgMS4yMDMgMCAwMC0uMzk0LS40MTYgMS4wMyAxLjAzIDAgMDAtLjU3NC0uMTUzYy0uMTIzIDAtLjIzNC4wMTgtLjMzNi4wNTFhMSAxIDAgMDAtLjI3OC4xNDcgMS4xNTMgMS4xNTMgMCAwMC0uMjI1LjIyMiAyLjAyMiAyLjAyMiAwIDAwLS4xODEuMjg5aC0uMDEzVjVIN3Y0Ljg4N2guNjk3di0uNDg1aC4wMTNjLjA0NC4wODIuMDk1LjE1OC4xNTEuMjI5LjA1Ny4wNy4xMTkuMTMzLjE5MS4xODZhLjgzNS44MzUgMCAwMC4yMzguMTIxLjk0My45NDMgMCAwMC4yOTMuMDQyYy4yMyAwIC40MzQtLjA1My42MDktLjE2YTEuMzQgMS4zNCAwIDAwLjQ0My0uNDQzYy4xMi0uMTg4LjIxMS0uNDEyLjI3Mi0uNjcyQTMuNjIgMy42MiAwIDAwMTAgNy44NjFhMy41NCAzLjU0IDAgMDAtLjA3NC0uNzM0IDIuMDQ3IDIuMDQ3IDAgMDAtLjIyOC0uNjExem0tLjQ3NiAxLjk1M2MtLjAzOS4xOC0uMDk1LjMyOC0uMTY4LjQ0NWEuNzU1Ljc1NSAwIDAxLS4yNjQuMjY2LjY4Ny42ODcgMCAwMS0uNjUxLjAxNS43Ni43NiAwIDAxLS4yMzctLjIwNy45ODguOTg4IDAgMDEtLjE1NC0uMzA2IDEuMjYyIDEuMjYyIDAgMDEtLjA1Ny0uMzgxdi0uNTA2YzAtLjE3LjAyLS4zMjYuMDYxLS40NjVzLjA5Ni0uMjU4LjE2OC0uMzU5YS43NTYuNzU2IDAgMDEuMjU3LS4yMzJjLjEtLjA1NS4yMS0uMDgyLjMzMS0uMDgyYS42NDYuNjQ2IDAgMDEuNTcxLjMyYy4wNjYuMTA1LjExNi4yMy4xNS4zNzcuMDM1LjE0Ni4wNTIuMzEuMDUyLjQ5NCAwIC4yMzQtLjAxOS40NDEtLjA1OS42MjF6bTMuNjcyLTIuMzMyYS43LjcgMCAwMS4xMDYuMDY2di44MTRhMS4xNzggMS4xNzggMCAwMC0uMjczLS4yMjMuNjQ1LjY0NSAwIDAwLS4zMTctLjA4MWMtLjA4NSAwLS4xNjEuMDMyLS4yMzguMDY0LS4yNjMuMTgxLS40NjkuNTg2LS40NjkgMS4zMDEgMCAuNjY4LjE4MiAxLjAxMS40MjMgMS4xNDYuMDg0LjA0LjE3MS4wNzQuMjc0LjA3NC4wNDkgMCAuMTAxLS4wMS4xNTMtLjAyN2EuODU2Ljg1NiAwIDAwLjE1OC0uMDY4IDEuMTYgMS4xNiAwIDAwLjI4OC0uMjI1di43N2MtLjA5LjA3Ni0uMTkyLjEzOS0uMzA5LjE4NGExLjA5OCAxLjA5OCAwIDAxLS40MTIuMDY4Ljk3NC45NzQgMCAwMS0uNTIzLS4xNDMgMS4yNTcgMS4yNTcgMCAwMS0uMzk2LS4zOTYgMi4wOTggMi4wOTggMCAwMS0uMjUyLS42MDIgMy4xMTggMy4xMTggMCAwMS0uMDg4LS43NTRjMC0uMzE2LjAzMi0uNjA0LjA5Ni0uODYxLjA2My0uMjU4LjE1NS0uNDc5LjI3My0uNjYuMTE5LS4xODIuMjY1LS4zMjIuNDMzLS40MjRhMS4xMDIgMS4xMDIgMCAwMTEuMDczLS4wMjN6IiBmaWxsPSIjYzVjNWM1Ii8+PC9zdmc+")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.color:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.color:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE2IDhjMCA0LjQxMS0zLjU4OSA4LTggOGEyLjgwMyAyLjgwMyAwIDAxLTIuOC0yLjhjMC0uODMzLjI3Mi0xLjYyOS43NjYtMi4yNDFhLjU5Ni41OTYgMCAwMC4xMDEtLjM1OS42NjcuNjY3IDAgMDAtLjY2Ny0uNjY2LjU4LjU4IDAgMDAtLjM1OC4xMDJBMy41ODQgMy41ODQgMCAwMTIuOCAxMC44IDIuODAzIDIuODAzIDAgMDEwIDhjMC00LjQxMSAzLjU4OS04IDgtOHM4IDMuNTg5IDggOHoiIGZpbGw9IiMyZDJkMzAiLz48cGF0aCBkPSJNNS40IDcuOTMzYTIuNjcgMi42NyAwIDAxMi42NjcgMi42NjZjMCAuNjA2LS4xOTMgMS4xNzktLjU0NCAxLjYxNGExLjU5OSAxLjU5OSAwIDAwLS4zMjMuOTg3LjguOCAwIDAwLjguOGMzLjMwOSAwIDYtMi42OTEgNi02cy0yLjY5MS02LTYtNi02IDIuNjkxLTYgNmMwIC40NDEuMzU5LjguOC44LjM3OCAwIC43MjktLjExNC45ODYtLjMyMkEyLjU2OCAyLjU2OCAwIDAxNS40IDcuOTMzeiIvPjxwYXRoIGQ9Ik04IDE1Yy0uOTkyIDAtMS44LS44MDgtMS44LTEuOCAwLS42MDYuMTkzLTEuMTc5LjU0NC0xLjYxMy4yMDgtLjI1OS4zMjMtLjYwOS4zMjMtLjk4NyAwLS45MTktLjc0OC0xLjY2Ni0xLjY2Ny0xLjY2Ni0uMzc3IDAtLjcyOC4xMTUtLjk4Ni4zMjNBMi41OCAyLjU4IDAgMDEyLjggOS44QzEuODA4IDkuOCAxIDguOTkyIDEgOGMwLTMuODYgMy4xNC03IDctNyAzLjg1OSAwIDcgMy4xNCA3IDcgMCAzLjg1OS0zLjE0MSA3LTcgN3pNNS40IDcuOTMzYTIuNjcgMi42NyAwIDAxMi42NjcgMi42NjZjMCAuNjA2LS4xOTMgMS4xNzktLjU0NCAxLjYxNGExLjU5OSAxLjU5OSAwIDAwLS4zMjMuOTg3LjguOCAwIDAwLjguOGMzLjMwOSAwIDYtMi42OTEgNi02cy0yLjY5MS02LTYtNi02IDIuNjkxLTYgNmMwIC40NDEuMzU5LjguOC44LjM3OCAwIC43MjktLjExNC45ODYtLjMyMkEyLjU2OCAyLjU2OCAwIDAxNS40IDcuOTMzeiIgZmlsbD0iI2M1YzVjNSIvPjxwYXRoIGQ9Ik00LjUgNS4zNzVhLjg3NS44NzUgMCAxMDAgMS43NS44NzUuODc1IDAgMDAwLTEuNzV6IiBmaWxsPSIjYjE4MGQ3Ii8+PHBhdGggZD0iTTcuMTI1IDMuNjI1YS44NzUuODc1IDAgMTAwIDEuNzUuODc1Ljg3NSAwIDAwMC0xLjc1eiIgZmlsbD0iIzFiYTFlMiIvPjxwYXRoIGQ9Ik0xMC42MjUgNC41YS44NzUuODc1IDAgMTAwIDEuNzUuODc1Ljg3NSAwIDAwMC0xLjc1eiIgZmlsbD0iIzM5MyIvPjxwYXRoIGQ9Ik0xMS41IDhhLjg3NS44NzUgMCAxMDAgMS43NS44NzUuODc1IDAgMDAwLTEuNzV6IiBmaWxsPSIjZmMwIi8+PHBhdGggZD0iTTkuNzUgMTAuNjI1YS44NzUuODc1IDAgMTAwIDEuNzUuODc1Ljg3NSAwIDAwMC0xLjc1eiIgZmlsbD0iI2Y0ODc3MSIvPjwvc3ZnPg==")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.file:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.file:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTE1IDE2SDJWMGg4LjYyMUwxNSA0LjM3OVYxNnoiIGZpbGw9IiMyZDJkMzAiLz48cGF0aCBkPSJNMTMgMTRINFYyaDV2NGg0djh6bS0zLTlWMi4yMDdMMTIuNzkzIDVIMTB6IiBmaWxsPSIjMmIyODJlIi8+PHBhdGggZD0iTTMgMXYxNGgxMVY0Ljc5M0wxMC4yMDcgMUgzem0xMCAxM0g0VjJoNXY0aDR2OHptLTMtOVYyLjIwN0wxMi43OTMgNUgxMHoiIGZpbGw9IiNjNWM1YzUiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.reference:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.reference:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTEzIDV2OHMtLjAzNSAxLTEuMDM1IDFoLThTMyAxNCAzIDEzVjloMXY0aDhWNkg5LjM5N2wuNTE3LS41Mkw5IDQuNTcyVjNINy40MTlMNi40MTMgMmgzLjIyOEwxMyA1eiIgZmlsbD0iI2M1YzVjNSIvPjxwYXRoIGQ9Ik01Ljk4OCA2SDMuNWEyLjUgMi41IDAgMTEwLTVINHYxaC0uNUMyLjY3MyAyIDIgMi42NzMgMiAzLjVTMi42NzMgNSAzLjUgNWgyLjUxM0w0IDNoMmwyLjUgMi40ODRMNiA4SDRsMS45ODgtMnoiIGZpbGw9IiM3NWJlZmYiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.snippet:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.snippet:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgaWQ9InN2ZzQ2OTQiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHN0eWxlIGlkPSJzdHlsZTQ2OTYiPjwvc3R5bGU+PGcgaWQ9Imc0NzI0IiB0cmFuc2Zvcm09Im1hdHJpeCgxLjMzMzMzIDAgMCAxLjMzMzMzIC0yNDYgLTMyKSI+PHBhdGggZD0iTTE4NSAyNGgxMXYxMmgtMTF6IiBpZD0icGF0aDQ1MjgiIGZpbGw9IiMyZDJkMzAiLz48cGF0aCBkPSJNMTk0IDMzdi03aC03djdoLTF2LThoOXY4em0tOCAxaDF2MWgtMXptMiAwaDF2MWgtMXptMiAwaDF2MWgtMXptMiAwaDF2MWgtMXptMiAwaDF2MWgtMXoiIGlkPSJwYXRoNDUzMCIgZmlsbD0iI2M1YzVjNSIvPjxwYXRoIGQ9Ik0xODcgMjZoN3Y3aC03eiIgaWQ9InBhdGg0NTMyIiBmaWxsPSIjMmIyODJlIi8+PC9nPjwvc3ZnPg==")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.customcolor:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.customcolor:before{background-image:none}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.folder:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.folder:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTE0LjUgMkg3LjAwOGwtMSAySDIuNTA0YS41LjUgMCAwMC0uNS41djhhLjUuNSAwIDAwLjUuNUgxNC41YS41LjUgMCAwMC41LS41di0xMGEuNS41IDAgMDAtLjUtLjV6bS0uNDk2IDJINy41MDhsLjUtMWg1Ljk5NnYxeiIgZmlsbD0iI2M1YzVjNSIvPjwvc3ZnPg==")}.monaco-list{position:relative;height:100%;width:100%;white-space:nowrap;-webkit-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;-o-user-select:none;user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{position:relative;width:100%;height:100%}.monaco-list-row{position:absolute;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;cursor:pointer;overflow:hidden;width:100%;touch-action:none}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-multiple,.monaco-list.selection-single{outline:0!important}.monaco-editor .accessibilityHelpWidget{padding:10px;vertical-align:middle;overflow:scroll}.monaco-editor .iPadShowKeyboard{width:58px;min-width:0;height:36px;min-height:0;margin:0;padding:0;position:absolute;resize:none;overflow:hidden;background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1OCIgaGVpZ2h0PSIzNiI+PHBhdGggZmlsbD0iI0YwRUZGMSIgZD0iTTU0IDMyVjRINHYyOGg1MHptLTE2LTJIMjB2LTZoMTh2NnptNiAwaC00di02aDR2NnptOCAwaC02di02aDZ2NnpNNDggNmg0djRoLTRWNnptMCA2aDR2NGgtNHYtNHptMCA2aDR2NGgtNHYtNHpNNDIgNmg0djRoLTRWNnptMCA2aDR2NGgtNHYtNHptMCA2aDR2NGgtNHYtNHpNMzYgNmg0djRoLTRWNnptMCA2aDR2NGgtNHYtNHptMCA2aDR2NGgtNHYtNHpNMzAgNmg0djRoLTRWNnptMCA2aDR2NGgtNHYtNHptMCA2aDR2NGgtNHYtNHpNMjQgNmg0djRoLTRWNnptMCA2aDR2NGgtNHYtNHptMCA2aDR2NGgtNHYtNHpNMTggNmg0djRoLTRWNnptMCA2aDR2NGgtNHYtNHptMCA2aDR2NGgtNHYtNHptMCAxMmgtNHYtNmg0djZ6TTEyIDZoNHY0aC00VjZ6bTAgNmg0djRoLTR2LTR6bTAgNmg0djRoLTR2LTR6TTYgNmg0djRINlY2em0wIDZoNHY0SDZ2LTR6bTAgNmg0djRINnYtNHptMCA2aDZ2Nkg2di02eiIvPjxwYXRoIGZpbGw9IiM0MjQyNDIiIGQ9Ik01NS4zMzYgMEgyLjA1MUMuNzA3IDAgMCAuNjU2IDAgMnYzMmMwIDEuMzQ0LjcwNyAxLjk2NSAyLjA1MSAxLjk2NUw1NiAzNmMxLjM0NCAwIDItLjY1NiAyLTJWMmMwLTEuMzQ0LTEuMzItMi0yLjY2NC0yek01NCAzMkg0VjRoNTB2Mjh6Ii8+PHBhdGggZmlsbD0iIzQyNDI0MiIgZD0iTTYgMTJoNHY0SDZ6TTEyIDEyaDR2NGgtNHpNMTggMTJoNHY0aC00ek0yNCAxMmg0djRoLTR6TTMwIDEyaDR2NGgtNHpNMzYgMTJoNHY0aC00ek00MiAxMmg0djRoLTR6TTQ4IDEyaDR2NGgtNHpNNiA2aDR2NEg2ek0xMiA2aDR2NGgtNHpNMTggNmg0djRoLTR6TTI0IDZoNHY0aC00ek0zMCA2aDR2NGgtNHpNMzYgNmg0djRoLTR6TTQyIDZoNHY0aC00ek00OCA2aDR2NGgtNHpNNiAxOGg0djRINnpNMTIgMThoNHY0aC00ek0xOCAxOGg0djRoLTR6TTI0IDE4aDR2NGgtNHpNMzAgMThoNHY0aC00ek0zNiAxOGg0djRoLTR6TTQyIDE4aDR2NGgtNHpNNDggMThoNHY0aC00ek02IDI0aDZ2Nkg2ek00NiAyNGg2djZoLTZ6TTIwIDI0aDE4djZIMjB6TTE0IDI0aDR2NmgtNHpNNDAgMjRoNHY2aC00eiIvPjwvc3ZnPg==") 50% no-repeat;border:4px solid #f6f6f6;border-radius:4px}.monaco-editor.vs-dark .iPadShowKeyboard{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1OCIgaGVpZ2h0PSIzNiI+PHBhdGggZmlsbD0iIzJCMjgyRSIgZD0iTTU0IDMyVjRINHYyOGg1MHptLTE2LTJIMjB2LTZoMTh2NnptNiAwaC00di02aDR2NnptOCAwaC02di02aDZ2NnpNNDggNmg0djRoLTRWNnptMCA2aDR2NGgtNHYtNHptMCA2aDR2NGgtNHYtNHpNNDIgNmg0djRoLTRWNnptMCA2aDR2NGgtNHYtNHptMCA2aDR2NGgtNHYtNHpNMzYgNmg0djRoLTRWNnptMCA2aDR2NGgtNHYtNHptMCA2aDR2NGgtNHYtNHpNMzAgNmg0djRoLTRWNnptMCA2aDR2NGgtNHYtNHptMCA2aDR2NGgtNHYtNHpNMjQgNmg0djRoLTRWNnptMCA2aDR2NGgtNHYtNHptMCA2aDR2NGgtNHYtNHpNMTggNmg0djRoLTRWNnptMCA2aDR2NGgtNHYtNHptMCA2aDR2NGgtNHYtNHptMCAxMmgtNHYtNmg0djZ6TTEyIDZoNHY0aC00VjZ6bTAgNmg0djRoLTR2LTR6bTAgNmg0djRoLTR2LTR6TTYgNmg0djRINlY2em0wIDZoNHY0SDZ2LTR6bTAgNmg0djRINnYtNHptMCA2aDZ2Nkg2di02eiIvPjxwYXRoIGZpbGw9IiNDNUM1QzUiIGQ9Ik01NS4zMzYgMEgyLjA1MUMuNzA3IDAgMCAuNjU2IDAgMnYzMmMwIDEuMzQ0LjcwNyAxLjk2NSAyLjA1MSAxLjk2NUw1NiAzNmMxLjM0NCAwIDItLjY1NiAyLTJWMmMwLTEuMzQ0LTEuMzItMi0yLjY2NC0yek01NCAzMkg0VjRoNTB2Mjh6Ii8+PHBhdGggZmlsbD0iI0M1QzVDNSIgZD0iTTYgMTJoNHY0SDZ6TTEyIDEyaDR2NGgtNHpNMTggMTJoNHY0aC00ek0yNCAxMmg0djRoLTR6TTMwIDEyaDR2NGgtNHpNMzYgMTJoNHY0aC00ek00MiAxMmg0djRoLTR6TTQ4IDEyaDR2NGgtNHpNNiA2aDR2NEg2ek0xMiA2aDR2NGgtNHpNMTggNmg0djRoLTR6TTI0IDZoNHY0aC00ek0zMCA2aDR2NGgtNHpNMzYgNmg0djRoLTR6TTQyIDZoNHY0aC00ek00OCA2aDR2NGgtNHpNNiAxOGg0djRINnpNMTIgMThoNHY0aC00ek0xOCAxOGg0djRoLTR6TTI0IDE4aDR2NGgtNHpNMzAgMThoNHY0aC00ek0zNiAxOGg0djRoLTR6TTQyIDE4aDR2NGgtNHpNNDggMThoNHY0aC00ek02IDI0aDZ2Nkg2ek00NiAyNGg2djZoLTZ6TTIwIDI0aDE4djZIMjB6TTE0IDI0aDR2NmgtNHpNNDAgMjRoNHY2aC00eiIvPjwvc3ZnPg==") 50% no-repeat;border:4px solid #252526}.monaco-editor .tokens-inspect-widget{z-index:50;-webkit-user-select:text;-ms-user-select:text;-moz-user-select:text;-o-user-select:text;user-select:text;padding:10px}.tokens-inspect-separator{height:1px;border:0}.monaco-editor .tokens-inspect-widget .tm-token{font-family:monospace}.monaco-editor .tokens-inspect-widget .tm-token-length{font-weight:400;font-size:60%;float:right}.monaco-editor .tokens-inspect-widget .tm-metadata-table{width:100%}.monaco-editor .tokens-inspect-widget .tm-metadata-value{font-family:monospace;text-align:right}.monaco-editor .tokens-inspect-widget .tm-token-type{font-family:monospace}.monaco-keybinding{display:flex;align-items:center;line-height:10px}.monaco-keybinding>.monaco-keybinding-key{display:inline-block;border:1px solid hsla(0,0%,80%,.4);border-bottom-color:hsla(0,0%,73.3%,.4);border-radius:3px;box-shadow:inset 0 -1px 0 hsla(0,0%,73.3%,.4);background-color:hsla(0,0%,86.7%,.4);vertical-align:middle;color:#555;font-size:11px;padding:3px 5px}.hc-black .monaco-keybinding>.monaco-keybinding-key,.vs-dark .monaco-keybinding>.monaco-keybinding-key{background-color:hsla(0,0%,50.2%,.17);color:#ccc;border:1px solid rgba(51,51,51,.6);border-bottom-color:rgba(68,68,68,.6);box-shadow:inset 0 -1px 0 rgba(68,68,68,.6)}.monaco-keybinding>.monaco-keybinding-key-separator{display:inline-block}.monaco-keybinding>.monaco-keybinding-key-chord-separator{width:2px}.monaco-quick-open-widget .monaco-list .monaco-list-row .monaco-highlighted-label .highlight,.monaco-quick-open-widget .monaco-tree .monaco-tree-row .monaco-highlighted-label .highlight{color:#0066bf}.vs-dark .monaco-quick-open-widget .monaco-list .monaco-list-row .monaco-highlighted-label .highlight,.vs-dark .monaco-quick-open-widget .monaco-tree .monaco-tree-row .monaco-highlighted-label .highlight{color:#0097fb}.hc-black .monaco-quick-open-widget .monaco-list .monaco-list-row .monaco-highlighted-label .highlight,.hc-black .monaco-quick-open-widget .monaco-tree .monaco-tree-row .monaco-highlighted-label .highlight{color:#f38518}.monaco-quick-open-widget{position:absolute;width:600px;z-index:2000;padding-bottom:6px;left:50%;margin-left:-300px}.monaco-quick-open-widget .monaco-progress-container{position:absolute;left:0;top:38px;z-index:1;height:2px}.monaco-quick-open-widget .monaco-progress-container .progress-bit{height:2px}.monaco-quick-open-widget .quick-open-input{width:588px;border:none;margin:6px}.monaco-quick-open-widget .quick-open-input .monaco-inputbox{width:100%;height:25px}.monaco-quick-open-widget .quick-open-result-count{position:absolute;left:-10000px}.monaco-quick-open-widget .quick-open-tree{line-height:22px}.monaco-quick-open-widget .quick-open-tree .monaco-tree-row>.content>.sub-content{overflow:hidden}.monaco-quick-open-widget.content-changing .quick-open-tree .monaco-scrollable-element .slider{display:none}.monaco-quick-open-widget .quick-open-tree .quick-open-entry{overflow:hidden;text-overflow:ellipsis;display:flex;flex-direction:column;height:100%}.monaco-quick-open-widget .quick-open-tree .quick-open-entry>.quick-open-row{display:flex;align-items:center}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon{overflow:hidden;width:16px;height:16px;margin-right:4px;display:inline-block;vertical-align:middle;flex-shrink:0}.monaco-quick-open-widget .quick-open-tree .monaco-icon-label,.monaco-quick-open-widget .quick-open-tree .monaco-icon-label .monaco-icon-label-description-container{flex:1}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .monaco-highlighted-label span{opacity:1}.monaco-quick-open-widget .quick-open-tree .quick-open-entry-meta{opacity:.7;line-height:normal}.monaco-quick-open-widget .quick-open-tree .content.has-group-label .quick-open-entry-keybinding{margin-right:8px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry-keybinding .monaco-keybinding-key{vertical-align:text-bottom}.monaco-quick-open-widget .quick-open-tree .results-group{margin-right:18px}.monaco-quick-open-widget .quick-open-tree .focused .monaco-tree-row.focused>.content.has-actions>.results-group,.monaco-quick-open-widget .quick-open-tree .monaco-tree-row.focused>.content.has-actions>.results-group,.monaco-quick-open-widget .quick-open-tree .monaco-tree-row:hover:not(.highlighted)>.content.has-actions>.results-group{margin-right:0}.monaco-quick-open-widget .quick-open-tree .results-group-separator{border-top-width:1px;border-top-style:solid;box-sizing:border-box;margin-left:-11px;padding-left:11px}.monaco-tree .monaco-tree-row>.content.actions{position:relative;display:flex}.monaco-tree .monaco-tree-row>.content.actions>.sub-content{flex:1}.monaco-tree .monaco-tree-row>.content.actions .action-item{margin:0}.monaco-tree .monaco-tree-row>.content.actions>.primary-action-bar{line-height:22px;display:none;padding:0 .8em 0 .4em}.monaco-tree .monaco-tree-row.focused>.content.has-actions>.primary-action-bar{width:0;display:block}.monaco-tree.focused .monaco-tree-row.focused>.content.has-actions>.primary-action-bar,.monaco-tree .monaco-tree-row:hover:not(.highlighted)>.content.has-actions>.primary-action-bar,.monaco-tree .monaco-tree-row>.content.has-actions.more>.primary-action-bar{width:inherit;display:block}.monaco-tree .monaco-tree-row>.content.actions>.primary-action-bar .action-label{margin-right:.4em;margin-top:4px;background-repeat:no-repeat;width:16px;height:16px}.monaco-quick-open-widget .quick-open-tree .monaco-highlighted-label .highlight{font-weight:700}.monaco-progress-container{width:100%;height:5px;overflow:hidden}.monaco-progress-container .progress-bit{width:2%;height:5px;position:absolute;left:0;display:none}.monaco-progress-container.active .progress-bit{display:inherit}.monaco-progress-container.discrete .progress-bit{left:0;transition:width .1s linear}.monaco-progress-container.discrete.done .progress-bit{width:100%}.monaco-progress-container.infinite .progress-bit{animation-name:progress;animation-duration:4s;animation-iteration-count:infinite;animation-timing-function:linear;-ms-animation-name:progress;-ms-animation-duration:4s;-ms-animation-iteration-count:infinite;-ms-animation-timing-function:linear;-webkit-animation-name:progress;-webkit-animation-duration:4s;-webkit-animation-iteration-count:infinite;-webkit-animation-timing-function:linear;-moz-animation-name:progress;-moz-animation-duration:4s;-moz-animation-iteration-count:infinite;-moz-animation-timing-function:linear;will-change:transform}@keyframes progress{0%{transform:translateX(0) scaleX(1)}50%{transform:translateX(2500%) scaleX(3)}to{transform:translateX(4950%) scaleX(1)}}.monaco-quick-open-widget{font-size:13px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon,.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iNDAiPjxwYXRoIGQ9Ik0yODguNDgzIDMzYTYuMjA2IDYuMjA2IDAgMDEtMi4xNTMtLjM2NSA1LjEyMyA1LjEyMyAwIDAxLTEuNzYtMS4wODQgNC45MzYgNC45MzYgMCAwMS0xLjE2My0xLjcwNGMtLjI3LS42NDQtLjQwNy0xLjM3MS0uNDA3LTIuMTU4IDAtLjUxNy4wNjEtMS4wMTguMTc4LTEuNDkuMTE2LS40Ny4yOS0uOTI1LjUxNi0xLjM0OGE1LjMwNCA1LjMwNCAwIDAxMS45ODMtMi4wNzJjLjQxNi0uMjQ2Ljg4MS0uNDQgMS4zOC0uNTc2YTYuMDUyIDYuMDUyIDAgMDExLjU4Ny0uMjAyYy43MDUgMCAxLjM4Mi4xMDkgMi4wMTMuMzI0YTUuMTc3IDUuMTc3IDAgMDExLjcwOC45NTVjLjUwMS40MjUuOTAzLjk0OCAxLjE5MyAxLjU1Ni4yOTQuNjIzLjQ0MiAxLjMxNi40NDIgMi4wNjQgMCAuNjE5LS4wOSAxLjE4NS0uMjY4IDEuNjc5LS4xNzguNDkyLS40Mi45Mi0uNzIxIDEuMjc1YTMuMzU3IDMuMzU3IDAgMDEtMS4xMDQuODQ3bC0uMDQ4LjAyMnYxLjUzbC0uNTg3LjI2NmE0LjgxIDQuODEgMCAwMS0xLjExOS4zMzggOS4zNDQgOS4zNDQgMCAwMS0xLjY3LjE0M3oiIGZpbGw9IiMyRDJEMkQiLz48cGF0aCBkPSJNMjkxLjcxNiAyNC4wNDFhNC4xNzMgNC4xNzMgMCAwMC0xLjM4NC0uNzcxIDUuMTkgNS4xOSAwIDAwLTEuNjg5LS4yNzFjLS40NzMgMC0uOTEyLjA1NS0xLjMyNC4xNjctLjQxNC4xMTItLjc5MS4yNy0xLjEzNS40NzMtLjM0Mi4yMDItLjY1LjQ0Ni0uOTIyLjczM2E0LjI1OCA0LjI1OCAwIDAwLS42ODYuOTQ5IDQuOCA0LjggMCAwMC0uNDI4IDEuMTE5Yy0uMS4zOTktLjE0OC44MTQtLjE0OCAxLjI0NyAwIC42NTIuMTA5IDEuMjQ3LjMzMiAxLjc3Ni4yMTkuNTMxLjUzLjk4NC45MjggMS4zNjEuMzk2LjM3OC44NzEuNjY3IDEuNDE2Ljg3YTUuMTk3IDUuMTk3IDAgMDAxLjgwOC4zMDQgNy45OTcgNy45OTcgMCAwMDEuNDg3LS4xMjZjLjE5NS0uMDM2LjM2Ni0uMDc4LjUxNC0uMTI1bC4zNzUtLjE0di0uODU0bC0uNDYzLjE4NGE0LjIzIDQuMjMgMCAwMS0uNTIxLjE0MyA1LjkwMSA1LjkwMSAwIDAxLS42MDQuMDg5IDYuMzI1IDYuMzI1IDAgMDEtLjcuMDM0IDQuMDcxIDQuMDcxIDAgMDEtMS41MDktLjI2NCAzLjI4IDMuMjggMCAwMS0xLjEyNS0uNzMxIDMuMTQ2IDMuMTQ2IDAgMDEtLjcwOC0xLjEyNCA0LjA5OSA0LjA5OSAwIDAxLS4yNDMtMS40MzJjMC0uNTQ1LjA5LTEuMDUzLjI3My0xLjUyMmEzLjc2IDMuNzYgMCAwMS43NTgtMS4yMjUgMy41MjIgMy41MjIgMCAwMTEuMTU1LS44MTUgMy41OSAzLjU5IDAgMDExLjQ1Ny0uMjk0Yy40MTkgMCAuNzk4LjA0NCAxLjEyMi4xMzYuMzI5LjA5MS42Mi4yMTUuODcxLjM2OS4yNTQuMTU4LjQ2NS4zMzkuNjQzLjU0Ny4xNzkuMjA5LjMyNC40MzIuNDM4LjY2Ny4xMTMuMjM3LjE5My40OC4yNDYuNzMxLjA1MS4yNTQuMDc2LjUuMDc2Ljc0MSAwIC4zNDQtLjAzMy42NTMtLjEwMi45MjZhMi42MzggMi42MzggMCAwMS0uMjY5LjY5NGMtLjExLjE4OS0uMjM5LjMzNS0uMzg2LjQzNHMtLjI5NS4xNDgtLjQ1My4xNDhsLS4yMTUtLjA0NWEuMzc0LjM3NCAwIDAxLS4xNjYtLjE1Ni45MjguOTI4IDAgMDEtLjEwNy0uMzA2IDIuNjEzIDIuNjEzIDAgMDEtLjAzOS0uNDkybC4wMTgtLjMyNS4wNDEtLjUzLjA1NS0uNjQ0LjA1OC0uNjQ3LjA0OC0uNTQ2LjAyNy0uMzQ0aC0uOTE5bC0uMDU0LjZoLS4wMjFhLjc0MS43NDEgMCAwMC0uMTM2LS4yODEuOTQ1Ljk0NSAwIDAwLS4yMzMtLjIxNiAxLjE1IDEuMTUgMCAwMC0uMzA3LS4xNDEgMS4zMzMgMS4zMzMgMCAwMC0uMzY5LS4wNDhjLS4zMzcgMC0uNjQ2LjA3LS45MjQuMjE2YTIuMTkxIDIuMTkxIDAgMDAtLjcyMS41OTkgMi43OTYgMi43OTYgMCAwMC0uNDY1LjkwNWMtLjExNS4zNS0uMTcuNzI2LS4xNyAxLjEzNCAwIC4zNDQuMDQ1LjY0NS4xMzUuOTAxLjA4OC4yNi4yMTEuNDczLjM1OS42NDYuMTUzLjE3MS4zMjkuMy41MzQuMzgyYTEuNjEgMS42MSAwIDAwMS4xNC4wNDhjLjE1NC0uMDUyLjMwMi0uMTMuNDMyLS4yMzJhMS43MiAxLjcyIDAgMDAuNTg0LS45aC4wMjdjMCAuMzc2LjEwMS42NzQuMzA3Ljg5My4yMDcuMjIuNTAyLjMzLjg4OS4zMy4yOTIgMCAuNTgtLjA2NC44NjMtLjE5OC4yODMtLjEzMi41MzYtLjMyOC43NjItLjU4Ni4yMjMtLjI2Mi40MDQtLjU4My41NDMtLjk2Ni4xMzgtLjM4NC4yMDgtLjgzLjIwOC0xLjM0YTMuNzkgMy43OSAwIDAwLS4zNDUtMS42MzQgMy42NzMgMy42NzMgMCAwMC0uOTM5LTEuMjI1bS0yLjM2OCAzLjc3NGEyLjU2MSAyLjU2MSAwIDAxLS4yNDYuNzE5IDEuNDE1IDEuNDE1IDAgMDEtLjQwNy40ODEuOTcuOTcgMCAwMS0uNTcyLjE3Ni43NzMuNzczIDAgMDEtLjM0NC0uMDc4Ljg0OC44NDggMCAwMS0uMjg5LS4yMzIgMS4yNCAxLjI0IDAgMDEtLjE5OC0uMzkgMS45MzMgMS45MzMgMCAwMS0uMDctLjU0N2MwLS4yMzcuMDI3LS40ODEuMDgtLjcyOS4wNTYtLjI0Ny4xMzctLjQ3My4yNS0uNjc3LjEwOS0uMi4yNS0uMzYzLjQxNi0uNDkyYS45MzEuOTMxIDAgMDEuNTgyLS4xOTFjLjEyMyAwIC4yMzQuMDIxLjM0LjA2M2EuNzM2LjczNiAwIDAxLjI3OS4xOTYuOS45IDAgMDEuMTg5LjMzYy4wNDMuMTM0LjA3LjI5NC4wNy40OCAwIC4zMTctLjAzMS42MTUtLjA4Ljg5MSIgZmlsbD0iI0M1QzVDNSIvPjxwYXRoIGQ9Ik0yODguNDgzIDEzYTYuMjA2IDYuMjA2IDAgMDEtMi4xNTMtLjM2NSA1LjEyMyA1LjEyMyAwIDAxLTEuNzYtMS4wODQgNC45MzYgNC45MzYgMCAwMS0xLjE2My0xLjcwNGMtLjI2OS0uNjQ0LS40MDctMS4zNzEtLjQwNy0yLjE1OSAwLS41MTcuMDYxLTEuMDE4LjE3OC0xLjQ5LjExNi0uNDcuMjktLjkyNS41MTYtMS4zNDhhNS4zMDQgNS4zMDQgMCAwMTEuOTgzLTIuMDcyYy40MTYtLjI0Ni44ODEtLjQ0IDEuMzgtLjU3NkE2LjAzOSA2LjAzOSAwIDAxMjg4LjY0MyAyYy43MDUgMCAxLjM4Mi4xMDkgMi4wMTMuMzI0YTUuMTc3IDUuMTc3IDAgMDExLjcwOC45NTVjLjUwMS40MjUuOTAzLjk0OCAxLjE5MyAxLjU1Ni4yOTUuNjI0LjQ0MyAxLjMxNy40NDMgMi4wNjUgMCAuNjE5LS4wOSAxLjE4NS0uMjY4IDEuNjc5LS4xNzguNDkyLS40Mi45Mi0uNzIxIDEuMjc1YTMuMzU3IDMuMzU3IDAgMDEtMS4xMDQuODQ3bC0uMDQ4LjAyMnYxLjUzbC0uNTg3LjI2NmE0LjgxIDQuODEgMCAwMS0xLjExOS4zMzggOS4zNDQgOS4zNDQgMCAwMS0xLjY3LjE0M3oiIGZpbGw9IiNGM0YzRjMiLz48cGF0aCBkPSJNMjkxLjcxNiA0LjA0MWE0LjE3MyA0LjE3MyAwIDAwLTEuMzg0LS43NzEgNS4yMTcgNS4yMTcgMCAwMC0xLjY4OS0uMjdjLS40NzMgMC0uOTEyLjA1NS0xLjMyNC4xNjctLjQxNC4xMTItLjc5MS4yNy0xLjEzNS40NzMtLjM0Mi4yMDItLjY1LjQ0Ni0uOTIyLjczM2E0LjI1OCA0LjI1OCAwIDAwLS42ODYuOTQ5IDQuOCA0LjggMCAwMC0uNDI4IDEuMTE5Yy0uMDk5LjQtLjE0OC44MTUtLjE0OCAxLjI0NyAwIC42NTIuMTA5IDEuMjQ3LjMzMiAxLjc3Ni4yMTkuNTMxLjUzLjk4NC45MjggMS4zNjEuMzk2LjM3OC44NzEuNjY3IDEuNDE2Ljg3YTUuMTk3IDUuMTk3IDAgMDAxLjgwOC4zMDQgNy45OTcgNy45OTcgMCAwMDEuNDg3LS4xMjZjLjE5NS0uMDM2LjM2Ni0uMDc4LjUxNC0uMTI1bC4zNzUtLjE0di0uODU0bC0uNDYzLjE4NGE0LjIzIDQuMjMgMCAwMS0uNTIxLjE0MyA1LjkwMSA1LjkwMSAwIDAxLS42MDQuMDg5IDYuMzI1IDYuMzI1IDAgMDEtLjcuMDM0IDQuMDcxIDQuMDcxIDAgMDEtMS41MDktLjI2NCAzLjI4IDMuMjggMCAwMS0xLjEyNS0uNzMxIDMuMTQ2IDMuMTQ2IDAgMDEtLjcwOC0xLjEyNCA0LjA5OSA0LjA5OSAwIDAxLS4yNDMtMS40MzJjMC0uNTQ1LjA5LTEuMDUzLjI3My0xLjUyMmEzLjc2IDMuNzYgMCAwMS43NTgtMS4yMjUgMy41MjIgMy41MjIgMCAwMTEuMTU1LS44MTUgMy41OSAzLjU5IDAgMDExLjQ1Ny0uMjk0Yy40MTkgMCAuNzk4LjA0NCAxLjEyMi4xMzYuMzI5LjA5MS42Mi4yMTUuODcxLjM2OS4yNTQuMTU4LjQ2NS4zMzkuNjQzLjU0Ny4xNzkuMjA5LjMyNC40MzIuNDM4LjY2Ny4xMTMuMjM3LjE5My40OC4yNDYuNzMxLjA1MS4yNTQuMDc2LjUuMDc2Ljc0MSAwIC4zNDQtLjAzMy42NTMtLjEwMi45MjZhMi42MzggMi42MzggMCAwMS0uMjY5LjY5NGMtLjExLjE4OS0uMjM5LjMzNS0uMzg2LjQzNHMtLjI5NS4xNDgtLjQ1My4xNDhsLS4yMTUtLjA0NWEuMzc0LjM3NCAwIDAxLS4xNjYtLjE1Ni45MjguOTI4IDAgMDEtLjEwNy0uMzA2IDIuNjEzIDIuNjEzIDAgMDEtLjAzOS0uNDkybC4wMTgtLjMyNS4wNDEtLjUzLjA1NS0uNjQ0LjA1OC0uNjQ3LjA0OC0uNTQ2LjAyNy0uMzQ0aC0uOTE5bC0uMDU0LjZoLS4wMjFhLjc0MS43NDEgMCAwMC0uMTM2LS4yODEuOTQ1Ljk0NSAwIDAwLS4yMzMtLjIxNiAxLjE1IDEuMTUgMCAwMC0uMzA3LS4xNDEgMS4zMzMgMS4zMzMgMCAwMC0uMzY5LS4wNDhjLS4zMzcgMC0uNjQ2LjA3LS45MjQuMjE2YTIuMTkxIDIuMTkxIDAgMDAtLjcyMS41OTkgMi43OTYgMi43OTYgMCAwMC0uNDY1LjkwNWMtLjExNS4zNS0uMTcuNzI2LS4xNyAxLjEzNCAwIC4zNDQuMDQ1LjY0NS4xMzUuOTAxLjA4OC4yNi4yMTEuNDczLjM1OS42NDYuMTUzLjE3MS4zMjkuMy41MzQuMzgyYTEuNjEgMS42MSAwIDAwMS4xNC4wNDhjLjE1NC0uMDUyLjMwMi0uMTMuNDMyLS4yMzJhMS43MiAxLjcyIDAgMDAuNTg0LS45aC4wMjdjMCAuMzc2LjEwMS42NzQuMzA3Ljg5My4yMDcuMjIuNTAyLjMzLjg4OS4zMy4yOTIgMCAuNTgtLjA2NC44NjMtLjE5OC4yODMtLjEzMi41MzYtLjMyOC43NjItLjU4Ni4yMjMtLjI2Mi40MDQtLjU4My41NDMtLjk2Ni4xMzgtLjM4NS4yMDgtLjgzMS4yMDgtMS4zNDFhMy43OSAzLjc5IDAgMDAtLjM0NS0xLjYzNCAzLjY3MyAzLjY3MyAwIDAwLS45MzktMS4yMjVtLTIuMzY4IDMuNzc0YTIuNTYxIDIuNTYxIDAgMDEtLjI0Ni43MTkgMS40MTUgMS40MTUgMCAwMS0uNDA3LjQ4MS45Ny45NyAwIDAxLS41NzIuMTc2Ljc3My43NzMgMCAwMS0uMzQ0LS4wNzguODQ4Ljg0OCAwIDAxLS4yODktLjIzMiAxLjI0IDEuMjQgMCAwMS0uMTk4LS4zOSAxLjkzMyAxLjkzMyAwIDAxLS4wNy0uNTQ3YzAtLjIzNy4wMjctLjQ4MS4wOC0uNzI5LjA1Ni0uMjQ3LjEzNy0uNDczLjI1LS42NzcuMTA5LS4yLjI1LS4zNjMuNDE2LS40OTJhLjkzMS45MzEgMCAwMS41ODItLjE5MWMuMTIzIDAgLjIzNC4wMjEuMzQuMDYzYS43MzYuNzM2IDAgMDEuMjc5LjE5Ni45LjkgMCAwMS4xODkuMzNjLjA0My4xMzQuMDcuMjk0LjA3LjQ4IDAgLjMxNy0uMDMxLjYxNS0uMDguODkxIiBmaWxsPSIjNDI0MjQyIi8+PHBhdGggZD0iTTI2NCAzN1YyM2g4LjYyNUwyNzYgMjYuNTU2VjM3aC0xMnoiIGZpbGw9IiMyRDJEMkQiLz48cGF0aCBkPSJNMjcyIDI0aC03djEyaDEwdi05bC0zLTN6bTIgMTFoLThWMjVoNXYzaDN2N3oiIGZpbGw9IiNDNUM1QzUiLz48cGF0aCBmaWxsPSIjMkQyRDJEIiBkPSJNMjY2IDI1aDV2M2gzdjdoLTh6Ii8+PHBhdGggZD0iTTI2NCAxN1YzaDguNjI1TDI3NiA2LjU1NlYxN2gtMTJ6IiBmaWxsPSIjRjNGM0YzIi8+PHBhdGggZD0iTTI3MiA0aC03djEyaDEwVjdsLTMtM3ptMiAxMWgtOFY1aDV2M2gzdjd6IiBmaWxsPSIjNDI0MjQyIi8+PHBhdGggZmlsbD0iI0YwRUZGMSIgZD0iTTI2NiA1aDV2M2gzdjdoLTh6Ii8+PHBhdGggZmlsbD0iIzJEMkQyRCIgZD0iTTI0NyAzNHYtNGgtMnYtNGgxMHY4eiIvPjxwYXRoIGQ9Ik0yNTQgMjloLTh2LTJoOHYyem0wIDFoLTZ2MWg2di0xem0wIDJoLTZ2MWg2di0xeiIgZmlsbD0iI0M1QzVDNSIvPjxwYXRoIGZpbGw9IiNGM0YzRjMiIGQ9Ik0yNDcgMTR2LTRoLTJWNmgxMHY4eiIvPjxwYXRoIGQ9Ik0yNTQgOWgtOFY3aDh2MnptMCAxaC02djFoNnYtMXptMCAyaC02djFoNnYtMXoiIGZpbGw9IiM0MjQyNDIiLz48cGF0aCBkPSJNMjMwLjUgMjJjLTQuMTQzIDAtNy41IDMuMzU3LTcuNSA3LjVzMy4zNTcgNy41IDcuNSA3LjUgNy41LTMuMzU3IDcuNS03LjUtMy4zNTctNy41LTcuNS03LjV6bTAgMTFhMy41IDMuNSAwIDExMC03IDMuNSAzLjUgMCAxMTAgN3oiIGZpbGw9IiMyRDJEMkQiLz48cGF0aCBkPSJNMjI0LjAyNSAyOWE2LjQ2NCA2LjQ2NCAwIDAxMS41NDItMy43MjZsMS40MzEgMS40MzFhNC40NDMgNC40NDMgMCAwMC0uOTQ3IDIuMjk1aC0yLjAyNnptMi45NzMgMy4yOTVhNC40NDMgNC40NDMgMCAwMS0uOTQ3LTIuMjk1aC0yLjAyNWE2LjQ2NyA2LjQ2NyAwIDAwMS41NDIgMy43MjZsMS40My0xLjQzMXptNC4wMDItOS4yN3YyLjAyNWE0LjQ2IDQuNDYgMCAwMTIuMjk1Ljk0N2wxLjQzMS0xLjQzMUE2LjQ3NiA2LjQ3NiAwIDAwMjMxIDIzLjAyNXptLTMuMjk1IDIuOTczYTQuNDQzIDQuNDQzIDAgMDEyLjI5NS0uOTQ3di0yLjAyNWE2LjQ2NCA2LjQ2NCAwIDAwLTMuNzI2IDEuNTQybDEuNDMxIDEuNDN6bTYuMjk3LjcwN2MuNTE2LjY0Ni44NTEgMS40My45NDcgMi4yOTVoMi4wMjVhNi40NjQgNi40NjQgMCAwMC0xLjU0Mi0zLjcyNmwtMS40MyAxLjQzMXpNMjMwIDMzLjk0OWE0LjQ2IDQuNDYgMCAwMS0yLjI5NS0uOTQ3bC0xLjQzMSAxLjQzMUE2LjQ2MSA2LjQ2MSAwIDAwMjMwIDM1Ljk3NXYtMi4wMjZ6TTIzNC45NDkgMzBhNC40NjMgNC40NjMgMCAwMS0uOTQ3IDIuMjk1bDEuNDMxIDEuNDMxQTYuNDY3IDYuNDY3IDAgMDAyMzYuOTc1IDMwaC0yLjAyNnptLTEuNjU0IDMuMDAyYTQuNDQzIDQuNDQzIDAgMDEtMi4yOTUuOTQ3djIuMDI1YTYuNDYxIDYuNDYxIDAgMDAzLjcyNi0xLjU0MmwtMS40MzEtMS40M3oiIGZpbGw9IiNDNUM1QzUiLz48cGF0aCBkPSJNMjMwLjUgMmE3LjUgNy41IDAgMDAtNy41IDcuNWMwIDQuMTQzIDMuMzU3IDcuNSA3LjUgNy41czcuNS0zLjM1NyA3LjUtNy41YTcuNSA3LjUgMCAwMC03LjUtNy41em0wIDExYTMuNSAzLjUgMCAxMS0uMDAxLTYuOTk5QTMuNSAzLjUgMCAwMTIzMC41IDEzeiIgZmlsbD0iI0YzRjNGMyIvPjxwYXRoIGQ9Ik0yMjQuMDI1IDlhNi40NjQgNi40NjQgMCAwMTEuNTQyLTMuNzI2bDEuNDMxIDEuNDMxYTQuNDQzIDQuNDQzIDAgMDAtLjk0NyAyLjI5NGgtMi4wMjZ6bTIuOTczIDMuMjk1YTQuNDQzIDQuNDQzIDAgMDEtLjk0Ny0yLjI5NWgtMi4wMjVhNi40NjcgNi40NjcgMCAwMDEuNTQyIDMuNzI2bDEuNDMtMS40MzF6TTIzMSAzLjAyNVY1LjA1YTQuNDUyIDQuNDUyIDAgMDEyLjI5NS45NDhsMS40MzEtMS40MzFBNi40NyA2LjQ3IDAgMDAyMzEgMy4wMjV6bS0zLjI5NSAyLjk3NEE0LjQ1MiA0LjQ1MiAwIDAxMjMwIDUuMDUxVjMuMDI1YTYuNDY0IDYuNDY0IDAgMDAtMy43MjYgMS41NDJsMS40MzEgMS40MzJ6bTYuMjk3LjcwN2MuNTE2LjY0Ni44NTEgMS40My45NDcgMi4yOTRoMi4wMjVhNi40NjQgNi40NjQgMCAwMC0xLjU0Mi0zLjcyNmwtMS40MyAxLjQzMnpNMjMwIDEzLjk0OWE0LjQ2IDQuNDYgMCAwMS0yLjI5NS0uOTQ3bC0xLjQzMSAxLjQzMUE2LjQ2MSA2LjQ2MSAwIDAwMjMwIDE1Ljk3NXYtMi4wMjZ6TTIzNC45NDkgMTBhNC40NjMgNC40NjMgMCAwMS0uOTQ3IDIuMjk1bDEuNDMxIDEuNDMxQTYuNDY3IDYuNDY3IDAgMDAyMzYuOTc1IDEwaC0yLjAyNnptLTEuNjU0IDMuMDAyYTQuNDQzIDQuNDQzIDAgMDEtMi4yOTUuOTQ3djIuMDI1YTYuNDYxIDYuNDYxIDAgMDAzLjcyNi0xLjU0MmwtMS40MzEtMS40M3oiIGZpbGw9IiM0MjQyNDIiLz48cGF0aCBmaWxsPSIjMkQyRDJEIiBkPSJNMjAyIDIzaDE2djE0aC0xNnoiLz48cGF0aCBkPSJNMjAzIDI0djEyaDE0VjI0aC0xNHptMTMgMTFoLTEyVjI1aDEydjEwem0tNi03di0xaC0xdjVoM3YtNGgtMnptMSAzaC0xdi0yaDF2MnptMy0ydjJoMXYxaC0ydi00aDJ2MWgtMXptLTYtMXY0aC0zdi0yaDF2MWgxdi0xaC0xdi0xaC0xdi0xaDN6IiBmaWxsPSIjQzVDNUM1Ii8+PHBhdGggZD0iTTIxMCAyOWgxdjJoLTF2LTJ6bS0zIDJ2LTFoLTF2MWgxem05LTZ2MTBoLTEyVjI1aDEyem0tOCAzaC0zdjFoMXYxaC0xdjJoM3YtNHptNCAwaC0ydi0xaC0xdjVoM3YtNHptMyAwaC0ydjRoMnYtMWgtMXYtMmgxdi0xeiIgZmlsbD0iIzJEMkQyRCIvPjxwYXRoIGZpbGw9IiNGM0YzRjMiIGQ9Ik0yMDIgM2gxNnYxNGgtMTZ6Ii8+PHBhdGggZD0iTTIwMyA0djEyaDE0VjRoLTE0em0xMyAxMWgtMTJWNWgxMnYxMHptLTYtN1Y3aC0xdjVoM1Y4aC0yem0xIDNoLTFWOWgxdjJ6bTMtMnYyaDF2MWgtMlY4aDJ2MWgtMXptLTYtMXY0aC0zdi0yaDF2MWgxdi0xaC0xVjloLTFWOGgzeiIgZmlsbD0iIzQyNDI0MiIvPjxwYXRoIGQ9Ik0yMTAgOWgxdjJoLTFWOXptLTMgMnYtMWgtMXYxaDF6bTktNnYxMGgtMTJWNWgxMnptLTggM2gtM3YxaDF2MWgtMXYyaDNWOHptNCAwaC0yVjdoLTF2NWgzVjh6bTMgMGgtMnY0aDJ2LTFoLTFWOWgxVjh6IiBmaWxsPSIjRjBFRkYxIi8+PHBhdGggZD0iTTE5Ni42NTIgMzIuNUEyLjk5NyAyLjk5NyAwIDAwMTk1IDI3Yy0uNzcxIDAtMS40NjguMzAxLTIgLjc3OVYyMmgtMTF2MTJoMy43NjRsLTEuNDUyLjcyNyAxLjQ4MSAxLjQ4Yy4zMjIuMzIyLjgwMy41IDEuMzU0LjUuNDM2IDAgLjg5Ny0uMTExIDEuMzAxLS4zMTNsMy4xNDQtMS41NzJjLjEzNC4wNTMuMjcxLjA5OC40MTQuMTI3bC0uMDA1LjA1MWMwIDEuNjU0IDEuMzQ2IDMgMyAzczMtMS4zNDYgMy0zYTMgMyAwIDAwLTEuMzQ5LTIuNXoiIGZpbGw9IiMyRDJEMkQiLz48cGF0aCBkPSJNMTk1IDMzYy0uMjkzIDAtLjU2OS4wNjYtLjgyLjE4bC0uMjUtLjI1Yy4wNDItLjEzNy4wNy0uMjc5LjA3LS40M3MtLjAyOC0uMjkzLS4wNy0uNDNsLjI1LS4yNWMuMjUxLjExMy41MjcuMTguODIuMThhMiAyIDAgMTAtMi0yYzAgLjI5My4wNjYuNTY4LjE4LjgybC0uMjUuMjVhMS40MjQgMS40MjQgMCAwMC0uNDMtLjA3Yy0uMzM3IDAtLjY0NS4xMTUtLjg5NS4zMDNsLTIuNjA3LTEuMzA1LS45OTktLjVjLS41NTItLjI3NS0xLjIyMy0uMjc1LTEuNDk5LjAwMmwtLjUuNSA1IDIuNS01IDIuNS41LjVjLjI3Ni4yNzUuOTQ3LjI3NSAxLjUgMGwxLS41IDIuNjA1LTEuMzAzYy4yNS4xODguNTU4LjMwMy44OTUuMzAzLjE1IDAgLjI5My0uMDI5LjQzLS4wN2wuMjUuMjVhMS45NyAxLjk3IDAgMDAtLjE4LjgyIDIgMiAwIDEwMi0yem0wLTRhMSAxIDAgMTEuMDAyIDEuOTk4QTEgMSAwIDAxMTk1IDI5em0tMi41IDRhLjUuNSAwIDExLjAwMi0xLjAwMkEuNS41IDAgMDExOTIuNSAzM3ptMi41IDNhMSAxIDAgMTEwLTIgMSAxIDAgMDEwIDJ6bS0zLTEzdjcuMDUxYy0uMTQyLjAyOS0uMjc5LjA3LS40MTMuMTIzTDE5MSAzMHYtNmgtN3Y3aC0xdi04aDl6bS04IDEwaC0xdi0xaDF2MXptMi0xaC0xdjFoMXYtMXptMiAwaC0xdjFoMXYtMXoiIGZpbGw9IiNDNUM1QzUiLz48cGF0aCBkPSJNMTg1Ljc5MyAyOC43OTNMMTg0IDMwdi02aDd2NS4zODFsLTIuNTU0LS43NzdjLS44MTYtLjQwOS0xLjk5LS40NzUtMi42NTMuMTg5ek0xODUgMzFoLjc2NGwtLjc2NC0uMzgzVjMxem0xMSA0YTEgMSAwIDExLTIgMCAxIDEgMCAwMTIgMHptLTMuNS0zYS41LjUgMCAxMDAgMSAuNS41IDAgMDAwLTF6bTIuNS0zYTEgMSAwIDEwLS4wMDIgMS45OThBMSAxIDAgMDAxOTUgMjl6IiBmaWxsPSIjMkQyRDJEIi8+PHBhdGggZD0iTTE5Ni42NTIgMTIuNUEzIDMgMCAwMDE5OCAxMGMwLTEuNjU0LTEuMzQ2LTMtMy0zLS43NzEgMC0xLjQ2OC4zMDEtMiAuNzc5VjJoLTExdjEyaDMuNzY0bC0xLjQ1Mi43MjcgMS40ODEgMS40OGMuMzIyLjMyMi44MDMuNSAxLjM1NC41LjQzNiAwIC44OTctLjExMSAxLjMwMS0uMzEzbDMuMTQ0LTEuNTcyYy4xMzQuMDUzLjI3MS4wOTguNDE0LjEyN2wtLjAwNS4wNTFjMCAxLjY1NCAxLjM0NiAzIDMgM3MzLTEuMzQ2IDMtM2EzIDMgMCAwMC0xLjM0OS0yLjV6IiBmaWxsPSIjRjNGM0YzIi8+PHBhdGggZD0iTTE5NSAxM2MtLjI5MyAwLS41NjkuMDY2LS44Mi4xOGwtLjI1LS4yNWMuMDQyLS4xMzcuMDctLjI3OS4wNy0uNDNzLS4wMjgtLjI5My0uMDctLjQzbC4yNS0uMjVjLjI1MS4xMTMuNTI3LjE4LjgyLjE4YTIgMiAwIDEwLTItMmMwIC4yOTMuMDY2LjU2OC4xOC44MmwtLjI1LjI1YTEuNDI0IDEuNDI0IDAgMDAtLjQzLS4wN2MtLjMzNyAwLS42NDUuMTE1LS44OTUuMzAzbC0yLjYwNy0xLjMwNC0uOTk5LS41Yy0uNTUyLS4yNzUtMS4yMjMtLjI3NS0xLjQ5OS4wMDJMMTg2IDEwbDUgMi41LTUgMi41LjUuNWMuMjc2LjI3NS45NDcuMjc1IDEuNSAwbDEtLjUgMi42MDUtMS4zMDNjLjI1LjE4OC41NTguMzAzLjg5NS4zMDMuMTUgMCAuMjkzLS4wMjkuNDMtLjA3bC4yNS4yNWMtLjExMy4yNS0uMTguNTI3LS4xOC44MmEyIDIgMCAxMDItMnptMC00YTEgMSAwIDExLjAwMiAxLjk5OEExIDEgMCAwMTE5NSA5em0tMi41IDRhLjUuNSAwIDExLjAwMi0xLjAwMkEuNS41IDAgMDExOTIuNSAxM3ptMi41IDNhMSAxIDAgMTEwLTIgMSAxIDAgMDEwIDJ6bS0zLTEzdjcuMDUxYy0uMTQyLjAyOS0uMjc5LjA3LS40MTMuMTIzTDE5MSAxMFY0aC03djdoLTFWM2g5em0tOCAxMGgtMXYtMWgxdjF6bTItMWgtMXYxaDF2LTF6bTIgMGgtMXYxaDF2LTF6IiBmaWxsPSIjNDI0MjQyIi8+PHBhdGggZD0iTTE4NS43OTMgOC43OTNMMTg0IDEwVjRoN3Y1LjM4MWwtMi41NTQtLjc3N2MtLjgxNi0uNDA5LTEuOTktLjQ3NS0yLjY1My4xODl6TTE4NSAxMWguNzY0bC0uNzY0LS4zODNWMTF6bTExIDRhMSAxIDAgMTEtMiAwIDEgMSAwIDAxMiAwem0tMy41LTNhLjUuNSAwIDEwMCAxIC41LjUgMCAwMDAtMXptMi41LTNhMSAxIDAgMTAtLjAwMiAxLjk5OEExIDEgMCAwMDE5NSA5eiIgZmlsbD0iI0YwRUZGMSIvPjxwYXRoIGQ9Ik0xNzggMjd2LTNoLTd2LTFoLTl2MTRoMTN2LTNoM3YtM2gtMXYtM2gtNnYtMWg3em0tOCA3di0zaDF2M2gtMXoiIGZpbGw9IiMyRDJEMkQiLz48cGF0aCBkPSJNMTc3IDI2aC01di0xaDV2MXptLTEgM2gtMnYxaDJ2LTF6bS00IDBoLTl2MWg5di0xem0yIDZoLTExdjFoMTF2LTF6bS01LTNoLTZ2MWg2di0xem04IDBoLTV2MWg1di0xem0tNy04djNoLTd2LTNoN3ptLTEgMWgtNXYxaDV2LTF6IiBmaWxsPSIjQzVDNUM1Ii8+PHBhdGggZmlsbD0iIzJEMkQyRCIgZD0iTTE2NCAyNWg1djFoLTV6Ii8+PHBhdGggZD0iTTE3OCA3VjRoLTdWM2gtOXYxNGgxM3YtM2gzdi0zaC0xVjhoLTZWN2g3em0tOCA3di0zaDF2M2gtMXoiIGZpbGw9IiNGM0YzRjMiLz48cGF0aCBkPSJNMTc3IDZoLTVWNWg1djF6bS0xIDNoLTJ2MWgyVjl6bS00IDBoLTl2MWg5Vjl6bTIgNmgtMTF2MWgxMXYtMXptLTUtM2gtNnYxaDZ2LTF6bTggMGgtNXYxaDV2LTF6bS03LTh2M2gtN1Y0aDd6bS0xIDFoLTV2MWg1VjV6IiBmaWxsPSIjNDI0MjQyIi8+PHBhdGggZmlsbD0iI0YwRUZGMSIgZD0iTTE2NCA1aDV2MWgtNXoiLz48cGF0aCBmaWxsPSIjMkQyRDJEIiBkPSJNMTU0LjQxNCAyNGgtNC44MjhMMTQ4IDI1LjU4NlYyOGgtNHY3aDh2LTRoMi40MTRMMTU2IDI5LjQxNHYtMy44Mjh6Ii8+PHBhdGggZD0iTTE1NCAyNWgtNGwtMSAxdjJoNXYxaC0ydjFoMmwxLTF2LTNsLTEtMXptMCAyaC00di0xaDR2MXptLTkgN2g2di01aC02djV6bTEtM2g0djFoLTR2LTF6IiBmaWxsPSIjNzVCRUZGIi8+PGcgZmlsbD0iIzJEMkQyRCI+PHBhdGggZD0iTTE0NiAzMWg0djFoLTR6TTE1MCAyNmg0djFoLTR6TTE1MiAyOGgydjFoLTJ6Ii8+PC9nPjxwYXRoIGZpbGw9IiNGM0YzRjMiIGQ9Ik0xNTQuNDE0IDRoLTQuODI4TDE0OCA1LjU4NlY4aC00djdoOHYtNGgyLjQxNEwxNTYgOS40MTRWNS41ODZ6Ii8+PHBhdGggZD0iTTE1NCA1aC00bC0xIDF2Mmg1djFoLTJ2MWgybDEtMVY2bC0xLTF6bTAgMmgtNFY2aDR2MXptLTkgN2g2VjloLTZ2NXptMS0zaDR2MWgtNHYtMXoiIGZpbGw9IiMwMDUzOUMiLz48ZyBmaWxsPSIjRjBFRkYxIj48cGF0aCBkPSJNMTQ2IDExaDR2MWgtNHpNMTUwIDZoNHYxaC00ek0xNTIgOGgydjFoLTJ6Ii8+PC9nPjxwYXRoIGQ9Ik0xMzggMjRoLTE1djRoLTF2OGg4di02aDh2LTZ6bS0xMSA5aC0ydi0yaDJ2MnoiIGZpbGw9IiMyRDJEMkQiLz48cGF0aCBkPSJNMTM3IDI5aC03di0xaC02di0zaDF2Mmgxdi0yaDF2Mmgxdi0yaDF2Mmgxdi0yaDF2Mmgxdi0yaDF2Mmgxdi0yaDF2Mmgxdi0yaDF2NHptLTEyIDF2LTFoLTJ2Nmgydi0xaC0xdi00aDF6bTIgNHYxaDJ2LTZoLTJ2MWgxdjRoLTF6IiBmaWxsPSIjQzVDNUM1Ii8+PHBhdGggZD0iTTEyNSAyN3YtMmgxdjJoLTF6bTMgMHYtMmgtMXYyaDF6bTIgMHYtMmgtMXYyaDF6bTIgMHYtMmgtMXYyaDF6bTIgMHYtMmgtMXYyaDF6bTIgMHYtMmgtMXYyaDF6IiBmaWxsPSIjMkQyRDJEIi8+PHBhdGggZD0iTTEzOCA0aC0xNXY0aC0xdjhoOHYtNmg4VjR6bS0xMSA5aC0ydi0yaDJ2MnoiIGZpbGw9IiNGM0YzRjMiLz48cGF0aCBkPSJNMTM3IDloLTdWOGgtNlY1aDF2MmgxVjVoMXYyaDFWNWgxdjJoMVY1aDF2MmgxVjVoMXYyaDFWNWgxdjJoMVY1aDF2NHptLTEyIDFWOWgtMnY2aDJ2LTFoLTF2LTRoMXptMiA0djFoMlY5aC0ydjFoMXY0aC0xeiIgZmlsbD0iIzQyNDI0MiIvPjxwYXRoIGQ9Ik0xMjUgN1Y1aDF2MmgtMXptMyAwVjVoLTF2Mmgxem0yIDBWNWgtMXYyaDF6bTIgMFY1aC0xdjJoMXptMiAwVjVoLTF2Mmgxem0yIDBWNWgtMXYyaDF6IiBmaWxsPSIjRjBFRkYxIi8+PHBhdGggZD0iTTExMC40NDkgMjNjLTEuNjM3IDAtMy4wNzUuNzk3LTMuOTg3IDIuMDEybC4wMDEuMDAyQTQuOTUzIDQuOTUzIDAgMDAxMDUuNDQ5IDI4YzAgLjQ2OS4wNjcuOTMzLjIgMS4zODVsLTIuOTA3IDIuOTA4Yy0uNjg3LjY4Ni0xLjI1MyAyLjE2MSAwIDMuNDE0LjYwOS42MDkgMS4yNDQuNzM2IDEuNjcuNzM2Ljk1OCAwIDEuNjIxLS42MTMgMS43NDQtLjczNmwyLjkwNy0yLjkwOGMuNDUzLjEzMy45MTcuMjAxIDEuMzg2LjIwMWE0Ljk1NyA0Ljk1NyAwIDAwMi45ODUtMS4wMTRsLjAwMi4wMDFjMS4yMTYtLjkxMiAyLjAxMy0yLjM1MiAyLjAxMy0zLjk4N2E1IDUgMCAwMC01LTV6IiBmaWxsPSIjMkQyRDJEIi8+PHBhdGggZD0iTTExNC4wOSAyNi4zNTlMMTExLjQ0OSAyOWwtMi0yIDIuNjQxLTIuNjQxYTMuOTY4IDMuOTY4IDAgMDAtMS42NDEtLjM1OSA0IDQgMCAwMC00IDRjMCAuNTg2LjEzMyAxLjEzOS4zNTkgMS42NEwxMDMuNDQ5IDMzcy0xIDEgMCAyaDJsMy4zNTktMy4zNmMuNTAyLjIyNyAxLjA1NS4zNiAxLjY0MS4zNmE0IDQgMCAwMDQtNGMwLS41ODYtLjEzMy0xLjEzOS0uMzU5LTEuNjQxeiIgZmlsbD0iI0M1QzVDNSIvPjxwYXRoIGQ9Ik0xMTAuNDQ5IDNjLTEuNjM3IDAtMy4wNzUuNzk3LTMuOTg3IDIuMDEybC4wMDEuMDAyQTQuOTUzIDQuOTUzIDAgMDAxMDUuNDQ5IDhjMCAuNDY5LjA2Ny45MzMuMiAxLjM4NWwtMi45MDcgMi45MDhjLS42ODcuNjg2LTEuMjUzIDIuMTYxIDAgMy40MTQuNjA5LjYwOSAxLjI0NC43MzYgMS42Ny43MzYuOTU4IDAgMS42MjEtLjYxMyAxLjc0NC0uNzM2bDIuOTA3LTIuOTA4Yy40NTMuMTMzLjkxNy4yMDEgMS4zODYuMjAxYTQuOTU3IDQuOTU3IDAgMDAyLjk4NS0xLjAxNGwuMDAyLjAwMWMxLjIxNi0uOTEyIDIuMDEzLTIuMzUyIDIuMDEzLTMuOTg3YTUgNSAwIDAwLTUtNXoiIGZpbGw9IiNGM0YzRjMiLz48cGF0aCBkPSJNMTE0LjA5IDYuMzU5TDExMS40NDkgOWwtMi0yIDIuNjQxLTIuNjQxQTMuOTg0IDMuOTg0IDAgMDAxMTAuNDQ5IDRhNCA0IDAgMDAtNCA0YzAgLjU4Ni4xMzMgMS4xMzkuMzU5IDEuNjRMMTAzLjQ0OSAxM3MtMSAxIDAgMmgybDMuMzU5LTMuMzZjLjUwMi4yMjcgMS4wNTUuMzYgMS42NDEuMzZhNCA0IDAgMDA0LTRjMC0uNTg2LS4xMzMtMS4xMzktLjM1OS0xLjY0MXoiIGZpbGw9IiM0MjQyNDIiLz48cGF0aCBkPSJNODkgMzNoMXYtMWMwLS41MzcuNzQxLTEuNjEzIDEtMi0uMjU5LS4zODktMS0xLjQ2Ny0xLTJ2LTFoLTF2LTNoMWMxLjk2OS4wMjEgMyAxLjI3NyAzIDN2MWwxIDF2MmwtMSAxdjFjMCAxLjcwOS0xLjAzMSAyLjk3OS0zIDNoLTF2LTN6bS0yIDBoLTF2LTFjMC0uNTM3LS43NDEtMS42MTMtMS0yIC4yNTktLjM4OSAxLTEuNDY3IDEtMnYtMWgxdi0zaC0xYy0xLjk2OS4wMjEtMyAxLjI3Ny0zIDN2MWwtMSAxdjJsMSAxdjFjMCAxLjcwOSAxLjMxNyAyLjk3OSAzLjI4NiAzSDg3di0zeiIgZmlsbD0iIzJEMkQyRCIvPjxwYXRoIGQ9Ik05MSAzM3YtMWMwLS44MzQuNDk2LTEuNzM4IDEtMi0uNTA0LS4yNy0xLTEuMTY4LTEtMnYtMWMwLS44NC0uNTg0LTEtMS0xdi0xYzIuMDgzIDAgMiAxLjE2NiAyIDJ2MWMwIC45NjkuNzAzLjk4IDEgMXYyYy0uMzIyLjAyLTEgLjA1My0xIDF2MWMwIC44MzQuMDgzIDItMiAydi0xYy44MzMgMCAxLTEgMS0xem0tNiAwdi0xYzAtLjgzNC0uNDk2LTEuNzM4LTEtMiAuNTA0LS4yNyAxLTEuMTY4IDEtMnYtMWMwLS44NC41ODQtMSAxLTF2LTFjLTIuMDgzIDAtMiAxLjE2Ni0yIDJ2MWMwIC45NjktLjcwMy45OC0xIDF2MmMuMzIyLjAyIDEgLjA1MyAxIDF2MWMwIC44MzQtLjA4MyAyIDIgMnYtMWMtLjgzMyAwLTEtMS0xLTF6IiBmaWxsPSIjQzVDNUM1Ii8+PHBhdGggZD0iTTg5IDEzaDF2LTFjMC0uNTM3Ljc0MS0xLjYxMyAxLTItLjI1OS0uMzg5LTEtMS40NjctMS0yVjdoLTFWNGgxYzEuOTY5LjAyMSAzIDEuMjc3IDMgM3YxbDEgMXYybC0xIDF2MWMwIDEuNzA5LTEuMDMxIDIuOTc5LTMgM2gtMXYtM3ptLTIgMGgtMXYtMWMwLS41MzctLjc0MS0xLjYxMy0xLTIgLjI1OS0uMzg5IDEtMS40NjcgMS0yVjdoMVY0aC0xYy0xLjk2OS4wMjEtMyAxLjI3Ny0zIDN2MWwtMSAxdjJsMSAxdjFjMCAxLjcwOSAxLjMxNyAyLjk3OSAzLjI4NiAzSDg3di0zeiIgZmlsbD0iI0YzRjNGMyIvPjxwYXRoIGQ9Ik05MSAxM3YtMWMwLS44MzQuNDk2LTEuNzM4IDEtMi0uNTA0LS4yNy0xLTEuMTY4LTEtMlY3YzAtLjg0LS41ODQtMS0xLTFWNWMyLjA4MyAwIDIgMS4xNjYgMiAydjFjMCAuOTY5LjcwMy45OCAxIDF2MmMtLjMyMi4wMi0xIC4wNTMtMSAxdjFjMCAuODM0LjA4MyAyLTIgMnYtMWMuODMzIDAgMS0xIDEtMXptLTYgMHYtMWMwLS44MzQtLjQ5Ni0xLjczOC0xLTIgLjUwNC0uMjcgMS0xLjE2OCAxLTJWN2MwLS44NC41ODQtMSAxLTFWNWMtMi4wODMgMC0yIDEuMTY2LTIgMnYxYzAgLjk2OS0uNzAzLjk4LTEgMXYyYy4zMjIuMDIgMSAuMDUzIDEgMXYxYzAgLjgzNC0uMDgzIDIgMiAydi0xYy0uODMzIDAtMS0xLTEtMXoiIGZpbGw9IiM0MjQyNDIiLz48cGF0aCBkPSJNNzMuNSAzNGMtMS45MTQgMC0zLjYwMS0xLjI0Mi00LjIyNy0zSDY3LjU5YTIuOTkyIDIuOTkyIDAgMDEtMi41OTEgMS41Yy0xLjY1NCAwLTMtMS4zNDYtMy0zczEuMzQ2LTMgMy0zQTIuOTkgMi45OSAwIDAxNjcuNTkgMjhoMS42ODNjLjYyNi0xLjc2IDIuMzEzLTMgNC4yMjctMyAyLjQ4MSAwIDQuNSAyLjAxOCA0LjUgNC41IDAgMi40OC0yLjAxOSA0LjUtNC41IDQuNXoiIGZpbGw9IiMyRDJEMkQiLz48cGF0aCBkPSJNNzMuNSAyNmMtMS43NTkgMC0zLjIwNCAxLjMwOC0zLjQ0OSAzaC0zLjEyMmExLjk5NSAxLjk5NSAwIDAwLTMuOTI5LjUgMS45OTUgMS45OTUgMCAwMDMuOTI5LjVoMy4xMjJjLjI0NSAxLjY5MSAxLjY5IDMgMy40NDkgMyAxLjkzIDAgMy41LTEuNTcgMy41LTMuNSAwLTEuOTMxLTEuNTctMy41LTMuNS0zLjV6bTAgNWExLjUwMSAxLjUwMSAwIDExMS41LTEuNWMwIC44MjYtLjY3MyAxLjUtMS41IDEuNXoiIGZpbGw9IiM3NUJFRkYiLz48Y2lyY2xlIGN4PSI3My41IiBjeT0iMjkuNSIgcj0iMS41IiBmaWxsPSIjMkQyRDJEIi8+PHBhdGggZD0iTTczLjUgMTRjLTEuOTE0IDAtMy42MDEtMS4yNDItNC4yMjctM0g2Ny41OWEyLjk5MiAyLjk5MiAwIDAxLTIuNTkxIDEuNWMtMS42NTQgMC0zLTEuMzQ2LTMtM3MxLjM0Ni0zIDMtM0EyLjk5IDIuOTkgMCAwMTY3LjU5IDhoMS42ODNjLjYyNi0xLjc2IDIuMzEzLTMgNC4yMjctM0M3NS45ODEgNSA3OCA3LjAxOCA3OCA5LjVjMCAyLjQ4LTIuMDE5IDQuNS00LjUgNC41eiIgZmlsbD0iI0YzRjNGMyIvPjxwYXRoIGQ9Ik03My41IDZjLTEuNzU5IDAtMy4yMDQgMS4zMDgtMy40NDkgM2gtMy4xMjJBMS45OTUgMS45OTUgMCAwMDYzIDkuNWExLjk5NSAxLjk5NSAwIDAwMy45MjkuNWgzLjEyMmMuMjQ1IDEuNjkxIDEuNjkgMyAzLjQ0OSAzIDEuOTMgMCAzLjUtMS41NyAzLjUtMy41Qzc3IDcuNTY5IDc1LjQzIDYgNzMuNSA2em0wIDVBMS41MDEgMS41MDEgMCAxMTc1IDkuNWMwIC44MjYtLjY3MyAxLjUtMS41IDEuNXoiIGZpbGw9IiMwMDUzOUMiLz48Y2lyY2xlIGN4PSI3My41IiBjeT0iOS41IiByPSIxLjUiIGZpbGw9IiNGMEVGRjEiLz48cGF0aCBkPSJNNTggMjguNTg2bC0zLTNMNTMuNTg2IDI3aC0yLjE3MmwxLTEtNC00aC0uODI4TDQyIDI3LjU4NnYuODI4bDQgNEw0OC40MTQgMzBINDl2NWgxLjU4NmwzIDNoLjgyOEw1OCAzNC40MTR2LS44MjhMNTUuOTE0IDMxLjUgNTggMjkuNDE0di0uODI4eiIgZmlsbD0iIzJEMkQyRCIvPjxwYXRoIGZpbGw9IiNDMjdEMUEiIGQ9Ik01My45OTggMzMuMDAyTDUxIDMzdi00aDJsLTEgMSAyIDIgMy0zLTItMi0xIDFoLTVsMi0yLTMtMy01IDUgMyAzIDItMmgydjVoM2wtMSAxIDIgMiAzLTMtMi0yeiIvPjxwYXRoIGQ9Ik01OCA4LjU4NmwtMy0zTDUzLjU4NiA3aC0yLjE3MmwxLTEtNC00aC0uODI4TDQyIDcuNTg2di44MjhsNCA0TDQ4LjQxNCAxMEg0OXY1aDEuNTg2bDMgM2guODI4TDU4IDE0LjQxNHYtLjgyOEw1NS45MTQgMTEuNSA1OCA5LjQxNHYtLjgyOHoiIGZpbGw9IiNGM0YzRjMiLz48cGF0aCBmaWxsPSIjQzI3RDFBIiBkPSJNNTMuOTk4IDEzLjAwMkw1MSAxM1Y5aDJsLTEgMSAyIDIgMy0zLTItMi0xIDFoLTVsMi0yLTMtMy01IDUgMyAzIDItMmgydjVoM2wtMSAxIDIgMiAzLTMtMi0yeiIvPjxwYXRoIGQ9Ik0yOS4yNjMgMjRMMzQgMjYuMzY5djUuMjM2TDI3LjIwOSAzNWgtLjQyTDIyIDMyLjYwNXYtNS4yMzZMMjguNzM5IDI0aC41MjR6IiBmaWxsPSIjMkQyRDJEIi8+PHBhdGggZD0iTTIzIDI4djRsNCAyIDYtM3YtNGwtNC0yLTYgM3ptNCAxbC0yLTEgNC0yIDIgMS00IDJ6IiBmaWxsPSIjNzVCRUZGIi8+PHBhdGggZD0iTTI5IDI2bDIgMS00IDItMi0xIDQtMnoiIGZpbGw9IiMyRDJEMkQiLz48cGF0aCBkPSJNMjkuMjYzIDRMMzQgNi4zNjl2NS4yMzZMMjcuMjA5IDE1aC0uNDJMMjIgMTIuNjA1VjcuMzY5TDI4LjczOSA0aC41MjR6IiBmaWxsPSIjRjNGM0YzIi8+PHBhdGggZD0iTTIzIDh2NGw0IDIgNi0zVjdsLTQtMi02IDN6bTQgMWwtMi0xIDQtMiAyIDEtNCAyeiIgZmlsbD0iIzAwNTM5QyIvPjxwYXRoIGQ9Ik0yOSA2bDIgMS00IDItMi0xIDQtMnoiIGZpbGw9IiNGMEVGRjEiLz48cGF0aCBmaWxsPSIjMkQyRDJEIiBkPSJNMiAyNy4zMDh2NS4zODRMNy4yMDkgMzZoLjU4MkwxMyAzMi42OTJ2LTUuMzg0TDcuNzkxIDI0aC0uNTgyeiIvPjxwYXRoIGQ9Ik03LjUgMjVMMyAyNy44NTd2NC4yODVMNy41IDM1bDQuNS0yLjg1N3YtNC4yODVMNy41IDI1ek03IDMzLjQ5OGwtMy0xLjkwNXYtMi44MTVsMyAxLjkwNXYyLjgxNXpNNC42NDIgMjhMNy41IDI2LjE4NSAxMC4zNTggMjggNy41IDI5LjgxNSA0LjY0MiAyOHpNMTEgMzEuNTkzbC0zIDEuOTA1di0yLjgxNWwzLTEuOTA1djIuODE1eiIgZmlsbD0iI0IxODBENyIvPjxwYXRoIGZpbGw9IiMyRDJEMkQiIGQ9Ik0xMC4zNTggMjhMNy41IDI5LjgxNSA0LjY0MiAyOCA3LjUgMjYuMTg1ek00IDI4Ljc3N2wzIDEuOTA2djIuODE1bC0zLTEuOTA1ek04IDMzLjQ5OHYtMi44MTVsMy0xLjkwNnYyLjgxNnoiLz48cGF0aCBmaWxsPSIjRjNGM0YzIiBkPSJNMiA3LjMwOHY1LjM4NEw3LjIwOSAxNmguNTgyTDEzIDEyLjY5MlY3LjMwOEw3Ljc5MSA0aC0uNTgyeiIvPjxwYXRoIGQ9Ik03LjUgNUwzIDcuODU3djQuMjg1TDcuNSAxNWw0LjUtMi44NTdWNy44NTdMNy41IDV6TTcgMTMuNDk4bC0zLTEuOTA1VjguNzc3bDMgMS45MDV2Mi44MTZ6TTQuNjQyIDhMNy41IDYuMTg1IDEwLjM1OCA4IDcuNSA5LjgxNSA0LjY0MiA4ek0xMSAxMS41OTNsLTMgMS45MDV2LTIuODE1bDMtMS45MDV2Mi44MTV6IiBmaWxsPSIjNjUyRDkwIi8+PHBhdGggZmlsbD0iI0YwRUZGMSIgZD0iTTEwLjM1OCA4TDcuNSA5LjgxNSA0LjY0MiA4IDcuNSA2LjE4NXpNNCA4Ljc3N2wzIDEuOTA2djIuODE1bC0zLTEuOTA1ek04IDEzLjQ5OHYtMi44MTVsMy0xLjkwNnYyLjgxNnoiLz48L3N2Zz4=");background-repeat:no-repeat}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.constructor,.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.function,.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.method{background-position:0 -4px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.field,.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.variable{background-position:-22px -4px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.class{background-position:-43px -3px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.interface{background-position:-63px -4px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.module{background-position:-82px -4px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.property{background-position:-102px -3px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.enum{background-position:-122px -3px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.rule{background-position:-242px -4px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.file{background-position:-262px -4px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.constructor,.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.function,.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.method{background-position:0 -24px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.field,.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.variable{background-position:-22px -24px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.class{background-position:-43px -23px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.interface{background-position:-63px -24px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.module{background-position:-82px -24px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.property{background-position:-102px -23px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.enum{background-position:-122px -23px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.rule{background-position:-242px -24px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.file{background-position:-262px -24px}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon{background:none;display:inline}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon:before{height:16px;width:16px;display:inline-block}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.constructor:before,.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.function:before,.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.method:before{content:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iI0IxODBENyIgZD0iTTUuNSAzTDEgNS44NTd2NC4yODVMNS41IDEzbDQuNS0yLjg1N1Y1Ljg1N0w1LjUgM3pNNSAxMS40OThMMiA5LjU5M1Y2Ljc3N2wzIDEuOTA1djIuODE2ek0yLjY0MiA2TDUuNSA0LjE4NSA4LjM1OCA2IDUuNSA3LjgxNSAyLjY0MiA2ek05IDkuNTkzbC0zIDEuOTA1VjguNjgzbDMtMS45MDV2Mi44MTV6Ii8+PC9zdmc+);margin-left:2px}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.field:before,.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.variable:before{content:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iIzc1QkVGRiIgZD0iTTEgNnY0bDQgMiA2LTNWNUw3IDMgMSA2em00IDFMMyA2bDQtMiAyIDEtNCAyeiIvPjwvc3ZnPg==);margin-left:2px}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.class:before{content:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iI0U4QUI1MyIgZD0iTTExLjk5OCAxMS4wMDJMOSAxMVY3aDJsLTEgMSAyIDIgMy0zLTItMi0xIDFIN2wyLTItMy0zLTUgNSAzIDMgMi0yaDJ2NWgzbC0xIDEgMiAyIDMtMy0yLTJ6Ii8+PC9zdmc+)}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.interface:before{content:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iIzc1QkVGRiIgZD0iTTExLjUgNEM5Ljc0MSA0IDguMjk2IDUuMzA4IDguMDUxIDdINC45MjlBMS45OTUgMS45OTUgMCAwMDEgNy41YTEuOTk1IDEuOTk1IDAgMDAzLjkyOS41aDMuMTIyYy4yNDUgMS42OTEgMS42OSAzIDMuNDQ5IDMgMS45MyAwIDMuNS0xLjU3IDMuNS0zLjVDMTUgNS41NjkgMTMuNDMgNCAxMS41IDR6bTAgNUExLjUwMSAxLjUwMSAwIDExMTMgNy41YzAgLjgyNi0uNjczIDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==)}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.module:before{content:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iI0M1QzVDNSIgZD0iTTkgMTF2LTFjMC0uODM0LjQ5Ni0xLjczOCAxLTItLjUwNC0uMjctMS0xLjE2OC0xLTJWNWMwLS44NC0uNTg0LTEtMS0xVjNjMi4wODMgMCAyIDEuMTY2IDIgMnYxYzAgLjk2OS43MDMuOTggMSAxdjJjLS4zMjIuMDItMSAuMDUzLTEgMXYxYzAgLjgzNC4wODMgMi0yIDJ2LTFjLjgzMyAwIDEtMSAxLTF6bS02IDB2LTFjMC0uODM0LS40OTYtMS43MzgtMS0yIC41MDQtLjI3IDEtMS4xNjggMS0yVjVjMC0uODQuNTg0LTEgMS0xVjNDMS45MTcgMyAyIDQuMTY2IDIgNXYxYzAgLjk2OS0uNzAzLjk4LTEgMXYyYy4zMjIuMDIgMSAuMDUzIDEgMXYxYzAgLjgzNC0uMDgzIDIgMiAydi0xYy0uODMzIDAtMS0xLTEtMXoiLz48L3N2Zz4=);margin-left:2px}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.property:before{content:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iI0M1QzVDNSIgZD0iTTEyLjA5IDQuMzU5TDkuNDQ5IDdsLTItMiAyLjY0MS0yLjY0MUEzLjk4NCAzLjk4NCAwIDAwOC40NDkgMmE0IDQgMCAwMC00IDRjMCAuNTg2LjEzMyAxLjEzOS4zNTkgMS42NEwxLjQ0OSAxMXMtMSAxIDAgMmgybDMuMzU5LTMuMzZjLjUwMy4yMjYgMS4wNTUuMzYgMS42NDEuMzZhNCA0IDAgMDA0LTRjMC0uNTg2LS4xMzMtMS4xMzktLjM1OS0xLjY0MXoiLz48L3N2Zz4=);margin-left:1px}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.enum:before,.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.value:before{content:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTEyIDNIOEw3IDR2Mmg1djFoLTJ2MWgybDEtMVY0bC0xLTF6bTAgMkg4VjRoNHYxem0tOSA3aDZWN0gzdjV6bTEtM2g0djFINFY5eiIgZmlsbD0iIzc1QkVGRiIvPjwvc3ZnPg==)}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.rule:before{content:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiI+PHBhdGggZmlsbD0iI0M1QzVDNSIgZD0iTTEwIDVIMlYzaDh2MnptMCAxSDR2MWg2VjZ6bTAgMkg0djFoNlY4eiIvPjwvc3ZnPg==)}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.file:before{content:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iI0M1QzVDNSIgZD0iTTkuNjc2IDJIM3YxMmgxMFY1TDkuNjc2IDJ6TTEyIDEzSDRWM2g1djNoM3Y3eiIvPjwvc3ZnPg==)} \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/fonts/addiconfont.aa9cec27.woff b/modules/gateway/src/main/resources/static/fonts/addiconfont.aa9cec27.woff deleted file mode 100644 index ab6cba175..000000000 Binary files a/modules/gateway/src/main/resources/static/fonts/addiconfont.aa9cec27.woff and /dev/null differ diff --git a/modules/gateway/src/main/resources/static/fonts/addiconfont.dc4f4b98.eot b/modules/gateway/src/main/resources/static/fonts/addiconfont.dc4f4b98.eot deleted file mode 100644 index ff70bda0e..000000000 Binary files a/modules/gateway/src/main/resources/static/fonts/addiconfont.dc4f4b98.eot and /dev/null differ diff --git a/modules/gateway/src/main/resources/static/fonts/addiconfont.fed05cb5.ttf b/modules/gateway/src/main/resources/static/fonts/addiconfont.fed05cb5.ttf deleted file mode 100644 index 67ee01c06..000000000 Binary files a/modules/gateway/src/main/resources/static/fonts/addiconfont.fed05cb5.ttf and /dev/null differ diff --git a/modules/gateway/src/main/resources/static/fonts/ionicons.96f1c901.woff2 b/modules/gateway/src/main/resources/static/fonts/ionicons.96f1c901.woff2 deleted file mode 100644 index 39176471d..000000000 Binary files a/modules/gateway/src/main/resources/static/fonts/ionicons.96f1c901.woff2 and /dev/null differ diff --git a/modules/gateway/src/main/resources/static/fonts/ionicons.99b86349.woff b/modules/gateway/src/main/resources/static/fonts/ionicons.99b86349.woff deleted file mode 100644 index 8708d82b2..000000000 Binary files a/modules/gateway/src/main/resources/static/fonts/ionicons.99b86349.woff and /dev/null differ diff --git a/modules/gateway/src/main/resources/static/fonts/ionicons.a558ac78.eot b/modules/gateway/src/main/resources/static/fonts/ionicons.a558ac78.eot deleted file mode 100644 index 579c1e19f..000000000 Binary files a/modules/gateway/src/main/resources/static/fonts/ionicons.a558ac78.eot and /dev/null differ diff --git a/modules/gateway/src/main/resources/static/fonts/ionicons.ef4a9f28.ttf b/modules/gateway/src/main/resources/static/fonts/ionicons.ef4a9f28.ttf deleted file mode 100644 index ffd7d6fb9..000000000 Binary files a/modules/gateway/src/main/resources/static/fonts/ionicons.ef4a9f28.ttf and /dev/null differ diff --git a/modules/gateway/src/main/resources/static/img/addiconfont.d327a749.svg b/modules/gateway/src/main/resources/static/img/addiconfont.d327a749.svg deleted file mode 100644 index b8e49dd17..000000000 --- a/modules/gateway/src/main/resources/static/img/addiconfont.d327a749.svg +++ /dev/null @@ -1,95 +0,0 @@ - - - - - -Created by iconfont - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/gateway/src/main/resources/static/img/ionicons.d6592091.svg b/modules/gateway/src/main/resources/static/img/ionicons.d6592091.svg deleted file mode 100644 index 43bbea82f..000000000 --- a/modules/gateway/src/main/resources/static/img/ionicons.d6592091.svg +++ /dev/null @@ -1,2090 +0,0 @@ - - - - - -Created by FontForge 20160407 at Fri May 24 15:45:40 2019 - By Adam Bradley -Copyright (c) 2019, Adam Bradley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/gateway/src/main/resources/static/img/login.aa01febc.svg b/modules/gateway/src/main/resources/static/img/login.aa01febc.svg deleted file mode 100644 index 43111b200..000000000 --- a/modules/gateway/src/main/resources/static/img/login.aa01febc.svg +++ /dev/null @@ -1,501 +0,0 @@ - - - - diff --git a/modules/gateway/src/main/resources/static/index.html b/modules/gateway/src/main/resources/static/index.html deleted file mode 100644 index f1d7e6b48..000000000 --- a/modules/gateway/src/main/resources/static/index.html +++ /dev/null @@ -1 +0,0 @@ -Fes
diff --git a/modules/gateway/src/main/resources/static/js/app.2881706b.js b/modules/gateway/src/main/resources/static/js/app.2881706b.js deleted file mode 100644 index acebedc71..000000000 --- a/modules/gateway/src/main/resources/static/js/app.2881706b.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["app"],{0:function(e,t,a){e.exports=a("5654")},"00ef":function(e,t,a){"use strict";a("eaea")},"05fd":function(e,t,a){},1112:function(e,t,a){"use strict";a("6861");t["a"]=function(){var e=this,t=function(e){return"super"===e?"超级用户":"admin"===e?"管理用户":"user"===e?"普通用户":"未登录"};this.FesApi.option({config:{headers:{"X-Requested-With":"XMLHttpRequest","Content-language":window.localStorage.getItem("lang")||"zh-cn"}}});var a=this,s=this.FesApi;this.FesApp.setBeforeRouter((function(e,t,a){"/group/groupDetail"===t.path&&this.FesFesx.get("isChange")?this.FesFesx.set("isGoto",e.path):(this.FesFesx.set("isGoto",""),console.log(t.path,e.path,"tofrom"),"/login"!==e.path?s.fetch("/auth",{},"get").then((function(e){a()})):a())})),this.FesApi.setResponse({successCode:0,codePath:"code",messagePath:"message",resultPath:"data"}),this.FesApi.setImportant({"generalcard/action":{control:1e4,message:"您在十秒内重复发起手工清算操作,是否继续?"}}),this.FesApi.setError({302:function(e){e.data;a.FesApp.router.push("/login")},401:function(e){window.Toast("未授权操作")}}),this.on("fes_logout",(function(){s.fetch("/logout",{},"post").then((function(){console.log("[退出成功]")}))["catch"]((function(){}))})),s.fetch("/auth",{},"get").then((function(a){"undefined"!==typeof a.redirect||("undefined"!==typeof a["X-AUTH-ID"]?(e.FesApp.setRole(a.role,!0,!1),e.FesApp.set("FesUserName",a["X-AUTH-ID"]),e.FesApp.set("FesRoleName",t(a.role)),e.FesStorage.set("currentUser",a["X-AUTH-ID"]),e.FesStorage.set("userRole",a.role)):(e.setRole("unLogin"),e.FesStorage.set("currentUser","guest"),e.FesStorage.set("userRole","unLogin")))}))["catch"]((function(e){console.error(e)})),this.set("FesLogoEvent",(function(){window.Toast("WeDataSphere Exchangis")}))}},"180a":function(e,t,a){"use strict";a("9c43")},"1f2d":function(e,t,a){},"1f35":function(e,t,a){"use strict";a("8c86")},"210f":function(e,t,a){},2328:function(e,t,a){},2373:function(e,t,a){"use strict";a("2bb5")},2478:function(e,t,a){"use strict";a.d(t,"b",(function(){return s})),a.d(t,"c",(function(){return n})),a.d(t,"a",(function(){return i}));var s={HIVE:"hive",LOCAL_FS:"local_fs",HDFS:"hdfs",SFTP:"sftp",ELASTICSEARCH:"elasticsearch",MYSQL:"mysql",ORACLE:"oracle"},n={STREAM:"stream",RECORD:"record"},i={PRE:"pre",NEXT:"next"}},2862:function(e,t,a){},"2bb5":function(e,t,a){},"2f33":function(e,t,a){},"363e":function(e,t,a){"use strict";a("210f")},"3a23":function(e,t,a){"use strict";a("fc8b")},"3e01":function(e,t,a){"use strict";a("d682")},"3e84":function(e,t,a){"use strict";a("c665")},"3fbd":function(e,t,a){"use strict";a("7e00")},"42cd":function(e,t,a){"use strict";a("05fd")},"45a4":function(e,t,a){},"4b33":function(e,t,a){},"4c8a":function(e,t,a){"use strict";a("8e3b")},"4f3e":function(e,t,a){"use strict";a("a72c")},5202:function(e,t,a){"use strict";a("2862")},5884:function(e,t,a){},"58df":function(e,t,a){"use strict";var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return e.show?a("div",{staticClass:"mask",on:{"!click":function(t){return t.target!==t.currentTarget?null:e.close(e.closable)}}},[a("div",{staticClass:"modal-content",style:{width:e.contentWidth,height:e.contentHeight}},[a("div",{staticClass:"modal-header"},[a("span",{staticClass:"ui-modal-title-main"},[e._v("\n "+e._s(e.title)+"\n ")]),a("Icon",{attrs:{type:"md-close"},on:{click:e.close}})],1),a("div",{staticClass:"modal-body"},[e._t("default")],2),e.footerDisable?a("div",{staticClass:"modal-footer"},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.comfirm}},[e._v("\n "+e._s(e.comfirmText)+"\n ")]),e.closeText?a("Wb-button",{attrs:{type:"error"},on:{click:e.close}},[e._v("\n "+e._s(e.closeText)+"\n ")]):e._e()],1):e._e()])]):e._e()},n=[];s._withStripped=!0;var i={model:{prop:"show",event:"parent-event"},props:{title:"",width:{tepy:String,default:"400"},height:{tepy:String,default:"auto"},show:{type:Boolean,default:!0},comfirmText:{type:String,default:"OK"},closeText:{type:String,default:""},footerDisable:{type:Boolean,default:!0},closable:{type:Boolean,default:!0}},computed:{contentWidth:function(){return this.width?"".concat(this.width,"px"):"400px"},contentHeight:function(){return this.height?"".concat(this.height,"px"):"auto"}},methods:{close:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e&&(this.$emit("parent-event",!1),this.$emit("onClose"))},comfirm:function(){this.$emit("parent-event",!1),this.$emit("onConfirm")}}},r=i,o=(a("180a"),a("dcb0")),l=Object(o["a"])(r,s,n,!1,null,"f7578088",null);l.options.__file="src/components/uiTemplate/weModal.fes";t["a"]=l.exports},6861:function(e,t,a){},6887:function(e){e.exports=JSON.parse('{"message":{"newAllPage":{"Projectbuttoncomponent":"项目按钮组件","Onlysupertubeandadministratorshaveaddpermissions":"只有超管和管理员有添加权限","Noaddgrouppermissions":"没有添加分组权限","Nodeletegrouppermissions":"没有删除分组权限","Helpdocumentrefertothebelow":"帮助文档参阅如下","address":"地址","Thedocumentdetails":"文档详情","Welcometologin":"Welcome to login Exchangis system","system":"系统","Pleaseenteryourusername":"请输入用户名","Pleaseenterthepassword":"请输入密码","Thelogin":"登录","Musthavealetter":"必须已字母开头","Andonlysupportletter":"且只支持字母","digital":"数字","Theunderline":"下划线","Namecannotbemorethanlength":"名称长度不能超过","Passwordlengthcantmorethan":"密码长度不能超过","Thesuperuser":"超级用户","Manageusers":"管理用户","Theaverageuser":"普通用户","Notloggedin":"未登录","rate":"速率","Setoperationrate":"设置作业速率","Operatingrate":"作业速率","Pleaseentertheoperationrate":"请输入作业速率","Pleaseenterthecorrectnumber":"请输入正确的数字","Whethertodisablelogbuttonatthebottom":"是否禁用日志底部按钮","Detailedlogbutton":"详细日志按钮","Determinewhethertoclickdetails":"点击详情时判断是否为","and":"和","state":"状态","button":"按钮","Thedeletebutton":"删除按钮","Displayinputbox":"展示输入框","Theexecutionoftaskcanbesetup":"执行中任务可设置","Thedynamicspeedlimit":"动态限速","Executesuccessfully":"执行成功","Intheoperationofthe":"运行中","Onfailure":"执行失败","Runatimeout":"运行超时","Inthequeue":"排队中","Hasstopped":"已停止","Backlog":"上一页日志","Thenextpagelog":"下一页日志","Toviewthelatestlog":"查看最新日志","Adjustablemeetagainafterthemodificationoftheinterfacedata":"调接修改接口后再重新拉数据","Thecolorofthestate":"状态的颜色","Queryconditions":"查询条件","Tasknameand":"任务名与","Forthetree":"获得树","Tochoosetimedeterminewhetherillegal":"选择时间的判断是否不合法","Aslegal":"为合法","Performatask":"执行任务","Ifconfirmtoperformatask":"是否确认执行任务","Searchproject":"搜索项目","Determinethestartandendarelegal":"判断开始和结束是否合法","Getalltheprojectlist":"获取所有工程列表","Getsthecurrentgroupofmembersallcanbeadded":"获取当前组下所有可添加的成员","Getpacketdetails":"获取分组详情","Addagroupingandupdategroup":"添加分组和更新分组","Firsttakethegroupmembersdidnotsave":"先去掉分组成员没有时的保存","Groupeddataispaging":"分组数据是分页的","Unabletogetalistofall":"无法获取所有的列表","Thetotalnumberofpagestocalculate":"分页总数计算","Whensearchingthecustomusername":"搜索时自定义用户名","Firstdeterminevalueandvalue":"先判断有值和没值","Havevaluetodeterminewhethertorepeat":"有值再判断是否重复"},"newComponents":{"XY":"小于","DY":"大于","DYH":"等于","BDY":"不等于","XYDY":"小于等于","DYDY":"大于等于","SimplifiedChinese":"简体中文","Notlessthanminimummemory":"最小内存不能小于","Taskvariables":"任务变量","Pleaseselecttheexecutionnode":"请选择执行节点","Checkthetype":"校验类型","Pleaseselectacalibrationtype":"请选择校验类型","Checknumber":"校验单号","Pleasefillinthechecklist":"请填写校验单号","new":"新增","Fieldlengthcantmorethan":"字段长度不能超过","Supportonlyalphanumericunderlineandhorizontalline":"只支持字母数字下划线和中横线","Pleasefilloutthe":"请填写","value":"值","Pleasefillinavariablesvalue":"请填写变量值","confirm":"确认","Pleaseenterthechecknumber":"请输入校验单号","SupportonlylettersandNumbers":"只支持字母和数字","Thereare":"有","Multi-selectlistnobindingvalueisnotempty":"多选列表没有绑定值是没清空","Ifnotedit":"如果不是编辑时","Thedefaultexecutionuserisloggedinuser":"默认执行用户为登录用户","Taskvariablesexistduplicatekey/valuepair":"任务变量存在重复的键值对","Confirmationbeforeyoucheckitagain":"确认之前先校验一遍","Convertedto":"转换成","Thenewfield":"新增字段","Pleaseenterthesourcefield":"请输入源字段","Pleaseenterthepurposefield":"请输入目的字段","point":"点","delete":"删除","Needtojudgewhetherasourceforthestructure":"需要一个来判断是否是源为结构","Purposeisnottocanmanuallyaddcolumnsstructure":"目的不是结构的情况来可以手动增加字段","Todeterminewhether":"判断是否是","engine":"引擎","Thetotalnumberofpagestocalculate":"分页总数计算","Ifthesourcefieldhastheoptionofarepeatrunwrong":"如果源字段有重复的选项就跑错","Repeatingfield":"重复字段","Checkfunctionvalue":"校验函数选择值","Checkfunctionparametersbuttontoadd":"校验函数参数按钮添加","Checkthefunction":"校验函数","Parameterlength":"参数长度","Thesequenceofstoredinthearray":"存储到数组的序列","Setwhetherthereisafearofjudgmenttochoosefirst":"先怕判断选择的自定是否有","Didntstopthenextstep":"没有阻止下一步","Mappingfieldcannotbeempty":"映射字段不能为空","Sourcefieldandthetargetfieldischoice":"源字段和目标字段都是必选","Objectivefieldlengthisnotgreaterthanthesourcefield":"目的字段长度不能大于源字段","Thetargetfieldisnotgreaterthanthesourcefield":"目标字段不能大于源字段","Anewfield":"新增一个字段","Deleteacertainfield":"删除字段某一项","Needtousethelibrary":"需要用到的库","Thetableset":"表集合","Thecurrentneedtobeconfigured":"当前需要配置的","Thesubscript":"的下标","Ifallthetabletoshowinthelist":"如果所有表在列表里才展示","Willbeatablebeforethelasttableandfieldsfortheuseofpop-upwindow":"将最后一个表和前一个表的字段供弹窗使用","Ifthefirstitemnovalueaddadefaultvalue":"如果第一项没有值加一个默认值","if":"如果","Quantityislessthan2":"数量小于二","empty":"清空","Accesstothedatasource":"获取数据源","Selectthedatasource":"选择数据源","Increasetheconnectionconfigurationfield":"增加连接配置字段","Deletethecurrentitemthelastitemonthefieldconfiguration":"删除当前项字段配置最后一项","Theconnectionconfigurationfieldtojoin":"将连接的配置字段加入到","Ifisnewadded":"如果是新加的就","to":"到","Ormodify":"否则就是修改","Canceltheconfigurationshouldbejustadddeletetable":"取消配置应该将刚添加的表删除","Ifitisnew":"如果是新加的","Whenconfiguredtocanceladdtablewillbedeleted":"在配置时取消将会删掉添加的表","Validationofconfigurationitemsarefree":"配置项有空时的校验","Addconfirmationbefore":"添加确认之前","Arefreejudgment":"判断是否有空的","Ifthelasttablefieldsdidntmatch":"如果上个表字段没配","Thedefaultvalue":"默认值","Theindexset":"索引集合","Emptydirectory":"清空目录","Additionaldata":"追加数据","Collectionisanasynchronousreturnedsotheasynchronouscantassignmentbeforereturntheresult":"集合是异步返回的所以在异步返回结果之前无法赋值","Determineenginefirstchoice":"先判断引擎的选择","Injudgingrecord":"在判断记录方式","Ifitis":"如果是","Engineistheresponsibilityofthesourcedatasourcejudgmentobjectivedatasourceoption":"引擎则由源数据源判断目的数据源的可选项","Datasourceschangeinitialvalue":"数据源改变还原初始值","Selectthedatasourceinterfacetoget":"选择数据源调接口获取","data":"数据","through":"通过","Toobtain":"获取","Acollectionof":"集合","Byselectingtheindexnameiscustom":"通过选择的索引名是否是自定义的","Todeterminetheindextype":"来确定索引类型","Queryconditions":"查询条件","Tasknameandprojectname":"任务名与项目名","Tohideanddisplayofthecontrolprocess":"控制流程的隐藏与显示","Chooseexecutionengine":"选择执行引擎","Settheglobalenginevariables":"设置全局引擎变量","Thepreviousstep":"上一步","Thenextstep":"下一步","Togettothefieldofinformationforuseinstep3":"将获取到的字段信息给第三步使用","Bynametoheavy":"通过名称去重","Whenthesourcedata":"当源数据为","Whencanchoosesynchronousmetainformation":"时可以选择同步元信息","Checkwhenthereisnofieldmappingandpostprocessor":"勾选时则没有字段映射和后置处理器","Havesynchronousmetainformation":"有同步元信息的","Nofurtheroperation":"没有后续操作","Thepurposeof":"目的为","Thesourcearestructured":"源也为结构化","Thepurposeofunstructured":"目的为非结构化","Sourceforstructured":"源为结构化","Copyoftasks":"解决复制的任务","Afterselectiontableagain":"重新选择表之后","Savetheinformationandmetadatasourcesonnoproblem":"保存的信息和元数据源对不不上问题","Isthetabletocompare":"比较选择的表是否一样","Ifyoudontlike":"如果不一样","Emptyeditcachedata":"清空编辑缓存的数据","Ifthesecondstepis":"如果第二步是","type":"类型","Edittemplatedatawasobtainedfromthebackground":"从后台获取编辑模板数据","Ifitisinediting":"如果是编辑进来的","Todeterminewhetherthereisatemplateinformation":"就要判断是否有模板信息","Ifyouhaveused":"如果有就用","Nobackgroundrequesttemplate":"没有后台请求模板","Ifitisthecustom":"如果是自定义的这种","Alsocalculatetheobjectivevalue":"还得计算目的值","Stepontheeditor":"编辑器上一步","Editoristhenextstep":"编辑器下一步","Thesecondpart":"第二部分","Checkiftheinformationsource":"如果勾选了同步源信息","Addtoedit":"增加写入编辑","Thefirstpart":"第一部分","Whenthetransmissionmodeisrecordtypeisthecompressiontypeandfileseparator":"当传输方式为记录型时才有压缩类型和文件分割符","Thefourthpart":"第四部分","Thefifthpart":"第五部分","Thenewdemand":"新需求要求","Aslongasitisthesourcedataisstructureddatasources":"只要是源数据是结构化得数据源","Therewillbe4fields":"就会有字段隐射","Therearetwofieldmapping:":"字段映射有两种:","Sourceanddestinationarestructured":"源和目的都是结构化","Thesourceisstructured":"源是结构化","Thepurposeisnotstructured":"目的不是结构化","Synchronousmetainformationdata":"同步元信息数据","Tojudgewhetherthereisafirst":"先判断是否有","Todeterminewhethermorethanthreelayers":"先判断是否超过三层","Onlysupportsnomorethanthreelayersofengineering":"只支持不超过三层工程","Selectedbydefaultthefirstproject":"默认选中第一个工程"},"newUitemplate":{"Librarytable":"库表","Pleaseselectthedatabase":"请选择数据库","Pleaseselectadatatable":"请选择数据表","new":"新增","timing":"定时","OnMonday,":"星期一","OnTuesday,":"星期二","OnWednesday,":"星期三","OnThursday,":"星期四","OnFriday,":"星期五","OnSaturday,":"星期六","OnSunday,":"星期日","minutes":"分钟","Perhour":"每小时","Everyday,":"每天","Onceaweek":"每周","Amonth":"每月","Everyyear,":"每年","points":"分","when":"时","month":"月","day":"日","every":"每","Willbeconvertedtotheselectedtime":"将所选时间转换成","format":"格式","Stillhavetomakesurewhatisthefirstchoicetodeterminetheexpressionishowtowrite":"还是得先确定第一个选择的是什么来决定表达是怎么写","Ifyouchooseday23selectionboxthereisnoshow":"如果选择天二三选择框不用展示","Fourorfiveselectionbox":"展示四五选择框","will":"将","Formatistransformedintotimeformat":"格式转换成时间格式","Todeterminewhetherselectedyearfirst":"先判断是否选的年","Usedtostorecustomindexname":"用来存放自定义索引名的","Indexofcustomlogic":"自定义索引逻辑","Whenuserssearchforthevalueofthereturnisnotthebackgroundofthelist":"当用户搜索的值不在后台返回的列表里","Willaddaandindextypeonly":"将添加一项且索引类型只能是","Searchthevalueofthereturninthebackgroundandnotreturnthedatainthedata":"搜索的值在后台返回的数据里和不在返回数据里","Tomonitorthefiletype":"监听文件类型","Modifythecompressedmode":"修改压缩模式","Todeterminewhether":"判断是否是","engine":"引擎","Transferthedatasource":"中转数据源","Dothedatatransfer":"做数据中转","Willusethedirectorysemaphorefileread/writesynchronization":"将使用目录信号量文件做读写同步","Pleaseenterthe":"请输入","Wheneveryouchosedatareadorwritedatacanbeused":"只要选了数据读取或者数据写入就一定可以使用","Thepasswordboxforthefocus":"密码框获取焦点的时候","Whenediting":"编辑时","Ifgetfocusvalueasthedefaultvalueisempty":"如果获取焦点的时候值为默认值就清空","Passwordboxlosesfocustojudgewhetherthereisamodifytheinitialvalue":"密码框失去焦点判断是否有修改初始值","Ifthevalueisnull":"如果值为空","Changethevaluetothedefaultvalue":"将值改为默认值","Transferstoobtaintemplatepage":"调转到获取模板页","Accesstothedatasourcetemplate":"获取数据源模板","Ifitisnotneedtoaddnew":"如果不是新建需要加上","Withoutpermissioninthetemplate":"在模板时无权限的情况下","Dontpassthistwofields":"不用传这个两个字段","Judgewhetherthecurrentusertotheadministratorusersandowner":"判断当前用户是否为管理员用户和属主用户","Checkwhethertheirowner":"先检查是不是自己属主","through":"再通过","Todeterminewhethercanoperation":"来判断是否可操作","Changechangescorrespondingtothealias":"变化修改对应别名","Prompttheuserwhetherdeletetodeletethemiddletable":"删除中间表提示用户是否删除","Mustfirstdeterminewhetherthelastitem":"首先得判断是否是最后一项","Accordingtothesubscripttakecorrespondingtorenamethetable":"根据下标取对应重命名的表","and":"和","Willbelostundostack":"都会丢失撤销栈","Tocancelthestack":"有撤销栈"}},"pageDs":{"XZWQXS":"选择无权限时","BYCXMCS":"不用传下面参数","YHWSCQX":"当前用户无删除权限","YHWBJQX":"当前用户无编辑权限","PDSFGLY":"判断当前用户是否为管理员用户和属主用户","XJCSBSZJSZ":"先检查是不是自己属主","ZTON":"再通过","LPAND":"来判断是否可操作","TG":"通过","HQDYGCM":"获取对应的工程名","HQSOGOCS":"获取所有工程数据","CKXQ":"查看详情","TONJKHQXX":"通过接口获取详情信息"},"manager":{"resourceManager":"数据源管理","resourceType":"数据源类型","selectResourceType":"请选择数据源类型","resourceName":"数据源名称","SRSZYM":"请输入查询的数据源名称","SZYSZ":"数据源属主","XZSJYSZ":"请选择数据源属主","CX":"查询","XZCX":"新增数据源","LX":"类型","CJZ":"创建者","CJZSJ":"创建时间","XM":"绑定项目","BJ":"编辑","XQ":"详情","SC":"删除","LJXX":"连接信息","CKLJXX":"查看连接信息","XZSJK":"选择数据源","GXSJK":"关系型数据库","SJY":"数据源","SJK":"数据库","DSJCC":"大数据存储","BJGHCC":"半结构化存储","ZW":"暂无","WJGHCC":"无结构化存储","FW":"服务","SJYSZJK":"获取数据源属主接口","CXSJ":"查询数据","DJFY":"点击分页","CJSJYCG":"创建数据源成功","GXSJ":"更新数据","GXCG":"更新数据源成功","LJSJYCG":"连接数据源成功","SCSJY":"删除数据源","SFSCSJY":"是否要删除数据源{name}","SCSJYCG":"删除数据源成功"},"dataTemplate":{"SJYMBGL":"数据源模板管理","SJYLJCSMBGL":"源数据连接参数模板化管理","MBLX":"模板类型","QXZSJY":"请选择数据源类型","MBMC":"模板名称","CXMBMC":"请输入查询的模板名称","CX":"查询","XZMB":"新增模板","CKXQ":"查看详情","XG":"修改","SC":"删除","XZSJYLX":"选择数据源类型","SRWB":"请输入文本","MBMS":"模板描述","DZ":"地址","QSR":"请输入","LJCS":"连接参数","CSM":"参数名","CSZ":"参数值","PZX":"配置项","PZM":"配置名","PZZ":"配置值","DZDKH":"地址端口号","RZFS":"认证方式","SZYLXBMK":"数据源类型不能为空","MBMCBLK":"模板名称不能为空","MCCDBNDY":"名称长度不能大于100","ZU":"只支持字母、数字、中文和特定字符(_ . :)","MOMSBNK":"模板描述不能为空","MBCDBNDY":"描述长度不能大于","DZBNK":"地址不能为空","CDBNDY":"url长度不能大于1000","DZBNWK":"地址port不能为空","BNWK":"不能为空","MR":"默认","WQX":"无权限","CKMB":"查看模板","XGMB":"修改模板","TJMB":"添加模板","TJJK":"调添加接口","MBMCBKTM":"模板名称不可同名","XZMBCG":"新增模板成功","XGMBCG":"修改模板成功","XGMBSB":"修改模板失败","SCMB":"删除模板","KECRWB":"可以传入文本和","QRSCMB":"确认删除模板","ZDLG":"最多有两个","DYTPZYG":"第一条配置第一个","QR":"确定","PZDRG":"配置第二个","FQ":"放弃","MB":"模板","SCCG":"删除成功","CXSJ":"查询数据","DJFY":"点击分页","PZSJDCC":"配置值失焦点查重","PZ":"配置","J":"键","Z":"值","CF":"重复","JC":"检查","SFCF":"是否重复"},"job":{"projectlist":"项目列表","taskNameLable":"任务名称:","input":"请输入","task":"任务ID","query":"查询","addJob":"增加任务","taskName":"任务名称","timeJob":"定时任务","jobDesc":"任务描述","jobStatus":"定时状态","creatTime":"创建时间","action":"操作","addProject":"新增任务","XZXM":"新增项目","MXMC":"项目名称","SRXMMC":"请输入项目名称","MS":"描述","TJ":"提交","LS":"历史重跑","QXZQSSJ":"请选择起始时间:","QXZZZSJ":"请选择终止时间:","JGSJ":"间隔单位:","JGCD":"间隔长度:","SRSJCD":"请输入时间长度","CXTJ":"查询条件","MCY":"任务名与","HDS":"获得树","XZSJSFBHF":"选择时间的判断是否不合法","WHF":"为合法","BJ":"编辑","ZX":"执行","FZ":"复制","RWKSZX":"任务开始执行","SC":"删除","SCRW":"删除任务","SFSC":"是否要删除任务?","SCRWCG":"删除任务成功","DSZT":"定时暂停","ZTCG":"暂停成功","DSQD":"定时启动","DSCG":"启动成功","ZTDS":"暂停定时","QDDS":"启动定时","LSSJCP":"历史数据重跑","KSSJBNWK":"开始时间不能为空","JSSJBNWK":"结束时间不能为空","SJBNWK":"时间不能为空","JGCDBNWK":"间隔长度不能为空","XZZQDKSSJ":"请选择正确的开始时间","XZZQDJSSJ":"请选择正确的结束时间","PDKSHJS":"判断开始和结束是否合法","QXZHFSJD":"请选择合法时间段","QRCP":"确认重跑{name}任务吗?","CPCG":"重跑成功","TXZQBD":"请填写正确的表单项","XMTJCG":"项目添加成功","JGCDDY30":"间隔长度不得大于30天","JGCDDY24":"间隔长度不得大于24小时","JGCDDY60":"间隔长度不得大于60分钟","XJ":"新建","SRXMMCSS":"输入项目名称搜索"},"task":{"ZYID":"作业ID","QSR":"请输入","RWZT":"任务状态","XZRWZT":"请选择任务状态","KSSJ":"开始时间","JSSJ":"结束时间","CX":"查询","ZWSJ":"暂无数据","ZXJD":"执行节点","RWMC":"任务名称","CFLX":"触发类型","CFSJ":"触发时间","CFZT":"触发状态","ZXYH":"创建用户","ZT":"状态","WCSJ":"完成时间","CS":"参数","CZ":"操作","RWYXRZ":"任务运行日志","SYY":"上一页","XYY":"下一页","CKZXRZ":"查看最新日志","ZZRW":"终止任务","SFZZRW":"是否要终止任务?","RWYZZ":"任务已终止","SCRZ":"删除日志","SFSCRZ":"是否要删除日志","SCRZCG":"删除日志成功","XXRZ":"详细日志","SC":"删除","RW":"任务","ZXCG":"执行成功","ZXSB":"执行失败, 请查看相关日志","WFHQRZ":"无法获取日志文件"},"sys":{"Performusermanagement":"执行用户管理","Theusername":"用户名","Thenewperformuser":"新增执行用户","Pleasefillinusername":"请填写执行用户名","describe":"描述","Pleasefillintheusername":"请填写用户名描述","Musthavealetter":"必须已字母开头","Andonlysupportletter":"且只支持字母","digital":"数字","Theunderline":"下划线","Callstoaddaninterface":"调用添加接口","Addausersuccessfully":"添加用户成功","Deleteperformuser":"删除执行用户","Whetheryouwanttodelete":"是否要删除","Deletetheusersuccessfully":"删除用户成功","Thedefaultnode":"默认节点","Thelabel":"标签","Bindingthenodelabel":"绑定节点标签","Pleaseselectalabel":"请选择标签","Themanagementnode":"管理节点","Nodeauthorizationpage":"节点授权页面","delete":"删除","Removenodes":"删除节点","Whetherornottodelete":"是否删除","Deletethesuccess":"删除成功","Bindingtothecurrentnode":"将当前的节点绑定标签","Updatethelist":"更新列表","Initialpassword":"初始密码","Pleaseenterthepassword":"请输入密码","Confirmpasswordagain":"再次确认密码","Pleaseenterthepasswordagain":"请再次输入密码","Passwordisnotcorrect":"密码不正确","Pleaseinputvalidationagain":"请再次输入确认","Namecannotbemorethanlength":"名称长度不能超过","Pleaseentertheinitialpassword":"请输入初始密码","Passwordlengthcantmorethan":"密码长度不能超过","Editbutton":"编辑按钮","Bindingauthorization":"绑定授权","Toresetyourpassword":"重置密码","Passwordresetsuccessfully":"重置密码成功","Deleteoperation":"删除操作","Emptythenewlyaddeddata":"清空新添加的数据","Torequestthedatalist":"重新请求最列表数据","Nodemanagement":"节点管理","state":"状态","normal":"正常","Hasbeenrolledofftheproductionline":"已下线","Thenodeaddress":"节点地址","Theheartbeatoftime":"心跳时间","Memoryusage":"内存使用率","usage":"使用率","Performausername":"执行用户名","Pleaseenteryourusername":"请输入用户名","Pleaseenterthe":"请输入","add":"添加","return":"返回","Temporarilynodata":"暂无数据","Associatedwiththeusertypes":"关联用户类型","Associatedstates":"关联状态","Therecentmodificationtime":"最近修改时间","operation":"操作","Bindtheuser":"绑定用户","Selecttheuser":"选择用户","Bindingtype":"绑定类型","Pleaseselectabindingtype":"请选择绑定类型","Hasbeenassociateduser":"已关联用户","Donotdelete":"不可删除","Confirmtodeletetheuserexecution":"确认删除执行用户","associated":"关联","confirm":"确认","Executionofuser":"关联执行用户","Canceltheassociated":"取消关联","Canceltheexecutionoftheuser":"取消关联执行用户","Notassociated":"未关联","Hasbeenassociated":"已关联","Connectionfailure":"关联失败","Thebinding":"绑定","bindings":"绑定关联","Callstoadduserinterface":"调用添加用户接口","Usermanagement":"用户管理","Performuserandexecutionnodebindingauthority":"执行用户和执行节点的绑定授权","Theexecutionnode":"执行节点","Addanode":"添加节点","Address:":"地址:","Status:":"状态:","offline":"下线","Memory:":"内存:","Performuser":"执行用户","Adduser":"添加用户","Name:":"名称:","Bindingnodes":"绑定节点","Selectthenode":"选择节点","Gettheexecutionnodecanchoose":"获取可以选择的执行节点","Afterthecalltoaddinterface":"调用添加接口后","Pullthedataagain":"重新拉取数据","Boundnodesuccess":"绑定节点成功","Bindingusersuccessfully":"绑定用户成功","Confirmtodeletetheexecutionnode":"确认删除执行节点","Deletenodesuccess":"删除节点成功","Deleteuser":"删除用户","executor":{"DZ":"地址","QSR":"请输入","CX":"查询","ZWSJ":"暂无数据","XTSJ":"心跳时间","ZT":"状态","NCSYL":"内存使用率","SYL":"CPU使用率","CZ":"操作","WH":"维护","XX":"下线","SX":"上线","JD":"节点","SFCG":"是否要{action}节点?","JDCG":"节点成功","ZC":"正常","YXX":"已下线"},"owner":{"SZYSZ":"数据源属主名称:","QSR":"请输入","CX":"查询","XZSJYSZ":"新增数据源属主","MYSZSJ":"没有属主数据","MC":"名称","MS":"描述","CJYH":"创建用户","CJSJ":"创建时间","XGYH":"修改用户","XGSJ":"修改时间","CZ":"操作","XZMC":"属主名称","SRSJSZ":"请输入数据源属主","TJ":"提交","XGSJSZ":"修改数据源属主","SZMCBNK":"属主名称不能为空","BJ":"编辑","BJAN":"编辑按钮","SC":"删除","SCCZ":"删除操作","SCSJYSZ":"删除数据源属主","SFSCSJYSZ":"是否要删除数据源属主?","SCCG":"删除数据源属主成功","XGCG":"修改数据源属主成功","TJSJYCG":"添加数据源属主成功"},"user":{"YHM":"用户名","QSR":"请输入","CX":"查询","XZYH":"新增用户","ZSWSJ":"暂无数据","YHLX":"用户类型","CJSJ":"创建时间","XGSJ":"修改时间","CZ":"操作","SZMC":"属主名称","SRYHM":"请输入用户名","PTYH":"普通用户","GLYH":"管理用户","CJYH":"超级用户","TJ":"提交","XGYHXX":"修改用户信息","YHXXBNWK":"用户名不能为空","BJ":"编辑","SC":"删除","SCYH":"删除用户","SFSCYH":"是否要删除用户","SCCG":"删除用户成功","XGCG":"修改用户成功","TJYHCG":"添加用户成功"}},"group":{"SCYXX":"删除已选项","FZBH:":"分组编号:","SRDZGSS":"请输入分组号进行搜索","SRFZMSS":"请输入分组名进行搜索","CX":"查询","TJFZ":"添加分组","ZWSJ":"暂无数据","FZBH":"分组编号","FZM":"分组名","MS":"描述","CJR":"创建人","BDXM":"绑定项目","CJSJ":"创建时间","GXSJ":"更新时间","XQ":"详情","SCFZ":"删除分组","QX":"取消","QRSCFZ":"确认删除分组","CKXQ":"查看详情","XZYSCDFZ":"请选择要删除的分组","FZSCCG":"分组删除成功","FZXQ":"分组详情","FH":"返回","JCXX":"基础信息","FZMBNK":"分组名称不能为空","ZCZZM":"只支持字母、数字、下划线和中文!","QSR":"请输入","FZMS":"分组描述","FZCY":"分组成员","SRYHMSS":"请输入用户名进行搜索","TICY":"添加成员","YH":"用户ID","YHM":"用户名","XZYH":"选择用户","SRWB":"请输入文本","QRSCYH":"确认删除用户","SFYXG":"是否有修改","BCXG":"保存修改","BCTS":"保存提示","FZXXTXSFBC":"分组信息有修改操作是否保存?","XGFZNRWBC":"修改分组内容未保存!","TJZCY":"请添加组成员","FZNBKCF":"分组名不可重复","FZXG":"分组{name}修改成功","CJCG":"分组{name}创建成功","TXZQBD":"请填写正确的表单项","FYZS":"分页总数计算","XZYSCDYH":"请选择要删除的用户","SCCG":"分组成员删除成功","FZCYSCSB":"分组成员删除失败","XZYHS":"请选择用户"},"uiTemplate":{"SJY":"数据源","SYMC":"索引名称","XZSYMC":"请选择索引名称","SYLX":"索引类型","XZSYLX":"请选择索引类型","PLDX":"批量大小","SRPLDX":"请输入批量大小","HZCLQ":"后置处理器","LJ":"路径","SRLJ":"请输入路径","YSLX":"压缩类型","XZYSLX":"请选择压缩类型","BM":"编码","QXZBM":"请选择编码格式","CSGS":"传输方式","QXZCSFS":"请选择传输方式","EJZ":"二进制","JL":"记录","WJLX":"文件类型","XZWJLX":"请选择文件类型","ZDFGF":"字段分隔符","WJMQZ":"文件名前缀","QSRWJMQZ":"请输入文件名前缀","K":"库","B":"表","FQXIN":"分区信息","FQZD":"分区字段","ZDYFQM":"自定义分区名","MYSJ":"没有数据","SJYMC":"数据源名称","SRSJYMC":"请输入数据源名称","SJYMS":"数据源描述","TXXQMS":"请填写详细描述","SJYSZ":"数据源属主","LJMB":"连接模板","WJ":"keytab文件","MYWJ":"秘钥文件","YHM":"用户名","GSXR":"格式形如:_NAME","MA":"密码","LJCS":"连接测试","SUBMIT":"提交","GX":"更新","SJYMCBNK":"数据源名称不能为空","MCCDBNDY":"名称长度不能大于100","ZZCZM":"只支持字母、数字、中文和特定字符(_.:)","MSCDBNDY":"描述长度不能大于100","SJYSZBNWK":"数据源属主不能为空","QXZ":"请选择","RZSTBNWK":"认证实体不能为空","YHMCDBNDY":"用户名长度不能大于100","YHMBNWK":"用户名不能为空","MABNWK":"密码不能为空","YHMABNDY":"用户密码不能大于30","LJMBBNWK":"连接模板不能为空","QTXZQBDX":"请填写正确的表单项!","RZST":"认证实体","KM":"库名","TABLENAMW":"表名","BBNWK":"表不能为空","LJTJ":"连接条件","TJ":"where条件","QSR":"请输入where条件","SCJG":"删除警告","SFSCCBZHDSYBJLJPZ":"是否删除此表之后的所有表及连接配置?","XRFS":"写入方式","QSRPLDXZ":"请输入批量大小值","QR":"确认","YWC":"已完成","JXZ":"进行中","DJX":"待进行","BINLOGHOST":"binlog地址不能为空","BJXR":"写入策略","SX":"刷新","CJMB":"创建模板","BDXM":"绑定项目","DWQX":"对外权限","KD":"可读","KBJ":"可编辑","KSY":"可使用","SJDQ":"数据读取","SJXR":"数据写入","TGSH":"跳过首行"},"components":{"TYSJJHPTWNFW":"统一数据交换平台为你服务","ZW":"中文","TCCG":"退出成功","DCXTSB":"登出系统失败!","BCLL":"保存预览","RWMC":"任务名称","QSRRWMC":"请输入任务名","TXR":"提醒人","QSRTXR":"请输入提醒人","DS":"定时","BDS":"corn表达式","RWMS":"任务描述","SRRWMS":"请输入任务描述","ZXYH":"执行用户:","XZZXYH":"请选择执行用户","ZXJD":"执行节点:","XZZXJD":"请选择执行节点","DH":"单号","QSR":"请输入","CSSJ":"超时时间","SRCSSJ":"请输入超时时间,单位为秒","TBFS":"同步方式","QL":"全量(FULL)","ZL":"增量(INCR)","SYB":"上一步","BC":"保存","TXRWM":"请填写任务名","XZZXDH":"请选择执行单号","QTX":"请填写","DXBNCG":"大小不能超过5位数","ZZCSZ":"只支持数字","DYCLQ":"定义处理器","XYB":"下一步","DZCLQ":"定制处理器内容不能为空","SDKZ":"速度控制","ZYSLXZ":"作业速率限制","ZYJLXZ":"作业记录数限制","T":"条/s","CWJLCG":"错误记录数超过","RWSB":"条,任务失败","GJ":"高级","ZYZDBXS":"作业最大并行数","G":"个","ZYZDNC":"作业最大内存","SYT":"上一条","NCBCG":"内存不超过","ZYZDBXSBCG":"作业最大并行数不超过","ZYSLBCG":"作业速率最大不超过","SRZQZYSL":"请输入正确作业速率限制","ZQSRZYJLSXZ":"请输入正确作业记录数限制","QSRZQCWJLS":"请输入正确错误记录数","SRZQQZYZDBXS":"请输入正确作业最大并行数","SRZQZYZDNC":"请输入正确作业最大内存","XZSJY":"选择来源","SJYLX":"数据源类型","LLSJ":"预览数据","LJTJPZ":"连接调节配置","QX":"取消","QBZDXX":"前表字段信息","LJTJ":"连接条件","DQBZDXX":"当前表字段信息","GNZWKF":"功能暂未开放,敬请期待","QXTXWZLJXX":"请先填写完整连接字段信息","QTXQBZDXX":"请先填写前表字段连接信息","QTXDQBZDXX":"请先填写当前表字段连接信息","ZDYS":"字段映射","YZD":"源字段","LX":"类型","MBZD":"目标字段","JYHS":"校验函数","ZHHS":"转换函数","CS":"参数","SZCS":"设置参数","CS:":"参数:","QR":"确定","YZDBNWK":"源字段不能为空","CXTJ":"查询条件","XZMD":"选择目的","JBXX":"基本信息","BSJJH":"表数据集合","RWBCCG":"任务保存成功","RWXGSC":"任务修改成功","TBYXXSJ":"同步元信息数据","XZXM":"新增项目","XMMC":"项目名称","SRXMMC":"请输入项目名称","MS":"描述","TJ":"提交","ZJZJD":"增加子节点","SCJD":"删除节点","SC":"删除","SFSC":"是否要删除该项目节点?","SCCG":"删除成功","TJCG":"添加成功","TBYXX":"同步元信息"},"mixin":{"FGFBCC":"分隔符不支持\\\\","QZQTX":"请填写正确的unicode","PLDXBCG":"批量大小不超过100000","SJYBNK":"数据源不能为空","BBK":"不能为空","LJBKBJKG":"路径不可包含空格","BMLXZC":"编码类型只支持ISO-8859-1、GB2312、GBK、UTF-8、UTF-16","CZBNRSZW":"此值不能输入中文字符","QXZWJLX":"请选择文件类型","SJKBNNQJ":"数据库不能为空","BBNWK":"表不能为空","SYMCBNWK":"索引名称不能为空","BXYZMKR":"必须以字母开头,且只支持字母、数字、(_.-#${})","STLXBNWK":"索引类型不能为空","DRFSBNWK":"写入方式不能为空","XZSJYLX":"请选择数据源类型","XZSJY":"请选择数据源","XZK":"请选择库","QXZB":"请选择表"},"navBar":{"dataManager":"数据源管理","dataSource":"数据源","templaceManagert":"模板管理","taskConfig":"任务配置","tasking":"任务作业","group":"权限组管理","help":"帮助文档","sysManagert":"系统管理","owner":"数据属主","execotor":"执行节点","user":"用户管理","executeUser":"执行用户"}}')},"68e0":function(e,t,a){},"6c08":function(e,t,a){},7444:function(e,t,a){},"78a5":function(e,t,a){"use strict";var s=a("6887"),n=a("abc4"),i=window.localStorage.getItem("lang")||"zh-cn";t["a"]={mode:"vertical",theme:"dark",fesName:"Exchangis",roles:{unLogin:["/ds/newManager","/","/login","/job","/task","/help"],user:["/ds/newManager","/","/login","/ds/dataTemplate","/job","/task","/help","/group","/group/groupDetail"],admin:["/ds/newManager","/","/login","/ds/dataTemplate","/job","/task","/help","/group","/group/groupDetail","/sys/owner"],super:["/ds/newManager","/","/login","*"]},map:{status:[["1","成功"],["2","失败"]]},i18n:{locale:i,messages:{en:n,"zh-cn":s}},menu:[{title:"$i18n.navBar.dataManager",path:"/ds",subMenu:[{title:"$i18n.navBar.dataSource",path:"/ds/newManager"},{title:"$i18n.navBar.templaceManagert",path:"/ds/dataTemplate"}]},{title:"$i18n.navBar.taskConfig",path:"/job"},{title:"$i18n.navBar.tasking",path:"/task"},{title:"$i18n.navBar.group",path:"/group"},{title:"$i18n.navBar.sysManagert",path:"/sys",subMenu:[{title:"$i18n.navBar.owner",path:"/sys/owner"},{title:"$i18n.navBar.execotor",path:"/sys/executor"},{title:"$i18n.navBar.executeUser",path:"/sys/executeUser"},{title:"$i18n.navBar.user",path:"/sys/user"}]}],env:{local:{api:""},prod:{api:"/api/v1"},open:{api:"/api/v1"}}}},"7e00":function(e,t,a){},"84b0":function(e,t,a){"use strict";a("2f33")},"86bb":function(e,t,a){"use strict";a("5884")},"8c77":function(e,t,a){"use strict";a("1f2d")},"8c86":function(e,t,a){},"8e3b":function(e,t,a){},9268:function(e,t,a){"use strict";a("eeba")},9299:function(e,t,a){"use strict";var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{"text-align":"center"}},[a("span",{staticStyle:{display:"inline-block"}},[e._v("\n "+e._s(e.title)+"\n ")])])},n=[];s._withStripped=!0;var i={FesData:function(){return{title:this.$t("components.TYSJJHPTWNFW")}},methods:{}},r=i,o=a("dcb0"),l=Object(o["a"])(r,s,n,!1,null,null,null);l.options.__file="src/components/fesHeader.fes";var c=l.exports,u=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"layout-left-user"},[a("div",{staticClass:"language-switching"},[a("p",{on:{click:e.languageSwitching}},[e._v("\n "+e._s(e.lang)+"\n ")])]),a("div",{staticClass:"layout-left-user-name"},[a("p",[e._v(e._s(e.userName))])]),a("div",{staticClass:"layout-left-user-logout",on:{click:e.logout}},[a("Icon",{attrs:{type:"md-log-out",size:"24"}})],1)])},d=[];u._withStripped=!0;var h={FesData:function(){return{lang:"en"===localStorage.getItem("lang")?"简体中文":"English"}},computed:{userName:function(){return this.FesApp.get("FesUserName")}},methods:{languageSwitching:function(){var e=localStorage.getItem("lang");"en"===e?(this.FesApp.setLocale("zh-cn"),localStorage.setItem("lang","zh-cn")):(this.FesApp.setLocale("en"),localStorage.setItem("lang","en")),window.location.reload()},logout:function(){var e=this;this.FesApp.setRole("unLogin"),this.FesStorage.set("userLogin",!1),this.FesApp.set("FesUserName",""),this.FesApp.set("FesRoleName",""),this.FesStorage.set("currentUser",""),this.FesStorage.set("userRole",""),this.FesApi.fetch("/logout",{},"post").then((function(){console.log("[".concat(e.$t("components.TCCG"),"]"))}))["catch"]((function(){}))}}},p=h,m=(a("c4ed"),Object(o["a"])(p,u,d,!1,null,"28dca72e",null));m.options.__file="src/components/fesLeft.fes";var f=m.exports,b=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("panel",{attrs:{title:e.$t("components.DYCLQ")}},[a("div",{staticClass:"editor-content"},[a("editor",{attrs:{value:e.editorContent,"read-only":!1},on:{input:e.getValue}})],1),a("Row",{staticClass:"footer-bar"},[a("Cell",{attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.partTwoPre}},[e._v("\n "+e._s(e.$t("components.SYB"))+"\n ")])],1),a("Cell",{attrs:{span:"12"}},[a("Wb-button",{staticClass:"next-button",attrs:{type:"primary"},on:{click:e.parNextStep}},[e._v("\n "+e._s(e.$t("components.XYB"))+"\n ")])],1)],1)],1)},g=[];b._withStripped=!0;var D=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"we-editor"})},S=[];D._withStripped=!0;var v=a("8ea9");v["languages"].registerCompletionItemProvider("java",{provideCompletionItems:function(){var e=[{label:"ifelse",kind:v["languages"].CompletionItemKind.Snippet,insertText:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n"),insertTextRules:v["languages"].CompletionItemInsertTextRule.InsertAsSnippet,documentation:"If-Else Statement"}];return{suggestions:e}}});var C=v,y=a("2ef0"),w={code:{theme:"defaultView"},log:{language:"log",theme:"logview",readOnly:!0,glyphMargin:!1,selectOnLineNumbers:!1,wordWrap:"on"}},T={name:"WeEditor",props:{id:{type:String,required:!1},type:{type:String,default:"code"},theme:{type:String,default:"vs"},language:{type:String,default:"java"},value:{type:String,default:""},readOnly:Boolean,options:Object,executable:{type:Boolean,default:!0},scriptType:String,application:String,lineNumbers:"off"},data:function(){return{editor:null,editorModel:null,decorations:null,parseErrorLine:0,isParserClose:!1,sqlParser:null}},computed:{currentConfig:function(){var e=w.code,t=Object(y["merge"])({automaticLayout:!0,scrollBeyondLastLine:!1,minimap:{enabled:!1},readOnly:this.readOnly,glyphMargin:!0},e,{value:this.value,theme:this.theme,language:this.language});return t}},watch:{value:function(e,t){if(this.editor){if(e==this.getValue())return;var a=this.editor.getConfiguration().readOnly;if(a)this.editor.setValue(e);else{var s=this.editor.getModel().getFullModelRange(),n=e,i={identifier:{major:1,minor:1},range:s,text:n,forceMoveMarkers:!0};this.editor.executeEdits("insertValue",[i])}}}},mounted:function(){this.initMonaco()},methods:{initMonaco:function(){var e=this;this.editor=C.editor.create(this.$el,this.currentConfig),this.editorModel=this.editor.getModel(),this.$emit("onload"),this.editor.onDidScrollChange(Object(y["debounce"])((function(t){e.$emit("scrollChange",t)})),300),this.editor.onDidChangeModelContent(Object(y["debounce"])((function(){e.$emit("input",e.getValue())})),100)},getValue:function(){return this.editor.getValue({lineEnding:"\n",preserveBOM:!1})}}},F=T,$=(a("8c77"),Object(o["a"])(F,D,S,!1,null,"023705ca",null));$.options.__file="src/components/uiTemplate/weEditor.fes";var x=$.exports,_={components:{editor:x},props:{value:{type:String,default:""},editData:{type:null}},watch:{value:function(e){this.editorContent=e}},FesData:function(){return{editorContent:""}},methods:{partTwoPre:function(){this.$emit("preEditor",!0)},parNextStep:function(){if(!this.editorContent)return this.$Toast.warn(this.$t("components.DZCLQ"));this.$emit("parNextStep",this.editorContent)},getValue:function(e){this.editorContent=e}}},A=_,L=(a("42cd"),Object(o["a"])(A,b,g,!1,null,"3167c3cf",null));L.options.__file="src/components/jobAddEditor.fes";var N=L.exports,P=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Panel",{attrs:{title:e.$t("components.BCLL")}},[a("Wb-button",{attrs:{slot:"action"},on:{click:e.addJobVar},slot:"action"},[e._v("\n"+e._s(e.$t("message.newComponents.Taskvariables"))+"\n")]),a("Wb-form",{ref:"saveView",attrs:{rule:e.vaildateRule}},[a("Row",[a("Cell",{attrs:{span:"8",offset:"3"}},[a("Form-item",{attrs:{label:e.$t("components.RWMC"),"label-width":120,prop:"jobName"}},[a("Wb-input",{attrs:{placeholder:e.$t("components.QSRRWMC")},model:{value:e.addData.taskName,callback:function(t){e.$set(e.addData,"taskName",t)},expression:"addData.taskName"}})],1)],1),a("Cell",{attrs:{span:"8"}},[a("Form-item",{attrs:{label:e.$t("components.TXR"),"label-width":120}},[a("Wb-input",{attrs:{placeholder:e.$t("components.QSRTXR")},model:{value:e.addData.email,callback:function(t){e.$set(e.addData,"email",t)},expression:"addData.email"}})],1)],1)],1),a("Row",{staticClass:"option-margin"},[a("Cell",{attrs:{span:"8",offset:"3"}},[a("CronComponent",{model:{value:e.addData.jobCorn,callback:function(t){e.$set(e.addData,"jobCorn",t)},expression:"addData.jobCorn"}})],1),a("Cell",{attrs:{span:"8"}},[a("Form-item",{attrs:{label:e.$t("components.RWMS"),"label-width":120}},[a("Wb-input",{attrs:{placeholder:e.$t("components.SRRWMS")},model:{value:e.addData.jobDesc,callback:function(t){e.$set(e.addData,"jobDesc",t)},expression:"addData.jobDesc"}})],1)],1)],1),a("Row",{staticClass:"option-margin"},[a("Cell",{attrs:{span:"8",offset:"3"}},[a("Form-item",{attrs:{label:e.$t("components.ZXYH"),"label-width":120,prop:"executeUser",rule:[{required:!0,message:e.$t("components.XZZXYH")}]}},[a("Wb-select",{attrs:{placeholder:e.$t("components.XZZXYH")},model:{value:e.addData.execUser,callback:function(t){e.$set(e.addData,"execUser",t)},expression:"addData.execUser"}},e._l(e.executeUserList,(function(e){return a("wb-option",{key:e,attrs:{value:e}})})),1)],1)],1),a("Cell",{attrs:{span:"8"}},[a("Form-item",{attrs:{label:e.$t("components.ZXJD"),"label-width":120,prop:"executeNode"}},[a("Wb-select",{attrs:{multiple:"",placeholder:e.$t("message.newComponents.Pleaseselecttheexecutionnode")},model:{value:e.addData.execNodes,callback:function(t){e.$set(e.addData,"execNodes",t)},expression:"addData.execNodes"}},e._l(e.executeNodeList,(function(e){return a("wb-option",{key:e.id,attrs:{value:e.id,label:e.address}})})),1)],1)],1)],1),a("Row",[a("Cell",{attrs:{span:"8",offset:"3"}},[a("Form-item",{attrs:{prop:"timeOut",label:e.$t("components.CSSJ"),"label-width":120}},[a("Wb-input",{attrs:{placeholder:e.$t("components.SRCSSJ")},model:{value:e.addData.timeout,callback:function(t){e.$set(e.addData,"timeout",t)},expression:"addData.timeout"}},[a("span",{attrs:{slot:"append"},slot:"append"},[e._v("S")])])],1)],1),a("Cell",{staticClass:"stander-height",attrs:{span:"9"}},[a("Form-item",{attrs:{label:e.$t("components.TBFS"),"label-width":120}},[a("Radio-group",{on:{"on-change":e.radioChange},model:{value:e.addData.sync,callback:function(t){e.$set(e.addData,"sync",t)},expression:"addData.sync"}},[a("Radio",{attrs:{value:"FULL"}},[e._v("\n "+e._s(e.$t("components.QL"))+"\n ")]),a("Radio",{attrs:{value:"INCR",disabled:"record"===e.FesFesx.firstIsSelectRecord}},[e._v("\n "+e._s(e.$t("components.ZL"))+"\n ")])],1)],1)],1)],1),a("Row",[a("Cell",{attrs:{span:"12"}},[a("Form-item",{staticClass:"btn-wrap"},[a("Wb-button",{staticClass:"end-save-btn",attrs:{type:"primary"},on:{click:e.fivePre}},[e._v("\n "+e._s(e.$t("components.SYB"))+"\n ")])],1)],1),a("Cell",{attrs:{span:"12"}},[a("Form-item",{staticClass:"btn-wrap"},[a("Wb-button",{staticClass:"end-save-btn",attrs:{type:"primary",disabled:e.saveDisable},on:{click:e.save}},[e._v("\n "+e._s(e.$t("components.BC"))+"\n ")])],1)],1)],1)],1),a("modal",{ref:"argModal",attrs:{"footer-disable":!0,title:e.$t("message.newComponents.Taskvariables"),"close-on-click-shadow":!1,width:650}},[a("Wb-form",{ref:"varForm"},[a("Form-item",[a("Wb-button",{attrs:{icon:"plus"},on:{click:function(t){return e.sourceConfPlus()}}},[e._v("\n"+e._s(e.$t("message.newComponents.new"))+"\n")])],1),e.jobParams.length>0?e._l(e.jobParams,(function(t,s){return a("div",{key:s},[a("Row",{staticClass:"parameter-item"},[a("Cell",{attrs:{span:"7"}},[a("Form-item",{attrs:{prop:"key",rule:[{message:e.$t("message.newComponents.Fieldlengthcantmorethan")+"200",max:200},{type:"string",pattern:/^[a-zA-Z0-9_-]*$/,message:e.$t("message.newComponents.Supportonlyalphanumericunderlineandhorizontalline"),trigger:"change"}]}},[a("wb-input",{attrs:{placeholder:e.$t("message.newComponents.Pleasefilloutthe")+"key"+e.$t("message.newComponents.value")},on:{"on-blur":function(t){return e.checkHadoop("key")}},model:{value:t.key,callback:function(a){e.$set(t,"key",a)},expression:"config.key"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n key\n ")])])],1)],1),a("Cell",{attrs:{span:"1"}},[a("span",[e._v(" ")])]),a("Cell",{attrs:{span:"7"}},[a("Form-item",{attrs:{prop:"value",rule:[{message:e.$t("message.newComponents.Fieldlengthcantmorethan")+"200",max:200}]}},[a("wb-input",{attrs:{placeholder:e.$t("message.newComponents.Pleasefillinavariablesvalue")},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"config.value"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n value\n ")])])],1)],1),a("span",[e._v("  ")]),a("Cell",{staticClass:"text-dec",attrs:{span:"3"}},[a("Wb-button",{attrs:{icon:"minus"},on:{click:function(t){return e.sourceConfMinus(s)}}})],1)],1)],1)})):e._e(),a("Form-item",[a("Wb-button",{attrs:{type:"primary"},on:{click:e.jobVarConfirm}},[e._v("\n"+e._s(e.$t("message.newComponents.confirm"))+"\n")])],1)],2)],1)],1)},k=[];P._withStripped=!0;var B=a("6a55"),M=a.n(B),Z=a("efe3"),X=a.n(Z),R=a("7479"),E=a.n(R),I=a("df0a"),J=a.n(I),W=a("ce07"),O=a.n(W),j=a("14ad"),Y=a.n(j),H=a("d06c"),Q=a.n(H),U=a("fdf5"),G=a.n(U),V=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Form-item",{attrs:{label:e.$t("message.newUitemplate.timing"),"label-width":120}},[a("Wb-input",{staticClass:"cron-input",attrs:{placeholder:e.$t("components.BDS")},model:{value:e.inputCronData,callback:function(t){e.inputCronData=t},expression:"inputCronData"}}),"MIN"===e.oneSelect?a("Wb-select",{staticClass:"margin-right",staticStyle:{width:"80px"},model:{value:e.zeroSelect,callback:function(t){e.zeroSelect=t},expression:"zeroSelect"}},e._l(e.zeroList,(function(t){return a("wb-option",{key:t.value,attrs:{value:t.value}},[e._v("\n"+e._s(t.label)+"\n")])})),1):e._e(),a("Wb-select",{staticClass:"margin-right",staticStyle:{width:"80px"},on:{"on-change":e.selectOneChange},model:{value:e.oneSelect,callback:function(t){e.oneSelect=t},expression:"oneSelect"}},e._l(e.oneList,(function(t){return a("wb-option",{key:t.value,attrs:{value:t.value}},[e._v("\n"+e._s(t.label)+"\n")])})),1),e.towList.length>0?a("Wb-select",{staticClass:"margin-right",staticStyle:{width:"80px"},model:{value:e.towSelect,callback:function(t){e.towSelect=t},expression:"towSelect"}},e._l(e.towList,(function(t){return a("wb-option",{key:t.value,attrs:{value:t.value}},[e._v("\n"+e._s(t.label)+"\n")])})),1):e._e(),e.threeList.length>0?a("Wb-select",{staticClass:"margin-right",staticStyle:{width:"80px"},model:{value:e.threeSelect,callback:function(t){e.threeSelect=t},expression:"threeSelect"}},e._l(e.threeList,(function(t){return a("wb-option",{key:t.value,attrs:{value:t.value}},[e._v("\n"+e._s(t.label)+"\n")])})),1):e._e(),e.selectHourAndMinues?a("Wb-select",{staticClass:"margin-right",staticStyle:{width:"80px"},model:{value:e.fourSelect,callback:function(t){e.fourSelect=t},expression:"fourSelect"}},e._l(e.fourList,(function(t){return a("wb-option",{key:t.value,attrs:{value:t.value}},[e._v("\n"+e._s(t.label)+"\n")])})),1):e._e(),e.selectHourAndMinues?a("Wb-select",{staticClass:"margin-right",staticStyle:{width:"80px"},model:{value:e.fiveSelect,callback:function(t){e.fiveSelect=t},expression:"fiveSelect"}},e._l(e.fiveList,(function(t){return a("wb-option",{key:t.value,attrs:{value:t.value}},[e._v("\n"+e._s(t.label)+"\n")])})),1):e._e()],1)},q=[];V._withStripped=!0;var z=a("c8d7"),K=a.n(z),ee={model:{prop:"cronData",event:"parent-event"},props:{cronData:{type:String,default:""}},data:function(){return{zeroSelect:0,oneSelect:"MIN",towSelect:this.$t("message.newUitemplate.minutes"),threeSelect:"",fourSelect:"",fiveSelect:"",zeroList:[],oneList:[],towList:[],threeList:[],fourList:[],fiveList:[],selectHourAndMinues:!1,inputCronData:"",TIMEDATA:{minuesList:[],hourList:[],weekList:[{value:"2",label:this.$t("message.newUitemplate.OnMonday,")},{value:"3",label:this.$t("message.newUitemplate.OnTuesday,")},{value:"4",label:this.$t("message.newUitemplate.OnWednesday,")},{value:"5",label:this.$t("message.newUitemplate.OnThursday,")},{value:"6",label:this.$t("message.newUitemplate.OnFriday,")},{value:"7",label:this.$t("message.newUitemplate.OnSaturday,")},{value:"1",label:this.$t("message.newUitemplate.OnSunday,")}],monthList:[],dayList:[],selectType:[{value:"MIN",label:this.$t("message.newUitemplate.minutes")},{value:"HOUR",label:this.$t("message.newUitemplate.Perhour")},{value:"DAY",label:this.$t("message.newUitemplate.Everyday,")},{value:"WEEK",label:this.$t("message.newUitemplate.Onceaweek")},{value:"MONTH",label:this.$t("message.newUitemplate.Amonth")},{value:"YEAR",label:this.$t("message.newUitemplate.Everyyear,")}]}}},computed:{timeToCron:function(){return"MIN"===this.oneSelect?"0 0/".concat(this.zeroSelect," * * * ?"):"HOUR"===this.oneSelect?"0 ".concat(this.towSelect," 0/1 * * ?"):"DAY"===this.oneSelect?K()(e="0 ".concat(this.fiveSelect," ")).call(e,this.fourSelect," 1/1 * ?"):"WEEK"===this.oneSelect?K()(t=K()(a="0 ".concat(this.fiveSelect," ")).call(a,this.fourSelect," ? * ")).call(t,this.towSelect):"MONTH"===this.oneSelect?K()(s=K()(n="0 ".concat(this.fiveSelect," ")).call(n,this.fourSelect," ")).call(s,this.threeSelect," * ?"):"YEAR"===this.oneSelect?K()(i=K()(r=K()(o="0 ".concat(this.fiveSelect," ")).call(o,this.fourSelect," ")).call(r,this.threeSelect," ")).call(i,this.towSelect," ? *"):"";var e,t,a,s,n,i,r,o}},watch:{timeToCron:function(e){this.inputCronData=e},inputCronData:function(e){this.$emit("parent-event",e)},cronData:function(e){this.inputCronData=e}},created:function(){for(var e=0;e<60;e++)this.TIMEDATA.minuesList.push({value:e,label:e<10?"0"+e+this.$t("message.newUitemplate.points"):String(e)+this.$t("message.newUitemplate.points")});for(var t=0;t<24;t++)this.TIMEDATA.hourList.push({value:t,label:t<10?"0"+t+this.$t("message.newUitemplate.when"):String(t)+this.$t("message.newUitemplate.when")});for(var a=1;a<=12;a++)this.TIMEDATA.monthList.push({value:a,label:a<10?"0"+a+this.$t("message.newUitemplate.month"):String(a)+this.$t("message.newUitemplate.month")});for(var s=1;s<=31;s++)this.TIMEDATA.dayList.push({value:s,label:s<10?"0"+s+this.$t("message.newUitemplate.day"):String(s)+this.$t("message.newUitemplate.day")});for(var n=[],i=0;i<60;i++)n.push({value:i,label:i<10?"".concat(this.$t("message.newUitemplate.every"),"0")+i:this.$t("message.newUitemplate.every")+String(i)});this.zeroList=n,this.oneList=this.TIMEDATA.selectType,this.fourList=this.TIMEDATA.hourList,this.fiveList=this.TIMEDATA.minuesList},methods:{selectOneChange:function(e){"MIN"===e?(this.zeroSelect=this.zeroList[0].value,this.towList=[],this.threeList=[],this.selectHourAndMinues=!1):"HOUR"===e?(this.towList=this.TIMEDATA.minuesList,this.towSelect=this.towList[0].value,this.selectHourAndMinues=!1):"DAY"===e?(this.selectHourAndMinues=!0,this.towList=[],this.threeList=[],this.fourSelect=this.fourList[0].value,this.fiveSelect=this.fiveList[0].value):"WEEK"===e?(this.selectHourAndMinues=!0,this.threeList=[],this.towList=this.TIMEDATA.weekList,this.towSelect=this.towList[0].value,this.fourSelect=this.fourList[0].value,this.fiveSelect=this.fiveList[0].value):"MONTH"===e?(this.selectHourAndMinues=!0,this.towList=[],this.threeList=this.TIMEDATA.dayList,this.threeSelect=this.threeList[0].value,this.fourSelect=this.fourList[0].value,this.fiveSelect=this.fiveList[0].value):"YEAR"===e&&(this.selectHourAndMinues=!0,this.towList=this.TIMEDATA.monthList,this.threeList=this.TIMEDATA.dayList,this.towSelect=this.towList[0].value,this.threeSelect=this.threeList[0].value,this.fourSelect=this.fourList[0].value,this.fiveSelect=this.fiveList[0].value)},setDispatch:function(e){if(e){var t=this.cronData.split(" ");t.length>=7?(this.oneSelect="YEAR",this.selectHourAndMinues=!0,this.towList=this.TIMEDATA.monthList,this.threeList=this.TIMEDATA.dayList,this.towSelect=Number(t[4]),this.threeSelect=Number(t[3]),this.fourSelect=Number(t[2]),this.fiveSelect=Number(t[1])):"*"===t[4]&&"*"!==t[3]&&"1/1"!==t[3]&&"?"!==t[3]?(this.selectHourAndMinues=!0,this.oneSelect="MONTH",this.towList=[],this.threeList=this.TIMEDATA.dayList,this.threeSelect=Number(t[3]),this.fourSelect=Number(t[2]),this.fiveSelect=Number(t[1])):"?"!==t[5]?(this.oneSelect="WEEK",this.selectHourAndMinues=!0,this.towList=this.TIMEDATA.weekList,this.threeList=[],this.towSelect=t[5],this.fourSelect=Number(t[2]),this.fiveSelect=Number(t[1])):"*"===t[4]&&"1/1"===t[3]&&"*"!==t[2]&&"0/1"!==t[2]?(this.oneSelect="DAY",this.selectHourAndMinues=!0,this.towList=[],this.threeList=[],this.fourSelect=Number(t[2]),this.fiveSelect=Number(t[1])):"*"===t[4]&&"*"===t[3]&&"0/1"===t[2]?(this.oneSelect="HOUR",this.towList=this.TIMEDATA.minuesList,this.towSelect=Number(t[1])):"*"===t[4]&&"*"===t[3]&&"*"===t[2]&&(this.zeroSelect=Number(t[1].substring(2)),this.oneSelect="MIN",this.threeList=[],this.selectHourAndMinues=!1)}}}},te=ee,ae=(a("cd9c"),Object(o["a"])(te,V,q,!1,null,null,null));ae.options.__file="src/components/uiTemplate/corn.fes";var se=ae.exports,ne={props:{editData:{type:null},saveDisable:{type:Boolean,default:!1}},components:{CronComponent:se},FesData:function(){return{addData:{email:"",taskName:"",jobCorn:"",jobDesc:"",sync:"FULL",execUser:"",execNodes:[],timeout:"43200",jobParams:{}},executeUserList:[],executeNodeList:[],timeoutIsError:!1,timeoutErroeText:"",jobParams:[],vaildateRule:{jobName:[{required:!0,message:this.$t("components.TXRWM")}],executeNode:[{required:!0,message:this.$t("message.newComponents.Pleaseselecttheexecutionnode")}],vldNum:[{required:!0,message:this.$t("message.newComponents.Pleaseenterthechecknumber")},{type:"string",pattern:/^[a-z0-9]*$/,message:this.$t("message.newComponents.SupportonlylettersandNumbers"),trigger:"change"}],vldType:[{required:!0,message:this.$t("message.newComponents.Pleaseselectacalibrationtype")}],timeOut:[{message:this.$t("components.DXBNCG"),max:5},{type:"string",pattern:/^[0-9]*$/,message:this.$t("components.ZZCSZ"),trigger:"change"}]}}},FesReady:function(){var e,t=this;this.editData&&(this.addData.taskName=this.editData.jobName,this.addData.email=this.editData.alarmUser,this.addData.jobCorn=this.editData.jobCorn,this.addData.jobDesc=this.editData.jobDesc,this.addData.sync=this.editData.sync||"FULL",this.addData.execUser=this.editData.execUser||"",this.addData.timeout=String(this.editData.timeout)||"",this.editData.jobParams&&G()(this.editData.jobParams).length>0&&(this.jobParams=[],Q()(e=G()(this.editData.jobParams)).call(e,(function(e,a){t.jobParams.push({key:e,value:t.editData.jobParams[e],icon:"minus"})}))))},watch:{"FesFesx.firstIsSelectRecord":function(e){"record"===e&&(this.addData.sync="FULL")},executeNodeList:function(e){if(this.editData&&this.editData.execNodes){var t,a=Y()(t=this.editData.execNodes).call(t,(function(t){var a;return O()(a=J()(e).call(e,(function(e){return e.id}))).call(a,t)}));this.addData.execNodes=a?this.editData.execNodes:[]}}},methods:{getUserAndNodeList:function(){var e=this,t=this.FesFesx.enginSelect;E.a.all([this.FesApi.fetch("/exec/user/list","get"),this.FesApi.fetch("/exec/node/list/".concat(t),"get")]).then((function(t){e.executeUserList=t[0],e.executeNodeList=t[1],e.editData||(e.addData.execUser=e.FesApp.get("FesUserName"))}))},save:function(){var e=this;this.$refs.saveView.validate((function(t){t&&e.$emit("save",e.addData)}))},fivePre:function(){this.$emit("fivePre",!0)},radioChange:function(e){},addJobVar:function(){this.$refs.argModal.show()},sourceConfPlus:function(){this.jobParams.push({key:"",value:"",icon:"minus"})},sourceConfMinus:function(e){var t;X()(t=this.jobParams).call(t,e,1)},checkHadoop:function(e){var t,a=[];if(Q()(t=this.jobParams).call(t,(function(t){a.push(t[e])})),this.checkHadoopRegex(a))return this.$Toast.error(this.$t("message.newComponents.Taskvariablesexistduplicatekey/valuepair")),!0},checkHadoopRegex:function(e){for(var t=M()(e).call(e),a=0;a32768&&s(new Error("".concat(e.$t("components.NCBCG"),"32G"))),a<64&&s(new Error("".concat(e.$t("message.newComponents.Notlessthanminimummemory"),"64M"))),s()},a=function(t,a,s){a>999&&s(new Error("".concat(e.$t("components.ZYZDBXSBCG"),"999"))),s()},s=function(t,a,s){a>102400&&s(new Error("".concat(e.$t("components.ZYSLBCG"),"100G"))),s()};return{speed:{mBytes:"10",record:"10000"},errorLimit:{record:"1"},numVPattern:new RegExp(/[^0-9]+/),ruleValidate:{speedLimit:[{required:!0,message:this.$t("components.SRZQZYSL")},{validator:s,trigger:"blur"}],jobLimit:[{required:!0,message:this.$t("components.ZQSRZYJLSXZ")}],errorLimit:[{required:!0,message:this.$t("components.QSRZQCWJLS")}],mParallel:[{required:!1,message:this.$t("components.SRZQQZYZDBXS")},{validator:a,trigger:"blur"}],mMemory:[{required:!1,message:this.$t("components.SRZQZYZDNC")},{validator:t,trigger:"blur"}]},advance:{advanceOption:!1,mParallel:null,mMemory:null}}},computed:{isShowErrorLimit:function(){return"hive"===this.FesFesx.FirstCurrentDataSourceType&&"hive"===this.FesFesx.secondCurrentDataSourceType}},FesReady:function(){""!=this.editData&&(this.speed.mBytes=this.editData.config.speed.mBytes,this.speed.record=this.editData.config.speed.record,this.errorLimit.record=this.editData.config.errorLimit.record,this.advance.advanceOption=this.editData.config.advance.advanceOption,this.advance.mParallel=this.editData.config.advance.mParallel||null,this.advance.mMemory=this.editData.config.advance.mMemory||null)},methods:{mBytes_v:function(){this.numVPattern.test(this.speed.mBytes)&&(this.speed.mBytes="")},record_v:function(){this.numVPattern.test(this.speed.record)&&(this.speed.record="")},errorRecord_v:function(){this.numVPattern.test(this.errorLimit.record)&&(this.errorLimit.record="")},mParallelCheck:function(){},mMemoryCheck:function(){},partFourPre:function(){this.$emit("fourPre",!0)},partFourNext:function(){var e=this;this.$refs.speedControl.validate((function(t){t&&("stream"===e.FesFesx.firstIsSelectRecord&&(e.speed.record="",e.errorLimit.record=""),e.$emit("fourNext",e.speed,e.errorLimit,e.advance))}))},clear:function(){this.speed.mBytes="",this.speed.record="",this.errorLimit.record=""}}},de=ue,he=(a("3a23"),Object(o["a"])(de,le,ce,!1,null,"4645eaf4",null));he.options.__file="src/components/jobAddStepFour.fes";var pe=he.exports,me=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Panel",{attrs:{title:e.$t("components.XZSJY")}},[a("Wb-form",{ref:"DataSource",attrs:{rule:e.ruleValidate}},[a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("components.SJYLX"),"label-width":120}},[a("Wb-select",{on:{"on-change":e.typeChange},model:{value:e.addData.type,callback:function(t){e.$set(e.addData,"type",t)},expression:"addData.type"}},e._l(e.dataSourceTypeList,(function(e){return a("wb-option",{key:e,attrs:{value:e}})})),1)],1)],1)],1),"hive"===e.addData.type||""===e.addData.type?[a("hiveOne",{attrs:{"add-data":e.addData,"source-origin":e.sourceOrigin,"db-data-list":e.dbDataList,"table-list":e.tableList,"part-val":e.partVal,ds_loading:e.ds_loading,db_loading:e.db_loading,table_loading:e.table_loading,part_loading:e.part_loading,"is-one-step":!0},on:{sourceChange:e.sourceChange,dbSeleted:e.dbSeleted,tableValueChange:e.tableValueChange,partValueSelect:e.partValueSelect,partCustom:e.partCustom,partCustomClear:e.partCustomClear}})]:e._e(),"local_fs"===e.addData.type?[a("localFsOne",{attrs:{"local-fs-data":e.localFsData},on:{localFsData:e.localFsDataAction}})]:e._e(),"hdfs"===e.addData.type?[a("hdfsOne",{attrs:{"step-one-data":e.hdfsData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading},on:{stepOneData:e.hdfsDataAction}})]:e._e(),"sftp"===e.addData.type?[a("sftpOne",{attrs:{"step-one-data":e.sftpData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading},on:{stepOneData:e.sftpDataAction}})]:e._e(),"mysql"===e.addData.type?[a("mysql",{attrs:{"step-one-data":e.tdsqlData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading,"db-data-list":e.tdsqlValue.dbs,"table-list":e.tdsqlValue.tables,ds_loading:e.ds_loading,db_loading:e.db_loading,table_loading:e.table_loading},on:{stepOneData:e.tdsqlDataAction,sourceChange:e.tdsqlSourceChange,dbSeleted:e.tdsqlDbSeleted,tableValueChange:e.tdsqlTableValueChange,addTable:e.addTable,deleteTable:e.deleteTable,linkCoditionClick:e.linkCoditionClick}})]:e._e(),"oracle"===e.addData.type?[a("oracle",{attrs:{"step-one-data":e.oracleData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading,"db-data-list":e.oracleValue.dbs,"table-list":e.oracleValue.tables,ds_loading:e.ds_loading,db_loading:e.db_loading,table_loading:e.table_loading},on:{stepOneData:e.tdsqlDataAction,sourceChange:e.oracleSourceChange,dbSeleted:e.oracleDbSeleted,tablesAddInputValue:e.oracleDbTablesAddInputValue}})]:e._e(),a("Form-item",[a("Row",[a("Cell",{attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.preview}},[e._v("\n "+e._s(e.$t("components.SYB"))+"\n ")])],1),a("Cell",{attrs:{span:"12"}},[a("Wb-button",{staticClass:"next-button",attrs:{type:"primary",disabled:e.nextStepButtonDisable},on:{click:e.parNextStep}},[e._v("\n "+e._s(e.$t("components.XYB"))+"\n ")])],1)],1)],1)],2),a("weModal",{attrs:{title:e.$t("components.LJTJPZ"),width:"800","close-text":e.$t("components.QX")},on:{onConfirm:e.addLinkConfirm,onClose:e.addLinkClose},model:{value:e.linkCoditionShow,callback:function(t){e.linkCoditionShow=t},expression:"linkCoditionShow"}},[a("Wb-form",[a("Form-item",[a("Row",{staticClass:"text-center"},[a("Cell",{attrs:{span:"7"}},[e._v("\n "+e._s(e.$t("components.QBZDXX"))+"\n ")]),a("Cell",{attrs:{span:"1"}},[a("span",[e._v(" ")])]),a("Cell",{attrs:{span:"3"}},[e._v("\n "+e._s(e.$t("components.LJTJ"))+"\n ")]),a("Cell",{attrs:{span:"1"}},[a("span",[e._v(" ")])]),a("Cell",{attrs:{span:"7"}},[e._v("\n "+e._s(e.$t("components.DQBZDXX"))+"\n ")])],1)],1),e._l(e.currentLink,(function(t,s){return[a("Form-item",{key:s},[a("Row",{staticClass:"text-center"},[a("Cell",{attrs:{span:"7"}},[a("Wb-select",{attrs:{width:"70%"},model:{value:t.left,callback:function(a){e.$set(t,"left",a)},expression:"item.left"}},e._l(e.column.preValue,(function(e,t){return a("wb-option",{key:t,attrs:{lable:e.name,value:e.name}})})),1)],1),a("Cell",{attrs:{span:"1"}},[a("span",[e._v(" ")])]),a("Cell",{attrs:{span:"3"}},[a("Wb-select",{attrs:{width:"70%"},model:{value:t.condition,callback:function(a){e.$set(t,"condition",a)},expression:"item.condition"}},[a("wb-option",{attrs:{lable:"=",value:"="}})],1)],1),a("Cell",{attrs:{span:"1"}},[a("span",[e._v(" ")])]),a("Cell",{attrs:{span:"7"}},[a("Wb-select",{attrs:{width:"70%"},model:{value:t.right,callback:function(a){e.$set(t,"right",a)},expression:"item.right"}},e._l(e.column.currentValue,(function(e,t){return a("wb-option",{key:t,attrs:{lable:e.name,value:e.name}})})),1)],1),a("Cell",{staticClass:"text-dec",attrs:{span:"4"}},[0===s?a("Wb-button",{attrs:{icon:"plus"},on:{click:e.addCodition}}):e._e(),0!==s||e.currentLink.length>1?a("Wb-button",{attrs:{icon:"minus"},on:{click:function(t){return e.minusCodition(s)}}}):e._e()],1)],1)],1)]})),a("Form-item",[a("Row",[a("Cell",{attrs:{span:"24"}})],1)],1)],2)],1)],1)},fe=[];me._withStripped=!0;var be=a("5940"),ge=a.n(be),De=a("a0fb"),Se=a.n(De),ve=a("ee2c"),Ce=a.n(ve),ye=a("1576"),we=a.n(ye),Te=a("99b3"),Fe=a.n(Te),$e=a("ca14"),xe=a.n($e),_e=a("eee8"),Ae=a.n(_e),Le=a("914a"),Ne=a.n(Le),Pe=a("5e50"),ke=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.LJ"),prop:"path","label-width":120}},[a("wb-input",{attrs:{placeholder:e.$t("uiTemplate.SRLJ")},model:{value:e.subData.path,callback:function(t){e.$set(e.subData,"path",t)},expression:"subData.path"}})],1)],1),"record"===e.subData.transfer?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.YSLX"),"label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.XZYSLX")},model:{value:e.subData.compress,callback:function(t){e.$set(e.subData,"compress",t)},expression:"subData.compress"}},e._l(e.localFsCompressList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),1)],1)],1):e._e(),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.BM"),prop:"encoding","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.QXZBM")},model:{value:e.subData.encoding,callback:function(t){e.$set(e.subData,"encoding",t)},expression:"subData.encoding"}},e._l(e.encodingList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),1)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.CSGS"),prop:"transfer","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.QXZCSFS")},on:{"on-change":e.transferchange},model:{value:e.subData.transfer,callback:function(t){e.$set(e.subData,"transfer",t)},expression:"subData.transfer"}},[a("wb-option",{attrs:{value:"stream",label:e.$t("uiTemplate.EJZ")}}),a("wb-option",{attrs:{value:"record",label:e.$t("uiTemplate.JL")}})],1)],1)],1),e.skipHeaderShow?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.TGSH"),"label-width":120}},[a("Checkbox",{model:{value:e.subData.skipHeader,callback:function(t){e.$set(e.subData,"skipHeader",t)},expression:"subData.skipHeader"}})],1)],1):e._e(),"record"===e.subData.transfer?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.ZDFGF"),prop:"fieldDelimiter","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-search":e.search},model:{value:e.subData.fieldDelimiter,callback:function(t){e.$set(e.subData,"fieldDelimiter",t)},expression:"subData.fieldDelimiter"}},e._l(e.options,(function(t){return a("Wb-option",{key:t.label,attrs:{value:t.value}},[e._v("\n "+e._s(t.label)+"\n ")])})),1)],1)],1):e._e()],1)},Be=[];ke._withStripped=!0;var Me=a("3a6f"),Ze=a.n(Me),Xe=a("97f9"),Re=a.n(Xe),Ee=a("56ed"),Ie=a.n(Ee),Je=a("9789"),We=a.n(Je),Oe={data:function(){return{options:[{label:",",value:","},{label:";",value:","},{label:"\\u0001",value:"\\u0001"}]}},created:function(){var e=this;if(this.subData.fieldDelimiter){var t;if(Y()(t=this.options).call(t,(function(t){return t.value===e.subData.fieldDelimiter})))return;this.options.push({label:this.subData.fieldDelimiter,value:this.subData.fieldDelimiter})}},methods:{search:function(e){e?(this.options=[{label:e,value:e}],this.subData.fieldDelimiter=e):(this.options=[{label:",",value:","},{label:";",value:","},{label:"\\u0001",value:"\\u0001"}],this.subData.fieldDelimiter="")},deUnicode:function(e){var t=e.split("\\u");We()(e).call(e,"\\u")&&(t=Ie()(t).call(t,1,t.length)),Re()(e).call(e,"\\u")&&(t=Ie()(t).call(t,0,t.length-1));for(var a="",s=0;s=26?(t=getTableName(e/26-1),t+=String.fromCharCode(65+e%26)):t+=String.fromCharCode(65+e),t})),linkCoditionClick:function(e){this.$emit("linkCoditionClick",e)}}},gt=bt,Dt=(a("84b0"),Object(o["a"])(gt,ht,pt,!1,null,"52da4597",null));Dt.options.__file="src/components/uiTemplate/tdsqlOne.fes";var St=Dt.exports,vt=a("4828"),Ct=a("753e"),yt=a.n(Ct),wt=a("2478"),Tt={data:function(){var e=this,t=function(t,a,s){var n=/^\\$/,i=/^\\u/;n.test(a)?s(new Error(e.$t("mixin.FGFBCC"))):i.test(a)&&4!=a.split("\\u")[1].length?s(new Error(e.$t("mixin.QZQTX"))):s()},a=function(t,a,s){a>1e5?s(new Error(e.$t("mixin.PLDXBCG"))):s()};return{partVal:[{name:"",value:"",partitions:{}}],sourceShow:!0,addData:{type:"",dataSourceValue:"",dataSourceId:"",db:"",table:"",DBData:"",partitions:"",partValueList:"",transfer:"record"},part_loading:!1,ds_loading:!1,db_loading:!1,table_loading:!1,sourceOrigin:[],dbDataList:[],tableList:[],partKey:"",partValCache:{},nextStepButtonDisable:!1,ruleValidate:{source:[{required:!0,message:this.$t("mixin.SJYBNK")}],path:[{required:!0,message:"path".concat(this.$t("mixin.BBK"))},{type:"string",pattern:/^[^ ]+$/,message:this.$t("mixin.LJBKBJKG"),trigger:"blur"}],encoding:[{type:"string",pattern:/^(ISO-8859-1|GB2312|GBK|UTF-8|UTF-16)$/,message:this.$t("mixin.BMLXZC"),trigger:"change"}],fieldDelimiter:[{validator:t,trigger:"change"},{type:"string",pattern:/^[^\u4e00-\u9fa5!……、,。’;()¥]+$/,message:this.$t("mixin.CZBNRSZW"),trigger:"change"}],transfer:[{required:!0,message:"transfer".concat(this.$t("mixin.BBK"))}],fielType:[{required:!0,message:this.$t("mixin.QXZWJLX")}],database:[{required:!0,message:this.$t("mixin.SJKBNNQJ")}],tableTow:[{required:!0,message:this.$t("mixin.BBNWK")}],indexName:[{required:!0,message:this.$t("mixin.SYMCBNWK")},{type:"string",pattern:/^[a-zA-Z][a-zA-Z0-9#${}_.-]*$/,message:this.$t("mixin.BXYZMKR"),trigger:"change"}],indexType:[{required:!0,message:this.$t("mixin.STLXBNWK")}],writeMode:[{required:!0,message:this.$t("mixin.DRFSBNWK")}],batchSize:[{validator:a}]}}},methods:{getSourceDataList:function(e){var t=this;""!=e&&(this.ds_loading=!0,this.FesApi.fetch("/datasource/selectAll",{sourceType:e,projectIds:this.treeId},"get").then((function(e){t.ds_loading=!1,t.sourceOrigin=J()(e).call(e,(function(e){return{id:e.id,sourceName:e.sourceName}}))}))["catch"]((function(){return t.ds_loading=!1})))},sourceChange:function(e){var t=this;if(this.addData.DBData="",this.addData.table="",this.dbDataList=[],this.tableList=[],this.partKey=[],this.partVal=[{name:"",value:"",partitions:{}}],""==e)return!1;this.db_loading=!0,this.FesApi.fetch("/datasource/meta/hive/"+e+"/dbs",{},{method:"get",timeout:"60000"}).then((function(e){t.db_loading=!1,t.dbDataList="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.db_loading=!1}))},dbSeleted:function(e){var t=this;this.addData.table="",this.tableList=[],this.partKey="",this.partVal=[{name:"",value:"",partitions:{}}],""!=e&&(this.table_loading=!0,this.FesApi.fetch("/datasource/meta/hive/"+this.addData.dataSourceId+"/"+e+"/tables",{},{method:"get",timeout:"60000"}).then((function(e){t.table_loading=!1,t.tableList="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.table_loading=!1})),this.addData.db=e)},tableValueChangeAction:function(e,t){var a=this;this.addData.table=e,this.partKey="",this.partVal=[{name:"",value:"",partitions:{}}],""!=e&&(this.part_loading=!0,this.FesApi.fetch("/datasource/meta/hive/"+this.addData.dataSourceId+"/"+this.addData.db+"/"+e+"/partitions",{},{method:"get",timeout:"60000"}).then((function(s){a.part_loading=!1;var n=s.root;if("undefined"!==typeof n.name?(a.timeTemplate(n),a.partVal=[n]):s.partKeys.length>0&&(n={name:s.partKeys[0],value:"",partitions:{}},a.timeTemplate(n),a.partVal=[n]),""!==a.editData&&a.editData.config[t].partitions&&""!==a.editData.config[t].partitions&&e===a.editData.config[t].table){var i=a.editData.config[t].partitions.split(",")[0];""===yt()(e).call(e)||n.partitions[i]||(n.custom=i,a.partCustom(n)),n.value=i}a.partValCache=s}))["catch"]((function(){return a.part_loading=!1}))),""!==this.addData.dataSourceId&&""!==this.addData.db&&""!==e&&this.FesApi.fetch("/datasource/meta/hive/"+this.addData.dataSourceId+"/"+this.addData.db+"/"+e+"/fields",{},{method:"get",timeout:"60000"}).then((function(e){a.addData.partValueList=e,a.nextStepButtonDisable=!1}))["catch"]((function(){a.nextStepButtonDisable=!0}))},partValueSelectAction:function(e,t,a,s){var n,i=X()(n=this.partVal).call(n,e+1);if(i.length>0)for(var r in i)"object"===Object(vt["a"])(i[r])&&(i[r].value="");if(""!==t){var o=a[t];if("undefined"!==typeof o&&"undefined"!==typeof o.name?(this.timeTemplate(o),this.partVal.push(o)):"undefined"!==typeof o&&e+10){var a=[];for(var s in this.partVal){var n=this.partVal[s].value;"undefined"!==typeof n&&""!==n&&a.push(n)}a.length>0&&(this.addData.partitions=a.join(","))}this.$refs.DataSource.validate((function(t){t&&e.$emit("nextStep",e.addData)}))}else this.$refs.DataSource.validate((function(t){if(t)if(e.addData.type===wt["b"].MYSQL&&e.tdsqlData.table<=0)e.tdsqlData.errorShow=!0;else if(e.addData.type===wt["b"].ORACLE){var a,s;console.log(122);var n=e.oracleData,i=n.dataSourceId,r=n.DBData,o=n.table;e.FesApi.fetch(K()(a=K()(s="/datasource/meta/oracle/".concat(i,"/")).call(s,r,"/")).call(a,o,"/check"),{},{method:"get",timeout:"60000"}).then((function(t){t&&e.$emit("nextStep",e[e.typeTransitionDataName(e.addData.type)])}))}else e.$emit("nextStep",e[e.typeTransitionDataName(e.addData.type)]);else e.addData.type===wt["b"].MYSQL&&e.tdsqlData.table<=0&&(e.tdsqlData.errorShow=!0)}))},localFsDataAction:function(e){this.localFsData=e},hdfsDataAction:function(e){this.hdfsData=e},sftpDataAction:function(e){this.sftpData=e},tdsqlDataAction:function(e){this.tdsqlData=e},timeTemplate:function(e){e.partitions["${yyyyMMdd}"]={},e.partitions["${yyyy-MM-dd}"]={},e.partitions["${run_date-1}"]={},e.partitions["${run_date-7}"]={},e.partitions["${run_month_begin-1}"]={},e.partitions["${run_month_end-1}"]={},e.partitions["${run_date}"]={}},typeTransitionDataName:function(e){switch(e){case wt["b"].HIVE:return"addData";case wt["b"].HDFS:return"hdfsData";case wt["b"].SFTP:return"sftpData";case wt["b"].MYSQL:return"tdsqlData";case wt["b"].ELASTICSEARCH:return"elasticSearchData";case wt["b"].LOCAL_FS:return"localFsData";case wt["b"].ORACLE:return"oracleData";default:break}},changeDataSourceId:function(e,t,a){if(e)for(var s in t)if(this.editData[a]===t[s].id)return void(this[e].dataSourceId=this.editData[a])}}},Ft=a("58df"),xt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.SJY"),prop:"source","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.sourceChange},model:{value:e.subData.dataSourceId,callback:function(t){e.$set(e.subData,"dataSourceId",t)},expression:"subData.dataSourceId"}},[e._l(e.sourceOrigin,(function(e,t){return a("wb-option",{key:t,attrs:{value:e.id,label:e.sourceName}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.ds_loading,expression:"ds_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.KM"),prop:"database","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.dbSeleted},model:{value:e.subData.DBData,callback:function(t){e.$set(e.subData,"DBData",t)},expression:"subData.DBData"}},[e._l(e.dbDataList,(function(e,t){return a("wb-option",{key:t,attrs:{value:e}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.db_loading,expression:"db_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.TABLENAMW"),prop:"tableTow","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.tableValueChange,"on-search":e.filterSearch},model:{value:e.subData.table,callback:function(t){e.$set(e.subData,"table",t)},expression:"subData.table"}},[e._l(e.tableList,(function(e,t){return a("wb-option",{key:t,attrs:{value:e,label:e}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.table_loading,expression:"table_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.TJ"),prop:"where","label-width":120}},[a("wb-input",{attrs:{placeholder:e.$t("uiTemplate.QSR")},model:{value:e.subData.where,callback:function(t){e.$set(e.subData,"where",t)},expression:"subData.where"}})],1)],1)],1)},_t=[];xt._withStripped=!0;var At={name:"tdsqlSecond",props:{stepOneData:{tepy:Object,default:{}},sourceOrigin:{tepy:Array,default:[]},dbDataList:{type:Array,default:[]},tableList:{type:Array,default:[]},ds_loading:{type:Boolean,default:!1},db_loading:{type:Boolean,default:!1},table_loading:{type:Boolean,default:!1}},data:function(){return{subData:this.stepOneData,showSelect:!1,optionIndex:"",alias:[],tableNameContact:{}}},watch:{subData:{handler:function(e){this.$emit("stepOneData",e)},deep:!0},"subData.table":function(e,t){}},computed:{writeModeList:function(){return"SQOOP"===this.FesFesx.enginSelect?["updateonly","allowinsert"]:["insert","replace","update"]}},methods:{sourceChange:function(e){this.$emit("sourceChange",e)},dbSeleted:function(e){this.$emit("dbSeleted",e)},tableValueChange:function(e){this.$emit("tableValueChange",e)},filterSearch:function(e){var t;e&&(Y()(t=this.tableList).call(t,(function(t){return O()(t).call(t,e)}))||this.$emit("tablesAddInputValue",e))}}},Lt=At,Nt=(a("932c"),Object(o["a"])(Lt,xt,_t,!1,null,"e18105f6",null));Nt.options.__file="src/components/uiTemplate/oracleOne.fes";var Pt=Nt.exports;function kt(e,t){var a=G()(e);if(Fe.a){var s=Fe()(e);t&&(s=Ae()(s).call(s,(function(t){return we()(e,t).enumerable}))),a.push.apply(a,s)}return a}function Bt(e){for(var t=1;t0&&""!==this.editData&&this.changeDataSourceId(this.typeTransitionDataName(this.editData.dataSrcType),e,"dataSrcId")},dbDataList:function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataSrcParams.database)&&(this.addData.DBData=this.editData.config.dataSrcParams.database)},tableList:function(e){e.length>0&&this.editData.config&&""!==this.editData.config.dataSrcParams.table&&O()(e).call(e,this.editData.config.dataSrcParams.table)&&(this.addData.table=this.editData.config.dataSrcParams.table)},"tdsqlValue.dbs":function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataSrcParams.database)&&(this.tdsqlData.DBData=this.editData.config.dataSrcParams.database)},"tdsqlValue.tables":function(e){var t=this;if(e.length>0&&""!==this.editData){var a,s=!0;if(J()(a=this.editData.config.dataSrcParams.table).call(a,(function(t){O()(e).call(e,t)||(s=!1)})),s){var n;this.tdsqlData.table=this.editData.config.dataSrcParams.table,this.tdsqlData.join=this.editData.config.dataSrcParams.join;var i=J()(n=this.tdsqlData.table).call(n,(function(e){return t.FesApi.fetch("/datasource/meta/mysql/"+t.tdsqlData.dataSourceId+"/"+t.tdsqlData.DBData+"/"+e+"/fields",{},{method:"get",timeout:"60000"})}));E.a.all(i).then((function(e){t.column.preValue=e[i.length-2],t.column.currentValue=e[i.length-1]}))["catch"]((function(){}))}else this.tdsqlData.table=[],this.tdsqlData.join=[]}},"column.preValue":function(e){!this.currentLink[0].left&&e&&(this.currentLink[0].left=e[0].name)},"column.currentValue":function(e){this.currentLink[0].right||(this.currentLink[0].right=e[0].name)},"oracleValue.dbs":function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataSrcParams.database)&&(this.oracleData.DBData=this.editData.config.dataSrcParams.database)},"oracleValue.tables":function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataSrcParams.table)&&(this.oracleData.table=this.editData.config.dataSrcParams.table)}},FesReady:function(){this.editData?this.editorAction(this.editData):(this.addData.type=wt["b"].HIVE,this.FesFesx.set("firstIsSelectRecord","record"))},methods:{typeChange:function(e){this.FesFesx.set("FirstCurrentDataSourceType",e),this.nextStepButtonDisable=!1,this.addData.dataSourceValue="",this.addData.dataSourceId="",this.addData.DBData="",this.addData.table="",this.sourceOrigin=[],this.dbDataList=[],this.tableList=[],this.partKey="",this.partVal=[{name:"",value:"",partitions:{}}],e===wt["b"].HIVE?(this.FesFesx.set("firstIsSelectRecord",this.addData.transfer),this.getSourceDataList(e)):e===wt["b"].LOCAL_FS?this.localFsData.type=e:e===wt["b"].SFTP?(this.sftpData.type=e,this.getSourceDataList(e)):e===wt["b"].MYSQL?(this.FesFesx.set("firstIsSelectRecord",wt["c"].RECORD),this.tdsqlData.type=e,this.getSourceDataList(e)):e===wt["b"].HDFS?(this.hdfsData.type=e,this.getSourceDataList(e)):e===wt["b"].ORACLE&&(this.FesFesx.set("firstIsSelectRecord",wt["c"].RECORD),this.oracleData.type=e,this.getSourceDataList(e))},editorAction:function(e){e&&(this.FesFesx.set("FirstCurrentDataSourceType",e.config.dataSrcParams.type),this.FesFesx.set("firstIsSelectRecord",e.config.transportType),this.addData.type=e.config.dataSrcParams.type,e.config.dataSrcParams.type===wt["b"].LOCAL_FS?(this.localFsData=Bt({},e.config.dataSrcParams),this.localFsData.transfer=e.config.transportType):e.config.dataSrcParams.type===wt["b"].HDFS?(this.hdfsData=Bt({},e.config.dataSrcParams),this.hdfsData.transfer=e.config.transportType):e.config.dataSrcParams.type===wt["b"].SFTP?(this.sftpData=Bt({},e.config.dataSrcParams),this.sftpData.transfer=e.config.transportType):e.config.dataSrcParams.type===wt["b"].HIVE?this.addData.transfer=e.config.transportType:e.config.dataSrcParams.type===wt["b"].MYSQL?this.tdsqlData=Bt({},e.config.dataSrcParams):e.config.dataSrcParams.type===wt["b"].ORACLE&&(this.oracleData=Bt({},e.config.dataSrcParams)))},tableValueChange:function(e){this.tableValueChangeAction(e,"dataSrcParams")},partValueSelect:function(e){var t=e.index,a=e.value,s=e.partitions;this.partValueSelectAction(t,a,s,"dataSrcParams")},preview:function(){this.$emit("preStep")},addTable:function(e){var t=this;if(""!==this.tdsqlData.dataSourceId&&""!==this.tdsqlData.DBData&&this.tdsqlData.table.length>1){var a,s=J()(a=this.tdsqlData.table).call(a,(function(e){return t.FesApi.fetch("/datasource/meta/mysql/"+t.tdsqlData.dataSourceId+"/"+t.tdsqlData.DBData+"/"+e+"/fields",{},{method:"get",timeout:"60000"})}));E.a.all(s).then((function(e){t.column.preValue=e[s.length-2],t.column.currentValue=e[s.length-1],Ne()(t.tdsqlData.table)&&t.tdsqlData.table.length>1&&(t.linkCoditionShow=!0,t.linkTableIndex=t.tdsqlData.join.length,t.initCurrentLinkCodition())}))["catch"]((function(){}))}},deleteTable:function(){var e,t=this;this.tdsqlData.table.length<2?this.tdsqlData.join=[]:this.tdsqlData.join=Ae()(e=this.tdsqlData.join).call(e,(function(e,a){return a<=t.tdsqlData.table.length-2}))},tdsqlTableValueChange:function(e){},tdsqlSourceChange:function(e){var t=this;if(this.tdsqlData.DBData="",this.tdsqlData.table=[],this.tdsqlValue.dbs=[],this.tdsqlValue.tables=[],this.tdsqlData.join=[],""==e)return!1;this.db_loading=!0,this.FesApi.fetch("/datasource/meta/mysql/"+e+"/dbs",{},{method:"get",timeout:"60000"}).then((function(e){t.db_loading=!1,t.tdsqlValue.dbs="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.db_loading=!1}))},tdsqlDbSeleted:function(e){var t=this;this.tdsqlData.table=[],this.tdsqlValue.tables=[],this.tdsqlData.join=[],""!=e&&(this.table_loading=!0,this.FesApi.fetch("/datasource/meta/mysql/"+this.tdsqlData.dataSourceId+"/"+e+"/tables",{},{method:"get",timeout:"60000"}).then((function(e){t.table_loading=!1,t.tdsqlValue.tables="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.table_loading=!1})))},oracleSourceChange:function(e){var t=this;if(this.oracleValue.dbs=[],this.oracleValue.tables=[],""===e)return!1;this.FesApi.fetch("/datasource/meta/oracle/"+e+"/dbs",{},{method:"get",timeout:"60000"}).then((function(e){t.db_loading=!1,t.oracleValue.dbs="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.db_loading=!1}))},oracleDbSeleted:function(e){var t=this;this.oracleValue.tables=[],""!=e&&(this.table_loading=!0,this.FesApi.fetch("/datasource/meta/oracle/"+this.oracleData.dataSourceId+"/"+e+"/tables",{},{method:"get",timeout:"60000"}).then((function(e){t.table_loading=!1,t.oracleValue.tables="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.table_loading=!1})))},oracleDbTablesAddInputValue:function(e){var t=this.oracleValue.tables;t.unshift(e),this.oracleValue.tables=J()(t).call(t,(function(e){return e}))},addCodition:function(){var e=this,t=function(){e.currentLink.push({left:"",right:"",condition:"="})};this.linkCoditionCheck(t)},minusCodition:function(e){var t;this.currentLink=Ae()(t=this.currentLink).call(t,(function(t,a){return a!==e}))},addLinkConfirm:function(){var e=this;this.linkCoditionShow=!0;var t=function(){e.linkCoditionShow=!1,e.tdsqlData.join[e.linkTableIndex]?e.tdsqlData.join[e.linkTableIndex]=e.currentLink:e.tdsqlData.join.push(e.currentLink)};this.linkCoditionCheck(t)},addLinkClose:function(){this.tdsqlData.join[this.linkTableIndex]||this.tdsqlData.table.pop()},initCurrentLinkCodition:function(){this.currentLink=[{left:"",right:"",condition:"="}]},linkCoditionClick:function(e){this.linkTableIndex=e,this.currentLink=JSON.parse(xe()(this.tdsqlData.join[e])),this.linkCoditionShow=!0},linkCoditionCheck:function(e){var t=this.currentLink[this.currentLink.length-1];return t.left||t.right?!t.left&&t.right?this.$Toast(this.$t("components.QTXQBZDXX")):t.left&&!t.right?this.$Toast(this.$t("components.QTXDQBZDXX")):void(t.left&&t.right&&e()):this.$Toast(this.$t("components.QXTXWZLJXX"))}}},Zt=Mt,Xt=(a("2373"),Object(o["a"])(Zt,me,fe,!1,null,"59342238",null));Xt.options.__file="src/components/jobAddStepOne.fes";var Rt=Xt.exports,Et=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Panel",{attrs:{title:e.$t("components.ZDYS")}},[e.isHandleAdd?a("Wb-button",{attrs:{type:"primary"},on:{click:e.addItem}},[e._v("\n "+e._s(e.$t("message.newComponents.Thenewfield"))+"\n ")]):e._e(),a("Wb-form",{ref:"validForm",attrs:{"label-width":0}},[a("Row",{staticClass:"form-box"},[a("Cell",{attrs:{span:"7"}},[a("Row",{staticClass:"source-word-block"},[a("Cell",{attrs:{span:"24"}},[a("Cell",{attrs:{span:"12"}},[a("div",{staticClass:"table-header"},[e._v("\n "+e._s(e.$t("components.YZD"))+"\n ")])]),a("Cell",{attrs:{span:"12"}},[a("div",{staticClass:"table-header"},[e._v("\n "+e._s(e.$t("components.LX"))+"\n ")])])],1),e._l(e.showObjectData.sourceArr,(function(t,s){return a("div",{key:s},[a("Cell",{staticClass:"raw-style",attrs:{span:"12"}},[a("Form-item",{attrs:{prop:"sourceWord",rule:[{required:!0,message:e.$t("message.newComponents.Pleaseenterthesourcefield"),trigger:"blur"},{validator:e.validateSource,trigger:"change"}]}},[a("Wb-select",{on:{"on-change":function(t){return e.sourceWordChange(s)}},model:{value:t.sourceWord,callback:function(a){e.$set(t,"sourceWord",a)},expression:"d.sourceWord"}},e._l(e.arg,(function(e){return a("wb-option",{key:e.name,attrs:{value:e.name}})})),1)],1)],1),a("Cell",{staticClass:"raw-style",attrs:{span:"12"}},[a("wb-input",{attrs:{placeholder:"",disabled:""},model:{value:t.sourceType,callback:function(a){e.$set(t,"sourceType",a)},expression:"d.sourceType"}})],1)],1)}))],2)],1),a("Cell",{attrs:{span:"1"}},[a("div",{staticClass:"table-margin"})]),a("Cell",{attrs:{span:"7"}},[a("Row",{staticClass:"source-word-block"},[a("Cell",{attrs:{span:"24"}},[a("Cell",{attrs:{span:"12"}},[a("div",{staticClass:"table-header"},[e._v("\n "+e._s(e.$t("components.MBZD"))+"\n ")])]),a("Cell",{attrs:{span:"12"}},[a("div",{staticClass:"table-header"},[e._v("\n "+e._s(e.$t("components.LX"))+"\n ")])])],1),e._l(e.showObjectData.rst,(function(t,s){return a("div",{key:s},[a("Cell",{staticClass:"raw-style",attrs:{span:"12"}},[a("Form-item",{attrs:{prop:"name",rule:[{required:!0,message:e.$t("message.newComponents.Pleaseenterthepurposefield"),trigger:"blur"},{message:e.$t("message.newComponents.Fieldlengthcantmorethan")+"200",max:200}]}},[a("wb-input",{attrs:{title:t.name,placeholder:"",disabled:!e.isHandleAdd},model:{value:t.name,callback:function(a){e.$set(t,"name",a)},expression:"d.name"}})],1)],1),a("Cell",{staticClass:"raw-style",attrs:{span:"12"}},[e.isHandleAdd?e._e():a("wb-input",{attrs:{placeholder:"",disabled:""},model:{value:t.type,callback:function(a){e.$set(t,"type",a)},expression:"d.type"}}),e.isHandleAdd?a("Wb-select",{attrs:{disabled:""},model:{value:t.type,callback:function(a){e.$set(t,"type",a)},expression:"d.type"}},e._l(e.targetType,(function(t,s){return a("wb-option",{key:s,attrs:{value:t}},[e._v("\n "+e._s(t)+"\n ")])})),1):e._e()],1)],1)}))],2)],1),a("Cell",{attrs:{span:"1"}},[a("div",{staticClass:"table-margin"})]),a("Cell",{attrs:{span:"7"}},[a("Row",{staticClass:"source-word-block"},[a("Cell",{attrs:{span:"24"}},[a("Cell",{attrs:{span:"12"}},[a("div",{staticClass:"table-header"},[e._v("\n "+e._s(e.$t("components.JYHS"))+"\n ")])]),a("Cell",{attrs:{span:"12"}},[a("div",{staticClass:"table-header"},[e._v("\n "+e._s(e.$t("components.ZHHS"))+"\n ")])])],1),e._l(e.showObjectData.funcArr,(function(t,s){return a("Cell",{key:s,attrs:{span:"24"}},[a("Cell",{staticClass:"raw-style",attrs:{span:"6"}},[a("Wb-select",{attrs:{disabled:e.isSqoop},on:{"on-change":function(t){return e.getValidArgNum(s)}},model:{value:t.validFun,callback:function(a){e.$set(t,"validFun",a)},expression:"item.validFun"}},e._l(e.validFun,(function(t,s){return a("wb-option",{key:s,attrs:{value:t.funcName}},[e._v("\n "+e._s(t.label)+"\n ")])})),1)],1),a("Cell",{attrs:{span:"4"}},[a("Wb-button",{staticClass:"arg-btn",attrs:{type:"primary","param-num":t.validParamNum,disabled:e.isSqoop},on:{click:function(a){return e.setValidArg(t.validParamNum,s,t)}}},[e._v("\n "+e._s(e.$t("components.CS"))+"\n ")])],1),a("Cell",{staticClass:"raw-style",attrs:{span:"6"}},[a("Wb-select",{attrs:{disabled:e.isSqoop},on:{"on-change":function(t){return e.getTransformArgNum(s)}},model:{value:t.transform,callback:function(a){e.$set(t,"transform",a)},expression:"item.transform"}},e._l(e.transform,(function(e,t){return a("wb-option",{key:t,attrs:{value:e.funcName}})})),1)],1),a("Cell",{attrs:{span:"4"}},[a("Wb-button",{staticClass:"arg-btn",attrs:{type:"primary","param-num":t.transformNum,disabled:e.isSqoop},on:{click:function(a){return e.setTransformArg(t.transformNum,s,t)}}},[e._v("\n "+e._s(e.$t("components.CS"))+"\n ")])],1),a("Cell",{attrs:{span:"4"}},[a("Wb-button",{staticClass:"arg-btn",attrs:{type:"defalut",disabled:!e.isHandleAdd},on:{click:function(t){return e.deleteIitem(s)}}},[e._v("\n "+e._s(e.$t("message.newComponents.delete"))+"\n ")])],1)],1)}))],2)],1)],1),a("Pagination",{staticClass:"pagination page-loc",attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.changePage}}),a("Form-item",{staticClass:"three-part-btn-wrap"},[a("Row",[a("Cell",{attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.partThreePre}},[e._v("\n "+e._s(e.$t("components.SYB"))+"\n ")])],1),a("Cell",{attrs:{span:"12"}},[a("Wb-button",{staticClass:"next-button",attrs:{type:"primary"},on:{click:e.partThreeNext}},[e._v("\n "+e._s(e.$t("components.XYB"))+"\n ")])],1)],1)],1)],1),a("modal",{ref:"argModal",attrs:{title:e.$t("components.SZCS")}},[a("div",[a("div",{staticClass:"parmas-bar"},e._l(e.modalArg,(function(t,s){return a("div",{key:s,staticClass:"arg-width"},[e.modalParamsName[s]?a("span",{staticClass:"label"},[e._v(e._s(e.modalParamsName[s])+": ")]):e._e(),e.modalParamsName[s]?a("Wb-input",{attrs:{placeholder:""},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"item.value"}}):e._e()],1)})),0),a("Row",[a("Cell",{staticClass:"modal-btn-wrap",attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.validFunAdd}},[e._v("\n "+e._s(e.$t("components.QR"))+"\n ")])],1),a("Cell",{staticClass:"modal-btn-wrap",attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.close}},[e._v("\n "+e._s(e.$t("components.QX"))+"\n ")])],1)],1)],1)]),a("modal",{ref:"argModal1",attrs:{title:e.$t("components.SZCS")}},[a("div",[a("div",{staticClass:"parmas-bar"},e._l(e.modalArg1,(function(t,s){return a("div",{key:s,staticClass:"arg-width"},[e.modalParamsName1[s]?a("span",{staticClass:"label"},[e._v(e._s(e.modalParamsName1[s])+": ")]):e._e(),e.modalParamsName1[s]?a("Wb-input",{attrs:{placeholder:""},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"item.value"}}):e._e()],1)})),0),a("Row",[a("Cell",{staticClass:"modal-btn-wrap",attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.transformFunAdd}},[e._v("\n "+e._s(e.$t("components.QR"))+"\n ")])],1),a("Cell",{staticClass:"modal-btn-wrap",attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.close}},[e._v("\n "+e._s(e.$t("components.QX"))+"\n ")])],1)],1)],1)])],1)},It=[];Et._withStripped=!0;var Jt=a("1c1b"),Wt=a.n(Jt),Ot={props:{arg:{type:null},paranNewObject:{type:Object,default:{}},editData:{type:null},isShow:{type:null}},FesData:function(){return{addData:{sourceWord:"",sourceType:""},modalArg:[],modalArg1:[],flagIndex:"",transformFlagIndex:"",validFun:[],transform:[],subNewObject:this.paranNewObject,targetType:["string"],pagination:{size:10,current:1,total:0},showObjectData:{sourceArr:[],funcArr:[],rst:[]},modalParamsName:[],modalParamsName1:[]}},FesReady:function(){var e=this;this.FesApi.fetch("/jobinfo/func/verify","get").then((function(t){e.validFun=J()(t).call(t,(function(t){return">"===t.funcName?t.label=e.$t("message.newComponents.DY"):"<"===t.funcName?t.label=e.$t("message.newComponents.XY"):"="===t.funcName?t.label=e.$t("message.newComponents.DYH"):"!="===t.funcName?t.label=e.$t("message.newComponents.BDY"):">="===t.funcName?t.label=e.$t("message.newComponents.DYDY"):"<="===t.funcName?t.label=e.$t("message.newComponents.XYDY"):t.label=t.funcName,t}))})),this.FesApi.fetch("/jobinfo/func/transform","get").then((function(t){e.transform=t}))},watch:{paranNewObject:function(e){var t,a,s,n=this;(this.subNewObject=e,this.subNewObject.rst.length>this.arg.length&&this.isSqoop)&&(this.subNewObject.sourceArr=Ae()(t=e.sourceArr).call(t,(function(e,t){return t0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.showObjectData.sourceArr=Ae()(e=this.subNewObject.sourceArr).call(e,(function(e,t){return(s-1)*n<=t&&t1?a(new Error(this.$t("message.newComponents.Repeatingfield"))):a()}else a()},sourceWordChange:function(e){for(var t=this.subNewObject.sourceArr[e].sourceWord,a=0;a0)this.$refs.argModal.show(),this.modalArg=this.subNewObject.funcArr[this.pagination.size*(this.pagination.current-1)+t].validFuncArg;else if(e>0){this.$refs.argModal.show();for(var i=[],r=0;r0)this.modalArg1=this.subNewObject.funcArr[this.pagination.size*(this.pagination.current-1)+t].transformFunArg;else if(e>0){for(var i=[],r=0;r=this.arg.length)return this.$Toast(this.$t("message.newComponents.Thetargetfieldisnotgreaterthanthesourcefield"));this.subNewObject.sourceArr.push({sourceWord:this.arg[this.subNewObject.sourceArr.length%this.arg.length].name,sourceType:this.arg[this.subNewObject.sourceArr.length%this.arg.length].type}),this.subNewObject.funcArr.push({validFun:"",transform:"",validFuncArg:[],transformFunArg:[]}),this.subNewObject.rst.push({name:this.arg[this.subNewObject.rst.length%this.arg.length].name,type:"string"}),this.pagination.total=Math.ceil(this.subNewObject.sourceArr.length/this.pagination.size),this.pagination.current=this.pagination.total,this.search(this.pagination.total,this.pagination.size)},deleteIitem:function(e){var t,a,s;X()(t=this.subNewObject.sourceArr).call(t,this.pagination.size*(this.pagination.current-1)+e,1),X()(a=this.subNewObject.funcArr).call(a,this.pagination.size*(this.pagination.current-1)+e,1),X()(s=this.subNewObject.rst).call(s,this.pagination.size*(this.pagination.current-1)+e,1),this.pagination.total=Math.ceil(this.subNewObject.sourceArr.length/this.pagination.size),this.pagination.current>this.pagination.total&&(this.pagination.current=this.pagination.total),this.search(this.pagination.current,this.pagination.size)}}},jt=Ot,Yt=(a("9268"),Object(o["a"])(jt,Et,It,!1,null,"1519341c",null));Yt.options.__file="src/components/jobAddStepThree.fes";var Ht=Yt.exports,Qt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Panel",{attrs:{title:e.$t("components.XZSJY")}},[a("Wb-form",{ref:"DataSource",attrs:{rule:e.ruleValidate}},[a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("components.SJYLX"),"label-width":120}},[a("Wb-select",{on:{"on-change":e.typeChange},model:{value:e.addData.type,callback:function(t){e.$set(e.addData,"type",t)},expression:"addData.type"}},e._l(e.dataSourceTypeList,(function(e){return a("wb-option",{key:e,attrs:{value:e}})})),1)],1)],1)],1),"hive"===e.addData.type||""===e.addData.type?[a("hiveSecond",{attrs:{"add-data":e.addData,"source-origin":e.sourceOrigin,"db-data-list":e.dbDataList,"table-list":e.tableList,"part-val":e.partVal,ds_loading:e.ds_loading,db_loading:e.db_loading,table_loading:e.table_loading,part_loading:e.part_loading},on:{sourceChange:e.sourceChange,dbSeleted:e.dbSeleted,tableValueChange:e.tableValueChange,partValueSelect:e.partValueSelect,partCustom:e.partCustom,partCustomClear:e.partCustomClear}})]:e._e(),"local_fs"===e.addData.type?[a("local-fs-second",{attrs:{"local-fs-data":e.localFsData},on:{localFsData:e.localFsDataAction}})]:e._e(),"hdfs"===e.addData.type?[a("hdfsSecond",{attrs:{"step-second-data":e.hdfsData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading},on:{stepSecondData:e.hdfsDataAction}})]:e._e(),"sftp"===e.addData.type?[a("sftpSecond",{attrs:{"step-second-data":e.sftpData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading},on:{stepSecondData:e.sftpDataAction}})]:e._e(),"elasticsearch"===e.addData.type?[a("elaticSearch",{attrs:{"step-second-data":e.elasticSearchData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading,db_loading:e.db_loading,table_loading:e.table_loading,"index-name-list":e.indexNameList,"index-type-list":e.indexTypeList,"edit-data":e.editData},on:{stepSecondData:e.elasticSearchDataAction,sourceChange:e.elasticSourceChange,indexNameChange:e.indexNameChange}})]:e._e(),"mysql"===e.addData.type?[a("mysql",{attrs:{"step-one-data":e.tdsqlData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading,"db-data-list":e.tdsqlValue.dbs,"table-list":e.tdsqlValue.tables,ds_loading:e.ds_loading,db_loading:e.db_loading,table_loading:e.table_loading},on:{stepOneData:e.tdsqlDataAction,sourceChange:e.tdsqlSourceChange,dbSeleted:e.tdsqlDbSeleted,tableValueChange:e.tdsqlTableValueChange}})]:e._e(),"oracle"===e.addData.type?[a("oracle",{attrs:{"step-one-data":e.oracleData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading,"db-data-list":e.oracleValue.dbs,"table-list":e.oracleValue.tables,ds_loading:e.ds_loading,db_loading:e.db_loading,table_loading:e.table_loading},on:{stepOneData:e.tdsqlDataAction,sourceChange:e.oracleSourceChange,dbSeleted:e.oracleDbSeleted}})]:e._e(),e.writeModeShow?a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.BJXR"),prop:"writeMode","label-width":120}},[a("Wb-select",{model:{value:e.writeMode,callback:function(t){e.writeMode=t},expression:"writeMode"}},e._l(e.writeModeList,(function(t){return a("Wb-option",{key:t.value,attrs:{value:t.value}},[e._v("\n "+e._s(t.lable)+"\n ")])})),1)],1)],1)],1):e._e(),e.syncMetaShow?a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("components.TBYXX"),porp:"syncMeta","label-width":100}},[a("Radio",{model:{value:e.syncMeta,callback:function(t){e.syncMeta=t},expression:"syncMeta"}})],1)],1)],1):e._e(),a("Form-item",[a("Row",[a("Cell",{attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.partTwoPre}},[e._v("\n "+e._s(e.$t("components.SYB"))+"\n ")])],1),a("Cell",{attrs:{span:"12"}},[a("Wb-button",{staticClass:"next-button",attrs:{type:"primary",disabled:e.nextStepButtonDisable},on:{click:e.parNextStep}},[e._v("\n "+e._s(e.$t("components.XYB"))+"\n ")])],1)],1)],1)],2)],1)},Ut=[];Qt._withStripped=!0;var Gt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.LJ"),prop:"path","label-width":120}},[a("wb-input",{attrs:{placeholder:e.$t("uiTemplate.SRLJ")},model:{value:e.subData.path,callback:function(t){e.$set(e.subData,"path",t)},expression:"subData.path"}})],1)],1),"record"===e.transferVal?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.YSLX"),prop:"localFsCompress","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.XZYSLX")},model:{value:e.subData.compress,callback:function(t){e.$set(e.subData,"compress",t)},expression:"subData.compress"}},e._l(e.localFsCompressList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),1)],1)],1):e._e(),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.BM"),prop:"encoding","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.QXZBM")},model:{value:e.subData.encoding,callback:function(t){e.$set(e.subData,"encoding",t)},expression:"subData.encoding"}},e._l(e.encodingList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),1)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.WJMQZ"),prop:"fileName","label-width":120}},[a("wb-input",{attrs:{placeholder:e.$t("uiTemplate.QSRWJMQZ")},model:{value:e.subData.fileName,callback:function(t){e.$set(e.subData,"fileName",t)},expression:"subData.fileName"}})],1)],1),"record"===e.transferVal?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.ZDFGF"),prop:"fieldDelimiter","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-search":e.search},model:{value:e.subData.fieldDelimiter,callback:function(t){e.$set(e.subData,"fieldDelimiter",t)},expression:"subData.fieldDelimiter"}},e._l(e.options,(function(t){return a("Wb-option",{key:t.label,attrs:{value:t.value}},[e._v("\n "+e._s(t.label)+"\n ")])})),1)],1)],1):e._e()],1)},Vt=[];Gt._withStripped=!0;var qt={name:"LocalFsTwo",mixins:[Oe],props:{localFsData:{tepy:Object,default:{}}},data:function(){return{subData:this.localFsData,encodingList:["UTF-8","ISO-8859-1","GB2312","GBK","UTF-16"],localFsCompressList:["gzip","bzip2"]}},computed:{transferVal:function(){return this.FesFesx.firstIsSelectRecord}},watch:{subData:{handler:function(e){this.$emit("localFsData",e)},deep:!0},transferVal:function(e){"stream"===e&&(this.subData.fieldDelimiter="",this.subData.compress="")}},methods:{}},zt=qt,Kt=Object(o["a"])(zt,Gt,Vt,!1,null,null,null);Kt.options.__file="src/components/uiTemplate/localFsSecond.fes";var ea=Kt.exports,ta=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.SJY"),prop:"source","label-width":120}},[a("Wb-select",{attrs:{filterable:""},model:{value:e.subData.dataSourceId,callback:function(t){e.$set(e.subData,"dataSourceId",t)},expression:"subData.dataSourceId"}},[e._l(e.sourceOrigin,(function(e,t){return a("wb-option",{key:t,attrs:{label:e.sourceName,value:e.id}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.dsLoading,expression:"dsLoading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.LJ"),prop:"path","label-width":120}},[a("wb-input",{attrs:{placeholder:e.$t("uiTemplate.SRLJ")},model:{value:e.subData.path,callback:function(t){e.$set(e.subData,"path",t)},expression:"subData.path"}})],1)],1),a("Cell",{attrs:{span:"24"}},["record"===e.transferVal?a("Form-item",{attrs:{label:e.$t("uiTemplate.YSLX"),prop:"hdfsCompress","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.XZYSLX")},model:{value:e.subData.compress,callback:function(t){e.$set(e.subData,"compress",t)},expression:"subData.compress"}},e._l(e.hdfsCompressList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),1)],1):e._e()],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.BM"),prop:"encoding","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.QXZBM"),disabled:e.isSqoop},model:{value:e.subData.encoding,callback:function(t){e.$set(e.subData,"encoding",t)},expression:"subData.encoding"}},e._l(e.encodingList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),1)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.WJMQZ"),prop:"fileName","label-width":120}},[a("wb-input",{attrs:{placeholder:e.$t("uiTemplate.QSRWJMQZ"),disabled:e.isSqoop},model:{value:e.subData.fileName,callback:function(t){e.$set(e.subData,"fileName",t)},expression:"subData.fileName"}})],1)],1),"record"===e.transferVal?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.WJLX"),prop:"fielType","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.XZWJLX")},model:{value:e.subData.fileType,callback:function(t){e.$set(e.subData,"fileType",t)},expression:"subData.fileType"}},[a("wb-option",{attrs:{value:"text"}}),e.isSqoop?e._e():a("wb-option",{attrs:{value:"orc"}})],1)],1)],1):e._e(),"record"===e.transferVal?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.ZDFGF"),prop:"fieldDelimiter","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-search":e.search},model:{value:e.subData.fieldDelimiter,callback:function(t){e.$set(e.subData,"fieldDelimiter",t)},expression:"subData.fieldDelimiter"}},e._l(e.options,(function(t){return a("Wb-option",{key:t.label,attrs:{value:t.value}},[e._v("\n "+e._s(t.label)+"\n ")])})),1)],1)],1):e._e()],1)},aa=[];ta._withStripped=!0;var sa={name:"hdfsSecond",mixins:[Oe],props:{stepSecondData:{tepy:Object,default:{}},sourceOrigin:{tepy:Array,default:[]},dsLoading:{type:Boolean,default:!1}},data:function(){return{subData:this.stepSecondData,encodingList:["UTF-8","ISO-8859-1","GB2312","GBK","UTF-16"]}},computed:{transferVal:function(){return this.FesFesx.firstIsSelectRecord},isSqoop:function(){return"SQOOP"===this.FesFesx.enginSelect},hdfsCompressList:function(){return this.isSqoop?["deflate","lzo"]:"orc"===this.subData.fileType?["none","snappy"]:["gzip","bzip2"]}},watch:{subData:{handler:function(e){this.$emit("stepSecondData",e)},deep:!0},transferVal:function(e){"stream"===e&&(this.subData.fieldDelimiter="",this.subData.fielType="",this.subData.compress="")},"subData.fileType":function(e){}},created:function(){},methods:{}},na=sa,ia=Object(o["a"])(na,ta,aa,!1,null,null,null);ia.options.__file="src/components/uiTemplate/hdfsSecond.fes";var ra=ia.exports,oa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.SJY"),prop:"source","label-width":120}},[a("Wb-select",{attrs:{filterable:""},model:{value:e.subData.dataSourceId,callback:function(t){e.$set(e.subData,"dataSourceId",t)},expression:"subData.dataSourceId"}},[e._l(e.sourceOrigin,(function(e,t){return a("wb-option",{key:t,attrs:{value:e.id,label:e.sourceName}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.dsLoading,expression:"dsLoading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.LJ"),prop:"path","label-width":120}},[a("wb-input",{attrs:{placeholder:e.$t("uiTemplate.SRLJ")},model:{value:e.subData.path,callback:function(t){e.$set(e.subData,"path",t)},expression:"subData.path"}})],1)],1),"record"===e.transferVal?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.YSLX"),prop:"hdfsCompress","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.XZYSLX")},model:{value:e.subData.compress,callback:function(t){e.$set(e.subData,"compress",t)},expression:"subData.compress"}},e._l(e.compressList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),1)],1)],1):e._e(),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.BM"),prop:"encoding","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.QXZBM")},model:{value:e.subData.encoding,callback:function(t){e.$set(e.subData,"encoding",t)},expression:"subData.encoding"}},e._l(e.encodingList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),1)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.WJMQZ"),prop:"fileName","label-width":120}},[a("wb-input",{attrs:{placeholder:e.$t("uiTemplate.QSRWJMQZ")},model:{value:e.subData.fileName,callback:function(t){e.$set(e.subData,"fileName",t)},expression:"subData.fileName"}})],1)],1),"record"===e.transferVal?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.ZDFGF"),prop:"fieldDelimiter","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-search":e.search},model:{value:e.subData.fieldDelimiter,callback:function(t){e.$set(e.subData,"fieldDelimiter",t)},expression:"subData.fieldDelimiter"}},e._l(e.options,(function(t,s){return a("Wb-option",{key:s,attrs:{value:t.value}},[e._v("\n "+e._s(t.label)+"\n ")])})),1)],1)],1):e._e(),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("message.newUitemplate.Transferthedatasource"),"label-width":120}},[a("Radio",{model:{value:e.subData.transit,callback:function(t){e.$set(e.subData,"transit",t)},expression:"subData.transit"}},[e._v("\n SFTP "+e._s(e.$t("message.newUitemplate.Willusethedirectorysemaphorefileread/writesynchronization"))+"\n ")])],1)],1),a("Cell",{attrs:{span:"24"}},[e._v("\n  \n ")])],1)},la=[];oa._withStripped=!0;var ca={name:"sftpSecond",mixins:[Oe],props:{stepSecondData:{tepy:Object,default:{}},sourceOrigin:{tepy:Array,default:[]},dsLoading:{type:Boolean,default:!1}},data:function(){return{subData:this.stepSecondData,encodingList:["UTF-8","ISO-8859-1","GB2312","GBK","UTF-16"],compressList:["gzip","bzip2","zip"]}},watch:{subData:{handler:function(e){this.$emit("stepSecondData",e)},deep:!0},transferVal:function(e){"stream"===e&&(this.subData.fieldDelimiter="",this.subData.compress="")}},computed:{transferVal:function(){return this.FesFesx.firstIsSelectRecord}},methods:{}},ua=ca,da=Object(o["a"])(ua,oa,la,!1,null,null,null);da.options.__file="src/components/uiTemplate/sftpSecond.fes";var ha=da.exports,pa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.SJY"),prop:"source","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.sourceChange},model:{value:e.subData.dataSourceId,callback:function(t){e.$set(e.subData,"dataSourceId",t)},expression:"subData.dataSourceId"}},[e._l(e.sourceOrigin,(function(e,t){return a("wb-option",{key:t,attrs:{label:e.sourceName,value:e.id}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.dsLoading,expression:"dsLoading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.SYMC"),prop:"indexName","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.XZSYMC"),filterable:""},on:{"on-search":e.search,"on-change":e.indexNameChange},model:{value:e.subData.indexName,callback:function(t){e.$set(e.subData,"indexName",t)},expression:"subData.indexName"}},[e._l(e.indexNameList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),e._l(e.searchIndexName,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.db_loading,expression:"db_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.SYLX"),prop:"indexType","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.XZSYLX")},on:{"on-change":e.indexTypeChange},model:{value:e.subData.indexType,callback:function(t){e.$set(e.subData,"indexType",t)},expression:"subData.indexType"}},[e._l(e.indexTypeList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.table_loading,expression:"table_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.PLDX"),prop:"batchSize","label-width":120}},[a("wb-input",{attrs:{type:"number",placeholder:e.$t("uiTemplate.SRPLDX")},model:{value:e.subData.batchSize,callback:function(t){e.$set(e.subData,"batchSize",t)},expression:"subData.batchSize"}})],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.HZCLQ"),prop:"usePostProcess","label-width":120}},[a("Radio",{attrs:{disabled:e.UsePostProcessDisable},model:{value:e.subData.usePostProcess,callback:function(t){e.$set(e.subData,"usePostProcess",t)},expression:"subData.usePostProcess"}})],1)],1)],1)},ma=[];pa._withStripped=!0;var fa={name:"elasticSearchSecond",props:{editData:{type:null},stepSecondData:{tepy:Object,default:{}},sourceOrigin:{tepy:Array,default:[]},dsLoading:{type:Boolean,default:!1},db_loading:{type:Boolean,default:!1},table_loading:{type:Boolean,default:!1},indexNameList:{type:Array,default:[]},indexTypeList:{type:Array,default:[]}},data:function(){return{subData:this.stepSecondData,UsePostProcessDisable:!0,searchIndexName:[]}},computed:{transferVal:function(){return this.FesFesx.firstIsSelectRecord}},mounted:function(){this.checkUsePostProcess(this.FesFesx.FirstCurrentDataSourceType)},watch:{subData:{handler:function(e){this.$emit("stepSecondData",e)},deep:!0},"subData.usePostProcess":function(e){this.FesFesx.set("usePostProcess",e)},"FesFesx.FirstCurrentDataSourceType":function(e){this.checkUsePostProcess(e)},"stepSecondData.indexName":function(e){var t;O()(t=this.indexNameList).call(t,e)?this.searchIndexName=[]:(this.searchIndexName=[e],this.UsePostProcessDisable=!0)}},methods:{sourceChange:function(e){this.$emit("sourceChange",e)},indexNameChange:function(e){this.$emit("indexNameChange",e)},indexTypeChange:function(e){this.$emit("indexTypeChange",e)},checkUsePostProcess:function(e){"hive"!==e?(this.subData.usePostProcess=!0,this.UsePostProcessDisable=!0):(this.UsePostProcessDisable=!1,this.editData&&(this.subData.usePostProcess=this.editData.config.usePostProcess))},search:function(e){var t;e?O()(t=this.indexNameList).call(t,e)?(this.searchIndexName=[],this.UsePostProcessDisable=!1):(this.searchIndexName=[e],this.subData.usePostProcess=!0,this.UsePostProcessDisable=!0):(this.searchIndexName=[],this.UsePostProcessDisable=!1)}}},ba=fa,ga=Object(o["a"])(ba,pa,ma,!1,null,null,null);ga.options.__file="src/components/uiTemplate/elasticSearchSecond.fes";var Da=ga.exports,Sa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.SJY"),prop:"source","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.sourceChange},model:{value:e.subData.dataSourceId,callback:function(t){e.$set(e.subData,"dataSourceId",t)},expression:"subData.dataSourceId"}},[e._l(e.sourceOrigin,(function(e,t){return a("wb-option",{key:t,attrs:{value:e.id,label:e.sourceName}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.ds_loading,expression:"ds_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.KM"),prop:"database","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.dbSeleted},model:{value:e.subData.DBData,callback:function(t){e.$set(e.subData,"DBData",t)},expression:"subData.DBData"}},[e._l(e.dbDataList,(function(e,t){return a("wb-option",{key:t,attrs:{value:e}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.db_loading,expression:"db_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.TABLENAMW"),prop:"tableTow","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.tableValueChange},model:{value:e.subData.table,callback:function(t){e.$set(e.subData,"table",t)},expression:"subData.table"}},[e._l(e.tableList,(function(e,t){return a("wb-option",{key:t,attrs:{value:e}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.table_loading,expression:"table_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.XRFS"),prop:"writeMode","label-width":120}},[a("Wb-select",{model:{value:e.subData.writeMode,callback:function(t){e.$set(e.subData,"writeMode",t)},expression:"subData.writeMode"}},e._l(e.writeModeList,(function(e,t){return a("wb-option",{key:t,attrs:{value:e}})})),1)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.PLDX"),prop:"batchSize","label-width":120}},[a("wb-input",{attrs:{type:"number",disabled:"SQOOP"===e.FesFesx.enginSelect,placeholder:e.$t("uiTemplate.QSRPLDXZ")},model:{value:e.subData.batchSize,callback:function(t){e.$set(e.subData,"batchSize",t)},expression:"subData.batchSize"}})],1)],1)],1)},va=[];Sa._withStripped=!0;var Ca={name:"tdsqlSecond",props:{stepOneData:{tepy:Object,default:{}},sourceOrigin:{tepy:Array,default:[]},dbDataList:{type:Array,default:[]},tableList:{type:Array,default:[]},ds_loading:{type:Boolean,default:!1},db_loading:{type:Boolean,default:!1},table_loading:{type:Boolean,default:!1}},data:function(){return{subData:this.stepOneData,showSelect:!1,optionIndex:"",alias:[],tableNameContact:{}}},watch:{subData:{handler:function(e){this.$emit("stepOneData",e)},deep:!0},"subData.table":function(e,t){}},computed:{writeModeList:function(){return"SQOOP"===this.FesFesx.enginSelect?["updateonly","allowinsert"]:["insert","replace","update"]}},methods:{sourceChange:function(e){this.$emit("sourceChange",e)},dbSeleted:function(e){this.$emit("dbSeleted",e)},tableValueChange:function(e){this.$emit("tableValueChange",e)}}},ya=Ca,wa=(a("3e84"),Object(o["a"])(ya,Sa,va,!1,null,"2518aca2",null));wa.options.__file="src/components/uiTemplate/tdsqlSecond.fes";var Ta=wa.exports,Fa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.SJY"),prop:"source","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.sourceChange},model:{value:e.subData.dataSourceId,callback:function(t){e.$set(e.subData,"dataSourceId",t)},expression:"subData.dataSourceId"}},[e._l(e.sourceOrigin,(function(e,t){return a("wb-option",{key:t,attrs:{value:e.id,label:e.sourceName}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.ds_loading,expression:"ds_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.KM"),prop:"database","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.dbSeleted},model:{value:e.subData.DBData,callback:function(t){e.$set(e.subData,"DBData",t)},expression:"subData.DBData"}},[e._l(e.dbDataList,(function(e,t){return a("wb-option",{key:t,attrs:{value:e}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.db_loading,expression:"db_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.TABLENAMW"),prop:"tableTow","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.tableValueChange},model:{value:e.subData.table,callback:function(t){e.$set(e.subData,"table",t)},expression:"subData.table"}},[e._l(e.tableList,(function(e,t){return a("wb-option",{key:t,attrs:{value:e}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.table_loading,expression:"table_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.PLDX"),prop:"batchSize","label-width":120}},[a("wb-input",{attrs:{type:"number",disabled:"SQOOP"===e.FesFesx.enginSelect,placeholder:e.$t("uiTemplate.QSRPLDXZ")},model:{value:e.subData.batchSize,callback:function(t){e.$set(e.subData,"batchSize",t)},expression:"subData.batchSize"}})],1)],1)],1)},$a=[];Fa._withStripped=!0;var xa={name:"tdsqlSecond",props:{stepOneData:{tepy:Object,default:{}},sourceOrigin:{tepy:Array,default:[]},dbDataList:{type:Array,default:[]},tableList:{type:Array,default:[]},ds_loading:{type:Boolean,default:!1},db_loading:{type:Boolean,default:!1},table_loading:{type:Boolean,default:!1}},data:function(){return{subData:this.stepOneData,showSelect:!1,optionIndex:"",alias:[],tableNameContact:{}}},watch:{subData:{handler:function(e){this.$emit("stepOneData",e)},deep:!0},"subData.table":function(e,t){}},methods:{sourceChange:function(e){this.$emit("sourceChange",e)},dbSeleted:function(e){this.$emit("dbSeleted",e)},tableValueChange:function(e){this.$emit("tableValueChange",e)}}},_a=xa,Aa=(a("bd85"),Object(o["a"])(_a,Fa,$a,!1,null,"34211381",null));Aa.options.__file="src/components/uiTemplate/oracleSecond.fes";var La=Aa.exports;function Na(e,t){var a=G()(e);if(Fe.a){var s=Fe()(e);t&&(s=Ae()(s).call(s,(function(t){return we()(e,t).enumerable}))),a.push.apply(a,s)}return a}function Pa(e){for(var t=1;t0&&""!==this.editData&&this.changeDataSourceId(this.typeTransitionDataName(this.editData.dataDestType),e,"dataDestId")},dbDataList:function(e){e.length>0&&""!==this.editData&&""!==this.editData.config.dataDstParams.database&&O()(e).call(e,this.editData.config.dataDstParams.database)&&(this.addData.DBData=this.editData.config.dataDstParams.database)},tableList:function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataDstParams.table)&&(this.addData.table=this.editData.config.dataDstParams.table)},"tdsqlValue.dbs":function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataDstParams.database)&&(this.tdsqlData.DBData=this.editData.config.dataDstParams.database)},"tdsqlValue.tables":function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataDstParams.table)&&(this.tdsqlData.table=this.editData.config.dataDstParams.table)},"oracleValue.dbs":function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataDstParams.database)&&(this.oracleData.DBData=this.editData.config.dataDstParams.database)},"oracleValue.tables":function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataDstParams.table)&&(this.oracleData.table=this.editData.config.dataDstParams.table)},indexNameList:function(e){e.length>0&&""!==this.editData&&""!==this.editData.config.dataDstParams.indexName&&(this.elasticSearchData.indexName=this.editData.config.dataDstParams.indexName,this.editData.config.dataDstParams.indexName="")},indexTypeList:function(e){e.length>0&&""!==this.editData&&""!==this.editData.config.dataDstParams.indexType&&O()(e).call(e,this.editData.config.dataDstParams.indexType)&&(this.elasticSearchData.indexType=this.editData.config.dataDstParams.indexType)}},FesReady:function(){this.editorAction(this.editData)},computed:{dataSourceTypeList:function(){return"SQOOP"!==this.FesFesx.enginSelect?this.FesFesx.FirstCurrentDataSourceType===wt["b"].MYSQL||this.FesFesx.firstIsSelectRecord===wt["c"].RECORD||this.FesFesx.FirstCurrentDataSourceType===wt["b"].ORACLE?(this.editData||(this.addData.type=wt["b"].HIVE),[wt["b"].HIVE,wt["b"].LOCAL_FS,wt["b"].HDFS,wt["b"].SFTP,wt["b"].ELASTICSEARCH,wt["b"].MYSQL,wt["b"].ORACLE]):(this.editData||(this.addData.type=wt["b"].HIVE),[wt["b"].HIVE,wt["b"].LOCAL_FS,wt["b"].HDFS,wt["b"].SFTP]):this.FesFesx.FirstCurrentDataSourceType===wt["b"].HIVE?(this.editData||(this.addData.type=wt["b"].MYSQL),[wt["b"].MYSQL]):this.FesFesx.FirstCurrentDataSourceType===wt["b"].MYSQL?(this.editData||(this.addData.type=wt["b"].HIVE),[wt["b"].HIVE,wt["b"].HDFS]):this.FesFesx.FirstCurrentDataSourceType===wt["b"].HDFS?(this.editData||(this.addData.type=wt["b"].MYSQL),[wt["b"].MYSQL]):void 0},syncMetaShow:function(){return this.FesFesx.FirstCurrentDataSourceType===wt["b"].HIVE&&(this.FesFesx.secondCurrentDataSourceType===wt["b"].HIVE||this.FesFesx.secondCurrentDataSourceType===wt["b"].SFTP)||this.FesFesx.FirstCurrentDataSourceType===wt["b"].SFTP&&this.FesFesx.secondCurrentDataSourceType===wt["b"].HIVE},writeModeShow:function(){var e;return"SQOOP"!==this.FesFesx.enginSelect&&O()(e=[wt["b"].HIVE,wt["b"].HDFS,wt["b"].SFTP,wt["b"].LOCAL_FS]).call(e,this.FesFesx.secondCurrentDataSourceType)}},methods:{partTwoPre:function(){this.$emit("preTwo",!0)},typeChange:function(e){this.FesFesx.set("secondCurrentDataSourceType",e),this.nextStepButtonDisable=!1,this.addData.dataSourceValue="",this.addData.dataSourceId="",this.addData.DBData="",this.addData.table="",this.sourceOrigin=[],this.dbDataList=[],this.tableList=[],this.partKey="",this.partVal=[{name:"",value:"",partitions:{}}],this.addData.type===wt["b"].HIVE?this.getSourceDataList(e):this.addData.type===wt["b"].LOCAL_FS?this.localFsData.type=e:e===wt["b"].SFTP?(this.sftpData.type=e,this.getSourceDataList(e)):e===wt["b"].ELASTICSEARCH?(this.elasticSearchData.type=e,this.getSourceDataList(e)):e===wt["b"].MYSQL?(this.tdsqlData.type=e,this.getSourceDataList(e)):e===wt["b"].ORACLE?(this.FesFesx.set("firstIsSelectRecord",wt["c"].RECORD),this.oracleData.type=e,this.getSourceDataList(e)):(this.hdfsData.type=e,this.getSourceDataList(e))},editorAction:function(e){e&&(this.FesFesx.set("secondCurrentDataSourceType",e.config.dataDstParams.type),this.addData.type=e.config.dataDstParams.type,e.config.syncMeta&&(this.syncMeta=e.config.syncMeta),e.config.dataDstParams&&e.config.dataDstParams.writeMode&&(this.writeMode=e.config.dataDstParams.writeMode),e.config.dataDstParams.type===wt["b"].LOCAL_FS?(this.localFsData=Pa({},e.config.dataDstParams),this.localFsData.type=e.config.dataDstParams.type):e.config.dataDstParams.type===wt["b"].HDFS?(this.hdfsData=Pa({},e.config.dataDstParams),this.hdfsData.type=e.config.dataDstParams.type):e.config.dataDstParams.type===wt["b"].SFTP?(this.sftpData=Pa({},e.config.dataDstParams),this.sftpData.type=e.config.dataDstParams.type,this.sftpData.dataSourceId=e.config.dataDestId):e.config.dataDstParams.type===wt["b"].ELASTICSEARCH?(this.elasticSearchData.type=e.config.dataDstParams.type,this.elasticSearchData.dataSourceId=e.config.dataDestId,this.elasticSearchData.batchSize=e.config.dataDstParams.batchSize,this.elasticSearchData.usePostProcess=e.config.usePostProcess,this.FesFesx.set("usePostProcess",e.config.usePostProcess)):e.config.dataDstParams.type===wt["b"].MYSQL?this.tdsqlData=Pa({},e.config.dataDstParams):e.config.dataDstParams.type===wt["b"].ORACLE&&(this.oracleData=Pa({},e.config.dataDstParams)))},tableValueChange:function(e){this.tableValueChangeAction(e,"dataDstParams")},partValueSelect:function(e){var t=e.index,a=e.value,s=e.partitions;this.partValueSelectAction(t,a,s,"dataDstParams")},elasticSearchDataAction:function(e){this.elasticSearchData=e},tdsqlTableValueChange:function(e){console.log(e,"tablechange")},tdsqlSourceChange:function(e){var t=this;if(this.tdsqlData.DBData="",this.tdsqlData.table="",this.tdsqlValue.dbs=[],this.tdsqlValue.tables=[],""==e)return!1;this.db_loading=!0,this.FesApi.fetch("/datasource/meta/mysql/"+e+"/dbs",{},{method:"get",timeout:"60000"}).then((function(e){t.db_loading=!1,t.tdsqlValue.dbs="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.db_loading=!1}))},tdsqlDbSeleted:function(e){var t=this;this.tdsqlData.table="",this.tdsqlValue.tables=[],""!=e&&(this.table_loading=!0,this.FesApi.fetch("/datasource/meta/mysql/"+this.tdsqlData.dataSourceId+"/"+e+"/tables",{},{method:"get",timeout:"60000"}).then((function(e){t.table_loading=!1,t.tdsqlValue.tables="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.table_loading=!1})))},oracleSourceChange:function(e){var t=this;if(this.oracleData.DBData="",this.oracleData.table="",this.oracleValue.dbs=[],this.oracleValue.tables=[],""==e)return!1;this.db_loading=!0,this.FesApi.fetch("/datasource/meta/oracle/"+e+"/dbs",{},{method:"get",timeout:"60000"}).then((function(e){t.db_loading=!1,t.oracleValue.dbs="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.db_loading=!1}))},oracleDbSeleted:function(e){var t=this;this.oracleData.table="",this.oracleValue.tables=[],""!=e&&(this.table_loading=!0,this.FesApi.fetch("/datasource/meta/oracle/"+this.oracleData.dataSourceId+"/"+e+"/tables",{},{method:"get",timeout:"60000"}).then((function(e){t.table_loading=!1,t.oracleValue.tables="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.table_loading=!1})))},elasticSourceChange:function(e){var t=this;this.indexNameList=[],this.indexTypeList=[],this.elasticSearchData.indexName="",this.elasticSearchData.indexType="",this.db_loading=!0,this.FesApi.fetch("/datasource/meta/elastic/"+e+"/indices",{},{method:"get",timeout:"60000"}).then((function(e){t.indexNameList="{}"===xe()(e)?[]:e,t.db_loading=!1}))["catch"]((function(){return t.db_loading=!1}))},indexNameChange:function(e){var t,a=this;this.elasticSearchData.indexType="",!e||O()(t=this.indexNameList).call(t,e)?e&&(this.table_loading=!0,this.FesApi.fetch("/datasource/meta/elastic/"+this.elasticSearchData.dataSourceId+"/"+e+"/types",{},{method:"get",timeout:"60000"}).then((function(e){a.indexTypeList="{}"===xe()(e)?[]:e,a.table_loading=!1}))["catch"]((function(){return a.table_loading=!1}))):this.indexTypeList=["_doc"]}}},Ba=ka,Ma=Object(o["a"])(Ba,Qt,Ut,!1,null,null,null);Ma.options.__file="src/components/jobAddStepTwo.fes";var Za=Ma.exports,Xa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Panel",[a("Wb-form",{ref:"enginSelect"},[a("Form-item",{attrs:{label:e.$t("message.newComponents.engine"),"label-width":120}},[a("Radio-group",{model:{value:e.addData.engin,callback:function(t){e.$set(e.addData,"engin",t)},expression:"addData.engin"}},[a("Radio",{attrs:{value:"DATAX"}},[e._v("\n DATAX\n ")]),a("Radio",{attrs:{value:"SQOOP"}},[e._v("\n SQOOP\n ")])],1)],1),a("Form-item",[a("Row",[a("Cell",{attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.preview}},[e._v("\n "+e._s(e.$t("components.LLSJ"))+"\n ")])],1),a("Cell",{attrs:{span:"12"}},[a("Wb-button",{staticClass:"next-button",attrs:{type:"primary"},on:{click:e.parNextStep}},[e._v("\n "+e._s(e.$t("components.XYB"))+"\n ")])],1)],1)],1)],1)],1)},Ra=[];Xa._withStripped=!0;var Ea={props:{editData:{type:null}},data:function(){return{addData:{engin:"DATAX"}}},FesReady:function(){this.editData&&(this.addData.engin=this.editData.engineType)},methods:{parNextStep:function(){this.$emit("nextStep",this.addData)},preview:function(){this.$Toast(this.$t("components.GNZWKF"))}}},Ia=Ea,Ja=Object(o["a"])(Ia,Xa,Ra,!1,null,null,null);Ja.options.__file="src/components/jobAddStepZero.fes";var Wa=Ja.exports,Oa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("we-step",{attrs:{"current-step":e.currentStep,"step-description":e.stepDescription}}),a("job-add-step-zero",{directives:[{name:"show",rawName:"v-show",value:e.partZero,expression:"partZero"}],attrs:{"edit-data":e.editData},on:{nextStep:e.partZeroNext}}),a("job-add-step-one",{directives:[{name:"show",rawName:"v-show",value:e.partOne,expression:"partOne"}],ref:"job_add_step_one",attrs:{"edit-data":e.editData,"tree-id":e.treeId},on:{preStep:e.partOnePre,nextStep:e.partOneNext}}),a("job-add-step-two",{directives:[{name:"show",rawName:"v-show",value:e.partTwo,expression:"partTwo"}],ref:"job_add_step_two",attrs:{"edit-data":e.editData,"tree-id":e.treeId},on:{nextStep:e.partTwoNext,preTwo:e.partTwoPre,syncMeta:e.syncMeta}}),a("job-add-step-three",{directives:[{name:"show",rawName:"v-show",value:e.partThree,expression:"partThree"}],ref:"job_add_step_three",attrs:{arg:e.partThreeData,"edit-data":e.editData,"paran-new-object":e.newObject,"is-show":e.partThree},on:{threeNext:e.partThreeNext,threePre:e.partThreePre}}),a("job-add-editor",{directives:[{name:"show",rawName:"v-show",value:e.editorShow,expression:"editorShow"}],attrs:{value:e.addData.editorContent},on:{preEditor:e.partEditorPre,parNextStep:e.editorNext}}),a("job-add-step-four",{directives:[{name:"show",rawName:"v-show",value:e.partFour,expression:"partFour"}],ref:"job_add_step_four",attrs:{"edit-data":e.editData},on:{fourNext:e.partFourNext,fourPre:e.partFourPre}}),a("job-add-step-five",{directives:[{name:"show",rawName:"v-show",value:e.partFive,expression:"partFive"}],ref:"job_add_step_five",attrs:{"edit-data":e.editData,"save-disable":e.saveDisable},on:{save:e.save,fivePre:e.fivePre}})],1)},ja=[];Oa._withStripped=!0;var Ya=a("5b3f"),Ha=a.n(Ya),Qa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"ui-steps web-steps"},[e._l(e.stepDescription,(function(t,s){return[a("div",{key:s,staticClass:"ui-step",class:{"ui-step-done":s+1e.currentStep}},[s+1!==e.stepDescription.length?a("div",{staticClass:"ui-step-tail"},[a("i")]):e._e(),s+10){var i=!0;this.addData.addData1.table.length===this.editData.config.dataSrcParams.table.length&&this.addData.addData1.table.toString===this.editData.config.dataSrcParams.table.toString||(this.editData.config.columnMaps=[]),this.editorAction(this.editData,this.editData.config.columnMaps,i)}}else e.type!==wt["b"].ORACLE||this.FesFesx.FirstCurrentDataSourceType!==wt["b"].HIVE&&this.FesFesx.FirstCurrentDataSourceType!==wt["b"].TDSQL&&this.FesFesx.FirstCurrentDataSourceType!==wt["b"].ORACLE||this.FesFesx.firstIsSelectRecord!==wt["c"].RECORD||this.FesApi.fetch("/datasource/meta/oracle/"+e.dataSourceId+"/"+e.DBData+"/"+e.table+"/fields",{},{method:"get",timeout:"60000"}).then((function(e){for(var t=[],a=0;a2&&void 0!==arguments[2]&&arguments[2];if(e&&e.config.columnMaps&&e.config.columnMaps.length>0){for(var s=[],n=[],i=0;i0?[a("Tree",{ref:"tree",attrs:{data:e.treeData},on:{"on-select-change":e.getProjectId},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.node;t.root;return[a("contextmenu",{attrs:{data:e.actions},on:{"on-choose":function(t){return e.doAction(s,arguments)}}},[a("span",[e._v(" "+e._s(s.projectName)+" ")])])]}}],null,!1,1902962643)})]:e._e(),e.treeData.length<=0?a("span",{staticClass:"not-data"},[e._v(e._s(e.$t("group.ZWSJ")))]):e._e(),a("modal",{ref:"addTree",attrs:{title:e.$t("components.XZXM")}},[a("Wb-form",{ref:"addForm"},[a("Form-item",{attrs:{label:e.$t("components.XMMC")}},[a("wb-input",{attrs:{placeholder:e.$t("components.SRXMMC")},model:{value:e.taskName,callback:function(t){e.taskName=t},expression:"taskName"}})],1),a("Form-item",{attrs:{label:e.$t("components.MS")}},[a("wb-input",{attrs:{placeholder:e.$t("components.MS")},model:{value:e.taskDesc,callback:function(t){e.taskDesc=t},expression:"taskDesc"}})],1),a("div",{staticClass:"submit-button-container"},[a("Wb-button",{ref:"submitButton",staticClass:"submit-button",attrs:{type:"primary"},on:{click:e.submit}},[e._v("\n "+e._s(e.$t("components.TJ"))+"\n ")])],1)],1)],1)],2)},ns=[];ss._withStripped=!0;var is=a("310e"),rs=a("f612"),os=a.n(rs),ls={props:{arg:{type:Object},newData:{type:Object}},FesData:function(){return{treeData:[],actions:[this.$t("components.ZJZJD"),this.$t("components.SCJD")],test:"",taskName:"",taskDesc:"",currentId:"",originTreeData:""}},FesReady:function(){this.getTree()},methods:{searchProject:function(e){console.log(e,"name");var t=this.originTreeData;this.walker(t,e),this.treeData=this.filterAction(t)},walker:function(e,t){var a=this,s=!1;return Q()(e).call(e,(function(e){var n;if(e.children){var i,r=a.walker(e.children,t);r||-1!==os()(i=e.projectName).call(i,t)||""===t?(e.isEnable=!1,s=!0):e.isEnable=!0}else-1!==os()(n=e.projectName).call(n,t)||""===t?(e.isEnable=!1,s=!0):e.isEnable=!0})),s},filterAction:function(e){var t=this;return Ae()(e).call(e,(function(e){return e.children&&!e.isEnable?(e.children=t.filterAction(e.children),e.children.length>0):!e.isEnable}))},doAction:function(e,t){var a=this,s=Object(is["a"])(t,2),n=s[1];if(this.currentNode=e,this.currentId=e.id,0===n){if(2===e.level)return this.$Toast.warn($t("message.newComponents.Onlysupportsnomorethanthreelayersofengineering"));this.$refs.addTree.show()}1===n&&this.$Message.confirm(this.$t("components.SC"),this.$t("components.SFSC")).then((function(t){0===t&&(a.FesFesx.set("isLoading",!0),a.FesApi.fetch("/project/delete/"+e.id,"delete").then((function(){a.FesFesx.set("isLoading",!1),a.$Toast.success(a.$t("components.SCCG")),a.$refs.tree.removeNode(e)}))["catch"]((function(){a.FesFesx.set("isLoading",!1)})))}))},getTree:function(){var e=this;this.FesFesx.set("isLoading",!0),this.FesApi.fetch("/project/tree","get").then((function(t){e.originTreeData=e.treeData=t,e.treeData[0]&&(e.treeData[0].selected=!0,e.getProjectId(e.treeData[0])),e.FesFesx.set("isLoading",!1)}))},submit:function(){var e=this,t={};t.parentId=this.currentId,t.projectName=this.taskName,t.projectDesc=this.taskDesc,this.FesApi.fetch("/project/add",t).then((function(){e.$refs.addTree.hide(),e.$Toast.success(e.$t("components.TJCG")),e.getTree(),e.taskName="",e.taskDesc="",e.currentId=""}))},getProjectId:function(e){return null!=e&&this.$emit("getTreeId",e.id),!1}}},cs=ls,us=(a("e769"),Object(o["a"])(cs,ss,ns,!1,null,null,null));us.options.__file="src/components/jobLeftTree.fes";var ds=us.exports;t["a"]={FesHeader:c,FesLeft:f,JobAddEditor:N,JobAddStepFive:oe,JobAddStepFour:pe,JobAddStepOne:Rt,JobAddStepThree:Ht,JobAddStepTwo:Za,JobAddStepZero:Wa,JobAddWrap:as,JobLeftTree:ds}},"932c":function(e,t,a){"use strict";a("7444")},"958e":function(e,t,a){"use strict";a("4b33")},"99e6":function(e,t,a){"use strict";a("e4c0")},"9b4c":function(e,t,a){"use strict";var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("main",{staticClass:"main"},[a("div",{staticClass:"header-bar"},[a("span",{staticClass:"header-title"},[e._v("\n "+e._s(e.$t("dataTemplate.SJYMBGL"))+"\n ")]),a("p",{staticClass:"header-des"},[e._v("\n "+e._s(e.$t("dataTemplate.SJYLJCSMBGL"))+"\n ")])]),a("div",{staticClass:"main-content"},[a("Row",{staticClass:"top-bar"},[a("div",[a("label",{staticClass:"ui-form-label"},[e._v("\n "+e._s(e.$t("dataTemplate.MBLX"))+"\n ")])]),a("Cell",{attrs:{span:"4"}},[a("Wb-select",{attrs:{placeholder:e.$t("dataTemplate.QXZSJY")},model:{value:e.querySourceType,callback:function(t){e.querySourceType=t},expression:"querySourceType"}},[a("wb-option",{attrs:{value:"HIVE",label:"HIVE"}}),a("wb-option",{attrs:{value:"HDFS",label:"HDFS"}}),a("wb-option",{attrs:{value:"SFTP",label:"SFTP"}}),a("wb-option",{attrs:{value:"ElasticSearch",label:"ElasticSearch"}}),a("wb-option",{attrs:{value:"MYSQL",label:"MYSQL"}}),a("wb-option",{attrs:{value:"ORACLE",label:"ORACLE"}})],1)],1),a("div",{staticClass:"margin-left"},[a("label",{staticClass:"ui-form-label"},[e._v("\n "+e._s(e.$t("dataTemplate.MBMC"))+"\n ")])]),a("Cell",{attrs:{span:"4"}},[a("Wb-input",{attrs:{maxlength:200,placeholder:e.$t("dataTemplate.CXMBMC")},model:{value:e.queryModelName,callback:function(t){e.queryModelName=t},expression:"queryModelName"}})],1),a("Cell",{staticClass:"margin-left",attrs:{span:"4"}},[a("Wb-button",{attrs:{type:"primary",icon:"search"},on:{click:function(t){return e.searchQuery()}}},[e._v("\n "+e._s(e.$t("dataTemplate.CX"))+"\n ")])],1)],1),a("div",{staticClass:"template-lsit"},[a("div",{staticClass:"add-item template-item",on:{click:e.addAction}},[a("Icon",{attrs:{type:"md-add",size:"16"}}),e._v("\n "+e._s(e.$t("dataTemplate.XZMB"))+"\n ")],1),e._l(e.templateList,(function(t){return a("div",{key:t.id,staticClass:"current-item template-item"},[a("div",{staticClass:"item-content"},[a("div",{staticClass:"icon-box"},["HIVE"===t.sourceType?a("i",{staticClass:"icon-bar",attrs:{type:"iconfont icon-hive",size:"35"}},[e._v("HIVE")]):e._e(),"HDFS"===t.sourceType?a("i",{staticClass:"icon-bar",attrs:{type:"iconfont icon-hdfs",size:"35"}},[e._v("HDFS")]):e._e(),"SFTP"===t.sourceType?a("i",{staticClass:"icon-bar",attrs:{type:"iconfont icon-sftp",size:"35"}},[e._v("SFTP")]):e._e(),"MYSQL"===t.sourceType?a("i",{staticClass:"icon-bar",attrs:{type:"iconfont icon-mysql",size:"35"}},[e._v("MYSQL")]):e._e(),"ElasticSearch"===t.sourceType?a("i",{staticClass:"icon-bar",attrs:{type:"iconfont icon-ElasticSearch",size:"35"}},[e._v("ES")]):e._e(),"ORACLE"===t.sourceType?a("i",{staticClass:"icon-bar",attrs:{type:"iconfont icon-xingzhuang",size:"35"}},[e._v("ORACLE")]):e._e()]),a("div",{staticClass:"content"},[a("span",{staticClass:"name",attrs:{title:t.modelName}},[e._v("\n "+e._s(t.modelName)+"\n ")]),a("div",{staticClass:"params",attrs:{title:t.modelDesc}},[e._v("\n "+e._s(t.modelDesc)+"\n ")]),a("div",{staticClass:"content-footer"},[a("span",[e._v(e._s(t.modifyUser))]),a("span",[e._v(e._s(t.modifyTime.split(" ")[0]))])])])]),a("div",{staticClass:"item-option"},[a("span",{staticClass:"detail",on:{click:function(a){return e.detailAction(t)}}},[e._v("\n "+e._s(e.$t("dataTemplate.CKXQ"))+"\n ")]),a("span",[e._v("|")]),a("span",{staticClass:"delete",on:{click:function(a){return e.modifyAction(t)}}},[e._v("\n "+e._s(e.$t("dataTemplate.XG"))+"\n ")]),a("span",[e._v("|")]),a("span",{staticClass:"modify",on:{click:function(a){return e.deleteAction(t)}}},[e._v("\n "+e._s(e.$t("dataTemplate.SC"))+"\n ")])])])}))],2),a("div",{staticClass:"page-pagination"},[a("Pagination",{attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.pageChange}})],1)],1),a("weModal",{attrs:{title:e.modelTitle,width:"750",closable:!0,"footer-disable":!("view"===e.actionType)},on:{onConfirm:e.addConfirm},model:{value:e.addShow,callback:function(t){e.addShow=t},expression:"addShow"}},[a("Wb-form",{ref:"templateForm",attrs:{rule:e.sourceRule}},[a("Form-item",{attrs:{label:e.$t("dataTemplate.XZSJYLX"),prop:"templateSourceType","label-width":130}},[a("Wb-select",{staticClass:"modal-select",attrs:{disabled:"view"===e.actionType},model:{value:e.selectSourceType,callback:function(t){e.selectSourceType=t},expression:"selectSourceType"}},e._l(e.selectSourceList,(function(e,t){return a("wb-option",{key:t,attrs:{value:e,label:e}})})),1)],1),a("Form-item",{attrs:{label:e.$t("dataTemplate.MBMC"),prop:"templateName","label-width":130}},[a("Wb-input",{attrs:{type:"text",placeholder:e.$t("dataTemplate.SRWB"),width:"85%",disabled:"view"===e.actionType},model:{value:e.templateName,callback:function(t){e.templateName=t},expression:"templateName"}})],1),a("Form-item",{attrs:{label:e.$t("dataTemplate.MBMS"),prop:"templateDesc","label-width":130}},[a("Wb-input",{attrs:{type:"textarea",placeholder:e.$t("dataTemplate.SRWB"),width:"85%",disabled:"view"===e.actionType},model:{value:e.description,callback:function(t){e.description=t},expression:"description"}})],1),"HIVE"===e.selectSourceType?a("Form-item",{attrs:{label:"Metastore "+e.$t("dataTemplate.DZ"),prop:"metaStorePaths","label-width":130}},e._l(e.parameter.metaStorePaths,(function(t,s){return a("div",{key:s,staticClass:"parameter-item"},[a("wb-input",{staticClass:"margin-bottom",attrs:{placeholder:e.$t("dataTemplate.QSR")+" Metastore "+e.$t("dataTemplate.DZ"),width:"85%",disabled:"view"===e.actionType},model:{value:t.content,callback:function(a){e.$set(t,"content",a)},expression:"path.content"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n thrift://\n ")]),a("span",{attrs:{slot:"append"},slot:"append"},["md-add"==t.icon?a("Icon",{staticClass:"icon-plus",attrs:{type:t.icon,color:"gray",size:"18"},on:{click:e.sourceMetaPlus}}):"md-remove"==t.icon?a("Icon",{staticClass:"icon-plus",attrs:{type:t.icon,color:"gray",size:"18"},on:{click:function(t){return e.sourceMetaMinus(s)}}}):e._e(),0==s?a("Icon",{staticClass:"icon-plus",attrs:{type:"md-add",color:"gray",size:"18"},on:{click:e.sourceMetaPlus}}):e._e()],1)])],1)})),0):e._e(),"HIVE"===e.selectSourceType||"HDFS"===e.selectSourceType?a("Form-item",{attrs:{label:"HDFS "+e.$t("dataTemplate.DZ"),prop:"hdfsPath","label-width":130}},[a("wb-input",{attrs:{placeholder:"HDFS "+e.$t("dataTemplate.DZ"),width:"85%",disabled:"view"===e.actionType},model:{value:e.parameter.hdfsPath,callback:function(t){e.$set(e.parameter,"hdfsPath",t)},expression:"parameter.hdfsPath"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n hdfs://\n ")])])],1):e._e(),"HIVE"===e.selectSourceType||"HDFS"===e.selectSourceType?a("Form-item",{attrs:{label:"Hadoop "+e.$t("dataTemplate.PZX"),"label-width":130}},e._l(e.parameter.hadoopConfigs,(function(t,s){return a("div",{key:s},[a("Row",{staticClass:"parameter-item"},[a("Cell",{attrs:{span:"9"}},[a("wb-input",{attrs:{placeholder:e.$t("dataTemplate.PZM"),disabled:"view"===e.actionType},on:{"on-blur":function(t){return e.checkHadoop("key")}},model:{value:t.key,callback:function(a){e.$set(t,"key",a)},expression:"config.key"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n "+e._s(e.$t("dataTemplate.PZM"))+"\n ")])])],1),a("Cell",{attrs:{span:"1"}},[a("span",[e._v(" ")])]),a("Cell",{attrs:{span:"9"}},[a("wb-input",{attrs:{placeholder:e.$t("dataTemplate.PZZ"),disabled:"view"===e.actionType},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"config.value"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n "+e._s(e.$t("dataTemplate.PZZ"))+"\n ")])])],1),a("Cell",{staticClass:"text-dec",attrs:{span:"3"}},["md-add"==t.icon?a("Icon",{staticClass:"icon-plus",attrs:{type:t.icon,color:"gray",size:"18"},on:{click:function(t){return e.sourceConfPlus("hadoopConfigs")}}}):"md-remove"==t.icon?a("Icon",{staticClass:"icon-plus",attrs:{type:t.icon,color:"gray",size:"18"},on:{click:function(t){return e.sourceConfMinus(s,"hadoopConfigs")}}}):e._e(),0==s?a("Icon",{staticClass:"icon-plus",attrs:{type:"md-add",color:"gray",size:"18"},on:{click:function(t){return e.sourceConfPlus("hadoopConfigs")}}}):e._e()],1)],1)],1)})),0):e._e(),"MYSQL"===e.selectSourceType?a("Form-item",{attrs:{label:"MYSQL "+e.$t("dataTemplate.LJCS"),"label-width":130}},e._l(e.parameter.connParams,(function(t,s){return a("div",{key:s},[a("Row",{staticClass:"parameter-item"},[a("Cell",{attrs:{span:"9"}},[a("wb-input",{attrs:{placeholder:e.$t("dataTemplate.CSM"),disabled:"view"===e.actionType},on:{"on-blur":function(t){return e.checkHadoop("key")}},model:{value:t.key,callback:function(a){e.$set(t,"key",a)},expression:"config.key"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n "+e._s(e.$t("dataTemplate.CSM"))+"\n ")])])],1),a("Cell",{attrs:{span:"1"}},[a("span",[e._v(" ")])]),a("Cell",{attrs:{span:"9"}},[a("wb-input",{attrs:{placeholder:e.$t("dataTemplate.CSZ"),disabled:"view"===e.actionType},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"config.value"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n "+e._s(e.$t("dataTemplate.CSZ"))+"\n ")])])],1),a("Cell",{staticClass:"text-dec",attrs:{span:"3"}},["md-add"==t.icon?a("Icon",{staticClass:"icon-plus",attrs:{type:t.icon,color:"gray",size:"18"},on:{click:function(t){return e.sourceConfPlus("connParams")}}}):"md-remove"==t.icon?a("Icon",{staticClass:"icon-plus",attrs:{type:t.icon,color:"gray",size:"18"},on:{click:function(t){return e.sourceConfMinus(s,"connParams")}}}):e._e(),0==s?a("Icon",{staticClass:"icon-plus",attrs:{type:"md-add",color:"gray",size:"18"},on:{click:function(t){return e.sourceConfPlus("connParams")}}}):e._e()],1)],1)],1)})),0):e._e(),"SFTP"===e.selectSourceType?a("Row",[a("Cell",{attrs:{span:"11"}},[a("Form-item",{attrs:{label:"SFTP "+e.$t("dataTemplate.DZ"),prop:"pathHost","label-width":130}},[a("wb-input",{attrs:{placeholder:"SFTP "+e.$t("dataTemplate.DZ")+" HOST",disabled:"view"===e.actionType},model:{value:e.parameter.host,callback:function(t){e.$set(e.parameter,"host",t)},expression:"parameter.host"}})],1)],1),a("Cell",{attrs:{span:"10"}},[a("Form-item",{attrs:{prop:"pathPort"}},[a("wb-input",{attrs:{type:"number",placeholder:"SFTP "+e.$t("dataTemplate.DZDKH"),disabled:"view"===e.actionType},model:{value:e.parameter.port,callback:function(t){e.$set(e.parameter,"port",t)},expression:"parameter.port"}})],1)],1)],1):e._e(),"ElasticSearch"===e.selectSourceType?a("Row",[a("Form-item",{attrs:{label:"Elastic Url",prop:"elasticSearchPaths","label-width":130}},e._l(e.parameter.metaStorePaths,(function(t,s){return a("div",{key:s,staticClass:"parameter-item"},[a("wb-input",{staticClass:"margin-bottom",attrs:{placeholder:e.$t("dataTemplate.QSR")+" elasticSearch "+e.$t("dataTemplate.DZ"),width:"85%",disabled:"view"===e.actionType},model:{value:t.content,callback:function(a){e.$set(t,"content",a)},expression:"path.content"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n http://\n ")]),a("span",{attrs:{slot:"append"},slot:"append"},["md-add"==t.icon?a("Icon",{staticClass:"icon-plus",attrs:{type:t.icon,color:"gray",size:"18"},on:{click:e.sourceMetaPlus}}):"md-remove"==t.icon?a("Icon",{staticClass:"icon-plus",attrs:{type:t.icon,color:"gray",size:"18"},on:{click:function(t){return e.sourceMetaMinus(s)}}}):e._e(),0==s?a("Icon",{staticClass:"icon-plus",attrs:{type:"md-add",color:"gray",size:"18"},on:{click:e.sourceMetaPlus}}):e._e()],1)])],1)})),0)],1):e._e(),"MYSQL"===e.selectSourceType?a("Row",[a("Cell",{attrs:{span:"11"}},[a("Form-item",{attrs:{label:"MYSQL "+e.$t("dataTemplate.DZ"),prop:"sqlPathHost","label-width":130}},[a("wb-input",{attrs:{placeholder:"MYSQL "+e.$t("dataTemplate.DZ")+" HOST",disabled:"view"===e.actionType},model:{value:e.parameter.host,callback:function(t){e.$set(e.parameter,"host",t)},expression:"parameter.host"}})],1)],1),a("Cell",{attrs:{span:"10"}},[a("Form-item",{attrs:{prop:"sqlPathPort"}},[a("wb-input",{attrs:{type:"number",placeholder:"MYSQL "+e.$t("dataTemplate.DZDKH"),disabled:"view"===e.actionType},model:{value:e.parameter.port,callback:function(t){e.$set(e.parameter,"port",t)},expression:"parameter.port"}})],1)],1)],1):e._e(),"ORACLE"===e.selectSourceType?a("Row",[a("Cell",{attrs:{span:"11"}},[a("Form-item",{attrs:{label:"ORACLE "+e.$t("dataTemplate.DZ"),prop:"pathHost","label-width":130}},[a("wb-input",{attrs:{placeholder:"ORACLE "+e.$t("dataTemplate.DZ")+" HOST",disabled:"view"===e.actionType},model:{value:e.parameter.host,callback:function(t){e.$set(e.parameter,"host",t)},expression:"parameter.host"}})],1)],1),a("Cell",{attrs:{span:"10"}},[a("Form-item",{attrs:{prop:"pathPort"}},[a("wb-input",{attrs:{type:"number",placeholder:"ORACLE "+e.$t("dataTemplate.DZDKH"),disabled:"view"===e.actionType},model:{value:e.parameter.port,callback:function(t){e.$set(e.parameter,"port",t)},expression:"parameter.port"}})],1)],1),a("Cell",{attrs:{span:"11"}},[a("Form-item",{attrs:{prop:"serviceName","label-width":130}},[a("wb-input",{attrs:{placeholder:"ORACLE "+e.$t("dataTemplate.DZ")+" service_name",disabled:"view"===e.actionType},model:{value:e.parameter.serviceName,callback:function(t){e.$set(e.parameter,"serviceName",t)},expression:"parameter.serviceName"}})],1)],1),a("Cell",{attrs:{span:"10"}},[a("Form-item",{attrs:{prop:"serviceSid"}},[a("wb-input",{attrs:{placeholder:"ORACLE "+e.$t("dataTemplate.DZ")+" sid",disabled:"view"===e.actionType},model:{value:e.parameter.sid,callback:function(t){e.$set(e.parameter,"sid",t)},expression:"parameter.sid"}})],1)],1)],1):e._e(),a("Form-item",{attrs:{label:e.$t("dataTemplate.RZFS"),"label-width":130,prop:"authType"}},[a("Radio-group",{attrs:{disabled:"view"===e.actionType},model:{value:e.parameter.authType,callback:function(t){e.$set(e.parameter,"authType",t)},expression:"parameter.authType"}},e._l(e.authTypeList,(function(e){return a("Radio",{key:e.value,attrs:{value:e.value,label:e.label}})})),1)],1),"KERBERS"===e.parameter.authType&&"NONE"!==e.parameter.authType?a("Form-item",{attrs:{label:"hostName",prop:"hostName","label-width":130}},[a("Wb-input",{attrs:{type:"text",placeholder:e.$t("dataTemplate.SRWB"),width:"85%",disabled:"view"===e.actionType},model:{value:e.parameter.hostname,callback:function(t){e.$set(e.parameter,"hostname",t)},expression:"parameter.hostname"}})],1):e._e(),"KERBERS"===e.parameter.authType&&"NONE"!==e.parameter.authType?a("Form-item",{attrs:{label:"realm",prop:"realm","label-width":130}},[a("Wb-input",{attrs:{type:"text",placeholder:e.$t("dataTemplate.SRWB"),width:"85%",disabled:"view"===e.actionType},model:{value:e.parameter.realminfo,callback:function(t){e.$set(e.parameter,"realminfo",t)},expression:"parameter.realminfo"}})],1):e._e()],1)],1),a("weLoading",{directives:[{name:"show",rawName:"v-show",value:e.FesFesx.isLoading,expression:"FesFesx.isLoading"}]})],1)},n=[];s._withStripped=!0;var i=a("ce07"),r=a.n(i),o=a("6a55"),l=a.n(o),c=a("d06c"),u=a.n(c),d=a("fdf5"),h=a.n(d),p=a("ca14"),m=a.n(p),f=a("3a6f"),b=a.n(f),g=a("753e"),D=a.n(g),S=a("efe3"),v=a.n(S),C=a("c8d7"),y=a.n(C),w=a("58df"),T=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"mask"},[a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.loadingShow,expression:"loadingShow"}],staticClass:"sub-loading",attrs:{color:"#ccc",size:"50px"}})],1)},F=[];T._withStripped=!0;var $={data:function(){return{loadingShow:!0}}},x=$,_=(a("958e"),a("dcb0")),A=Object(_["a"])(x,T,F,!1,null,"74ad308b",null);A.options.__file="src/components/uiTemplate/weLoading.fes";var L=A.exports,N={components:{weModal:w["a"],weLoading:L},data:function(){var e,t,a=this,s=function(e,t,s){a.parameter.serviceName||a.parameter.sid||s(new Error("service_name和sid至少填一项")),s()},n=function(e,t,a){(t<0||t>65535)&&a(new Error("请输入正确的端口")),a()};return{addShow:!1,selectSourceList:["HIVE","HDFS","SFTP","ElasticSearch","MYSQL","ORACLE"],parameter:{metaStorePaths:[{content:""}],hdfsPath:"",hadoopConfigs:[{key:"",value:""}],connParams:[{key:"",value:""}],authType:"KERBERS",host:"",port:"",hostname:"",realminfo:"",elasticUrls:"",serviceName:"",sid:""},selectSourceType:"HIVE",templateName:"",description:"",querySourceType:"",queryModelName:"",pagination:{size:11,current:1,total:10},actionType:"",templateList:[],currentTemplateID:"",sourceRule:{templateSourceType:[{required:!0,message:this.$t("dataTemplate.SZYLXBMK")}],templateName:[{required:!0,message:this.$t("dataTemplate.MBMCBLK")},{message:this.$t("dataTemplate.MCCDBNDY"),max:100},{type:"string",pattern:/^[a-zA-Z0-9_\u4e00-\u9fa5.:]*$/,message:this.$t("dataTemplate.ZU"),trigger:"change"}],templateDesc:[{required:!0,message:this.$t("dataTemplate.MOMSBNK")},{required:!1,message:this.$t("dataTemplate.MBCDBNDY"),max:100}],metaStorePaths:[{required:!0,message:"metastore ".concat(this.$t("dataTemplate.DZBNK"))},{required:!1,message:this.$t("dataTemplate.CDBNDY"),max:1e3}],elasticSearchPaths:[{required:!0,message:"ESPaths ".concat(this.$t("dataTemplate.DZBNK"))},{required:!1,message:this.$t("dataTemplate.CDBNDY"),max:1e3}],hdfsPath:[{required:!0,message:"hdfs ".concat(this.$t("dataTemplate.DZBNK"))},{required:!1,message:this.$t("dataTemplate.CDBNDY"),max:1e3}],pathHost:[{required:!0,message:this.$t("dataTemplate.DZBNWK")}],pathPort:[{required:!0,message:this.$t("dataTemplate.DZBNWK")},{validator:n,trigger:"blur"}],authType:[{required:!0,message:this.$t("dataTemplate.DZBNWK")}],hostName:[{required:!1,message:"hostName ".concat(this.$t("dataTemplate.BNWK"))}],realm:[{required:!0,message:"realm ".concat(this.$t("dataTemplate.BNWK"))}],elasticPath:[{required:!0,message:"elasticUrl ".concat(this.$t("dataTemplate.BNWK"))}],sqlPathHost:[{required:!0,message:y()(e="sql ".concat(this.$t("dataTemplate.DZ")," host ")).call(e,this.$t("dataTemplate.BNWK"))}],sqlPathPort:[{required:!0,message:y()(t="sql ".concat(this.$t("dataTemplate.DZ")," port ")).call(t,this.$t("dataTemplate.BNWK"))}],serviceName:[{validator:s,trigger:"blur"},{type:"string",pattern:/^[a-zA-Z0-9_\u4e00-\u9fa5.:]*$/,message:this.$t("dataTemplate.ZU"),trigger:"change"}],serviceSid:[{validator:s,trigger:"blur"},{type:"string",pattern:/^[a-zA-Z0-9]*$/,message:this.$t("message.newComponents.SupportonlylettersandNumbers"),trigger:"change"}]}}},computed:{authTypeList:function(){var e=[];return"HIVE"===this.selectSourceType||"HDFS"===this.selectSourceType?e=[{value:"KERBERS",label:"kerbers"},{value:"LDAP",label:"LDAP"}]:"SFTP"===this.selectSourceType?e=[{value:"DEFAULT",label:this.$t("dataTemplate.MR")},{value:"KEYFILE",label:"keyFile"}]:"ElasticSearch"!==this.selectSourceType&&"MYSQL"!==this.selectSourceType&&"ORACLE"!==this.selectSourceType||(e=[{value:"DEFAULT",label:this.$t("dataTemplate.MR")}]),"HIVE"!==this.selectSourceType&&"HDFS"!==this.selectSourceType&&"ElasticSearch"!==this.selectSourceType||e.push({value:"NONE",label:this.$t("dataTemplate.WQX")}),e},newHadoopValue:function(){return"MYSQL"===this.selectSourceType?this.parameter.connParams:this.parameter.hadoopConfigs},modelTitle:function(){return"view"===this.actionType?this.$t("dataTemplate.CKMB"):"modify"===this.actionType?this.$t("dataTemplate.XGMB"):this.$t("dataTemplate.TJMB")},userName:function(){return this.FesApp.get("FesUserName")}},watch:{selectSourceType:function(e){"add"===this.actionType&&(this.parameter.authType=this.authTypeList[0].value)}},FesReady:function(){this.searchQuery()},methods:{init:function(){this.parameter={metaStorePaths:[{content:""}],hdfsPath:"",hadoopConfigs:[{key:"",value:""}],connParams:[{key:"",value:""}],authType:"KERBERS",sftpPath:{host:"",port:""},hostname:"",realminfo:""},this.selectSourceType="HIVE",this.templateName="",this.description=""},addAction:function(){this.addShow=!0,this.actionType="add",this.init()},sourceMetaPlus:function(){1===this.parameter.metaStorePaths.length&&(this.parameter.metaStorePaths[0].icon="md-remove"),this.parameter.metaStorePaths.push({content:"",icon:"md-remove"})},sourceMetaMinus:function(e){var t;v()(t=this.parameter.metaStorePaths).call(t,e,1),1===this.parameter.metaStorePaths.length&&(this.parameter.metaStorePaths[0].icon="")},sourceConfPlus:function(e){1===this.parameter[e].length&&(this.parameter[e][0].icon="md-remove"),this.parameter[e].push({key:"",value:"",icon:"md-remove"})},sourceConfMinus:function(e,t){var a;v()(a=this.parameter[t]).call(a,e,1),1===this.parameter[t].length&&(this.parameter[t][0].icon="")},parameterValue:function(){var e={};if("HIVE"===this.selectSourceType||"HDFS"===this.selectSourceType){var t;if("HIVE"===this.selectSourceType){var a="";for(var s in this.parameter.metaStorePaths){var n;a+="thrift://"+D()(n=this).call(n,this.parameter.metaStorePaths[s].content),b()(s)!==this.parameter.metaStorePaths.length-1&&(a+=",")}e.hiveMetastoreUris=a}e.defaultFS="hdfs://"+D()(t=this).call(t,this.parameter.hdfsPath);var i={};for(var r in e.hadoopConfig=i,this.parameter.hadoopConfigs){var o,l,c=this.parameter.hadoopConfigs[r];if(null!==c.key&&""!==c.key)i[D()(o=this).call(o,c.key)]=D()(l=this).call(l,c.value)}e.authType=this.parameter.authType,"KERBERS"===this.parameter.authType&&"NONE"!==e.authType?(e.haveKerberos=!0,e.hostname=this.parameter.hostname,e.realminfo=this.parameter.realminfo):e.haveKerberos=!1}else if("ElasticSearch"===this.selectSourceType){var u="";for(var d in this.parameter.metaStorePaths){var h;u+="http://"+D()(h=this).call(h,this.parameter.metaStorePaths[d].content),b()(d)!==this.parameter.metaStorePaths.length-1&&(u+=",")}e.elasticUrls=u,e.authType=this.parameter.authType,e.haveKerberos=!1}else if("MYSQL"===this.selectSourceType){var p={};for(var f in e.connParams=p,this.parameter.connParams){var g,S,v=this.parameter.connParams[f];if(null!==v.key&&""!==v.key)p[D()(g=this).call(g,v.key)]=D()(S=this).call(S,v.value)}e.host=this.parameter.host,e.port=this.parameter.port,e.authType=this.parameter.authType,e.haveKerberos=!1}else"ORACLE"===this.selectSourceType?(e.serviceName=this.parameter.serviceName,e.sid=this.parameter.sid,e.host=this.parameter.host,e.port=this.parameter.port,e.authType=this.parameter.authType,e.haveKerberos=!1):(e.host=this.parameter.host,e.port=this.parameter.port,e.authType=this.parameter.authType,e.haveKerberos=!1);return m()(e)},addConfirm:function(){var e=this;this.checkHadoop("key")||this.$refs.templateForm.validate((function(t){if(t){if(e.checkName(e.templateName,e.currentTemplateID))return e.$Toast.error(e.$t("dataTemplate.MBMCBKTM"));e.FesFesx.set("isLoading",!0),"add"===e.actionType?e.FesApi.fetch("/model/add",{modelName:e.templateName,modelDesc:e.description,sourceType:e.selectSourceType,parameter:e.parameterValue()},"post").then((function(){e.$Toast.success(e.$t("dataTemplate.XZMBCG")),e.searchQuery(e.pagination.current,e.pagination.size)}))["catch"]((function(){e.FesFesx.set("isLoading",!1)})):e.FesApi.fetch("/model/update/".concat(e.currentTemplateID),{id:e.currentTemplateID,modelName:e.templateName,modelDesc:e.description,sourceType:e.selectSourceType,parameter:e.parameterValue()},{},"put").then((function(){e.$Toast.success(e.$t("dataTemplate.XGMBCG")),e.searchQuery(e.pagination.current,e.pagination.size)}))["catch"]((function(){e.FesFesx.set("isLoading",!1),e.$Toast.error(e.$t("dataTemplate.XGMBSB"))}))}else e.addShow=!0}))},deleteAction:function(e){var t;if(!this.checkAuthority(e,"DELETE"))return this.$Toast.warn(this.$t("pageDs.YHWSCQX"));var a=this;this.$Message({title:this.$t("dataTemplate.SCMB"),template:y()(t="".concat(this.$t("dataTemplate.QRSCMB")," ")).call(t,e.modelName),buttons:[{text:this.$t("dataTemplate.QR"),show:!0},{text:this.$t("dataTemplate.FQ"),show:!0}]}).then((function(t){0==t&&(a.FesFesx.set("isLoading",!0),a.FesApi.fetch("model/delete/".concat(e.id),{},"delete").then((function(){var t,s;a.$Toast.success(y()(t=y()(s="".concat(a.$t("dataTemplate.MB")," ")).call(s,e.modelName," ")).call(t,a.$t("dataTemplate.SCCG"))),a.searchQuery()}))["catch"]((function(){a.FesFesx.set("isLoading",!1)})))}))},reviewParameterData:function(e){var t=JSON.parse(e.parameter);if("HIVE"===this.selectSourceType){var a=t.hiveMetastoreUris.split(","),s=[];for(var n in a)s.push({content:a[n].substring("thrift://".length),icon:"md-remove"});1===s.length&&(s[0].icon=""),this.parameter.metaStorePaths=s}if("ElasticSearch"===this.selectSourceType){var i=t.elasticUrls.split(","),r=[];for(var o in i)r.push({content:i[o].substring("http://".length),icon:"md-remove"});1===r.length&&(r[0].icon=""),this.parameter.metaStorePaths=r}if("HIVE"===this.selectSourceType||"HDFS"===this.selectSourceType){this.parameter.hdfsPath=t.defaultFS.substring("hdfs://".length);var l=[];for(var c in t.hadoopConfig)l.push({key:c,value:t.hadoopConfig[c],icon:"md-remove"});(!t.hadoopConfig||h()(t.hadoopConfig).length<=0)&&l.push({key:"",value:"",icon:"md-add"}),1===l.length&&(l[0].icon=""),this.parameter.hadoopConfigs=l}else if("MYSQL"===this.selectSourceType){var u=[];for(var d in t.connParams)u.push({key:d,value:t.connParams[d],icon:"md-remove"});(!t.connParams||h()(t.connParams).length<=0)&&u.push({key:"",value:"",icon:"md-add"}),1===u.length&&(u[0].icon=""),this.parameter.connParams=u,this.parameter.host=t.host,this.parameter.port=t.port}else"ORACLE"===this.selectSourceType?(this.parameter.serviceName=t.serviceName,this.parameter.sid=t.sid,this.parameter.host=t.host,this.parameter.port=t.port):(this.parameter.host=t.host,this.parameter.port=t.port);this.parameter.authType=t.authType,"KERBERS"!==this.parameter.authType&&"KEYFILE"!==this.parameter.authType||(this.parameter.hostname=t.hostname,this.parameter.realminfo=t.realminfo)},detailAction:function(e){this.actionType="view",this.addShow=!0,this.selectSourceType=e.sourceType,this.templateName=e.modelName,this.description=e.modelDesc,this.reviewParameterData(e)},modifyAction:function(e){if(!this.checkAuthority(e,"WRITE"))return this.$Toast.warn(this.$t("pageDs.YHWBJQX"));this.actionType="modify",this.addShow=!0,this.selectSourceType=e.sourceType,this.templateName=e.modelName,this.description=e.modelDesc,this.currentTemplateID=e.id,this.reviewParameterData(e)},searchQuery:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:11;this.FesFesx.set("isLoading",!0),this.FesApi.fetch("/model/pageList",{modelName:this.queryModelName,sourceType:this.querySourceType,page:t,pageSize:a},"get").then((function(t){e.FesFesx.set("isLoading",!1),e.templateList=t.data,e.pagination.size=t.pageSize,e.pagination.current=t.page,e.pagination.total=t.totalPages}))["catch"]((function(){e.FesFesx.set("isLoading",!1)}))},pageChange:function(e){var t=e.current,a=e.size;this.searchQuery(t,a)},checkHadoop:function(e){var t,a,s,n=[];if(u()(t=this.newHadoopValue).call(t,(function(t){n.push(t[e])})),this.checkHadoopRegex(n))return this.$Toast.error(y()(a=y()(s="HADOOP".concat(this.$t("dataTemplate.PZ")," ")).call(s,"key"==e?this.$t("dataTemplate.J"):this.$t("dataTemplate.Z"))).call(a,this.$t("dataTemplate.CF"))),!0},checkHadoopRegex:function(e){for(var t=l()(e).call(e),a=0;a0&&e.append("id",this.sourceForm.id),e},isOwnerOrAdmin:function(e){var t,a=this.FesStorage.get("userRole");return e.createUser===this.userName||r()(t=["super","admin"]).call(t,a)},checkAuthority:function(e){var t,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.FesStorage.get("userRole");return!(e.createUser!==this.userName&&!r()(t=["super","admin"]).call(t,n)&&"add"!==this.activeType)||!!(s&&e.authScopes&&r()(a=e.authScopes).call(a,s))}}},H=Y,Q=(a("d7a2"),Object(_["a"])(H,E,I,!1,null,"78d99f2e",null));Q.options.__file="src/components/uiTemplate/sourceForm.fes";var U=Q.exports,G={components:{weModal:w["a"],sourceForm:U,weLoading:L},FesData:function(){return{loading:!1,search:{source:"",name:"",owner:""},dsOwners:[],pagination:{size:10,current:1,total:0},sourceData:[],sourceFormShow:!1,formTitle:"",currentType:"",activeType:"",modifyData:{},projectDataList:[]}},computed:{userName:function(){return this.FesApp.get("FesUserName")}},FesReady:function(){this.loadOwners(),this.searchQuery(),this.getProjectData()},methods:{getProjectName:function(e){var t;if(!e||e<=0)return"---";var a=R()(t=this.projectDataList).call(t,(function(t){return t.id===e}));return a?a.projectName:e},getProjectData:function(){var e=this;this.FesApi.fetch("/project/selectAll","get").then((function(t){e.projectDataList=t}))},loadOwners:function(){var e=this;this.FesApi.fetch("/admin/dsOwner/selectAll","get").then((function(t){e.dsOwners=t}))["catch"]((function(e){console.log(e)}))},searchQuery:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.loading=!0,this.FesApi.fetch("/datasource/pageList",{sourceName:this.search.name,sourceType:this.search.source,owner:this.search.owner,page:t,pageSize:a},"get").then((function(t){e.loading=!1,e.pagination.total=t.totalPages,e.pagination.current=t.page,e.sourceData=t.data}))["catch"]((function(){e.loading=!1}))},showChooseWind:function(){this.$refs.ds_choose.show()},pageChange:function(e){var t=e.current,a=e.size;this.searchQuery(t,a)},showAddWind:function(e,t){this.$refs.ds_choose.close(),this.sourceFormShow=!0,this.formTitle=t,this.currentType=e,this.activeType="add",this.modifyData=null},sourceAdd:function(e){var t=this;this.loading=!0,this.FesApi.fetch("/datasource/addAttach",e,{method:"post",headers:{"Content-Type":"multipart/form-data"}}).then((function(){t.sourceFormShow=!1,t.$Toast.success(t.$t("manager.CJSJYCG")),t.searchQuery()}))["catch"]((function(){t.loading=!1}))},sourceUpdate:function(e){var t=this;this.loading=!0,this.FesApi.fetch("/datasource/updateAttach",e,{method:"post",headers:{"Content-Type":"multipart/form-data"}}).then((function(){t.sourceFormShow=!1,t.$Toast.success(t.$t("manager.GXCG")),t.searchQuery(),t.loading=!1}))},sourceConnect:function(e){var t=this;this.loading=!0,this.FesApi.fetch("/datasource/connect/check/".concat(this.currentType.toLowerCase()),e,{method:"post",headers:{"Content-Type":"multipart/form-data"},timeout:"60000"}).then((function(){t.loading=!1,t.$Toast.success(t.$t("manager.LJSJYCG"))}))["catch"]((function(){t.loading=!1}))},sourceDelete:function(e){var t=this;if(!this.checkAuthority(e,"DELETE"))return this.$Toast.warn(this.$t("pageDs.YHWSCQX"));this.$Message.confirm(this.$t("manager.SCSJY"),"".concat(this.$t("manager.SFSCSJY",{name:e.sourceName}),"?")).then((function(a){0===a&&(t.loading=!0,t.FesApi.fetch("/datasource/delete/".concat(e.id),{},"delete").then((function(){t.$Toast.success(t.$t("manager.SCSJYCG")),t.searchQuery()}))["catch"]((function(){t.loading=!1})))}))},sourceModify:function(e){var t=this;if(!this.checkAuthority(e,"WRITE"))return this.$Toast.warn(this.$t("pageDs.YHWBJQX"));var a=function(){return"hive"===e.sourceType?"HIVE".concat(t.$t("manager.SJY")):"hdfs"===e.sourceType?"HDFS".concat(t.$t("manager.SJY")):"sftp"===e.sourceType?"SFTP".concat(t.$t("manager.SJY")):"mysql"===e.sourceType?"MYSQL".concat(t.$t("manager.SJY")):void 0};this.sourceFormShow=!0,this.formTitle=a(),this.currentType=e.sourceType.toUpperCase(),this.activeType="update",this.modifyData=e},sourceDetail:function(e){var t=this;if(!this.checkAuthority(e,"READ"))return this.$Toast.warn(this.$t("pageDs.YHWBJQX"));this.FesApi.fetch("/datasource/view/".concat(e.id),{},"get").then((function(e){var a=function(){return"hive"===e.sourceType?"HIVE".concat(t.$t("manager.SJY")):"hdfs"===e.sourceType?"HDFS".concat(t.$t("manager.SJY")):"sftp"===e.sourceType?"SFTP".concat(t.$t("manager.SJY")):"mysql"===e.sourceType?"MYSQL".concat(t.$t("manager.SJY")):void 0};t.sourceFormShow=!0,t.formTitle=a(),t.currentType=e.sourceType.toUpperCase(),t.activeType="detail",t.modifyData=e}))},checkAuthority:function(e){var t,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.FesStorage.get("userRole");return!(e.createUser!==this.userName&&!r()(t=["super","admin"]).call(t,n))||!!(s&&e.authScopes&&r()(a=e.authScopes).call(a,s))}}},V=G,q=(a("99e6"),Object(_["a"])(V,M,Z,!1,null,"c91c522c",null));q.options.__file="src/pages/ds/newManager/index.fes";var z=q.exports,K=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("diV",{staticClass:"group-box"},[a("Row",{staticClass:"group-header"},[a("Cell",{staticClass:"header-item",attrs:{span:"3"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.deleteGroupList}},[e._v("\n "+e._s(e.$t("group.SCYXX"))+"\n ")])],1),a("Cell",{attrs:{span:"6"}},[a("Row",[a("Cell",{attrs:{span:"5"}},[e._v("\n "+e._s(e.$t("group.FZBH"))+"\n ")]),a("Cell",{attrs:{span:"15"}},[a("Wb-input",{attrs:{placeholder:e.$t("group.SRDZGSS")},on:{"on-enter":function(t){return e.search()}},model:{value:e.groupNum,callback:function(t){e.groupNum=t},expression:"groupNum"}})],1)],1)],1),a("Cell",{attrs:{span:"6"}},[a("Row",[a("Cell",{attrs:{span:"5"}},[e._v("\n "+e._s(e.$t("group.FZM"))+"\n ")]),a("Cell",{attrs:{span:"15"}},[a("Wb-input",{attrs:{placeholder:e.$t("group.SRFZMSS")},on:{"on-enter":function(t){return e.search()}},model:{value:e.groupName,callback:function(t){e.groupName=t},expression:"groupName"}})],1),a("Cell",{attrs:{span:"1",offset:"1"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:function(t){return e.search()}}},[e._v("\n "+e._s(e.$t("group.CX"))+"\n ")])],1)],1)],1),a("Cell",{staticClass:"header-item",attrs:{span:"3",offset:"6"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.addGroup}},[e._v("\n "+e._s(e.$t("group.TJFZ"))+"\n ")])],1)],1),a("Row",{staticClass:"group-content"},[a("Wb-table",{ref:"groupTable",attrs:{data:e.dataList,"no-data-text":e.$t("group.ZWSJ")}},[a("Column",{attrs:{type:"selection"}}),a("Column",{attrs:{prop:"id",name:e.$t("group.FZBH")}}),a("Column",{attrs:{prop:"groupName",name:e.$t("group.FZM")}}),a("Column",{attrs:{prop:"groupDesc",name:e.$t("group.MS")}}),a("Column",{attrs:{prop:"createUser",name:e.$t("group.CJR")}}),a("Column",{attrs:{component:e.bindProjectComponent,name:e.$t("group.BDXM")}}),a("Column",{attrs:{prop:"createTime",name:e.$t("group.CJSJ")}}),a("Column",{attrs:{prop:"modifyTime",name:e.$t("group.GXSJ")}}),a("Column",{attrs:{name:e.$t("group.XQ"),action:e.groupDetail}})],1),a("Pagination",{staticClass:"groupPagination page-loc",attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.changePage}})],1),a("weLoading",{directives:[{name:"show",rawName:"v-show",value:e.FesFesx.isLoading,expression:"FesFesx.isLoading"}]})],1)},ee=[];K._withStripped=!0;var te=a("df0a"),ae=a.n(te),se={data:function(){return{groupNum:"",groupName:"",dataList:[],deleteList:[],pagination:{size:10,current:1,total:10,locking:!1},groupDetail:[{text:this.$t("group.CKXQ"),func:this.groupDetailAction}],bindProjectComponent:this.bindProject}},components:{weLoading:L,weModal:w["a"]},created:function(){this.search(1,10)},methods:{bindProject:function(e){return new Vue({data:function(){return{trData:e}},methods:{getProjectName:function(e){return e.project?e.project.projectName:"---"},getStyle:function(){return"{\n border: none;\n padding: 0 10px;\n background-color: #ff9988;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 90px;\n border-radius: 5px;\n color: #f7f7f7;\n line-height: 25px;\n display: inline-block;\n }"}},template:'{{getProjectName(trData)}}'})},addGroup:function(){var e,t=this.FesStorage.get("userRole");if(!r()(e=["super","admin"]).call(e,t))return this.$Toast.warn($t("message.newAllPage.Noaddgrouppermissions"));this.$router.push({path:"/group/groupDetail"})},changePage:function(e){var t=e.current,a=e.size;this.search(t,a)},groupDetailAction:function(e){this.$router.push({path:"/group/groupDetail?id="+e.id})},search:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.pagination.total=0,this.FesFesx.set("isLoading",!0);var s={page:t,pageSize:a,id:this.groupNum,groupName:this.groupName};return this.FesApi.fetch("/group/pageList",s,"get").then((function(t){e.FesFesx.set("isLoading",!1);var s=t.code;0!=s?e.$Toast.error(t.message):(e.dataList=t.data,e.FesFesx.set("groupDataList",t.data),e.pagination.total=t.totalPages,e.pagination.current=t.page,e.pagination.size=a)}))["catch"]((function(){e.FesFesx.set("isLoading",!1)})),!1},deleteGroupList:function(){var e,t,a,s=this,n=this.FesStorage.get("userRole");if(!r()(e=["super","admin"]).call(e,n))return this.$Toast.warn($t("message.newAllPage.Nodeletegrouppermissions"));(this.deleteList=this.$refs.groupTable.getSelected(),this.deleteList.length<=0)?this.$Toast(this.$t("group.XZYSCDFZ")):this.$Message.confirm(this.$t("group.SCFZ"),y()(t="".concat(this.$t("group.QRSCFZ"))).call(t,ae()(a=this.deleteList).call(a,(function(e){return e.groupName})).join(",")," ?")).then((function(e){0===e&&s.confirm()}))},confirm:function(){var e,t=this;this.FesFesx.set("isLoading",!0);var a=ae()(e=this.deleteList).call(e,(function(e){return e.id})).join(",");this.FesApi.fetch("/group/delBatch",{ids:a}).then((function(e){t.FesFesx.set("isLoading",!1),t.$Toast.success(t.$t("group.FZSCCG")),t.search()}))["catch"]((function(){t.FesFesx.set("isLoading",!1)}))}}},ne=se,ie=(a("363e"),Object(_["a"])(ne,K,ee,!1,null,"0303e37c",null));ie.options.__file="src/pages/group/index.fes";var re=ie.exports,oe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"detail-box"},[a("div",{staticClass:"detail-header"},[a("h2",[e._v(e._s(e.$t("group.FZXQ")))]),a("Wb-button",{attrs:{type:"primary"},on:{click:e.addGroupAction}},[e._v("\n "+e._s(e.saveText)+"\n ")]),a("Wb-button",{on:{click:e.goback}},[e._v("\n "+e._s(e.$t("group.FH"))+"\n ")])],1),a("Panel",{attrs:{title:e.$t("group.JCXX")}},[a("Wb-form",{ref:"formValidate",staticClass:"group-detail-form",attrs:{"label-position":"left","label-width":100}},[a("Form-item",{attrs:{label:e.$t("group.FZM"),prop:"groupName",rule:[{required:!0,message:e.$t("group.FZMBNK")},{type:"string",pattern:/^[a-zA-Z0-9_\u4e00-\u9fa5\[\]]*$/,message:e.$t("group.ZCZZM"),trigger:"blur"}]}},[a("wb-input",{attrs:{placeholder:e.$t("group.QSR"),type:"text",disabled:!e.isAdmin},model:{value:e.groupName,callback:function(t){e.groupName=t},expression:"groupName"}})],1),a("Form-item",{attrs:{label:e.$t("group.FZMS")}},[a("wb-input",{attrs:{placeholder:e.$t("group.QSR"),type:"text",disabled:!e.isAdmin},model:{value:e.groupDesc,callback:function(t){e.groupDesc=t},expression:"groupDesc"}})],1),a("Form-item",{attrs:{label:e.$t("group.BDXM"),prop:"bindProject"}},[a("Wb-select",{attrs:{disabled:!e.isAdmin},model:{value:e.bindProject,callback:function(t){e.bindProject=t},expression:"bindProject"}},e._l(e.projectDataList,(function(e){return a("wb-option",{key:e.id,attrs:{value:e.id,label:e.projectName}})})),1)],1),a("div",{staticClass:"detail-save"})],1)],1),a("Panel",{staticClass:"group-user-panel",attrs:{title:e.$t("group.FZCY")}},[a("Row",{staticClass:"group-header"},[a("Cell",{staticClass:"header-item",attrs:{span:"3"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.deleteUser}},[e._v("\n "+e._s(e.$t("group.SCYXX"))+"\n ")])],1),a("Cell",{attrs:{span:"6"}},[a("Row",[a("Cell",{attrs:{span:"4"}},[e._v("\n "+e._s(e.$t("group.YHM"))+"\n ")]),a("Cell",{attrs:{span:"16"}},[a("Wb-input",{attrs:{placeholder:e.$t("group.SRYHMSS")},model:{value:e.searchUserName,callback:function(t){e.searchUserName=t},expression:"searchUserName"}})],1),a("Cell",{attrs:{span:"1",offset:"1"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.searchAction}},[e._v("\n "+e._s(e.$t("group.CX"))+"\n ")])],1)],1)],1),a("Cell",{staticClass:"header-item",attrs:{span:"3",offset:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.addUser}},[e._v("\n "+e._s(e.$t("group.TICY"))+"\n ")])],1)],1),a("Row",{staticClass:"group-content"},[a("Wb-table",{ref:"userTable",attrs:{data:e.currentUserData,"no-data-text":e.$t("group.ZWSJ"),border:""}},[a("Column",{attrs:{type:"selection"}}),a("Column",{attrs:{prop:"userId",name:e.$t("group.YH")}}),a("Column",{attrs:{prop:"userName",name:e.$t("group.YHM")}})],1)],1),a("div",{staticClass:"page-pagination"},[a("Pagination",{staticClass:"group-pagination",attrs:{current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.changePage}})],1)],1),a("weModal",{attrs:{title:e.$t("group.TICY"),width:"500",closable:!1},on:{onConfirm:e.addConfirm},model:{value:e.addShow,callback:function(t){e.addShow=t},expression:"addShow"}},[a("Wb-form",{ref:"addUserForm"},[a("Form-item",{attrs:{label:e.$t("group.XZYH"),prop:"selectUserName",rule:[{validator:e.validateUserName,trigger:"change"}]}},[a("Wb-select",{attrs:{multiple:"",filterable:""},on:{"on-change":e.selcetChange,"on-search":e.filterSearch},model:{value:e.selectUserName,callback:function(t){e.selectUserName=t},expression:"selectUserName"}},e._l(e.selectUserIdList,(function(e){return a("wb-option",{key:e.userId,attrs:{value:e.userName,label:e.userName}})})),1)],1),a("Form-item",{attrs:{label:e.$t("group.YHM")}},[a("wb-input",{attrs:{type:"textarea",placeholder:e.$t("group.SRWB"),readonly:""},model:{value:e.userName,callback:function(t){e.userName=t},expression:"userName"}})],1)],1)],1),a("weLoading",{directives:[{name:"show",rawName:"v-show",value:e.isLoading,expression:"isLoading"}]})],1)},le=[];oe._withStripped=!0;var ce=a("56ed"),ue=a.n(ce),de=a("5b3f"),he=a.n(de),pe=a("eee8"),me=a.n(pe),fe=a("b69f"),be=a.n(fe),ge={data:function(){return{searchUserName:"",groupName:"",groupDesc:"",userData:[],currentUserData:[],userList:[],pagination:{size:10,current:1,total:0},addShow:!1,deleteList:[],selectUserName:[],selectUserIdList:[],userName:"",saveText:this.$t("group.TJFZ"),isChange:!1,isLoading:!1,projectDataList:[],bindProject:""}},components:{weModal:w["a"],weLoading:L},created:function(){this.addGroupUserList(),this.getProjectData(),this.FesFesx.set("isChange",!1),this.$route.query.id?(this.groupDetailAction(),this.saveText=this.$t("group.BCXG")):this.search()},watch:{userList:{handler:function(e){this.pageTotalAction(e)},deep:!0},isChange:function(e){this.FesFesx.set("isChange",e)},routedPath:function(e){var t=this;e&&this.$Message.confirm(this.$t("group.BCTS"),this.$t("group.FZXXTXSFBC")).then((function(a){0===a?t.addGroupAction(e):(t.FesFesx.set("isChange",!1),t.$router.push({path:e}))}))}},computed:{routedPath:function(){return this.FesFesx.get("isGoto")},isAdmin:function(){var e,t=this.FesStorage.get("userRole");return r()(e=["super","admin"]).call(e,t)}},methods:{getProjectData:function(){var e=this;this.FesApi.fetch("/project/selectAll","get").then((function(t){e.projectDataList=t}))},validateUserName:function(e,t,a){be()(t).call(t,(function(e){return/^[a-zA-Z0-9_\u4e00-\u9fa5]*$/.test(e)}))?a():a(new Error(this.$t("group.ZCZZM")))},goback:function(){if(this.isChange&&this.$route.query.id)return this.$Toast(this.$t("group.XGFZNRWBC"));this.FesApp.router.push("/group")},addUser:function(){this.addShow=!0},addGroupUserList:function(){var e=this;this.isLoading=!0,this.FesApi.fetch("/usergroup/getAvailableUser",{},"post").then((function(t){e.selectUserIdList=t,e.isLoading=!1}))["catch"]((function(){e.isLoading=!1}))},groupDetailAction:function(){var e=this;this.FesApi.fetch("/group/view/".concat(this.$route.query.id),{},"get").then((function(t){e.groupName=t.groupName,e.groupDesc=t.groupDesc,e.userList=t.userList?t.userList:[],e.bindProject=t.projectId,e.pagination.total=Math.ceil(e.userList.length/e.pagination.size),e.search(e.pagination.current,e.pagination.size)}))},addGroupAction:function(){var e=this;this.$refs.formValidate.validate((function(t){if(t)if(e.isLoading=!0,e.$route.query.id){var a={id:e.$route.query.id,groupName:e.groupName,groupDesc:e.groupDesc,userList:e.userList,projectId:e.bindProject};e.FesApi.fetch("/group/update/".concat(a.id),a,"post").then((function(t){e.isLoading=!1,e.isChange=!1,e.FesFesx.set("isChange",!1),e.$Toast.success(e.$t("group.FZXG",{name:a.groupName})),e.FesApp.router.push("/group")}))["catch"]((function(){e.FesFesx.set("isChange",!1),e.isLoading=!1}))}else{var s={groupName:e.groupName,groupDesc:e.groupDesc,userList:e.userList,projectId:e.bindProject};e.FesApi.fetch("/group/add",s,"post").then((function(t){e.isLoading=!1,e.isChange=!1,e.FesFesx.set("isChange",!1),e.$Toast.success(e.$t("group.CJCG",{name:s.groupName})),e.$router.go(-1)}))["catch"]((function(){e.FesFesx.set("isChange",!1),e.isLoading=!1}))}else e.$Toast(e.$t("group.TXZQBD"))}))},pageTotalAction:function(e){this.pagination.total=Math.ceil(e.length/this.pagination.size)},changePage:function(e){var t=e.current,a=e.size;this.search(t,a),this.pagination.current=t,this.pagination.size=a},searchAction:function(){this.search(1,10),this.pagination.current=1},search:function(){var e,t=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=me()(e=this.userList).call(e,(function(e){var a=RegExp(t.searchUserName);return a.test(e.userName)||!t.searchUserName}));this.currentUserData=me()(n).call(n,(function(e,t){return(a-1)*s<=t&&t\n \n '.concat(e.$t("job.BJ"),'\n \n \n ')).call(o,e.$t("job.ZX"),'\n \n \n ')).call(r,e.$t("job.FZ"),'\n \n \n ')).call(i,e.$t("job.ZTDS"),'\n \n \n ')).call(n,e.$t("job.QDDS"),'\n \n \n ')).call(s,e.$t("job.SC"),'\n \n \n ')).call(a,e.$t("job.LSSJCP"),"\n \n ")})},validateForm:{startTime:[{required:!0,message:this.$t("job.KSSJBNWK")}],endTime:[{required:!0,message:this.$t("job.JSSJBNWK")}],timeUnit:[{required:!0,message:this.$t("job.SJBNWK")}],timeInterval:[{required:!0,message:this.$t("job.JGCDBNWK")}]},unitList:["DAY"],unitValue:"DAY",intervalValue:1}},components:{weLoading:L,weModal:w["a"]},watch:{dateValueStart:function(e){e>(new Date).getTime()||e>this.dateValueEnd?(this.$Toast.error(this.$t("job.XZZQDKSSJ")),this.checkTimeResult=!0):this.checkTimeResult=!1},dateValueEnd:function(e){e>(new Date).getTime()||this.dateValueStart>e?(this.$Toast.error(this.$t("job.XZZQDJSSJ")),this.checkTimeResult=!0):this.checkTimeResult=!1},"FesFesx.enginSelect":function(e){}},methods:{searchProject:function(){this.$refs.job_left_tree.searchProject(this.searchProjectName)},resetTaskAction:function(){var e=this;this.$refs.resetTaskForm.validate((function(t){if(t){if(e.checkTimeResult)return e.$Toast.error(e.$t("job.QXZHFSJD")),void(e.resetTaskShow=!0);if(e.checkTimeInterval(e.intervalValue))return e.resetTaskShow=!0;var a={jobId:e.currentJobId,startTime:e.dateValueStart,endTime:e.dateValueEnd,unit:e.unitValue,step:e.intervalValue};e.$Message.confirm(e.$t("job.LSSJCP"),e.$t("job.QRCP",{name:e.currentJobName})).then((function(t){0===t&&(e.FesFesx.set("isLoading",!0),e.FesApi.fetch("/jobinfo/history/run",a,{methods:"post",headers:{"Content-Type":"application/json"}}).then((function(){e.FesFesx.set("isLoading",!1),e.$Toast.success(e.$t("job.CPCG"))}))["catch"]((function(){e.FesFesx.set("isLoading",!1)})))}))}else e.resetTaskShow=!0,e.$Toast.warn(e.$t("job.TXZQBD"))}))},showAdd:function(){this.isSave=!0,this.editData="",this.newData={},this.addModalShow=!0},search:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.data=[],this.pagination.total=0,this.FesFesx.set("isLoading",!0);var s={projectId:this.projectId,page:t,pageSize:a,fuzzyName:this.query.jobName,jobId:this.query.jobId};return this.FesApi.fetch("/jobinfo/pageList",s,"get").then((function(s){e.FesFesx.set("isLoading",!1);var n=s.code;0!=n?e.$Toast.error(s.message):(e.data=s.data,e.pagination.total=s.totalPages,e.pagination.current=t,e.pagination.size=a)}))["catch"]((function(){e.FesFesx.set("isLoading",!1)})),!1},changePage:function(e){var t=e.current,a=e.size;this.search(t,a)},saveinfo:function(e){console.log(e)},saveSucess:function(){return this.addModalShow=!1,this.search(this.pagination.current,this.pagination.size),!1},submit:function(){var e=this;this.FesApi.fetch("/project/add",this.newData).then((function(){e.$refs.addProjectModal.hide(),e.$Toast.success(e.$t("job.XMTJCG")),e.$refs.job_left_tree.getTree(),e.newData.projectName="",e.newData.parentId="",e.newData.projectDesc=""}))},menuAddBtn:function(){this.$refs.addProjectModal.show()},addTreeModalShow:function(){this.$refs.addProjectModal.show()},getTreeId:function(e){this.treeId=e,this.projectId=this.treeId,this.search()},checkTimeInterval:function(e){if("DAY"===this.unitValue){if(e>30)return this.$Toast.warn(this.$t("job.JGCDDY30")),!0}else if("HOUR"===this.unitValue){if(e>24)return this.$Toast.warn(this.$t("job.JGCDDY24")),!0}else{if("MINUTE"!==this.unitValue)return!1;if(e>60)return this.$Toast.warn(this.$t("job.JGCDDY60")),!0}}}},Me=Be,Ze=(a("b79c"),Object(_["a"])(Me,Pe,ke,!1,null,null,null));Ze.options.__file="src/pages/job/index.fes";var Xe=Ze.exports,Re=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"udes-login"},[a("div",{staticClass:"login-content"},[a("h2",{staticClass:"sys-title"},[e._v("\n"+e._s(e.$t("message.newAllPage.Welcometologin"))+"\n")]),a("Wb-form",{ref:"loginForm",attrs:{"label-width":0,rule:e.loginRule}},[a("Form-item",{attrs:{prop:"userName"}},[a("wb-input",{attrs:{placeholder:e.$t("message.newAllPage.Pleaseenteryourusername"),maxlength:150},on:{"on-enter":e.loginAction},model:{value:e.userName,callback:function(t){e.userName=t},expression:"userName"}})],1),a("Form-item",{attrs:{prop:"password"}},[a("wb-input",{attrs:{type:"password",placeholder:e.$t("message.newAllPage.Pleaseenterthepassword"),maxlength:150},on:{"on-enter":e.loginAction},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}})],1),a("Form-item",[a("Wb-button",{attrs:{type:"primary",long:""},on:{click:e.loginAction}},[e._v("\n"+e._s(e.$t("message.newAllPage.Thelogin"))+"\n")])],1)],1)],1)])},Ee=[];Re._withStripped=!0;var Ie=a("f612"),Je=a.n(Ie);(function(){var e;function t(e){var t,a,s,n="",i=-1;if(e&&e.length){s=e.length;while((i+=1)=55296&&t<=56319&&a>=56320&&a<=57343&&(t=65536+((1023&t)<<10)+(1023&a),i+=1),t<=127?n+=String.fromCharCode(t):t<=2047?n+=String.fromCharCode(192|t>>>6&31,128|63&t):t<=65535?n+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(n+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t))}return n}function a(e){var t,a,s,n,i,r,o=[];if(t=a=s=n=i=0,e&&e.length){r=e.length,e+="";while(t191&&s<224?(n=e.charCodeAt(t+1),o[a]=String.fromCharCode((31&s)<<6|63&n),t+=2):(n=e.charCodeAt(t+1),i=e.charCodeAt(t+2),o[a]=String.fromCharCode((15&s)<<12|(63&n)<<6|63&i),t+=3)}return o.join("")}function s(e,t){var a=(65535&e)+(65535&t),s=(e>>16)+(t>>16)+(a>>16);return s<<16|65535&a}function n(e,t){return e<>>32-t}function i(e,t){for(var a,s=t?"0123456789ABCDEF":"0123456789abcdef",n="",i=0,r=e.length;i>>4&15)+s.charAt(15&a);return n}function r(e){var t,a=32*e.length,s="";for(t=0;t>5]>>>24-t%32&255);return s}function o(e){var t,a=32*e.length,s="";for(t=0;t>5]>>>t%32&255);return s}function l(e){var t,a=8*e.length,s=Array(e.length>>2),n=s.length;for(t=0;t>5]|=(255&e.charCodeAt(t/8))<>2),n=s.length;for(t=0;t>5]|=(255&e.charCodeAt(t/8))<<24-t%32;return s}function u(e,t){var a,s,n,i,r,o,l,c,u=t.length,d=Array();for(o=Array(Math.ceil(e.length/2)),i=o.length,a=0;a0){for(r=Array(),n=0,a=0;a0||s>0)&&(r[r.length]=s);d[d.length]=n,o=r}for(l="",a=d.length-1;a>=0;a--)l+=t.charAt(d[a]);for(c=Math.ceil(8*e.length/(Math.log(t.length)/Math.log(2))),a=l.length;a8*e.length?r+=t:r+=i.charAt(n>>>6*(3-s)&63);return r}e={VERSION:"1.0.5",Base64:function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s="=",n=!0;this.encode=function(a){var i,r,o,l="",c=a.length;for(s=s||"=",a=n?t(a):a,i=0;i8*c?s:e.charAt(o>>>6*(3-r)&63);return l},this.decode=function(t){var i,r,o,l,c,u,d,h,p,m,f="",b=[];if(!t)return t;i=m=0,t=t.replace(new RegExp("\\"+s,"gi"),"");do{c=Je()(e).call(e,t.charAt(i+=1)),u=Je()(e).call(e,t.charAt(i+=1)),d=Je()(e).call(e,t.charAt(i+=1)),h=Je()(e).call(e,t.charAt(i+=1)),p=c<<18|u<<12|d<<6|h,r=p>>16&255,o=p>>8&255,l=255&p,m+=1,b[m]=64===d?String.fromCharCode(r):64===h?String.fromCharCode(r,o):String.fromCharCode(r,o,l)}while(i>>8^r;return(-1^i)>>>0},MD5:function(e){var a=!(!e||"boolean"!==typeof e.uppercase)&&e.uppercase,r=e&&"string"===typeof e.pad?e.pda:"=",c=!e||"boolean"!==typeof e.utf8||e.utf8;function h(e){return e=c?t(e):e,o(m(l(e),8*e.length))}function p(e,a){var s,n,i,r,u;for(e=c?t(e):e,a=c?t(a):a,s=l(e),s.length>16&&(s=m(s,8*e.length)),n=Array(16),i=Array(16),u=0;u<16;u+=1)n[u]=909522486^s[u],i[u]=1549556828^s[u];return r=m(y()(n).call(n,l(a)),512+8*a.length),o(m(y()(i).call(i,r),640))}function m(e,t){var a,n,i,r,o,l=1732584193,c=-271733879,u=-1732584194,d=271733878;for(e[t>>5]|=128<>>9<<4)]=t,a=0;a16&&(s=m(s,8*e.length)),n=Array(16),i=Array(16),o=0;o<16;o+=1)n[o]=909522486^s[o],i[o]=1549556828^s[o];return u=m(y()(n).call(n,c(a)),512+8*a.length),r(m(y()(i).call(i,u),672))}function m(e,t){var a,i,r,o,l,c,u,d,h=Array(80),p=1732584193,m=-271733879,g=-1732584194,D=271733878,S=-1009589776;for(e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t,a=0;a16&&(i=C(i,8*e.length));n<16;n+=1)l[n]=909522486^i[n],u[n]=1549556828^i[n];return s=C(y()(l).call(l,c(a)),512+8*a.length),r(C(y()(u).call(u,s),768))}function p(e,t){return e>>>t|e<<32-t}function m(e,t){return e>>>t}function f(e,t,a){return e&t^~e&a}function b(e,t,a){return e&t^e&a^t&a}function g(e){return p(e,2)^p(e,13)^p(e,22)}function D(e){return p(e,6)^p(e,11)^p(e,25)}function S(e){return p(e,7)^p(e,18)^m(e,3)}function v(e){return p(e,17)^p(e,19)^m(e,10)}function C(e,t){var n,i,r,o,l,c,u,d,h,p,m,C,y=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],w=new Array(64);for(e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t,h=0;h32&&(o=h(o,8*e.length));i<32;i+=1)l[i]=909522486^o[i],u[i]=1549556828^o[i];return s=h(y()(l).call(l,c(a)),1024+8*a.length),r(h(y()(u).call(u,s),1536))}function h(e,t){var s,n,i,r=new Array(80),o=new Array(16),l=[new p(1779033703,-205731576),new p(-1150833019,-2067093701),new p(1013904242,-23791573),new p(-1521486534,1595750129),new p(1359893119,-1377402159),new p(-1694144372,725511199),new p(528734635,-79577749),new p(1541459225,327033209)],c=new p(0,0),u=new p(0,0),d=new p(0,0),h=new p(0,0),C=new p(0,0),y=new p(0,0),w=new p(0,0),T=new p(0,0),F=new p(0,0),$=new p(0,0),x=new p(0,0),_=new p(0,0),A=new p(0,0),L=new p(0,0),N=new p(0,0),P=new p(0,0),k=new p(0,0);for(void 0===a&&(a=[new p(1116352408,-685199838),new p(1899447441,602891725),new p(-1245643825,-330482897),new p(-373957723,-2121671748),new p(961987163,-213338824),new p(1508970993,-1241133031),new p(-1841331548,-1357295717),new p(-1424204075,-630357736),new p(-670586216,-1560083902),new p(310598401,1164996542),new p(607225278,1323610764),new p(1426881987,-704662302),new p(1925078388,-226784913),new p(-2132889090,991336113),new p(-1680079193,633803317),new p(-1046744716,-815192428),new p(-459576895,-1628353838),new p(-272742522,944711139),new p(264347078,-1953704523),new p(604807628,2007800933),new p(770255983,1495990901),new p(1249150122,1856431235),new p(1555081692,-1119749164),new p(1996064986,-2096016459),new p(-1740746414,-295247957),new p(-1473132947,766784016),new p(-1341970488,-1728372417),new p(-1084653625,-1091629340),new p(-958395405,1034457026),new p(-710438585,-1828018395),new p(113926993,-536640913),new p(338241895,168717936),new p(666307205,1188179964),new p(773529912,1546045734),new p(1294757372,1522805485),new p(1396182291,-1651133473),new p(1695183700,-1951439906),new p(1986661051,1014477480),new p(-2117940946,1206759142),new p(-1838011259,344077627),new p(-1564481375,1290863460),new p(-1474664885,-1136513023),new p(-1035236496,-789014639),new p(-949202525,106217008),new p(-778901479,-688958952),new p(-694614492,1432725776),new p(-200395387,1467031594),new p(275423344,851169720),new p(430227734,-1194143544),new p(506948616,1363258195),new p(659060556,-544281703),new p(883997877,-509917016),new p(958139571,-976659869),new p(1322822218,-482243893),new p(1537002063,2003034995),new p(1747873779,-692930397),new p(1955562222,1575990012),new p(2024104815,1125592928),new p(-2067236844,-1578062990),new p(-1933114872,442776044),new p(-1866530822,593698344),new p(-1538233109,-561857047),new p(-1090935817,-1295615723),new p(-965641998,-479046869),new p(-903397682,-366583396),new p(-779700025,566280711),new p(-354779690,-840897762),new p(-176337025,-294727304),new p(116418474,1914138554),new p(174292421,-1563912026),new p(289380356,-1090974290),new p(460393269,320620315),new p(685471733,587496836),new p(852142971,1086792851),new p(1017036298,365543100),new p(1126000580,-1676669620),new p(1288033470,-885112138),new p(1501505948,-60457430),new p(1607167915,987167468),new p(1816402316,1246189591)]),n=0;n<80;n+=1)r[n]=new p(0,0);for(e[t>>5]|=128<<24-(31&t),e[31+(t+128>>10<<5)]=t,i=e.length,n=0;n>>a|t.h<<32-a,e.h=t.h>>>a|t.l<<32-a}function b(e,t,a){e.l=t.h>>>a|t.l<<32-a,e.h=t.l>>>a|t.h<<32-a}function g(e,t,a){e.l=t.l>>>a|t.h<<32-a,e.h=t.h>>>a}function D(e,t,a){var s=(65535&t.l)+(65535&a.l),n=(t.l>>>16)+(a.l>>>16)+(s>>>16),i=(65535&t.h)+(65535&a.h)+(n>>>16),r=(t.h>>>16)+(a.h>>>16)+(i>>>16);e.l=65535&s|n<<16,e.h=65535&i|r<<16}function S(e,t,a,s,n){var i=(65535&t.l)+(65535&a.l)+(65535&s.l)+(65535&n.l),r=(t.l>>>16)+(a.l>>>16)+(s.l>>>16)+(n.l>>>16)+(i>>>16),o=(65535&t.h)+(65535&a.h)+(65535&s.h)+(65535&n.h)+(r>>>16),l=(t.h>>>16)+(a.h>>>16)+(s.h>>>16)+(n.h>>>16)+(o>>>16);e.l=65535&i|r<<16,e.h=65535&o|l<<16}function v(e,t,a,s,n,i){var r=(65535&t.l)+(65535&a.l)+(65535&s.l)+(65535&n.l)+(65535&i.l),o=(t.l>>>16)+(a.l>>>16)+(s.l>>>16)+(n.l>>>16)+(i.l>>>16)+(r>>>16),l=(65535&t.h)+(65535&a.h)+(65535&s.h)+(65535&n.h)+(65535&i.h)+(o>>>16),c=(t.h>>>16)+(a.h>>>16)+(s.h>>>16)+(n.h>>>16)+(i.h>>>16)+(l>>>16);e.l=65535&r|o<<16,e.h=65535&l|c<<16}this.hex=function(e){return i(o(e))},this.b64=function(e){return d(o(e),s)},this.any=function(e,t){return u(o(e),t)},this.raw=function(e){return o(e,n)},this.hex_hmac=function(e,t){return i(l(e,t))},this.b64_hmac=function(e,t){return d(l(e,t),s)},this.any_hmac=function(e,t,a){return u(l(e,t),a)},this.vm_test=function(){return"900150983cd24fb0d6963f7d28e17f72"===hex("abc").toLowerCase()},this.setUpperCase=function(e){return"boolean"===typeof e&&e,this},this.setPad=function(e){return s=e||s,this},this.setUTF8=function(e){return"boolean"===typeof e&&(n=e),this}},RMD160:function(e){!(!e||"boolean"!==typeof e.uppercase)&&e.uppercase;var a=e&&"string"===typeof e.pad?e.pda:"=",r=!e||"boolean"!==typeof e.utf8||e.utf8,o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];function m(e){return e=r?t(e):e,b(g(l(e),8*e.length))}function f(e,a){var s,n;e=r?t(e):e,a=r?t(a):a;var i=l(e),o=Array(16),c=Array(16);for(i.length>16&&(i=g(i,8*e.length)),s=0;s<16;s+=1)o[s]=909522486^i[s],c[s]=1549556828^i[s];return n=g(y()(o).call(o,l(a)),512+8*a.length),b(g(y()(c).call(c,n),672))}function b(e){var t,a="",s=32*e.length;for(t=0;t>5]>>>t%32&255);return a}function g(e,t){var a,i,r,l,u,d,m,f,b,g,C,y,w,T,F=1732584193,$=4023233417,x=2562383102,_=271733878,A=3285377520;for(e[t>>5]|=128<>>9<<4)]=t,l=e.length,r=0;r=0&&e<=15?t^a^s:e>=16&&e<=31?t&a|~t&s:e>=32&&e<=47?(t|~a)^s:e>=48&&e<=63?t&s|a&~s:e>=64&&e<=79?t^(a|~s):"rmd160_f: j out of range"}function S(e){return e>=0&&e<=15?0:e>=16&&e<=31?1518500249:e>=32&&e<=47?1859775393:e>=48&&e<=63?2400959708:e>=64&&e<=79?2840853838:"rmd160_K1: j out of range"}function v(e){return e>=0&&e<=15?1352829926:e>=16&&e<=31?1548603684:e>=32&&e<=47?1836072691:e>=48&&e<=63?2053994217:e>=64&&e<=79?0:"rmd160_K2: j out of range"}this.hex=function(e){return i(m(e,r))},this.b64=function(e){return d(m(e,r),a)},this.any=function(e,t){return u(m(e,r),t)},this.raw=function(e){return m(e,r)},this.hex_hmac=function(e,t){return i(f(e,t))},this.b64_hmac=function(e,t){return d(f(e,t),a)},this.any_hmac=function(e,t,a){return u(f(e,t),a)},this.vm_test=function(){return"900150983cd24fb0d6963f7d28e17f72"===hex("abc").toLowerCase()},this.setUpperCase=function(e){return"boolean"===typeof e&&e,this},this.setPad=function(e){return"undefined"!==typeof e&&(a=e),this},this.setUTF8=function(e){return"boolean"===typeof e&&(r=e),this}}},window.Hashes=e})(window);window.Hashes;var We,Oe=0xdeadbeefcafe,je=15715070==(16777215&Oe);function Ye(e,t,a){null!=e&&("number"==typeof e?this.fromNumber(e,t,a):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function He(){return new Ye(null)}function Qe(e,t,a,s,n,i){while(--i>=0){var r=t*this[e++]+a[s]+n;n=Math.floor(r/67108864),a[s++]=67108863&r}return n}function Ue(e,t,a,s,n,i){var r=32767&t,o=t>>15;while(--i>=0){var l=32767&this[e],c=this[e++]>>15,u=o*l+c*r;l=r*l+((32767&u)<<15)+a[s]+(1073741823&n),n=(l>>>30)+(u>>>15)+o*c+(n>>>30),a[s++]=1073741823&l}return n}function Ge(e,t,a,s,n,i){var r=16383&t,o=t>>14;while(--i>=0){var l=16383&this[e],c=this[e++]>>14,u=o*l+c*r;l=r*l+((16383&u)<<14)+a[s]+n,n=(l>>28)+(u>>14)+o*c,a[s++]=268435455&l}return n}je&&"Microsoft Internet Explorer"==navigator.appName?(Ye.prototype.am=Ue,We=30):je&&"Netscape"!=navigator.appName?(Ye.prototype.am=Qe,We=26):(Ye.prototype.am=Ge,We=28),Ye.prototype.DB=We,Ye.prototype.DM=(1<=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function nt(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+DV:this.t=0}function it(e){var t=He();return t.fromInt(e),t}function rt(e,t){var a;if(16==t)a=4;else if(8==t)a=3;else if(256==t)a=8;else if(2==t)a=1;else if(32==t)a=5;else{if(4!=t)return void this.fromRadix(e,t);a=2}this.t=0,this.s=0;var s=e.length,n=!1,i=0;while(--s>=0){var r=8==a?255&e[s]:at(e,s);r<0?"-"==e.charAt(s)&&(n=!0):(n=!1,0==i?this[this.t++]=r:i+a>this.DB?(this[this.t-1]|=(r&(1<>this.DB-i):this[this.t-1]|=r<=this.DB&&(i-=this.DB))}8==a&&0!=(128&e[0])&&(this.s=-1,i>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==e)--this.t}function lt(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else if(64==e)t=6;else{if(4!=e)return this.toRadix(e);t=2}var a,s=(1<0){o>o)>0&&(n=!0,i=tt(a));while(r>=0)o>(o+=this.DB-t)):(a=this[r]>>(o-=t)&s,o<=0&&(o+=this.DB,--r)),a>0&&(n=!0),n&&(i+=tt(a))}return n?i:"0"}function ct(){var e=He();return Ye.ZERO.subTo(this,e),e}function ut(){return this.s<0?this.negate():this}function dt(e){var t=this.s-e.s;if(0!=t)return t;var a=this.t;if(t=a-e.t,0!=t)return t;while(--a>=0)if(0!=(t=this[a]-e[a]))return t;return 0}function ht(e){var t,a=1;return 0!=(t=e>>>16)&&(e=t,a+=16),0!=(t=e>>8)&&(e=t,a+=8),0!=(t=e>>4)&&(e=t,a+=4),0!=(t=e>>2)&&(e=t,a+=2),0!=(t=e>>1)&&(e=t,a+=1),a}function pt(){return this.t<=0?0:this.DB*(this.t-1)+ht(this[this.t-1]^this.s&this.DM)}function mt(e,t){var a;for(a=this.t-1;a>=0;--a)t[a+e]=this[a];for(a=e-1;a>=0;--a)t[a]=0;t.t=this.t+e,t.s=this.s}function ft(e,t){for(var a=e;a=0;--a)t[a+r+1]=this[a]>>n|o,o=(this[a]&i)<=0;--a)t[a]=0;t[r]=o,t.t=this.t+r+1,t.s=this.s,t.clamp()}function gt(e,t){t.s=this.s;var a=Math.floor(e/this.DB);if(a>=this.t)t.t=0;else{var s=e%this.DB,n=this.DB-s,i=(1<>s;for(var r=a+1;r>s;s>0&&(t[this.t-a-1]|=(this.s&i)<>=this.DB;if(e.t>=this.DB;s+=this.s}else{s+=this.s;while(a>=this.DB;s-=e.s}t.s=s<0?-1:0,s<-1?t[a++]=this.DV+s:s>0&&(t[a++]=s),t.t=a,t.clamp()}function St(e,t){var a=this.abs(),s=e.abs(),n=a.t;t.t=n+s.t;while(--n>=0)t[n]=0;for(n=0;n=0)e[a]=0;for(a=0;a=t.DV&&(e[a+t.t]-=t.DV,e[a+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(a,t[a],e,2*a,0,1)),e.s=0,e.clamp()}function Ct(e,t,a){var s=e.abs();if(!(s.t<=0)){var n=this.abs();if(n.t0?(s.lShiftTo(l,i),n.lShiftTo(l,a)):(s.copyTo(i),n.copyTo(a));var c=i.t,u=i[c-1];if(0!=u){var d=u*(1<1?i[c-2]>>this.F2:0),h=this.FV/d,p=(1<=0&&(a[a.t++]=1,a.subTo(g,a)),Ye.ONE.dlShiftTo(c,g),g.subTo(i,i);while(i.t=0){var D=a[--f]==u?this.DM:Math.floor(a[f]*h+(a[f-1]+m)*p);if((a[f]+=i.am(0,D,a,b,0,c))0&&a.rShiftTo(l,a),r<0&&Ye.ZERO.subTo(a,a)}}}function yt(e){var t=He();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(Ye.ZERO)>0&&e.subTo(t,t),t}function wt(e){this.m=e}function Tt(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function Ft(e){return e}function xt(e){e.divRemTo(this.m,null,e)}function _t(e,t,a){var s;e.multiplyTo(t,a),he()(s=this).call(s,a)}function At(e,t){var a;e.squareTo(t),he()(a=this).call(a,t)}function Lt(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return t=t*(2-(15&e)*t)&15,t=t*(2-(255&e)*t)&255,t=t*(2-((65535&e)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Nt(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(t,t),t}function kt(e){var t,a=He();return e.copyTo(a),he()(t=this).call(t,a),a}function Bt(e){while(e.t<=this.mt2)e[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;a=t+this.m.t,e[a]+=this.m.am(0,s,e,t,0,this.m.t);while(e[a]>=e.DV)e[a]-=e.DV,e[++a]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function Mt(e,t){var a;e.squareTo(t),he()(a=this).call(a,t)}function Zt(e,t,a){var s;e.multiplyTo(t,a),he()(s=this).call(s,a)}function Xt(){return 0==(this.t>0?1&this[0]:this.s)}function Rt(e,t){if(e>4294967295||e<1)return Ye.ONE;var a=He(),s=He(),n=t.convert(this),i=ht(e)-1;n.copyTo(a);while(--i>=0)if(t.sqrTo(a,s),(e&1<0)t.mulTo(s,n,a);else{var r=a;a=s,s=r}return t.revert(a)}function Et(e,t){var a;return a=e<256||t.isEven()?new wt(t):new Nt(t),this.exp(e,a)}function It(){var e=He();return this.copyTo(e),e}function Jt(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function Ot(){return 0==this.t?this.s:this[0]<<16>>16}function jt(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function Yt(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function Ht(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),a=Math.pow(e,t),s=it(a),n=He(),i=He(),r="";this.divRemTo(s,n,i);while(n.signum()>0)r=(a+i.intValue()).toString(e).substr(1)+r,n.divRemTo(s,n,i);return i.intValue().toString(e)+r}function Qt(e,t){this.fromInt(0),null==t&&(t=10);for(var a=this.chunkSize(t),s=Math.pow(t,a),n=!1,i=0,r=0,o=0;o=a&&(this.dMultiply(s),this.dAddOffset(r,0),i=0,r=0))}i>0&&(this.dMultiply(Math.pow(t,i)),this.dAddOffset(r,0)),n&&Ye.ZERO.subTo(this,this)}function Ut(e,t,a){if("number"==typeof t)if(e<2)this.fromInt(1);else{this.fromNumber(e,a),this.testBit(e-1)||this.bitwiseTo(Ye.ONE.shiftLeft(e-1),aa,this),this.isEven()&&this.dAddOffset(1,0);while(!this.isProbablePrime(t))this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(Ye.ONE.shiftLeft(e-1),this)}else{var s=new Array,n=7&e;s.length=1+(e>>3),t.nextBytes(s),n>0?s[0]&=(1<0){s>s)!=(this.s&this.DM)>>s&&(t[n++]=a|this.s<=0)s<8?(a=(this[e]&(1<>(s+=this.DB-8)):(a=this[e]>>(s-=8)&255,s<=0&&(s+=this.DB,--e)),0!=(128&a)&&(a|=-256),0==n&&(128&this.s)!=(128&a)&&++n,(n>0||a!=this.s)&&(t[n++]=a)}return t}function Vt(e){return 0==this.compareTo(e)}function qt(e){return this.compareTo(e)<0?this:e}function zt(e){return this.compareTo(e)>0?this:e}function Kt(e,t,a){var s,n,i=Math.min(e.t,this.t);for(s=0;s>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function ha(){for(var e=0;e=this.t?0!=this.s:0!=(this[t]&1<>=this.DB;if(e.t>=this.DB;s+=this.s}else{s+=this.s;while(a>=this.DB;s+=e.s}t.s=s<0?-1:0,s>0?t[a++]=s:s<-1&&(t[a++]=this.DV+s),t.t=a,t.clamp()}function Ca(e){var t=He();return this.addTo(e,t),t}function ya(e){var t=He();return this.subTo(e,t),t}function wa(e){var t=He();return this.multiplyTo(e,t),t}function Ta(){var e=He();return this.squareTo(e),e}function Fa(e){var t=He();return this.divRemTo(e,t,null),t}function $a(e){var t=He();return this.divRemTo(e,null,t),t}function xa(e){var t=He(),a=He();return this.divRemTo(e,t,a),new Array(t,a)}function _a(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function Aa(e,t){if(0!=e){while(this.t<=t)this[this.t++]=0;this[t]+=e;while(this[t]>=this.DV)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}function La(){}function Na(e){return e}function Pa(e,t,a){e.multiplyTo(t,a)}function ka(e,t){e.squareTo(t)}function Ba(e){return this.exp(e,new La)}function Ma(e,t,a){var s,n=Math.min(this.t+e.t,t);a.s=0,a.t=n;while(n>0)a[--n]=0;for(s=a.t-this.t;n=0)a[s]=0;for(s=Math.max(t-this.t,0);s2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t,a=He();return e.copyTo(a),he()(t=this).call(t,a),a}function Ea(e){return e}function Ia(e){e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(e.compareTo(this.r2)<0)e.dAddOffset(1,this.m.t+1);e.subTo(this.r2,e);while(e.compareTo(this.m)>=0)e.subTo(this.m,e)}function Ja(e,t){var a;e.squareTo(t),he()(a=this).call(a,t)}function Wa(e,t,a){var s;e.multiplyTo(t,a),he()(s=this).call(s,a)}function Oa(e,t){var a,s,n=e.bitLength(),i=it(1);if(n<=0)return i;a=n<18?1:n<48?3:n<144?4:n<768?5:6,s=n<8?new wt(t):t.isEven()?new Xa(t):new Nt(t);var r=new Array,o=3,l=a-1,c=(1<1){var u=He();s.sqrTo(r[1],u);while(o<=c)r[o]=He(),s.mulTo(u,r[o-2],r[o]),o+=2}var d,h,p=e.t-1,m=!0,f=He();n=ht(e[p])-1;while(p>=0){n>=l?d=e[p]>>n-l&c:(d=(e[p]&(1<0&&(d|=e[p-1]>>this.DB+n-l)),o=a;while(0==(1&d))d>>=1,--o;if((n-=o)<0&&(n+=this.DB,--p),m)r[d].copyTo(i),m=!1;else{while(o>1)s.sqrTo(i,f),s.sqrTo(f,i),o-=2;o>0?s.sqrTo(i,f):(h=i,i=f,f=h),s.mulTo(f,r[d],i)}while(p>=0&&0==(e[p]&1<0&&(t.rShiftTo(i,t),a.rShiftTo(i,a));while(t.signum()>0)(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),(n=a.getLowestSetBit())>0&&a.rShiftTo(n,a),t.compareTo(a)>=0?(t.subTo(a,t),t.rShiftTo(1,t)):(a.subTo(t,a),a.rShiftTo(1,a));return i>0&&a.lShiftTo(i,a),a}function Ya(e){if(e<=0)return 0;var t=this.DV%e,a=this.s<0?e-1:0;if(this.t>0)if(0==t)a=this[0]%e;else for(var s=this.t-1;s>=0;--s)a=(t*a+this[s])%e;return a}function Ha(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return Ye.ZERO;var a=e.clone(),s=this.clone(),n=it(1),i=it(0),r=it(0),o=it(1);while(0!=a.signum()){while(a.isEven())a.rShiftTo(1,a),t?(n.isEven()&&i.isEven()||(n.addTo(this,n),i.subTo(e,i)),n.rShiftTo(1,n)):i.isEven()||i.subTo(e,i),i.rShiftTo(1,i);while(s.isEven())s.rShiftTo(1,s),t?(r.isEven()&&o.isEven()||(r.addTo(this,r),o.subTo(e,o)),r.rShiftTo(1,r)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);a.compareTo(s)>=0?(a.subTo(s,a),t&&n.subTo(r,n),i.subTo(o,i)):(s.subTo(a,s),t&&r.subTo(n,r),o.subTo(i,o))}return 0!=s.compareTo(Ye.ONE)?Ye.ZERO:o.compareTo(e)>=0?o.subtract(e):o.signum()<0?(o.addTo(e,o),o.signum()<0?o.add(e):o):o}wt.prototype.convert=Tt,wt.prototype.revert=Ft,wt.prototype.reduce=xt,wt.prototype.mulTo=_t,wt.prototype.sqrTo=At,Nt.prototype.convert=Pt,Nt.prototype.revert=kt,Nt.prototype.reduce=Bt,Nt.prototype.mulTo=Zt,Nt.prototype.sqrTo=Mt,Ye.prototype.copyTo=st,Ye.prototype.fromInt=nt,Ye.prototype.fromString=rt,Ye.prototype.clamp=ot,Ye.prototype.dlShiftTo=mt,Ye.prototype.drShiftTo=ft,Ye.prototype.lShiftTo=bt,Ye.prototype.rShiftTo=gt,Ye.prototype.subTo=Dt,Ye.prototype.multiplyTo=St,Ye.prototype.squareTo=vt,Ye.prototype.divRemTo=Ct,Ye.prototype.invDigit=Lt,Ye.prototype.isEven=Xt,Ye.prototype.exp=Rt,Ye.prototype.toString=lt,Ye.prototype.negate=ct,Ye.prototype.abs=ut,Ye.prototype.compareTo=dt,Ye.prototype.bitLength=pt,Ye.prototype.mod=yt,Ye.prototype.modPowInt=Et,Ye.ZERO=it(0),Ye.ONE=it(1),La.prototype.convert=Na,La.prototype.revert=Na,La.prototype.mulTo=Pa,La.prototype.sqrTo=ka,Xa.prototype.convert=Ra,Xa.prototype.revert=Ea,Xa.prototype.reduce=Ia,Xa.prototype.mulTo=Wa,Xa.prototype.sqrTo=Ja;var Qa=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Ua=(1<<26)/Qa[Qa.length-1];function Ga(e){var t,a=this.abs();if(1==a.t&&a[0]<=Qa[Qa.length-1]){for(t=0;t>1,e>Qa.length&&(e=Qa.length);for(var n=He(),i=0;i127&&s<2048?(t+=String.fromCharCode(s>>6|192),t+=String.fromCharCode(63&s|128)):(t+=String.fromCharCode(s>>12|224),t+=String.fromCharCode(s>>6&63|128),t+=String.fromCharCode(63&s|128))}return t},decode:function(e){var t="",a=0,s=$c1=$c2=0;while(a191&&s<224?($c2=e.charCodeAt(a+1),t+=String.fromCharCode((31&s)<<6|63&$c2),a+=2):($c2=e.charCodeAt(a+1),$c3=e.charCodeAt(a+2),t+=String.fromCharCode((15&s)<<12|(63&$c2)<<6|63&$c3),a+=3);return t}},Ka={base64:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){if(!e)return!1;var t,a,s,n,i,r,o,l="",c=0;do{t=e.charCodeAt(c++),a=e.charCodeAt(c++),s=e.charCodeAt(c++),n=t>>2,i=(3&t)<<4|a>>4,r=(15&a)<<2|s>>6,o=63&s,isNaN(a)?r=o=64:isNaN(s)&&(o=64),l+=this.base64.charAt(n)+this.base64.charAt(i)+this.base64.charAt(r)+this.base64.charAt(o)}while(c>4),64!=s&&(i+=String.fromCharCode((15&a)<<4|s>>2)),64!=n&&(i+=String.fromCharCode((3&s)<<6|n))}while(r>4&15)+this.hex.charAt(15&t)}while(s0){var a=e.charCodeAt(0);e=e.substr(1);var s=0;if(5==(31&a))e=e.substr(1);else if(128&e.charCodeAt(0)){var n=127&e.charCodeAt(0);if(e=e.substr(1),n>0&&(s=e.charCodeAt(0)),n>1&&(s=s<<8|e.charCodeAt(1)),n>2)return this.error=!0,null;e=e.substr(n)}else s=e.charCodeAt(0),e=e.substr(1);var i="";if(s){if(s>e.length)return this.error=!0,null;i=e.substr(0,s),e=e.substr(s)}32&a?t.push(this.parse(i)):t.push(this.value(128&a?4:31&a,i))}return t},this.value=function(e,t){if(1==e)return!!t;if(2==e)return t;if(3==e)return this.parse(t.substr(1));if(5==e)return null;if(6==e){var a=[],s=t.charCodeAt(0);a.push(Math.floor(s/40)),a.push(s-40*a[0]);var n,i=[],r=0;for(n=1;n>3;if(e=this.pkcs1pad2(e,a),!e)return!1;if(e=e.modPowInt(t.encryptionExponent,t.modulus),!e)return!1;e=e.toString(16);while(e.length<2*a)e="0"+e;return Ka.encode(es.decode(e))},pkcs1pad2:function(e,t){if(t=0&&t>0)a[--t]=e.charCodeAt(s--);a[--t]=0;while(t>2)a[--t]=Math.floor(254*Math.random())+1;return a[--t]=2,a[--t]=0,new Ye(a)}},ss=(as=as,{FesLeft:!1,data:function(){var e,t,a;return{userName:"",password:"",loginRule:{userName:[{required:!0,message:this.$t("message.newAllPage.Pleaseenteryourusername")},{type:"string",pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:y()(e=y()(t=y()(a="".concat(this.$t("message.newAllPage.Musthavealetter"),",")).call(a,this.$t("message.newAllPage.Andonlysupportletter"),"、")).call(t,this.$t("message.newAllPage.digital"),"、")).call(e,this.$t("message.newAllPage.Theunderline")),trigger:"change"},{message:"".concat(this.$t("message.newAllPage.Namecannotbemorethanlength"),"200"),max:200}],password:[{required:!0,message:this.$t("message.newAllPage.Pleaseenterthepassword")},{message:"".concat(this.$t("message.newAllPage.Passwordlengthcantmorethan"),"20"),max:20}]}}},methods:{roleName:function(e){return"super"===e?this.$t("message.newAllPage.Thesuperuser"):"admin"===e?this.$t("message.newAllPage.Manageusers"):"user"===e?this.$t("message.newAllPage.Theaverageuser"):this.$t("message.newAllPage.Notloggedin")},loginAction:function(){var e=this,t=as.getPublicKey("-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCQT/eMMgLf6MvSY1JWVI5KOPeWh+Lb3v6J7nMJVaok8V0vEqRmYc3A5dh3+VXmxslrpWSBhiom/43b/y3f2/g8jEpmxU1MEyq1l8i4rnx6fJP60od5hLmGdbNexnh9MksEqSx10nAYsH0trZ71bZJnQkuK/m70oMXjr0HAwJafBwIDAQAB-----END PUBLIC KEY-----"),a=as.encrypt(this.password,t);this.$refs.loginForm.validate((function(t){t&&e.FesApi.fetch("/auth/login",{loginUser:e.userName,loginPwd:a},"post").then((function(t){e.FesApp.setRole(t.role),e.FesApp.set("FesUserName",t["X-AUTH-ID"]),e.FesApp.set("FesRoleName",e.roleName(t.role)),e.FesStorage.set("currentUser",t["X-AUTH-ID"]),e.FesStorage.set("userRole",t.role),e.FesApp.router.push("/ds/newManager")}))}))}}}),ns=ss,is=(a("1f35"),Object(_["a"])(ns,Re,Ee,!1,null,"247e3fe6",null));is.options.__file="src/pages/login/index.fes";var rs=is.exports,os=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("main",{staticClass:"main full-height"},[a("div",{staticClass:"header-bar"},[a("span",{staticClass:"header-title"},[e._v("\n "+e._s(e.$t("sys.Performusermanagement"))+"\n ")]),a("p",{staticClass:"header-des"},[e._v("\n "+e._s(e.$t("sys.Performusermanagement"))+"\n ")])]),a("div",{staticClass:"main-content"},[a("Row",{staticClass:"top-bar"},[a("div",{staticClass:"data-source"},[a("label",{staticClass:"ui-form-label"},[e._v("\n "+e._s(e.$t("sys.Theusername"))+"\n ")])]),a("Cell",{attrs:{span:"4"}},[a("Wb-input",{attrs:{placeholder:e.$t("manager.SRSZYM")},on:{"on-enter":function(t){return e.searchQuery()}},model:{value:e.searchName,callback:function(t){e.searchName=t},expression:"searchName"}})],1),a("Cell",{staticClass:"query-button",attrs:{span:"4"}},[a("Wb-button",{attrs:{type:"primary",icon:"search"},on:{click:function(t){return e.searchQuery()}}},[e._v("\n "+e._s(e.$t("manager.CX"))+"\n ")])],1)],1),a("div",{staticClass:"lists-bar"},[a("div",{staticClass:"add-button"},[a("Wb-button",{staticClass:"button",attrs:{type:"ghost",icon:"plus"},on:{click:e.showChooseWind}},[e._v("\n "+e._s(e.$t("sys.Thenewperformuser"))+"\n ")])],1),e._l(e.sourceData,(function(t){return a("div",{key:t.id,staticClass:"list-item"},[a("Icon",{staticClass:"item-icon",attrs:{type:"md-person",size:"35"}}),a("div",{staticClass:"item item-col"},[a("span",{staticClass:"title"},[e._v("\n "+e._s(e.$t("sys.Theusername"))+"\n ")]),a("span",{staticClass:"desc"},[e._v("\n "+e._s(t.execUser)+"\n ")])]),a("div",{staticClass:"item item-col"},[a("span",{staticClass:"title"},[e._v("\n ID\n ")]),a("span",{staticClass:"desc"},[e._v("\n "+e._s(t.id)+"\n ")])]),a("div",{staticClass:"time item-col"},[a("span",[e._v(e._s(e.$t("manager.CJZSJ")))]),a("span",[e._v(e._s(t.createTime))])]),a("div",{staticClass:"option"},[a("span",{staticClass:"text",on:{click:function(a){return e.sourceDelete(t)}}},[e._v("\n "+e._s(e.$t("manager.SC"))+"\n ")])])],1)}))],2),a("div",{staticClass:"page-pagination"},[a("Pagination",{attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.pageChange}})],1)],1),a("weModal",{attrs:{title:e.$t("sys.Thenewperformuser")},on:{onConfirm:e.addConfirm},model:{value:e.addExecutor,callback:function(t){e.addExecutor=t},expression:"addExecutor"}},[a("Wb-form",{ref:"source_validate",attrs:{"label-position":"left",rule:e.sourceRule}},[a("Form-item",{attrs:{label:e.$t("sys.Theusername"),prop:"executeName"}},[a("wb-input",{attrs:{placeholder:e.$t("sys.Pleasefillinusername")},model:{value:e.executeName,callback:function(t){e.executeName=t},expression:"executeName"}})],1),a("Form-item",{attrs:{label:e.$t("sys.describe"),prop:"executeDes"}},[a("wb-input",{attrs:{placeholder:e.$t("sys.Pleasefillintheusername")},model:{value:e.executeDes,callback:function(t){e.executeDes=t},expression:"executeDes"}})],1)],1)],1),a("weLoading",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}]})],1)},ls=[];os._withStripped=!0;var cs={components:{weModal:w["a"],weLoading:L},FesData:function(){var e,t,a;return{loading:!1,searchName:"",sourceData:"",pagination:{size:10,current:1,total:0},executeName:"",executeDes:"",addExecutor:!1,sourceRule:{executeName:[{required:!0,message:this.$t("sys.Pleasefillinusername")},{type:"string",pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:y()(e=y()(t=y()(a="".concat(this.$t("sys.Musthavealetter"),",")).call(a,this.$t("sys.Andonlysupportletter"),"、")).call(t,this.$t("sys.digital"),"、")).call(e,this.$t("sys.Theunderline")),trigger:"change"}]}}},FesReady:function(){this.loadOwners(),this.searchQuery()},methods:{loadOwners:function(){var e=this;this.FesApi.fetch("/admin/exec/user/list","get").then((function(t){e.dsOwners=t}))["catch"]((function(e){console.log(e)}))},searchQuery:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.loading=!0,this.FesApi.fetch("/admin/exec/user/pager?execUser=".concat(this.searchName),{page:t,pageSize:a},"get").then((function(t){e.loading=!1,e.sourceData=t.data,e.pagination.size=t.pageSize,e.pagination.current=t.page,e.pagination.total=t.totalPages}))["catch"]((function(){e.loading=!1}))},showChooseWind:function(){this.addExecutor=!0},addConfirm:function(){var e=this;this.$refs.source_validate.validate((function(t){t?e.FesApi.fetch("/admin/exec/user",{description:e.executeDes,execUser:e.executeName},"post").then((function(){e.searchQuery(e.pagination.current,e.pagination.size),e.$Toast.success(e.$t("sys.Addausersuccessfully"))})):e.addExecutor=!0}))},pageChange:function(e){var t=e.current,a=e.size;this.searchQuery(t,a)},sourceDelete:function(e){var t,a=this;this.$Message.confirm(this.$t("sys.Deleteperformuser"),y()(t="".concat(this.$t("sys.Whetheryouwanttodelete"))).call(t,e.execUser,"?")).then((function(t){0===t&&(a.loading=!0,a.FesApi.fetch("/admin/exec/user/"+e.id,{},"delete").then((function(){a.$Toast.success(a.$t("sys.Deletetheusersuccessfully")),a.searchQuery(a.pagination.current,a.pagination.size)}))["catch"]((function(){a.loading=!1})))}))}}},us=cs,ds=(a("e072"),Object(_["a"])(us,os,ls,!1,null,"1613cddb",null));ds.options.__file="src/pages/sys/executeUser/index.fes";var hs=ds.exports,ps=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"full-height"},[a("fes-search-panel",[a("Wb-form",{attrs:{type:"query","label-width":150}},[a("Form-item",{attrs:{label:e.$t("sys.executor.DZ")}},[a("wb-input",{attrs:{placeholder:e.$t("sys.executor.QSR")},on:{"on-enter":function(t){return e.search()}},model:{value:e.query.address,callback:function(t){e.$set(e.query,"address",t)},expression:"query.address"}})],1)],1),a("div",{attrs:{slot:"button"},slot:"button"},[a("Wb-button",{attrs:{type:"primary",icon:"search"},on:{click:function(t){return e.search()}}},[e._v("\n "+e._s(e.$t("sys.executor.CX"))+"\n ")])],1)],1),a("fes-list-panel",[a("Wb-table",{attrs:{data:e.data,"no-data-text":e.$t("sys.executor.ZWSJ")}},[a("Column",{attrs:{prop:"id",name:"ID"}}),a("Column",{attrs:{prop:"address",name:e.$t("sys.executor.DZ")}}),a("Column",{attrs:{prop:"defaultNode",name:e.$t("sys.Thedefaultnode"),component:e.checkboxCompenentData}}),a("Column",{attrs:{prop:"tabIds",name:e.$t("sys.Thelabel"),component:e.tabComponentData,width:"200px"}}),a("Column",{attrs:{prop:"heartbeatTime",name:e.$t("sys.executor.XTSJ")}}),a("Column",{attrs:{prop:"status",component:e.showStatus,name:e.$t("sys.executor.ZT")}}),a("Column",{attrs:{prop:"memRate",name:e.$t("sys.executor.NCSYL")}}),a("Column",{attrs:{prop:"cpuRate",name:e.$t("sys.executor.SYL")}}),a("Column",{attrs:{name:e.$t("sys.executor.CZ"),action:e.exeAction}})],1),a("Pagination",{staticClass:"page-center",attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.changePage}})],1),a("weModal",{attrs:{title:e.$t("sys.Bindingthenodelabel"),closable:!1},on:{onConfirm:e.addConfirm},model:{value:e.bindlabelShow,callback:function(t){e.bindlabelShow=t},expression:"bindlabelShow"}},[a("Wb-form",{ref:"source_validate",attrs:{"label-position":"left"}},[a("Form-item",{attrs:{label:e.$t("sys.Thelabel"),prop:"executeDes"}},[a("Wb-select",{attrs:{placeholder:e.$t("sys.Pleaseselectalabel"),multiple:""},model:{value:e.tabIds,callback:function(t){e.tabIds=t},expression:"tabIds"}},e._l(e.tabList,(function(e){return a("wb-option",{key:e.id,attrs:{value:e.id,label:e.name}})})),1)],1)],1)],1)],1)},ms=[];ps._withStripped=!0;var fs={FesDataCache:"executor",FesHeader:!1,components:{weModal:w["a"]},data:function(){return{query:{address:""},data:[],pagination:{size:10,current:1,total:0},bindlabelShow:!1,tabIds:[],tabList:[],currentNode:{},exeAction:[{text:this.$t("sys.executor.WH"),func:function(e){var t=this,a="";a=0==e.status?this.$t("sys.executor.XX"):this.$t("sys.executor.SX"),this.$Message.confirm(a+this.$t("sys.executor.JD"),this.$t("sys.executor.SFCG",{action:a})).then((function(s){0===s&&(0==e.status?e.status=1:e.status=0,t.FesApi.fetch("/admin/exec/node/update/"+e.id,e).then((function(){t.$Toast.success(a+" "+t.$t("sys.executor.JDCG")),t.search()})))}))}},{text:this.$t("sys.Themanagementnode"),func:function(e){var t=encodeURIComponent(m()(e));this.$router.push({path:"/sys/executor/bind",query:{value:t}})}},{text:this.$t("sys.Thelabel"),func:function(e){this.currentNode=e,this.tabIds=e.tabIds?JSON.parse(m()(e.tabIds)):[],this.bindlabelShow=!0}},{text:this.$t("sys.delete"),func:function(e){var t,a=this;this.$Message.confirm(this.$t("sys.Removenodes"),y()(t="".concat(this.$t("sys.Whetherornottodelete"))).call(t,e.address)).then((function(t){0===t&&a.FesApi.fetch("/admin/exec/node/delete/"+e.id,{},"delete").then((function(){a.$Toast.success(a.$t("sys.Deletethesuccess")),a.search()}))}))}}],showStatus:this.showStatusFunction,tabComponentData:this.tabComponent,checkboxCompenentData:this.checkboxCompenent}},FesReady:function(){var e=this;this.search(),this.FesApi.fetch("/tab/list",{},"get").then((function(t){e.tabList=t}))},methods:{addConfirm:function(){var e=this;this.FesApi.fetch("/admin/exec/node/".concat(this.currentNode.id,"/tab"),{tabIds:this.tabIds}).then((function(t){e.search()}))},checkboxCompenent:function(e){var t=this;return new Vue({data:function(){return{trData:e}},methods:{checkDefault:function(e){e?t.FesApi.fetch("/admin/exec/node/".concat(this.trData.id,"/default"),{},"post").then((function(){t.search()})):t.FesApi.fetch("/admin/exec/node/".concat(this.trData.id,"/default"),{},"delete").then((function(){t.search()}))}},template:''})},tabComponent:function(e){return new Vue({data:function(){return{tabIds:e.tabIds||[]}},template:'
{{tab === 1 ? \'DATAX\' : \'SQOOP\' }}
'})},showStatusFunction:function(e){var t="",a="";return 0==e.status?(t=this.$t("sys.executor.ZC"),a="blue"):(t=this.$t("sys.executor.YXX"),a="red"),new Vue({template:"

"+t+"

"})},search:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.loading=!0,this.data=[],this.pagination.total=0,this.FesApi.fetch("/admin/exec/node/pageList",{address:this.query.address,page:t,pageSize:a},"get").then((function(s){e.data=s.data,e.pagination.total=s.totalPages,e.pagination.current=t,e.pagination.size=a,e.loading=!1}))},changePage:function(e){var t=e.current,a=e.size;this.search(t,a)}}},bs=fs,gs=Object(_["a"])(bs,ps,ms,!1,null,null,null);gs.options.__file="src/pages/sys/executor/index.fes";var Ds=gs.exports,Ss=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("main",{staticClass:"bind-main full-height"},[a("div",{staticClass:"header-bar"},[a("span",{staticClass:"header-title"},[e._v("\n "+e._s(e.$t("sys.Nodemanagement"))+"\n ")]),a("div",{staticClass:"header-content"},[a("div",{staticClass:"content-item"},[a("span",[e._v(e._s(e.$t("sys.state")))]),a("span",{staticClass:"button"},[a("i",{staticClass:"status-bar",class:{green:0===e.executorNodeData.status,orange:1===e.executorNodeData.status}}),e._v("\n "+e._s(0===e.executorNodeData.status?e.$t("sys.normal"):e.$t("sys.Hasbeenrolledofftheproductionline"))+"\n ")])]),a("div",{staticClass:"content-item"},[a("span",[e._v(e._s(e.$t("sys.Thenodeaddress")))]),a("span",{staticClass:"button"},[e._v("\n "+e._s(e.executorNodeData.address)+"\n ")])]),a("div",{staticClass:"content-item"},[a("span",[e._v(e._s(e.$t("sys.Theheartbeatoftime")))]),a("span",{staticClass:"button"},[e._v("\n "+e._s(e.executorNodeData.heartbeatTime)+"\n ")])]),a("div",{staticClass:"content-item"},[a("span",[e._v(e._s(e.$t("sys.Memoryusage")))]),a("span",{staticClass:"button"},[e._v("\n "+e._s(e.executorNodeData.memRate)+"\n ")])]),a("div",{staticClass:"content-item"},[a("span",[e._v("cpu "+e._s(e.$t("sys.usage")))]),a("span",{staticClass:"button"},[e._v("\n "+e._s(e.executorNodeData.cpuRate)+"\n ")])])])]),a("div",{staticClass:"main-content"},[a("Row",{staticClass:"top-bar"},[a("Cell",{attrs:{span:"2"}},[a("label",{staticClass:"ui-form-label float-right"},[e._v("\n "+e._s(e.$t("sys.Performausername"))+"\n ")])]),a("Cell",{attrs:{span:"3"}},[a("Wb-input",{attrs:{placeholder:e.$t("sys.Pleaseenteryourusername")},model:{value:e.searchUserName,callback:function(t){e.searchUserName=t},expression:"searchUserName"}})],1),a("div",{staticClass:"margin-left"},[a("label",{staticClass:"ui-form-label"},[e._v("\n UID\n ")])]),a("Cell",{attrs:{span:"3"}},[a("Wb-input",{attrs:{placeholder:e.$t("sys.Pleaseenterthe")+" UID"},model:{value:e.searchUID,callback:function(t){e.searchUID=t},expression:"searchUID"}})],1),a("div",{staticClass:"margin-left"},[a("label",{staticClass:"ui-form-label"},[e._v("\n GID\n ")])]),a("Cell",{attrs:{span:"3"}},[a("Wb-input",{attrs:{placeholder:e.$t("sys.Pleaseenterthe")+" GID"},model:{value:e.searchGID,callback:function(t){e.searchGID=t},expression:"searchGID"}})],1),a("Cell",{staticClass:"margin-left",attrs:{span:"5"}},[a("Wb-button",{attrs:{type:"primary",icon:"search"},on:{click:function(t){return e.searchQuery()}}},[e._v("\n "+e._s(e.$t("manager.CX"))+"\n ")]),a("Wb-button",{staticClass:"margin-left",attrs:{type:"primary",icon:"plus"},on:{click:e.addExecuteUser}},[e._v("\n "+e._s(e.$t("sys.add"))+"\n ")])],1),a("Cell",{staticClass:"margin-left",attrs:{span:"4"}},[a("Wb-button",{on:{click:e.goback}},[e._v("\n "+e._s(e.$t("sys.return"))+"\n ")])],1)],1),a("Wb-table",{attrs:{data:e.execoteUserList,"no-data-text":e.$t("sys.Temporarilynodata")}},[a("Column",{attrs:{prop:"execUser",name:e.$t("sys.Performausername")}}),a("Column",{attrs:{prop:"userType",name:e.$t("sys.Associatedwiththeusertypes")}}),a("Column",{attrs:{component:e.statusComponent,name:e.$t("sys.Associatedstates")}}),a("Column",{attrs:{prop:"uid",name:"UID"}}),a("Column",{attrs:{prop:"gid",name:"GID"}}),a("Column",{attrs:{prop:"updateTime",name:e.$t("sys.Therecentmodificationtime")}}),a("Column",{attrs:{component:e.optionComponent,name:e.$t("sys.operation"),width:"300px"}})],1),a("div",{staticClass:"page-pagination"},[a("Pagination",{staticClass:"pagination",attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.changePage}})],1)],1),a("weModal",{attrs:{title:e.$t("sys.Bindtheuser"),width:"500",closable:!1},on:{onConfirm:e.addUserConfirm},model:{value:e.addUserShow,callback:function(t){e.addUserShow=t},expression:"addUserShow"}},[a("Wb-form",{ref:"bindFrom",attrs:{rule:e.addBindRule}},[a("Form-item",{attrs:{label:e.$t("sys.Selecttheuser"),prop:"selectBindUser"}},[a("Wb-select",{attrs:{multiple:"",filterable:""},model:{value:e.selectBindUser,callback:function(t){e.selectBindUser=t},expression:"selectBindUser"}},e._l(e.selectUserList,(function(e){return a("wb-option",{key:e.id,attrs:{value:e.id,label:e.execUser}})})),1)],1),a("Form-item",{attrs:{label:e.$t("sys.Bindingtype"),prop:"selectBindType"}},[a("Wb-select",{model:{value:e.selectBindType,callback:function(t){e.selectBindType=t},expression:"selectBindType"}},e._l(e.selectBindTypeList,(function(e){return a("wb-option",{key:e.value,attrs:{value:e.value,label:e.label}})})),1)],1)],1)],1),a("weLoading",{directives:[{name:"show",rawName:"v-show",value:e.FesFesx.isLoading,expression:"FesFesx.isLoading"}]})],1)},vs=[];Ss._withStripped=!0;var Cs={components:{weModal:w["a"],weLoading:L},data:function(){var e=this;return{executorNodeData:JSON.parse(decodeURIComponent(this.$route.query.value)),tabValue:"node",selectBindNode:[],selectBindUser:[],selectUserList:[],addExecuteUserShow:!1,addUserShow:!1,pagination:{size:10,current:1,total:10},addBindRule:{selectBindUser:[{required:!0,message:this.$t("sys.Pleasefillinusername")}],selectBindType:[{required:!0,message:this.$t("sys.Pleaseselectabindingtype")}]},optionComponent:function(t){var a,s;return new Vue({data:function(){return{trData:t}},methods:{deleteAction:function(t){var a,s,n=this;if(1===t.relationState)return e.$Toast.warn(y()(a="".concat(e.$t("sys.Hasbeenassociateduser"),",")).call(a,e.$t("sys.Donotdelete"),"!"));this.$Message.confirm(e.$t("sys.delete"),y()(s="".concat(e.$t("sys.Confirmtodeletetheuserexecution"))).call(s,t.execUser,"?")).then((function(a){var s;0===a&&e.FesApi.fetch(y()(s="/admin/exec/node/".concat(e.executorNodeData.id,"/user/")).call(s,t.execUser,"/bind"),{},"DELETE").then((function(){e.searchQuery(e.pagination.current,e.pagination.size),n.$Toast.success(e.$t("sys.Deletetheusersuccessfully"))}))}))},associated:function(t){var a,s,n;this.$Message.confirm(e.$t("sys.associated"),y()(a=y()(s=y()(n="".concat(e.$t("sys.confirm"))).call(n,e.executorNodeData.address)).call(s,e.$t("sys.Executionofuser"))).call(a,t.execUser,"?")).then((function(a){var s;0===a&&e.FesApi.fetch(y()(s="/admin/exec/node/".concat(e.executorNodeData.id,"/user/")).call(s,t.execUser,"/relate"),{},"PUT").then((function(){e.searchQuery(e.pagination.current,e.pagination.size)}))}))},cancelAssociated:function(t){var a,s,n;this.$Message.confirm(e.$t("sys.Canceltheassociated"),y()(a=y()(s=y()(n="".concat(e.$t("sys.confirm"))).call(n,e.executorNodeData.address)).call(s,e.$t("sys.Canceltheexecutionoftheuser"))).call(a,t.execUser,"?")).then((function(a){var s;0===a&&e.FesApi.fetch(y()(s="/admin/exec/node/".concat(e.executorNodeData.id,"/user/")).call(s,t.execUser,"/relate"),{},"DELETE").then((function(){e.searchQuery(e.pagination.current,e.pagination.size)}))}))}},template:y()(a=y()(s='
\n '.concat(e.$t("sys.associated"),'\n \n ')).call(s,e.$t("sys.Canceltheassociated"),'\n \n \n ')).call(a,e.$t("sys.delete"),"\n \n
")})},statusComponent:function(t){var a,s;return new Vue({data:function(){return{trData:t}},methods:{},template:y()(a=y()(s='
\n \n '.concat(e.$t("sys.Notassociated"),'\n \n \n ')).call(s,e.$t("sys.Hasbeenassociated"),'\n \n \n ')).call(a,e.$t("sys.Connectionfailure"),"\n \n
")})},searchUserName:"",searchUID:"",searchGID:"",execoteUserList:[],selectBindType:"",selectBindTypeList:[{label:this.$t("sys.Thebinding"),value:"BIND"},{label:this.$t("sys.bindings"),value:"BIND_RELATE"}]}},FesReady:function(){this.searchQuery(),this.getSelectUserList()},methods:{getSelectUserList:function(){var e=this;this.FesApi.fetch("/admin/exec/user/list ",{},"get").then((function(t){e.FesFesx.set("isLoading",!1),e.selectUserList=t}))["catch"]((function(){e.FesFesx.set("isLoading",!1)}))},addExecuteUser:function(){this.addUserShow=!0,this.selectBindUser=[],this.selectBindType=""},searchQuery:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.FesFesx.set("isLoading",!0),this.FesApi.fetch("/admin/exec/node/".concat(this.executorNodeData.id,"/user/bind/pager"),{uid:this.searchUID,gid:this.searchGID,execUser:this.searchUserName,page:t,pageSize:a},"get").then((function(t){e.FesFesx.set("isLoading",!1),e.execoteUserList=t.data,e.pagination.size=t.pageSize,e.pagination.current=t.page,e.pagination.total=t.totalPages}))["catch"]((function(){e.FesFesx.set("isLoading",!1)}))},changePage:function(e){var t=e.current,a=e.size;this.searchQuery(t,a)},addUserConfirm:function(){var e=this;this.$refs.bindFrom.validate((function(t){if(t){var a,s={opType:e.selectBindType,execUserList:me()(a=e.selectUserList).call(a,(function(t){var a;return r()(a=e.selectBindUser).call(a,t.id)}))};e.FesApi.fetch("/admin/exec/node/".concat(e.executorNodeData.id,"/user/bind"),s,{method:"post",timeout:"60000"}).then((function(){e.searchQuery(e.pagination.current,e.pagination.size),e.$Toast.success(e.$t("sys.Addausersuccessfully"))}))["catch"]((function(){e.searchQuery(e.pagination.current,e.pagination.size)}))}else e.addUserShow=!0}))},goback:function(){this.$router.go(-1)}}},ys=Cs,ws=(a("c95e"),Object(_["a"])(ys,Ss,vs,!1,null,"55344934",null));ws.options.__file="src/pages/sys/executor/bind/index.fes";var Ts=ws.exports,Fs=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"owner-box"},[a("fes-search-panel",[a("Wb-form",{staticClass:"search-form",attrs:{type:"query","label-width":170}},[a("Form-item",{attrs:{label:e.$t("sys.owner.SZYSZ")}},[a("wb-input",{attrs:{placeholder:e.$t("sys.owner.QSR")},on:{"on-enter":function(t){return e.search()}},model:{value:e.query.ownerName,callback:function(t){e.$set(e.query,"ownerName",t)},expression:"query.ownerName"}})],1)],1),a("div",{attrs:{slot:"button"},slot:"button"},[a("Wb-button",{attrs:{type:"primary",icon:"search"},on:{click:function(t){return e.search()}}},[e._v("\n "+e._s(e.$t("sys.owner.CX"))+"\n ")])],1)],1),a("div",{staticClass:"button-row"},[a("Wb-button",{attrs:{type:"primary",icon:"plus"},on:{click:e.showAdd}},[e._v("\n "+e._s(e.$t("sys.owner.XZSJYSZ"))+"\n ")])],1),a("fes-list-panel",[a("Wb-table",{attrs:{data:e.data,"no-data-text":e.$t("sys.owner.MYSZSJ")}},[a("Column",{attrs:{prop:"ownerName",name:e.$t("sys.owner.MC")}}),a("Column",{attrs:{prop:"ownerDesc",name:e.$t("sys.owner.MS")}}),a("Column",{attrs:{prop:"createUser",name:e.$t("sys.owner.CJYH")}}),a("Column",{attrs:{prop:"createTime",name:e.$t("sys.owner.CJSJ")}}),a("Column",{attrs:{prop:"modifyUser",name:e.$t("sys.owner.XGYH")}}),a("Column",{attrs:{prop:"modifyTime",name:e.$t("sys.owner.XGSJ")}}),a("Column",{attrs:{name:e.$t("sys.owner.CZ"),action:e.ownerAction}})],1),a("div",{staticClass:"page-pagination"},[a("Pagination",{attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.changePage}})],1)],1),a("modal",{ref:"addModal",attrs:{title:e.$t("sys.owner.XZSJYSZ")},on:{"on-close":e.closeAdd}},[a("Wb-form",{ref:"addForm",attrs:{rule:e.ruleAdd,"label-width":100}},[a("Form-item",{attrs:{label:e.$t("sys.owner.XZMC"),prop:"ownerName"}},[a("wb-input",{attrs:{placeholder:e.$t("sys.owner.SRSJSZ")},model:{value:e.newOwnerData.ownerName,callback:function(t){e.$set(e.newOwnerData,"ownerName",t)},expression:"newOwnerData.ownerName"}})],1),a("Form-item",{attrs:{label:e.$t("sys.owner.MS")}},[a("wb-input",{attrs:{placeholder:e.$t("sys.owner.MS")},model:{value:e.newOwnerData.ownerDesc,callback:function(t){e.$set(e.newOwnerData,"ownerDesc",t)},expression:"newOwnerData.ownerDesc"}})],1),a("div",{staticClass:"submit-button-container"},[a("Wb-button",{ref:"submitButton",staticClass:"submit-button",attrs:{type:"primary"},on:{click:e.submit}},[e._v("\n "+e._s(e.$t("sys.owner.TJ"))+"\n ")])],1)],1)],1),a("modal",{ref:"modifyModal",attrs:{title:e.$t("sys.owner.XGSJSZ")}},[a("Wb-form",{ref:"modifyForm",attrs:{rule:e.ruleModify,"label-width":100}},[a("Form-item",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],attrs:{label:"ID",prop:"id"}},[a("wb-input",{model:{value:e.newOwnerData.id,callback:function(t){e.$set(e.newOwnerData,"id",t)},expression:"newOwnerData.id"}})],1),a("Form-item",{attrs:{label:e.$t("sys.owner.XZMC"),prop:"ownerName"}},[a("wb-input",{attrs:{placeholder:e.$t("sys.owner.SRSJSZ")},model:{value:e.newOwnerData.ownerName,callback:function(t){e.$set(e.newOwnerData,"ownerName",t)},expression:"newOwnerData.ownerName"}})],1),a("Form-item",{attrs:{label:e.$t("sys.owner.MS")}},[a("wb-input",{attrs:{placeholder:e.$t("sys.owner.MS")},model:{value:e.newOwnerData.ownerDesc,callback:function(t){e.$set(e.newOwnerData,"ownerDesc",t)},expression:"newOwnerData.ownerDesc"}})],1),a("div",{staticClass:"submit-button-container"},[a("Wb-button",{ref:"modifyButton",staticClass:"submit-button",attrs:{type:"primary"},on:{click:e.modify}},[e._v("\n "+e._s(e.$t("sys.owner.TJ"))+"\n ")])],1)],1)],1)],1)},$s=[];Fs._withStripped=!0;var xs={FesDataCache:"owner",FesHeader:!1,FesData:function(){return{query:{ownerName:""},newOwnerData:{id:null,ownerName:"",ownerDesc:""},ruleAdd:{ownerName:[{required:!0,message:this.$t("sys.owner.SZMCBNK")}]},ruleModify:{ownerName:[{required:!0,message:this.$t("sys.owner.SZMCBNK")}]},data:[],pagination:{size:10,current:1,total:0},ownerAction:[{text:this.$t("sys.owner.BJ"),func:function(e){var t=this;this.FesApi.fetch("/admin/dsOwner/view/"+e.id,"get").then((function(e){t.newOwnerData=e,t.$refs.modifyModal.show()}))}},{text:this.$t("sys.owner.SC"),func:this["delete"]}],test:!1}},FesReady:function(){this.search()},methods:{delete:function(e){var t=this;this.$Message.confirm(this.$t("sys.owner.SCSJYSZ"),this.$t("sys.owner.SFSCSJYSZ")).then((function(a){0===a&&t.FesApi.fetch("/admin/dsOwner/delete/"+e.id,"delete").then((function(){t.$Toast.success(t.$t("sys.owner.SCCG")),t.search()}))}))},showAdd:function(){this.newOwnerData={},this.$refs.addModal.show(),this.test=!0},modify:function(){var e=this,t=this.newOwnerData;this.$refs.modifyForm.validate((function(a){a&&e.FesApi.fetch("/admin/dsOwner/update/"+t.id,t,{methods:"post",button:e.$refs.modifyButton,headers:{"Content-Type":"application/json"}}).then((function(){e.$Toast.success(e.$t("sys.owner.XGCG")),e.$refs.modifyModal.close(),e.newOwnerData={},e.search()}))}))},submit:function(){var e=this,t=this.newOwnerData;this.$refs.addForm.validate((function(a){a&&e.FesApi.fetch("/admin/dsOwner/add",t,{methods:"post",button:e.$refs.submitButton,headers:{"Content-Type":"application/json"}}).then((function(){e.$Toast.success(e.$t("sys.owner.TJSJYCG")),e.$refs.addModal.close(),e.newOwnerData={},e.search()}))}))},search:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.loading=!0,this.data=[],this.pagination.total=0,this.FesApi.fetch("/admin/dsOwner/pageList",{ownerName:this.query.ownerName,page:t,pageSize:a},"get").then((function(s){e.data=s.data,e.pagination.total=s.totalPages,e.pagination.current=t,e.pagination.size=a,e.loading=!1}))},changePage:function(e){var t=e.current,a=e.size;this.search(t,a)},closeAdd:function(){this.$refs.addForm.resetFields()}}},_s=xs,As=(a("86bb"),Object(_["a"])(_s,Fs,$s,!1,null,"18c1f524",null));As.options.__file="src/pages/sys/owner/index.fes";var Ls=As.exports,Ns=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"full-height"},[a("fes-search-panel",[a("Wb-form",{attrs:{type:"query","label-width":150}},[a("Form-item",{attrs:{label:e.$t("sys.user.YHM")}},[a("wb-input",{attrs:{placeholder:e.$t("sys.user.QSR")},on:{"on-change":e.changeSearch},model:{value:e.query.userName,callback:function(t){e.$set(e.query,"userName",t)},expression:"query.userName"}})],1)],1),a("div",{attrs:{slot:"button"},slot:"button"},[a("Wb-button",{attrs:{type:"primary",icon:"search"},on:{click:function(t){return e.search()}}},[e._v("\n "+e._s(e.$t("sys.user.CX"))+"\n ")])],1)],1),a("div",{staticClass:"button-row"},[a("Wb-button",{attrs:{type:"primary",icon:"plus"},on:{click:e.showAdd}},[e._v("\n "+e._s(e.$t("sys.user.XZYH"))+"\n ")])],1),a("fes-list-panel",[a("Wb-table",{attrs:{data:e.data,"no-data-text":e.$t("sys.user.ZSWSJ")}},[a("Column",{attrs:{prop:"userName",name:e.$t("sys.user.YHM")}}),a("Column",{attrs:{name:e.$t("sys.user.YHLX"),component:e.userTypeComponent}}),a("Column",{attrs:{prop:"createTime",name:e.$t("sys.user.CJSJ")}}),a("Column",{attrs:{prop:"updateTime",name:e.$t("sys.user.XGSJ")}}),a("Column",{attrs:{name:e.$t("sys.user.CZ"),action:e.userAction}})],1),a("div",{staticClass:"page-pagination"},[a("Pagination",{attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.changePage}})],1)],1),a("weModal",{attrs:{title:e.modalTitle,width:"500",closable:!1},on:{onConfirm:e.addNodeConfirm},model:{value:e.modalShow,callback:function(t){e.modalShow=t},expression:"modalShow"}},[a("Wb-form",{ref:"addForm",attrs:{rule:e.ruleAdd,"label-width":100}},[a("Form-item",{attrs:{label:e.$t("sys.user.SZMC"),prop:"userName"}},[a("wb-input",{attrs:{placeholder:e.$t("sys.user.SRYHM"),disabled:"resetPassword"===e.actionType},model:{value:e.newUserData.userName,callback:function(t){e.$set(e.newUserData,"userName",t)},expression:"newUserData.userName"}})],1),a("Form-item",{attrs:{label:e.$t("sys.user.YHLX")}},[a("wb-select",{attrs:{placeholder:e.$t("sys.user.YHLX"),disabled:"resetPassword"===e.actionType},model:{value:e.newUserData.userType,callback:function(t){e.$set(e.newUserData,"userType",t)},expression:"newUserData.userType"}},[a("wb-option",{attrs:{value:0}},[e._v("\n "+e._s(e.$t("sys.user.PTYH"))+"\n ")]),a("wb-option",{attrs:{value:1}},[e._v("\n "+e._s(e.$t("sys.user.GLYH"))+"\n ")]),a("wb-option",{attrs:{value:2}},[e._v("\n "+e._s(e.$t("sys.user.CJYH"))+"\n ")])],1)],1),"add"===e.actionType||"resetPassword"===e.actionType?a("Form-item",{attrs:{label:e.$t("sys.Initialpassword"),prop:"firstPassword"}},[a("wb-input",{attrs:{type:"password",placeholder:e.$t("sys.Pleaseenterthepassword"),maxlength:150},model:{value:e.firstPassword,callback:function(t){e.firstPassword=t},expression:"firstPassword"}})],1):e._e(),"add"===e.actionType||"resetPassword"===e.actionType?a("Form-item",{attrs:{label:e.$t("sys.Confirmpasswordagain"),prop:"secondPassword"}},[a("wb-input",{attrs:{type:"password",placeholder:e.$t("sys.Pleaseenterthepasswordagain"),maxlength:150},model:{value:e.secondPassword,callback:function(t){e.secondPassword=t},expression:"secondPassword"}})],1):e._e()],1)],1)],1)},Ps=[];Ns._withStripped=!0;var ks=a("2ef0"),Bs={FesDataCache:"user",FesHeader:!1,components:{weModal:w["a"]},FesData:function(){var e,t,a,s=this,n=function(e,t,a){var n;s.firstPassword&&t&&s.firstPassword!==t&&a(new Error(y()(n="".concat(s.$t("sys.Passwordisnotcorrect"),",")).call(n,s.$t("sys.Pleaseinputvalidationagain"))));a()};return{query:{userName:""},newUserData:{id:null,userName:"",userType:null},firstPassword:"",secondPassword:"",ruleAdd:{userName:[{required:!0,message:this.$t("sys.user.YHXXBNWK")},{type:"string",pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:y()(e=y()(t=y()(a="".concat(this.$t("sys.Musthavealetter"),",")).call(a,this.$t("sys.Andonlysupportletter"),"、")).call(t,this.$t("sys.digital"),"、")).call(e,this.$t("sys.Theunderline")),trigger:"change"},{message:"".concat(this.$t("sys.Namecannotbemorethanlength"),"200"),max:200}],firstPassword:[{message:"".concat(this.$t("sys.Passwordlengthcantmorethan"),"20"),max:20}],secondPassword:[{validator:n,trigger:"blur"},{message:"".concat(this.$t("sys.Passwordlengthcantmorethan"),"20"),max:20}]},data:[],pagination:{size:10,current:1,total:0},modalShow:!1,modalTitle:this.$t("sys.user.XZYH"),actionType:"add",userTypeComponent:function(e,t){var a=s;return new Vue({data:function(){return{trData:e}},methods:{typeName:function(e){return 0===e?a.$root.$t("sys.user.PTYH"):1===e?a.$root.$t("sys.user.GLYH"):a.$root.$t("sys.user.CJYH")},typeAction:function(e){return 0===e?"info":1===e?"primary":"warn"}},template:'{{typeName(trData.userType)}}'})},userAction:[{text:this.$t("sys.user.BJ"),func:function(e){var t=this;this.FesApi.fetch("/admin/user/view/"+e.id,"get").then((function(e){t.newUserData=e,t.modalShow=!0,t.actionType="modify",t.modalTitle=t.$t("sys.user.XGYHXX")}))}},{text:this.$t("sys.Bindingauthorization"),func:function(e){var t=encodeURIComponent(m()(e));this.$router.push({path:"/sys/user/bind",query:{user:t}})}},{text:this.$t("sys.Toresetyourpassword"),func:function(e){this.modalShow=!0,this.newUserData=e,this.firstPassword="",this.secondPassword="",this.actionType="resetPassword",this.modalTitle=this.$t("sys.Toresetyourpassword")}},{text:this.$t("sys.user.SC"),func:function(e){var t,a=this;this.$Message.confirm(this.$t("sys.user.SCYH"),y()(t="".concat(this.$t("sys.user.SFSCYH"))).call(t,e.userName," ?")).then((function(t){0===t&&a.FesApi.fetch("/admin/user/delete/"+e.id,"delete").then((function(){a.$Toast.success(a.$t("sys.user.SCCG")),a.search()}))}))}}]}},FesReady:function(){this.search()},methods:{changeSearch:Object(ks["debounce"])((function(){this.search()}),800),showAdd:function(){this.newUserData={userName:"",userType:0},this.modalShow=!0,this.actionType="add",this.firstPassword="",this.secondPassword="",this.modalTitle=this.$t("sys.user.XZYH")},addNodeConfirm:function(){var e=this,t=this.newUserData,a="",s="",n={method:"post",headers:{"Content-Type":"application/json"}};"add"===this.actionType?(t.password=this.secondPassword,a="/admin/user/add",s=this.$t("sys.user.TJYHCG")):"modify"===this.actionType?(a="/admin/user/update/"+t.id,s=this.$t("sys.user.XGCG")):(a="/admin/user/".concat(this.newUserData.id,"/password/reset"),s=this.$t("sys.Passwordresetsuccessfully"),n.method="put",t={password:this.secondPassword}),this.$refs.addForm.validate((function(i){i?e.FesApi.fetch(a,t,n).then((function(){e.$Toast.success(s),e.newUserData={},e.search()})):e.modalShow=!0}))},search:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.loading=!0,this.data=[],this.FesApi.fetch("/admin/user/selectAll",{userName:this.query.userName,page:t,pageSize:a},"get").then((function(s){e.data=s,e.pagination.current=t,e.pagination.size=a,e.loading=!1}))},changePage:function(e){var t=e.current,a=e.size;this.search(t,a)}}},Ms=Bs,Zs=(a("c86c"),Object(_["a"])(Ms,Ns,Ps,!1,null,null,null));Zs.options.__file="src/pages/sys/user/index.fes";var Xs=Zs.exports,Rs=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("main",{staticClass:"main full-height"},[a("div",{staticClass:"header-bar"},[a("span",{staticClass:"header-title"},[e._v("\n "+e._s(e.$t("sys.Usermanagement"))+"\n ")]),a("p",{staticClass:"header-des"},[e._v("\n "+e._s(e.$t("sys.Performuserandexecutionnodebindingauthority"))+"\n ")])]),a("div",{staticClass:"main-content"},[a("Tabs",{model:{value:e.tabValue,callback:function(t){e.tabValue=t},expression:"tabValue"}},[a("Tab",{attrs:{label:e.$t("sys.Theexecutionnode"),name:"node",icon:"iconfont icon-jiedian"}},[a("div",{staticClass:"template-lsit"},[a("div",{staticClass:"add-item template-item",on:{click:e.addNode}},[a("Icon",{attrs:{type:"md-add",size:"16"}}),e._v("\n "+e._s(e.$t("sys.Addanode"))+"\n ")],1),e._l(e.execoteNodeList,(function(t,s){return a("div",{key:s,staticClass:"current-item template-item"},[a("div",{staticClass:"item-content"},[a("div",{staticClass:"icon-box"},[a("Icon",{staticClass:"icon-bar",attrs:{type:"iconfont icon-jiedian",size:"35"}}),a("span",{staticClass:"template-type",attrs:{title:t.sourceType}},[e._v("\n Node\n ")])],1),a("div",{staticClass:"content"},[a("div",{staticClass:"params",attrs:{title:t.address}},[a("span",{staticClass:"label"},[e._v("\n "+e._s(e.$t("sys.Address:"))+"\n ")]),e._v("\n "+e._s(t.address)+"\n ")]),a("div",{staticClass:"params",attrs:{title:t.id}},[a("span",{staticClass:"label"},[e._v("\n ID:\n ")]),e._v("\n "+e._s(t.id)+"\n ")]),a("div",{staticClass:"params"},[a("span",{staticClass:"label"},[e._v("\n "+e._s(e.$t("sys.Status:"))+"\n ")]),e._v("\n "+e._s(0==t.status?e.$t("sys.normal"):e.$t("sys.offline"))+"\n ")]),a("div",{staticClass:"params"},[a("span",{staticClass:"label"},[e._v("\n cup:\n ")]),e._v("\n "+e._s(t.cpuRate)+"\n ")]),a("div",{staticClass:"params"},[a("span",{staticClass:"label"},[e._v("\n "+e._s(e.$t("sys.Memory:"))+"\n ")]),e._v("\n "+e._s(t.memRate)+"\n ")])])]),a("div",{staticClass:"item-option"},[a("span",{staticClass:"modify",on:{click:function(a){return e.deleteNodeAction(t)}}},[e._v("\n "+e._s(e.$t("dataTemplate.SC"))+"\n ")])])])}))],2),a("div",{staticClass:"page-pagination"},[a("Pagination",{attrs:{loking:e.nodePagination.locking,current:e.nodePagination.current,size:e.nodePagination.size,total:e.nodePagination.total},on:{"on-change":e.nodePageChange}})],1)]),a("Tab",{attrs:{label:e.$t("sys.Performuser"),name:"user",icon:"iconfont icon-yonghu"}},[a("div",{staticClass:"template-lsit"},[a("div",{staticClass:"add-item template-item",on:{click:e.addUser}},[a("Icon",{attrs:{type:"md-add",size:"16"}}),e._v("\n "+e._s(e.$t("sys.Adduser"))+"\n ")],1),e._l(e.execoteUserList,(function(t,s){return a("div",{key:s,staticClass:"current-item template-item"},[a("div",{staticClass:"item-content"},[a("div",{staticClass:"icon-box"},[a("Icon",{staticClass:"icon-bar",attrs:{type:"iconfont icon-yonghu",size:"35"}}),a("span",{staticClass:"template-type",attrs:{title:t.sourceType}},[e._v("\n E-User\n ")])],1),a("div",{staticClass:"content"},[a("div",{staticClass:"params",attrs:{title:t.name}},[a("span",{staticClass:"label"},[e._v("\n "+e._s(e.$t("sys.Name:"))+"\n ")]),e._v("\n "+e._s(t.execUser)+"\n ")]),a("div",{staticClass:"params",attrs:{title:t.dec}},[a("span",{staticClass:"label"},[e._v("\n ID:\n ")]),e._v("\n "+e._s(t.id)+"\n ")])])]),a("div",{staticClass:"item-option"},[a("span",{staticClass:"modify",on:{click:function(a){return e.deleteUserAction(t)}}},[e._v("\n "+e._s(e.$t("dataTemplate.SC"))+"\n ")])])])}))],2),a("div",{staticClass:"page-pagination"},[a("Pagination",{attrs:{loking:e.userPagination.locking,current:e.userPagination.current,size:e.userPagination.size,total:e.userPagination.total},on:{"on-change":e.userPageChange}})],1)]),a("Wb-button",{attrs:{slot:"action",type:"ghost"},on:{click:e.goback},slot:"action"},[e._v("\n "+e._s(e.$t("sys.return"))+"\n ")])],1)],1),a("weModal",{attrs:{title:e.$t("sys.Bindingnodes"),width:"500",closable:!1},on:{onConfirm:e.addNodeConfirm},model:{value:e.addNodeShow,callback:function(t){e.addNodeShow=t},expression:"addNodeShow"}},[a("Wb-form",[a("Form-item",{attrs:{label:e.$t("sys.Selectthenode")}},[a("Wb-select",{attrs:{filterable:""},model:{value:e.selectBindNode,callback:function(t){e.selectBindNode=t},expression:"selectBindNode"}},e._l(e.selectNodeList,(function(e){return a("wb-option",{key:e.id,attrs:{value:e.id,label:e.address}})})),1)],1)],1)],1),a("weModal",{attrs:{title:e.$t("sys.Bindtheuser"),width:"500",closable:!1},on:{onConfirm:e.addUserConfirm},model:{value:e.addUserShow,callback:function(t){e.addUserShow=t},expression:"addUserShow"}},[a("Wb-form",[a("Form-item",{attrs:{label:e.$t("sys.Selecttheuser")}},[a("Wb-select",{attrs:{filterable:""},model:{value:e.selectBindUser,callback:function(t){e.selectBindUser=t},expression:"selectBindUser"}},e._l(e.selectUserList,(function(e){return a("wb-option",{key:e.id,attrs:{value:e.id,label:e.execUser}})})),1)],1)],1)],1),a("weLoading",{directives:[{name:"show",rawName:"v-show",value:e.FesFesx.isLoading,expression:"FesFesx.isLoading"}]})],1)},Es=[];Rs._withStripped=!0;var Is={components:{weModal:w["a"],weLoading:L},data:function(){return{tabValue:"node",execoteNodeList:[],execoteUserList:[],selectBindNode:"",selectBindUser:"",selectNodeList:[],selectUserList:[],addNodeShow:!1,addUserShow:!1,nodePagination:{size:11,current:1,total:10},userPagination:{size:11,current:1,total:10},userData:JSON.parse(decodeURIComponent(this.$route.query.user))}},mounted:function(){this.getSelectNodeList(),this.getSelectUserList(),this.nodeSearchQuery(),this.userSearchQuery()},methods:{addNode:function(){this.addNodeShow=!0},addUser:function(){this.addUserShow=!0},nodeSearchQuery:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:11;this.FesFesx.set("isLoading",!0),this.FesApi.fetch("/admin/user/".concat(this.userData.id,"/exec/node/bind/pager"),{page:t,pageSize:a},"get").then((function(t){e.FesFesx.set("isLoading",!1),e.execoteNodeList=t.data,e.nodePagination.size=t.pageSize,e.nodePagination.current=t.page,e.nodePagination.total=t.totalPages}))["catch"]((function(){e.FesFesx.set("isLoading",!1)}))},userSearchQuery:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:11;this.FesFesx.set("isLoading",!0),this.FesApi.fetch("/admin/user/".concat(this.userData.id,"/exec/user/bind/pager"),{page:t,pageSize:a},"get").then((function(t){e.FesFesx.set("isLoading",!1),e.execoteUserList=t.data,e.userPagination.size=t.pageSize,e.userPagination.current=t.page,e.userPagination.total=t.totalPages}))["catch"]((function(){e.FesFesx.set("isLoading",!1)}))},nodePageChange:function(e){var t=e.current,a=e.size;this.nodeSearchQuery(t,a)},userPageChange:function(e){var t=e.current,a=e.size;this.userSearchQuery(t,a)},addNodeConfirm:function(){var e,t=this;this.FesApi.fetch(y()(e="/admin/user/".concat(this.userData.id,"/exec/node/")).call(e,this.selectBindNode,"/bind"),{},"post").then((function(){t.$Toast.success(t.$t("sys.Boundnodesuccess")),t.nodeSearchQuery(t.nodePagination.current,t.nodePagination.size)}))},addUserConfirm:function(){var e,t=this;this.FesApi.fetch(y()(e="/admin/user/".concat(this.userData.id,"/exec/user/")).call(e,this.selectBindUser,"/bind"),{},"post").then((function(){t.$Toast.success(t.$t("sys.Bindingusersuccessfully")),t.userSearchQuery(t.userPagination.current,t.userPagination.size)}))},deleteNodeAction:function(e){var t,a=this;this.$Message.confirm(this.$t("sys.Removenodes"),y()(t="".concat(this.$t("sys.Confirmtodeletetheexecutionnode"))).call(t,e.address,"?")).then((function(t){var s;0===t&&a.FesApi.fetch(y()(s="/admin/user/".concat(a.userData.id,"/exec/node/")).call(s,e.id,"/bind"),{},"delete").then((function(){a.$Toast.success(a.$t("sys.Deletenodesuccess")),a.nodeSearchQuery(a.nodePagination.current,a.nodePagination.size)}))}))},deleteUserAction:function(e){var t,a=this;this.$Message.confirm(this.$t("sys.Deleteuser"),y()(t="".concat(this.$t("sys.Confirmtodeletetheuserexecution"))).call(t,e.execUser,"?")).then((function(t){var s;0===t&&a.FesApi.fetch(y()(s="/admin/user/".concat(a.userData.id,"/exec/user/")).call(s,e.id,"/bind"),{},"delete").then((function(){a.$Toast.success(a.$t("sys.Deletetheusersuccessfully")),a.userSearchQuery(a.userPagination.current,a.userPagination.size)}))}))},goback:function(){this.$router.go(-1)},getSelectNodeList:function(){var e=this;this.FesApi.fetch("/admin/exec/node/selectAll",{},"get").then((function(t){e.selectNodeList=t}))},getSelectUserList:function(){var e=this;this.FesApi.fetch("/admin/exec/user/list ",{},"get").then((function(t){e.selectUserList=t}))}}},Js=Is,Ws=(a("5202"),Object(_["a"])(Js,Rs,Es,!1,null,"ee32ff88",null));Ws.options.__file="src/pages/sys/user/bind/index.fes";var Os=Ws.exports,js=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"task-main"},[a("fes-search-panel",[a("Wb-form",{attrs:{type:"query","label-width":150}},[a("Form-item",{attrs:{label:e.$t("task.ZYID")}},[a("wb-input",{attrs:{type:"number",placeholder:e.$t("task.QSR")},on:{"on-enter":function(t){return e.search(e.pagination.current,e.pagination.size)}},model:{value:e.query.jobId,callback:function(t){e.$set(e.query,"jobId",t)},expression:"query.jobId"}})],1),a("Form-item",{attrs:{label:e.$t("task.RWMC")}},[a("wb-input",{attrs:{placeholder:e.$t("task.QSR")},on:{"on-enter":function(t){return e.search(e.pagination.current,e.pagination.size)}},model:{value:e.query.jobName,callback:function(t){e.$set(e.query,"jobName",t)},expression:"query.jobName"}})],1),a("Form-item",{attrs:{label:e.$t("task.RWZT")}},[a("Wb-select",{attrs:{placeholder:e.$t("task.XZRWZT")},model:{value:e.query.status,callback:function(t){e.$set(e.query,"status",t)},expression:"query.status"}},[a("wb-option",{attrs:{value:"",label:e.$t("task.XZRWZT")}}),a("wb-option",{attrs:{value:"COMMIT",label:e.$t("message.newAllPage.Inthequeue")}}),a("wb-option",{attrs:{value:"RUNNING",label:e.$t("message.newAllPage.Intheoperationofthe")}}),a("wb-option",{attrs:{value:"KILL",label:e.$t("message.newAllPage.Hasstopped")}}),a("wb-option",{attrs:{value:"SUCCESS",label:e.$t("message.newAllPage.Executesuccessfully")}}),a("wb-option",{attrs:{value:"FAILD",label:e.$t("message.newAllPage.Onfailure")}}),a("wb-option",{attrs:{value:"RUNNING_TIMEOUT",label:e.$t("message.newAllPage.Runatimeout")}})],1)],1),a("Form-item",{attrs:{label:e.$t("task.KSSJ")}},[a("Wb-input-date-picker",{attrs:{"enable-seconds":"","enable-time":"",clearable:""},model:{value:e.query.triggerTimeBegin,callback:function(t){e.$set(e.query,"triggerTimeBegin",t)},expression:"query.triggerTimeBegin"}})],1),a("Form-item",{attrs:{label:e.$t("task.JSSJ")}},[a("Wb-input-date-picker",{attrs:{"enable-seconds":"","enable-time":"",clearable:""},model:{value:e.query.triggerTimeEnd,callback:function(t){e.$set(e.query,"triggerTimeEnd",t)},expression:"query.triggerTimeEnd"}})],1)],1),a("div",{attrs:{slot:"button"},slot:"button"},[a("Wb-button",{attrs:{type:"primary",icon:"search"},on:{click:function(t){return e.search(e.pagination.current,e.pagination.size)}}},[e._v("\n "+e._s(e.$t("task.CX"))+"\n ")])],1)],1),a("fes-list-panel",[a("Wb-table",{attrs:{data:e.data,"no-data-text":e.$t("task.ZWSJ")}},[a("Column",{attrs:{prop:"id",name:"ID",width:"90px"}}),a("Column",{attrs:{prop:"executerAddress",name:e.$t("task.ZXJD"),width:"130px"}}),a("Column",{attrs:{prop:"jobName",width:"110px",name:e.$t("task.RWMC")}}),a("Column",{attrs:{prop:"triggerType",width:"60px",name:e.$t("task.CFLX")}}),a("Column",{attrs:{prop:"triggerTime",width:"120px",name:e.$t("task.CFSJ")}}),a("Column",{attrs:{prop:"speed",width:"90px",name:e.$t("message.newAllPage.rate")+"(M/s)",classes:e.speedLimitStyle}}),a("Column",{attrs:{prop:"operater",width:"90px",name:e.$t("task.ZXYH")}}),a("Column",{attrs:{width:"80px",name:e.$t("task.ZT"),component:e.statusCompoennt}}),a("Column",{attrs:{prop:"completeTime",width:"120px",name:e.$t("task.WCSJ")}}),a("Column",{attrs:{component:e.tooltipComponent,width:"40px",name:e.$t("task.CS")}}),a("Column",{attrs:{component:e.operationComponent,name:e.$t("task.CZ"),width:"180px"}})],1),a("Pagination",{staticClass:"page-center",attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.changePage}})],1),a("weModal",{ref:"detailLogModal",attrs:{name:e.$t("task.RWYXRZ"),width:"1000","footer-disable":!1},on:{onConfirm:e.detailLog_close,onClose:e.detailLog_close},model:{value:e.detailShow,callback:function(t){e.detailShow=t},expression:"detailShow"}},[a("div",{staticClass:"ui-input-swap ui-input-textarea textarea-height"},[a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.textarea,expression:"textarea"}],staticClass:"ui-input",attrs:{id:"tt",readonly:""},domProps:{value:e.textarea},on:{input:function(t){t.target.composing||(e.textarea=t.target.value)}}})]),a("div",{staticClass:"button-box"},[a("Wb-button",{staticClass:"prepage",attrs:{type:"primary",disabled:e.disabled},on:{click:e.prePage}},[e._v("\n "+e._s(e.$t("task.SYY"))+"\n ")]),a("Wb-button",{staticClass:"prepage",attrs:{type:"primary",disabled:e.disabled},on:{click:e.nextPage}},[e._v("\n "+e._s(e.$t("task.XYY"))+"\n ")]),a("Wb-button",{attrs:{type:"primary",disabled:e.disabled},on:{click:e.newLog}},[e._v("\n "+e._s(e.$t("task.CKZXRZ"))+"\n ")])],1)]),a("weModal",{attrs:{title:e.$t("message.newAllPage.Setoperationrate")},on:{onConfirm:e.setSpeedLimit},model:{value:e.speedLimitShow,callback:function(t){e.speedLimitShow=t},expression:"speedLimitShow"}},[a("Wb-form",{ref:"speedLimit",attrs:{"label-width":80,rule:e.ruleValidate}},[a("Form-item",{attrs:{label:e.$t("message.newAllPage.Operatingrate"),prop:"speedLimit"}},[a("Wb-input",{attrs:{placeholder:e.$t("message.newAllPage.Pleaseentertheoperationrate")},model:{value:e.currentSpeedLimit,callback:function(t){e.currentSpeedLimit=t},expression:"currentSpeedLimit"}})],1)],1)],1)],1)},Ys=[];js._withStripped=!0;var Hs=a("ee56"),Qs=a.n(Hs),Us=a("740f"),Gs=a.n(Us),Vs=a("2478"),qs={FesDataCache:"log",FesHeader:!1,data:function(){var e=this,t=function(t,a,s){/^[0-9]+$/.test(a)?(a>102400&&s(new Error("".concat(e.$t("components.ZYSLBCG"),"100G"))),a<=0&&s(new Error(e.$t("message.newAllPage.Pleaseenterthecorrectnumber"))),s()):s(new Error(e.$t("message.newAllPage.Pleaseenterthecorrectnumber")))},a=this;return{query:{jobId:"",jobName:"",status:"",triggerTimeBegin:null,triggerTimeEnd:null},searchTimestamp:0,refreshTimestamp:0,textarea:"",data:[],pagination:{size:10,current:1,total:0},logLock:!1,logTimer:null,logStatusTimer:null,detailShow:!1,windSize:50,taskId:"",endLineNum:"",startLineNum:"",disabled:!0,buttonFlag:"",timer:"",speedLimitShow:!1,currentSpeedLimit:"",operationComponent:function(e){var t,s;return new Vue({data:function(){return{trData:e}},methods:{logDetailButton:function(e){a.textarea="","RUNNING"===e.status||"RUNNING_TIMEOUT"===e.status?a.disabled=!0:a.disabled=!1,a.logDetail(e.id,-1,-50),a.taskId=e.id},KILLButton:function(e){a.$Message.confirm(a.$t("task.ZZRW"),a.$t("task.SFZZRW")).then((function(t){0===t&&(a.logLock=!0,a.FesApi.fetch("/jobtask/kill/"+e.id,{},"post").then((function(){a.search(a.pagination.current,a.pagination.size),a.$Toast.success(a.$t("task.RWYZZ"))}))["catch"]((function(){a.logLock=!1})))}))},deteleButton:function(e){a.$Message.confirm(a.$t("task.SCRZ"),a.$t("task.SFSCRZ")).then((function(t){0===t&&(a.logLock=!0,a.FesApi.fetch("/jobtask/delete/"+e.id,"delete").then((function(){a.search(a.pagination.current,10),a.$Toast.success(a.$t("task.SCRZCG"))}))["catch"]((function(){a.logLock=!1})))}))},speedLimitAciton:function(t){var s;r()(s=["RUNNING","RUNNING_TIMEOUT"]).call(s,e.status)?(a.speedLimitShow=!0,a.currentSpeedLimit=t.speedLimit||"",a.taskId=t.id):a.$Toast(a.$t("message.newAllPage.Theexecutionoftaskcanbesetup"))}},template:y()(t=y()(s='
KILL'.concat(a.$t("task.XXRZ"),'')).call(t,a.$t("message.newAllPage.Thedynamicspeedlimit"),"
")})},tooltipComponent:function(e){return new Vue({data:function(){return{taskParams:Gs()(e.taskParams),option1:{direction:"left",align:"center",component:new Vue({data:function(){return{a:e.taskParams}},template:"{{a}}"})}}},methods:{defaultValue:function(){var e;return y()(e="".concat(this.taskParams[0][0]," : ")).call(e,this.taskParams[0][1])}},template:'{{defaultValue()}}'})},statusCompoennt:function(e){return new Vue({data:function(){return{trData:e}},methods:{statusFilter:function(e){switch(e.status){case"SUCCESS":return{color:"SUCCESS",lable:a.$t("message.newAllPage.Executesuccessfully")};case"RUNNING":return{color:"RUNNING",lable:a.$t("message.newAllPage.Intheoperationofthe")};case"FAILD":return{color:"FAILD",lable:a.$t("message.newAllPage.Onfailure")};case"RUNNING_TIMEOUT":return{color:"RUNNING_TIMEOUT",lable:a.$t("message.newAllPage.Runatimeout")};case"COMMIT":return{color:"COMMIT",lable:a.$t("message.newAllPage.Inthequeue")};case"KILL":return{color:"KILL",lable:a.$t("message.newAllPage.Hasstopped")};default:return{color:"",lable:"---"}}}},template:'{{statusFilter(trData).lable}}'})},ruleValidate:{speedLimit:[{required:!0,message:this.$t("components.SRZQZYSL")},{validator:t,trigger:"change"}]}}},components:{weLoading:L,weModal:w["a"]},FesReady:function(){this.logLock=!0,this.search()},watch:{data:{handler:function(e,t){var a=this;t.length>0&&ae()(e).call(e,(function(e,s){var n,i,r;if(t[s]&&e.status!==t[s].status&&e.id===t[s].id)if("SUCCESS"===e.status)a.$Toast.success(y()(n=y()(i=y()(r="".concat(a.$t("task.RW"),":")).call(r,e.jobName,",ID:")).call(i,e.id)).call(n,a.$t("task.ZXCG"),"!"));else if("FAILD"===e.status){var o,l,c;a.$Toast.success(y()(o=y()(l=y()(c="".concat(a.$t("task.RW"),":")).call(c,e.jobName,",ID:")).call(l,e.id)).call(o,a.$t("task.ZXSB"),"!"))}}))},deep:!0}},beforeDestroy:function(){clearTimeout(this.logTimer),clearTimeout(this.timer)},methods:{logDetail:function(e,t,a){var s=this;this.logLock||(this.logLock=!0,this.FesApi.fetch("/jobtask/log",{taskId:e,startLine:t,windSize:a},"get").then((function(t){s.logLock=!1,t.endLineNum!==t.startLineNum&&(s.endLineNum=t.endLineNum,s.startLineNum=t.startLineNum),b()(t.endLineNum)<0?s.$Toast.warn(s.$t("task.WFHQRZ")):("undefined"!==typeof t.logContent&&(s.textarea=t.logContent),s.showLog(),t.end?s.disabled=!1:s.logTimer=Qs()((function(){s.logDetail(e,-1,-50)}),5e3))}))["catch"]((function(){s.logLock=!1})))},newLine:function(e){e.target.scrollTop=e.target.scrollHeight},showLog:function(){this.detailShow=!0},detailLog_close:function(){null!=this.logTimer&&(clearTimeout(this.logTimer),this.logTimer=null),this.logLock=!1},search:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.pagination.total=0,this.FesApi.fetch("/jobtask/pageList",{taskId:this.query.jobId,fuzzyName:this.query.jobName,status:this.query.status,triggerTimeBegin:this.query.triggerTimeBegin,triggerTimeEnd:this.query.triggerTimeEnd,page:t,pageSize:a},"get").then((function(s){e.timer&&clearTimeout(e.timer),e.searchTimestamp=(new Date).getTime(),e.data=s.data,e.pagination.total=s.totalPages,e.pagination.current=t,e.pagination.size=a,e.logLock=!1,e.repetitionRunning()}))["catch"]((function(){clearTimeout(e.timer),e.repetitionRunning(),e.logLock=!1}))},repetitionRunning:function(){var e=this;if(this.data.length>0){var t={};for(var a in this.data){var s=this.data[a];"RUNNING"!==s.status&&"COMMIT"!==s.status&&"RUNNING_TIMEOUT"!==s.status||(t[a]=s.id)}var n=h()(t).length;n>0&&(this.timer=Qs()((function(){e.search(e.pagination.current,e.pagination.size)}),6e3))}},changePage:function(e){var t=e.current,a=e.size;this.search(t,a)},prePage:function(){this.detailLog_close(),this.buttonFlag===Vs["a"].NEXT?this.logDetail(this.taskId,this.startLineNum,-50):this.logDetail(this.taskId,this.endLineNum,-50),this.buttonFlag=Vs["a"].PRE},nextPage:function(){this.detailLog_close(),this.buttonFlag===Vs["a"].PRE?this.logDetail(this.taskId,this.startLineNum,50):this.logDetail(this.taskId,this.endLineNum,50),this.buttonFlag=Vs["a"].NEXT},newLog:function(){this.buttonFlag=null,this.detailLog_close(),this.logDetail(this.taskId,-1,-50)},setSpeedLimit:function(){var e=this;this.$refs.speedLimit.validate((function(t){var a;t?e.FesApi.fetch(y()(a="/jobtask/".concat(e.taskId,"/speed/limit/")).call(a,e.currentSpeedLimit),{},"put").then((function(t){e.search(e.pagination.current,e.pagination.size)})):e.speedLimitShow=!0}))},speedLimitStyle:function(e){return e>=1&&e<50?"normal":e>=50&&e<100?"warnig":e>=100?"error":void 0}}},zs=qs,Ks=(a("3e01"),Object(_["a"])(zs,js,Ys,!1,null,null,null));Ks.options.__file="src/pages/task/index.fes";var en=Ks.exports;t["a"]=[{path:"/sys/executor/bind",component:Ts,name:"sys_executor_bind_index",count:21},{path:"/sys/user/bind",component:Os,name:"sys_user_bind_index",count:21},{path:"/ds/dataTemplate",component:B,name:"ds_dataTemplate_index",count:14},{path:"/ds/newManager",component:z,name:"ds_newManager_index",count:14},{path:"/group/groupDetail",component:ve,name:"group_groupDetail_index",count:14},{path:"/sys/executeUser",component:hs,name:"sys_executeUser_index",count:14},{path:"/sys/executor",component:Ds,name:"sys_executor_index",count:14},{path:"/sys/owner",component:Ls,name:"sys_owner_index",count:14},{path:"/sys/user",component:Xs,name:"sys_user_index",count:14},{path:"/group",component:re,name:"group_index",count:7},{path:"/help",component:Fe,name:"help_index",count:7},{path:"/home",component:Ne,name:"home_index",count:7},{path:"/job",component:Xe,name:"job_index",count:7},{path:"/login",component:rs,name:"login_index",count:7},{path:"/task",component:en,name:"task_index",count:7}]},"9c43":function(e,t,a){},"9d64":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHUAAAAXCAYAAAA1OADtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjVGREZCMjNGRkM2NTExRTU4RjdDRDFCNjdDMUYwQjQ0IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjVGREZCMjQwRkM2NTExRTU4RjdDRDFCNjdDMUYwQjQ0Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NUZERkIyM0RGQzY1MTFFNThGN0NEMUI2N0MxRjBCNDQiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NUZERkIyM0VGQzY1MTFFNThGN0NEMUI2N0MxRjBCNDQiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7i+XFBAAAHJklEQVR42uxaaWxVRRS+3WwRC61QVoUGUHApD+PGqhCQRSug4AIxJGjQKCq4gAoEEeMCiAEUTAQDVRKVKIEoiBIKiRaQBCxVikLZbBEKRSl7F3meMd/F43Bm7tz3atIfnuRLe2fOrGfmbPMSotGo9z/VS3qBMI2Qhu8qwkjC8qCGydr37YQ8dKSgJL6T0D2GSb1FeIhN6hxhFmF2HS78EswvycJTTThDOELYRVhPWE04W8+FeiPbO0WpmL8XVqi3ENpqZSdjnFRfQnP23ZhQXscLv5bQLgT/HYSxhArCGMKKeizUiPZdQ/jZpWGi9t1Z4Nkew4SSseF10ZeNOsfYrinhMxzi+kgNCB20smJCbSw3NUfgKYphUp2gGjnVup60OIX6B+GEpqKbCwdYqezxsFMmuoIwmnAroTXKSgirCJ/+hyr8OmG+RWFulE8pIW5XLuFFDDydsMbhcBRDhUiUhLGvIWRhs34lbCKctsxfGudpwlKtrAnhc/gM+uaZaCLhVeFwdiEMJ7yMv1sD9rgJTFojZuP3Eg6HXFdMQu0IwQbp8TsJK9lJWg5hHAi4QT8KZRmESYSHsXidlMe3hDCZcMzxpkqLV23nC0I9b9iXVwhT8b8SWhlsXDbjycZhztEEdDPhLkJPODsZhjFKcdtnwYmz2VNp/3oQ7oUDdRlbz0+eCmmAkdGLqZDVK3QhnBT43tb4Vgs8EzWe2whHom70G+F6rX2WwFdDSNH4fDwi8K8U+HIItYS9hBtYeRJhidDHHMaTEQ1P5RiTzyFf4GvJ6h8kVAs8OwhteEdvCkx5rF51WmqYWCUhnfGWCTwDWX1PwpmQi99DaMD66CvwbDcIVAmkQOB/jvFkE74gHCScx0ZPIByCsBRPW8OB8/voFY2NNmnzrdDqK1jdREMfG/x5JjqqsksJX8JxkKgRHArfhrS29KXU0TJ4eHo8qeLHDwiFQnsVuowKsDv7oRZ9dIQq/EqItVXc/CH7TiBcSWhF+AXqTpmeb8ErOZaKWrIwMMewP79j/cWI/XXqyvaspWCKiuB3LCDMENp/QuhPOP73FzsB0i3sh1O+wuG0lRASCb2FOn7SXhfqt+EW8PlMF/i+YfWLo/HRo8KNTiOcgGpT8xxDGEroTxhk2Ycn0f49oS5XG6MTNJtOPVE/QKh7H6ZCohmEBD6G/0+moUEzwuwQGzWYME4oX49xGgo2uVKzFz6SBZtbyuq3xiHQHVibPuasGPsbi/aSis8Uxlkl8HVD3QShrkoo+5PwhGRuki2q9zC8q2eFuqNQualauYr79lnCosHMU/NpG+JAzzBOFvtuqIVA8WSiNmLcY0z9PhZjf9sM6vcg4mad0oWyMoss9LBKhXwjEIUYQxpTR+8K5btgnwYK8WAfQ+znu+MDhLregAsdxd+rtLyoh4TDYq3sctjIHgJ/e8TaE/A9BptdQNiNMK2DIdTSbfP3sOHpjrFlByEVWxZglzkVmgTKbepCRzVzlNCOqccDju1uQpudcdrBdejnfqEu3+D5+uHPRkvIlgIv9hShBWvXyGGNm8F7t8He6XNpKvAVsHlUO+7FPab1JobIoapEwFBkQ/y033yHdufh9XnCY0FY+iFk0oHf8NeEcl+dD4LX+ZGWSHie0CZgTvkh52TLFnUSEkCeIas2Q1DLFxL6iQHpMp9GQTVxWohnLRuVgCdVCGP8UCXTEZMtGxP0WCCFY3uZUD3h1Wa0w76sDpnai1j4pD7egQnZrZUrE/S4Sajt2Ik10STEllLyPC+gbRG76VVC/UDEVzZU4m9ViDQaJxV/viSUr9UEzp8GW1nicm7HNxsEYnrAsKVQI4Y5qnGeEeqm4rBfJNQgw6ySAW9Y6uc5CtUTTpsHZ2wmHBOf0pBDHQ/tMFtLdEhqPAXJdh/K+XoAJmKH0OYc8sqKTgkOTGOHW7oFwktFosPlAaNzyJvq16mXoXWCIzhFcpSmWYzxWksulWONpY8hDikun1Tq8LhQrspSWYqxLugpNq8RzGFJQlkThz4WsZy4TksN6cqzGt9+S3r1uNY+ghQmp2rmvF5wlExOUjGelmocTuwcx5s6z5AC5I/D0g1RZb3ifBjnDt842CqfliFu7Y6Xk0zEr6UBfWVYbnWRIZRJM/gCmUJ6dbvwnSdoqJm6+pU2qRxPbJWOG/W1wX6cRD6Wq7x++NWBK9UgJiuz2B0XUu+zcwlXCyYj1/vnpzfDIMwFAQdQ0RAIST3P7XSw8ZGQ9lQ6GFOEx/lheOq7kHxYgyxPOpiVIBZp76NBFEXmKZc5XUqAe4QEtroB98HjVsn2boQWOPVVOEjlsIMqU7PB+/fvpL4jHHKY0wmsZz8O3L4AD30pMk3NIODhCBlqWZLmHPotwYZ/zJL9ESRf2uPmbhHGOQQfIh0RwWk83nv4nosxE7AX0uE/iPfnrrilKWibjb3x/hJgANWjL/Qrnss7AAAAAElFTkSuQmCC"},a35e:function(e,t,a){},a72c:function(e,t,a){},abc4:function(e){e.exports=JSON.parse('{"message":{"newAllPage":{"Projectbuttoncomponent":"Project button component","Onlysupertubeandadministratorshaveaddpermissions":"Only super tube and administrators have add permissions","Noaddgrouppermissions":"No add group permissions","Nodeletegrouppermissions":"No delete group permissions","Helpdocumentrefertothebelow":"Help document refer to the below","address":"address","Thedocumentdetails":"The document details","Welcometologin":"Welcome to login Exchangis system","system":"system","Pleaseenteryourusername":"Please enter your user name","Pleaseenterthepassword":"Please enter the password","Thelogin":"The login","Musthavealetter":"Must have a letter","Andonlysupportletter":"And only support letter","digital":"digital","Theunderline":"The underline","Namecannotbemorethanlength":"Name cannot be more than length","Passwordlengthcantmorethan":"Password length can\'t more than","Thesuperuser":"The super user","Manageusers":"Manage users","Theaverageuser":"The average user","Notloggedin":"Not logged in","rate":"rate","Setoperationrate":"Set operation rate","Operatingrate":"Operating rate","Pleaseentertheoperationrate":"Please enter the operation rate","Pleaseenterthecorrectnumber":"Please enter the correct number","Whethertodisablelogbuttonatthebottom":"Whether to disable log button at the bottom","Detailedlogbutton":"Detailed log button","Determinewhethertoclickdetails":"Determine whether to click details","and":"and","state":"state","button":"button","Thedeletebutton":"The delete button","Displayinputbox":"Display input box","Theexecutionoftaskcanbesetup":"The execution of task can be set up","Thedynamicspeedlimit":"The dynamic speed limit","Executesuccessfully":"Execute successfully","Intheoperationofthe":"In the operation of the","Onfailure":"On failure","Runatimeout":"Run a timeout","Inthequeue":"In the queue","Hasstopped":"Has stopped","Backlog":"Back log","Thenextpagelog":"The next page log","Toviewthelatestlog":"To view the latest log","Adjustablemeetagainafterthemodificationoftheinterfacedata":"Adjustable meet again after the modification of the interface data","Thecolorofthestate":"The color of the state","Queryconditions":"Query conditions","Tasknameand":"Task name and","Forthetree":"For the tree","Tochoosetimedeterminewhetherillegal":"To choose time determine whether illegal","Aslegal":"As legal","Performatask":"Perform a task","Ifconfirmtoperformatask":"If confirm to perform a task","Searchproject":"Search project","Determinethestartandendarelegal":"Determine the start and end are legal","Getalltheprojectlist":"Get all the project list","Getsthecurrentgroupofmembersallcanbeadded":"Gets the current group of members all can be added","Getpacketdetails":"Get packet details","Addagroupingandupdategroup":"Add a grouping and update group","Firsttakethegroupmembersdidnotsave":"First take the group members did not save","Groupeddataispaging":"Grouped data is paging","Unabletogetalistofall":"Unable to get a list of all","Thetotalnumberofpagestocalculate":"The total number of pages to calculate","Whensearchingthecustomusername":"When searching the custom user name","Firstdeterminevalueandvalue":"First determine value and value","Havevaluetodeterminewhethertorepeat":"Have value to determine whether to repeat"},"newComponents":{"XY":"Less","DY":"Greater","DYH":"Equal","BDY":"Unequal","XYDY":"LE","DYDY":"GE","SimplifiedChinese":"Simplified Chinese","Notlessthanminimummemory":"Not less than minimum memory","Taskvariables":"Task variables","Pleaseselecttheexecutionnode":"Please select the execution node","Checkthetype":"Check the type","Pleaseselectacalibrationtype":"Please select a calibration type","Checknumber":"Check number","Pleasefillinthechecklist":"Please fill in the check list","new":"new","Fieldlengthcantmorethan":"Field length can\'t more than","Supportonlyalphanumericunderlineandhorizontalline":"Support only alphanumeric underline and horizontal line","Pleasefilloutthe":"Please fill out the","value":"value","Pleasefillinavariablesvalue":"Please fill in a variable\'s value","confirm":"confirm","Pleaseenterthechecknumber":"Please enter the check number","SupportonlylettersandNumbers":"Support only letters and Numbers","Thereare":"There are","Multi-selectlistnobindingvalueisnotempty":"Multi-select list no binding value is not empty","Ifnotedit":"If not edit","Thedefaultexecutionuserisloggedinuser":"The default execution user is logged in user","Taskvariablesexistduplicatekey/valuepair":"Task variables exist duplicate key/value pair","Confirmationbeforeyoucheckitagain":"Confirmation before you check it again","Convertedto":"Converted to","Thenewfield":"The new field","Pleaseenterthesourcefield":"Please enter the source field","Pleaseenterthepurposefield":"Please enter the purpose field","point":"point","delete":"delete","Needtojudgewhetherasourceforthestructure":"Need to judge whether a source for the structure","Purposeisnottocanmanuallyaddcolumnsstructure":"Purpose is not to can manually add columns structure","Todeterminewhether":"To determine whether","engine":"engine","Thetotalnumberofpagestocalculate":"The total number of pages to calculate","Ifthesourcefieldhastheoptionofarepeatrunwrong":"If the source field has the option of a repeat run wrong","Repeatingfield":"Repeating field","Checkfunctionvalue":"Check function value","Checkfunctionparametersbuttontoadd":"Check function parameters button to add","Checkthefunction":"Check the function","Parameterlength":"Parameter length","Thesequenceofstoredinthearray":"The sequence of stored in the array","Setwhetherthereisafearofjudgmenttochoosefirst":"Set whether there is a fear of judgment to choose first","Didntstopthenextstep":"Didn\'t stop the next step","Mappingfieldcannotbeempty":"Mapping field cannot be empty","Sourcefieldandthetargetfieldischoice":"Source field and the target field is choice","Objectivefieldlengthisnotgreaterthanthesourcefield":"Objective field length is not greater than the source field","Thetargetfieldisnotgreaterthanthesourcefield":"The target field is not greater than the source field","Anewfield":"A new field","Deleteacertainfield":"Delete a certain field","Needtousethelibrary":"Need to use the library","Thetableset":"The table set","Thecurrentneedtobeconfigured":"The current need to be configured","Thesubscript":"The subscript","Ifallthetabletoshowinthelist":"If all the table to show in the list","Willbeatablebeforethelasttableandfieldsfortheuseofpop-upwindow":"Will be a table before the last table and fields for the use of pop-up window","Ifthefirstitemnovalueaddadefaultvalue":"If the first item no value add a default value","if":"if","Quantityislessthan2":"Quantity is less than 2","empty":"empty","Accesstothedatasource":"Access to the data source","Selectthedatasource":"Select the data source","Increasetheconnectionconfigurationfield":"Increase the connection configuration field","Deletethecurrentitemthelastitemonthefieldconfiguration":"Delete the current item the last item on the field configuration","Theconnectionconfigurationfieldtojoin":"The connection configuration field to join","Ifisnewadded":"If is new added","to":"to","Ormodify":"Or modify","Canceltheconfigurationshouldbejustadddeletetable":"Cancel the configuration should be just add delete table","Ifitisnew":"If it is new","Whenconfiguredtocanceladdtablewillbedeleted":"When configured to cancel add table will be deleted","Validationofconfigurationitemsarefree":"Validation of configuration items are free","Addconfirmationbefore":"Add confirmation before","Arefreejudgment":"Are free judgment","Ifthelasttablefieldsdidntmatch":"If the last table fields didn\'t match","Thedefaultvalue":"The default value","Theindexset":"The index set","Emptydirectory":"Empty directory","Additionaldata":"Append data","Collectionisanasynchronousreturnedsotheasynchronouscantassignmentbeforereturntheresult":"Collection is an asynchronous returned so the asynchronous can\'t assignment before return the result","Determineenginefirstchoice":"Determine engine first choice","Injudgingrecord":"In judging record","Ifitis":"If it is","Engineistheresponsibilityofthesourcedatasourcejudgmentobjectivedatasourceoption":"Engine is the responsibility of the source data source judgment objective data source option","Datasourceschangeinitialvalue":"Data sources change initial value","Selectthedatasourceinterfacetoget":"Select the data source interface to get","data":"data","through":"through","Toobtain":"To obtain","Acollectionof":"A collection of","Byselectingtheindexnameiscustom":"By selecting the index name is custom","Todeterminetheindextype":"To determine the index type","Queryconditions":"Query conditions","Tasknameandprojectname":"Task name and project name","Tohideanddisplayofthecontrolprocess":"To hide and display of the control process","Chooseexecutionengine":"Choose execution engine","Settheglobalenginevariables":"Set the global engine variables","Thepreviousstep":"The previous step","Thenextstep":"The next step","Togettothefieldofinformationforuseinstep3":"To get to the field of information for use in step 3","Bynametoheavy":"By name to heavy","Whenthesourcedata":"When the source data","Whencanchoosesynchronousmetainformation":"When can choose synchronous meta information","Checkwhenthereisnofieldmappingandpostprocessor":"Check when there is no field mapping and post processor","Havesynchronousmetainformation":"Have synchronous meta information","Nofurtheroperation":"No further operation","Thepurposeof":"The purpose of","Thesourcearestructured":"The source are structured","Thepurposeofunstructured":"The purpose of unstructured","Sourceforstructured":"Source for structured","Copyoftasks":"Copy of tasks","Afterselectiontableagain":"After selection table again","Savetheinformationandmetadatasourcesonnoproblem":"Save the information and metadata sources on no problem","Isthetabletocompare":"Is the table to compare","Ifyoudontlike":"If you don\'t like","Emptyeditcachedata":"Empty edit cache data","Ifthesecondstepis":"If the second step is","type":"type","Edittemplatedatawasobtainedfromthebackground":"Edit template data was obtained from the background","Ifitisinediting":"If it is in editing","Todeterminewhetherthereisatemplateinformation":"To determine whether there is a template information","Ifyouhaveused":"If you have used","Nobackgroundrequesttemplate":"No background request template","Ifitisthecustom":"If it is the custom","Alsocalculatetheobjectivevalue":"Also calculate the objective value","Stepontheeditor":"Step on the editor","Editoristhenextstep":"Editor is the next step","Thesecondpart":"The second part","Checkiftheinformationsource":"Check if the information source","Addtoedit":"Add to edit","Thefirstpart":"The first part","Whenthetransmissionmodeisrecordtypeisthecompressiontypeandfileseparator":"When the transmission mode is record type is the compression type and file separator","Thefourthpart":"The fourth part","Thefifthpart":"The fifth part","Thenewdemand":"The new demand","Aslongasitisthesourcedataisstructureddatasources":"As long as it is the source data is structured data sources","Therewillbe4fields":"There will be 4 fields","Therearetwofieldmapping:":"There are two field mapping:","Sourceanddestinationarestructured":"Source and destination are structured","Thesourceisstructured":"The source is structured","Thepurposeisnotstructured":"The purpose is not structured","Synchronousmetainformationdata":"Synchronous meta information data","Tojudgewhetherthereisafirst":"To judge whether there is a first","Todeterminewhethermorethanthreelayers":"To determine whether more than three layers","Onlysupportsnomorethanthreelayersofengineering":"Only supports no more than three layers of engineering","Selectedbydefaultthefirstproject":"Selected by default the first project"},"newUitemplate":{"Librarytable":"Library table","Pleaseselectthedatabase":"Please select the database","Pleaseselectadatatable":"Please select a data table","new":"new","timing":"timing","OnMonday,":"On Monday,","OnTuesday,":"On Tuesday,","OnWednesday,":"On Wednesday,","OnThursday,":"On Thursday,","OnFriday,":"On Friday,","OnSaturday,":"On Saturday,","OnSunday,":"On Sunday,","minutes":"minutes","Perhour":"Per hour","Everyday,":"Every day,","Onceaweek":"Once a week","Amonth":"A month","Everyyear,":"Every year,","points":"points","when":"when","month":"month","day":"day","every":"Per","Willbeconvertedtotheselectedtime":"Will be converted to the selected time","format":"format","Stillhavetomakesurewhatisthefirstchoicetodeterminetheexpressionishowtowrite":"Still have to make sure what is the first choice to determine the expression is how to write","Ifyouchooseday23selectionboxthereisnoshow":"If you choose day 23 selection box there is no show","Fourorfiveselectionbox":"Four or five selection box","will":"will","Formatistransformedintotimeformat":"Format is transformed into time format","Todeterminewhetherselectedyearfirst":"To determine whether selected year first","Usedtostorecustomindexname":"Used to store custom index name","Indexofcustomlogic":"Index of custom logic","Whenuserssearchforthevalueofthereturnisnotthebackgroundofthelist":"When users search for the value of the return is not the background of the list","Willaddaandindextypeonly":"Will add a and index type only","Searchthevalueofthereturninthebackgroundandnotreturnthedatainthedata":"Search the value of the return in the background and not return the data in the data","Tomonitorthefiletype":"To monitor the file type","Modifythecompressedmode":"Modify the compressed mode","Todeterminewhether":"To determine whether","engine":"engine","Transferthedatasource":"Transfer the data source","Dothedatatransfer":"Do the data transfer","Willusethedirectorysemaphorefileread/writesynchronization":"Will use the directory semaphore file read/write synchronization","Pleaseenterthe":"Please enter the","Wheneveryouchosedatareadorwritedatacanbeused":"Whenever you chose data read or write data can be used","Thepasswordboxforthefocus":"The password box for the focus","Whenediting":"When editing","Ifgetfocusvalueasthedefaultvalueisempty":"If get focus value as the default value is empty","Passwordboxlosesfocustojudgewhetherthereisamodifytheinitialvalue":"Password box loses focus to judge whether there is a modify the initial value","Ifthevalueisnull":"If the value is null","Changethevaluetothedefaultvalue":"Change the value to the default value","Transferstoobtaintemplatepage":"Transfers to obtain template page","Accesstothedatasourcetemplate":"Access to the data source template","Ifitisnotneedtoaddnew":"If it is not need to add new","Withoutpermissioninthetemplate":"Without permission in the template","Dontpassthistwofields":"Don\'t pass this two fields","Judgewhetherthecurrentusertotheadministratorusersandowner":"Judge whether the current user to the administrator users and owner","Checkwhethertheirowner":"Check whether their owner","through":"through","Todeterminewhethercanoperation":"To determine whether can operation","Changechangescorrespondingtothealias":"Change changes corresponding to the alias","Prompttheuserwhetherdeletetodeletethemiddletable":"Prompt the user whether delete to delete the middle table","Mustfirstdeterminewhetherthelastitem":"Must first determine whether the last item","Accordingtothesubscripttakecorrespondingtorenamethetable":"According to the subscript take corresponding to rename the table","and":"and","Willbelostundostack":"Will be lost undo stack","Tocancelthestack":"To cancel the stack"}},"pageDs":{"XZWQXS":"Choose the right to limit","BYCXMCS":"Don\'t pass the following parameters","YHWSCQX":"The current user remove permissions","YHWBJQX":"The current user has no edit permissions","PDSFGLY":"Judge whether the current user to the administrator users and owner","XJCSBSZJSZ":"Check whether their owner","ZTON":"through","LPAND":"To determine whether can operation","TG":"through","HQDYGCM":"To obtain the corresponding project name","HQSOGOCS":"Get all the engineering data","CKXQ":"Check the details","TONJKHQXX":"Through the interface for more details information"},"manager":{"resourceManager":"Data Source Management","resourceType":"Data Source Type","selectResourceType":"Select the data source type","resourceName":"Data Source Name","SRSZYM":"Enter the data source name","SZYSZ":"Data Source Owner","XZSJYSZ":"Select source","CX":"Select","XZCX":"New Data Source","LX":"Type","CJZ":"Creator","XM":"Project","CJZSJ":"Created Time","XQ":"Detail","BJ":"Edit","SC":"Delete","LJXX":"Connection Information","CKLJXX":"View Connection Information","XZSJK":"Select Data Source","GXSJK":"RMDB","SJY":"Data Source","SJK":"DB","DSJCC":"Big Data Storage","BJGHCC":"Semi-structured Storage","ZW":"None","WJGHCC":"Unstructured Storage","FW":"Server","SJYSZJK":"The api of obtaining data soruce onwers","CXSJ":"Query Data","DJFY":"Click paging","CJSJYCG":"Success to create data source","GXSJ":"Update","GXCG":"Success to update data source","LJSJYCG":"Success to connect data source","SCSJY":"Delete Data Source","SFSCSJY":"Do you want to delete data source named \'{name}\'","SCSJYCG":"Success to delete data source"},"dataTemplate":{"SJYMBGL":"Data Source Model Management","SJYLJCSMBGL":"Model Management Of Data Source Parameters","MBLX":"Model Type","QXZSJY":"Please select data source type","MBMC":"Model Name","CXMBMC":"Please enter the model name of query","CX":"Query","XZMB":"New Model","CKXQ":"View Details","XG":"Edit","SC":"Delete","XZSJYLX":"Data Source Type","SRWB":"Please enter text","MBMS":"Model Desc","DZ":"Address","QSR":"Please enter","LJCS":"connectParameters","CSM":"Param Name","CSZ":"Param Value","PZX":"Configuration","PZM":"Configuration Name","PZZ":"Configuration Value","DZDKH":"Address Port","RZFS":"Auth Mode","SZYLXBMK":"Data Source type cannot be empty","MBMCBLK":"Model name cannot be empty","MCCDBNDY":"Name length cannot be greater than 100","ZU":"Only support letters, numbers, Chinese and specific characters: (_ . :)","MOMSBNK":"Model description cannot be empty","MBCDBNDY":"Description length cannot be greater than ","DZBNK":"Address cannot be empty","CDBNDY":"URL length cannot be greater than 1000","DZBNWK":"Address Port cannot be empty","BNWK":"cannot be empty","MR":"default","WQX":"None","CKMB":"View Model","XGMB":"Edit Model","TJMB":"Add Model","TJJK":"Call add interface","MBMCBKTM":"Model name cannot have the same","XZMBCG":"Succe","XGMBCG":"Success to create model","XGMBSB":"Fail to modify model","SCMB":"Delete Model","KECRWB":"Allow to enter text and ","QRSCMB":"Whether confirm to delete model","ZDLG":"Two max","DYTPZYG":"First of the first configuration","QR":"Confirm","PZDRG":"Second of the configuration","FQ":"Abort","MB":"Model","SCCG":"Success to delete","CXSJ":"Query Data","DJFY":"Click paging","PZSJDCC":"Configuration value out of focus duplicate check","PZ":"Configuration","J":"Key","Z":"Value","CF":"Duplicate","JC":"Check","SFCF":"If duplicate"},"job":{"projectlist":"Project List","taskNameLable":"Project Name:","input":"Please enter","task":"Project ID","query":"Query","addJob":"Add Job","taskName":"Job Name","timeJob":"Cron Job","jobDesc":"Job Desc","jobStatus":"Job Status","creatTime":"Created Time","action":"Operation","addProject":"Add Job","XZXM":"Add Project","MXMC":"Project Name","SRXMMC":"Please enter the project name","MS":"Description","TJ":"Submit","LS":"Run History","QXZQSSJ":"Start time:","QXZZZSJ":"End time:","JGSJ":"Interval Unit:","JGCD":"Interval Length:","SRSJCD":"Please enter the length","CXTJ":"Query Condition","MCY":"Job name and ","HDS":"Acquire tree","XZSJSFBHF":"Whether the time selected is not illegeal","WHF":"is illegal","BJ":"Edit","ZX":"Execute","FZ":"Copy","RWKSZX":"Job Start To Run","SC":"Delete","SCRW":"Delete Job","SFSC":"Whether confirm to delete job?","SCRWCG":"Success to delete job","DSZT":"Pause Corn","ZTCG":"Success to pause corn","DSQD":"Start Corn","DSCG":"Success to start corn","ZTDS":"Pause Corn","QDDS":"Start Corn","LSSJCP":"Run History","KSSJBNWK":"Start time cannot be empty","JSSJBNWK":"End time cannot be empty","SJBNWK":"Time cannot be empty","JGCDBNWK":"Interval length cannot be empty","XZZQDKSSJ":"Please select the right start time","XZZQDJSSJ":"Please select the right end time","PDKSHJS":"Judge if the start and end time is illegal","QXZHFSJD":"Please the illegal time slot","QRCP":"Whether confirm to run history of {name} job ?","CPCG":"Success to run history","TXZQBD":"Please enter the right form item","XMTJCG":"Success to add project","JGCDDY30":"The interval length cannot be greater than 30 days","JGCDDY24":"The interval length cannot be greater than 24 hours","JGCDDY60":"The interval length cannot be greater than 60 minutes","XJ":"Add","SRXMMCSS":"Enter the project name search"},"task":{"ZYID":"Task ID","QSR":"Please enter","RWZT":"Task state","XZRWZT":"Please select task state","KSSJ":"Start Time","JSSJ":"End Time","CX":"Query","ZWSJ":"No Data","ZXJD":"Execution Node","RWMC":"Job Name","CFLX":"Trigger Type","CFSJ":"Trigger Time","CFZT":"Trigger Status","ZXYH":"Created User","ZT":"State","WCSJ":"Finish Time","CS":"Parameters","CZ":"Operation","RWYXRZ":"Task Run Log","SYY":"Previous Page","XYY":"Next Page","CKZXRZ":"Latest Log","ZZRW":"Kill Task","SFZZRW":"Whether confirm to kill task?","RWYZZ":"Task has been killed","SCRZ":"Delete Log","SFSCRZ":"Whether confirm to delete log","SCRZCG":"Success to delete log","XXRZ":"Detail Log","SC":"Delete","RW":"Task","ZXCG":"Execute Success","ZXSB":"Execute Fail, Please view related logs","WFHQRZ":"Cannot acquire the log file"},"sys":{"Performusermanagement":"Perform user management","Theusername":"The user name","Thenewperformuser":"The new perform user","Pleasefillinusername":"Please fill in user name","describe":"describe","Pleasefillintheusername":"Please fill in the user name","Musthavealetter":"Must have a letter","Andonlysupportletter":"And only support letter","digital":"digital","Theunderline":"The underline","Callstoaddaninterface":"Calls to add an interface","Addausersuccessfully":"Add a user successfully","Deleteperformuser":"Delete perform user","Whetheryouwanttodelete":"Whether you want to delete","Deletetheusersuccessfully":"Delete the user successfully","Thedefaultnode":"The default node","Thelabel":"The label","Bindingthenodelabel":"Binding the node label","Pleaseselectalabel":"Please select a label","Themanagementnode":"The management node","Nodeauthorizationpage":"Node authorization page","delete":"delete","Removenodes":"Remove nodes","Whetherornottodelete":"Whether or not to delete","Deletethesuccess":"Delete the success","Bindingtothecurrentnode":"Binding to the current node","Updatethelist":"Update the list","Initialpassword":"Initial password","Pleaseenterthepassword":"Please enter the password","Confirmpasswordagain":"Confirm password again","Pleaseenterthepasswordagain":"Please enter the password again","Passwordisnotcorrect":"Password is not correct","Pleaseinputvalidationagain":"Please input validation again","Namecannotbemorethanlength":"Name cannot be more than length","Pleaseentertheinitialpassword":"Please enter the initial password","Passwordlengthcantmorethan":"Password length can\'t more than","Editbutton":"Edit button","Bindingauthorization":"Binding authorization","Toresetyourpassword":"To reset your password","Passwordresetsuccessfully":"Password reset successfully","Deleteoperation":"Delete operation","Emptythenewlyaddeddata":"Empty the newly added data","Torequestthedatalist":"To request the data list","Nodemanagement":"Node management","state":"state","normal":"normal","Hasbeenrolledofftheproductionline":"Has been rolled off the production line","Thenodeaddress":"The node address","Theheartbeatoftime":"The heartbeat of time","Memoryusage":"Memory usage","usage":"usage","Performausername":"Perform a user name","Pleaseenteryourusername":"Please enter your user name","Pleaseenterthe":"Please enter the","add":"add","return":"return","Temporarilynodata":"Temporarily no data","Associatedwiththeusertypes":"Associated with the user types","Associatedstates":"Associated states","Therecentmodificationtime":"The recent modification time","operation":"operation","Bindtheuser":"Bind the user","Selecttheuser":"Select the user","Bindingtype":"Binding type","Pleaseselectabindingtype":"Please select a binding type","Hasbeenassociateduser":"Has been associated user","Donotdelete":"Do not delete","Confirmtodeletetheuserexecution":"Confirm to delete the user execution","associated":"associated","confirm":"confirm","Executionofuser":"Execution of user","Canceltheassociated":"Cancel the associated","Canceltheexecutionoftheuser":"Cancel the execution of the user","Notassociated":"Not associated","Hasbeenassociated":"Has been associated","Connectionfailure":"Connection failure","Thebinding":"The binding","bindings":"bindings","Callstoadduserinterface":"Calls to add user interface","Usermanagement":"User management","Performuserandexecutionnodebindingauthority":"Perform user and execution node binding authority","Theexecutionnode":"The execution node","Addanode":"Add a node","Address:":"Address:","Status:":"Status:","offline":"offline","Memory:":"Memory:","Performuser":"Perform user","Adduser":"Add user","Name:":"Name:","Bindingnodes":"Binding nodes","Selectthenode":"Select the node","Gettheexecutionnodecanchoose":"Get the execution node can choose","Afterthecalltoaddinterface":"After the call to add interface","Pullthedataagain":"Pull the data again","Boundnodesuccess":"Bound node success","Bindingusersuccessfully":"Binding user successfully","Confirmtodeletetheexecutionnode":"Confirm to delete the execution node","Deletenodesuccess":"Delete node success","Deleteuser":"Delete user","executor":{"DZ":"Address","QSR":"Please enter","CX":"Query","ZWSJ":"No Data","XTSJ":"Heartbeat Time","ZT":"Status","NCSYL":"Memory Usage","SYL":"CPU Usage","CZ":"Opeartion","WH":"Repair","XX":"Down","SX":"Up","JD":"Node","SFCG":"Whether confirm to {action} node?","JDCG":"node success","ZC":"Normal","YXX":"Offline"},"owner":{"SZYSZ":"Data Source Owner Name:","QSR":"Please enter","CX":"Query","XZSJYSZ":"Add Data Source Owner","MYSZSJ":"No Owner Data","MC":"Name","MS":"Desc","CJYH":"Created User","CJSJ":"Created Time","XGYH":"Modified User","XGSJ":"Modified Time","CZ":"Operation","XZMC":"Owner Name","SRSJSZ":"Please enter Data Source Owner","TJ":"Submit","XGSJSZ":"Alter Data Source Owner","SZMCBNK":"Data Source Owner Name cannot be empty","BJ":"Edit","BJAN":"Edit Button","SC":"Delete","SCCZ":"Delete Operation","SCSJYSZ":"Delete Data Source Owner","SFSCSJYSZ":"Whether confirm to delete Data Source Owner?","SCCG":"Success to delete Data Source Owner","XGCG":"Success to modify Data Source Owner","TJSJYCG":"Success toa add Data Source Owner"},"user":{"YHM":"Username","QSR":"Please enter","CX":"Query","XZYH":"Add User","ZSWSJ":"No Data","YHLX":"User Type","CJSJ":"Created Time","XGSJ":"Modified Time","CZ":"Operation","SZMC":"Owner Name","SRYHM":"Please enter username","PTYH":"Ordinary User","GLYH":"Manage User","CJYH":"Super User","TJ":"Submit","XGYHXX":"Modify User Info","YHXXBNWK":"Username cannot be empty","BJ":"Edit","SC":"Delete","SCYH":"Delete User","SFSCYH":"Whether confirm to delete user","SCCG":"Success to delete user","XGCG":"Success to modify user","TJYHCG":"Success to add user"}},"group":{"SCYXX":"Delete Selected","SRDZGSS":"Please enter goup No. to search","SRFZMSS":"Please enter group name to search","CX":"Query","TJFZ":"Add Group","ZWSJ":"No Data","FZBH":"Group No.","FZM":"Group Name","MS":"Desc","CJR":"Created User","BDXM":"Bind Project","CJSJ":"Created Time","GXSJ":"Updated Time","XQ":"Detail","SCFZ":"Delete Group","QX":"Cancel","QRSCFZ":"Whether confirm to delete group","CKXQ":"View Detail","XZYSCDFZ":"Please select the group to delete","FZSCCG":"Success tot delete group","FZXQ":"Group Detail","FH":"Back","JCXX":"Basic Info","FZMBNK":"Group name cannot be empty","ZCZZM":"Only support letters, numbers, underline and Chinese!","QSR":"Please enter","FZMS":"Group Desc","FZCY":"Group Members","SRYHMSS":"Please enter username to serach","TICY":"Add Memeber","YH":"User ID","YHM":"Username","XZYH":"Select User","SRWB":"Please enter text","QRSCYH":"Whether confirm to delete user","SFYXG":"Whether is been modified","BCXG":"Save Changes","BCTS":"Save Tip","FZXXTXSFBC":"Whether confirm to save the changes in group?","XGFZNRWBC":"Changes not saved!","TJZCY":"Please add group member","FZNBKCF":"Group name cannot have the same","FZXG":"Success to modify group{name}","CJCG":"Success to create group{name}","TXZQBD":"Please enter the right form item","FYZS":"Calculate the summary of pages","XZYSCDYH":"Please select the user to delete","SCCG":"Success to delete group member","FZCYSCSB":"Fail to delete group member","XZYHS":"Please select user"},"uiTemplate":{"SJY":"Data Source","SYMC":"Index Name","XZSYMC":"Please select the index name","SYLX":"Index Type","XZSYLX":"Please select the index type","PLDX":"Batch Size","SRPLDX":"Please enter the batch size","HZCLQ":"Post Processor","LJ":"Path","SRLJ":"Please enter the path","YSLX":"Compress Type","XZYSLX":"Please select the compress type","BM":"Encoding","QXZBM":"Please select the encoding","CSGS":"Transport Type","QXZCSFS":"Please select the transport type","EJZ":"Binary","JL":"Record","WJLX":"File Type","XZWJLX":"Please select the file type","ZDFGF":"Field Separator","WJMQZ":"File Name Prefix","QSRWJMQZ":"Please enter the filename prefix","K":"Database","B":"Table","FQXIN":"Partition Info","FQZD":"Partition Field","ZDYFQM":"Custom partition name","MYSJ":"No Data","SJYMC":"Data Source Name","SRSJYMC":"Please enter the Data Source Name","SJYMS":"Data Source Desc","TXXQMS":"Please enter the Data Source description","SJYSZ":"Data Source Onwer","LJMB":"Connection Model","WJ":"keytab File","MYWJ":"Private-key File","YHM":"Username","GSXR":"Format such as:_NAME","MA":"Password","LJCS":"Connect Test","SUBMIT":"Submit","GX":"Update","SJYMCBNK":"Data Souce name cannot be empty","MCCDBNDY":"Name length cannot be greater than 100","ZZCZM":"Only support letters, numbers, Chinese and specific characters: (_.:)","MSCDBNDY":"Desc length cannot be greater than 100","SJYSZBNWK":"Data Source Owner cannot be null","QXZ":"Please select","RZSTBNWK":"Auth Entity cannot be empty","YHMCDBNDY":"Username length cannot be greater than 1000","YHMBNWK":"Username cannot be empty","MABNWK":"Password cannot be empty","YHMABNDY":"Password cannot be greater than 30","LJMBBNWK":"Connection Model cannot be empty","QTXZQBDX":"Please enter the right form item!","RZST":"Auth Entity","KM":"Database","TABLENAMW":"Table","BBNWK":"Table cannot be empty","LJTJ":"Link conditions","TJ":"Where condition","QSR":"Please enter the where condition","SCJG":"Delete Warn","SFSCCBZHDSYBJLJPZ":"Whether confirm to remove this table?","XRFS":"Write Mode","QSRPLDXZ":"Please enter the batch size","QR":"Confirm","YWC":"Done","JXZ":"In Progress","DJX":"Pend","BINLOGHOST":"BINLOG Address cannot be empty","BJXR":"Write Mode","SX":"Refrech","CJMB":"Create Template?","BDXM":"Bin Project","DWQX":"Foreign Authority","KD":"Read","KBJ":"Write","KSY":"Execute","SJDQ":"Data Read","SJXR":"Data Write","TGSH":"Spik header"},"components":{"TYSJJHPTWNFW":"Exchangies welcome you","ZW":"Chinese","TCCG":"Success to exit","DCXTSB":"Fail to logout system!","BCLL":"Save Browse","RWMC":"Job Name","QSRRWMC":"Please enter job name","TXR":"Alarm Users","QSRTXR":"Please enter the alarm users","DS":"Corn","BDS":"corn expression","RWMS":"Job Desc","SRRWMS":"Please enter the job description","ZXYH":"Executive User:","XZZXYH":"Please select the executive user","ZXJD":"Execution Node:","XZZXJD":"Please select the execution node","DH":"No.","QSR":"Please enter","CSSJ":"Timeout","SRCSSJ":"Please enter the timeout, unit is second","TBFS":"Sync Method","QL":"FULL","ZL":"INCREMENT","SYB":"Previous Step","BC":"Save","TXRWM":"Please enter the job name","XZZXDH":"Please select the execution","QTX":"Please enter","DXBNCG":"Cannot be greater than 5 digits","ZZCSZ":"Only support numbers","DYCLQ":"Define Processor","XYB":"Next Step","DZCLQ":"Content of processor cannot be empty","SDKZ":"Speed Limit","ZYSLXZ":"Task Byte Speed Limit","ZYJLXZ":"Task Record Speed Limit","T":"strip","CWJLCG":"Error Recod Over","RWSB":"task fail","GJ":"Adavance","ZYZDBXS":"Task Max Parallel Num","G":"","ZYZDNC":"Task Max Memory Size","SYT":"Previous","NCBCG":"Max memeory size cannot be greater than","ZYZDBXSBCG":"Max parallel number cannot be greater than","ZYSLBCG":"Max task byte speed cannot be greater than","SRZQZYSL":"Please enter the right task byte speed","ZQSRZYJLSXZ":"Please enter the right task record speed","QSRZQCWJLS":"Please enter the right error record limit","SRZQQZYZDBXS":"Please enter the right max parallel number","SRZQZYZDNC":"Please enter the right max memory size","XZSJY":"Select Data Source","SJYLX":"Data Source Type","LLSJ":"View Data","LJTJPZ":"Connection Adjustment Configuration","QX":"Cancel","QBZDXX":"Column information in previous table ","LJTJ":"Link Condition","DQBZDXX":"Column information in current table","GNZWKF":"Function is not open yet, please wait","QXTXWZLJXX":"Please complete the connected column information","QTXQBZDXX":"Please enter the connected column information in previous table before","QTXDQBZDXX":"Please enter the connected collumn informtion in current table before","ZDYS":"Column Mappings","YZD":"Source Column","LX":"Type","MBZD":"Dest Column","JYHS":"Check Function","ZHHS":"Transfer Function","CS":"Parameter","SZCS":"Set parameter","CS:":"Parameter:","QR":"Confirm","YZDBNWK":"Source column cannot be empty","CXTJ":"Query Condition","XZMD":"Select Destination","JBXX":"Basic Information","BSJJH":"Table Data Collection","RWBCCG":"Success to save job","RWXGSC":"Success to modify job","TBYXXSJ":"Sync Meta Data","XZXM":"Add Project","XMMC":"Project Name","SRXMMC":"Please enter project name","MS":"Desc","TJ":"Submit","ZJZJD":"Add Child Node","SCJD":"Delete Node","SC":"Delete","SFSC":"Whether confirm to delete the project node?","SCCG":"Success to delete","TJCG":"Success to add","TBYXX":"Sync Meta Data"},"mixin":{"FGFBCC":"Don\'t support separator like: \\\\","QZQTX":"Please enter the right unicode","PLDXBCG":"Batch size cannot be greater than 100000","SJYBNK":"Data Source cnnot be empty","BBK":"Cannot be empty","LJBKBJKG":"Path cannot contain white sapce","BMLXZC":"Only support :ISO-8859-1、GB2312、GBK、UTF-8、UTF-16","CZBNRSZW":"Cannot enter Chinese","QXZWJLX":"Please select the file type","SJKBNNQJ":"Database cannot be empty","BBNWK":"Table cannot be empty","SYMCBNWK":"Index name cannot be empty","BXYZMKR":"Must start with a letter,and only support letters, numbers, (_.-#${})","STLXBNWK":"Index type cannot be empty","DRFSBNWK":"Write mode cannot be empty","XZSJYLX":"Please select the Data Source type","XZSJY":"Please select the Data Source","XZK":"Please select database","QXZB":"Please select table"},"navBar":{"dataManager":"Data Source Management","dataSource":"Data Source","templaceManagert":"Model Management","taskConfig":"Job Configuration","tasking":"Job Tasks","group":"Group Management","help":"Help Doc","sysManagert":"System Management","owner":"Data Source Owner","execotor":"Execution Node","user":"User Management","executeUser":"executed user"}}')},afa9:function(e,t,a){},b034:function(e,t,a){},b79c:function(e,t,a){"use strict";a("6c08")},bd85:function(e,t,a){"use strict";a("68e0")},c4ed:function(e,t,a){"use strict";a("f310")},c665:function(e,t,a){},c86c:function(e,t,a){"use strict";a("afa9")},c95e:function(e,t,a){"use strict";a("45a4")},ca39:function(e,t,a){},cd9c:function(e,t,a){"use strict";a("ca39")},d682:function(e,t,a){},d7a2:function(e,t,a){"use strict";a("f952")},e072:function(e,t,a){"use strict";a("a35e")},e4c0:function(e,t,a){},e769:function(e,t,a){"use strict";a("b034")},eaea:function(e,t,a){},eeba:function(e,t,a){},f310:function(e,t,a){},f902:function(e,t,a){"use strict";a("2328")},f952:function(e,t,a){},fc8b:function(e,t,a){}},[[0,"runtime~app","chunk-vendors"]]]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/app.977a816f.js b/modules/gateway/src/main/resources/static/js/app.977a816f.js deleted file mode 100644 index 8c5617533..000000000 --- a/modules/gateway/src/main/resources/static/js/app.977a816f.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["app"],{0:function(e,t,a){e.exports=a("5654")},"00ef":function(e,t,a){"use strict";a("083c")},"083c":function(e,t,a){},1112:function(e,t,a){"use strict";a("6861");t["a"]=function(){var e=this,t=function(e){return"super"===e?"超级用户":"admin"===e?"管理用户":"user"===e?"普通用户":"未登录"};this.FesApi.option({config:{headers:{"X-Requested-With":"XMLHttpRequest","Content-language":window.localStorage.getItem("lang")||"zh-cn"}}});var a=this,s=this.FesApi;this.FesApp.setBeforeRouter((function(e,t,a){"/group/groupDetail"===t.path&&this.FesFesx.get("isChange")?this.FesFesx.set("isGoto",e.path):(this.FesFesx.set("isGoto",""),console.log(t.path,e.path,"tofrom"),"/login"!==e.path?s.fetch("/auth",{},"get").then((function(e){a()})):a())})),this.FesApi.setResponse({successCode:0,codePath:"code",messagePath:"message",resultPath:"data"}),this.FesApi.setImportant({"generalcard/action":{control:1e4,message:"您在十秒内重复发起手工清算操作,是否继续?"}}),this.FesApi.setError({302:function(e){e.data;a.FesApp.router.push("/login")},401:function(e){window.Toast("未授权操作")}}),this.on("fes_logout",(function(){s.fetch("/logout",{},"post").then((function(){console.log("[退出成功]")}))["catch"]((function(){}))})),s.fetch("/auth",{},"get").then((function(a){"undefined"!==typeof a.redirect||("undefined"!==typeof a["X-AUTH-ID"]?(e.FesApp.setRole(a.role,!0,!1),e.FesApp.set("FesUserName",a["X-AUTH-ID"]),e.FesApp.set("FesRoleName",t(a.role)),e.FesStorage.set("currentUser",a["X-AUTH-ID"]),e.FesStorage.set("userRole",a.role)):(e.setRole("unLogin"),e.FesStorage.set("currentUser","guest"),e.FesStorage.set("userRole","unLogin")))}))["catch"]((function(e){console.error(e)})),this.set("FesLogoEvent",(function(){window.Toast("WeDataSphere Exchangis")}))}},"118a":function(e,t,a){},"180a":function(e,t,a){"use strict";a("5b03")},"1f35":function(e,t,a){"use strict";a("b80f")},2373:function(e,t,a){"use strict";a("3ced")},2478:function(e,t,a){"use strict";a.d(t,"b",(function(){return s})),a.d(t,"c",(function(){return n})),a.d(t,"a",(function(){return i}));var s={HIVE:"hive",LOCAL_FS:"local_fs",HDFS:"hdfs",SFTP:"sftp",ELASTICSEARCH:"elasticsearch",MYSQL:"mysql",ORACLE:"oracle"},n={STREAM:"stream",RECORD:"record"},i={PRE:"pre",NEXT:"next"}},"301a":function(e,t,a){},"363e":function(e,t,a){"use strict";a("9768")},"3a23":function(e,t,a){"use strict";a("91a3")},"3c2b":function(e,t,a){},"3ced":function(e,t,a){},"3e01":function(e,t,a){"use strict";a("6f6c")},"3e84":function(e,t,a){"use strict";a("b8a3")},"3fbd":function(e,t,a){"use strict";a("459b")},"42cd":function(e,t,a){"use strict";a("301a")},"459b":function(e,t,a){},"4c8a":function(e,t,a){"use strict";a("72c1")},"4f3e":function(e,t,a){"use strict";a("d674")},"4fa7":function(e,t,a){},5202:function(e,t,a){"use strict";a("77f5")},"58df":function(e,t,a){"use strict";var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return e.show?a("div",{staticClass:"mask",on:{"!click":function(t){return t.target!==t.currentTarget?null:e.close(e.closable)}}},[a("div",{staticClass:"modal-content",style:{width:e.contentWidth,height:e.contentHeight}},[a("div",{staticClass:"modal-header"},[a("span",{staticClass:"ui-modal-title-main"},[e._v("\n "+e._s(e.title)+"\n ")]),a("Icon",{attrs:{type:"md-close"},on:{click:e.close}})],1),a("div",{staticClass:"modal-body"},[e._t("default")],2),e.footerDisable?a("div",{staticClass:"modal-footer"},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.comfirm}},[e._v("\n "+e._s(e.comfirmText)+"\n ")]),e.closeText?a("Wb-button",{attrs:{type:"error"},on:{click:e.close}},[e._v("\n "+e._s(e.closeText)+"\n ")]):e._e()],1):e._e()])]):e._e()},n=[];s._withStripped=!0;var i={model:{prop:"show",event:"parent-event"},props:{title:"",width:{tepy:String,default:"400"},height:{tepy:String,default:"auto"},show:{type:Boolean,default:!0},comfirmText:{type:String,default:"OK"},closeText:{type:String,default:""},footerDisable:{type:Boolean,default:!0},closable:{type:Boolean,default:!0}},computed:{contentWidth:function(){return this.width?"".concat(this.width,"px"):"400px"},contentHeight:function(){return this.height?"".concat(this.height,"px"):"auto"}},methods:{close:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e&&(this.$emit("parent-event",!1),this.$emit("onClose"))},comfirm:function(){this.$emit("parent-event",!1),this.$emit("onConfirm")}}},r=i,o=(a("180a"),a("350f")),l=Object(o["a"])(r,s,n,!1,null,"f7578088",null);l.options.__file="src/components/uiTemplate/weModal.fes";t["a"]=l.exports},"5b03":function(e,t,a){},"62d2":function(e,t,a){},6861:function(e,t,a){},6887:function(e){e.exports=JSON.parse('{"message":{"newAllPage":{"Projectbuttoncomponent":"项目按钮组件","Onlysupertubeandadministratorshaveaddpermissions":"只有超管和管理员有添加权限","Noaddgrouppermissions":"没有添加分组权限","Nodeletegrouppermissions":"没有删除分组权限","Helpdocumentrefertothebelow":"帮助文档参阅如下","address":"地址","Thedocumentdetails":"文档详情","Welcometologin":"Welcome to login Exchangis system","system":"系统","Pleaseenteryourusername":"请输入用户名","Pleaseenterthepassword":"请输入密码","Thelogin":"登录","Musthavealetter":"必须已字母开头","Andonlysupportletter":"且只支持字母","digital":"数字","Theunderline":"下划线","Namecannotbemorethanlength":"名称长度不能超过","Passwordlengthcantmorethan":"密码长度不能超过","Thesuperuser":"超级用户","Manageusers":"管理用户","Theaverageuser":"普通用户","Notloggedin":"未登录","rate":"速率","Setoperationrate":"设置作业速率","Operatingrate":"作业速率","Pleaseentertheoperationrate":"请输入作业速率","Pleaseenterthecorrectnumber":"请输入正确的数字","Whethertodisablelogbuttonatthebottom":"是否禁用日志底部按钮","Detailedlogbutton":"详细日志按钮","Determinewhethertoclickdetails":"点击详情时判断是否为","and":"和","state":"状态","button":"按钮","Thedeletebutton":"删除按钮","Displayinputbox":"展示输入框","Theexecutionoftaskcanbesetup":"执行中任务可设置","Thedynamicspeedlimit":"动态限速","Executesuccessfully":"执行成功","Intheoperationofthe":"运行中","Onfailure":"执行失败","Runatimeout":"运行超时","Inthequeue":"排队中","Hasstopped":"已停止","Backlog":"上一页日志","Thenextpagelog":"下一页日志","Toviewthelatestlog":"查看最新日志","Adjustablemeetagainafterthemodificationoftheinterfacedata":"调接修改接口后再重新拉数据","Thecolorofthestate":"状态的颜色","Queryconditions":"查询条件","Tasknameand":"任务名与","Forthetree":"获得树","Tochoosetimedeterminewhetherillegal":"选择时间的判断是否不合法","Aslegal":"为合法","Performatask":"执行任务","Ifconfirmtoperformatask":"是否确认执行任务","Searchproject":"搜索项目","Determinethestartandendarelegal":"判断开始和结束是否合法","Getalltheprojectlist":"获取所有工程列表","Getsthecurrentgroupofmembersallcanbeadded":"获取当前组下所有可添加的成员","Getpacketdetails":"获取分组详情","Addagroupingandupdategroup":"添加分组和更新分组","Firsttakethegroupmembersdidnotsave":"先去掉分组成员没有时的保存","Groupeddataispaging":"分组数据是分页的","Unabletogetalistofall":"无法获取所有的列表","Thetotalnumberofpagestocalculate":"分页总数计算","Whensearchingthecustomusername":"搜索时自定义用户名","Firstdeterminevalueandvalue":"先判断有值和没值","Havevaluetodeterminewhethertorepeat":"有值再判断是否重复"},"newComponents":{"XY":"小于","DY":"大于","DYH":"等于","BDY":"不等于","XYDY":"小于等于","DYDY":"大于等于","SimplifiedChinese":"简体中文","Notlessthanminimummemory":"最小内存不能小于","Taskvariables":"任务变量","Pleaseselecttheexecutionnode":"请选择执行节点","Checkthetype":"校验类型","Pleaseselectacalibrationtype":"请选择校验类型","Checknumber":"校验单号","Pleasefillinthechecklist":"请填写校验单号","new":"新增","Fieldlengthcantmorethan":"字段长度不能超过","Supportonlyalphanumericunderlineandhorizontalline":"只支持字母数字下划线和中横线","Pleasefilloutthe":"请填写","value":"值","Pleasefillinavariablesvalue":"请填写变量值","confirm":"确认","Pleaseenterthechecknumber":"请输入校验单号","SupportonlylettersandNumbers":"只支持字母和数字","Thereare":"有","Multi-selectlistnobindingvalueisnotempty":"多选列表没有绑定值是没清空","Ifnotedit":"如果不是编辑时","Thedefaultexecutionuserisloggedinuser":"默认执行用户为登录用户","Taskvariablesexistduplicatekey/valuepair":"任务变量存在重复的键值对","Confirmationbeforeyoucheckitagain":"确认之前先校验一遍","Convertedto":"转换成","Thenewfield":"新增字段","Pleaseenterthesourcefield":"请输入源字段","Pleaseenterthepurposefield":"请输入目的字段","point":"点","delete":"删除","Needtojudgewhetherasourceforthestructure":"需要一个来判断是否是源为结构","Purposeisnottocanmanuallyaddcolumnsstructure":"目的不是结构的情况来可以手动增加字段","Todeterminewhether":"判断是否是","engine":"引擎","Thetotalnumberofpagestocalculate":"分页总数计算","Ifthesourcefieldhastheoptionofarepeatrunwrong":"如果源字段有重复的选项就跑错","Repeatingfield":"重复字段","Checkfunctionvalue":"校验函数选择值","Checkfunctionparametersbuttontoadd":"校验函数参数按钮添加","Checkthefunction":"校验函数","Parameterlength":"参数长度","Thesequenceofstoredinthearray":"存储到数组的序列","Setwhetherthereisafearofjudgmenttochoosefirst":"先怕判断选择的自定是否有","Didntstopthenextstep":"没有阻止下一步","Mappingfieldcannotbeempty":"映射字段不能为空","Sourcefieldandthetargetfieldischoice":"源字段和目标字段都是必选","Objectivefieldlengthisnotgreaterthanthesourcefield":"目的字段长度不能大于源字段","Thetargetfieldisnotgreaterthanthesourcefield":"目标字段不能大于源字段","Anewfield":"新增一个字段","Deleteacertainfield":"删除字段某一项","Needtousethelibrary":"需要用到的库","Thetableset":"表集合","Thecurrentneedtobeconfigured":"当前需要配置的","Thesubscript":"的下标","Ifallthetabletoshowinthelist":"如果所有表在列表里才展示","Willbeatablebeforethelasttableandfieldsfortheuseofpop-upwindow":"将最后一个表和前一个表的字段供弹窗使用","Ifthefirstitemnovalueaddadefaultvalue":"如果第一项没有值加一个默认值","if":"如果","Quantityislessthan2":"数量小于二","empty":"清空","Accesstothedatasource":"获取数据源","Selectthedatasource":"选择数据源","Increasetheconnectionconfigurationfield":"增加连接配置字段","Deletethecurrentitemthelastitemonthefieldconfiguration":"删除当前项字段配置最后一项","Theconnectionconfigurationfieldtojoin":"将连接的配置字段加入到","Ifisnewadded":"如果是新加的就","to":"到","Ormodify":"否则就是修改","Canceltheconfigurationshouldbejustadddeletetable":"取消配置应该将刚添加的表删除","Ifitisnew":"如果是新加的","Whenconfiguredtocanceladdtablewillbedeleted":"在配置时取消将会删掉添加的表","Validationofconfigurationitemsarefree":"配置项有空时的校验","Addconfirmationbefore":"添加确认之前","Arefreejudgment":"判断是否有空的","Ifthelasttablefieldsdidntmatch":"如果上个表字段没配","Thedefaultvalue":"默认值","Theindexset":"索引集合","Emptydirectory":"清空目录","Additionaldata":"追加数据","Collectionisanasynchronousreturnedsotheasynchronouscantassignmentbeforereturntheresult":"集合是异步返回的所以在异步返回结果之前无法赋值","Determineenginefirstchoice":"先判断引擎的选择","Injudgingrecord":"在判断记录方式","Ifitis":"如果是","Engineistheresponsibilityofthesourcedatasourcejudgmentobjectivedatasourceoption":"引擎则由源数据源判断目的数据源的可选项","Datasourceschangeinitialvalue":"数据源改变还原初始值","Selectthedatasourceinterfacetoget":"选择数据源调接口获取","data":"数据","through":"通过","Toobtain":"获取","Acollectionof":"集合","Byselectingtheindexnameiscustom":"通过选择的索引名是否是自定义的","Todeterminetheindextype":"来确定索引类型","Queryconditions":"查询条件","Tasknameandprojectname":"任务名与项目名","Tohideanddisplayofthecontrolprocess":"控制流程的隐藏与显示","Chooseexecutionengine":"选择执行引擎","Settheglobalenginevariables":"设置全局引擎变量","Thepreviousstep":"上一步","Thenextstep":"下一步","Togettothefieldofinformationforuseinstep3":"将获取到的字段信息给第三步使用","Bynametoheavy":"通过名称去重","Whenthesourcedata":"当源数据为","Whencanchoosesynchronousmetainformation":"时可以选择同步元信息","Checkwhenthereisnofieldmappingandpostprocessor":"勾选时则没有字段映射和后置处理器","Havesynchronousmetainformation":"有同步元信息的","Nofurtheroperation":"没有后续操作","Thepurposeof":"目的为","Thesourcearestructured":"源也为结构化","Thepurposeofunstructured":"目的为非结构化","Sourceforstructured":"源为结构化","Copyoftasks":"解决复制的任务","Afterselectiontableagain":"重新选择表之后","Savetheinformationandmetadatasourcesonnoproblem":"保存的信息和元数据源对不不上问题","Isthetabletocompare":"比较选择的表是否一样","Ifyoudontlike":"如果不一样","Emptyeditcachedata":"清空编辑缓存的数据","Ifthesecondstepis":"如果第二步是","type":"类型","Edittemplatedatawasobtainedfromthebackground":"从后台获取编辑模板数据","Ifitisinediting":"如果是编辑进来的","Todeterminewhetherthereisatemplateinformation":"就要判断是否有模板信息","Ifyouhaveused":"如果有就用","Nobackgroundrequesttemplate":"没有后台请求模板","Ifitisthecustom":"如果是自定义的这种","Alsocalculatetheobjectivevalue":"还得计算目的值","Stepontheeditor":"编辑器上一步","Editoristhenextstep":"编辑器下一步","Thesecondpart":"第二部分","Checkiftheinformationsource":"如果勾选了同步源信息","Addtoedit":"增加写入编辑","Thefirstpart":"第一部分","Whenthetransmissionmodeisrecordtypeisthecompressiontypeandfileseparator":"当传输方式为记录型时才有压缩类型和文件分割符","Thefourthpart":"第四部分","Thefifthpart":"第五部分","Thenewdemand":"新需求要求","Aslongasitisthesourcedataisstructureddatasources":"只要是源数据是结构化得数据源","Therewillbe4fields":"就会有字段隐射","Therearetwofieldmapping:":"字段映射有两种:","Sourceanddestinationarestructured":"源和目的都是结构化","Thesourceisstructured":"源是结构化","Thepurposeisnotstructured":"目的不是结构化","Synchronousmetainformationdata":"同步元信息数据","Tojudgewhetherthereisafirst":"先判断是否有","Todeterminewhethermorethanthreelayers":"先判断是否超过三层","Onlysupportsnomorethanthreelayersofengineering":"只支持不超过三层工程","Selectedbydefaultthefirstproject":"默认选中第一个工程"},"newUitemplate":{"Librarytable":"库表","Pleaseselectthedatabase":"请选择数据库","Pleaseselectadatatable":"请选择数据表","new":"新增","timing":"定时","OnMonday,":"星期一","OnTuesday,":"星期二","OnWednesday,":"星期三","OnThursday,":"星期四","OnFriday,":"星期五","OnSaturday,":"星期六","OnSunday,":"星期日","minutes":"分钟","Perhour":"每小时","Everyday,":"每天","Onceaweek":"每周","Amonth":"每月","Everyyear,":"每年","points":"分","when":"时","month":"月","day":"日","every":"每","Willbeconvertedtotheselectedtime":"将所选时间转换成","format":"格式","Stillhavetomakesurewhatisthefirstchoicetodeterminetheexpressionishowtowrite":"还是得先确定第一个选择的是什么来决定表达是怎么写","Ifyouchooseday23selectionboxthereisnoshow":"如果选择天二三选择框不用展示","Fourorfiveselectionbox":"展示四五选择框","will":"将","Formatistransformedintotimeformat":"格式转换成时间格式","Todeterminewhetherselectedyearfirst":"先判断是否选的年","Usedtostorecustomindexname":"用来存放自定义索引名的","Indexofcustomlogic":"自定义索引逻辑","Whenuserssearchforthevalueofthereturnisnotthebackgroundofthelist":"当用户搜索的值不在后台返回的列表里","Willaddaandindextypeonly":"将添加一项且索引类型只能是","Searchthevalueofthereturninthebackgroundandnotreturnthedatainthedata":"搜索的值在后台返回的数据里和不在返回数据里","Tomonitorthefiletype":"监听文件类型","Modifythecompressedmode":"修改压缩模式","Todeterminewhether":"判断是否是","engine":"引擎","Transferthedatasource":"中转数据源","Dothedatatransfer":"做数据中转","Willusethedirectorysemaphorefileread/writesynchronization":"将使用目录信号量文件做读写同步","Pleaseenterthe":"请输入","Wheneveryouchosedatareadorwritedatacanbeused":"只要选了数据读取或者数据写入就一定可以使用","Thepasswordboxforthefocus":"密码框获取焦点的时候","Whenediting":"编辑时","Ifgetfocusvalueasthedefaultvalueisempty":"如果获取焦点的时候值为默认值就清空","Passwordboxlosesfocustojudgewhetherthereisamodifytheinitialvalue":"密码框失去焦点判断是否有修改初始值","Ifthevalueisnull":"如果值为空","Changethevaluetothedefaultvalue":"将值改为默认值","Transferstoobtaintemplatepage":"调转到获取模板页","Accesstothedatasourcetemplate":"获取数据源模板","Ifitisnotneedtoaddnew":"如果不是新建需要加上","Withoutpermissioninthetemplate":"在模板时无权限的情况下","Dontpassthistwofields":"不用传这个两个字段","Judgewhetherthecurrentusertotheadministratorusersandowner":"判断当前用户是否为管理员用户和属主用户","Checkwhethertheirowner":"先检查是不是自己属主","through":"再通过","Todeterminewhethercanoperation":"来判断是否可操作","Changechangescorrespondingtothealias":"变化修改对应别名","Prompttheuserwhetherdeletetodeletethemiddletable":"删除中间表提示用户是否删除","Mustfirstdeterminewhetherthelastitem":"首先得判断是否是最后一项","Accordingtothesubscripttakecorrespondingtorenamethetable":"根据下标取对应重命名的表","and":"和","Willbelostundostack":"都会丢失撤销栈","Tocancelthestack":"有撤销栈"}},"pageDs":{"XZWQXS":"选择无权限时","BYCXMCS":"不用传下面参数","YHWSCQX":"当前用户无删除权限","YHWBJQX":"当前用户无编辑权限","PDSFGLY":"判断当前用户是否为管理员用户和属主用户","XJCSBSZJSZ":"先检查是不是自己属主","ZTON":"再通过","LPAND":"来判断是否可操作","TG":"通过","HQDYGCM":"获取对应的工程名","HQSOGOCS":"获取所有工程数据","CKXQ":"查看详情","TONJKHQXX":"通过接口获取详情信息"},"manager":{"resourceManager":"数据源管理","resourceType":"数据源类型","selectResourceType":"请选择数据源类型","resourceName":"数据源名称","SRSZYM":"请输入查询的数据源名称","SZYSZ":"数据源属主","XZSJYSZ":"请选择数据源属主","CX":"查询","XZCX":"新增数据源","LX":"类型","CJZ":"创建者","CJZSJ":"创建时间","XM":"绑定项目","BJ":"编辑","XQ":"详情","SC":"删除","LJXX":"连接信息","CKLJXX":"查看连接信息","XZSJK":"选择数据源","GXSJK":"关系型数据库","SJY":"数据源","SJK":"数据库","DSJCC":"大数据存储","BJGHCC":"半结构化存储","ZW":"暂无","WJGHCC":"无结构化存储","FW":"服务","SJYSZJK":"获取数据源属主接口","CXSJ":"查询数据","DJFY":"点击分页","CJSJYCG":"创建数据源成功","GXSJ":"更新数据","GXCG":"更新数据源成功","LJSJYCG":"连接数据源成功","SCSJY":"删除数据源","SFSCSJY":"是否要删除数据源{name}","SCSJYCG":"删除数据源成功"},"dataTemplate":{"SJYMBGL":"数据源模板管理","SJYLJCSMBGL":"源数据连接参数模板化管理","MBLX":"模板类型","QXZSJY":"请选择数据源类型","MBMC":"模板名称","CXMBMC":"请输入查询的模板名称","CX":"查询","XZMB":"新增模板","CKXQ":"查看详情","XG":"修改","SC":"删除","XZSJYLX":"选择数据源类型","SRWB":"请输入文本","MBMS":"模板描述","DZ":"地址","QSR":"请输入","LJCS":"连接参数","CSM":"参数名","CSZ":"参数值","PZX":"配置项","PZM":"配置名","PZZ":"配置值","DZDKH":"地址端口号","RZFS":"认证方式","SZYLXBMK":"数据源类型不能为空","MBMCBLK":"模板名称不能为空","MCCDBNDY":"名称长度不能大于100","ZU":"只支持字母、数字、中文和特定字符(_ . :)","MOMSBNK":"模板描述不能为空","MBCDBNDY":"描述长度不能大于","DZBNK":"地址不能为空","CDBNDY":"url长度不能大于1000","DZBNWK":"地址port不能为空","BNWK":"不能为空","MR":"默认","WQX":"无权限","CKMB":"查看模板","XGMB":"修改模板","TJMB":"添加模板","TJJK":"调添加接口","MBMCBKTM":"模板名称不可同名","XZMBCG":"新增模板成功","XGMBCG":"修改模板成功","XGMBSB":"修改模板失败","SCMB":"删除模板","KECRWB":"可以传入文本和","QRSCMB":"确认删除模板","ZDLG":"最多有两个","DYTPZYG":"第一条配置第一个","QR":"确定","PZDRG":"配置第二个","FQ":"放弃","MB":"模板","SCCG":"删除成功","CXSJ":"查询数据","DJFY":"点击分页","PZSJDCC":"配置值失焦点查重","PZ":"配置","J":"键","Z":"值","CF":"重复","JC":"检查","SFCF":"是否重复"},"job":{"projectlist":"项目列表","taskNameLable":"任务名称:","input":"请输入","task":"任务ID","query":"查询","addJob":"增加任务","taskName":"任务名称","timeJob":"定时任务","jobDesc":"任务描述","jobStatus":"定时状态","creatTime":"创建时间","action":"操作","addProject":"新增任务","XZXM":"新增项目","MXMC":"项目名称","SRXMMC":"请输入项目名称","MS":"描述","TJ":"提交","LS":"历史重跑","QXZQSSJ":"请选择起始时间:","QXZZZSJ":"请选择终止时间:","JGSJ":"间隔单位:","JGCD":"间隔长度:","SRSJCD":"请输入时间长度","CXTJ":"查询条件","MCY":"任务名与","HDS":"获得树","XZSJSFBHF":"选择时间的判断是否不合法","WHF":"为合法","BJ":"编辑","ZX":"执行","FZ":"复制","RWKSZX":"任务开始执行","SC":"删除","SCRW":"删除任务","SFSC":"是否要删除任务?","SCRWCG":"删除任务成功","DSZT":"定时暂停","ZTCG":"暂停成功","DSQD":"定时启动","DSCG":"启动成功","ZTDS":"暂停定时","QDDS":"启动定时","LSSJCP":"历史数据重跑","KSSJBNWK":"开始时间不能为空","JSSJBNWK":"结束时间不能为空","SJBNWK":"时间不能为空","JGCDBNWK":"间隔长度不能为空","XZZQDKSSJ":"请选择正确的开始时间","XZZQDJSSJ":"请选择正确的结束时间","PDKSHJS":"判断开始和结束是否合法","QXZHFSJD":"请选择合法时间段","QRCP":"确认重跑{name}任务吗?","CPCG":"重跑成功","TXZQBD":"请填写正确的表单项","XMTJCG":"项目添加成功","JGCDDY30":"间隔长度不得大于30天","JGCDDY24":"间隔长度不得大于24小时","JGCDDY60":"间隔长度不得大于60分钟","XJ":"新建","SRXMMCSS":"输入项目名称搜索"},"task":{"ZYID":"作业ID","QSR":"请输入","RWZT":"任务状态","XZRWZT":"请选择任务状态","KSSJ":"开始时间","JSSJ":"结束时间","CX":"查询","ZWSJ":"暂无数据","ZXJD":"执行节点","RWMC":"任务名称","CFLX":"触发类型","CFSJ":"触发时间","CFZT":"触发状态","ZXYH":"创建用户","ZT":"状态","WCSJ":"完成时间","CS":"参数","CZ":"操作","RWYXRZ":"任务运行日志","SYY":"上一页","XYY":"下一页","CKZXRZ":"查看最新日志","ZZRW":"终止任务","SFZZRW":"是否要终止任务?","RWYZZ":"任务已终止","SCRZ":"删除日志","SFSCRZ":"是否要删除日志","SCRZCG":"删除日志成功","XXRZ":"详细日志","SC":"删除","RW":"任务","ZXCG":"执行成功","ZXSB":"执行失败, 请查看相关日志","WFHQRZ":"无法获取日志文件"},"sys":{"Performusermanagement":"执行用户管理","Theusername":"用户名","Thenewperformuser":"新增执行用户","Pleasefillinusername":"请填写执行用户名","describe":"描述","Pleasefillintheusername":"请填写用户名描述","Musthavealetter":"必须已字母开头","Andonlysupportletter":"且只支持字母","digital":"数字","Theunderline":"下划线","Callstoaddaninterface":"调用添加接口","Addausersuccessfully":"添加用户成功","Deleteperformuser":"删除执行用户","Whetheryouwanttodelete":"是否要删除","Deletetheusersuccessfully":"删除用户成功","Thedefaultnode":"默认节点","Thelabel":"标签","Bindingthenodelabel":"绑定节点标签","Pleaseselectalabel":"请选择标签","Themanagementnode":"管理节点","Nodeauthorizationpage":"节点授权页面","delete":"删除","Removenodes":"删除节点","Whetherornottodelete":"是否删除","Deletethesuccess":"删除成功","Bindingtothecurrentnode":"将当前的节点绑定标签","Updatethelist":"更新列表","Initialpassword":"初始密码","Pleaseenterthepassword":"请输入密码","Confirmpasswordagain":"再次确认密码","Pleaseenterthepasswordagain":"请再次输入密码","Passwordisnotcorrect":"密码不正确","Pleaseinputvalidationagain":"请再次输入确认","Namecannotbemorethanlength":"名称长度不能超过","Pleaseentertheinitialpassword":"请输入初始密码","Passwordlengthcantmorethan":"密码长度不能超过","Editbutton":"编辑按钮","Bindingauthorization":"绑定授权","Toresetyourpassword":"重置密码","Passwordresetsuccessfully":"重置密码成功","Deleteoperation":"删除操作","Emptythenewlyaddeddata":"清空新添加的数据","Torequestthedatalist":"重新请求最列表数据","Nodemanagement":"节点管理","state":"状态","normal":"正常","Hasbeenrolledofftheproductionline":"已下线","Thenodeaddress":"节点地址","Theheartbeatoftime":"心跳时间","Memoryusage":"内存使用率","usage":"使用率","Performausername":"执行用户名","Pleaseenteryourusername":"请输入用户名","Pleaseenterthe":"请输入","add":"添加","return":"返回","Temporarilynodata":"暂无数据","Associatedwiththeusertypes":"关联用户类型","Associatedstates":"关联状态","Therecentmodificationtime":"最近修改时间","operation":"操作","Bindtheuser":"绑定用户","Selecttheuser":"选择用户","Bindingtype":"绑定类型","Pleaseselectabindingtype":"请选择绑定类型","Hasbeenassociateduser":"已关联用户","Donotdelete":"不可删除","Confirmtodeletetheuserexecution":"确认删除执行用户","associated":"关联","confirm":"确认","Executionofuser":"关联执行用户","Canceltheassociated":"取消关联","Canceltheexecutionoftheuser":"取消关联执行用户","Notassociated":"未关联","Hasbeenassociated":"已关联","Connectionfailure":"关联失败","Thebinding":"绑定","bindings":"绑定关联","Callstoadduserinterface":"调用添加用户接口","Usermanagement":"用户管理","Performuserandexecutionnodebindingauthority":"执行用户和执行节点的绑定授权","Theexecutionnode":"执行节点","Addanode":"添加节点","Address:":"地址:","Status:":"状态:","offline":"下线","Memory:":"内存:","Performuser":"执行用户","Adduser":"添加用户","Name:":"名称:","Bindingnodes":"绑定节点","Selectthenode":"选择节点","Gettheexecutionnodecanchoose":"获取可以选择的执行节点","Afterthecalltoaddinterface":"调用添加接口后","Pullthedataagain":"重新拉取数据","Boundnodesuccess":"绑定节点成功","Bindingusersuccessfully":"绑定用户成功","Confirmtodeletetheexecutionnode":"确认删除执行节点","Deletenodesuccess":"删除节点成功","Deleteuser":"删除用户","executor":{"DZ":"地址","QSR":"请输入","CX":"查询","ZWSJ":"暂无数据","XTSJ":"心跳时间","ZT":"状态","NCSYL":"内存使用率","SYL":"CPU使用率","CZ":"操作","WH":"维护","XX":"下线","SX":"上线","JD":"节点","SFCG":"是否要{action}节点?","JDCG":"节点成功","ZC":"正常","YXX":"已下线"},"owner":{"SZYSZ":"数据源属主名称:","QSR":"请输入","CX":"查询","XZSJYSZ":"新增数据源属主","MYSZSJ":"没有属主数据","MC":"名称","MS":"描述","CJYH":"创建用户","CJSJ":"创建时间","XGYH":"修改用户","XGSJ":"修改时间","CZ":"操作","XZMC":"属主名称","SRSJSZ":"请输入数据源属主","TJ":"提交","XGSJSZ":"修改数据源属主","SZMCBNK":"属主名称不能为空","BJ":"编辑","BJAN":"编辑按钮","SC":"删除","SCCZ":"删除操作","SCSJYSZ":"删除数据源属主","SFSCSJYSZ":"是否要删除数据源属主?","SCCG":"删除数据源属主成功","XGCG":"修改数据源属主成功","TJSJYCG":"添加数据源属主成功"},"user":{"YHM":"用户名","QSR":"请输入","CX":"查询","XZYH":"新增用户","ZSWSJ":"暂无数据","YHLX":"用户类型","CJSJ":"创建时间","XGSJ":"修改时间","CZ":"操作","SZMC":"属主名称","SRYHM":"请输入用户名","PTYH":"普通用户","GLYH":"管理用户","CJYH":"超级用户","TJ":"提交","XGYHXX":"修改用户信息","YHXXBNWK":"用户名不能为空","BJ":"编辑","SC":"删除","SCYH":"删除用户","SFSCYH":"是否要删除用户","SCCG":"删除用户成功","XGCG":"修改用户成功","TJYHCG":"添加用户成功"}},"group":{"SCYXX":"删除已选项","FZBH:":"分组编号:","SRDZGSS":"请输入分组号进行搜索","SRFZMSS":"请输入分组名进行搜索","CX":"查询","TJFZ":"添加分组","ZWSJ":"暂无数据","FZBH":"分组编号","FZM":"分组名","MS":"描述","CJR":"创建人","BDXM":"绑定项目","CJSJ":"创建时间","GXSJ":"更新时间","XQ":"详情","SCFZ":"删除分组","QX":"取消","QRSCFZ":"确认删除分组","CKXQ":"查看详情","XZYSCDFZ":"请选择要删除的分组","FZSCCG":"分组删除成功","FZXQ":"分组详情","FH":"返回","JCXX":"基础信息","FZMBNK":"分组名称不能为空","ZCZZM":"只支持字母、数字、下划线和中文!","QSR":"请输入","FZMS":"分组描述","FZCY":"分组成员","SRYHMSS":"请输入用户名进行搜索","TICY":"添加成员","YH":"用户ID","YHM":"用户名","XZYH":"选择用户","SRWB":"请输入文本","QRSCYH":"确认删除用户","SFYXG":"是否有修改","BCXG":"保存修改","BCTS":"保存提示","FZXXTXSFBC":"分组信息有修改操作是否保存?","XGFZNRWBC":"修改分组内容未保存!","TJZCY":"请添加组成员","FZNBKCF":"分组名不可重复","FZXG":"分组{name}修改成功","CJCG":"分组{name}创建成功","TXZQBD":"请填写正确的表单项","FYZS":"分页总数计算","XZYSCDYH":"请选择要删除的用户","SCCG":"分组成员删除成功","FZCYSCSB":"分组成员删除失败","XZYHS":"请选择用户"},"uiTemplate":{"SJY":"数据源","SYMC":"索引名称","XZSYMC":"请选择索引名称","SYLX":"索引类型","XZSYLX":"请选择索引类型","PLDX":"批量大小","SRPLDX":"请输入批量大小","HZCLQ":"后置处理器","LJ":"路径","SRLJ":"请输入路径","YSLX":"压缩类型","XZYSLX":"请选择压缩类型","BM":"编码","QXZBM":"请选择编码格式","CSGS":"传输方式","QXZCSFS":"请选择传输方式","EJZ":"二进制","JL":"记录","WJLX":"文件类型","XZWJLX":"请选择文件类型","ZDFGF":"字段分隔符","WJMQZ":"文件名前缀","QSRWJMQZ":"请输入文件名前缀","K":"库","B":"表","FQXIN":"分区信息","FQZD":"分区字段","ZDYFQM":"自定义分区名","MYSJ":"没有数据","SJYMC":"数据源名称","SRSJYMC":"请输入数据源名称","SJYMS":"数据源描述","TXXQMS":"请填写详细描述","SJYSZ":"数据源属主","LJMB":"连接模板","WJ":"keytab文件","MYWJ":"秘钥文件","YHM":"用户名","GSXR":"格式形如:_NAME","MA":"密码","LJCS":"连接测试","SUBMIT":"提交","GX":"更新","SJYMCBNK":"数据源名称不能为空","MCCDBNDY":"名称长度不能大于100","ZZCZM":"只支持字母、数字、中文和特定字符(_.:)","MSCDBNDY":"描述长度不能大于100","SJYSZBNWK":"数据源属主不能为空","QXZ":"请选择","RZSTBNWK":"认证实体不能为空","YHMCDBNDY":"用户名长度不能大于100","YHMBNWK":"用户名不能为空","MABNWK":"密码不能为空","YHMABNDY":"用户密码不能大于30","LJMBBNWK":"连接模板不能为空","QTXZQBDX":"请填写正确的表单项!","RZST":"认证实体","KM":"库名","TABLENAMW":"表名","BBNWK":"表不能为空","LJTJ":"连接条件","TJ":"where条件","QSR":"请输入where条件","SCJG":"删除警告","SFSCCBZHDSYBJLJPZ":"是否删除此表之后的所有表及连接配置?","XRFS":"写入方式","QSRPLDXZ":"请输入批量大小值","QR":"确认","YWC":"已完成","JXZ":"进行中","DJX":"待进行","BINLOGHOST":"binlog地址不能为空","BJXR":"写入策略","SX":"刷新","CJMB":"创建模板","BDXM":"绑定项目","DWQX":"对外权限","KD":"可读","KBJ":"可编辑","KSY":"可使用","SJDQ":"数据读取","SJXR":"数据写入","TGSH":"跳过首行"},"components":{"TYSJJHPTWNFW":"统一数据交换平台为你服务","ZW":"中文","TCCG":"退出成功","DCXTSB":"登出系统失败!","BCLL":"保存预览","RWMC":"任务名称","QSRRWMC":"请输入任务名","TXR":"提醒人","QSRTXR":"请输入提醒人","DS":"定时","BDS":"corn表达式","RWMS":"任务描述","SRRWMS":"请输入任务描述","ZXYH":"执行用户:","XZZXYH":"请选择执行用户","ZXJD":"执行节点:","XZZXJD":"请选择执行节点","DH":"单号","QSR":"请输入","CSSJ":"超时时间","SRCSSJ":"请输入超时时间,单位为秒","TBFS":"同步方式","QL":"全量(FULL)","ZL":"增量(INCR)","SYB":"上一步","BC":"保存","TXRWM":"请填写任务名","XZZXDH":"请选择执行单号","QTX":"请填写","DXBNCG":"大小不能超过5位数","ZZCSZ":"只支持数字","DYCLQ":"定义处理器","XYB":"下一步","DZCLQ":"定制处理器内容不能为空","SDKZ":"速度控制","ZYSLXZ":"作业速率限制","ZYJLXZ":"作业记录数限制","T":"条/s","CWJLCG":"错误记录数超过","RWSB":"条,任务失败","GJ":"高级","ZYZDBXS":"作业最大并行数","G":"个","ZYZDNC":"作业最大内存","SYT":"上一条","NCBCG":"内存不超过","ZYZDBXSBCG":"作业最大并行数不超过","ZYSLBCG":"作业速率最大不超过","SRZQZYSL":"请输入正确作业速率限制","ZQSRZYJLSXZ":"请输入正确作业记录数限制","QSRZQCWJLS":"请输入正确错误记录数","SRZQQZYZDBXS":"请输入正确作业最大并行数","SRZQZYZDNC":"请输入正确作业最大内存","XZSJY":"选择来源","SJYLX":"数据源类型","LLSJ":"预览数据","LJTJPZ":"连接调节配置","QX":"取消","QBZDXX":"前表字段信息","LJTJ":"连接条件","DQBZDXX":"当前表字段信息","GNZWKF":"功能暂未开放,敬请期待","QXTXWZLJXX":"请先填写完整连接字段信息","QTXQBZDXX":"请先填写前表字段连接信息","QTXDQBZDXX":"请先填写当前表字段连接信息","ZDYS":"字段映射","YZD":"源字段","LX":"类型","MBZD":"目标字段","JYHS":"校验函数","ZHHS":"转换函数","CS":"参数","SZCS":"设置参数","CS:":"参数:","QR":"确定","YZDBNWK":"源字段不能为空","CXTJ":"查询条件","XZMD":"选择目的","JBXX":"基本信息","BSJJH":"表数据集合","RWBCCG":"任务保存成功","RWXGSC":"任务修改成功","TBYXXSJ":"同步元信息数据","XZXM":"新增项目","XMMC":"项目名称","SRXMMC":"请输入项目名称","MS":"描述","TJ":"提交","ZJZJD":"增加子节点","SCJD":"删除节点","SC":"删除","SFSC":"是否要删除该项目节点?","SCCG":"删除成功","TJCG":"添加成功","TBYXX":"同步元信息"},"mixin":{"FGFBCC":"分隔符不支持\\\\","QZQTX":"请填写正确的unicode","PLDXBCG":"批量大小不超过100000","SJYBNK":"数据源不能为空","BBK":"不能为空","LJBKBJKG":"路径不可包含空格","BMLXZC":"编码类型只支持ISO-8859-1、GB2312、GBK、UTF-8、UTF-16","CZBNRSZW":"此值不能输入中文字符","QXZWJLX":"请选择文件类型","SJKBNNQJ":"数据库不能为空","BBNWK":"表不能为空","SYMCBNWK":"索引名称不能为空","BXYZMKR":"必须以字母开头,且只支持字母、数字、(_.-#${})","STLXBNWK":"索引类型不能为空","DRFSBNWK":"写入方式不能为空","XZSJYLX":"请选择数据源类型","XZSJY":"请选择数据源","XZK":"请选择库","QXZB":"请选择表"},"navBar":{"dataManager":"数据源管理","dataSource":"数据源","templaceManagert":"模板管理","taskConfig":"任务配置","tasking":"任务作业","group":"权限组管理","help":"帮助文档","sysManagert":"系统管理","owner":"数据属主","execotor":"执行节点","user":"用户管理","executeUser":"执行用户"}}')},"6f5a8":function(e,t,a){},"6f6c":function(e,t,a){},"72c1":function(e,t,a){},7426:function(e,t,a){},7682:function(e,t,a){},"77f5":function(e,t,a){},"78a5":function(e,t,a){"use strict";var s=a("6887"),n=a("abc4"),i=window.localStorage.getItem("lang")||"zh-cn";t["a"]={mode:"vertical",theme:"dark",fesName:"Exchangis",roles:{unLogin:["/ds/newManager","/","/login","/job","/task","/help"],user:["/ds/newManager","/","/login","/ds/dataTemplate","/job","/task","/help","/group","/group/groupDetail"],admin:["/ds/newManager","/","/login","/ds/dataTemplate","/job","/task","/help","/group","/group/groupDetail","/sys/owner"],super:["/ds/newManager","/","/login","*"]},map:{status:[["1","成功"],["2","失败"]]},i18n:{locale:i,messages:{en:n,"zh-cn":s}},menu:[{title:"$i18n.navBar.dataManager",path:"/ds",subMenu:[{title:"$i18n.navBar.dataSource",path:"/ds/newManager"},{title:"$i18n.navBar.templaceManagert",path:"/ds/dataTemplate"}]},{title:"$i18n.navBar.taskConfig",path:"/job"},{title:"$i18n.navBar.tasking",path:"/task"},{title:"$i18n.navBar.group",path:"/group"},{title:"$i18n.navBar.sysManagert",path:"/sys",subMenu:[{title:"$i18n.navBar.owner",path:"/sys/owner"},{title:"$i18n.navBar.execotor",path:"/sys/executor"},{title:"$i18n.navBar.executeUser",path:"/sys/executeUser"},{title:"$i18n.navBar.user",path:"/sys/user"}]}],env:{local:{api:""},prod:{api:"/api/v1"},open:{api:"/api/v1"}}}},"81ee":function(e,t,a){},"824e":function(e,t,a){},"84b0":function(e,t,a){"use strict";a("f4fa")},"86bb":function(e,t,a){"use strict";a("fd48")},"8c77":function(e,t,a){"use strict";a("3c2b")},"91a3":function(e,t,a){},9268:function(e,t,a){"use strict";a("cb80")},9299:function(e,t,a){"use strict";var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{"text-align":"center"}},[a("span",{staticStyle:{display:"inline-block"}},[e._v("\n "+e._s(e.title)+"\n ")])])},n=[];s._withStripped=!0;var i={FesData:function(){return{title:this.$t("components.TYSJJHPTWNFW")}},methods:{}},r=i,o=a("350f"),l=Object(o["a"])(r,s,n,!1,null,null,null);l.options.__file="src/components/fesHeader.fes";var c=l.exports,u=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"layout-left-user"},[a("div",{staticClass:"language-switching"},[a("p",{on:{click:e.languageSwitching}},[e._v("\n "+e._s(e.lang)+"\n ")])]),a("div",{staticClass:"layout-left-user-name"},[a("p",[e._v(e._s(e.userName))])]),a("div",{staticClass:"layout-left-user-logout",on:{click:e.logout}},[a("Icon",{attrs:{type:"md-log-out",size:"24"}})],1)])},d=[];u._withStripped=!0;var h={FesData:function(){return{lang:"en"===localStorage.getItem("lang")?"简体中文":"English"}},computed:{userName:function(){return this.FesApp.get("FesUserName")}},methods:{languageSwitching:function(){var e=localStorage.getItem("lang");"en"===e?(this.FesApp.setLocale("zh-cn"),localStorage.setItem("lang","zh-cn")):(this.FesApp.setLocale("en"),localStorage.setItem("lang","en")),window.location.reload()},logout:function(){var e=this;this.FesApp.setRole("unLogin"),this.FesStorage.set("userLogin",!1),this.FesApp.set("FesUserName",""),this.FesApp.set("FesRoleName",""),this.FesStorage.set("currentUser",""),this.FesStorage.set("userRole",""),this.FesApi.fetch("/logout",{},"post").then((function(){console.log("[".concat(e.$t("components.TCCG"),"]"))}))["catch"]((function(){}))}}},p=h,m=(a("c4ed"),Object(o["a"])(p,u,d,!1,null,"28dca72e",null));m.options.__file="src/components/fesLeft.fes";var f=m.exports,b=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("panel",{attrs:{title:e.$t("components.DYCLQ")}},[a("div",{staticClass:"editor-content"},[a("editor",{attrs:{value:e.editorContent,"read-only":!1},on:{input:e.getValue}})],1),a("Row",{staticClass:"footer-bar"},[a("Cell",{attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.partTwoPre}},[e._v("\n "+e._s(e.$t("components.SYB"))+"\n ")])],1),a("Cell",{attrs:{span:"12"}},[a("Wb-button",{staticClass:"next-button",attrs:{type:"primary"},on:{click:e.parNextStep}},[e._v("\n "+e._s(e.$t("components.XYB"))+"\n ")])],1)],1)],1)},g=[];b._withStripped=!0;var D=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"we-editor"})},S=[];D._withStripped=!0;var v=a("8ea9");v["languages"].registerCompletionItemProvider("java",{provideCompletionItems:function(){var e=[{label:"ifelse",kind:v["languages"].CompletionItemKind.Snippet,insertText:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n"),insertTextRules:v["languages"].CompletionItemInsertTextRule.InsertAsSnippet,documentation:"If-Else Statement"}];return{suggestions:e}}});var C=v,y=a("2ef0"),w={code:{theme:"defaultView"},log:{language:"log",theme:"logview",readOnly:!0,glyphMargin:!1,selectOnLineNumbers:!1,wordWrap:"on"}},T={name:"WeEditor",props:{id:{type:String,required:!1},type:{type:String,default:"code"},theme:{type:String,default:"vs"},language:{type:String,default:"java"},value:{type:String,default:""},readOnly:Boolean,options:Object,executable:{type:Boolean,default:!0},scriptType:String,application:String,lineNumbers:"off"},data:function(){return{editor:null,editorModel:null,decorations:null,parseErrorLine:0,isParserClose:!1,sqlParser:null}},computed:{currentConfig:function(){var e=w.code,t=Object(y["merge"])({automaticLayout:!0,scrollBeyondLastLine:!1,minimap:{enabled:!1},readOnly:this.readOnly,glyphMargin:!0},e,{value:this.value,theme:this.theme,language:this.language});return t}},watch:{value:function(e,t){if(this.editor){if(e==this.getValue())return;var a=this.editor.getConfiguration().readOnly;if(a)this.editor.setValue(e);else{var s=this.editor.getModel().getFullModelRange(),n=e,i={identifier:{major:1,minor:1},range:s,text:n,forceMoveMarkers:!0};this.editor.executeEdits("insertValue",[i])}}}},mounted:function(){this.initMonaco()},methods:{initMonaco:function(){var e=this;this.editor=C.editor.create(this.$el,this.currentConfig),this.editorModel=this.editor.getModel(),this.$emit("onload"),this.editor.onDidScrollChange(Object(y["debounce"])((function(t){e.$emit("scrollChange",t)})),300),this.editor.onDidChangeModelContent(Object(y["debounce"])((function(){e.$emit("input",e.getValue())})),100)},getValue:function(){return this.editor.getValue({lineEnding:"\n",preserveBOM:!1})}}},F=T,$=(a("8c77"),Object(o["a"])(F,D,S,!1,null,"023705ca",null));$.options.__file="src/components/uiTemplate/weEditor.fes";var x=$.exports,_={components:{editor:x},props:{value:{type:String,default:""},editData:{type:null}},watch:{value:function(e){this.editorContent=e}},FesData:function(){return{editorContent:""}},methods:{partTwoPre:function(){this.$emit("preEditor",!0)},parNextStep:function(){if(!this.editorContent)return this.$Toast.warn(this.$t("components.DZCLQ"));this.$emit("parNextStep",this.editorContent)},getValue:function(e){this.editorContent=e}}},A=_,L=(a("42cd"),Object(o["a"])(A,b,g,!1,null,"3167c3cf",null));L.options.__file="src/components/jobAddEditor.fes";var N=L.exports,P=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Panel",{attrs:{title:e.$t("components.BCLL")}},[a("Wb-button",{attrs:{slot:"action"},on:{click:e.addJobVar},slot:"action"},[e._v("\n"+e._s(e.$t("message.newComponents.Taskvariables"))+"\n")]),a("Wb-form",{ref:"saveView",attrs:{rule:e.vaildateRule}},[a("Row",[a("Cell",{attrs:{span:"8",offset:"3"}},[a("Form-item",{attrs:{label:e.$t("components.RWMC"),"label-width":120,prop:"jobName"}},[a("Wb-input",{attrs:{placeholder:e.$t("components.QSRRWMC")},model:{value:e.addData.taskName,callback:function(t){e.$set(e.addData,"taskName",t)},expression:"addData.taskName"}})],1)],1),a("Cell",{attrs:{span:"8"}},[a("Form-item",{attrs:{label:e.$t("components.TXR"),"label-width":120}},[a("Wb-input",{attrs:{placeholder:e.$t("components.QSRTXR")},model:{value:e.addData.email,callback:function(t){e.$set(e.addData,"email",t)},expression:"addData.email"}})],1)],1)],1),a("Row",{staticClass:"option-margin"},[a("Cell",{attrs:{span:"8",offset:"3"}},[a("CronComponent",{model:{value:e.addData.jobCorn,callback:function(t){e.$set(e.addData,"jobCorn",t)},expression:"addData.jobCorn"}})],1),a("Cell",{attrs:{span:"8"}},[a("Form-item",{attrs:{label:e.$t("components.RWMS"),"label-width":120}},[a("Wb-input",{attrs:{placeholder:e.$t("components.SRRWMS")},model:{value:e.addData.jobDesc,callback:function(t){e.$set(e.addData,"jobDesc",t)},expression:"addData.jobDesc"}})],1)],1)],1),a("Row",{staticClass:"option-margin"},[a("Cell",{attrs:{span:"8",offset:"3"}},[a("Form-item",{attrs:{label:e.$t("components.ZXYH"),"label-width":120,prop:"executeUser",rule:[{required:!0,message:e.$t("components.XZZXYH")}]}},[a("Wb-select",{attrs:{placeholder:e.$t("components.XZZXYH")},model:{value:e.addData.execUser,callback:function(t){e.$set(e.addData,"execUser",t)},expression:"addData.execUser"}},e._l(e.executeUserList,(function(e){return a("wb-option",{key:e,attrs:{value:e}})})),1)],1)],1),a("Cell",{attrs:{span:"8"}},[a("Form-item",{attrs:{label:e.$t("components.ZXJD"),"label-width":120,prop:"executeNode"}},[a("Wb-select",{attrs:{multiple:"",placeholder:e.$t("message.newComponents.Pleaseselecttheexecutionnode")},model:{value:e.addData.execNodes,callback:function(t){e.$set(e.addData,"execNodes",t)},expression:"addData.execNodes"}},e._l(e.executeNodeList,(function(e){return a("wb-option",{key:e.id,attrs:{value:e.id,label:e.address}})})),1)],1)],1)],1),a("Row",[a("Cell",{attrs:{span:"8",offset:"3"}},[a("Form-item",{attrs:{prop:"timeOut",label:e.$t("components.CSSJ"),"label-width":120}},[a("Wb-input",{attrs:{placeholder:e.$t("components.SRCSSJ")},model:{value:e.addData.timeout,callback:function(t){e.$set(e.addData,"timeout",t)},expression:"addData.timeout"}},[a("span",{attrs:{slot:"append"},slot:"append"},[e._v("S")])])],1)],1),a("Cell",{staticClass:"stander-height",attrs:{span:"9"}},[a("Form-item",{attrs:{label:e.$t("components.TBFS"),"label-width":120}},[a("Radio-group",{on:{"on-change":e.radioChange},model:{value:e.addData.sync,callback:function(t){e.$set(e.addData,"sync",t)},expression:"addData.sync"}},[a("Radio",{attrs:{value:"FULL"}},[e._v("\n "+e._s(e.$t("components.QL"))+"\n ")]),a("Radio",{attrs:{value:"INCR",disabled:"record"===e.FesFesx.firstIsSelectRecord}},[e._v("\n "+e._s(e.$t("components.ZL"))+"\n ")])],1)],1)],1)],1),a("Row",[a("Cell",{attrs:{span:"12"}},[a("Form-item",{staticClass:"btn-wrap"},[a("Wb-button",{staticClass:"end-save-btn",attrs:{type:"primary"},on:{click:e.fivePre}},[e._v("\n "+e._s(e.$t("components.SYB"))+"\n ")])],1)],1),a("Cell",{attrs:{span:"12"}},[a("Form-item",{staticClass:"btn-wrap"},[a("Wb-button",{staticClass:"end-save-btn",attrs:{type:"primary",disabled:e.saveDisable},on:{click:e.save}},[e._v("\n "+e._s(e.$t("components.BC"))+"\n ")])],1)],1)],1)],1),a("modal",{ref:"argModal",attrs:{"footer-disable":!0,title:e.$t("message.newComponents.Taskvariables"),"close-on-click-shadow":!1,width:650}},[a("Wb-form",{ref:"varForm"},[a("Form-item",[a("Wb-button",{attrs:{icon:"plus"},on:{click:function(t){return e.sourceConfPlus()}}},[e._v("\n"+e._s(e.$t("message.newComponents.new"))+"\n")])],1),e.jobParams.length>0?e._l(e.jobParams,(function(t,s){return a("div",{key:s},[a("Row",{staticClass:"parameter-item"},[a("Cell",{attrs:{span:"7"}},[a("Form-item",{attrs:{prop:"key",rule:[{message:e.$t("message.newComponents.Fieldlengthcantmorethan")+"200",max:200},{type:"string",pattern:/^[a-zA-Z0-9_-]*$/,message:e.$t("message.newComponents.Supportonlyalphanumericunderlineandhorizontalline"),trigger:"change"}]}},[a("wb-input",{attrs:{placeholder:e.$t("message.newComponents.Pleasefilloutthe")+"key"+e.$t("message.newComponents.value")},on:{"on-blur":function(t){return e.checkHadoop("key")}},model:{value:t.key,callback:function(a){e.$set(t,"key",a)},expression:"config.key"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n key\n ")])])],1)],1),a("Cell",{attrs:{span:"1"}},[a("span",[e._v(" ")])]),a("Cell",{attrs:{span:"7"}},[a("Form-item",{attrs:{prop:"value",rule:[{message:e.$t("message.newComponents.Fieldlengthcantmorethan")+"200",max:200}]}},[a("wb-input",{attrs:{placeholder:e.$t("message.newComponents.Pleasefillinavariablesvalue")},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"config.value"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n value\n ")])])],1)],1),a("span",[e._v("  ")]),a("Cell",{staticClass:"text-dec",attrs:{span:"3"}},[a("Wb-button",{attrs:{icon:"minus"},on:{click:function(t){return e.sourceConfMinus(s)}}})],1)],1)],1)})):e._e(),a("Form-item",[a("Wb-button",{attrs:{type:"primary"},on:{click:e.jobVarConfirm}},[e._v("\n"+e._s(e.$t("message.newComponents.confirm"))+"\n")])],1)],2)],1)],1)},k=[];P._withStripped=!0;var B=a("315b"),M=a.n(B),Z=a("0bdb"),X=a.n(Z),R=a("88b4"),E=a.n(R),I=a("72b6"),J=a.n(I),W=a("7dfe"),O=a.n(W),j=a("a947"),Y=a.n(j),H=a("9af5"),Q=a.n(H),U=a("11eb"),G=a.n(U),V=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Form-item",{attrs:{label:e.$t("message.newUitemplate.timing"),"label-width":120}},[a("Wb-input",{staticClass:"cron-input",attrs:{placeholder:e.$t("components.BDS")},model:{value:e.inputCronData,callback:function(t){e.inputCronData=t},expression:"inputCronData"}}),"MIN"===e.oneSelect?a("Wb-select",{staticClass:"margin-right",staticStyle:{width:"80px"},model:{value:e.zeroSelect,callback:function(t){e.zeroSelect=t},expression:"zeroSelect"}},e._l(e.zeroList,(function(t){return a("wb-option",{key:t.value,attrs:{value:t.value}},[e._v("\n"+e._s(t.label)+"\n")])})),1):e._e(),a("Wb-select",{staticClass:"margin-right",staticStyle:{width:"80px"},on:{"on-change":e.selectOneChange},model:{value:e.oneSelect,callback:function(t){e.oneSelect=t},expression:"oneSelect"}},e._l(e.oneList,(function(t){return a("wb-option",{key:t.value,attrs:{value:t.value}},[e._v("\n"+e._s(t.label)+"\n")])})),1),e.towList.length>0?a("Wb-select",{staticClass:"margin-right",staticStyle:{width:"80px"},model:{value:e.towSelect,callback:function(t){e.towSelect=t},expression:"towSelect"}},e._l(e.towList,(function(t){return a("wb-option",{key:t.value,attrs:{value:t.value}},[e._v("\n"+e._s(t.label)+"\n")])})),1):e._e(),e.threeList.length>0?a("Wb-select",{staticClass:"margin-right",staticStyle:{width:"80px"},model:{value:e.threeSelect,callback:function(t){e.threeSelect=t},expression:"threeSelect"}},e._l(e.threeList,(function(t){return a("wb-option",{key:t.value,attrs:{value:t.value}},[e._v("\n"+e._s(t.label)+"\n")])})),1):e._e(),e.selectHourAndMinues?a("Wb-select",{staticClass:"margin-right",staticStyle:{width:"80px"},model:{value:e.fourSelect,callback:function(t){e.fourSelect=t},expression:"fourSelect"}},e._l(e.fourList,(function(t){return a("wb-option",{key:t.value,attrs:{value:t.value}},[e._v("\n"+e._s(t.label)+"\n")])})),1):e._e(),e.selectHourAndMinues?a("Wb-select",{staticClass:"margin-right",staticStyle:{width:"80px"},model:{value:e.fiveSelect,callback:function(t){e.fiveSelect=t},expression:"fiveSelect"}},e._l(e.fiveList,(function(t){return a("wb-option",{key:t.value,attrs:{value:t.value}},[e._v("\n"+e._s(t.label)+"\n")])})),1):e._e()],1)},q=[];V._withStripped=!0;var z=a("2b84"),K=a.n(z),ee={model:{prop:"cronData",event:"parent-event"},props:{cronData:{type:String,default:""}},data:function(){return{zeroSelect:0,oneSelect:"MIN",towSelect:this.$t("message.newUitemplate.minutes"),threeSelect:"",fourSelect:"",fiveSelect:"",zeroList:[],oneList:[],towList:[],threeList:[],fourList:[],fiveList:[],selectHourAndMinues:!1,inputCronData:"",TIMEDATA:{minuesList:[],hourList:[],weekList:[{value:"2",label:this.$t("message.newUitemplate.OnMonday,")},{value:"3",label:this.$t("message.newUitemplate.OnTuesday,")},{value:"4",label:this.$t("message.newUitemplate.OnWednesday,")},{value:"5",label:this.$t("message.newUitemplate.OnThursday,")},{value:"6",label:this.$t("message.newUitemplate.OnFriday,")},{value:"7",label:this.$t("message.newUitemplate.OnSaturday,")},{value:"1",label:this.$t("message.newUitemplate.OnSunday,")}],monthList:[],dayList:[],selectType:[{value:"MIN",label:this.$t("message.newUitemplate.minutes")},{value:"HOUR",label:this.$t("message.newUitemplate.Perhour")},{value:"DAY",label:this.$t("message.newUitemplate.Everyday,")},{value:"WEEK",label:this.$t("message.newUitemplate.Onceaweek")},{value:"MONTH",label:this.$t("message.newUitemplate.Amonth")},{value:"YEAR",label:this.$t("message.newUitemplate.Everyyear,")}]}}},computed:{timeToCron:function(){return"MIN"===this.oneSelect?"0 0/".concat(this.zeroSelect," * * * ?"):"HOUR"===this.oneSelect?"0 ".concat(this.towSelect," 0/1 * * ?"):"DAY"===this.oneSelect?K()(e="0 ".concat(this.fiveSelect," ")).call(e,this.fourSelect," 1/1 * ?"):"WEEK"===this.oneSelect?K()(t=K()(a="0 ".concat(this.fiveSelect," ")).call(a,this.fourSelect," ? * ")).call(t,this.towSelect):"MONTH"===this.oneSelect?K()(s=K()(n="0 ".concat(this.fiveSelect," ")).call(n,this.fourSelect," ")).call(s,this.threeSelect," * ?"):"YEAR"===this.oneSelect?K()(i=K()(r=K()(o="0 ".concat(this.fiveSelect," ")).call(o,this.fourSelect," ")).call(r,this.threeSelect," ")).call(i,this.towSelect," ? *"):"";var e,t,a,s,n,i,r,o}},watch:{timeToCron:function(e){this.inputCronData=e},inputCronData:function(e){this.$emit("parent-event",e)},cronData:function(e){this.inputCronData=e}},created:function(){for(var e=0;e<60;e++)this.TIMEDATA.minuesList.push({value:e,label:e<10?"0"+e+this.$t("message.newUitemplate.points"):String(e)+this.$t("message.newUitemplate.points")});for(var t=0;t<24;t++)this.TIMEDATA.hourList.push({value:t,label:t<10?"0"+t+this.$t("message.newUitemplate.when"):String(t)+this.$t("message.newUitemplate.when")});for(var a=1;a<=12;a++)this.TIMEDATA.monthList.push({value:a,label:a<10?"0"+a+this.$t("message.newUitemplate.month"):String(a)+this.$t("message.newUitemplate.month")});for(var s=1;s<=31;s++)this.TIMEDATA.dayList.push({value:s,label:s<10?"0"+s+this.$t("message.newUitemplate.day"):String(s)+this.$t("message.newUitemplate.day")});for(var n=[],i=0;i<60;i++)n.push({value:i,label:i<10?"".concat(this.$t("message.newUitemplate.every"),"0")+i:this.$t("message.newUitemplate.every")+String(i)});this.zeroList=n,this.oneList=this.TIMEDATA.selectType,this.fourList=this.TIMEDATA.hourList,this.fiveList=this.TIMEDATA.minuesList},methods:{selectOneChange:function(e){"MIN"===e?(this.zeroSelect=this.zeroList[0].value,this.towList=[],this.threeList=[],this.selectHourAndMinues=!1):"HOUR"===e?(this.towList=this.TIMEDATA.minuesList,this.towSelect=this.towList[0].value,this.selectHourAndMinues=!1):"DAY"===e?(this.selectHourAndMinues=!0,this.towList=[],this.threeList=[],this.fourSelect=this.fourList[0].value,this.fiveSelect=this.fiveList[0].value):"WEEK"===e?(this.selectHourAndMinues=!0,this.threeList=[],this.towList=this.TIMEDATA.weekList,this.towSelect=this.towList[0].value,this.fourSelect=this.fourList[0].value,this.fiveSelect=this.fiveList[0].value):"MONTH"===e?(this.selectHourAndMinues=!0,this.towList=[],this.threeList=this.TIMEDATA.dayList,this.threeSelect=this.threeList[0].value,this.fourSelect=this.fourList[0].value,this.fiveSelect=this.fiveList[0].value):"YEAR"===e&&(this.selectHourAndMinues=!0,this.towList=this.TIMEDATA.monthList,this.threeList=this.TIMEDATA.dayList,this.towSelect=this.towList[0].value,this.threeSelect=this.threeList[0].value,this.fourSelect=this.fourList[0].value,this.fiveSelect=this.fiveList[0].value)},setDispatch:function(e){if(e){var t=this.cronData.split(" ");t.length>=7?(this.oneSelect="YEAR",this.selectHourAndMinues=!0,this.towList=this.TIMEDATA.monthList,this.threeList=this.TIMEDATA.dayList,this.towSelect=Number(t[4]),this.threeSelect=Number(t[3]),this.fourSelect=Number(t[2]),this.fiveSelect=Number(t[1])):"*"===t[4]&&"*"!==t[3]&&"1/1"!==t[3]&&"?"!==t[3]?(this.selectHourAndMinues=!0,this.oneSelect="MONTH",this.towList=[],this.threeList=this.TIMEDATA.dayList,this.threeSelect=Number(t[3]),this.fourSelect=Number(t[2]),this.fiveSelect=Number(t[1])):"?"!==t[5]?(this.oneSelect="WEEK",this.selectHourAndMinues=!0,this.towList=this.TIMEDATA.weekList,this.threeList=[],this.towSelect=t[5],this.fourSelect=Number(t[2]),this.fiveSelect=Number(t[1])):"*"===t[4]&&"1/1"===t[3]&&"*"!==t[2]&&"0/1"!==t[2]?(this.oneSelect="DAY",this.selectHourAndMinues=!0,this.towList=[],this.threeList=[],this.fourSelect=Number(t[2]),this.fiveSelect=Number(t[1])):"*"===t[4]&&"*"===t[3]&&"0/1"===t[2]?(this.oneSelect="HOUR",this.towList=this.TIMEDATA.minuesList,this.towSelect=Number(t[1])):"*"===t[4]&&"*"===t[3]&&"*"===t[2]&&(this.zeroSelect=Number(t[1].substring(2)),this.oneSelect="MIN",this.threeList=[],this.selectHourAndMinues=!1)}}}},te=ee,ae=(a("cd9c"),Object(o["a"])(te,V,q,!1,null,null,null));ae.options.__file="src/components/uiTemplate/corn.fes";var se=ae.exports,ne={props:{editData:{type:null},saveDisable:{type:Boolean,default:!1}},components:{CronComponent:se},FesData:function(){return{addData:{email:"",taskName:"",jobCorn:"",jobDesc:"",sync:"FULL",execUser:"",execNodes:[],timeout:"43200",jobParams:{}},executeUserList:[],executeNodeList:[],timeoutIsError:!1,timeoutErroeText:"",jobParams:[],vaildateRule:{jobName:[{required:!0,message:this.$t("components.TXRWM")}],executeNode:[{required:!0,message:this.$t("message.newComponents.Pleaseselecttheexecutionnode")}],vldNum:[{required:!0,message:this.$t("message.newComponents.Pleaseenterthechecknumber")},{type:"string",pattern:/^[a-z0-9]*$/,message:this.$t("message.newComponents.SupportonlylettersandNumbers"),trigger:"change"}],vldType:[{required:!0,message:this.$t("message.newComponents.Pleaseselectacalibrationtype")}],timeOut:[{message:this.$t("components.DXBNCG"),max:5},{type:"string",pattern:/^[0-9]*$/,message:this.$t("components.ZZCSZ"),trigger:"change"}]}}},FesReady:function(){var e,t=this;this.editData&&(this.addData.taskName=this.editData.jobName,this.addData.email=this.editData.alarmUser,this.addData.jobCorn=this.editData.jobCorn,this.addData.jobDesc=this.editData.jobDesc,this.addData.sync=this.editData.sync||"FULL",this.addData.execUser=this.editData.execUser||"",this.addData.timeout=String(this.editData.timeout)||"",this.editData.jobParams&&G()(this.editData.jobParams).length>0&&(this.jobParams=[],Q()(e=G()(this.editData.jobParams)).call(e,(function(e,a){t.jobParams.push({key:e,value:t.editData.jobParams[e],icon:"minus"})}))))},watch:{"FesFesx.firstIsSelectRecord":function(e){"record"===e&&(this.addData.sync="FULL")},executeNodeList:function(e){if(this.editData&&this.editData.execNodes){var t,a=Y()(t=this.editData.execNodes).call(t,(function(t){var a;return O()(a=J()(e).call(e,(function(e){return e.id}))).call(a,t)}));this.addData.execNodes=a?this.editData.execNodes:[]}}},methods:{getUserAndNodeList:function(){var e=this,t=this.FesFesx.enginSelect;E.a.all([this.FesApi.fetch("/exec/user/list","get"),this.FesApi.fetch("/exec/node/list/".concat(t),"get")]).then((function(t){e.executeUserList=t[0],e.executeNodeList=t[1],e.editData||(e.addData.execUser=e.FesApp.get("FesUserName"))}))},save:function(){var e=this;this.$refs.saveView.validate((function(t){t&&e.$emit("save",e.addData)}))},fivePre:function(){this.$emit("fivePre",!0)},radioChange:function(e){},addJobVar:function(){this.$refs.argModal.show()},sourceConfPlus:function(){this.jobParams.push({key:"",value:"",icon:"minus"})},sourceConfMinus:function(e){var t;X()(t=this.jobParams).call(t,e,1)},checkHadoop:function(e){var t,a=[];if(Q()(t=this.jobParams).call(t,(function(t){a.push(t[e])})),this.checkHadoopRegex(a))return this.$Toast.error(this.$t("message.newComponents.Taskvariablesexistduplicatekey/valuepair")),!0},checkHadoopRegex:function(e){for(var t=M()(e).call(e),a=0;a32768&&s(new Error("".concat(e.$t("components.NCBCG"),"32G"))),a<64&&s(new Error("".concat(e.$t("message.newComponents.Notlessthanminimummemory"),"64M"))),s()},a=function(t,a,s){a>999&&s(new Error("".concat(e.$t("components.ZYZDBXSBCG"),"999"))),s()},s=function(t,a,s){a>102400&&s(new Error("".concat(e.$t("components.ZYSLBCG"),"100G"))),s()};return{speed:{mBytes:"10",record:"10000"},errorLimit:{record:"1"},numVPattern:new RegExp(/[^0-9]+/),ruleValidate:{speedLimit:[{required:!0,message:this.$t("components.SRZQZYSL")},{validator:s,trigger:"blur"}],jobLimit:[{required:!0,message:this.$t("components.ZQSRZYJLSXZ")}],errorLimit:[{required:!0,message:this.$t("components.QSRZQCWJLS")}],mParallel:[{required:!1,message:this.$t("components.SRZQQZYZDBXS")},{validator:a,trigger:"blur"}],mMemory:[{required:!1,message:this.$t("components.SRZQZYZDNC")},{validator:t,trigger:"blur"}]},advance:{advanceOption:!1,mParallel:null,mMemory:null}}},computed:{isShowErrorLimit:function(){return"hive"===this.FesFesx.FirstCurrentDataSourceType&&"hive"===this.FesFesx.secondCurrentDataSourceType}},FesReady:function(){""!=this.editData&&(this.speed.mBytes=this.editData.config.speed.mBytes,this.speed.record=this.editData.config.speed.record,this.errorLimit.record=this.editData.config.errorLimit.record,this.advance.advanceOption=this.editData.config.advance.advanceOption,this.advance.mParallel=this.editData.config.advance.mParallel||null,this.advance.mMemory=this.editData.config.advance.mMemory||null)},methods:{mBytes_v:function(){this.numVPattern.test(this.speed.mBytes)&&(this.speed.mBytes="")},record_v:function(){this.numVPattern.test(this.speed.record)&&(this.speed.record="")},errorRecord_v:function(){this.numVPattern.test(this.errorLimit.record)&&(this.errorLimit.record="")},mParallelCheck:function(){},mMemoryCheck:function(){},partFourPre:function(){this.$emit("fourPre",!0)},partFourNext:function(){var e=this;this.$refs.speedControl.validate((function(t){t&&("stream"===e.FesFesx.firstIsSelectRecord&&(e.speed.record="",e.errorLimit.record=""),e.$emit("fourNext",e.speed,e.errorLimit,e.advance))}))},clear:function(){this.speed.mBytes="",this.speed.record="",this.errorLimit.record=""}}},de=ue,he=(a("3a23"),Object(o["a"])(de,le,ce,!1,null,"4645eaf4",null));he.options.__file="src/components/jobAddStepFour.fes";var pe=he.exports,me=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Panel",{attrs:{title:e.$t("components.XZSJY")}},[a("Wb-form",{ref:"DataSource",attrs:{rule:e.ruleValidate}},[a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("components.SJYLX"),"label-width":120}},[a("Wb-select",{on:{"on-change":e.typeChange},model:{value:e.addData.type,callback:function(t){e.$set(e.addData,"type",t)},expression:"addData.type"}},e._l(e.dataSourceTypeList,(function(e){return a("wb-option",{key:e,attrs:{value:e}})})),1)],1)],1)],1),"hive"===e.addData.type||""===e.addData.type?[a("hiveOne",{attrs:{"add-data":e.addData,"source-origin":e.sourceOrigin,"db-data-list":e.dbDataList,"table-list":e.tableList,"part-val":e.partVal,ds_loading:e.ds_loading,db_loading:e.db_loading,table_loading:e.table_loading,part_loading:e.part_loading,"is-one-step":!0},on:{sourceChange:e.sourceChange,dbSeleted:e.dbSeleted,tableValueChange:e.tableValueChange,partValueSelect:e.partValueSelect,partCustom:e.partCustom,partCustomClear:e.partCustomClear}})]:e._e(),"local_fs"===e.addData.type?[a("localFsOne",{attrs:{"local-fs-data":e.localFsData},on:{localFsData:e.localFsDataAction}})]:e._e(),"hdfs"===e.addData.type?[a("hdfsOne",{attrs:{"step-one-data":e.hdfsData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading},on:{stepOneData:e.hdfsDataAction}})]:e._e(),"sftp"===e.addData.type?[a("sftpOne",{attrs:{"step-one-data":e.sftpData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading},on:{stepOneData:e.sftpDataAction}})]:e._e(),"mysql"===e.addData.type?[a("mysql",{attrs:{"step-one-data":e.tdsqlData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading,"db-data-list":e.tdsqlValue.dbs,"table-list":e.tdsqlValue.tables,ds_loading:e.ds_loading,db_loading:e.db_loading,table_loading:e.table_loading},on:{stepOneData:e.tdsqlDataAction,sourceChange:e.tdsqlSourceChange,dbSeleted:e.tdsqlDbSeleted,tableValueChange:e.tdsqlTableValueChange,addTable:e.addTable,deleteTable:e.deleteTable,linkCoditionClick:e.linkCoditionClick}})]:e._e(),"oracle"===e.addData.type?[a("oracle",{attrs:{"step-one-data":e.oracleData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading,"db-data-list":e.oracleValue.dbs,"table-list":e.oracleValue.tables,ds_loading:e.ds_loading,db_loading:e.db_loading,table_loading:e.table_loading},on:{stepOneData:e.tdsqlDataAction,sourceChange:e.oracleSourceChange,dbSeleted:e.oracleDbSeleted}})]:e._e(),a("Form-item",[a("Row",[a("Cell",{attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.preview}},[e._v("\n "+e._s(e.$t("components.SYB"))+"\n ")])],1),a("Cell",{attrs:{span:"12"}},[a("Wb-button",{staticClass:"next-button",attrs:{type:"primary",disabled:e.nextStepButtonDisable},on:{click:e.parNextStep}},[e._v("\n "+e._s(e.$t("components.XYB"))+"\n ")])],1)],1)],1)],2),a("weModal",{attrs:{title:e.$t("components.LJTJPZ"),width:"800","close-text":e.$t("components.QX")},on:{onConfirm:e.addLinkConfirm,onClose:e.addLinkClose},model:{value:e.linkCoditionShow,callback:function(t){e.linkCoditionShow=t},expression:"linkCoditionShow"}},[a("Wb-form",[a("Form-item",[a("Row",{staticClass:"text-center"},[a("Cell",{attrs:{span:"7"}},[e._v("\n "+e._s(e.$t("components.QBZDXX"))+"\n ")]),a("Cell",{attrs:{span:"1"}},[a("span",[e._v(" ")])]),a("Cell",{attrs:{span:"3"}},[e._v("\n "+e._s(e.$t("components.LJTJ"))+"\n ")]),a("Cell",{attrs:{span:"1"}},[a("span",[e._v(" ")])]),a("Cell",{attrs:{span:"7"}},[e._v("\n "+e._s(e.$t("components.DQBZDXX"))+"\n ")])],1)],1),e._l(e.currentLink,(function(t,s){return[a("Form-item",{key:s},[a("Row",{staticClass:"text-center"},[a("Cell",{attrs:{span:"7"}},[a("Wb-select",{attrs:{width:"70%"},model:{value:t.left,callback:function(a){e.$set(t,"left",a)},expression:"item.left"}},e._l(e.column.preValue,(function(e,t){return a("wb-option",{key:t,attrs:{lable:e.name,value:e.name}})})),1)],1),a("Cell",{attrs:{span:"1"}},[a("span",[e._v(" ")])]),a("Cell",{attrs:{span:"3"}},[a("Wb-select",{attrs:{width:"70%"},model:{value:t.condition,callback:function(a){e.$set(t,"condition",a)},expression:"item.condition"}},[a("wb-option",{attrs:{lable:"=",value:"="}})],1)],1),a("Cell",{attrs:{span:"1"}},[a("span",[e._v(" ")])]),a("Cell",{attrs:{span:"7"}},[a("Wb-select",{attrs:{width:"70%"},model:{value:t.right,callback:function(a){e.$set(t,"right",a)},expression:"item.right"}},e._l(e.column.currentValue,(function(e,t){return a("wb-option",{key:t,attrs:{lable:e.name,value:e.name}})})),1)],1),a("Cell",{staticClass:"text-dec",attrs:{span:"4"}},[0===s?a("Wb-button",{attrs:{icon:"plus"},on:{click:e.addCodition}}):e._e(),0!==s||e.currentLink.length>1?a("Wb-button",{attrs:{icon:"minus"},on:{click:function(t){return e.minusCodition(s)}}}):e._e()],1)],1)],1)]})),a("Form-item",[a("Row",[a("Cell",{attrs:{span:"24"}})],1)],1)],2)],1)],1)},fe=[];me._withStripped=!0;var be=a("97b4"),ge=a.n(be),De=a("ad13"),Se=a.n(De),ve=a("3608"),Ce=a.n(ve),ye=a("e12c"),we=a.n(ye),Te=a("a38a"),Fe=a.n(Te),$e=a("95a3"),xe=a.n($e),_e=a("ac15"),Ae=a.n(_e),Le=a("8d18"),Ne=a.n(Le),Pe=a("2e36"),ke=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.LJ"),prop:"path","label-width":120}},[a("wb-input",{attrs:{placeholder:e.$t("uiTemplate.SRLJ")},model:{value:e.subData.path,callback:function(t){e.$set(e.subData,"path",t)},expression:"subData.path"}})],1)],1),"record"===e.subData.transfer?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.YSLX"),"label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.XZYSLX")},model:{value:e.subData.compress,callback:function(t){e.$set(e.subData,"compress",t)},expression:"subData.compress"}},e._l(e.localFsCompressList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),1)],1)],1):e._e(),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.BM"),prop:"encoding","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.QXZBM")},model:{value:e.subData.encoding,callback:function(t){e.$set(e.subData,"encoding",t)},expression:"subData.encoding"}},e._l(e.encodingList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),1)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.CSGS"),prop:"transfer","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.QXZCSFS")},on:{"on-change":e.transferchange},model:{value:e.subData.transfer,callback:function(t){e.$set(e.subData,"transfer",t)},expression:"subData.transfer"}},[a("wb-option",{attrs:{value:"stream",label:e.$t("uiTemplate.EJZ")}}),a("wb-option",{attrs:{value:"record",label:e.$t("uiTemplate.JL")}})],1)],1)],1),e.skipHeaderShow?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.TGSH"),"label-width":120}},[a("Checkbox",{model:{value:e.subData.skipHeader,callback:function(t){e.$set(e.subData,"skipHeader",t)},expression:"subData.skipHeader"}})],1)],1):e._e(),"record"===e.subData.transfer?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.ZDFGF"),prop:"fieldDelimiter","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-search":e.search},model:{value:e.subData.fieldDelimiter,callback:function(t){e.$set(e.subData,"fieldDelimiter",t)},expression:"subData.fieldDelimiter"}},e._l(e.options,(function(t){return a("Wb-option",{key:t.label,attrs:{value:t.value}},[e._v("\n "+e._s(t.label)+"\n ")])})),1)],1)],1):e._e()],1)},Be=[];ke._withStripped=!0;var Me=a("43cf"),Ze=a.n(Me),Xe=a("d16c"),Re=a.n(Xe),Ee=a("dace"),Ie=a.n(Ee),Je=a("81c0"),We=a.n(Je),Oe={data:function(){return{options:[{label:",",value:","},{label:";",value:","},{label:"\\u0001",value:"\\u0001"}]}},created:function(){var e=this;if(this.subData.fieldDelimiter){var t;if(Y()(t=this.options).call(t,(function(t){return t.value===e.subData.fieldDelimiter})))return;this.options.push({label:this.subData.fieldDelimiter,value:this.subData.fieldDelimiter})}},methods:{search:function(e){e?(this.options=[{label:e,value:e}],this.subData.fieldDelimiter=e):(this.options=[{label:",",value:","},{label:";",value:","},{label:"\\u0001",value:"\\u0001"}],this.subData.fieldDelimiter="")},deUnicode:function(e){var t=e.split("\\u");We()(e).call(e,"\\u")&&(t=Ie()(t).call(t,1,t.length)),Re()(e).call(e,"\\u")&&(t=Ie()(t).call(t,0,t.length-1));for(var a="",s=0;s=26?(t=getTableName(e/26-1),t+=String.fromCharCode(65+e%26)):t+=String.fromCharCode(65+e),t})),linkCoditionClick:function(e){this.$emit("linkCoditionClick",e)}}},gt=bt,Dt=(a("84b0"),Object(o["a"])(gt,ht,pt,!1,null,"52da4597",null));Dt.options.__file="src/components/uiTemplate/tdsqlOne.fes";var St=Dt.exports,vt=a("532c"),Ct=a("513b"),yt=a.n(Ct),wt=a("2478"),Tt={data:function(){var e=this,t=function(t,a,s){var n=/^\\$/,i=/^\\u/;n.test(a)?s(new Error(e.$t("mixin.FGFBCC"))):i.test(a)&&4!=a.split("\\u")[1].length?s(new Error(e.$t("mixin.QZQTX"))):s()},a=function(t,a,s){a>1e5?s(new Error(e.$t("mixin.PLDXBCG"))):s()};return{partVal:[{name:"",value:"",partitions:{}}],sourceShow:!0,addData:{type:"",dataSourceValue:"",dataSourceId:"",db:"",table:"",DBData:"",partitions:"",partValueList:"",transfer:"record"},part_loading:!1,ds_loading:!1,db_loading:!1,table_loading:!1,sourceOrigin:[],dbDataList:[],tableList:[],partKey:"",partValCache:{},nextStepButtonDisable:!1,ruleValidate:{source:[{required:!0,message:this.$t("mixin.SJYBNK")}],path:[{required:!0,message:"path".concat(this.$t("mixin.BBK"))},{type:"string",pattern:/^[^ ]+$/,message:this.$t("mixin.LJBKBJKG"),trigger:"blur"}],encoding:[{type:"string",pattern:/^(ISO-8859-1|GB2312|GBK|UTF-8|UTF-16)$/,message:this.$t("mixin.BMLXZC"),trigger:"change"}],fieldDelimiter:[{validator:t,trigger:"change"},{type:"string",pattern:/^[^\u4e00-\u9fa5!……、,。’;()¥]+$/,message:this.$t("mixin.CZBNRSZW"),trigger:"change"}],transfer:[{required:!0,message:"transfer".concat(this.$t("mixin.BBK"))}],fielType:[{required:!0,message:this.$t("mixin.QXZWJLX")}],database:[{required:!0,message:this.$t("mixin.SJKBNNQJ")}],tableTow:[{required:!0,message:this.$t("mixin.BBNWK")}],indexName:[{required:!0,message:this.$t("mixin.SYMCBNWK")},{type:"string",pattern:/^[a-zA-Z][a-zA-Z0-9#${}_.-]*$/,message:this.$t("mixin.BXYZMKR"),trigger:"change"}],indexType:[{required:!0,message:this.$t("mixin.STLXBNWK")}],writeMode:[{required:!0,message:this.$t("mixin.DRFSBNWK")}],batchSize:[{validator:a}]}}},methods:{getSourceDataList:function(e){var t=this;""!=e&&(this.ds_loading=!0,this.FesApi.fetch("/datasource/selectAll",{sourceType:e,projectIds:this.treeId},"get").then((function(e){t.ds_loading=!1,t.sourceOrigin=J()(e).call(e,(function(e){return{id:e.id,sourceName:e.sourceName}}))}))["catch"]((function(){return t.ds_loading=!1})))},sourceChange:function(e){var t=this;if(this.addData.DBData="",this.addData.table="",this.dbDataList=[],this.tableList=[],this.partKey=[],this.partVal=[{name:"",value:"",partitions:{}}],""==e)return!1;this.db_loading=!0,this.FesApi.fetch("/datasource/meta/hive/"+e+"/dbs",{},{method:"get",timeout:"60000"}).then((function(e){t.db_loading=!1,t.dbDataList="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.db_loading=!1}))},dbSeleted:function(e){var t=this;this.addData.table="",this.tableList=[],this.partKey="",this.partVal=[{name:"",value:"",partitions:{}}],""!=e&&(this.table_loading=!0,this.FesApi.fetch("/datasource/meta/hive/"+this.addData.dataSourceId+"/"+e+"/tables",{},{method:"get",timeout:"60000"}).then((function(e){t.table_loading=!1,t.tableList="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.table_loading=!1})),this.addData.db=e)},tableValueChangeAction:function(e,t){var a=this;this.addData.table=e,this.partKey="",this.partVal=[{name:"",value:"",partitions:{}}],""!=e&&(this.part_loading=!0,this.FesApi.fetch("/datasource/meta/hive/"+this.addData.dataSourceId+"/"+this.addData.db+"/"+e+"/partitions",{},{method:"get",timeout:"60000"}).then((function(s){a.part_loading=!1;var n=s.root;if("undefined"!==typeof n.name?(a.timeTemplate(n),a.partVal=[n]):s.partKeys.length>0&&(n={name:s.partKeys[0],value:"",partitions:{}},a.timeTemplate(n),a.partVal=[n]),""!==a.editData&&a.editData.config[t].partitions&&""!==a.editData.config[t].partitions&&e===a.editData.config[t].table){var i=a.editData.config[t].partitions.split(",")[0];""===yt()(e).call(e)||n.partitions[i]||(n.custom=i,a.partCustom(n)),n.value=i}a.partValCache=s}))["catch"]((function(){return a.part_loading=!1}))),""!==this.addData.dataSourceId&&""!==this.addData.db&&""!==e&&this.FesApi.fetch("/datasource/meta/hive/"+this.addData.dataSourceId+"/"+this.addData.db+"/"+e+"/fields",{},{method:"get",timeout:"60000"}).then((function(e){a.addData.partValueList=e,a.nextStepButtonDisable=!1}))["catch"]((function(){a.nextStepButtonDisable=!0}))},partValueSelectAction:function(e,t,a,s){var n,i=X()(n=this.partVal).call(n,e+1);if(i.length>0)for(var r in i)"object"===Object(vt["a"])(i[r])&&(i[r].value="");if(""!==t){var o=a[t];if("undefined"!==typeof o&&"undefined"!==typeof o.name?(this.timeTemplate(o),this.partVal.push(o)):"undefined"!==typeof o&&e+10){var a=[];for(var s in this.partVal){var n=this.partVal[s].value;"undefined"!==typeof n&&""!==n&&a.push(n)}a.length>0&&(this.addData.partitions=a.join(","))}this.$refs.DataSource.validate((function(t){t&&e.$emit("nextStep",e.addData)}))}else this.$refs.DataSource.validate((function(t){t?e.addData.type===wt["b"].MYSQL&&e.tdsqlData.table<=0?e.tdsqlData.errorShow=!0:e.$emit("nextStep",e[e.typeTransitionDataName(e.addData.type)]):e.addData.type===wt["b"].MYSQL&&e.tdsqlData.table<=0&&(e.tdsqlData.errorShow=!0)}))},localFsDataAction:function(e){this.localFsData=e},hdfsDataAction:function(e){this.hdfsData=e},sftpDataAction:function(e){this.sftpData=e},tdsqlDataAction:function(e){this.tdsqlData=e},timeTemplate:function(e){e.partitions["${yyyyMMdd}"]={},e.partitions["${yyyy-MM-dd}"]={},e.partitions["${run_date-1}"]={},e.partitions["${run_date-7}"]={},e.partitions["${run_month_begin-1}"]={},e.partitions["${run_month_end-1}"]={},e.partitions["${run_date}"]={}},typeTransitionDataName:function(e){switch(e){case wt["b"].HIVE:return"addData";case wt["b"].HDFS:return"hdfsData";case wt["b"].SFTP:return"sftpData";case wt["b"].MYSQL:return"tdsqlData";case wt["b"].ELASTICSEARCH:return"elasticSearchData";case wt["b"].LOCAL_FS:return"localFsData";case wt["b"].ORACLE:return"oracleData";default:break}},changeDataSourceId:function(e,t,a){if(e)for(var s in t)if(this.editData[a]===t[s].id)return void(this[e].dataSourceId=this.editData[a])}}},Ft=a("58df"),xt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.SJY"),prop:"source","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.sourceChange},model:{value:e.subData.dataSourceId,callback:function(t){e.$set(e.subData,"dataSourceId",t)},expression:"subData.dataSourceId"}},[e._l(e.sourceOrigin,(function(e,t){return a("wb-option",{key:t,attrs:{value:e.id,label:e.sourceName}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.ds_loading,expression:"ds_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.KM"),prop:"database","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.dbSeleted},model:{value:e.subData.DBData,callback:function(t){e.$set(e.subData,"DBData",t)},expression:"subData.DBData"}},[e._l(e.dbDataList,(function(e,t){return a("wb-option",{key:t,attrs:{value:e}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.db_loading,expression:"db_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.TABLENAMW"),prop:"tableTow","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.tableValueChange},model:{value:e.subData.table,callback:function(t){e.$set(e.subData,"table",t)},expression:"subData.table"}},[e._l(e.tableList,(function(e,t){return a("wb-option",{key:t,attrs:{value:e}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.table_loading,expression:"table_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.TJ"),prop:"where","label-width":120}},[a("wb-input",{attrs:{placeholder:e.$t("uiTemplate.QSR")},model:{value:e.subData.where,callback:function(t){e.$set(e.subData,"where",t)},expression:"subData.where"}})],1)],1)],1)},_t=[];xt._withStripped=!0;var At={name:"tdsqlSecond",props:{stepOneData:{tepy:Object,default:{}},sourceOrigin:{tepy:Array,default:[]},dbDataList:{type:Array,default:[]},tableList:{type:Array,default:[]},ds_loading:{type:Boolean,default:!1},db_loading:{type:Boolean,default:!1},table_loading:{type:Boolean,default:!1}},data:function(){return{subData:this.stepOneData,showSelect:!1,optionIndex:"",alias:[],tableNameContact:{}}},watch:{subData:{handler:function(e){this.$emit("stepOneData",e)},deep:!0},"subData.table":function(e,t){}},computed:{writeModeList:function(){return"SQOOP"===this.FesFesx.enginSelect?["updateonly","allowinsert"]:["insert","replace","update"]}},methods:{sourceChange:function(e){this.$emit("sourceChange",e)},dbSeleted:function(e){this.$emit("dbSeleted",e)},tableValueChange:function(e){this.$emit("tableValueChange",e)}}},Lt=At,Nt=(a("932c"),Object(o["a"])(Lt,xt,_t,!1,null,"e18105f6",null));Nt.options.__file="src/components/uiTemplate/oracleOne.fes";var Pt=Nt.exports;function kt(e,t){var a=G()(e);if(Fe.a){var s=Fe()(e);t&&(s=Ae()(s).call(s,(function(t){return we()(e,t).enumerable}))),a.push.apply(a,s)}return a}function Bt(e){for(var t=1;t0&&""!==this.editData&&this.changeDataSourceId(this.typeTransitionDataName(this.editData.dataSrcType),e,"dataSrcId")},dbDataList:function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataSrcParams.database)&&(this.addData.DBData=this.editData.config.dataSrcParams.database)},tableList:function(e){e.length>0&&this.editData.config&&""!==this.editData.config.dataSrcParams.table&&O()(e).call(e,this.editData.config.dataSrcParams.table)&&(this.addData.table=this.editData.config.dataSrcParams.table)},"tdsqlValue.dbs":function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataSrcParams.database)&&(this.tdsqlData.DBData=this.editData.config.dataSrcParams.database)},"tdsqlValue.tables":function(e){var t=this;if(e.length>0&&""!==this.editData){var a,s=!0;if(J()(a=this.editData.config.dataSrcParams.table).call(a,(function(t){O()(e).call(e,t)||(s=!1)})),s){var n;this.tdsqlData.table=this.editData.config.dataSrcParams.table,this.tdsqlData.join=this.editData.config.dataSrcParams.join;var i=J()(n=this.tdsqlData.table).call(n,(function(e){return t.FesApi.fetch("/datasource/meta/mysql/"+t.tdsqlData.dataSourceId+"/"+t.tdsqlData.DBData+"/"+e+"/fields",{},{method:"get",timeout:"60000"})}));E.a.all(i).then((function(e){t.column.preValue=e[i.length-2],t.column.currentValue=e[i.length-1]}))["catch"]((function(){}))}else this.tdsqlData.table=[],this.tdsqlData.join=[]}},"column.preValue":function(e){!this.currentLink[0].left&&e&&(this.currentLink[0].left=e[0].name)},"column.currentValue":function(e){this.currentLink[0].right||(this.currentLink[0].right=e[0].name)},"oracleValue.dbs":function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataSrcParams.database)&&(this.oracleData.DBData=this.editData.config.dataSrcParams.database)},"oracleValue.tables":function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataSrcParams.table)&&(this.oracleData.table=this.editData.config.dataSrcParams.table)}},FesReady:function(){this.editData?this.editorAction(this.editData):(this.addData.type=wt["b"].HIVE,this.FesFesx.set("firstIsSelectRecord","record"))},methods:{typeChange:function(e){this.FesFesx.set("FirstCurrentDataSourceType",e),this.nextStepButtonDisable=!1,this.addData.dataSourceValue="",this.addData.dataSourceId="",this.addData.DBData="",this.addData.table="",this.sourceOrigin=[],this.dbDataList=[],this.tableList=[],this.partKey="",this.partVal=[{name:"",value:"",partitions:{}}],e===wt["b"].HIVE?(this.FesFesx.set("firstIsSelectRecord",this.addData.transfer),this.getSourceDataList(e)):e===wt["b"].LOCAL_FS?this.localFsData.type=e:e===wt["b"].SFTP?(this.sftpData.type=e,this.getSourceDataList(e)):e===wt["b"].MYSQL?(this.FesFesx.set("firstIsSelectRecord",wt["c"].RECORD),this.tdsqlData.type=e,this.getSourceDataList(e)):e===wt["b"].HDFS?(this.hdfsData.type=e,this.getSourceDataList(e)):e===wt["b"].ORACLE&&(this.FesFesx.set("firstIsSelectRecord",wt["c"].RECORD),this.oracleData.type=e,this.getSourceDataList(e))},editorAction:function(e){e&&(this.FesFesx.set("FirstCurrentDataSourceType",e.config.dataSrcParams.type),this.FesFesx.set("firstIsSelectRecord",e.config.transportType),this.addData.type=e.config.dataSrcParams.type,e.config.dataSrcParams.type===wt["b"].LOCAL_FS?(this.localFsData=Bt({},e.config.dataSrcParams),this.localFsData.transfer=e.config.transportType):e.config.dataSrcParams.type===wt["b"].HDFS?(this.hdfsData=Bt({},e.config.dataSrcParams),this.hdfsData.transfer=e.config.transportType):e.config.dataSrcParams.type===wt["b"].SFTP?(this.sftpData=Bt({},e.config.dataSrcParams),this.sftpData.transfer=e.config.transportType):e.config.dataSrcParams.type===wt["b"].HIVE?this.addData.transfer=e.config.transportType:e.config.dataSrcParams.type===wt["b"].MYSQL?this.tdsqlData=Bt({},e.config.dataSrcParams):e.config.dataSrcParams.type===wt["b"].ORACLE&&(this.oracleData=Bt({},e.config.dataSrcParams)))},tableValueChange:function(e){this.tableValueChangeAction(e,"dataSrcParams")},partValueSelect:function(e){var t=e.index,a=e.value,s=e.partitions;this.partValueSelectAction(t,a,s,"dataSrcParams")},preview:function(){this.$emit("preStep")},addTable:function(e){var t=this;if(""!==this.tdsqlData.dataSourceId&&""!==this.tdsqlData.DBData&&this.tdsqlData.table.length>1){var a,s=J()(a=this.tdsqlData.table).call(a,(function(e){return t.FesApi.fetch("/datasource/meta/mysql/"+t.tdsqlData.dataSourceId+"/"+t.tdsqlData.DBData+"/"+e+"/fields",{},{method:"get",timeout:"60000"})}));E.a.all(s).then((function(e){t.column.preValue=e[s.length-2],t.column.currentValue=e[s.length-1],Ne()(t.tdsqlData.table)&&t.tdsqlData.table.length>1&&(t.linkCoditionShow=!0,t.linkTableIndex=t.tdsqlData.join.length,t.initCurrentLinkCodition())}))["catch"]((function(){}))}},deleteTable:function(){var e,t=this;this.tdsqlData.table.length<2?this.tdsqlData.join=[]:this.tdsqlData.join=Ae()(e=this.tdsqlData.join).call(e,(function(e,a){return a<=t.tdsqlData.table.length-2}))},tdsqlTableValueChange:function(e){},tdsqlSourceChange:function(e){var t=this;if(this.tdsqlData.DBData="",this.tdsqlData.table=[],this.tdsqlValue.dbs=[],this.tdsqlValue.tables=[],this.tdsqlData.join=[],""==e)return!1;this.db_loading=!0,this.FesApi.fetch("/datasource/meta/mysql/"+e+"/dbs",{},{method:"get",timeout:"60000"}).then((function(e){t.db_loading=!1,t.tdsqlValue.dbs="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.db_loading=!1}))},tdsqlDbSeleted:function(e){var t=this;this.tdsqlData.table=[],this.tdsqlValue.tables=[],this.tdsqlData.join=[],""!=e&&(this.table_loading=!0,this.FesApi.fetch("/datasource/meta/mysql/"+this.tdsqlData.dataSourceId+"/"+e+"/tables",{},{method:"get",timeout:"60000"}).then((function(e){t.table_loading=!1,t.tdsqlValue.tables="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.table_loading=!1})))},oracleSourceChange:function(e){var t=this;if(this.oracleValue.dbs=[],this.oracleValue.tables=[],""===e)return!1;this.FesApi.fetch("/datasource/meta/oracle/"+e+"/dbs",{},{method:"get",timeout:"60000"}).then((function(e){t.db_loading=!1,t.oracleValue.dbs="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.db_loading=!1}))},oracleDbSeleted:function(e){var t=this;this.oracleValue.tables=[],""!=e&&(this.table_loading=!0,this.FesApi.fetch("/datasource/meta/oracle/"+this.oracleData.dataSourceId+"/"+e+"/tables",{},{method:"get",timeout:"60000"}).then((function(e){t.table_loading=!1,t.oracleValue.tables="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.table_loading=!1})))},addCodition:function(){var e=this,t=function(){e.currentLink.push({left:"",right:"",condition:"="})};this.linkCoditionCheck(t)},minusCodition:function(e){var t;this.currentLink=Ae()(t=this.currentLink).call(t,(function(t,a){return a!==e}))},addLinkConfirm:function(){var e=this;this.linkCoditionShow=!0;var t=function(){e.linkCoditionShow=!1,e.tdsqlData.join[e.linkTableIndex]?e.tdsqlData.join[e.linkTableIndex]=e.currentLink:e.tdsqlData.join.push(e.currentLink)};this.linkCoditionCheck(t)},addLinkClose:function(){this.tdsqlData.join[this.linkTableIndex]||this.tdsqlData.table.pop()},initCurrentLinkCodition:function(){this.currentLink=[{left:"",right:"",condition:"="}]},linkCoditionClick:function(e){this.linkTableIndex=e,this.currentLink=JSON.parse(xe()(this.tdsqlData.join[e])),this.linkCoditionShow=!0},linkCoditionCheck:function(e){var t=this.currentLink[this.currentLink.length-1];return t.left||t.right?!t.left&&t.right?this.$Toast(this.$t("components.QTXQBZDXX")):t.left&&!t.right?this.$Toast(this.$t("components.QTXDQBZDXX")):void(t.left&&t.right&&e()):this.$Toast(this.$t("components.QXTXWZLJXX"))}}},Zt=Mt,Xt=(a("2373"),Object(o["a"])(Zt,me,fe,!1,null,"59342238",null));Xt.options.__file="src/components/jobAddStepOne.fes";var Rt=Xt.exports,Et=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Panel",{attrs:{title:e.$t("components.ZDYS")}},[e.isHandleAdd?a("Wb-button",{attrs:{type:"primary"},on:{click:e.addItem}},[e._v("\n "+e._s(e.$t("message.newComponents.Thenewfield"))+"\n ")]):e._e(),a("Wb-form",{ref:"validForm",attrs:{"label-width":0}},[a("Row",{staticClass:"form-box"},[a("Cell",{attrs:{span:"7"}},[a("Row",{staticClass:"source-word-block"},[a("Cell",{attrs:{span:"24"}},[a("Cell",{attrs:{span:"12"}},[a("div",{staticClass:"table-header"},[e._v("\n "+e._s(e.$t("components.YZD"))+"\n ")])]),a("Cell",{attrs:{span:"12"}},[a("div",{staticClass:"table-header"},[e._v("\n "+e._s(e.$t("components.LX"))+"\n ")])])],1),e._l(e.showObjectData.sourceArr,(function(t,s){return a("div",{key:s},[a("Cell",{staticClass:"raw-style",attrs:{span:"12"}},[a("Form-item",{attrs:{prop:"sourceWord",rule:[{required:!0,message:e.$t("message.newComponents.Pleaseenterthesourcefield"),trigger:"blur"},{validator:e.validateSource,trigger:"change"}]}},[a("Wb-select",{on:{"on-change":function(t){return e.sourceWordChange(s)}},model:{value:t.sourceWord,callback:function(a){e.$set(t,"sourceWord",a)},expression:"d.sourceWord"}},e._l(e.arg,(function(e){return a("wb-option",{key:e.name,attrs:{value:e.name}})})),1)],1)],1),a("Cell",{staticClass:"raw-style",attrs:{span:"12"}},[a("wb-input",{attrs:{placeholder:"",disabled:""},model:{value:t.sourceType,callback:function(a){e.$set(t,"sourceType",a)},expression:"d.sourceType"}})],1)],1)}))],2)],1),a("Cell",{attrs:{span:"1"}},[a("div",{staticClass:"table-margin"})]),a("Cell",{attrs:{span:"7"}},[a("Row",{staticClass:"source-word-block"},[a("Cell",{attrs:{span:"24"}},[a("Cell",{attrs:{span:"12"}},[a("div",{staticClass:"table-header"},[e._v("\n "+e._s(e.$t("components.MBZD"))+"\n ")])]),a("Cell",{attrs:{span:"12"}},[a("div",{staticClass:"table-header"},[e._v("\n "+e._s(e.$t("components.LX"))+"\n ")])])],1),e._l(e.showObjectData.rst,(function(t,s){return a("div",{key:s},[a("Cell",{staticClass:"raw-style",attrs:{span:"12"}},[a("Form-item",{attrs:{prop:"name",rule:[{required:!0,message:e.$t("message.newComponents.Pleaseenterthepurposefield"),trigger:"blur"},{message:e.$t("message.newComponents.Fieldlengthcantmorethan")+"200",max:200}]}},[a("wb-input",{attrs:{title:t.name,placeholder:"",disabled:!e.isHandleAdd},model:{value:t.name,callback:function(a){e.$set(t,"name",a)},expression:"d.name"}})],1)],1),a("Cell",{staticClass:"raw-style",attrs:{span:"12"}},[e.isHandleAdd?e._e():a("wb-input",{attrs:{placeholder:"",disabled:""},model:{value:t.type,callback:function(a){e.$set(t,"type",a)},expression:"d.type"}}),e.isHandleAdd?a("Wb-select",{attrs:{disabled:""},model:{value:t.type,callback:function(a){e.$set(t,"type",a)},expression:"d.type"}},e._l(e.targetType,(function(t,s){return a("wb-option",{key:s,attrs:{value:t}},[e._v("\n "+e._s(t)+"\n ")])})),1):e._e()],1)],1)}))],2)],1),a("Cell",{attrs:{span:"1"}},[a("div",{staticClass:"table-margin"})]),a("Cell",{attrs:{span:"7"}},[a("Row",{staticClass:"source-word-block"},[a("Cell",{attrs:{span:"24"}},[a("Cell",{attrs:{span:"12"}},[a("div",{staticClass:"table-header"},[e._v("\n "+e._s(e.$t("components.JYHS"))+"\n ")])]),a("Cell",{attrs:{span:"12"}},[a("div",{staticClass:"table-header"},[e._v("\n "+e._s(e.$t("components.ZHHS"))+"\n ")])])],1),e._l(e.showObjectData.funcArr,(function(t,s){return a("Cell",{key:s,attrs:{span:"24"}},[a("Cell",{staticClass:"raw-style",attrs:{span:"6"}},[a("Wb-select",{attrs:{disabled:e.isSqoop},on:{"on-change":function(t){return e.getValidArgNum(s)}},model:{value:t.validFun,callback:function(a){e.$set(t,"validFun",a)},expression:"item.validFun"}},e._l(e.validFun,(function(t,s){return a("wb-option",{key:s,attrs:{value:t.funcName}},[e._v("\n "+e._s(t.label)+"\n ")])})),1)],1),a("Cell",{attrs:{span:"4"}},[a("Wb-button",{staticClass:"arg-btn",attrs:{type:"primary","param-num":t.validParamNum,disabled:e.isSqoop},on:{click:function(a){return e.setValidArg(t.validParamNum,s,t)}}},[e._v("\n "+e._s(e.$t("components.CS"))+"\n ")])],1),a("Cell",{staticClass:"raw-style",attrs:{span:"6"}},[a("Wb-select",{attrs:{disabled:e.isSqoop},on:{"on-change":function(t){return e.getTransformArgNum(s)}},model:{value:t.transform,callback:function(a){e.$set(t,"transform",a)},expression:"item.transform"}},e._l(e.transform,(function(e,t){return a("wb-option",{key:t,attrs:{value:e.funcName}})})),1)],1),a("Cell",{attrs:{span:"4"}},[a("Wb-button",{staticClass:"arg-btn",attrs:{type:"primary","param-num":t.transformNum,disabled:e.isSqoop},on:{click:function(a){return e.setTransformArg(t.transformNum,s,t)}}},[e._v("\n "+e._s(e.$t("components.CS"))+"\n ")])],1),a("Cell",{attrs:{span:"4"}},[a("Wb-button",{staticClass:"arg-btn",attrs:{type:"defalut",disabled:!e.isHandleAdd},on:{click:function(t){return e.deleteIitem(s)}}},[e._v("\n "+e._s(e.$t("message.newComponents.delete"))+"\n ")])],1)],1)}))],2)],1)],1),a("Pagination",{staticClass:"pagination page-loc",attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.changePage}}),a("Form-item",{staticClass:"three-part-btn-wrap"},[a("Row",[a("Cell",{attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.partThreePre}},[e._v("\n "+e._s(e.$t("components.SYB"))+"\n ")])],1),a("Cell",{attrs:{span:"12"}},[a("Wb-button",{staticClass:"next-button",attrs:{type:"primary"},on:{click:e.partThreeNext}},[e._v("\n "+e._s(e.$t("components.XYB"))+"\n ")])],1)],1)],1)],1),a("modal",{ref:"argModal",attrs:{title:e.$t("components.SZCS")}},[a("div",[a("div",{staticClass:"parmas-bar"},e._l(e.modalArg,(function(t,s){return a("div",{key:s,staticClass:"arg-width"},[e.modalParamsName[s]?a("span",{staticClass:"label"},[e._v(e._s(e.modalParamsName[s])+": ")]):e._e(),e.modalParamsName[s]?a("Wb-input",{attrs:{placeholder:""},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"item.value"}}):e._e()],1)})),0),a("Row",[a("Cell",{staticClass:"modal-btn-wrap",attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.validFunAdd}},[e._v("\n "+e._s(e.$t("components.QR"))+"\n ")])],1),a("Cell",{staticClass:"modal-btn-wrap",attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.close}},[e._v("\n "+e._s(e.$t("components.QX"))+"\n ")])],1)],1)],1)]),a("modal",{ref:"argModal1",attrs:{title:e.$t("components.SZCS")}},[a("div",[a("div",{staticClass:"parmas-bar"},e._l(e.modalArg1,(function(t,s){return a("div",{key:s,staticClass:"arg-width"},[e.modalParamsName1[s]?a("span",{staticClass:"label"},[e._v(e._s(e.modalParamsName1[s])+": ")]):e._e(),e.modalParamsName1[s]?a("Wb-input",{attrs:{placeholder:""},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"item.value"}}):e._e()],1)})),0),a("Row",[a("Cell",{staticClass:"modal-btn-wrap",attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.transformFunAdd}},[e._v("\n "+e._s(e.$t("components.QR"))+"\n ")])],1),a("Cell",{staticClass:"modal-btn-wrap",attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.close}},[e._v("\n "+e._s(e.$t("components.QX"))+"\n ")])],1)],1)],1)])],1)},It=[];Et._withStripped=!0;var Jt=a("a56d"),Wt=a.n(Jt),Ot={props:{arg:{type:null},paranNewObject:{type:Object,default:{}},editData:{type:null},isShow:{type:null}},FesData:function(){return{addData:{sourceWord:"",sourceType:""},modalArg:[],modalArg1:[],flagIndex:"",transformFlagIndex:"",validFun:[],transform:[],subNewObject:this.paranNewObject,targetType:["string"],pagination:{size:10,current:1,total:0},showObjectData:{sourceArr:[],funcArr:[],rst:[]},modalParamsName:[],modalParamsName1:[]}},FesReady:function(){var e=this;this.FesApi.fetch("/jobinfo/func/verify","get").then((function(t){e.validFun=J()(t).call(t,(function(t){return">"===t.funcName?t.label=e.$t("message.newComponents.DY"):"<"===t.funcName?t.label=e.$t("message.newComponents.XY"):"="===t.funcName?t.label=e.$t("message.newComponents.DYH"):"!="===t.funcName?t.label=e.$t("message.newComponents.BDY"):">="===t.funcName?t.label=e.$t("message.newComponents.DYDY"):"<="===t.funcName?t.label=e.$t("message.newComponents.XYDY"):t.label=t.funcName,t}))})),this.FesApi.fetch("/jobinfo/func/transform","get").then((function(t){e.transform=t}))},watch:{paranNewObject:function(e){var t,a,s,n=this;(this.subNewObject=e,this.subNewObject.rst.length>this.arg.length&&this.isSqoop)&&(this.subNewObject.sourceArr=Ae()(t=e.sourceArr).call(t,(function(e,t){return t0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.showObjectData.sourceArr=Ae()(e=this.subNewObject.sourceArr).call(e,(function(e,t){return(s-1)*n<=t&&t1?a(new Error(this.$t("message.newComponents.Repeatingfield"))):a()}else a()},sourceWordChange:function(e){for(var t=this.subNewObject.sourceArr[e].sourceWord,a=0;a0)this.$refs.argModal.show(),this.modalArg=this.subNewObject.funcArr[this.pagination.size*(this.pagination.current-1)+t].validFuncArg;else if(e>0){this.$refs.argModal.show();for(var i=[],r=0;r0)this.modalArg1=this.subNewObject.funcArr[this.pagination.size*(this.pagination.current-1)+t].transformFunArg;else if(e>0){for(var i=[],r=0;r=this.arg.length)return this.$Toast(this.$t("message.newComponents.Thetargetfieldisnotgreaterthanthesourcefield"));this.subNewObject.sourceArr.push({sourceWord:this.arg[this.subNewObject.sourceArr.length%this.arg.length].name,sourceType:this.arg[this.subNewObject.sourceArr.length%this.arg.length].type}),this.subNewObject.funcArr.push({validFun:"",transform:"",validFuncArg:[],transformFunArg:[]}),this.subNewObject.rst.push({name:this.arg[this.subNewObject.rst.length%this.arg.length].name,type:"string"}),this.pagination.total=Math.ceil(this.subNewObject.sourceArr.length/this.pagination.size),this.pagination.current=this.pagination.total,this.search(this.pagination.total,this.pagination.size)},deleteIitem:function(e){var t,a,s;X()(t=this.subNewObject.sourceArr).call(t,this.pagination.size*(this.pagination.current-1)+e,1),X()(a=this.subNewObject.funcArr).call(a,this.pagination.size*(this.pagination.current-1)+e,1),X()(s=this.subNewObject.rst).call(s,this.pagination.size*(this.pagination.current-1)+e,1),this.pagination.total=Math.ceil(this.subNewObject.sourceArr.length/this.pagination.size),this.pagination.current>this.pagination.total&&(this.pagination.current=this.pagination.total),this.search(this.pagination.current,this.pagination.size)}}},jt=Ot,Yt=(a("9268"),Object(o["a"])(jt,Et,It,!1,null,"1519341c",null));Yt.options.__file="src/components/jobAddStepThree.fes";var Ht=Yt.exports,Qt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Panel",{attrs:{title:e.$t("components.XZSJY")}},[a("Wb-form",{ref:"DataSource",attrs:{rule:e.ruleValidate}},[a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("components.SJYLX"),"label-width":120}},[a("Wb-select",{on:{"on-change":e.typeChange},model:{value:e.addData.type,callback:function(t){e.$set(e.addData,"type",t)},expression:"addData.type"}},e._l(e.dataSourceTypeList,(function(e){return a("wb-option",{key:e,attrs:{value:e}})})),1)],1)],1)],1),"hive"===e.addData.type||""===e.addData.type?[a("hiveSecond",{attrs:{"add-data":e.addData,"source-origin":e.sourceOrigin,"db-data-list":e.dbDataList,"table-list":e.tableList,"part-val":e.partVal,ds_loading:e.ds_loading,db_loading:e.db_loading,table_loading:e.table_loading,part_loading:e.part_loading},on:{sourceChange:e.sourceChange,dbSeleted:e.dbSeleted,tableValueChange:e.tableValueChange,partValueSelect:e.partValueSelect,partCustom:e.partCustom,partCustomClear:e.partCustomClear}})]:e._e(),"local_fs"===e.addData.type?[a("local-fs-second",{attrs:{"local-fs-data":e.localFsData},on:{localFsData:e.localFsDataAction}})]:e._e(),"hdfs"===e.addData.type?[a("hdfsSecond",{attrs:{"step-second-data":e.hdfsData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading},on:{stepSecondData:e.hdfsDataAction}})]:e._e(),"sftp"===e.addData.type?[a("sftpSecond",{attrs:{"step-second-data":e.sftpData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading},on:{stepSecondData:e.sftpDataAction}})]:e._e(),"elasticsearch"===e.addData.type?[a("elaticSearch",{attrs:{"step-second-data":e.elasticSearchData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading,db_loading:e.db_loading,table_loading:e.table_loading,"index-name-list":e.indexNameList,"index-type-list":e.indexTypeList,"edit-data":e.editData},on:{stepSecondData:e.elasticSearchDataAction,sourceChange:e.elasticSourceChange,indexNameChange:e.indexNameChange}})]:e._e(),"mysql"===e.addData.type?[a("mysql",{attrs:{"step-one-data":e.tdsqlData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading,"db-data-list":e.tdsqlValue.dbs,"table-list":e.tdsqlValue.tables,ds_loading:e.ds_loading,db_loading:e.db_loading,table_loading:e.table_loading},on:{stepOneData:e.tdsqlDataAction,sourceChange:e.tdsqlSourceChange,dbSeleted:e.tdsqlDbSeleted,tableValueChange:e.tdsqlTableValueChange}})]:e._e(),"oracle"===e.addData.type?[a("oracle",{attrs:{"step-one-data":e.oracleData,"source-origin":e.sourceOrigin,"ds-loading":e.ds_loading,"db-data-list":e.oracleValue.dbs,"table-list":e.oracleValue.tables,ds_loading:e.ds_loading,db_loading:e.db_loading,table_loading:e.table_loading},on:{stepOneData:e.tdsqlDataAction,sourceChange:e.oracleSourceChange,dbSeleted:e.oracleDbSeleted}})]:e._e(),e.writeModeShow?a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.BJXR"),prop:"writeMode","label-width":120}},[a("Wb-select",{model:{value:e.writeMode,callback:function(t){e.writeMode=t},expression:"writeMode"}},e._l(e.writeModeList,(function(t){return a("Wb-option",{key:t.value,attrs:{value:t.value}},[e._v("\n "+e._s(t.lable)+"\n ")])})),1)],1)],1)],1):e._e(),e.syncMetaShow?a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("components.TBYXX"),porp:"syncMeta","label-width":100}},[a("Radio",{model:{value:e.syncMeta,callback:function(t){e.syncMeta=t},expression:"syncMeta"}})],1)],1)],1):e._e(),a("Form-item",[a("Row",[a("Cell",{attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.partTwoPre}},[e._v("\n "+e._s(e.$t("components.SYB"))+"\n ")])],1),a("Cell",{attrs:{span:"12"}},[a("Wb-button",{staticClass:"next-button",attrs:{type:"primary",disabled:e.nextStepButtonDisable},on:{click:e.parNextStep}},[e._v("\n "+e._s(e.$t("components.XYB"))+"\n ")])],1)],1)],1)],2)],1)},Ut=[];Qt._withStripped=!0;var Gt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.LJ"),prop:"path","label-width":120}},[a("wb-input",{attrs:{placeholder:e.$t("uiTemplate.SRLJ")},model:{value:e.subData.path,callback:function(t){e.$set(e.subData,"path",t)},expression:"subData.path"}})],1)],1),"record"===e.transferVal?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.YSLX"),prop:"localFsCompress","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.XZYSLX")},model:{value:e.subData.compress,callback:function(t){e.$set(e.subData,"compress",t)},expression:"subData.compress"}},e._l(e.localFsCompressList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),1)],1)],1):e._e(),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.BM"),prop:"encoding","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.QXZBM")},model:{value:e.subData.encoding,callback:function(t){e.$set(e.subData,"encoding",t)},expression:"subData.encoding"}},e._l(e.encodingList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),1)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.WJMQZ"),prop:"fileName","label-width":120}},[a("wb-input",{attrs:{placeholder:e.$t("uiTemplate.QSRWJMQZ")},model:{value:e.subData.fileName,callback:function(t){e.$set(e.subData,"fileName",t)},expression:"subData.fileName"}})],1)],1),"record"===e.transferVal?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.ZDFGF"),prop:"fieldDelimiter","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-search":e.search},model:{value:e.subData.fieldDelimiter,callback:function(t){e.$set(e.subData,"fieldDelimiter",t)},expression:"subData.fieldDelimiter"}},e._l(e.options,(function(t){return a("Wb-option",{key:t.label,attrs:{value:t.value}},[e._v("\n "+e._s(t.label)+"\n ")])})),1)],1)],1):e._e()],1)},Vt=[];Gt._withStripped=!0;var qt={name:"LocalFsTwo",mixins:[Oe],props:{localFsData:{tepy:Object,default:{}}},data:function(){return{subData:this.localFsData,encodingList:["UTF-8","ISO-8859-1","GB2312","GBK","UTF-16"],localFsCompressList:["gzip","bzip2"]}},computed:{transferVal:function(){return this.FesFesx.firstIsSelectRecord}},watch:{subData:{handler:function(e){this.$emit("localFsData",e)},deep:!0},transferVal:function(e){"stream"===e&&(this.subData.fieldDelimiter="",this.subData.compress="")}},methods:{}},zt=qt,Kt=Object(o["a"])(zt,Gt,Vt,!1,null,null,null);Kt.options.__file="src/components/uiTemplate/localFsSecond.fes";var ea=Kt.exports,ta=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.SJY"),prop:"source","label-width":120}},[a("Wb-select",{attrs:{filterable:""},model:{value:e.subData.dataSourceId,callback:function(t){e.$set(e.subData,"dataSourceId",t)},expression:"subData.dataSourceId"}},[e._l(e.sourceOrigin,(function(e,t){return a("wb-option",{key:t,attrs:{label:e.sourceName,value:e.id}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.dsLoading,expression:"dsLoading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.LJ"),prop:"path","label-width":120}},[a("wb-input",{attrs:{placeholder:e.$t("uiTemplate.SRLJ")},model:{value:e.subData.path,callback:function(t){e.$set(e.subData,"path",t)},expression:"subData.path"}})],1)],1),a("Cell",{attrs:{span:"24"}},["record"===e.transferVal?a("Form-item",{attrs:{label:e.$t("uiTemplate.YSLX"),prop:"hdfsCompress","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.XZYSLX")},model:{value:e.subData.compress,callback:function(t){e.$set(e.subData,"compress",t)},expression:"subData.compress"}},e._l(e.hdfsCompressList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),1)],1):e._e()],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.BM"),prop:"encoding","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.QXZBM"),disabled:e.isSqoop},model:{value:e.subData.encoding,callback:function(t){e.$set(e.subData,"encoding",t)},expression:"subData.encoding"}},e._l(e.encodingList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),1)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.WJMQZ"),prop:"fileName","label-width":120}},[a("wb-input",{attrs:{placeholder:e.$t("uiTemplate.QSRWJMQZ"),disabled:e.isSqoop},model:{value:e.subData.fileName,callback:function(t){e.$set(e.subData,"fileName",t)},expression:"subData.fileName"}})],1)],1),"record"===e.transferVal?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.WJLX"),prop:"fielType","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.XZWJLX")},model:{value:e.subData.fileType,callback:function(t){e.$set(e.subData,"fileType",t)},expression:"subData.fileType"}},[a("wb-option",{attrs:{value:"text"}}),e.isSqoop?e._e():a("wb-option",{attrs:{value:"orc"}})],1)],1)],1):e._e(),"record"===e.transferVal?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.ZDFGF"),prop:"fieldDelimiter","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-search":e.search},model:{value:e.subData.fieldDelimiter,callback:function(t){e.$set(e.subData,"fieldDelimiter",t)},expression:"subData.fieldDelimiter"}},e._l(e.options,(function(t){return a("Wb-option",{key:t.label,attrs:{value:t.value}},[e._v("\n "+e._s(t.label)+"\n ")])})),1)],1)],1):e._e()],1)},aa=[];ta._withStripped=!0;var sa={name:"hdfsSecond",mixins:[Oe],props:{stepSecondData:{tepy:Object,default:{}},sourceOrigin:{tepy:Array,default:[]},dsLoading:{type:Boolean,default:!1}},data:function(){return{subData:this.stepSecondData,encodingList:["UTF-8","ISO-8859-1","GB2312","GBK","UTF-16"]}},computed:{transferVal:function(){return this.FesFesx.firstIsSelectRecord},isSqoop:function(){return"SQOOP"===this.FesFesx.enginSelect},hdfsCompressList:function(){return this.isSqoop?["deflate","lzo"]:"orc"===this.subData.fileType?["none","snappy"]:["gzip","bzip2"]}},watch:{subData:{handler:function(e){this.$emit("stepSecondData",e)},deep:!0},transferVal:function(e){"stream"===e&&(this.subData.fieldDelimiter="",this.subData.fielType="",this.subData.compress="")},"subData.fileType":function(e){}},created:function(){},methods:{}},na=sa,ia=Object(o["a"])(na,ta,aa,!1,null,null,null);ia.options.__file="src/components/uiTemplate/hdfsSecond.fes";var ra=ia.exports,oa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.SJY"),prop:"source","label-width":120}},[a("Wb-select",{attrs:{filterable:""},model:{value:e.subData.dataSourceId,callback:function(t){e.$set(e.subData,"dataSourceId",t)},expression:"subData.dataSourceId"}},[e._l(e.sourceOrigin,(function(e,t){return a("wb-option",{key:t,attrs:{value:e.id,label:e.sourceName}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.dsLoading,expression:"dsLoading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.LJ"),prop:"path","label-width":120}},[a("wb-input",{attrs:{placeholder:e.$t("uiTemplate.SRLJ")},model:{value:e.subData.path,callback:function(t){e.$set(e.subData,"path",t)},expression:"subData.path"}})],1)],1),"record"===e.transferVal?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.YSLX"),prop:"hdfsCompress","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.XZYSLX")},model:{value:e.subData.compress,callback:function(t){e.$set(e.subData,"compress",t)},expression:"subData.compress"}},e._l(e.compressList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),1)],1)],1):e._e(),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.BM"),prop:"encoding","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.QXZBM")},model:{value:e.subData.encoding,callback:function(t){e.$set(e.subData,"encoding",t)},expression:"subData.encoding"}},e._l(e.encodingList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),1)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.WJMQZ"),prop:"fileName","label-width":120}},[a("wb-input",{attrs:{placeholder:e.$t("uiTemplate.QSRWJMQZ")},model:{value:e.subData.fileName,callback:function(t){e.$set(e.subData,"fileName",t)},expression:"subData.fileName"}})],1)],1),"record"===e.transferVal?a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.ZDFGF"),prop:"fieldDelimiter","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-search":e.search},model:{value:e.subData.fieldDelimiter,callback:function(t){e.$set(e.subData,"fieldDelimiter",t)},expression:"subData.fieldDelimiter"}},e._l(e.options,(function(t,s){return a("Wb-option",{key:s,attrs:{value:t.value}},[e._v("\n "+e._s(t.label)+"\n ")])})),1)],1)],1):e._e(),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("message.newUitemplate.Transferthedatasource"),"label-width":120}},[a("Radio",{model:{value:e.subData.transit,callback:function(t){e.$set(e.subData,"transit",t)},expression:"subData.transit"}},[e._v("\n SFTP "+e._s(e.$t("message.newUitemplate.Willusethedirectorysemaphorefileread/writesynchronization"))+"\n ")])],1)],1),a("Cell",{attrs:{span:"24"}},[e._v("\n  \n ")])],1)},la=[];oa._withStripped=!0;var ca={name:"sftpSecond",mixins:[Oe],props:{stepSecondData:{tepy:Object,default:{}},sourceOrigin:{tepy:Array,default:[]},dsLoading:{type:Boolean,default:!1}},data:function(){return{subData:this.stepSecondData,encodingList:["UTF-8","ISO-8859-1","GB2312","GBK","UTF-16"],compressList:["gzip","bzip2","zip"]}},watch:{subData:{handler:function(e){this.$emit("stepSecondData",e)},deep:!0},transferVal:function(e){"stream"===e&&(this.subData.fieldDelimiter="",this.subData.compress="")}},computed:{transferVal:function(){return this.FesFesx.firstIsSelectRecord}},methods:{}},ua=ca,da=Object(o["a"])(ua,oa,la,!1,null,null,null);da.options.__file="src/components/uiTemplate/sftpSecond.fes";var ha=da.exports,pa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.SJY"),prop:"source","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.sourceChange},model:{value:e.subData.dataSourceId,callback:function(t){e.$set(e.subData,"dataSourceId",t)},expression:"subData.dataSourceId"}},[e._l(e.sourceOrigin,(function(e,t){return a("wb-option",{key:t,attrs:{label:e.sourceName,value:e.id}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.dsLoading,expression:"dsLoading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.SYMC"),prop:"indexName","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.XZSYMC"),filterable:""},on:{"on-search":e.search,"on-change":e.indexNameChange},model:{value:e.subData.indexName,callback:function(t){e.$set(e.subData,"indexName",t)},expression:"subData.indexName"}},[e._l(e.indexNameList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),e._l(e.searchIndexName,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.db_loading,expression:"db_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.SYLX"),prop:"indexType","label-width":120}},[a("Wb-select",{attrs:{placeholder:e.$t("uiTemplate.XZSYLX")},on:{"on-change":e.indexTypeChange},model:{value:e.subData.indexType,callback:function(t){e.$set(e.subData,"indexType",t)},expression:"subData.indexType"}},[e._l(e.indexTypeList,(function(e){return a("wb-option",{key:e,attrs:{value:e,label:e}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.table_loading,expression:"table_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.PLDX"),prop:"batchSize","label-width":120}},[a("wb-input",{attrs:{type:"number",placeholder:e.$t("uiTemplate.SRPLDX")},model:{value:e.subData.batchSize,callback:function(t){e.$set(e.subData,"batchSize",t)},expression:"subData.batchSize"}})],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.HZCLQ"),prop:"usePostProcess","label-width":120}},[a("Radio",{attrs:{disabled:e.UsePostProcessDisable},model:{value:e.subData.usePostProcess,callback:function(t){e.$set(e.subData,"usePostProcess",t)},expression:"subData.usePostProcess"}})],1)],1)],1)},ma=[];pa._withStripped=!0;var fa={name:"elasticSearchSecond",props:{editData:{type:null},stepSecondData:{tepy:Object,default:{}},sourceOrigin:{tepy:Array,default:[]},dsLoading:{type:Boolean,default:!1},db_loading:{type:Boolean,default:!1},table_loading:{type:Boolean,default:!1},indexNameList:{type:Array,default:[]},indexTypeList:{type:Array,default:[]}},data:function(){return{subData:this.stepSecondData,UsePostProcessDisable:!0,searchIndexName:[]}},computed:{transferVal:function(){return this.FesFesx.firstIsSelectRecord}},mounted:function(){this.checkUsePostProcess(this.FesFesx.FirstCurrentDataSourceType)},watch:{subData:{handler:function(e){this.$emit("stepSecondData",e)},deep:!0},"subData.usePostProcess":function(e){this.FesFesx.set("usePostProcess",e)},"FesFesx.FirstCurrentDataSourceType":function(e){this.checkUsePostProcess(e)},"stepSecondData.indexName":function(e){var t;O()(t=this.indexNameList).call(t,e)?this.searchIndexName=[]:(this.searchIndexName=[e],this.UsePostProcessDisable=!0)}},methods:{sourceChange:function(e){this.$emit("sourceChange",e)},indexNameChange:function(e){this.$emit("indexNameChange",e)},indexTypeChange:function(e){this.$emit("indexTypeChange",e)},checkUsePostProcess:function(e){"hive"!==e?(this.subData.usePostProcess=!0,this.UsePostProcessDisable=!0):(this.UsePostProcessDisable=!1,this.editData&&(this.subData.usePostProcess=this.editData.config.usePostProcess))},search:function(e){var t;e?O()(t=this.indexNameList).call(t,e)?(this.searchIndexName=[],this.UsePostProcessDisable=!1):(this.searchIndexName=[e],this.subData.usePostProcess=!0,this.UsePostProcessDisable=!0):(this.searchIndexName=[],this.UsePostProcessDisable=!1)}}},ba=fa,ga=Object(o["a"])(ba,pa,ma,!1,null,null,null);ga.options.__file="src/components/uiTemplate/elasticSearchSecond.fes";var Da=ga.exports,Sa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.SJY"),prop:"source","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.sourceChange},model:{value:e.subData.dataSourceId,callback:function(t){e.$set(e.subData,"dataSourceId",t)},expression:"subData.dataSourceId"}},[e._l(e.sourceOrigin,(function(e,t){return a("wb-option",{key:t,attrs:{value:e.id,label:e.sourceName}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.ds_loading,expression:"ds_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.KM"),prop:"database","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.dbSeleted},model:{value:e.subData.DBData,callback:function(t){e.$set(e.subData,"DBData",t)},expression:"subData.DBData"}},[e._l(e.dbDataList,(function(e,t){return a("wb-option",{key:t,attrs:{value:e}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.db_loading,expression:"db_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.TABLENAMW"),prop:"tableTow","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.tableValueChange},model:{value:e.subData.table,callback:function(t){e.$set(e.subData,"table",t)},expression:"subData.table"}},[e._l(e.tableList,(function(e,t){return a("wb-option",{key:t,attrs:{value:e}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.table_loading,expression:"table_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.XRFS"),prop:"writeMode","label-width":120}},[a("Wb-select",{model:{value:e.subData.writeMode,callback:function(t){e.$set(e.subData,"writeMode",t)},expression:"subData.writeMode"}},e._l(e.writeModeList,(function(e,t){return a("wb-option",{key:t,attrs:{value:e}})})),1)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.PLDX"),prop:"batchSize","label-width":120}},[a("wb-input",{attrs:{type:"number",disabled:"SQOOP"===e.FesFesx.enginSelect,placeholder:e.$t("uiTemplate.QSRPLDXZ")},model:{value:e.subData.batchSize,callback:function(t){e.$set(e.subData,"batchSize",t)},expression:"subData.batchSize"}})],1)],1)],1)},va=[];Sa._withStripped=!0;var Ca={name:"tdsqlSecond",props:{stepOneData:{tepy:Object,default:{}},sourceOrigin:{tepy:Array,default:[]},dbDataList:{type:Array,default:[]},tableList:{type:Array,default:[]},ds_loading:{type:Boolean,default:!1},db_loading:{type:Boolean,default:!1},table_loading:{type:Boolean,default:!1}},data:function(){return{subData:this.stepOneData,showSelect:!1,optionIndex:"",alias:[],tableNameContact:{}}},watch:{subData:{handler:function(e){this.$emit("stepOneData",e)},deep:!0},"subData.table":function(e,t){}},computed:{writeModeList:function(){return"SQOOP"===this.FesFesx.enginSelect?["updateonly","allowinsert"]:["insert","replace","update"]}},methods:{sourceChange:function(e){this.$emit("sourceChange",e)},dbSeleted:function(e){this.$emit("dbSeleted",e)},tableValueChange:function(e){this.$emit("tableValueChange",e)}}},ya=Ca,wa=(a("3e84"),Object(o["a"])(ya,Sa,va,!1,null,"2518aca2",null));wa.options.__file="src/components/uiTemplate/tdsqlSecond.fes";var Ta=wa.exports,Fa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Row",[a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.SJY"),prop:"source","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.sourceChange},model:{value:e.subData.dataSourceId,callback:function(t){e.$set(e.subData,"dataSourceId",t)},expression:"subData.dataSourceId"}},[e._l(e.sourceOrigin,(function(e,t){return a("wb-option",{key:t,attrs:{value:e.id,label:e.sourceName}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.ds_loading,expression:"ds_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.KM"),prop:"database","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.dbSeleted},model:{value:e.subData.DBData,callback:function(t){e.$set(e.subData,"DBData",t)},expression:"subData.DBData"}},[e._l(e.dbDataList,(function(e,t){return a("wb-option",{key:t,attrs:{value:e}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.db_loading,expression:"db_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.TABLENAMW"),prop:"tableTow","label-width":120}},[a("Wb-select",{attrs:{filterable:""},on:{"on-change":e.tableValueChange},model:{value:e.subData.table,callback:function(t){e.$set(e.subData,"table",t)},expression:"subData.table"}},[e._l(e.tableList,(function(e,t){return a("wb-option",{key:t,attrs:{value:e}})})),a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.table_loading,expression:"table_loading"}],staticClass:"loading-position",attrs:{size:"16px"}})],2)],1)],1),a("Cell",{attrs:{span:"24"}},[a("Form-item",{attrs:{label:e.$t("uiTemplate.PLDX"),prop:"batchSize","label-width":120}},[a("wb-input",{attrs:{type:"number",disabled:"SQOOP"===e.FesFesx.enginSelect,placeholder:e.$t("uiTemplate.QSRPLDXZ")},model:{value:e.subData.batchSize,callback:function(t){e.$set(e.subData,"batchSize",t)},expression:"subData.batchSize"}})],1)],1)],1)},$a=[];Fa._withStripped=!0;var xa={name:"tdsqlSecond",props:{stepOneData:{tepy:Object,default:{}},sourceOrigin:{tepy:Array,default:[]},dbDataList:{type:Array,default:[]},tableList:{type:Array,default:[]},ds_loading:{type:Boolean,default:!1},db_loading:{type:Boolean,default:!1},table_loading:{type:Boolean,default:!1}},data:function(){return{subData:this.stepOneData,showSelect:!1,optionIndex:"",alias:[],tableNameContact:{}}},watch:{subData:{handler:function(e){this.$emit("stepOneData",e)},deep:!0},"subData.table":function(e,t){}},methods:{sourceChange:function(e){this.$emit("sourceChange",e)},dbSeleted:function(e){this.$emit("dbSeleted",e)},tableValueChange:function(e){this.$emit("tableValueChange",e)}}},_a=xa,Aa=(a("bd85"),Object(o["a"])(_a,Fa,$a,!1,null,"34211381",null));Aa.options.__file="src/components/uiTemplate/oracleSecond.fes";var La=Aa.exports;function Na(e,t){var a=G()(e);if(Fe.a){var s=Fe()(e);t&&(s=Ae()(s).call(s,(function(t){return we()(e,t).enumerable}))),a.push.apply(a,s)}return a}function Pa(e){for(var t=1;t0&&""!==this.editData&&this.changeDataSourceId(this.typeTransitionDataName(this.editData.dataDestType),e,"dataDestId")},dbDataList:function(e){e.length>0&&""!==this.editData&&""!==this.editData.config.dataDstParams.database&&O()(e).call(e,this.editData.config.dataDstParams.database)&&(this.addData.DBData=this.editData.config.dataDstParams.database)},tableList:function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataDstParams.table)&&(this.addData.table=this.editData.config.dataDstParams.table)},"tdsqlValue.dbs":function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataDstParams.database)&&(this.tdsqlData.DBData=this.editData.config.dataDstParams.database)},"tdsqlValue.tables":function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataDstParams.table)&&(this.tdsqlData.table=this.editData.config.dataDstParams.table)},"oracleValue.dbs":function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataDstParams.database)&&(this.oracleData.DBData=this.editData.config.dataDstParams.database)},"oracleValue.tables":function(e){e.length>0&&""!==this.editData&&O()(e).call(e,this.editData.config.dataDstParams.table)&&(this.oracleData.table=this.editData.config.dataDstParams.table)},indexNameList:function(e){e.length>0&&""!==this.editData&&""!==this.editData.config.dataDstParams.indexName&&(this.elasticSearchData.indexName=this.editData.config.dataDstParams.indexName,this.editData.config.dataDstParams.indexName="")},indexTypeList:function(e){e.length>0&&""!==this.editData&&""!==this.editData.config.dataDstParams.indexType&&O()(e).call(e,this.editData.config.dataDstParams.indexType)&&(this.elasticSearchData.indexType=this.editData.config.dataDstParams.indexType)}},FesReady:function(){this.editorAction(this.editData)},computed:{dataSourceTypeList:function(){return"SQOOP"!==this.FesFesx.enginSelect?this.FesFesx.FirstCurrentDataSourceType===wt["b"].MYSQL||this.FesFesx.firstIsSelectRecord===wt["c"].RECORD||this.FesFesx.FirstCurrentDataSourceType===wt["b"].ORACLE?(this.editData||(this.addData.type=wt["b"].HIVE),[wt["b"].HIVE,wt["b"].LOCAL_FS,wt["b"].HDFS,wt["b"].SFTP,wt["b"].ELASTICSEARCH,wt["b"].MYSQL,wt["b"].ORACLE]):(this.editData||(this.addData.type=wt["b"].HIVE),[wt["b"].HIVE,wt["b"].LOCAL_FS,wt["b"].HDFS,wt["b"].SFTP]):this.FesFesx.FirstCurrentDataSourceType===wt["b"].HIVE?(this.editData||(this.addData.type=wt["b"].MYSQL),[wt["b"].MYSQL]):this.FesFesx.FirstCurrentDataSourceType===wt["b"].MYSQL?(this.editData||(this.addData.type=wt["b"].HIVE),[wt["b"].HIVE,wt["b"].HDFS]):this.FesFesx.FirstCurrentDataSourceType===wt["b"].HDFS?(this.editData||(this.addData.type=wt["b"].MYSQL),[wt["b"].MYSQL]):void 0},syncMetaShow:function(){return this.FesFesx.FirstCurrentDataSourceType===wt["b"].HIVE&&(this.FesFesx.secondCurrentDataSourceType===wt["b"].HIVE||this.FesFesx.secondCurrentDataSourceType===wt["b"].SFTP)||this.FesFesx.FirstCurrentDataSourceType===wt["b"].SFTP&&this.FesFesx.secondCurrentDataSourceType===wt["b"].HIVE},writeModeShow:function(){var e;return"SQOOP"!==this.FesFesx.enginSelect&&O()(e=[wt["b"].HIVE,wt["b"].HDFS,wt["b"].SFTP,wt["b"].LOCAL_FS]).call(e,this.FesFesx.secondCurrentDataSourceType)}},methods:{partTwoPre:function(){this.$emit("preTwo",!0)},typeChange:function(e){this.FesFesx.set("secondCurrentDataSourceType",e),this.nextStepButtonDisable=!1,this.addData.dataSourceValue="",this.addData.dataSourceId="",this.addData.DBData="",this.addData.table="",this.sourceOrigin=[],this.dbDataList=[],this.tableList=[],this.partKey="",this.partVal=[{name:"",value:"",partitions:{}}],this.addData.type===wt["b"].HIVE?this.getSourceDataList(e):this.addData.type===wt["b"].LOCAL_FS?this.localFsData.type=e:e===wt["b"].SFTP?(this.sftpData.type=e,this.getSourceDataList(e)):e===wt["b"].ELASTICSEARCH?(this.elasticSearchData.type=e,this.getSourceDataList(e)):e===wt["b"].MYSQL?(this.tdsqlData.type=e,this.getSourceDataList(e)):e===wt["b"].ORACLE?(this.FesFesx.set("firstIsSelectRecord",wt["c"].RECORD),this.oracleData.type=e,this.getSourceDataList(e)):(this.hdfsData.type=e,this.getSourceDataList(e))},editorAction:function(e){e&&(this.FesFesx.set("secondCurrentDataSourceType",e.config.dataDstParams.type),this.addData.type=e.config.dataDstParams.type,e.config.syncMeta&&(this.syncMeta=e.config.syncMeta),e.config.dataDstParams&&e.config.dataDstParams.writeMode&&(this.writeMode=e.config.dataDstParams.writeMode),e.config.dataDstParams.type===wt["b"].LOCAL_FS?(this.localFsData=Pa({},e.config.dataDstParams),this.localFsData.type=e.config.dataDstParams.type):e.config.dataDstParams.type===wt["b"].HDFS?(this.hdfsData=Pa({},e.config.dataDstParams),this.hdfsData.type=e.config.dataDstParams.type):e.config.dataDstParams.type===wt["b"].SFTP?(this.sftpData=Pa({},e.config.dataDstParams),this.sftpData.type=e.config.dataDstParams.type,this.sftpData.dataSourceId=e.config.dataDestId):e.config.dataDstParams.type===wt["b"].ELASTICSEARCH?(this.elasticSearchData.type=e.config.dataDstParams.type,this.elasticSearchData.dataSourceId=e.config.dataDestId,this.elasticSearchData.batchSize=e.config.dataDstParams.batchSize,this.elasticSearchData.usePostProcess=e.config.usePostProcess,this.FesFesx.set("usePostProcess",e.config.usePostProcess)):e.config.dataDstParams.type===wt["b"].MYSQL?this.tdsqlData=Pa({},e.config.dataDstParams):e.config.dataDstParams.type===wt["b"].ORACLE&&(this.oracleData=Pa({},e.config.dataDstParams)))},tableValueChange:function(e){this.tableValueChangeAction(e,"dataDstParams")},partValueSelect:function(e){var t=e.index,a=e.value,s=e.partitions;this.partValueSelectAction(t,a,s,"dataDstParams")},elasticSearchDataAction:function(e){this.elasticSearchData=e},tdsqlTableValueChange:function(e){console.log(e,"tablechange")},tdsqlSourceChange:function(e){var t=this;if(this.tdsqlData.DBData="",this.tdsqlData.table="",this.tdsqlValue.dbs=[],this.tdsqlValue.tables=[],""==e)return!1;this.db_loading=!0,this.FesApi.fetch("/datasource/meta/mysql/"+e+"/dbs",{},{method:"get",timeout:"60000"}).then((function(e){t.db_loading=!1,t.tdsqlValue.dbs="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.db_loading=!1}))},tdsqlDbSeleted:function(e){var t=this;this.tdsqlData.table="",this.tdsqlValue.tables=[],""!=e&&(this.table_loading=!0,this.FesApi.fetch("/datasource/meta/mysql/"+this.tdsqlData.dataSourceId+"/"+e+"/tables",{},{method:"get",timeout:"60000"}).then((function(e){t.table_loading=!1,t.tdsqlValue.tables="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.table_loading=!1})))},oracleSourceChange:function(e){var t=this;if(this.oracleData.DBData="",this.oracleData.table="",this.oracleValue.dbs=[],this.oracleValue.tables=[],""==e)return!1;this.db_loading=!0,this.FesApi.fetch("/datasource/meta/oracle/"+e+"/dbs",{},{method:"get",timeout:"60000"}).then((function(e){t.db_loading=!1,t.oracleValue.dbs="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.db_loading=!1}))},oracleDbSeleted:function(e){var t=this;this.oracleData.table="",this.oracleValue.tables=[],""!=e&&(this.table_loading=!0,this.FesApi.fetch("/datasource/meta/oracle/"+this.oracleData.dataSourceId+"/"+e+"/tables",{},{method:"get",timeout:"60000"}).then((function(e){t.table_loading=!1,t.oracleValue.tables="{}"===xe()(e)?[]:e}))["catch"]((function(){return t.table_loading=!1})))},elasticSourceChange:function(e){var t=this;this.indexNameList=[],this.indexTypeList=[],this.elasticSearchData.indexName="",this.elasticSearchData.indexType="",this.db_loading=!0,this.FesApi.fetch("/datasource/meta/elastic/"+e+"/indices",{},{method:"get",timeout:"60000"}).then((function(e){t.indexNameList="{}"===xe()(e)?[]:e,t.db_loading=!1}))["catch"]((function(){return t.db_loading=!1}))},indexNameChange:function(e){var t,a=this;this.elasticSearchData.indexType="",!e||O()(t=this.indexNameList).call(t,e)?e&&(this.table_loading=!0,this.FesApi.fetch("/datasource/meta/elastic/"+this.elasticSearchData.dataSourceId+"/"+e+"/types",{},{method:"get",timeout:"60000"}).then((function(e){a.indexTypeList="{}"===xe()(e)?[]:e,a.table_loading=!1}))["catch"]((function(){return a.table_loading=!1}))):this.indexTypeList=["_doc"]}}},Ba=ka,Ma=Object(o["a"])(Ba,Qt,Ut,!1,null,null,null);Ma.options.__file="src/components/jobAddStepTwo.fes";var Za=Ma.exports,Xa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("Panel",[a("Wb-form",{ref:"enginSelect"},[a("Form-item",{attrs:{label:e.$t("message.newComponents.engine"),"label-width":120}},[a("Radio-group",{model:{value:e.addData.engin,callback:function(t){e.$set(e.addData,"engin",t)},expression:"addData.engin"}},[a("Radio",{attrs:{value:"DATAX"}},[e._v("\n DATAX\n ")]),a("Radio",{attrs:{value:"SQOOP"}},[e._v("\n SQOOP\n ")])],1)],1),a("Form-item",[a("Row",[a("Cell",{attrs:{span:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.preview}},[e._v("\n "+e._s(e.$t("components.LLSJ"))+"\n ")])],1),a("Cell",{attrs:{span:"12"}},[a("Wb-button",{staticClass:"next-button",attrs:{type:"primary"},on:{click:e.parNextStep}},[e._v("\n "+e._s(e.$t("components.XYB"))+"\n ")])],1)],1)],1)],1)],1)},Ra=[];Xa._withStripped=!0;var Ea={props:{editData:{type:null}},data:function(){return{addData:{engin:"DATAX"}}},FesReady:function(){this.editData&&(this.addData.engin=this.editData.engineType)},methods:{parNextStep:function(){this.$emit("nextStep",this.addData)},preview:function(){this.$Toast(this.$t("components.GNZWKF"))}}},Ia=Ea,Ja=Object(o["a"])(Ia,Xa,Ra,!1,null,null,null);Ja.options.__file="src/components/jobAddStepZero.fes";var Wa=Ja.exports,Oa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("we-step",{attrs:{"current-step":e.currentStep,"step-description":e.stepDescription}}),a("job-add-step-zero",{directives:[{name:"show",rawName:"v-show",value:e.partZero,expression:"partZero"}],attrs:{"edit-data":e.editData},on:{nextStep:e.partZeroNext}}),a("job-add-step-one",{directives:[{name:"show",rawName:"v-show",value:e.partOne,expression:"partOne"}],ref:"job_add_step_one",attrs:{"edit-data":e.editData,"tree-id":e.treeId},on:{preStep:e.partOnePre,nextStep:e.partOneNext}}),a("job-add-step-two",{directives:[{name:"show",rawName:"v-show",value:e.partTwo,expression:"partTwo"}],ref:"job_add_step_two",attrs:{"edit-data":e.editData,"tree-id":e.treeId},on:{nextStep:e.partTwoNext,preTwo:e.partTwoPre,syncMeta:e.syncMeta}}),a("job-add-step-three",{directives:[{name:"show",rawName:"v-show",value:e.partThree,expression:"partThree"}],ref:"job_add_step_three",attrs:{arg:e.partThreeData,"edit-data":e.editData,"paran-new-object":e.newObject,"is-show":e.partThree},on:{threeNext:e.partThreeNext,threePre:e.partThreePre}}),a("job-add-editor",{directives:[{name:"show",rawName:"v-show",value:e.editorShow,expression:"editorShow"}],attrs:{value:e.addData.editorContent},on:{preEditor:e.partEditorPre,parNextStep:e.editorNext}}),a("job-add-step-four",{directives:[{name:"show",rawName:"v-show",value:e.partFour,expression:"partFour"}],ref:"job_add_step_four",attrs:{"edit-data":e.editData},on:{fourNext:e.partFourNext,fourPre:e.partFourPre}}),a("job-add-step-five",{directives:[{name:"show",rawName:"v-show",value:e.partFive,expression:"partFive"}],ref:"job_add_step_five",attrs:{"edit-data":e.editData,"save-disable":e.saveDisable},on:{save:e.save,fivePre:e.fivePre}})],1)},ja=[];Oa._withStripped=!0;var Ya=a("3ebb"),Ha=a.n(Ya),Qa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"ui-steps web-steps"},[e._l(e.stepDescription,(function(t,s){return[a("div",{key:s,staticClass:"ui-step",class:{"ui-step-done":s+1e.currentStep}},[s+1!==e.stepDescription.length?a("div",{staticClass:"ui-step-tail"},[a("i")]):e._e(),s+10){var i=!0;this.addData.addData1.table.length===this.editData.config.dataSrcParams.table.length&&this.addData.addData1.table.toString===this.editData.config.dataSrcParams.table.toString||(this.editData.config.columnMaps=[]),this.editorAction(this.editData,this.editData.config.columnMaps,i)}}else e.type!==wt["b"].ORACLE||this.FesFesx.FirstCurrentDataSourceType!==wt["b"].HIVE&&this.FesFesx.FirstCurrentDataSourceType!==wt["b"].TDSQL&&this.FesFesx.FirstCurrentDataSourceType!==wt["b"].ORACLE||this.FesFesx.firstIsSelectRecord!==wt["c"].RECORD||this.FesApi.fetch("/datasource/meta/oracle/"+e.dataSourceId+"/"+e.DBData+"/"+e.table+"/fields",{},{method:"get",timeout:"60000"}).then((function(e){for(var t=[],a=0;a2&&void 0!==arguments[2]&&arguments[2];if(e&&e.config.columnMaps&&e.config.columnMaps.length>0){for(var s=[],n=[],i=0;i0?[a("Tree",{ref:"tree",attrs:{data:e.treeData},on:{"on-select-change":e.getProjectId},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.node;t.root;return[a("contextmenu",{attrs:{data:e.actions},on:{"on-choose":function(t){return e.doAction(s,arguments)}}},[a("span",[e._v(" "+e._s(s.projectName)+" ")])])]}}],null,!1,1902962643)})]:e._e(),e.treeData.length<=0?a("span",{staticClass:"not-data"},[e._v(e._s(e.$t("group.ZWSJ")))]):e._e(),a("modal",{ref:"addTree",attrs:{title:e.$t("components.XZXM")}},[a("Wb-form",{ref:"addForm"},[a("Form-item",{attrs:{label:e.$t("components.XMMC")}},[a("wb-input",{attrs:{placeholder:e.$t("components.SRXMMC")},model:{value:e.taskName,callback:function(t){e.taskName=t},expression:"taskName"}})],1),a("Form-item",{attrs:{label:e.$t("components.MS")}},[a("wb-input",{attrs:{placeholder:e.$t("components.MS")},model:{value:e.taskDesc,callback:function(t){e.taskDesc=t},expression:"taskDesc"}})],1),a("div",{staticClass:"submit-button-container"},[a("Wb-button",{ref:"submitButton",staticClass:"submit-button",attrs:{type:"primary"},on:{click:e.submit}},[e._v("\n "+e._s(e.$t("components.TJ"))+"\n ")])],1)],1)],1)],2)},ns=[];ss._withStripped=!0;var is=a("9a5e"),rs=a("d68f"),os=a.n(rs),ls={props:{arg:{type:Object},newData:{type:Object}},FesData:function(){return{treeData:[],actions:[this.$t("components.ZJZJD"),this.$t("components.SCJD")],test:"",taskName:"",taskDesc:"",currentId:"",originTreeData:""}},FesReady:function(){this.getTree()},methods:{searchProject:function(e){console.log(e,"name");var t=this.originTreeData;this.walker(t,e),this.treeData=this.filterAction(t)},walker:function(e,t){var a=this,s=!1;return Q()(e).call(e,(function(e){var n;if(e.children){var i,r=a.walker(e.children,t);r||-1!==os()(i=e.projectName).call(i,t)||""===t?(e.isEnable=!1,s=!0):e.isEnable=!0}else-1!==os()(n=e.projectName).call(n,t)||""===t?(e.isEnable=!1,s=!0):e.isEnable=!0})),s},filterAction:function(e){var t=this;return Ae()(e).call(e,(function(e){return e.children&&!e.isEnable?(e.children=t.filterAction(e.children),e.children.length>0):!e.isEnable}))},doAction:function(e,t){var a=this,s=Object(is["a"])(t,2),n=s[1];if(this.currentNode=e,this.currentId=e.id,0===n){if(2===e.level)return this.$Toast.warn($t("message.newComponents.Onlysupportsnomorethanthreelayersofengineering"));this.$refs.addTree.show()}1===n&&this.$Message.confirm(this.$t("components.SC"),this.$t("components.SFSC")).then((function(t){0===t&&(a.FesFesx.set("isLoading",!0),a.FesApi.fetch("/project/delete/"+e.id,"delete").then((function(){a.FesFesx.set("isLoading",!1),a.$Toast.success(a.$t("components.SCCG")),a.$refs.tree.removeNode(e)}))["catch"]((function(){a.FesFesx.set("isLoading",!1)})))}))},getTree:function(){var e=this;this.FesFesx.set("isLoading",!0),this.FesApi.fetch("/project/tree","get").then((function(t){e.originTreeData=e.treeData=t,e.treeData[0]&&(e.treeData[0].selected=!0,e.getProjectId(e.treeData[0])),e.FesFesx.set("isLoading",!1)}))},submit:function(){var e=this,t={};t.parentId=this.currentId,t.projectName=this.taskName,t.projectDesc=this.taskDesc,this.FesApi.fetch("/project/add",t).then((function(){e.$refs.addTree.hide(),e.$Toast.success(e.$t("components.TJCG")),e.getTree(),e.taskName="",e.taskDesc="",e.currentId=""}))},getProjectId:function(e){return null!=e&&this.$emit("getTreeId",e.id),!1}}},cs=ls,us=(a("e769"),Object(o["a"])(cs,ss,ns,!1,null,null,null));us.options.__file="src/components/jobLeftTree.fes";var ds=us.exports;t["a"]={FesHeader:c,FesLeft:f,JobAddEditor:N,JobAddStepFive:oe,JobAddStepFour:pe,JobAddStepOne:Rt,JobAddStepThree:Ht,JobAddStepTwo:Za,JobAddStepZero:Wa,JobAddWrap:as,JobLeftTree:ds}},"932c":function(e,t,a){"use strict";a("fc79")},"958e":function(e,t,a){"use strict";a("ab38")},9768:function(e,t,a){},"99e6":function(e,t,a){"use strict";a("cca7")},"9b4c":function(e,t,a){"use strict";var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("main",{staticClass:"main"},[a("div",{staticClass:"header-bar"},[a("span",{staticClass:"header-title"},[e._v("\n "+e._s(e.$t("dataTemplate.SJYMBGL"))+"\n ")]),a("p",{staticClass:"header-des"},[e._v("\n "+e._s(e.$t("dataTemplate.SJYLJCSMBGL"))+"\n ")])]),a("div",{staticClass:"main-content"},[a("Row",{staticClass:"top-bar"},[a("div",[a("label",{staticClass:"ui-form-label"},[e._v("\n "+e._s(e.$t("dataTemplate.MBLX"))+"\n ")])]),a("Cell",{attrs:{span:"4"}},[a("Wb-select",{attrs:{placeholder:e.$t("dataTemplate.QXZSJY")},model:{value:e.querySourceType,callback:function(t){e.querySourceType=t},expression:"querySourceType"}},[a("wb-option",{attrs:{value:"HIVE",label:"HIVE"}}),a("wb-option",{attrs:{value:"HDFS",label:"HDFS"}}),a("wb-option",{attrs:{value:"SFTP",label:"SFTP"}}),a("wb-option",{attrs:{value:"ElasticSearch",label:"ElasticSearch"}}),a("wb-option",{attrs:{value:"MYSQL",label:"MYSQL"}}),a("wb-option",{attrs:{value:"ORACLE",label:"ORACLE"}})],1)],1),a("div",{staticClass:"margin-left"},[a("label",{staticClass:"ui-form-label"},[e._v("\n "+e._s(e.$t("dataTemplate.MBMC"))+"\n ")])]),a("Cell",{attrs:{span:"4"}},[a("Wb-input",{attrs:{maxlength:200,placeholder:e.$t("dataTemplate.CXMBMC")},model:{value:e.queryModelName,callback:function(t){e.queryModelName=t},expression:"queryModelName"}})],1),a("Cell",{staticClass:"margin-left",attrs:{span:"4"}},[a("Wb-button",{attrs:{type:"primary",icon:"search"},on:{click:function(t){return e.searchQuery()}}},[e._v("\n "+e._s(e.$t("dataTemplate.CX"))+"\n ")])],1)],1),a("div",{staticClass:"template-lsit"},[a("div",{staticClass:"add-item template-item",on:{click:e.addAction}},[a("Icon",{attrs:{type:"md-add",size:"16"}}),e._v("\n "+e._s(e.$t("dataTemplate.XZMB"))+"\n ")],1),e._l(e.templateList,(function(t){return a("div",{key:t.id,staticClass:"current-item template-item"},[a("div",{staticClass:"item-content"},[a("div",{staticClass:"icon-box"},["HIVE"===t.sourceType?a("i",{staticClass:"icon-bar",attrs:{type:"iconfont icon-hive",size:"35"}},[e._v("HIVE")]):e._e(),"HDFS"===t.sourceType?a("i",{staticClass:"icon-bar",attrs:{type:"iconfont icon-hdfs",size:"35"}},[e._v("HDFS")]):e._e(),"SFTP"===t.sourceType?a("i",{staticClass:"icon-bar",attrs:{type:"iconfont icon-sftp",size:"35"}},[e._v("SFTP")]):e._e(),"MYSQL"===t.sourceType?a("i",{staticClass:"icon-bar",attrs:{type:"iconfont icon-mysql",size:"35"}},[e._v("MYSQL")]):e._e(),"ElasticSearch"===t.sourceType?a("i",{staticClass:"icon-bar",attrs:{type:"iconfont icon-ElasticSearch",size:"35"}},[e._v("ES")]):e._e(),"ORACLE"===t.sourceType?a("i",{staticClass:"icon-bar",attrs:{type:"iconfont icon-xingzhuang",size:"35"}},[e._v("ORACLE")]):e._e()]),a("div",{staticClass:"content"},[a("span",{staticClass:"name",attrs:{title:t.modelName}},[e._v("\n "+e._s(t.modelName)+"\n ")]),a("div",{staticClass:"params",attrs:{title:t.modelDesc}},[e._v("\n "+e._s(t.modelDesc)+"\n ")]),a("div",{staticClass:"content-footer"},[a("span",[e._v(e._s(t.modifyUser))]),a("span",[e._v(e._s(t.modifyTime.split(" ")[0]))])])])]),a("div",{staticClass:"item-option"},[a("span",{staticClass:"detail",on:{click:function(a){return e.detailAction(t)}}},[e._v("\n "+e._s(e.$t("dataTemplate.CKXQ"))+"\n ")]),a("span",[e._v("|")]),a("span",{staticClass:"delete",on:{click:function(a){return e.modifyAction(t)}}},[e._v("\n "+e._s(e.$t("dataTemplate.XG"))+"\n ")]),a("span",[e._v("|")]),a("span",{staticClass:"modify",on:{click:function(a){return e.deleteAction(t)}}},[e._v("\n "+e._s(e.$t("dataTemplate.SC"))+"\n ")])])])}))],2),a("div",{staticClass:"page-pagination"},[a("Pagination",{attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.pageChange}})],1)],1),a("weModal",{attrs:{title:e.modelTitle,width:"750",closable:!0,"footer-disable":!("view"===e.actionType)},on:{onConfirm:e.addConfirm},model:{value:e.addShow,callback:function(t){e.addShow=t},expression:"addShow"}},[a("Wb-form",{ref:"templateForm",attrs:{rule:e.sourceRule}},[a("Form-item",{attrs:{label:e.$t("dataTemplate.XZSJYLX"),prop:"templateSourceType","label-width":130}},[a("Wb-select",{staticClass:"modal-select",attrs:{disabled:"view"===e.actionType},model:{value:e.selectSourceType,callback:function(t){e.selectSourceType=t},expression:"selectSourceType"}},e._l(e.selectSourceList,(function(e,t){return a("wb-option",{key:t,attrs:{value:e,label:e}})})),1)],1),a("Form-item",{attrs:{label:e.$t("dataTemplate.MBMC"),prop:"templateName","label-width":130}},[a("Wb-input",{attrs:{type:"text",placeholder:e.$t("dataTemplate.SRWB"),width:"85%",disabled:"view"===e.actionType},model:{value:e.templateName,callback:function(t){e.templateName=t},expression:"templateName"}})],1),a("Form-item",{attrs:{label:e.$t("dataTemplate.MBMS"),prop:"templateDesc","label-width":130}},[a("Wb-input",{attrs:{type:"textarea",placeholder:e.$t("dataTemplate.SRWB"),width:"85%",disabled:"view"===e.actionType},model:{value:e.description,callback:function(t){e.description=t},expression:"description"}})],1),"HIVE"===e.selectSourceType?a("Form-item",{attrs:{label:"Metastore "+e.$t("dataTemplate.DZ"),prop:"metaStorePaths","label-width":130}},e._l(e.parameter.metaStorePaths,(function(t,s){return a("div",{key:s,staticClass:"parameter-item"},[a("wb-input",{staticClass:"margin-bottom",attrs:{placeholder:e.$t("dataTemplate.QSR")+" Metastore "+e.$t("dataTemplate.DZ"),width:"85%",disabled:"view"===e.actionType},model:{value:t.content,callback:function(a){e.$set(t,"content",a)},expression:"path.content"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n thrift://\n ")]),a("span",{attrs:{slot:"append"},slot:"append"},["md-add"==t.icon?a("Icon",{staticClass:"icon-plus",attrs:{type:t.icon,color:"gray",size:"18"},on:{click:e.sourceMetaPlus}}):"md-remove"==t.icon?a("Icon",{staticClass:"icon-plus",attrs:{type:t.icon,color:"gray",size:"18"},on:{click:function(t){return e.sourceMetaMinus(s)}}}):e._e(),0==s?a("Icon",{staticClass:"icon-plus",attrs:{type:"md-add",color:"gray",size:"18"},on:{click:e.sourceMetaPlus}}):e._e()],1)])],1)})),0):e._e(),"HIVE"===e.selectSourceType||"HDFS"===e.selectSourceType?a("Form-item",{attrs:{label:"HDFS "+e.$t("dataTemplate.DZ"),prop:"hdfsPath","label-width":130}},[a("wb-input",{attrs:{placeholder:"HDFS "+e.$t("dataTemplate.DZ"),width:"85%",disabled:"view"===e.actionType},model:{value:e.parameter.hdfsPath,callback:function(t){e.$set(e.parameter,"hdfsPath",t)},expression:"parameter.hdfsPath"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n hdfs://\n ")])])],1):e._e(),"HIVE"===e.selectSourceType||"HDFS"===e.selectSourceType?a("Form-item",{attrs:{label:"Hadoop "+e.$t("dataTemplate.PZX"),"label-width":130}},e._l(e.parameter.hadoopConfigs,(function(t,s){return a("div",{key:s},[a("Row",{staticClass:"parameter-item"},[a("Cell",{attrs:{span:"9"}},[a("wb-input",{attrs:{placeholder:e.$t("dataTemplate.PZM"),disabled:"view"===e.actionType},on:{"on-blur":function(t){return e.checkHadoop("key")}},model:{value:t.key,callback:function(a){e.$set(t,"key",a)},expression:"config.key"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n "+e._s(e.$t("dataTemplate.PZM"))+"\n ")])])],1),a("Cell",{attrs:{span:"1"}},[a("span",[e._v(" ")])]),a("Cell",{attrs:{span:"9"}},[a("wb-input",{attrs:{placeholder:e.$t("dataTemplate.PZZ"),disabled:"view"===e.actionType},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"config.value"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n "+e._s(e.$t("dataTemplate.PZZ"))+"\n ")])])],1),a("Cell",{staticClass:"text-dec",attrs:{span:"3"}},["md-add"==t.icon?a("Icon",{staticClass:"icon-plus",attrs:{type:t.icon,color:"gray",size:"18"},on:{click:function(t){return e.sourceConfPlus("hadoopConfigs")}}}):"md-remove"==t.icon?a("Icon",{staticClass:"icon-plus",attrs:{type:t.icon,color:"gray",size:"18"},on:{click:function(t){return e.sourceConfMinus(s,"hadoopConfigs")}}}):e._e(),0==s?a("Icon",{staticClass:"icon-plus",attrs:{type:"md-add",color:"gray",size:"18"},on:{click:function(t){return e.sourceConfPlus("hadoopConfigs")}}}):e._e()],1)],1)],1)})),0):e._e(),"MYSQL"===e.selectSourceType?a("Form-item",{attrs:{label:"MYSQL "+e.$t("dataTemplate.LJCS"),"label-width":130}},e._l(e.parameter.connParams,(function(t,s){return a("div",{key:s},[a("Row",{staticClass:"parameter-item"},[a("Cell",{attrs:{span:"9"}},[a("wb-input",{attrs:{placeholder:e.$t("dataTemplate.CSM"),disabled:"view"===e.actionType},on:{"on-blur":function(t){return e.checkHadoop("key")}},model:{value:t.key,callback:function(a){e.$set(t,"key",a)},expression:"config.key"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n "+e._s(e.$t("dataTemplate.CSM"))+"\n ")])])],1),a("Cell",{attrs:{span:"1"}},[a("span",[e._v(" ")])]),a("Cell",{attrs:{span:"9"}},[a("wb-input",{attrs:{placeholder:e.$t("dataTemplate.CSZ"),disabled:"view"===e.actionType},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"config.value"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n "+e._s(e.$t("dataTemplate.CSZ"))+"\n ")])])],1),a("Cell",{staticClass:"text-dec",attrs:{span:"3"}},["md-add"==t.icon?a("Icon",{staticClass:"icon-plus",attrs:{type:t.icon,color:"gray",size:"18"},on:{click:function(t){return e.sourceConfPlus("connParams")}}}):"md-remove"==t.icon?a("Icon",{staticClass:"icon-plus",attrs:{type:t.icon,color:"gray",size:"18"},on:{click:function(t){return e.sourceConfMinus(s,"connParams")}}}):e._e(),0==s?a("Icon",{staticClass:"icon-plus",attrs:{type:"md-add",color:"gray",size:"18"},on:{click:function(t){return e.sourceConfPlus("connParams")}}}):e._e()],1)],1)],1)})),0):e._e(),"SFTP"===e.selectSourceType?a("Row",[a("Cell",{attrs:{span:"11"}},[a("Form-item",{attrs:{label:"SFTP "+e.$t("dataTemplate.DZ"),prop:"pathHost","label-width":130}},[a("wb-input",{attrs:{placeholder:"SFTP "+e.$t("dataTemplate.DZ")+" HOST",disabled:"view"===e.actionType},model:{value:e.parameter.host,callback:function(t){e.$set(e.parameter,"host",t)},expression:"parameter.host"}})],1)],1),a("Cell",{attrs:{span:"10"}},[a("Form-item",{attrs:{prop:"pathPort"}},[a("wb-input",{attrs:{type:"number",placeholder:"SFTP "+e.$t("dataTemplate.DZDKH"),disabled:"view"===e.actionType},model:{value:e.parameter.port,callback:function(t){e.$set(e.parameter,"port",t)},expression:"parameter.port"}})],1)],1)],1):e._e(),"ElasticSearch"===e.selectSourceType?a("Row",[a("Form-item",{attrs:{label:"Elastic Url",prop:"elasticSearchPaths","label-width":130}},e._l(e.parameter.metaStorePaths,(function(t,s){return a("div",{key:s,staticClass:"parameter-item"},[a("wb-input",{staticClass:"margin-bottom",attrs:{placeholder:e.$t("dataTemplate.QSR")+" elasticSearch "+e.$t("dataTemplate.DZ"),width:"85%",disabled:"view"===e.actionType},model:{value:t.content,callback:function(a){e.$set(t,"content",a)},expression:"path.content"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("\n http://\n ")]),a("span",{attrs:{slot:"append"},slot:"append"},["md-add"==t.icon?a("Icon",{staticClass:"icon-plus",attrs:{type:t.icon,color:"gray",size:"18"},on:{click:e.sourceMetaPlus}}):"md-remove"==t.icon?a("Icon",{staticClass:"icon-plus",attrs:{type:t.icon,color:"gray",size:"18"},on:{click:function(t){return e.sourceMetaMinus(s)}}}):e._e(),0==s?a("Icon",{staticClass:"icon-plus",attrs:{type:"md-add",color:"gray",size:"18"},on:{click:e.sourceMetaPlus}}):e._e()],1)])],1)})),0)],1):e._e(),"MYSQL"===e.selectSourceType?a("Row",[a("Cell",{attrs:{span:"11"}},[a("Form-item",{attrs:{label:"MYSQL "+e.$t("dataTemplate.DZ"),prop:"sqlPathHost","label-width":130}},[a("wb-input",{attrs:{placeholder:"MYSQL "+e.$t("dataTemplate.DZ")+" HOST",disabled:"view"===e.actionType},model:{value:e.parameter.host,callback:function(t){e.$set(e.parameter,"host",t)},expression:"parameter.host"}})],1)],1),a("Cell",{attrs:{span:"10"}},[a("Form-item",{attrs:{prop:"sqlPathPort"}},[a("wb-input",{attrs:{type:"number",placeholder:"MYSQL "+e.$t("dataTemplate.DZDKH"),disabled:"view"===e.actionType},model:{value:e.parameter.port,callback:function(t){e.$set(e.parameter,"port",t)},expression:"parameter.port"}})],1)],1)],1):e._e(),"ORACLE"===e.selectSourceType?a("Row",[a("Cell",{attrs:{span:"11"}},[a("Form-item",{attrs:{label:"ORACLE "+e.$t("dataTemplate.DZ"),prop:"pathHost","label-width":130}},[a("wb-input",{attrs:{placeholder:"ORACLE "+e.$t("dataTemplate.DZ")+" HOST",disabled:"view"===e.actionType},model:{value:e.parameter.host,callback:function(t){e.$set(e.parameter,"host",t)},expression:"parameter.host"}})],1)],1),a("Cell",{attrs:{span:"10"}},[a("Form-item",{attrs:{prop:"pathPort"}},[a("wb-input",{attrs:{type:"number",placeholder:"ORACLE "+e.$t("dataTemplate.DZDKH"),disabled:"view"===e.actionType},model:{value:e.parameter.port,callback:function(t){e.$set(e.parameter,"port",t)},expression:"parameter.port"}})],1)],1),a("Cell",{attrs:{span:"11"}},[a("Form-item",{attrs:{prop:"serviceName","label-width":130}},[a("wb-input",{attrs:{placeholder:"ORACLE "+e.$t("dataTemplate.DZ")+" service_name",disabled:"view"===e.actionType},model:{value:e.parameter.serviceName,callback:function(t){e.$set(e.parameter,"serviceName",t)},expression:"parameter.serviceName"}})],1)],1),a("Cell",{attrs:{span:"10"}},[a("Form-item",{attrs:{prop:"serviceSid"}},[a("wb-input",{attrs:{placeholder:"ORACLE "+e.$t("dataTemplate.DZ")+" sid",disabled:"view"===e.actionType},model:{value:e.parameter.sid,callback:function(t){e.$set(e.parameter,"sid",t)},expression:"parameter.sid"}})],1)],1)],1):e._e(),a("Form-item",{attrs:{label:e.$t("dataTemplate.RZFS"),"label-width":130,prop:"authType"}},[a("Radio-group",{attrs:{disabled:"view"===e.actionType},model:{value:e.parameter.authType,callback:function(t){e.$set(e.parameter,"authType",t)},expression:"parameter.authType"}},e._l(e.authTypeList,(function(e){return a("Radio",{key:e.value,attrs:{value:e.value,label:e.label}})})),1)],1),"KERBERS"===e.parameter.authType&&"NONE"!==e.parameter.authType?a("Form-item",{attrs:{label:"hostName",prop:"hostName","label-width":130}},[a("Wb-input",{attrs:{type:"text",placeholder:e.$t("dataTemplate.SRWB"),width:"85%",disabled:"view"===e.actionType},model:{value:e.parameter.hostname,callback:function(t){e.$set(e.parameter,"hostname",t)},expression:"parameter.hostname"}})],1):e._e(),"KERBERS"===e.parameter.authType&&"NONE"!==e.parameter.authType?a("Form-item",{attrs:{label:"realm",prop:"realm","label-width":130}},[a("Wb-input",{attrs:{type:"text",placeholder:e.$t("dataTemplate.SRWB"),width:"85%",disabled:"view"===e.actionType},model:{value:e.parameter.realminfo,callback:function(t){e.$set(e.parameter,"realminfo",t)},expression:"parameter.realminfo"}})],1):e._e()],1)],1),a("weLoading",{directives:[{name:"show",rawName:"v-show",value:e.FesFesx.isLoading,expression:"FesFesx.isLoading"}]})],1)},n=[];s._withStripped=!0;var i=a("7dfe"),r=a.n(i),o=a("315b"),l=a.n(o),c=a("9af5"),u=a.n(c),d=a("11eb"),h=a.n(d),p=a("95a3"),m=a.n(p),f=a("43cf"),b=a.n(f),g=a("513b"),D=a.n(g),S=a("0bdb"),v=a.n(S),C=a("2b84"),y=a.n(C),w=a("58df"),T=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"mask"},[a("Loading",{directives:[{name:"show",rawName:"v-show",value:e.loadingShow,expression:"loadingShow"}],staticClass:"sub-loading",attrs:{color:"#ccc",size:"50px"}})],1)},F=[];T._withStripped=!0;var $={data:function(){return{loadingShow:!0}}},x=$,_=(a("958e"),a("350f")),A=Object(_["a"])(x,T,F,!1,null,"74ad308b",null);A.options.__file="src/components/uiTemplate/weLoading.fes";var L=A.exports,N={components:{weModal:w["a"],weLoading:L},data:function(){var e,t,a=this,s=function(e,t,s){a.parameter.serviceName||a.parameter.sid||s(new Error("service_name和sid至少填一项")),s()},n=function(e,t,a){(t<0||t>65535)&&a(new Error("请输入正确的端口")),a()};return{addShow:!1,selectSourceList:["HIVE","HDFS","SFTP","ElasticSearch","MYSQL","ORACLE"],parameter:{metaStorePaths:[{content:""}],hdfsPath:"",hadoopConfigs:[{key:"",value:""}],connParams:[{key:"",value:""}],authType:"KERBERS",host:"",port:"",hostname:"",realminfo:"",elasticUrls:"",serviceName:"",sid:""},selectSourceType:"HIVE",templateName:"",description:"",querySourceType:"",queryModelName:"",pagination:{size:11,current:1,total:10},actionType:"",templateList:[],currentTemplateID:"",sourceRule:{templateSourceType:[{required:!0,message:this.$t("dataTemplate.SZYLXBMK")}],templateName:[{required:!0,message:this.$t("dataTemplate.MBMCBLK")},{message:this.$t("dataTemplate.MCCDBNDY"),max:100},{type:"string",pattern:/^[a-zA-Z0-9_\u4e00-\u9fa5.:]*$/,message:this.$t("dataTemplate.ZU"),trigger:"change"}],templateDesc:[{required:!0,message:this.$t("dataTemplate.MOMSBNK")},{required:!1,message:this.$t("dataTemplate.MBCDBNDY"),max:100}],metaStorePaths:[{required:!0,message:"metastore ".concat(this.$t("dataTemplate.DZBNK"))},{required:!1,message:this.$t("dataTemplate.CDBNDY"),max:1e3}],elasticSearchPaths:[{required:!0,message:"ESPaths ".concat(this.$t("dataTemplate.DZBNK"))},{required:!1,message:this.$t("dataTemplate.CDBNDY"),max:1e3}],hdfsPath:[{required:!0,message:"hdfs ".concat(this.$t("dataTemplate.DZBNK"))},{required:!1,message:this.$t("dataTemplate.CDBNDY"),max:1e3}],pathHost:[{required:!0,message:this.$t("dataTemplate.DZBNWK")}],pathPort:[{required:!0,message:this.$t("dataTemplate.DZBNWK")},{validator:n,trigger:"blur"}],authType:[{required:!0,message:this.$t("dataTemplate.DZBNWK")}],hostName:[{required:!1,message:"hostName ".concat(this.$t("dataTemplate.BNWK"))}],realm:[{required:!0,message:"realm ".concat(this.$t("dataTemplate.BNWK"))}],elasticPath:[{required:!0,message:"elasticUrl ".concat(this.$t("dataTemplate.BNWK"))}],sqlPathHost:[{required:!0,message:y()(e="sql ".concat(this.$t("dataTemplate.DZ")," host ")).call(e,this.$t("dataTemplate.BNWK"))}],sqlPathPort:[{required:!0,message:y()(t="sql ".concat(this.$t("dataTemplate.DZ")," port ")).call(t,this.$t("dataTemplate.BNWK"))}],serviceName:[{validator:s,trigger:"blur"},{type:"string",pattern:/^[a-zA-Z0-9_\u4e00-\u9fa5.:]*$/,message:this.$t("dataTemplate.ZU"),trigger:"change"}],serviceSid:[{validator:s,trigger:"blur"},{type:"string",pattern:/^[a-zA-Z0-9]*$/,message:this.$t("message.newComponents.SupportonlylettersandNumbers"),trigger:"change"}]}}},computed:{authTypeList:function(){var e=[];return"HIVE"===this.selectSourceType||"HDFS"===this.selectSourceType?e=[{value:"KERBERS",label:"kerbers"},{value:"LDAP",label:"LDAP"}]:"SFTP"===this.selectSourceType?e=[{value:"DEFAULT",label:this.$t("dataTemplate.MR")},{value:"KEYFILE",label:"keyFile"}]:"ElasticSearch"!==this.selectSourceType&&"MYSQL"!==this.selectSourceType&&"ORACLE"!==this.selectSourceType||(e=[{value:"DEFAULT",label:this.$t("dataTemplate.MR")}]),"HIVE"!==this.selectSourceType&&"HDFS"!==this.selectSourceType&&"ElasticSearch"!==this.selectSourceType||e.push({value:"NONE",label:this.$t("dataTemplate.WQX")}),e},newHadoopValue:function(){return"MYSQL"===this.selectSourceType?this.parameter.connParams:this.parameter.hadoopConfigs},modelTitle:function(){return"view"===this.actionType?this.$t("dataTemplate.CKMB"):"modify"===this.actionType?this.$t("dataTemplate.XGMB"):this.$t("dataTemplate.TJMB")},userName:function(){return this.FesApp.get("FesUserName")}},watch:{selectSourceType:function(e){"add"===this.actionType&&(this.parameter.authType=this.authTypeList[0].value)}},FesReady:function(){this.searchQuery()},methods:{init:function(){this.parameter={metaStorePaths:[{content:""}],hdfsPath:"",hadoopConfigs:[{key:"",value:""}],connParams:[{key:"",value:""}],authType:"KERBERS",sftpPath:{host:"",port:""},hostname:"",realminfo:""},this.selectSourceType="HIVE",this.templateName="",this.description=""},addAction:function(){this.addShow=!0,this.actionType="add",this.init()},sourceMetaPlus:function(){1===this.parameter.metaStorePaths.length&&(this.parameter.metaStorePaths[0].icon="md-remove"),this.parameter.metaStorePaths.push({content:"",icon:"md-remove"})},sourceMetaMinus:function(e){var t;v()(t=this.parameter.metaStorePaths).call(t,e,1),1===this.parameter.metaStorePaths.length&&(this.parameter.metaStorePaths[0].icon="")},sourceConfPlus:function(e){1===this.parameter[e].length&&(this.parameter[e][0].icon="md-remove"),this.parameter[e].push({key:"",value:"",icon:"md-remove"})},sourceConfMinus:function(e,t){var a;v()(a=this.parameter[t]).call(a,e,1),1===this.parameter[t].length&&(this.parameter[t][0].icon="")},parameterValue:function(){var e={};if("HIVE"===this.selectSourceType||"HDFS"===this.selectSourceType){var t;if("HIVE"===this.selectSourceType){var a="";for(var s in this.parameter.metaStorePaths){var n;a+="thrift://"+D()(n=this).call(n,this.parameter.metaStorePaths[s].content),b()(s)!==this.parameter.metaStorePaths.length-1&&(a+=",")}e.hiveMetastoreUris=a}e.defaultFS="hdfs://"+D()(t=this).call(t,this.parameter.hdfsPath);var i={};for(var r in e.hadoopConfig=i,this.parameter.hadoopConfigs){var o,l,c=this.parameter.hadoopConfigs[r];if(null!==c.key&&""!==c.key)i[D()(o=this).call(o,c.key)]=D()(l=this).call(l,c.value)}e.authType=this.parameter.authType,"KERBERS"===this.parameter.authType&&"NONE"!==e.authType?(e.haveKerberos=!0,e.hostname=this.parameter.hostname,e.realminfo=this.parameter.realminfo):e.haveKerberos=!1}else if("ElasticSearch"===this.selectSourceType){var u="";for(var d in this.parameter.metaStorePaths){var h;u+="http://"+D()(h=this).call(h,this.parameter.metaStorePaths[d].content),b()(d)!==this.parameter.metaStorePaths.length-1&&(u+=",")}e.elasticUrls=u,e.authType=this.parameter.authType,e.haveKerberos=!1}else if("MYSQL"===this.selectSourceType){var p={};for(var f in e.connParams=p,this.parameter.connParams){var g,S,v=this.parameter.connParams[f];if(null!==v.key&&""!==v.key)p[D()(g=this).call(g,v.key)]=D()(S=this).call(S,v.value)}e.host=this.parameter.host,e.port=this.parameter.port,e.authType=this.parameter.authType,e.haveKerberos=!1}else"ORACLE"===this.selectSourceType?(e.serviceName=this.parameter.serviceName,e.sid=this.parameter.sid,e.host=this.parameter.host,e.port=this.parameter.port,e.authType=this.parameter.authType,e.haveKerberos=!1):(e.host=this.parameter.host,e.port=this.parameter.port,e.authType=this.parameter.authType,e.haveKerberos=!1);return m()(e)},addConfirm:function(){var e=this;this.checkHadoop("key")||this.$refs.templateForm.validate((function(t){if(t){if(e.checkName(e.templateName,e.currentTemplateID))return e.$Toast.error(e.$t("dataTemplate.MBMCBKTM"));e.FesFesx.set("isLoading",!0),"add"===e.actionType?e.FesApi.fetch("/model/add",{modelName:e.templateName,modelDesc:e.description,sourceType:e.selectSourceType,parameter:e.parameterValue()},"post").then((function(){e.$Toast.success(e.$t("dataTemplate.XZMBCG")),e.searchQuery(e.pagination.current,e.pagination.size)}))["catch"]((function(){e.FesFesx.set("isLoading",!1)})):e.FesApi.fetch("/model/update/".concat(e.currentTemplateID),{id:e.currentTemplateID,modelName:e.templateName,modelDesc:e.description,sourceType:e.selectSourceType,parameter:e.parameterValue()},{},"put").then((function(){e.$Toast.success(e.$t("dataTemplate.XGMBCG")),e.searchQuery(e.pagination.current,e.pagination.size)}))["catch"]((function(){e.FesFesx.set("isLoading",!1),e.$Toast.error(e.$t("dataTemplate.XGMBSB"))}))}else e.addShow=!0}))},deleteAction:function(e){var t;if(!this.checkAuthority(e,"DELETE"))return this.$Toast.warn(this.$t("pageDs.YHWSCQX"));var a=this;this.$Message({title:this.$t("dataTemplate.SCMB"),template:y()(t="".concat(this.$t("dataTemplate.QRSCMB")," ")).call(t,e.modelName),buttons:[{text:this.$t("dataTemplate.QR"),show:!0},{text:this.$t("dataTemplate.FQ"),show:!0}]}).then((function(t){0==t&&(a.FesFesx.set("isLoading",!0),a.FesApi.fetch("model/delete/".concat(e.id),{},"delete").then((function(){var t,s;a.$Toast.success(y()(t=y()(s="".concat(a.$t("dataTemplate.MB")," ")).call(s,e.modelName," ")).call(t,a.$t("dataTemplate.SCCG"))),a.searchQuery()}))["catch"]((function(){a.FesFesx.set("isLoading",!1)})))}))},reviewParameterData:function(e){var t=JSON.parse(e.parameter);if("HIVE"===this.selectSourceType){var a=t.hiveMetastoreUris.split(","),s=[];for(var n in a)s.push({content:a[n].substring("thrift://".length),icon:"md-remove"});1===s.length&&(s[0].icon=""),this.parameter.metaStorePaths=s}if("ElasticSearch"===this.selectSourceType){var i=t.elasticUrls.split(","),r=[];for(var o in i)r.push({content:i[o].substring("http://".length),icon:"md-remove"});1===r.length&&(r[0].icon=""),this.parameter.metaStorePaths=r}if("HIVE"===this.selectSourceType||"HDFS"===this.selectSourceType){this.parameter.hdfsPath=t.defaultFS.substring("hdfs://".length);var l=[];for(var c in t.hadoopConfig)l.push({key:c,value:t.hadoopConfig[c],icon:"md-remove"});(!t.hadoopConfig||h()(t.hadoopConfig).length<=0)&&l.push({key:"",value:"",icon:"md-add"}),1===l.length&&(l[0].icon=""),this.parameter.hadoopConfigs=l}else if("MYSQL"===this.selectSourceType){var u=[];for(var d in t.connParams)u.push({key:d,value:t.connParams[d],icon:"md-remove"});(!t.connParams||h()(t.connParams).length<=0)&&u.push({key:"",value:"",icon:"md-add"}),1===u.length&&(u[0].icon=""),this.parameter.connParams=u,this.parameter.host=t.host,this.parameter.port=t.port}else"ORACLE"===this.selectSourceType?(this.parameter.serviceName=t.serviceName,this.parameter.sid=t.sid,this.parameter.host=t.host,this.parameter.port=t.port):(this.parameter.host=t.host,this.parameter.port=t.port);this.parameter.authType=t.authType,"KERBERS"!==this.parameter.authType&&"KEYFILE"!==this.parameter.authType||(this.parameter.hostname=t.hostname,this.parameter.realminfo=t.realminfo)},detailAction:function(e){this.actionType="view",this.addShow=!0,this.selectSourceType=e.sourceType,this.templateName=e.modelName,this.description=e.modelDesc,this.reviewParameterData(e)},modifyAction:function(e){if(!this.checkAuthority(e,"WRITE"))return this.$Toast.warn(this.$t("pageDs.YHWBJQX"));this.actionType="modify",this.addShow=!0,this.selectSourceType=e.sourceType,this.templateName=e.modelName,this.description=e.modelDesc,this.currentTemplateID=e.id,this.reviewParameterData(e)},searchQuery:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:11;this.FesFesx.set("isLoading",!0),this.FesApi.fetch("/model/pageList",{modelName:this.queryModelName,sourceType:this.querySourceType,page:t,pageSize:a},"get").then((function(t){e.FesFesx.set("isLoading",!1),e.templateList=t.data,e.pagination.size=t.pageSize,e.pagination.current=t.page,e.pagination.total=t.totalPages}))["catch"]((function(){e.FesFesx.set("isLoading",!1)}))},pageChange:function(e){var t=e.current,a=e.size;this.searchQuery(t,a)},checkHadoop:function(e){var t,a,s,n=[];if(u()(t=this.newHadoopValue).call(t,(function(t){n.push(t[e])})),this.checkHadoopRegex(n))return this.$Toast.error(y()(a=y()(s="HADOOP".concat(this.$t("dataTemplate.PZ")," ")).call(s,"key"==e?this.$t("dataTemplate.J"):this.$t("dataTemplate.Z"))).call(a,this.$t("dataTemplate.CF"))),!0},checkHadoopRegex:function(e){for(var t=l()(e).call(e),a=0;a0&&e.append("id",this.sourceForm.id),e},isOwnerOrAdmin:function(e){var t,a=this.FesStorage.get("userRole");return e.createUser===this.userName||r()(t=["super","admin"]).call(t,a)},checkAuthority:function(e){var t,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.FesStorage.get("userRole");return!(e.createUser!==this.userName&&!r()(t=["super","admin"]).call(t,n)&&"add"!==this.activeType)||!!(s&&e.authScopes&&r()(a=e.authScopes).call(a,s))}}},H=Y,Q=(a("d7a2"),Object(_["a"])(H,E,I,!1,null,"78d99f2e",null));Q.options.__file="src/components/uiTemplate/sourceForm.fes";var U=Q.exports,G={components:{weModal:w["a"],sourceForm:U,weLoading:L},FesData:function(){return{loading:!1,search:{source:"",name:"",owner:""},dsOwners:[],pagination:{size:10,current:1,total:0},sourceData:[],sourceFormShow:!1,formTitle:"",currentType:"",activeType:"",modifyData:{},projectDataList:[]}},computed:{userName:function(){return this.FesApp.get("FesUserName")}},FesReady:function(){this.loadOwners(),this.searchQuery(),this.getProjectData()},methods:{getProjectName:function(e){var t;if(!e||e<=0)return"---";var a=R()(t=this.projectDataList).call(t,(function(t){return t.id===e}));return a?a.projectName:e},getProjectData:function(){var e=this;this.FesApi.fetch("/project/selectAll","get").then((function(t){e.projectDataList=t}))},loadOwners:function(){var e=this;this.FesApi.fetch("/admin/dsOwner/selectAll","get").then((function(t){e.dsOwners=t}))["catch"]((function(e){console.log(e)}))},searchQuery:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.loading=!0,this.FesApi.fetch("/datasource/pageList",{sourceName:this.search.name,sourceType:this.search.source,owner:this.search.owner,page:t,pageSize:a},"get").then((function(t){e.loading=!1,e.pagination.total=t.totalPages,e.pagination.current=t.page,e.sourceData=t.data}))["catch"]((function(){e.loading=!1}))},showChooseWind:function(){this.$refs.ds_choose.show()},pageChange:function(e){var t=e.current,a=e.size;this.searchQuery(t,a)},showAddWind:function(e,t){this.$refs.ds_choose.close(),this.sourceFormShow=!0,this.formTitle=t,this.currentType=e,this.activeType="add",this.modifyData=null},sourceAdd:function(e){var t=this;this.loading=!0,this.FesApi.fetch("/datasource/addAttach",e,{method:"post",headers:{"Content-Type":"multipart/form-data"}}).then((function(){t.sourceFormShow=!1,t.$Toast.success(t.$t("manager.CJSJYCG")),t.searchQuery()}))["catch"]((function(){t.loading=!1}))},sourceUpdate:function(e){var t=this;this.loading=!0,this.FesApi.fetch("/datasource/updateAttach",e,{method:"post",headers:{"Content-Type":"multipart/form-data"}}).then((function(){t.sourceFormShow=!1,t.$Toast.success(t.$t("manager.GXCG")),t.searchQuery(),t.loading=!1}))},sourceConnect:function(e){var t=this;this.loading=!0,this.FesApi.fetch("/datasource/connect/check/".concat(this.currentType.toLowerCase()),e,{method:"post",headers:{"Content-Type":"multipart/form-data"},timeout:"60000"}).then((function(){t.loading=!1,t.$Toast.success(t.$t("manager.LJSJYCG"))}))["catch"]((function(){t.loading=!1}))},sourceDelete:function(e){var t=this;if(!this.checkAuthority(e,"DELETE"))return this.$Toast.warn(this.$t("pageDs.YHWSCQX"));this.$Message.confirm(this.$t("manager.SCSJY"),"".concat(this.$t("manager.SFSCSJY",{name:e.sourceName}),"?")).then((function(a){0===a&&(t.loading=!0,t.FesApi.fetch("/datasource/delete/".concat(e.id),{},"delete").then((function(){t.$Toast.success(t.$t("manager.SCSJYCG")),t.searchQuery()}))["catch"]((function(){t.loading=!1})))}))},sourceModify:function(e){var t=this;if(!this.checkAuthority(e,"WRITE"))return this.$Toast.warn(this.$t("pageDs.YHWBJQX"));var a=function(){return"hive"===e.sourceType?"HIVE".concat(t.$t("manager.SJY")):"hdfs"===e.sourceType?"HDFS".concat(t.$t("manager.SJY")):"sftp"===e.sourceType?"SFTP".concat(t.$t("manager.SJY")):"mysql"===e.sourceType?"MYSQL".concat(t.$t("manager.SJY")):void 0};this.sourceFormShow=!0,this.formTitle=a(),this.currentType=e.sourceType.toUpperCase(),this.activeType="update",this.modifyData=e},sourceDetail:function(e){var t=this;if(!this.checkAuthority(e,"READ"))return this.$Toast.warn(this.$t("pageDs.YHWBJQX"));this.FesApi.fetch("/datasource/view/".concat(e.id),{},"get").then((function(e){var a=function(){return"hive"===e.sourceType?"HIVE".concat(t.$t("manager.SJY")):"hdfs"===e.sourceType?"HDFS".concat(t.$t("manager.SJY")):"sftp"===e.sourceType?"SFTP".concat(t.$t("manager.SJY")):"mysql"===e.sourceType?"MYSQL".concat(t.$t("manager.SJY")):void 0};t.sourceFormShow=!0,t.formTitle=a(),t.currentType=e.sourceType.toUpperCase(),t.activeType="detail",t.modifyData=e}))},checkAuthority:function(e){var t,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.FesStorage.get("userRole");return!(e.createUser!==this.userName&&!r()(t=["super","admin"]).call(t,n))||!!(s&&e.authScopes&&r()(a=e.authScopes).call(a,s))}}},V=G,q=(a("99e6"),Object(_["a"])(V,M,Z,!1,null,"c91c522c",null));q.options.__file="src/pages/ds/newManager/index.fes";var z=q.exports,K=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("diV",{staticClass:"group-box"},[a("Row",{staticClass:"group-header"},[a("Cell",{staticClass:"header-item",attrs:{span:"3"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.deleteGroupList}},[e._v("\n "+e._s(e.$t("group.SCYXX"))+"\n ")])],1),a("Cell",{attrs:{span:"6"}},[a("Row",[a("Cell",{attrs:{span:"5"}},[e._v("\n "+e._s(e.$t("group.FZBH"))+"\n ")]),a("Cell",{attrs:{span:"15"}},[a("Wb-input",{attrs:{placeholder:e.$t("group.SRDZGSS")},on:{"on-enter":function(t){return e.search()}},model:{value:e.groupNum,callback:function(t){e.groupNum=t},expression:"groupNum"}})],1)],1)],1),a("Cell",{attrs:{span:"6"}},[a("Row",[a("Cell",{attrs:{span:"5"}},[e._v("\n "+e._s(e.$t("group.FZM"))+"\n ")]),a("Cell",{attrs:{span:"15"}},[a("Wb-input",{attrs:{placeholder:e.$t("group.SRFZMSS")},on:{"on-enter":function(t){return e.search()}},model:{value:e.groupName,callback:function(t){e.groupName=t},expression:"groupName"}})],1),a("Cell",{attrs:{span:"1",offset:"1"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:function(t){return e.search()}}},[e._v("\n "+e._s(e.$t("group.CX"))+"\n ")])],1)],1)],1),a("Cell",{staticClass:"header-item",attrs:{span:"3",offset:"6"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.addGroup}},[e._v("\n "+e._s(e.$t("group.TJFZ"))+"\n ")])],1)],1),a("Row",{staticClass:"group-content"},[a("Wb-table",{ref:"groupTable",attrs:{data:e.dataList,"no-data-text":e.$t("group.ZWSJ")}},[a("Column",{attrs:{type:"selection"}}),a("Column",{attrs:{prop:"id",name:e.$t("group.FZBH")}}),a("Column",{attrs:{prop:"groupName",name:e.$t("group.FZM")}}),a("Column",{attrs:{prop:"groupDesc",name:e.$t("group.MS")}}),a("Column",{attrs:{prop:"createUser",name:e.$t("group.CJR")}}),a("Column",{attrs:{component:e.bindProjectComponent,name:e.$t("group.BDXM")}}),a("Column",{attrs:{prop:"createTime",name:e.$t("group.CJSJ")}}),a("Column",{attrs:{prop:"modifyTime",name:e.$t("group.GXSJ")}}),a("Column",{attrs:{name:e.$t("group.XQ"),action:e.groupDetail}})],1),a("Pagination",{staticClass:"groupPagination page-loc",attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.changePage}})],1),a("weLoading",{directives:[{name:"show",rawName:"v-show",value:e.FesFesx.isLoading,expression:"FesFesx.isLoading"}]})],1)},ee=[];K._withStripped=!0;var te=a("72b6"),ae=a.n(te),se={data:function(){return{groupNum:"",groupName:"",dataList:[],deleteList:[],pagination:{size:10,current:1,total:10,locking:!1},groupDetail:[{text:this.$t("group.CKXQ"),func:this.groupDetailAction}],bindProjectComponent:this.bindProject}},components:{weLoading:L,weModal:w["a"]},created:function(){this.search(1,10)},methods:{bindProject:function(e){return new Vue({data:function(){return{trData:e}},methods:{getProjectName:function(e){return e.project?e.project.projectName:"---"},getStyle:function(){return"{\n border: none;\n padding: 0 10px;\n background-color: #ff9988;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 90px;\n border-radius: 5px;\n color: #f7f7f7;\n line-height: 25px;\n display: inline-block;\n }"}},template:'{{getProjectName(trData)}}'})},addGroup:function(){var e,t=this.FesStorage.get("userRole");if(!r()(e=["super","admin"]).call(e,t))return this.$Toast.warn(this.$t("message.newAllPage.Noaddgrouppermissions"));this.$router.push({path:"/group/groupDetail"})},changePage:function(e){var t=e.current,a=e.size;this.search(t,a)},groupDetailAction:function(e){this.$router.push({path:"/group/groupDetail?id="+e.id})},search:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.pagination.total=0,this.FesFesx.set("isLoading",!0);var s={page:t,pageSize:a,id:this.groupNum,groupName:this.groupName};return this.FesApi.fetch("/group/pageList",s,"get").then((function(t){e.FesFesx.set("isLoading",!1);var s=t.code;0!=s?e.$Toast.error(t.message):(e.dataList=t.data,e.FesFesx.set("groupDataList",t.data),e.pagination.total=t.totalPages,e.pagination.current=t.page,e.pagination.size=a)}))["catch"]((function(){e.FesFesx.set("isLoading",!1)})),!1},deleteGroupList:function(){var e,t,a,s=this,n=this.FesStorage.get("userRole");if(!r()(e=["super","admin"]).call(e,n))return this.$Toast.warn($t("message.newAllPage.Nodeletegrouppermissions"));(this.deleteList=this.$refs.groupTable.getSelected(),this.deleteList.length<=0)?this.$Toast(this.$t("group.XZYSCDFZ")):this.$Message.confirm(this.$t("group.SCFZ"),y()(t="".concat(this.$t("group.QRSCFZ"))).call(t,ae()(a=this.deleteList).call(a,(function(e){return e.groupName})).join(",")," ?")).then((function(e){0===e&&s.confirm()}))},confirm:function(){var e,t=this;this.FesFesx.set("isLoading",!0);var a=ae()(e=this.deleteList).call(e,(function(e){return e.id})).join(",");this.FesApi.fetch("/group/delBatch",{ids:a}).then((function(e){t.FesFesx.set("isLoading",!1),t.$Toast.success(t.$t("group.FZSCCG")),t.search()}))["catch"]((function(){t.FesFesx.set("isLoading",!1)}))}}},ne=se,ie=(a("363e"),Object(_["a"])(ne,K,ee,!1,null,"0303e37c",null));ie.options.__file="src/pages/group/index.fes";var re=ie.exports,oe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"detail-box"},[a("div",{staticClass:"detail-header"},[a("h2",[e._v(e._s(e.$t("group.FZXQ")))]),a("Wb-button",{attrs:{type:"primary"},on:{click:e.addGroupAction}},[e._v("\n "+e._s(e.saveText)+"\n ")]),a("Wb-button",{on:{click:e.goback}},[e._v("\n "+e._s(e.$t("group.FH"))+"\n ")])],1),a("Panel",{attrs:{title:e.$t("group.JCXX")}},[a("Wb-form",{ref:"formValidate",staticClass:"group-detail-form",attrs:{"label-position":"left","label-width":100}},[a("Form-item",{attrs:{label:e.$t("group.FZM"),prop:"groupName",rule:[{required:!0,message:e.$t("group.FZMBNK")},{type:"string",pattern:/^[a-zA-Z0-9_\u4e00-\u9fa5\[\]]*$/,message:e.$t("group.ZCZZM"),trigger:"blur"}]}},[a("wb-input",{attrs:{placeholder:e.$t("group.QSR"),type:"text",disabled:!e.isAdmin},model:{value:e.groupName,callback:function(t){e.groupName=t},expression:"groupName"}})],1),a("Form-item",{attrs:{label:e.$t("group.FZMS")}},[a("wb-input",{attrs:{placeholder:e.$t("group.QSR"),type:"text",disabled:!e.isAdmin},model:{value:e.groupDesc,callback:function(t){e.groupDesc=t},expression:"groupDesc"}})],1),a("Form-item",{attrs:{label:e.$t("group.BDXM"),prop:"bindProject"}},[a("Wb-select",{attrs:{disabled:!e.isAdmin},model:{value:e.bindProject,callback:function(t){e.bindProject=t},expression:"bindProject"}},e._l(e.projectDataList,(function(e){return a("wb-option",{key:e.id,attrs:{value:e.id,label:e.projectName}})})),1)],1),a("div",{staticClass:"detail-save"})],1)],1),a("Panel",{staticClass:"group-user-panel",attrs:{title:e.$t("group.FZCY")}},[a("Row",{staticClass:"group-header"},[a("Cell",{staticClass:"header-item",attrs:{span:"3"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.deleteUser}},[e._v("\n "+e._s(e.$t("group.SCYXX"))+"\n ")])],1),a("Cell",{attrs:{span:"6"}},[a("Row",[a("Cell",{attrs:{span:"4"}},[e._v("\n "+e._s(e.$t("group.YHM"))+"\n ")]),a("Cell",{attrs:{span:"16"}},[a("Wb-input",{attrs:{placeholder:e.$t("group.SRYHMSS")},model:{value:e.searchUserName,callback:function(t){e.searchUserName=t},expression:"searchUserName"}})],1),a("Cell",{attrs:{span:"1",offset:"1"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.searchAction}},[e._v("\n "+e._s(e.$t("group.CX"))+"\n ")])],1)],1)],1),a("Cell",{staticClass:"header-item",attrs:{span:"3",offset:"12"}},[a("Wb-button",{attrs:{type:"primary"},on:{click:e.addUser}},[e._v("\n "+e._s(e.$t("group.TICY"))+"\n ")])],1)],1),a("Row",{staticClass:"group-content"},[a("Wb-table",{ref:"userTable",attrs:{data:e.currentUserData,"no-data-text":e.$t("group.ZWSJ"),border:""}},[a("Column",{attrs:{type:"selection"}}),a("Column",{attrs:{prop:"userId",name:e.$t("group.YH")}}),a("Column",{attrs:{prop:"userName",name:e.$t("group.YHM")}})],1)],1),a("div",{staticClass:"page-pagination"},[a("Pagination",{staticClass:"group-pagination",attrs:{current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.changePage}})],1)],1),a("weModal",{attrs:{title:e.$t("group.TICY"),width:"500",closable:!1},on:{onConfirm:e.addConfirm},model:{value:e.addShow,callback:function(t){e.addShow=t},expression:"addShow"}},[a("Wb-form",{ref:"addUserForm"},[a("Form-item",{attrs:{label:e.$t("group.XZYH"),prop:"selectUserName",rule:[{validator:e.validateUserName,trigger:"change"}]}},[a("Wb-select",{attrs:{multiple:"",filterable:""},on:{"on-change":e.selcetChange,"on-search":e.filterSearch},model:{value:e.selectUserName,callback:function(t){e.selectUserName=t},expression:"selectUserName"}},e._l(e.selectUserIdList,(function(e){return a("wb-option",{key:e.userId,attrs:{value:e.userName,label:e.userName}})})),1)],1),a("Form-item",{attrs:{label:e.$t("group.YHM")}},[a("wb-input",{attrs:{type:"textarea",placeholder:e.$t("group.SRWB"),readonly:""},model:{value:e.userName,callback:function(t){e.userName=t},expression:"userName"}})],1)],1)],1),a("weLoading",{directives:[{name:"show",rawName:"v-show",value:e.isLoading,expression:"isLoading"}]})],1)},le=[];oe._withStripped=!0;var ce=a("dace"),ue=a.n(ce),de=a("3ebb"),he=a.n(de),pe=a("ac15"),me=a.n(pe),fe=a("34d8"),be=a.n(fe),ge={data:function(){return{searchUserName:"",groupName:"",groupDesc:"",userData:[],currentUserData:[],userList:[],pagination:{size:10,current:1,total:0},addShow:!1,deleteList:[],selectUserName:[],selectUserIdList:[],userName:"",saveText:this.$t("group.TJFZ"),isChange:!1,isLoading:!1,projectDataList:[],bindProject:""}},components:{weModal:w["a"],weLoading:L},created:function(){this.addGroupUserList(),this.getProjectData(),this.FesFesx.set("isChange",!1),this.$route.query.id?(this.groupDetailAction(),this.saveText=this.$t("group.BCXG")):this.search()},watch:{userList:{handler:function(e){this.pageTotalAction(e)},deep:!0},isChange:function(e){this.FesFesx.set("isChange",e)},routedPath:function(e){var t=this;e&&this.$Message.confirm(this.$t("group.BCTS"),this.$t("group.FZXXTXSFBC")).then((function(a){0===a?t.addGroupAction(e):(t.FesFesx.set("isChange",!1),t.$router.push({path:e}))}))}},computed:{routedPath:function(){return this.FesFesx.get("isGoto")},isAdmin:function(){var e,t=this.FesStorage.get("userRole");return r()(e=["super","admin"]).call(e,t)}},methods:{getProjectData:function(){var e=this;this.FesApi.fetch("/project/selectAll","get").then((function(t){e.projectDataList=t}))},validateUserName:function(e,t,a){be()(t).call(t,(function(e){return/^[a-zA-Z0-9_\u4e00-\u9fa5]*$/.test(e)}))?a():a(new Error(this.$t("group.ZCZZM")))},goback:function(){if(this.isChange&&this.$route.query.id)return this.$Toast(this.$t("group.XGFZNRWBC"));this.FesApp.router.push("/group")},addUser:function(){this.addShow=!0},addGroupUserList:function(){var e=this;this.isLoading=!0,this.FesApi.fetch("/usergroup/getAvailableUser",{},"post").then((function(t){e.selectUserIdList=t,e.isLoading=!1}))["catch"]((function(){e.isLoading=!1}))},groupDetailAction:function(){var e=this;this.FesApi.fetch("/group/view/".concat(this.$route.query.id),{},"get").then((function(t){e.groupName=t.groupName,e.groupDesc=t.groupDesc,e.userList=t.userList?t.userList:[],e.bindProject=t.projectId,e.pagination.total=Math.ceil(e.userList.length/e.pagination.size),e.search(e.pagination.current,e.pagination.size)}))},addGroupAction:function(){var e=this;this.$refs.formValidate.validate((function(t){if(t)if(e.isLoading=!0,e.$route.query.id){var a={id:e.$route.query.id,groupName:e.groupName,groupDesc:e.groupDesc,userList:e.userList,projectId:e.bindProject};e.FesApi.fetch("/group/update/".concat(a.id),a,"post").then((function(t){e.isLoading=!1,e.isChange=!1,e.FesFesx.set("isChange",!1),e.$Toast.success(e.$t("group.FZXG",{name:a.groupName})),e.FesApp.router.push("/group")}))["catch"]((function(){e.FesFesx.set("isChange",!1),e.isLoading=!1}))}else{var s={groupName:e.groupName,groupDesc:e.groupDesc,userList:e.userList,projectId:e.bindProject};e.FesApi.fetch("/group/add",s,"post").then((function(t){e.isLoading=!1,e.isChange=!1,e.FesFesx.set("isChange",!1),e.$Toast.success(e.$t("group.CJCG",{name:s.groupName})),e.$router.go(-1)}))["catch"]((function(){e.FesFesx.set("isChange",!1),e.isLoading=!1}))}else e.$Toast(e.$t("group.TXZQBD"))}))},pageTotalAction:function(e){this.pagination.total=Math.ceil(e.length/this.pagination.size)},changePage:function(e){var t=e.current,a=e.size;this.search(t,a),this.pagination.current=t,this.pagination.size=a},searchAction:function(){this.search(1,10),this.pagination.current=1},search:function(){var e,t=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=me()(e=this.userList).call(e,(function(e){var a=RegExp(t.searchUserName);return a.test(e.userName)||!t.searchUserName}));this.currentUserData=me()(n).call(n,(function(e,t){return(a-1)*s<=t&&t\n \n '.concat(e.$t("job.BJ"),'\n \n \n ')).call(o,e.$t("job.ZX"),'\n \n \n ')).call(r,e.$t("job.FZ"),'\n \n \n ')).call(i,e.$t("job.ZTDS"),'\n \n \n ')).call(n,e.$t("job.QDDS"),'\n \n \n ')).call(s,e.$t("job.SC"),'\n \n \n ')).call(a,e.$t("job.LSSJCP"),"\n \n ")})},validateForm:{startTime:[{required:!0,message:this.$t("job.KSSJBNWK")}],endTime:[{required:!0,message:this.$t("job.JSSJBNWK")}],timeUnit:[{required:!0,message:this.$t("job.SJBNWK")}],timeInterval:[{required:!0,message:this.$t("job.JGCDBNWK")}]},unitList:["DAY"],unitValue:"DAY",intervalValue:1}},components:{weLoading:L,weModal:w["a"]},watch:{dateValueStart:function(e){e>(new Date).getTime()||e>this.dateValueEnd?(this.$Toast.error(this.$t("job.XZZQDKSSJ")),this.checkTimeResult=!0):this.checkTimeResult=!1},dateValueEnd:function(e){e>(new Date).getTime()||this.dateValueStart>e?(this.$Toast.error(this.$t("job.XZZQDJSSJ")),this.checkTimeResult=!0):this.checkTimeResult=!1},"FesFesx.enginSelect":function(e){}},methods:{searchProject:function(){this.$refs.job_left_tree.searchProject(this.searchProjectName)},resetTaskAction:function(){var e=this;this.$refs.resetTaskForm.validate((function(t){if(t){if(e.checkTimeResult)return e.$Toast.error(e.$t("job.QXZHFSJD")),void(e.resetTaskShow=!0);if(e.checkTimeInterval(e.intervalValue))return e.resetTaskShow=!0;var a={jobId:e.currentJobId,startTime:e.dateValueStart,endTime:e.dateValueEnd,unit:e.unitValue,step:e.intervalValue};e.$Message.confirm(e.$t("job.LSSJCP"),e.$t("job.QRCP",{name:e.currentJobName})).then((function(t){0===t&&(e.FesFesx.set("isLoading",!0),e.FesApi.fetch("/jobinfo/history/run",a,{methods:"post",headers:{"Content-Type":"application/json"}}).then((function(){e.FesFesx.set("isLoading",!1),e.$Toast.success(e.$t("job.CPCG"))}))["catch"]((function(){e.FesFesx.set("isLoading",!1)})))}))}else e.resetTaskShow=!0,e.$Toast.warn(e.$t("job.TXZQBD"))}))},showAdd:function(){this.isSave=!0,this.editData="",this.newData={},this.addModalShow=!0},search:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.data=[],this.pagination.total=0,this.FesFesx.set("isLoading",!0);var s={projectId:this.projectId,page:t,pageSize:a,fuzzyName:this.query.jobName,jobId:this.query.jobId};return this.FesApi.fetch("/jobinfo/pageList",s,"get").then((function(s){e.FesFesx.set("isLoading",!1);var n=s.code;0!=n?e.$Toast.error(s.message):(e.data=s.data,e.pagination.total=s.totalPages,e.pagination.current=t,e.pagination.size=a)}))["catch"]((function(){e.FesFesx.set("isLoading",!1)})),!1},changePage:function(e){var t=e.current,a=e.size;this.search(t,a)},saveinfo:function(e){console.log(e)},saveSucess:function(){return this.addModalShow=!1,this.search(this.pagination.current,this.pagination.size),!1},submit:function(){var e=this;this.FesApi.fetch("/project/add",this.newData).then((function(){e.$refs.addProjectModal.hide(),e.$Toast.success(e.$t("job.XMTJCG")),e.$refs.job_left_tree.getTree(),e.newData.projectName="",e.newData.parentId="",e.newData.projectDesc=""}))},menuAddBtn:function(){this.$refs.addProjectModal.show()},addTreeModalShow:function(){this.$refs.addProjectModal.show()},getTreeId:function(e){this.treeId=e,this.projectId=this.treeId,this.search()},checkTimeInterval:function(e){if("DAY"===this.unitValue){if(e>30)return this.$Toast.warn(this.$t("job.JGCDDY30")),!0}else if("HOUR"===this.unitValue){if(e>24)return this.$Toast.warn(this.$t("job.JGCDDY24")),!0}else{if("MINUTE"!==this.unitValue)return!1;if(e>60)return this.$Toast.warn(this.$t("job.JGCDDY60")),!0}}}},Me=Be,Ze=(a("b79c"),Object(_["a"])(Me,Pe,ke,!1,null,null,null));Ze.options.__file="src/pages/job/index.fes";var Xe=Ze.exports,Re=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"udes-login"},[a("div",{staticClass:"login-content"},[a("h2",{staticClass:"sys-title"},[e._v("\n"+e._s(e.$t("message.newAllPage.Welcometologin"))+"\n")]),a("Wb-form",{ref:"loginForm",attrs:{"label-width":0,rule:e.loginRule}},[a("Form-item",{attrs:{prop:"userName"}},[a("wb-input",{attrs:{placeholder:e.$t("message.newAllPage.Pleaseenteryourusername"),maxlength:150},on:{"on-enter":e.loginAction},model:{value:e.userName,callback:function(t){e.userName=t},expression:"userName"}})],1),a("Form-item",{attrs:{prop:"password"}},[a("wb-input",{attrs:{type:"password",placeholder:e.$t("message.newAllPage.Pleaseenterthepassword"),maxlength:150},on:{"on-enter":e.loginAction},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}})],1),a("Form-item",[a("Wb-button",{attrs:{type:"primary",long:""},on:{click:e.loginAction}},[e._v("\n"+e._s(e.$t("message.newAllPage.Thelogin"))+"\n")])],1)],1)],1)])},Ee=[];Re._withStripped=!0;var Ie=a("d68f"),Je=a.n(Ie);(function(){var e;function t(e){var t,a,s,n="",i=-1;if(e&&e.length){s=e.length;while((i+=1)=55296&&t<=56319&&a>=56320&&a<=57343&&(t=65536+((1023&t)<<10)+(1023&a),i+=1),t<=127?n+=String.fromCharCode(t):t<=2047?n+=String.fromCharCode(192|t>>>6&31,128|63&t):t<=65535?n+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(n+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t))}return n}function a(e){var t,a,s,n,i,r,o=[];if(t=a=s=n=i=0,e&&e.length){r=e.length,e+="";while(t191&&s<224?(n=e.charCodeAt(t+1),o[a]=String.fromCharCode((31&s)<<6|63&n),t+=2):(n=e.charCodeAt(t+1),i=e.charCodeAt(t+2),o[a]=String.fromCharCode((15&s)<<12|(63&n)<<6|63&i),t+=3)}return o.join("")}function s(e,t){var a=(65535&e)+(65535&t),s=(e>>16)+(t>>16)+(a>>16);return s<<16|65535&a}function n(e,t){return e<>>32-t}function i(e,t){for(var a,s=t?"0123456789ABCDEF":"0123456789abcdef",n="",i=0,r=e.length;i>>4&15)+s.charAt(15&a);return n}function r(e){var t,a=32*e.length,s="";for(t=0;t>5]>>>24-t%32&255);return s}function o(e){var t,a=32*e.length,s="";for(t=0;t>5]>>>t%32&255);return s}function l(e){var t,a=8*e.length,s=Array(e.length>>2),n=s.length;for(t=0;t>5]|=(255&e.charCodeAt(t/8))<>2),n=s.length;for(t=0;t>5]|=(255&e.charCodeAt(t/8))<<24-t%32;return s}function u(e,t){var a,s,n,i,r,o,l,c,u=t.length,d=Array();for(o=Array(Math.ceil(e.length/2)),i=o.length,a=0;a0){for(r=Array(),n=0,a=0;a0||s>0)&&(r[r.length]=s);d[d.length]=n,o=r}for(l="",a=d.length-1;a>=0;a--)l+=t.charAt(d[a]);for(c=Math.ceil(8*e.length/(Math.log(t.length)/Math.log(2))),a=l.length;a8*e.length?r+=t:r+=i.charAt(n>>>6*(3-s)&63);return r}e={VERSION:"1.0.5",Base64:function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s="=",n=!0;this.encode=function(a){var i,r,o,l="",c=a.length;for(s=s||"=",a=n?t(a):a,i=0;i8*c?s:e.charAt(o>>>6*(3-r)&63);return l},this.decode=function(t){var i,r,o,l,c,u,d,h,p,m,f="",b=[];if(!t)return t;i=m=0,t=t.replace(new RegExp("\\"+s,"gi"),"");do{c=Je()(e).call(e,t.charAt(i+=1)),u=Je()(e).call(e,t.charAt(i+=1)),d=Je()(e).call(e,t.charAt(i+=1)),h=Je()(e).call(e,t.charAt(i+=1)),p=c<<18|u<<12|d<<6|h,r=p>>16&255,o=p>>8&255,l=255&p,m+=1,b[m]=64===d?String.fromCharCode(r):64===h?String.fromCharCode(r,o):String.fromCharCode(r,o,l)}while(i>>8^r;return(-1^i)>>>0},MD5:function(e){var a=!(!e||"boolean"!==typeof e.uppercase)&&e.uppercase,r=e&&"string"===typeof e.pad?e.pda:"=",c=!e||"boolean"!==typeof e.utf8||e.utf8;function h(e){return e=c?t(e):e,o(m(l(e),8*e.length))}function p(e,a){var s,n,i,r,u;for(e=c?t(e):e,a=c?t(a):a,s=l(e),s.length>16&&(s=m(s,8*e.length)),n=Array(16),i=Array(16),u=0;u<16;u+=1)n[u]=909522486^s[u],i[u]=1549556828^s[u];return r=m(y()(n).call(n,l(a)),512+8*a.length),o(m(y()(i).call(i,r),640))}function m(e,t){var a,n,i,r,o,l=1732584193,c=-271733879,u=-1732584194,d=271733878;for(e[t>>5]|=128<>>9<<4)]=t,a=0;a16&&(s=m(s,8*e.length)),n=Array(16),i=Array(16),o=0;o<16;o+=1)n[o]=909522486^s[o],i[o]=1549556828^s[o];return u=m(y()(n).call(n,c(a)),512+8*a.length),r(m(y()(i).call(i,u),672))}function m(e,t){var a,i,r,o,l,c,u,d,h=Array(80),p=1732584193,m=-271733879,g=-1732584194,D=271733878,S=-1009589776;for(e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t,a=0;a16&&(i=C(i,8*e.length));n<16;n+=1)l[n]=909522486^i[n],u[n]=1549556828^i[n];return s=C(y()(l).call(l,c(a)),512+8*a.length),r(C(y()(u).call(u,s),768))}function p(e,t){return e>>>t|e<<32-t}function m(e,t){return e>>>t}function f(e,t,a){return e&t^~e&a}function b(e,t,a){return e&t^e&a^t&a}function g(e){return p(e,2)^p(e,13)^p(e,22)}function D(e){return p(e,6)^p(e,11)^p(e,25)}function S(e){return p(e,7)^p(e,18)^m(e,3)}function v(e){return p(e,17)^p(e,19)^m(e,10)}function C(e,t){var n,i,r,o,l,c,u,d,h,p,m,C,y=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],w=new Array(64);for(e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t,h=0;h32&&(o=h(o,8*e.length));i<32;i+=1)l[i]=909522486^o[i],u[i]=1549556828^o[i];return s=h(y()(l).call(l,c(a)),1024+8*a.length),r(h(y()(u).call(u,s),1536))}function h(e,t){var s,n,i,r=new Array(80),o=new Array(16),l=[new p(1779033703,-205731576),new p(-1150833019,-2067093701),new p(1013904242,-23791573),new p(-1521486534,1595750129),new p(1359893119,-1377402159),new p(-1694144372,725511199),new p(528734635,-79577749),new p(1541459225,327033209)],c=new p(0,0),u=new p(0,0),d=new p(0,0),h=new p(0,0),C=new p(0,0),y=new p(0,0),w=new p(0,0),T=new p(0,0),F=new p(0,0),$=new p(0,0),x=new p(0,0),_=new p(0,0),A=new p(0,0),L=new p(0,0),N=new p(0,0),P=new p(0,0),k=new p(0,0);for(void 0===a&&(a=[new p(1116352408,-685199838),new p(1899447441,602891725),new p(-1245643825,-330482897),new p(-373957723,-2121671748),new p(961987163,-213338824),new p(1508970993,-1241133031),new p(-1841331548,-1357295717),new p(-1424204075,-630357736),new p(-670586216,-1560083902),new p(310598401,1164996542),new p(607225278,1323610764),new p(1426881987,-704662302),new p(1925078388,-226784913),new p(-2132889090,991336113),new p(-1680079193,633803317),new p(-1046744716,-815192428),new p(-459576895,-1628353838),new p(-272742522,944711139),new p(264347078,-1953704523),new p(604807628,2007800933),new p(770255983,1495990901),new p(1249150122,1856431235),new p(1555081692,-1119749164),new p(1996064986,-2096016459),new p(-1740746414,-295247957),new p(-1473132947,766784016),new p(-1341970488,-1728372417),new p(-1084653625,-1091629340),new p(-958395405,1034457026),new p(-710438585,-1828018395),new p(113926993,-536640913),new p(338241895,168717936),new p(666307205,1188179964),new p(773529912,1546045734),new p(1294757372,1522805485),new p(1396182291,-1651133473),new p(1695183700,-1951439906),new p(1986661051,1014477480),new p(-2117940946,1206759142),new p(-1838011259,344077627),new p(-1564481375,1290863460),new p(-1474664885,-1136513023),new p(-1035236496,-789014639),new p(-949202525,106217008),new p(-778901479,-688958952),new p(-694614492,1432725776),new p(-200395387,1467031594),new p(275423344,851169720),new p(430227734,-1194143544),new p(506948616,1363258195),new p(659060556,-544281703),new p(883997877,-509917016),new p(958139571,-976659869),new p(1322822218,-482243893),new p(1537002063,2003034995),new p(1747873779,-692930397),new p(1955562222,1575990012),new p(2024104815,1125592928),new p(-2067236844,-1578062990),new p(-1933114872,442776044),new p(-1866530822,593698344),new p(-1538233109,-561857047),new p(-1090935817,-1295615723),new p(-965641998,-479046869),new p(-903397682,-366583396),new p(-779700025,566280711),new p(-354779690,-840897762),new p(-176337025,-294727304),new p(116418474,1914138554),new p(174292421,-1563912026),new p(289380356,-1090974290),new p(460393269,320620315),new p(685471733,587496836),new p(852142971,1086792851),new p(1017036298,365543100),new p(1126000580,-1676669620),new p(1288033470,-885112138),new p(1501505948,-60457430),new p(1607167915,987167468),new p(1816402316,1246189591)]),n=0;n<80;n+=1)r[n]=new p(0,0);for(e[t>>5]|=128<<24-(31&t),e[31+(t+128>>10<<5)]=t,i=e.length,n=0;n>>a|t.h<<32-a,e.h=t.h>>>a|t.l<<32-a}function b(e,t,a){e.l=t.h>>>a|t.l<<32-a,e.h=t.l>>>a|t.h<<32-a}function g(e,t,a){e.l=t.l>>>a|t.h<<32-a,e.h=t.h>>>a}function D(e,t,a){var s=(65535&t.l)+(65535&a.l),n=(t.l>>>16)+(a.l>>>16)+(s>>>16),i=(65535&t.h)+(65535&a.h)+(n>>>16),r=(t.h>>>16)+(a.h>>>16)+(i>>>16);e.l=65535&s|n<<16,e.h=65535&i|r<<16}function S(e,t,a,s,n){var i=(65535&t.l)+(65535&a.l)+(65535&s.l)+(65535&n.l),r=(t.l>>>16)+(a.l>>>16)+(s.l>>>16)+(n.l>>>16)+(i>>>16),o=(65535&t.h)+(65535&a.h)+(65535&s.h)+(65535&n.h)+(r>>>16),l=(t.h>>>16)+(a.h>>>16)+(s.h>>>16)+(n.h>>>16)+(o>>>16);e.l=65535&i|r<<16,e.h=65535&o|l<<16}function v(e,t,a,s,n,i){var r=(65535&t.l)+(65535&a.l)+(65535&s.l)+(65535&n.l)+(65535&i.l),o=(t.l>>>16)+(a.l>>>16)+(s.l>>>16)+(n.l>>>16)+(i.l>>>16)+(r>>>16),l=(65535&t.h)+(65535&a.h)+(65535&s.h)+(65535&n.h)+(65535&i.h)+(o>>>16),c=(t.h>>>16)+(a.h>>>16)+(s.h>>>16)+(n.h>>>16)+(i.h>>>16)+(l>>>16);e.l=65535&r|o<<16,e.h=65535&l|c<<16}this.hex=function(e){return i(o(e))},this.b64=function(e){return d(o(e),s)},this.any=function(e,t){return u(o(e),t)},this.raw=function(e){return o(e,n)},this.hex_hmac=function(e,t){return i(l(e,t))},this.b64_hmac=function(e,t){return d(l(e,t),s)},this.any_hmac=function(e,t,a){return u(l(e,t),a)},this.vm_test=function(){return"900150983cd24fb0d6963f7d28e17f72"===hex("abc").toLowerCase()},this.setUpperCase=function(e){return"boolean"===typeof e&&e,this},this.setPad=function(e){return s=e||s,this},this.setUTF8=function(e){return"boolean"===typeof e&&(n=e),this}},RMD160:function(e){!(!e||"boolean"!==typeof e.uppercase)&&e.uppercase;var a=e&&"string"===typeof e.pad?e.pda:"=",r=!e||"boolean"!==typeof e.utf8||e.utf8,o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];function m(e){return e=r?t(e):e,b(g(l(e),8*e.length))}function f(e,a){var s,n;e=r?t(e):e,a=r?t(a):a;var i=l(e),o=Array(16),c=Array(16);for(i.length>16&&(i=g(i,8*e.length)),s=0;s<16;s+=1)o[s]=909522486^i[s],c[s]=1549556828^i[s];return n=g(y()(o).call(o,l(a)),512+8*a.length),b(g(y()(c).call(c,n),672))}function b(e){var t,a="",s=32*e.length;for(t=0;t>5]>>>t%32&255);return a}function g(e,t){var a,i,r,l,u,d,m,f,b,g,C,y,w,T,F=1732584193,$=4023233417,x=2562383102,_=271733878,A=3285377520;for(e[t>>5]|=128<>>9<<4)]=t,l=e.length,r=0;r=0&&e<=15?t^a^s:e>=16&&e<=31?t&a|~t&s:e>=32&&e<=47?(t|~a)^s:e>=48&&e<=63?t&s|a&~s:e>=64&&e<=79?t^(a|~s):"rmd160_f: j out of range"}function S(e){return e>=0&&e<=15?0:e>=16&&e<=31?1518500249:e>=32&&e<=47?1859775393:e>=48&&e<=63?2400959708:e>=64&&e<=79?2840853838:"rmd160_K1: j out of range"}function v(e){return e>=0&&e<=15?1352829926:e>=16&&e<=31?1548603684:e>=32&&e<=47?1836072691:e>=48&&e<=63?2053994217:e>=64&&e<=79?0:"rmd160_K2: j out of range"}this.hex=function(e){return i(m(e,r))},this.b64=function(e){return d(m(e,r),a)},this.any=function(e,t){return u(m(e,r),t)},this.raw=function(e){return m(e,r)},this.hex_hmac=function(e,t){return i(f(e,t))},this.b64_hmac=function(e,t){return d(f(e,t),a)},this.any_hmac=function(e,t,a){return u(f(e,t),a)},this.vm_test=function(){return"900150983cd24fb0d6963f7d28e17f72"===hex("abc").toLowerCase()},this.setUpperCase=function(e){return"boolean"===typeof e&&e,this},this.setPad=function(e){return"undefined"!==typeof e&&(a=e),this},this.setUTF8=function(e){return"boolean"===typeof e&&(r=e),this}}},window.Hashes=e})(window);window.Hashes;var We,Oe=0xdeadbeefcafe,je=15715070==(16777215&Oe);function Ye(e,t,a){null!=e&&("number"==typeof e?this.fromNumber(e,t,a):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function He(){return new Ye(null)}function Qe(e,t,a,s,n,i){while(--i>=0){var r=t*this[e++]+a[s]+n;n=Math.floor(r/67108864),a[s++]=67108863&r}return n}function Ue(e,t,a,s,n,i){var r=32767&t,o=t>>15;while(--i>=0){var l=32767&this[e],c=this[e++]>>15,u=o*l+c*r;l=r*l+((32767&u)<<15)+a[s]+(1073741823&n),n=(l>>>30)+(u>>>15)+o*c+(n>>>30),a[s++]=1073741823&l}return n}function Ge(e,t,a,s,n,i){var r=16383&t,o=t>>14;while(--i>=0){var l=16383&this[e],c=this[e++]>>14,u=o*l+c*r;l=r*l+((16383&u)<<14)+a[s]+n,n=(l>>28)+(u>>14)+o*c,a[s++]=268435455&l}return n}je&&"Microsoft Internet Explorer"==navigator.appName?(Ye.prototype.am=Ue,We=30):je&&"Netscape"!=navigator.appName?(Ye.prototype.am=Qe,We=26):(Ye.prototype.am=Ge,We=28),Ye.prototype.DB=We,Ye.prototype.DM=(1<=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function nt(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+DV:this.t=0}function it(e){var t=He();return t.fromInt(e),t}function rt(e,t){var a;if(16==t)a=4;else if(8==t)a=3;else if(256==t)a=8;else if(2==t)a=1;else if(32==t)a=5;else{if(4!=t)return void this.fromRadix(e,t);a=2}this.t=0,this.s=0;var s=e.length,n=!1,i=0;while(--s>=0){var r=8==a?255&e[s]:at(e,s);r<0?"-"==e.charAt(s)&&(n=!0):(n=!1,0==i?this[this.t++]=r:i+a>this.DB?(this[this.t-1]|=(r&(1<>this.DB-i):this[this.t-1]|=r<=this.DB&&(i-=this.DB))}8==a&&0!=(128&e[0])&&(this.s=-1,i>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==e)--this.t}function lt(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else if(64==e)t=6;else{if(4!=e)return this.toRadix(e);t=2}var a,s=(1<0){o>o)>0&&(n=!0,i=tt(a));while(r>=0)o>(o+=this.DB-t)):(a=this[r]>>(o-=t)&s,o<=0&&(o+=this.DB,--r)),a>0&&(n=!0),n&&(i+=tt(a))}return n?i:"0"}function ct(){var e=He();return Ye.ZERO.subTo(this,e),e}function ut(){return this.s<0?this.negate():this}function dt(e){var t=this.s-e.s;if(0!=t)return t;var a=this.t;if(t=a-e.t,0!=t)return t;while(--a>=0)if(0!=(t=this[a]-e[a]))return t;return 0}function ht(e){var t,a=1;return 0!=(t=e>>>16)&&(e=t,a+=16),0!=(t=e>>8)&&(e=t,a+=8),0!=(t=e>>4)&&(e=t,a+=4),0!=(t=e>>2)&&(e=t,a+=2),0!=(t=e>>1)&&(e=t,a+=1),a}function pt(){return this.t<=0?0:this.DB*(this.t-1)+ht(this[this.t-1]^this.s&this.DM)}function mt(e,t){var a;for(a=this.t-1;a>=0;--a)t[a+e]=this[a];for(a=e-1;a>=0;--a)t[a]=0;t.t=this.t+e,t.s=this.s}function ft(e,t){for(var a=e;a=0;--a)t[a+r+1]=this[a]>>n|o,o=(this[a]&i)<=0;--a)t[a]=0;t[r]=o,t.t=this.t+r+1,t.s=this.s,t.clamp()}function gt(e,t){t.s=this.s;var a=Math.floor(e/this.DB);if(a>=this.t)t.t=0;else{var s=e%this.DB,n=this.DB-s,i=(1<>s;for(var r=a+1;r>s;s>0&&(t[this.t-a-1]|=(this.s&i)<>=this.DB;if(e.t>=this.DB;s+=this.s}else{s+=this.s;while(a>=this.DB;s-=e.s}t.s=s<0?-1:0,s<-1?t[a++]=this.DV+s:s>0&&(t[a++]=s),t.t=a,t.clamp()}function St(e,t){var a=this.abs(),s=e.abs(),n=a.t;t.t=n+s.t;while(--n>=0)t[n]=0;for(n=0;n=0)e[a]=0;for(a=0;a=t.DV&&(e[a+t.t]-=t.DV,e[a+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(a,t[a],e,2*a,0,1)),e.s=0,e.clamp()}function Ct(e,t,a){var s=e.abs();if(!(s.t<=0)){var n=this.abs();if(n.t0?(s.lShiftTo(l,i),n.lShiftTo(l,a)):(s.copyTo(i),n.copyTo(a));var c=i.t,u=i[c-1];if(0!=u){var d=u*(1<1?i[c-2]>>this.F2:0),h=this.FV/d,p=(1<=0&&(a[a.t++]=1,a.subTo(g,a)),Ye.ONE.dlShiftTo(c,g),g.subTo(i,i);while(i.t=0){var D=a[--f]==u?this.DM:Math.floor(a[f]*h+(a[f-1]+m)*p);if((a[f]+=i.am(0,D,a,b,0,c))0&&a.rShiftTo(l,a),r<0&&Ye.ZERO.subTo(a,a)}}}function yt(e){var t=He();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(Ye.ZERO)>0&&e.subTo(t,t),t}function wt(e){this.m=e}function Tt(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function Ft(e){return e}function xt(e){e.divRemTo(this.m,null,e)}function _t(e,t,a){var s;e.multiplyTo(t,a),he()(s=this).call(s,a)}function At(e,t){var a;e.squareTo(t),he()(a=this).call(a,t)}function Lt(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return t=t*(2-(15&e)*t)&15,t=t*(2-(255&e)*t)&255,t=t*(2-((65535&e)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Nt(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(t,t),t}function kt(e){var t,a=He();return e.copyTo(a),he()(t=this).call(t,a),a}function Bt(e){while(e.t<=this.mt2)e[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;a=t+this.m.t,e[a]+=this.m.am(0,s,e,t,0,this.m.t);while(e[a]>=e.DV)e[a]-=e.DV,e[++a]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function Mt(e,t){var a;e.squareTo(t),he()(a=this).call(a,t)}function Zt(e,t,a){var s;e.multiplyTo(t,a),he()(s=this).call(s,a)}function Xt(){return 0==(this.t>0?1&this[0]:this.s)}function Rt(e,t){if(e>4294967295||e<1)return Ye.ONE;var a=He(),s=He(),n=t.convert(this),i=ht(e)-1;n.copyTo(a);while(--i>=0)if(t.sqrTo(a,s),(e&1<0)t.mulTo(s,n,a);else{var r=a;a=s,s=r}return t.revert(a)}function Et(e,t){var a;return a=e<256||t.isEven()?new wt(t):new Nt(t),this.exp(e,a)}function It(){var e=He();return this.copyTo(e),e}function Jt(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function Ot(){return 0==this.t?this.s:this[0]<<16>>16}function jt(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function Yt(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function Ht(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),a=Math.pow(e,t),s=it(a),n=He(),i=He(),r="";this.divRemTo(s,n,i);while(n.signum()>0)r=(a+i.intValue()).toString(e).substr(1)+r,n.divRemTo(s,n,i);return i.intValue().toString(e)+r}function Qt(e,t){this.fromInt(0),null==t&&(t=10);for(var a=this.chunkSize(t),s=Math.pow(t,a),n=!1,i=0,r=0,o=0;o=a&&(this.dMultiply(s),this.dAddOffset(r,0),i=0,r=0))}i>0&&(this.dMultiply(Math.pow(t,i)),this.dAddOffset(r,0)),n&&Ye.ZERO.subTo(this,this)}function Ut(e,t,a){if("number"==typeof t)if(e<2)this.fromInt(1);else{this.fromNumber(e,a),this.testBit(e-1)||this.bitwiseTo(Ye.ONE.shiftLeft(e-1),aa,this),this.isEven()&&this.dAddOffset(1,0);while(!this.isProbablePrime(t))this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(Ye.ONE.shiftLeft(e-1),this)}else{var s=new Array,n=7&e;s.length=1+(e>>3),t.nextBytes(s),n>0?s[0]&=(1<0){s>s)!=(this.s&this.DM)>>s&&(t[n++]=a|this.s<=0)s<8?(a=(this[e]&(1<>(s+=this.DB-8)):(a=this[e]>>(s-=8)&255,s<=0&&(s+=this.DB,--e)),0!=(128&a)&&(a|=-256),0==n&&(128&this.s)!=(128&a)&&++n,(n>0||a!=this.s)&&(t[n++]=a)}return t}function Vt(e){return 0==this.compareTo(e)}function qt(e){return this.compareTo(e)<0?this:e}function zt(e){return this.compareTo(e)>0?this:e}function Kt(e,t,a){var s,n,i=Math.min(e.t,this.t);for(s=0;s>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function ha(){for(var e=0;e=this.t?0!=this.s:0!=(this[t]&1<>=this.DB;if(e.t>=this.DB;s+=this.s}else{s+=this.s;while(a>=this.DB;s+=e.s}t.s=s<0?-1:0,s>0?t[a++]=s:s<-1&&(t[a++]=this.DV+s),t.t=a,t.clamp()}function Ca(e){var t=He();return this.addTo(e,t),t}function ya(e){var t=He();return this.subTo(e,t),t}function wa(e){var t=He();return this.multiplyTo(e,t),t}function Ta(){var e=He();return this.squareTo(e),e}function Fa(e){var t=He();return this.divRemTo(e,t,null),t}function $a(e){var t=He();return this.divRemTo(e,null,t),t}function xa(e){var t=He(),a=He();return this.divRemTo(e,t,a),new Array(t,a)}function _a(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function Aa(e,t){if(0!=e){while(this.t<=t)this[this.t++]=0;this[t]+=e;while(this[t]>=this.DV)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}function La(){}function Na(e){return e}function Pa(e,t,a){e.multiplyTo(t,a)}function ka(e,t){e.squareTo(t)}function Ba(e){return this.exp(e,new La)}function Ma(e,t,a){var s,n=Math.min(this.t+e.t,t);a.s=0,a.t=n;while(n>0)a[--n]=0;for(s=a.t-this.t;n=0)a[s]=0;for(s=Math.max(t-this.t,0);s2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t,a=He();return e.copyTo(a),he()(t=this).call(t,a),a}function Ea(e){return e}function Ia(e){e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(e.compareTo(this.r2)<0)e.dAddOffset(1,this.m.t+1);e.subTo(this.r2,e);while(e.compareTo(this.m)>=0)e.subTo(this.m,e)}function Ja(e,t){var a;e.squareTo(t),he()(a=this).call(a,t)}function Wa(e,t,a){var s;e.multiplyTo(t,a),he()(s=this).call(s,a)}function Oa(e,t){var a,s,n=e.bitLength(),i=it(1);if(n<=0)return i;a=n<18?1:n<48?3:n<144?4:n<768?5:6,s=n<8?new wt(t):t.isEven()?new Xa(t):new Nt(t);var r=new Array,o=3,l=a-1,c=(1<1){var u=He();s.sqrTo(r[1],u);while(o<=c)r[o]=He(),s.mulTo(u,r[o-2],r[o]),o+=2}var d,h,p=e.t-1,m=!0,f=He();n=ht(e[p])-1;while(p>=0){n>=l?d=e[p]>>n-l&c:(d=(e[p]&(1<0&&(d|=e[p-1]>>this.DB+n-l)),o=a;while(0==(1&d))d>>=1,--o;if((n-=o)<0&&(n+=this.DB,--p),m)r[d].copyTo(i),m=!1;else{while(o>1)s.sqrTo(i,f),s.sqrTo(f,i),o-=2;o>0?s.sqrTo(i,f):(h=i,i=f,f=h),s.mulTo(f,r[d],i)}while(p>=0&&0==(e[p]&1<0&&(t.rShiftTo(i,t),a.rShiftTo(i,a));while(t.signum()>0)(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),(n=a.getLowestSetBit())>0&&a.rShiftTo(n,a),t.compareTo(a)>=0?(t.subTo(a,t),t.rShiftTo(1,t)):(a.subTo(t,a),a.rShiftTo(1,a));return i>0&&a.lShiftTo(i,a),a}function Ya(e){if(e<=0)return 0;var t=this.DV%e,a=this.s<0?e-1:0;if(this.t>0)if(0==t)a=this[0]%e;else for(var s=this.t-1;s>=0;--s)a=(t*a+this[s])%e;return a}function Ha(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return Ye.ZERO;var a=e.clone(),s=this.clone(),n=it(1),i=it(0),r=it(0),o=it(1);while(0!=a.signum()){while(a.isEven())a.rShiftTo(1,a),t?(n.isEven()&&i.isEven()||(n.addTo(this,n),i.subTo(e,i)),n.rShiftTo(1,n)):i.isEven()||i.subTo(e,i),i.rShiftTo(1,i);while(s.isEven())s.rShiftTo(1,s),t?(r.isEven()&&o.isEven()||(r.addTo(this,r),o.subTo(e,o)),r.rShiftTo(1,r)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);a.compareTo(s)>=0?(a.subTo(s,a),t&&n.subTo(r,n),i.subTo(o,i)):(s.subTo(a,s),t&&r.subTo(n,r),o.subTo(i,o))}return 0!=s.compareTo(Ye.ONE)?Ye.ZERO:o.compareTo(e)>=0?o.subtract(e):o.signum()<0?(o.addTo(e,o),o.signum()<0?o.add(e):o):o}wt.prototype.convert=Tt,wt.prototype.revert=Ft,wt.prototype.reduce=xt,wt.prototype.mulTo=_t,wt.prototype.sqrTo=At,Nt.prototype.convert=Pt,Nt.prototype.revert=kt,Nt.prototype.reduce=Bt,Nt.prototype.mulTo=Zt,Nt.prototype.sqrTo=Mt,Ye.prototype.copyTo=st,Ye.prototype.fromInt=nt,Ye.prototype.fromString=rt,Ye.prototype.clamp=ot,Ye.prototype.dlShiftTo=mt,Ye.prototype.drShiftTo=ft,Ye.prototype.lShiftTo=bt,Ye.prototype.rShiftTo=gt,Ye.prototype.subTo=Dt,Ye.prototype.multiplyTo=St,Ye.prototype.squareTo=vt,Ye.prototype.divRemTo=Ct,Ye.prototype.invDigit=Lt,Ye.prototype.isEven=Xt,Ye.prototype.exp=Rt,Ye.prototype.toString=lt,Ye.prototype.negate=ct,Ye.prototype.abs=ut,Ye.prototype.compareTo=dt,Ye.prototype.bitLength=pt,Ye.prototype.mod=yt,Ye.prototype.modPowInt=Et,Ye.ZERO=it(0),Ye.ONE=it(1),La.prototype.convert=Na,La.prototype.revert=Na,La.prototype.mulTo=Pa,La.prototype.sqrTo=ka,Xa.prototype.convert=Ra,Xa.prototype.revert=Ea,Xa.prototype.reduce=Ia,Xa.prototype.mulTo=Wa,Xa.prototype.sqrTo=Ja;var Qa=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Ua=(1<<26)/Qa[Qa.length-1];function Ga(e){var t,a=this.abs();if(1==a.t&&a[0]<=Qa[Qa.length-1]){for(t=0;t>1,e>Qa.length&&(e=Qa.length);for(var n=He(),i=0;i127&&s<2048?(t+=String.fromCharCode(s>>6|192),t+=String.fromCharCode(63&s|128)):(t+=String.fromCharCode(s>>12|224),t+=String.fromCharCode(s>>6&63|128),t+=String.fromCharCode(63&s|128))}return t},decode:function(e){var t="",a=0,s=$c1=$c2=0;while(a191&&s<224?($c2=e.charCodeAt(a+1),t+=String.fromCharCode((31&s)<<6|63&$c2),a+=2):($c2=e.charCodeAt(a+1),$c3=e.charCodeAt(a+2),t+=String.fromCharCode((15&s)<<12|(63&$c2)<<6|63&$c3),a+=3);return t}},Ka={base64:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){if(!e)return!1;var t,a,s,n,i,r,o,l="",c=0;do{t=e.charCodeAt(c++),a=e.charCodeAt(c++),s=e.charCodeAt(c++),n=t>>2,i=(3&t)<<4|a>>4,r=(15&a)<<2|s>>6,o=63&s,isNaN(a)?r=o=64:isNaN(s)&&(o=64),l+=this.base64.charAt(n)+this.base64.charAt(i)+this.base64.charAt(r)+this.base64.charAt(o)}while(c>4),64!=s&&(i+=String.fromCharCode((15&a)<<4|s>>2)),64!=n&&(i+=String.fromCharCode((3&s)<<6|n))}while(r>4&15)+this.hex.charAt(15&t)}while(s0){var a=e.charCodeAt(0);e=e.substr(1);var s=0;if(5==(31&a))e=e.substr(1);else if(128&e.charCodeAt(0)){var n=127&e.charCodeAt(0);if(e=e.substr(1),n>0&&(s=e.charCodeAt(0)),n>1&&(s=s<<8|e.charCodeAt(1)),n>2)return this.error=!0,null;e=e.substr(n)}else s=e.charCodeAt(0),e=e.substr(1);var i="";if(s){if(s>e.length)return this.error=!0,null;i=e.substr(0,s),e=e.substr(s)}32&a?t.push(this.parse(i)):t.push(this.value(128&a?4:31&a,i))}return t},this.value=function(e,t){if(1==e)return!!t;if(2==e)return t;if(3==e)return this.parse(t.substr(1));if(5==e)return null;if(6==e){var a=[],s=t.charCodeAt(0);a.push(Math.floor(s/40)),a.push(s-40*a[0]);var n,i=[],r=0;for(n=1;n>3;if(e=this.pkcs1pad2(e,a),!e)return!1;if(e=e.modPowInt(t.encryptionExponent,t.modulus),!e)return!1;e=e.toString(16);while(e.length<2*a)e="0"+e;return Ka.encode(es.decode(e))},pkcs1pad2:function(e,t){if(t=0&&t>0)a[--t]=e.charCodeAt(s--);a[--t]=0;while(t>2)a[--t]=Math.floor(254*Math.random())+1;return a[--t]=2,a[--t]=0,new Ye(a)}},ss=(as=as,{FesLeft:!1,data:function(){var e,t,a;return{userName:"",password:"",loginRule:{userName:[{required:!0,message:this.$t("message.newAllPage.Pleaseenteryourusername")},{type:"string",pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:y()(e=y()(t=y()(a="".concat(this.$t("message.newAllPage.Musthavealetter"),",")).call(a,this.$t("message.newAllPage.Andonlysupportletter"),"、")).call(t,this.$t("message.newAllPage.digital"),"、")).call(e,this.$t("message.newAllPage.Theunderline")),trigger:"change"},{message:"".concat(this.$t("message.newAllPage.Namecannotbemorethanlength"),"200"),max:200}],password:[{required:!0,message:this.$t("message.newAllPage.Pleaseenterthepassword")},{message:"".concat(this.$t("message.newAllPage.Passwordlengthcantmorethan"),"20"),max:20}]}}},methods:{roleName:function(e){return"super"===e?this.$t("message.newAllPage.Thesuperuser"):"admin"===e?this.$t("message.newAllPage.Manageusers"):"user"===e?this.$t("message.newAllPage.Theaverageuser"):this.$t("message.newAllPage.Notloggedin")},loginAction:function(){var e=this,t=as.getPublicKey("-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCQT/eMMgLf6MvSY1JWVI5KOPeWh+Lb3v6J7nMJVaok8V0vEqRmYc3A5dh3+VXmxslrpWSBhiom/43b/y3f2/g8jEpmxU1MEyq1l8i4rnx6fJP60od5hLmGdbNexnh9MksEqSx10nAYsH0trZ71bZJnQkuK/m70oMXjr0HAwJafBwIDAQAB-----END PUBLIC KEY-----"),a=as.encrypt(this.password,t);this.$refs.loginForm.validate((function(t){t&&e.FesApi.fetch("/auth/login",{loginUser:e.userName,loginPwd:a},"post").then((function(t){e.FesApp.setRole(t.role),e.FesApp.set("FesUserName",t["X-AUTH-ID"]),e.FesApp.set("FesRoleName",e.roleName(t.role)),e.FesStorage.set("currentUser",t["X-AUTH-ID"]),e.FesStorage.set("userRole",t.role),e.FesApp.router.push("/ds/newManager")}))}))}}}),ns=ss,is=(a("1f35"),Object(_["a"])(ns,Re,Ee,!1,null,"247e3fe6",null));is.options.__file="src/pages/login/index.fes";var rs=is.exports,os=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("main",{staticClass:"main full-height"},[a("div",{staticClass:"header-bar"},[a("span",{staticClass:"header-title"},[e._v("\n "+e._s(e.$t("sys.Performusermanagement"))+"\n ")]),a("p",{staticClass:"header-des"},[e._v("\n "+e._s(e.$t("sys.Performusermanagement"))+"\n ")])]),a("div",{staticClass:"main-content"},[a("Row",{staticClass:"top-bar"},[a("div",{staticClass:"data-source"},[a("label",{staticClass:"ui-form-label"},[e._v("\n "+e._s(e.$t("sys.Theusername"))+"\n ")])]),a("Cell",{attrs:{span:"4"}},[a("Wb-input",{attrs:{placeholder:e.$t("manager.SRSZYM")},on:{"on-enter":function(t){return e.searchQuery()}},model:{value:e.searchName,callback:function(t){e.searchName=t},expression:"searchName"}})],1),a("Cell",{staticClass:"query-button",attrs:{span:"4"}},[a("Wb-button",{attrs:{type:"primary",icon:"search"},on:{click:function(t){return e.searchQuery()}}},[e._v("\n "+e._s(e.$t("manager.CX"))+"\n ")])],1)],1),a("div",{staticClass:"lists-bar"},[a("div",{staticClass:"add-button"},[a("Wb-button",{staticClass:"button",attrs:{type:"ghost",icon:"plus"},on:{click:e.showChooseWind}},[e._v("\n "+e._s(e.$t("sys.Thenewperformuser"))+"\n ")])],1),e._l(e.sourceData,(function(t){return a("div",{key:t.id,staticClass:"list-item"},[a("Icon",{staticClass:"item-icon",attrs:{type:"md-person",size:"35"}}),a("div",{staticClass:"item item-col"},[a("span",{staticClass:"title"},[e._v("\n "+e._s(e.$t("sys.Theusername"))+"\n ")]),a("span",{staticClass:"desc"},[e._v("\n "+e._s(t.execUser)+"\n ")])]),a("div",{staticClass:"item item-col"},[a("span",{staticClass:"title"},[e._v("\n ID\n ")]),a("span",{staticClass:"desc"},[e._v("\n "+e._s(t.id)+"\n ")])]),a("div",{staticClass:"time item-col"},[a("span",[e._v(e._s(e.$t("manager.CJZSJ")))]),a("span",[e._v(e._s(t.createTime))])]),a("div",{staticClass:"option"},[a("span",{staticClass:"text",on:{click:function(a){return e.sourceDelete(t)}}},[e._v("\n "+e._s(e.$t("manager.SC"))+"\n ")])])],1)}))],2),a("div",{staticClass:"page-pagination"},[a("Pagination",{attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.pageChange}})],1)],1),a("weModal",{attrs:{title:e.$t("sys.Thenewperformuser")},on:{onConfirm:e.addConfirm},model:{value:e.addExecutor,callback:function(t){e.addExecutor=t},expression:"addExecutor"}},[a("Wb-form",{ref:"source_validate",attrs:{"label-position":"left",rule:e.sourceRule}},[a("Form-item",{attrs:{label:e.$t("sys.Theusername"),prop:"executeName"}},[a("wb-input",{attrs:{placeholder:e.$t("sys.Pleasefillinusername")},model:{value:e.executeName,callback:function(t){e.executeName=t},expression:"executeName"}})],1),a("Form-item",{attrs:{label:e.$t("sys.describe"),prop:"executeDes"}},[a("wb-input",{attrs:{placeholder:e.$t("sys.Pleasefillintheusername")},model:{value:e.executeDes,callback:function(t){e.executeDes=t},expression:"executeDes"}})],1)],1)],1),a("weLoading",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}]})],1)},ls=[];os._withStripped=!0;var cs={components:{weModal:w["a"],weLoading:L},FesData:function(){var e,t,a;return{loading:!1,searchName:"",sourceData:"",pagination:{size:10,current:1,total:0},executeName:"",executeDes:"",addExecutor:!1,sourceRule:{executeName:[{required:!0,message:this.$t("sys.Pleasefillinusername")},{type:"string",pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:y()(e=y()(t=y()(a="".concat(this.$t("sys.Musthavealetter"),",")).call(a,this.$t("sys.Andonlysupportletter"),"、")).call(t,this.$t("sys.digital"),"、")).call(e,this.$t("sys.Theunderline")),trigger:"change"}]}}},FesReady:function(){this.loadOwners(),this.searchQuery()},methods:{loadOwners:function(){var e=this;this.FesApi.fetch("/admin/exec/user/list","get").then((function(t){e.dsOwners=t}))["catch"]((function(e){console.log(e)}))},searchQuery:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.loading=!0,this.FesApi.fetch("/admin/exec/user/pager?execUser=".concat(this.searchName),{page:t,pageSize:a},"get").then((function(t){e.loading=!1,e.sourceData=t.data,e.pagination.size=t.pageSize,e.pagination.current=t.page,e.pagination.total=t.totalPages}))["catch"]((function(){e.loading=!1}))},showChooseWind:function(){this.addExecutor=!0},addConfirm:function(){var e=this;this.$refs.source_validate.validate((function(t){t?e.FesApi.fetch("/admin/exec/user",{description:e.executeDes,execUser:e.executeName},"post").then((function(){e.searchQuery(e.pagination.current,e.pagination.size),e.$Toast.success(e.$t("sys.Addausersuccessfully"))})):e.addExecutor=!0}))},pageChange:function(e){var t=e.current,a=e.size;this.searchQuery(t,a)},sourceDelete:function(e){var t,a=this;this.$Message.confirm(this.$t("sys.Deleteperformuser"),y()(t="".concat(this.$t("sys.Whetheryouwanttodelete"))).call(t,e.execUser,"?")).then((function(t){0===t&&(a.loading=!0,a.FesApi.fetch("/admin/exec/user/"+e.id,{},"delete").then((function(){a.$Toast.success(a.$t("sys.Deletetheusersuccessfully")),a.searchQuery(a.pagination.current,a.pagination.size)}))["catch"]((function(){a.loading=!1})))}))}}},us=cs,ds=(a("e072"),Object(_["a"])(us,os,ls,!1,null,"1613cddb",null));ds.options.__file="src/pages/sys/executeUser/index.fes";var hs=ds.exports,ps=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"full-height"},[a("fes-search-panel",[a("Wb-form",{attrs:{type:"query","label-width":150}},[a("Form-item",{attrs:{label:e.$t("sys.executor.DZ")}},[a("wb-input",{attrs:{placeholder:e.$t("sys.executor.QSR")},on:{"on-enter":function(t){return e.search()}},model:{value:e.query.address,callback:function(t){e.$set(e.query,"address",t)},expression:"query.address"}})],1)],1),a("div",{attrs:{slot:"button"},slot:"button"},[a("Wb-button",{attrs:{type:"primary",icon:"search"},on:{click:function(t){return e.search()}}},[e._v("\n "+e._s(e.$t("sys.executor.CX"))+"\n ")])],1)],1),a("fes-list-panel",[a("Wb-table",{attrs:{data:e.data,"no-data-text":e.$t("sys.executor.ZWSJ")}},[a("Column",{attrs:{prop:"id",name:"ID"}}),a("Column",{attrs:{prop:"address",name:e.$t("sys.executor.DZ")}}),a("Column",{attrs:{prop:"defaultNode",name:e.$t("sys.Thedefaultnode"),component:e.checkboxCompenentData}}),a("Column",{attrs:{prop:"tabIds",name:e.$t("sys.Thelabel"),component:e.tabComponentData,width:"200px"}}),a("Column",{attrs:{prop:"heartbeatTime",name:e.$t("sys.executor.XTSJ")}}),a("Column",{attrs:{prop:"status",component:e.showStatus,name:e.$t("sys.executor.ZT")}}),a("Column",{attrs:{prop:"memRate",name:e.$t("sys.executor.NCSYL")}}),a("Column",{attrs:{prop:"cpuRate",name:e.$t("sys.executor.SYL")}}),a("Column",{attrs:{name:e.$t("sys.executor.CZ"),action:e.exeAction}})],1),a("Pagination",{staticClass:"page-center",attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.changePage}})],1),a("weModal",{attrs:{title:e.$t("sys.Bindingthenodelabel"),closable:!1},on:{onConfirm:e.addConfirm},model:{value:e.bindlabelShow,callback:function(t){e.bindlabelShow=t},expression:"bindlabelShow"}},[a("Wb-form",{ref:"source_validate",attrs:{"label-position":"left"}},[a("Form-item",{attrs:{label:e.$t("sys.Thelabel"),prop:"executeDes"}},[a("Wb-select",{attrs:{placeholder:e.$t("sys.Pleaseselectalabel"),multiple:""},model:{value:e.tabIds,callback:function(t){e.tabIds=t},expression:"tabIds"}},e._l(e.tabList,(function(e){return a("wb-option",{key:e.id,attrs:{value:e.id,label:e.name}})})),1)],1)],1)],1)],1)},ms=[];ps._withStripped=!0;var fs={FesDataCache:"executor",FesHeader:!1,components:{weModal:w["a"]},data:function(){return{query:{address:""},data:[],pagination:{size:10,current:1,total:0},bindlabelShow:!1,tabIds:[],tabList:[],currentNode:{},exeAction:[{text:this.$t("sys.executor.WH"),func:function(e){var t=this,a="";a=0==e.status?this.$t("sys.executor.XX"):this.$t("sys.executor.SX"),this.$Message.confirm(a+this.$t("sys.executor.JD"),this.$t("sys.executor.SFCG",{action:a})).then((function(s){0===s&&(0==e.status?e.status=1:e.status=0,t.FesApi.fetch("/admin/exec/node/update/"+e.id,e).then((function(){t.$Toast.success(a+" "+t.$t("sys.executor.JDCG")),t.search()})))}))}},{text:this.$t("sys.Themanagementnode"),func:function(e){var t=encodeURIComponent(m()(e));this.$router.push({path:"/sys/executor/bind",query:{value:t}})}},{text:this.$t("sys.Thelabel"),func:function(e){this.currentNode=e,this.tabIds=e.tabIds?JSON.parse(m()(e.tabIds)):[],this.bindlabelShow=!0}},{text:this.$t("sys.delete"),func:function(e){var t,a=this;this.$Message.confirm(this.$t("sys.Removenodes"),y()(t="".concat(this.$t("sys.Whetherornottodelete"))).call(t,e.address)).then((function(t){0===t&&a.FesApi.fetch("/admin/exec/node/delete/"+e.id,{},"delete").then((function(){a.$Toast.success(a.$t("sys.Deletethesuccess")),a.search()}))}))}}],showStatus:this.showStatusFunction,tabComponentData:this.tabComponent,checkboxCompenentData:this.checkboxCompenent}},FesReady:function(){var e=this;this.search(),this.FesApi.fetch("/tab/list",{},"get").then((function(t){e.tabList=t}))},methods:{addConfirm:function(){var e=this;this.FesApi.fetch("/admin/exec/node/".concat(this.currentNode.id,"/tab"),{tabIds:this.tabIds}).then((function(t){e.search()}))},checkboxCompenent:function(e){var t=this;return new Vue({data:function(){return{trData:e}},methods:{checkDefault:function(e){e?t.FesApi.fetch("/admin/exec/node/".concat(this.trData.id,"/default"),{},"post").then((function(){t.search()})):t.FesApi.fetch("/admin/exec/node/".concat(this.trData.id,"/default"),{},"delete").then((function(){t.search()}))}},template:''})},tabComponent:function(e){return new Vue({data:function(){return{tabIds:e.tabIds||[]}},template:'
{{tab === 1 ? \'DATAX\' : \'SQOOP\' }}
'})},showStatusFunction:function(e){var t="",a="";return 0==e.status?(t=this.$t("sys.executor.ZC"),a="blue"):(t=this.$t("sys.executor.YXX"),a="red"),new Vue({template:"

"+t+"

"})},search:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.loading=!0,this.data=[],this.pagination.total=0,this.FesApi.fetch("/admin/exec/node/pageList",{address:this.query.address,page:t,pageSize:a},"get").then((function(s){e.data=s.data,e.pagination.total=s.totalPages,e.pagination.current=t,e.pagination.size=a,e.loading=!1}))},changePage:function(e){var t=e.current,a=e.size;this.search(t,a)}}},bs=fs,gs=Object(_["a"])(bs,ps,ms,!1,null,null,null);gs.options.__file="src/pages/sys/executor/index.fes";var Ds=gs.exports,Ss=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("main",{staticClass:"bind-main full-height"},[a("div",{staticClass:"header-bar"},[a("span",{staticClass:"header-title"},[e._v("\n "+e._s(e.$t("sys.Nodemanagement"))+"\n ")]),a("div",{staticClass:"header-content"},[a("div",{staticClass:"content-item"},[a("span",[e._v(e._s(e.$t("sys.state")))]),a("span",{staticClass:"button"},[a("i",{staticClass:"status-bar",class:{green:0===e.executorNodeData.status,orange:1===e.executorNodeData.status}}),e._v("\n "+e._s(0===e.executorNodeData.status?e.$t("sys.normal"):e.$t("sys.Hasbeenrolledofftheproductionline"))+"\n ")])]),a("div",{staticClass:"content-item"},[a("span",[e._v(e._s(e.$t("sys.Thenodeaddress")))]),a("span",{staticClass:"button"},[e._v("\n "+e._s(e.executorNodeData.address)+"\n ")])]),a("div",{staticClass:"content-item"},[a("span",[e._v(e._s(e.$t("sys.Theheartbeatoftime")))]),a("span",{staticClass:"button"},[e._v("\n "+e._s(e.executorNodeData.heartbeatTime)+"\n ")])]),a("div",{staticClass:"content-item"},[a("span",[e._v(e._s(e.$t("sys.Memoryusage")))]),a("span",{staticClass:"button"},[e._v("\n "+e._s(e.executorNodeData.memRate)+"\n ")])]),a("div",{staticClass:"content-item"},[a("span",[e._v("cpu "+e._s(e.$t("sys.usage")))]),a("span",{staticClass:"button"},[e._v("\n "+e._s(e.executorNodeData.cpuRate)+"\n ")])])])]),a("div",{staticClass:"main-content"},[a("Row",{staticClass:"top-bar"},[a("Cell",{attrs:{span:"2"}},[a("label",{staticClass:"ui-form-label float-right"},[e._v("\n "+e._s(e.$t("sys.Performausername"))+"\n ")])]),a("Cell",{attrs:{span:"3"}},[a("Wb-input",{attrs:{placeholder:e.$t("sys.Pleaseenteryourusername")},model:{value:e.searchUserName,callback:function(t){e.searchUserName=t},expression:"searchUserName"}})],1),a("div",{staticClass:"margin-left"},[a("label",{staticClass:"ui-form-label"},[e._v("\n UID\n ")])]),a("Cell",{attrs:{span:"3"}},[a("Wb-input",{attrs:{placeholder:e.$t("sys.Pleaseenterthe")+" UID"},model:{value:e.searchUID,callback:function(t){e.searchUID=t},expression:"searchUID"}})],1),a("div",{staticClass:"margin-left"},[a("label",{staticClass:"ui-form-label"},[e._v("\n GID\n ")])]),a("Cell",{attrs:{span:"3"}},[a("Wb-input",{attrs:{placeholder:e.$t("sys.Pleaseenterthe")+" GID"},model:{value:e.searchGID,callback:function(t){e.searchGID=t},expression:"searchGID"}})],1),a("Cell",{staticClass:"margin-left",attrs:{span:"5"}},[a("Wb-button",{attrs:{type:"primary",icon:"search"},on:{click:function(t){return e.searchQuery()}}},[e._v("\n "+e._s(e.$t("manager.CX"))+"\n ")]),a("Wb-button",{staticClass:"margin-left",attrs:{type:"primary",icon:"plus"},on:{click:e.addExecuteUser}},[e._v("\n "+e._s(e.$t("sys.add"))+"\n ")])],1),a("Cell",{staticClass:"margin-left",attrs:{span:"4"}},[a("Wb-button",{on:{click:e.goback}},[e._v("\n "+e._s(e.$t("sys.return"))+"\n ")])],1)],1),a("Wb-table",{attrs:{data:e.execoteUserList,"no-data-text":e.$t("sys.Temporarilynodata")}},[a("Column",{attrs:{prop:"execUser",name:e.$t("sys.Performausername")}}),a("Column",{attrs:{prop:"userType",name:e.$t("sys.Associatedwiththeusertypes")}}),a("Column",{attrs:{component:e.statusComponent,name:e.$t("sys.Associatedstates")}}),a("Column",{attrs:{prop:"uid",name:"UID"}}),a("Column",{attrs:{prop:"gid",name:"GID"}}),a("Column",{attrs:{prop:"updateTime",name:e.$t("sys.Therecentmodificationtime")}}),a("Column",{attrs:{component:e.optionComponent,name:e.$t("sys.operation"),width:"300px"}})],1),a("div",{staticClass:"page-pagination"},[a("Pagination",{staticClass:"pagination",attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.changePage}})],1)],1),a("weModal",{attrs:{title:e.$t("sys.Bindtheuser"),width:"500",closable:!1},on:{onConfirm:e.addUserConfirm},model:{value:e.addUserShow,callback:function(t){e.addUserShow=t},expression:"addUserShow"}},[a("Wb-form",{ref:"bindFrom",attrs:{rule:e.addBindRule}},[a("Form-item",{attrs:{label:e.$t("sys.Selecttheuser"),prop:"selectBindUser"}},[a("Wb-select",{attrs:{multiple:"",filterable:""},model:{value:e.selectBindUser,callback:function(t){e.selectBindUser=t},expression:"selectBindUser"}},e._l(e.selectUserList,(function(e){return a("wb-option",{key:e.id,attrs:{value:e.id,label:e.execUser}})})),1)],1),a("Form-item",{attrs:{label:e.$t("sys.Bindingtype"),prop:"selectBindType"}},[a("Wb-select",{model:{value:e.selectBindType,callback:function(t){e.selectBindType=t},expression:"selectBindType"}},e._l(e.selectBindTypeList,(function(e){return a("wb-option",{key:e.value,attrs:{value:e.value,label:e.label}})})),1)],1)],1)],1),a("weLoading",{directives:[{name:"show",rawName:"v-show",value:e.FesFesx.isLoading,expression:"FesFesx.isLoading"}]})],1)},vs=[];Ss._withStripped=!0;var Cs={components:{weModal:w["a"],weLoading:L},data:function(){var e=this;return{executorNodeData:JSON.parse(decodeURIComponent(this.$route.query.value)),tabValue:"node",selectBindNode:[],selectBindUser:[],selectUserList:[],addExecuteUserShow:!1,addUserShow:!1,pagination:{size:10,current:1,total:10},addBindRule:{selectBindUser:[{required:!0,message:this.$t("sys.Pleasefillinusername")}],selectBindType:[{required:!0,message:this.$t("sys.Pleaseselectabindingtype")}]},optionComponent:function(t){var a,s;return new Vue({data:function(){return{trData:t}},methods:{deleteAction:function(t){var a,s,n=this;if(1===t.relationState)return e.$Toast.warn(y()(a="".concat(e.$t("sys.Hasbeenassociateduser"),",")).call(a,e.$t("sys.Donotdelete"),"!"));this.$Message.confirm(e.$t("sys.delete"),y()(s="".concat(e.$t("sys.Confirmtodeletetheuserexecution"))).call(s,t.execUser,"?")).then((function(a){var s;0===a&&e.FesApi.fetch(y()(s="/admin/exec/node/".concat(e.executorNodeData.id,"/user/")).call(s,t.execUser,"/bind"),{},"DELETE").then((function(){e.searchQuery(e.pagination.current,e.pagination.size),n.$Toast.success(e.$t("sys.Deletetheusersuccessfully"))}))}))},associated:function(t){var a,s,n;this.$Message.confirm(e.$t("sys.associated"),y()(a=y()(s=y()(n="".concat(e.$t("sys.confirm"))).call(n,e.executorNodeData.address)).call(s,e.$t("sys.Executionofuser"))).call(a,t.execUser,"?")).then((function(a){var s;0===a&&e.FesApi.fetch(y()(s="/admin/exec/node/".concat(e.executorNodeData.id,"/user/")).call(s,t.execUser,"/relate"),{},"PUT").then((function(){e.searchQuery(e.pagination.current,e.pagination.size)}))}))},cancelAssociated:function(t){var a,s,n;this.$Message.confirm(e.$t("sys.Canceltheassociated"),y()(a=y()(s=y()(n="".concat(e.$t("sys.confirm"))).call(n,e.executorNodeData.address)).call(s,e.$t("sys.Canceltheexecutionoftheuser"))).call(a,t.execUser,"?")).then((function(a){var s;0===a&&e.FesApi.fetch(y()(s="/admin/exec/node/".concat(e.executorNodeData.id,"/user/")).call(s,t.execUser,"/relate"),{},"DELETE").then((function(){e.searchQuery(e.pagination.current,e.pagination.size)}))}))}},template:y()(a=y()(s='
\n '.concat(e.$t("sys.associated"),'\n \n ')).call(s,e.$t("sys.Canceltheassociated"),'\n \n \n ')).call(a,e.$t("sys.delete"),"\n \n
")})},statusComponent:function(t){var a,s;return new Vue({data:function(){return{trData:t}},methods:{},template:y()(a=y()(s='
\n \n '.concat(e.$t("sys.Notassociated"),'\n \n \n ')).call(s,e.$t("sys.Hasbeenassociated"),'\n \n \n ')).call(a,e.$t("sys.Connectionfailure"),"\n \n
")})},searchUserName:"",searchUID:"",searchGID:"",execoteUserList:[],selectBindType:"",selectBindTypeList:[{label:this.$t("sys.Thebinding"),value:"BIND"},{label:this.$t("sys.bindings"),value:"BIND_RELATE"}]}},FesReady:function(){this.searchQuery(),this.getSelectUserList()},methods:{getSelectUserList:function(){var e=this;this.FesApi.fetch("/admin/exec/user/list ",{},"get").then((function(t){e.FesFesx.set("isLoading",!1),e.selectUserList=t}))["catch"]((function(){e.FesFesx.set("isLoading",!1)}))},addExecuteUser:function(){this.addUserShow=!0,this.selectBindUser=[],this.selectBindType=""},searchQuery:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.FesFesx.set("isLoading",!0),this.FesApi.fetch("/admin/exec/node/".concat(this.executorNodeData.id,"/user/bind/pager"),{uid:this.searchUID,gid:this.searchGID,execUser:this.searchUserName,page:t,pageSize:a},"get").then((function(t){e.FesFesx.set("isLoading",!1),e.execoteUserList=t.data,e.pagination.size=t.pageSize,e.pagination.current=t.page,e.pagination.total=t.totalPages}))["catch"]((function(){e.FesFesx.set("isLoading",!1)}))},changePage:function(e){var t=e.current,a=e.size;this.searchQuery(t,a)},addUserConfirm:function(){var e=this;this.$refs.bindFrom.validate((function(t){if(t){var a,s={opType:e.selectBindType,execUserList:me()(a=e.selectUserList).call(a,(function(t){var a;return r()(a=e.selectBindUser).call(a,t.id)}))};e.FesApi.fetch("/admin/exec/node/".concat(e.executorNodeData.id,"/user/bind"),s,{method:"post",timeout:"60000"}).then((function(){e.searchQuery(e.pagination.current,e.pagination.size),e.$Toast.success(e.$t("sys.Addausersuccessfully"))}))["catch"]((function(){e.searchQuery(e.pagination.current,e.pagination.size)}))}else e.addUserShow=!0}))},goback:function(){this.$router.go(-1)}}},ys=Cs,ws=(a("c95e"),Object(_["a"])(ys,Ss,vs,!1,null,"55344934",null));ws.options.__file="src/pages/sys/executor/bind/index.fes";var Ts=ws.exports,Fs=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"owner-box"},[a("fes-search-panel",[a("Wb-form",{staticClass:"search-form",attrs:{type:"query","label-width":170}},[a("Form-item",{attrs:{label:e.$t("sys.owner.SZYSZ")}},[a("wb-input",{attrs:{placeholder:e.$t("sys.owner.QSR")},on:{"on-enter":function(t){return e.search()}},model:{value:e.query.ownerName,callback:function(t){e.$set(e.query,"ownerName",t)},expression:"query.ownerName"}})],1)],1),a("div",{attrs:{slot:"button"},slot:"button"},[a("Wb-button",{attrs:{type:"primary",icon:"search"},on:{click:function(t){return e.search()}}},[e._v("\n "+e._s(e.$t("sys.owner.CX"))+"\n ")])],1)],1),a("div",{staticClass:"button-row"},[a("Wb-button",{attrs:{type:"primary",icon:"plus"},on:{click:e.showAdd}},[e._v("\n "+e._s(e.$t("sys.owner.XZSJYSZ"))+"\n ")])],1),a("fes-list-panel",[a("Wb-table",{attrs:{data:e.data,"no-data-text":e.$t("sys.owner.MYSZSJ")}},[a("Column",{attrs:{prop:"ownerName",name:e.$t("sys.owner.MC")}}),a("Column",{attrs:{prop:"ownerDesc",name:e.$t("sys.owner.MS")}}),a("Column",{attrs:{prop:"createUser",name:e.$t("sys.owner.CJYH")}}),a("Column",{attrs:{prop:"createTime",name:e.$t("sys.owner.CJSJ")}}),a("Column",{attrs:{prop:"modifyUser",name:e.$t("sys.owner.XGYH")}}),a("Column",{attrs:{prop:"modifyTime",name:e.$t("sys.owner.XGSJ")}}),a("Column",{attrs:{name:e.$t("sys.owner.CZ"),action:e.ownerAction}})],1),a("div",{staticClass:"page-pagination"},[a("Pagination",{attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.changePage}})],1)],1),a("modal",{ref:"addModal",attrs:{title:e.$t("sys.owner.XZSJYSZ")},on:{"on-close":e.closeAdd}},[a("Wb-form",{ref:"addForm",attrs:{rule:e.ruleAdd,"label-width":100}},[a("Form-item",{attrs:{label:e.$t("sys.owner.XZMC"),prop:"ownerName"}},[a("wb-input",{attrs:{placeholder:e.$t("sys.owner.SRSJSZ")},model:{value:e.newOwnerData.ownerName,callback:function(t){e.$set(e.newOwnerData,"ownerName",t)},expression:"newOwnerData.ownerName"}})],1),a("Form-item",{attrs:{label:e.$t("sys.owner.MS")}},[a("wb-input",{attrs:{placeholder:e.$t("sys.owner.MS")},model:{value:e.newOwnerData.ownerDesc,callback:function(t){e.$set(e.newOwnerData,"ownerDesc",t)},expression:"newOwnerData.ownerDesc"}})],1),a("div",{staticClass:"submit-button-container"},[a("Wb-button",{ref:"submitButton",staticClass:"submit-button",attrs:{type:"primary"},on:{click:e.submit}},[e._v("\n "+e._s(e.$t("sys.owner.TJ"))+"\n ")])],1)],1)],1),a("modal",{ref:"modifyModal",attrs:{title:e.$t("sys.owner.XGSJSZ")}},[a("Wb-form",{ref:"modifyForm",attrs:{rule:e.ruleModify,"label-width":100}},[a("Form-item",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],attrs:{label:"ID",prop:"id"}},[a("wb-input",{model:{value:e.newOwnerData.id,callback:function(t){e.$set(e.newOwnerData,"id",t)},expression:"newOwnerData.id"}})],1),a("Form-item",{attrs:{label:e.$t("sys.owner.XZMC"),prop:"ownerName"}},[a("wb-input",{attrs:{placeholder:e.$t("sys.owner.SRSJSZ")},model:{value:e.newOwnerData.ownerName,callback:function(t){e.$set(e.newOwnerData,"ownerName",t)},expression:"newOwnerData.ownerName"}})],1),a("Form-item",{attrs:{label:e.$t("sys.owner.MS")}},[a("wb-input",{attrs:{placeholder:e.$t("sys.owner.MS")},model:{value:e.newOwnerData.ownerDesc,callback:function(t){e.$set(e.newOwnerData,"ownerDesc",t)},expression:"newOwnerData.ownerDesc"}})],1),a("div",{staticClass:"submit-button-container"},[a("Wb-button",{ref:"modifyButton",staticClass:"submit-button",attrs:{type:"primary"},on:{click:e.modify}},[e._v("\n "+e._s(e.$t("sys.owner.TJ"))+"\n ")])],1)],1)],1)],1)},$s=[];Fs._withStripped=!0;var xs={FesDataCache:"owner",FesHeader:!1,FesData:function(){return{query:{ownerName:""},newOwnerData:{id:null,ownerName:"",ownerDesc:""},ruleAdd:{ownerName:[{required:!0,message:this.$t("sys.owner.SZMCBNK")}]},ruleModify:{ownerName:[{required:!0,message:this.$t("sys.owner.SZMCBNK")}]},data:[],pagination:{size:10,current:1,total:0},ownerAction:[{text:this.$t("sys.owner.BJ"),func:function(e){var t=this;this.FesApi.fetch("/admin/dsOwner/view/"+e.id,"get").then((function(e){t.newOwnerData=e,t.$refs.modifyModal.show()}))}},{text:this.$t("sys.owner.SC"),func:this["delete"]}],test:!1}},FesReady:function(){this.search()},methods:{delete:function(e){var t=this;this.$Message.confirm(this.$t("sys.owner.SCSJYSZ"),this.$t("sys.owner.SFSCSJYSZ")).then((function(a){0===a&&t.FesApi.fetch("/admin/dsOwner/delete/"+e.id,"delete").then((function(){t.$Toast.success(t.$t("sys.owner.SCCG")),t.search()}))}))},showAdd:function(){this.newOwnerData={},this.$refs.addModal.show(),this.test=!0},modify:function(){var e=this,t=this.newOwnerData;this.$refs.modifyForm.validate((function(a){a&&e.FesApi.fetch("/admin/dsOwner/update/"+t.id,t,{methods:"post",button:e.$refs.modifyButton,headers:{"Content-Type":"application/json"}}).then((function(){e.$Toast.success(e.$t("sys.owner.XGCG")),e.$refs.modifyModal.close(),e.newOwnerData={},e.search()}))}))},submit:function(){var e=this,t=this.newOwnerData;this.$refs.addForm.validate((function(a){a&&e.FesApi.fetch("/admin/dsOwner/add",t,{methods:"post",button:e.$refs.submitButton,headers:{"Content-Type":"application/json"}}).then((function(){e.$Toast.success(e.$t("sys.owner.TJSJYCG")),e.$refs.addModal.close(),e.newOwnerData={},e.search()}))}))},search:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.loading=!0,this.data=[],this.pagination.total=0,this.FesApi.fetch("/admin/dsOwner/pageList",{ownerName:this.query.ownerName,page:t,pageSize:a},"get").then((function(s){e.data=s.data,e.pagination.total=s.totalPages,e.pagination.current=t,e.pagination.size=a,e.loading=!1}))},changePage:function(e){var t=e.current,a=e.size;this.search(t,a)},closeAdd:function(){this.$refs.addForm.resetFields()}}},_s=xs,As=(a("86bb"),Object(_["a"])(_s,Fs,$s,!1,null,"18c1f524",null));As.options.__file="src/pages/sys/owner/index.fes";var Ls=As.exports,Ns=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"full-height"},[a("fes-search-panel",[a("Wb-form",{attrs:{type:"query","label-width":150}},[a("Form-item",{attrs:{label:e.$t("sys.user.YHM")}},[a("wb-input",{attrs:{placeholder:e.$t("sys.user.QSR")},on:{"on-change":e.changeSearch},model:{value:e.query.userName,callback:function(t){e.$set(e.query,"userName",t)},expression:"query.userName"}})],1)],1),a("div",{attrs:{slot:"button"},slot:"button"},[a("Wb-button",{attrs:{type:"primary",icon:"search"},on:{click:function(t){return e.search()}}},[e._v("\n "+e._s(e.$t("sys.user.CX"))+"\n ")])],1)],1),a("div",{staticClass:"button-row"},[a("Wb-button",{attrs:{type:"primary",icon:"plus"},on:{click:e.showAdd}},[e._v("\n "+e._s(e.$t("sys.user.XZYH"))+"\n ")])],1),a("fes-list-panel",[a("Wb-table",{attrs:{data:e.data,"no-data-text":e.$t("sys.user.ZSWSJ")}},[a("Column",{attrs:{prop:"userName",name:e.$t("sys.user.YHM")}}),a("Column",{attrs:{name:e.$t("sys.user.YHLX"),component:e.userTypeComponent}}),a("Column",{attrs:{prop:"createTime",name:e.$t("sys.user.CJSJ")}}),a("Column",{attrs:{prop:"updateTime",name:e.$t("sys.user.XGSJ")}}),a("Column",{attrs:{name:e.$t("sys.user.CZ"),action:e.userAction}})],1),a("div",{staticClass:"page-pagination"},[a("Pagination",{attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.changePage}})],1)],1),a("weModal",{attrs:{title:e.modalTitle,width:"500",closable:!1},on:{onConfirm:e.addNodeConfirm},model:{value:e.modalShow,callback:function(t){e.modalShow=t},expression:"modalShow"}},[a("Wb-form",{ref:"addForm",attrs:{rule:e.ruleAdd,"label-width":100}},[a("Form-item",{attrs:{label:e.$t("sys.user.SZMC"),prop:"userName"}},[a("wb-input",{attrs:{placeholder:e.$t("sys.user.SRYHM"),disabled:"resetPassword"===e.actionType},model:{value:e.newUserData.userName,callback:function(t){e.$set(e.newUserData,"userName",t)},expression:"newUserData.userName"}})],1),a("Form-item",{attrs:{label:e.$t("sys.user.YHLX")}},[a("wb-select",{attrs:{placeholder:e.$t("sys.user.YHLX"),disabled:"resetPassword"===e.actionType},model:{value:e.newUserData.userType,callback:function(t){e.$set(e.newUserData,"userType",t)},expression:"newUserData.userType"}},[a("wb-option",{attrs:{value:0}},[e._v("\n "+e._s(e.$t("sys.user.PTYH"))+"\n ")]),a("wb-option",{attrs:{value:1}},[e._v("\n "+e._s(e.$t("sys.user.GLYH"))+"\n ")]),a("wb-option",{attrs:{value:2}},[e._v("\n "+e._s(e.$t("sys.user.CJYH"))+"\n ")])],1)],1),"add"===e.actionType||"resetPassword"===e.actionType?a("Form-item",{attrs:{label:e.$t("sys.Initialpassword"),prop:"firstPassword"}},[a("wb-input",{attrs:{type:"password",placeholder:e.$t("sys.Pleaseenterthepassword"),maxlength:150},model:{value:e.firstPassword,callback:function(t){e.firstPassword=t},expression:"firstPassword"}})],1):e._e(),"add"===e.actionType||"resetPassword"===e.actionType?a("Form-item",{attrs:{label:e.$t("sys.Confirmpasswordagain"),prop:"secondPassword"}},[a("wb-input",{attrs:{type:"password",placeholder:e.$t("sys.Pleaseenterthepasswordagain"),maxlength:150},model:{value:e.secondPassword,callback:function(t){e.secondPassword=t},expression:"secondPassword"}})],1):e._e()],1)],1)],1)},Ps=[];Ns._withStripped=!0;var ks=a("2ef0"),Bs={FesDataCache:"user",FesHeader:!1,components:{weModal:w["a"]},FesData:function(){var e,t,a,s=this,n=function(e,t,a){var n;s.firstPassword&&t&&s.firstPassword!==t&&a(new Error(y()(n="".concat(s.$t("sys.Passwordisnotcorrect"),",")).call(n,s.$t("sys.Pleaseinputvalidationagain"))));a()};return{query:{userName:""},newUserData:{id:null,userName:"",userType:null},firstPassword:"",secondPassword:"",ruleAdd:{userName:[{required:!0,message:this.$t("sys.user.YHXXBNWK")},{type:"string",pattern:/^[a-zA-Z][a-zA-Z0-9_]*$/,message:y()(e=y()(t=y()(a="".concat(this.$t("sys.Musthavealetter"),",")).call(a,this.$t("sys.Andonlysupportletter"),"、")).call(t,this.$t("sys.digital"),"、")).call(e,this.$t("sys.Theunderline")),trigger:"change"},{message:"".concat(this.$t("sys.Namecannotbemorethanlength"),"200"),max:200}],firstPassword:[{message:"".concat(this.$t("sys.Passwordlengthcantmorethan"),"20"),max:20}],secondPassword:[{validator:n,trigger:"blur"},{message:"".concat(this.$t("sys.Passwordlengthcantmorethan"),"20"),max:20}]},data:[],pagination:{size:10,current:1,total:0},modalShow:!1,modalTitle:this.$t("sys.user.XZYH"),actionType:"add",userTypeComponent:function(e,t){var a=s;return new Vue({data:function(){return{trData:e}},methods:{typeName:function(e){return 0===e?a.$root.$t("sys.user.PTYH"):1===e?a.$root.$t("sys.user.GLYH"):a.$root.$t("sys.user.CJYH")},typeAction:function(e){return 0===e?"info":1===e?"primary":"warn"}},template:'{{typeName(trData.userType)}}'})},userAction:[{text:this.$t("sys.user.BJ"),func:function(e){var t=this;this.FesApi.fetch("/admin/user/view/"+e.id,"get").then((function(e){t.newUserData=e,t.modalShow=!0,t.actionType="modify",t.modalTitle=t.$t("sys.user.XGYHXX")}))}},{text:this.$t("sys.Bindingauthorization"),func:function(e){var t=encodeURIComponent(m()(e));this.$router.push({path:"/sys/user/bind",query:{user:t}})}},{text:this.$t("sys.Toresetyourpassword"),func:function(e){this.modalShow=!0,this.newUserData=e,this.firstPassword="",this.secondPassword="",this.actionType="resetPassword",this.modalTitle=this.$t("sys.Toresetyourpassword")}},{text:this.$t("sys.user.SC"),func:function(e){var t,a=this;this.$Message.confirm(this.$t("sys.user.SCYH"),y()(t="".concat(this.$t("sys.user.SFSCYH"))).call(t,e.userName," ?")).then((function(t){0===t&&a.FesApi.fetch("/admin/user/delete/"+e.id,"delete").then((function(){a.$Toast.success(a.$t("sys.user.SCCG")),a.search()}))}))}}]}},FesReady:function(){this.search()},methods:{changeSearch:Object(ks["debounce"])((function(){this.search()}),800),showAdd:function(){this.newUserData={userName:"",userType:0},this.modalShow=!0,this.actionType="add",this.firstPassword="",this.secondPassword="",this.modalTitle=this.$t("sys.user.XZYH")},addNodeConfirm:function(){var e=this,t=this.newUserData,a="",s="",n={method:"post",headers:{"Content-Type":"application/json"}};"add"===this.actionType?(t.password=this.secondPassword,a="/admin/user/add",s=this.$t("sys.user.TJYHCG")):"modify"===this.actionType?(a="/admin/user/update/"+t.id,s=this.$t("sys.user.XGCG")):(a="/admin/user/".concat(this.newUserData.id,"/password/reset"),s=this.$t("sys.Passwordresetsuccessfully"),n.method="put",t={password:this.secondPassword}),this.$refs.addForm.validate((function(i){i?e.FesApi.fetch(a,t,n).then((function(){e.$Toast.success(s),e.newUserData={},e.search()})):e.modalShow=!0}))},search:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.loading=!0,this.data=[],this.FesApi.fetch("/admin/user/selectAll",{userName:this.query.userName,page:t,pageSize:a},"get").then((function(s){e.data=s,e.pagination.current=t,e.pagination.size=a,e.loading=!1}))},changePage:function(e){var t=e.current,a=e.size;this.search(t,a)}}},Ms=Bs,Zs=(a("c86c"),Object(_["a"])(Ms,Ns,Ps,!1,null,null,null));Zs.options.__file="src/pages/sys/user/index.fes";var Xs=Zs.exports,Rs=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("main",{staticClass:"main full-height"},[a("div",{staticClass:"header-bar"},[a("span",{staticClass:"header-title"},[e._v("\n "+e._s(e.$t("sys.Usermanagement"))+"\n ")]),a("p",{staticClass:"header-des"},[e._v("\n "+e._s(e.$t("sys.Performuserandexecutionnodebindingauthority"))+"\n ")])]),a("div",{staticClass:"main-content"},[a("Tabs",{model:{value:e.tabValue,callback:function(t){e.tabValue=t},expression:"tabValue"}},[a("Tab",{attrs:{label:e.$t("sys.Theexecutionnode"),name:"node",icon:"iconfont icon-jiedian"}},[a("div",{staticClass:"template-lsit"},[a("div",{staticClass:"add-item template-item",on:{click:e.addNode}},[a("Icon",{attrs:{type:"md-add",size:"16"}}),e._v("\n "+e._s(e.$t("sys.Addanode"))+"\n ")],1),e._l(e.execoteNodeList,(function(t,s){return a("div",{key:s,staticClass:"current-item template-item"},[a("div",{staticClass:"item-content"},[a("div",{staticClass:"icon-box"},[a("Icon",{staticClass:"icon-bar",attrs:{type:"iconfont icon-jiedian",size:"35"}}),a("span",{staticClass:"template-type",attrs:{title:t.sourceType}},[e._v("\n Node\n ")])],1),a("div",{staticClass:"content"},[a("div",{staticClass:"params",attrs:{title:t.address}},[a("span",{staticClass:"label"},[e._v("\n "+e._s(e.$t("sys.Address:"))+"\n ")]),e._v("\n "+e._s(t.address)+"\n ")]),a("div",{staticClass:"params",attrs:{title:t.id}},[a("span",{staticClass:"label"},[e._v("\n ID:\n ")]),e._v("\n "+e._s(t.id)+"\n ")]),a("div",{staticClass:"params"},[a("span",{staticClass:"label"},[e._v("\n "+e._s(e.$t("sys.Status:"))+"\n ")]),e._v("\n "+e._s(0==t.status?e.$t("sys.normal"):e.$t("sys.offline"))+"\n ")]),a("div",{staticClass:"params"},[a("span",{staticClass:"label"},[e._v("\n cup:\n ")]),e._v("\n "+e._s(t.cpuRate)+"\n ")]),a("div",{staticClass:"params"},[a("span",{staticClass:"label"},[e._v("\n "+e._s(e.$t("sys.Memory:"))+"\n ")]),e._v("\n "+e._s(t.memRate)+"\n ")])])]),a("div",{staticClass:"item-option"},[a("span",{staticClass:"modify",on:{click:function(a){return e.deleteNodeAction(t)}}},[e._v("\n "+e._s(e.$t("dataTemplate.SC"))+"\n ")])])])}))],2),a("div",{staticClass:"page-pagination"},[a("Pagination",{attrs:{loking:e.nodePagination.locking,current:e.nodePagination.current,size:e.nodePagination.size,total:e.nodePagination.total},on:{"on-change":e.nodePageChange}})],1)]),a("Tab",{attrs:{label:e.$t("sys.Performuser"),name:"user",icon:"iconfont icon-yonghu"}},[a("div",{staticClass:"template-lsit"},[a("div",{staticClass:"add-item template-item",on:{click:e.addUser}},[a("Icon",{attrs:{type:"md-add",size:"16"}}),e._v("\n "+e._s(e.$t("sys.Adduser"))+"\n ")],1),e._l(e.execoteUserList,(function(t,s){return a("div",{key:s,staticClass:"current-item template-item"},[a("div",{staticClass:"item-content"},[a("div",{staticClass:"icon-box"},[a("Icon",{staticClass:"icon-bar",attrs:{type:"iconfont icon-yonghu",size:"35"}}),a("span",{staticClass:"template-type",attrs:{title:t.sourceType}},[e._v("\n E-User\n ")])],1),a("div",{staticClass:"content"},[a("div",{staticClass:"params",attrs:{title:t.name}},[a("span",{staticClass:"label"},[e._v("\n "+e._s(e.$t("sys.Name:"))+"\n ")]),e._v("\n "+e._s(t.execUser)+"\n ")]),a("div",{staticClass:"params",attrs:{title:t.dec}},[a("span",{staticClass:"label"},[e._v("\n ID:\n ")]),e._v("\n "+e._s(t.id)+"\n ")])])]),a("div",{staticClass:"item-option"},[a("span",{staticClass:"modify",on:{click:function(a){return e.deleteUserAction(t)}}},[e._v("\n "+e._s(e.$t("dataTemplate.SC"))+"\n ")])])])}))],2),a("div",{staticClass:"page-pagination"},[a("Pagination",{attrs:{loking:e.userPagination.locking,current:e.userPagination.current,size:e.userPagination.size,total:e.userPagination.total},on:{"on-change":e.userPageChange}})],1)]),a("Wb-button",{attrs:{slot:"action",type:"ghost"},on:{click:e.goback},slot:"action"},[e._v("\n "+e._s(e.$t("sys.return"))+"\n ")])],1)],1),a("weModal",{attrs:{title:e.$t("sys.Bindingnodes"),width:"500",closable:!1},on:{onConfirm:e.addNodeConfirm},model:{value:e.addNodeShow,callback:function(t){e.addNodeShow=t},expression:"addNodeShow"}},[a("Wb-form",[a("Form-item",{attrs:{label:e.$t("sys.Selectthenode")}},[a("Wb-select",{attrs:{filterable:""},model:{value:e.selectBindNode,callback:function(t){e.selectBindNode=t},expression:"selectBindNode"}},e._l(e.selectNodeList,(function(e){return a("wb-option",{key:e.id,attrs:{value:e.id,label:e.address}})})),1)],1)],1)],1),a("weModal",{attrs:{title:e.$t("sys.Bindtheuser"),width:"500",closable:!1},on:{onConfirm:e.addUserConfirm},model:{value:e.addUserShow,callback:function(t){e.addUserShow=t},expression:"addUserShow"}},[a("Wb-form",[a("Form-item",{attrs:{label:e.$t("sys.Selecttheuser")}},[a("Wb-select",{attrs:{filterable:""},model:{value:e.selectBindUser,callback:function(t){e.selectBindUser=t},expression:"selectBindUser"}},e._l(e.selectUserList,(function(e){return a("wb-option",{key:e.id,attrs:{value:e.id,label:e.execUser}})})),1)],1)],1)],1),a("weLoading",{directives:[{name:"show",rawName:"v-show",value:e.FesFesx.isLoading,expression:"FesFesx.isLoading"}]})],1)},Es=[];Rs._withStripped=!0;var Is={components:{weModal:w["a"],weLoading:L},data:function(){return{tabValue:"node",execoteNodeList:[],execoteUserList:[],selectBindNode:"",selectBindUser:"",selectNodeList:[],selectUserList:[],addNodeShow:!1,addUserShow:!1,nodePagination:{size:11,current:1,total:10},userPagination:{size:11,current:1,total:10},userData:JSON.parse(decodeURIComponent(this.$route.query.user))}},mounted:function(){this.getSelectNodeList(),this.getSelectUserList(),this.nodeSearchQuery(),this.userSearchQuery()},methods:{addNode:function(){this.addNodeShow=!0},addUser:function(){this.addUserShow=!0},nodeSearchQuery:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:11;this.FesFesx.set("isLoading",!0),this.FesApi.fetch("/admin/user/".concat(this.userData.id,"/exec/node/bind/pager"),{page:t,pageSize:a},"get").then((function(t){e.FesFesx.set("isLoading",!1),e.execoteNodeList=t.data,e.nodePagination.size=t.pageSize,e.nodePagination.current=t.page,e.nodePagination.total=t.totalPages}))["catch"]((function(){e.FesFesx.set("isLoading",!1)}))},userSearchQuery:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:11;this.FesFesx.set("isLoading",!0),this.FesApi.fetch("/admin/user/".concat(this.userData.id,"/exec/user/bind/pager"),{page:t,pageSize:a},"get").then((function(t){e.FesFesx.set("isLoading",!1),e.execoteUserList=t.data,e.userPagination.size=t.pageSize,e.userPagination.current=t.page,e.userPagination.total=t.totalPages}))["catch"]((function(){e.FesFesx.set("isLoading",!1)}))},nodePageChange:function(e){var t=e.current,a=e.size;this.nodeSearchQuery(t,a)},userPageChange:function(e){var t=e.current,a=e.size;this.userSearchQuery(t,a)},addNodeConfirm:function(){var e,t=this;this.FesApi.fetch(y()(e="/admin/user/".concat(this.userData.id,"/exec/node/")).call(e,this.selectBindNode,"/bind"),{},"post").then((function(){t.$Toast.success(t.$t("sys.Boundnodesuccess")),t.nodeSearchQuery(t.nodePagination.current,t.nodePagination.size)}))},addUserConfirm:function(){var e,t=this;this.FesApi.fetch(y()(e="/admin/user/".concat(this.userData.id,"/exec/user/")).call(e,this.selectBindUser,"/bind"),{},"post").then((function(){t.$Toast.success(t.$t("sys.Bindingusersuccessfully")),t.userSearchQuery(t.userPagination.current,t.userPagination.size)}))},deleteNodeAction:function(e){var t,a=this;this.$Message.confirm(this.$t("sys.Removenodes"),y()(t="".concat(this.$t("sys.Confirmtodeletetheexecutionnode"))).call(t,e.address,"?")).then((function(t){var s;0===t&&a.FesApi.fetch(y()(s="/admin/user/".concat(a.userData.id,"/exec/node/")).call(s,e.id,"/bind"),{},"delete").then((function(){a.$Toast.success(a.$t("sys.Deletenodesuccess")),a.nodeSearchQuery(a.nodePagination.current,a.nodePagination.size)}))}))},deleteUserAction:function(e){var t,a=this;this.$Message.confirm(this.$t("sys.Deleteuser"),y()(t="".concat(this.$t("sys.Confirmtodeletetheuserexecution"))).call(t,e.execUser,"?")).then((function(t){var s;0===t&&a.FesApi.fetch(y()(s="/admin/user/".concat(a.userData.id,"/exec/user/")).call(s,e.id,"/bind"),{},"delete").then((function(){a.$Toast.success(a.$t("sys.Deletetheusersuccessfully")),a.userSearchQuery(a.userPagination.current,a.userPagination.size)}))}))},goback:function(){this.$router.go(-1)},getSelectNodeList:function(){var e=this;this.FesApi.fetch("/admin/exec/node/selectAll",{},"get").then((function(t){e.selectNodeList=t}))},getSelectUserList:function(){var e=this;this.FesApi.fetch("/admin/exec/user/list ",{},"get").then((function(t){e.selectUserList=t}))}}},Js=Is,Ws=(a("5202"),Object(_["a"])(Js,Rs,Es,!1,null,"ee32ff88",null));Ws.options.__file="src/pages/sys/user/bind/index.fes";var Os=Ws.exports,js=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"task-main"},[a("fes-search-panel",[a("Wb-form",{attrs:{type:"query","label-width":150}},[a("Form-item",{attrs:{label:e.$t("task.ZYID")}},[a("wb-input",{attrs:{type:"number",placeholder:e.$t("task.QSR")},on:{"on-enter":function(t){return e.search(e.pagination.current,e.pagination.size)}},model:{value:e.query.jobId,callback:function(t){e.$set(e.query,"jobId",t)},expression:"query.jobId"}})],1),a("Form-item",{attrs:{label:e.$t("task.RWMC")}},[a("wb-input",{attrs:{placeholder:e.$t("task.QSR")},on:{"on-enter":function(t){return e.search(e.pagination.current,e.pagination.size)}},model:{value:e.query.jobName,callback:function(t){e.$set(e.query,"jobName",t)},expression:"query.jobName"}})],1),a("Form-item",{attrs:{label:e.$t("task.RWZT")}},[a("Wb-select",{attrs:{placeholder:e.$t("task.XZRWZT")},model:{value:e.query.status,callback:function(t){e.$set(e.query,"status",t)},expression:"query.status"}},[a("wb-option",{attrs:{value:"",label:e.$t("task.XZRWZT")}}),a("wb-option",{attrs:{value:"COMMIT",label:e.$t("message.newAllPage.Inthequeue")}}),a("wb-option",{attrs:{value:"RUNNING",label:e.$t("message.newAllPage.Intheoperationofthe")}}),a("wb-option",{attrs:{value:"KILL",label:e.$t("message.newAllPage.Hasstopped")}}),a("wb-option",{attrs:{value:"SUCCESS",label:e.$t("message.newAllPage.Executesuccessfully")}}),a("wb-option",{attrs:{value:"FAILD",label:e.$t("message.newAllPage.Onfailure")}}),a("wb-option",{attrs:{value:"RUNNING_TIMEOUT",label:e.$t("message.newAllPage.Runatimeout")}})],1)],1),a("Form-item",{attrs:{label:e.$t("task.KSSJ")}},[a("Wb-input-date-picker",{attrs:{"enable-seconds":"","enable-time":"",clearable:""},model:{value:e.query.triggerTimeBegin,callback:function(t){e.$set(e.query,"triggerTimeBegin",t)},expression:"query.triggerTimeBegin"}})],1),a("Form-item",{attrs:{label:e.$t("task.JSSJ")}},[a("Wb-input-date-picker",{attrs:{"enable-seconds":"","enable-time":"",clearable:""},model:{value:e.query.triggerTimeEnd,callback:function(t){e.$set(e.query,"triggerTimeEnd",t)},expression:"query.triggerTimeEnd"}})],1)],1),a("div",{attrs:{slot:"button"},slot:"button"},[a("Wb-button",{attrs:{type:"primary",icon:"search"},on:{click:function(t){return e.search(e.pagination.current,e.pagination.size)}}},[e._v("\n "+e._s(e.$t("task.CX"))+"\n ")])],1)],1),a("fes-list-panel",[a("Wb-table",{attrs:{data:e.data,"no-data-text":e.$t("task.ZWSJ")}},[a("Column",{attrs:{prop:"id",name:"ID",width:"90px"}}),a("Column",{attrs:{prop:"executerAddress",name:e.$t("task.ZXJD"),width:"130px"}}),a("Column",{attrs:{prop:"jobName",width:"110px",name:e.$t("task.RWMC")}}),a("Column",{attrs:{prop:"triggerType",width:"60px",name:e.$t("task.CFLX")}}),a("Column",{attrs:{prop:"triggerTime",width:"120px",name:e.$t("task.CFSJ")}}),a("Column",{attrs:{prop:"speed",width:"90px",name:e.$t("message.newAllPage.rate")+"(M/s)",classes:e.speedLimitStyle}}),a("Column",{attrs:{prop:"operater",width:"90px",name:e.$t("task.ZXYH")}}),a("Column",{attrs:{width:"80px",name:e.$t("task.ZT"),component:e.statusCompoennt}}),a("Column",{attrs:{prop:"completeTime",width:"120px",name:e.$t("task.WCSJ")}}),a("Column",{attrs:{component:e.tooltipComponent,width:"40px",name:e.$t("task.CS")}}),a("Column",{attrs:{component:e.operationComponent,name:e.$t("task.CZ"),width:"180px"}})],1),a("Pagination",{staticClass:"page-center",attrs:{loking:e.pagination.locking,current:e.pagination.current,size:e.pagination.size,total:e.pagination.total},on:{"on-change":e.changePage}})],1),a("weModal",{ref:"detailLogModal",attrs:{name:e.$t("task.RWYXRZ"),width:"1000","footer-disable":!1},on:{onConfirm:e.detailLog_close,onClose:e.detailLog_close},model:{value:e.detailShow,callback:function(t){e.detailShow=t},expression:"detailShow"}},[a("div",{staticClass:"ui-input-swap ui-input-textarea textarea-height"},[a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.textarea,expression:"textarea"}],staticClass:"ui-input",attrs:{id:"tt",readonly:""},domProps:{value:e.textarea},on:{input:function(t){t.target.composing||(e.textarea=t.target.value)}}})]),a("div",{staticClass:"button-box"},[a("Wb-button",{staticClass:"prepage",attrs:{type:"primary",disabled:e.disabled},on:{click:e.prePage}},[e._v("\n "+e._s(e.$t("task.SYY"))+"\n ")]),a("Wb-button",{staticClass:"prepage",attrs:{type:"primary",disabled:e.disabled},on:{click:e.nextPage}},[e._v("\n "+e._s(e.$t("task.XYY"))+"\n ")]),a("Wb-button",{attrs:{type:"primary",disabled:e.disabled},on:{click:e.newLog}},[e._v("\n "+e._s(e.$t("task.CKZXRZ"))+"\n ")])],1)]),a("weModal",{attrs:{title:e.$t("message.newAllPage.Setoperationrate")},on:{onConfirm:e.setSpeedLimit},model:{value:e.speedLimitShow,callback:function(t){e.speedLimitShow=t},expression:"speedLimitShow"}},[a("Wb-form",{ref:"speedLimit",attrs:{"label-width":80,rule:e.ruleValidate}},[a("Form-item",{attrs:{label:e.$t("message.newAllPage.Operatingrate"),prop:"speedLimit"}},[a("Wb-input",{attrs:{placeholder:e.$t("message.newAllPage.Pleaseentertheoperationrate")},model:{value:e.currentSpeedLimit,callback:function(t){e.currentSpeedLimit=t},expression:"currentSpeedLimit"}})],1)],1)],1)],1)},Ys=[];js._withStripped=!0;var Hs=a("e9d4"),Qs=a.n(Hs),Us=a("7ead"),Gs=a.n(Us),Vs=a("2478"),qs={FesDataCache:"log",FesHeader:!1,data:function(){var e=this,t=function(t,a,s){/^[0-9]+$/.test(a)?(a>102400&&s(new Error("".concat(e.$t("components.ZYSLBCG"),"100G"))),a<=0&&s(new Error(e.$t("message.newAllPage.Pleaseenterthecorrectnumber"))),s()):s(new Error(e.$t("message.newAllPage.Pleaseenterthecorrectnumber")))},a=this;return{query:{jobId:"",jobName:"",status:"",triggerTimeBegin:null,triggerTimeEnd:null},searchTimestamp:0,refreshTimestamp:0,textarea:"",data:[],pagination:{size:10,current:1,total:0},logLock:!1,logTimer:null,logStatusTimer:null,detailShow:!1,windSize:50,taskId:"",endLineNum:"",startLineNum:"",disabled:!0,buttonFlag:"",timer:"",speedLimitShow:!1,currentSpeedLimit:"",operationComponent:function(e){var t,s;return new Vue({data:function(){return{trData:e}},methods:{logDetailButton:function(e){a.textarea="","RUNNING"===e.status||"RUNNING_TIMEOUT"===e.status?a.disabled=!0:a.disabled=!1,a.logDetail(e.id,-1,-50),a.taskId=e.id},KILLButton:function(e){a.$Message.confirm(a.$t("task.ZZRW"),a.$t("task.SFZZRW")).then((function(t){0===t&&(a.logLock=!0,a.FesApi.fetch("/jobtask/kill/"+e.id,{},"post").then((function(){a.search(a.pagination.current,a.pagination.size),a.$Toast.success(a.$t("task.RWYZZ"))}))["catch"]((function(){a.logLock=!1})))}))},deteleButton:function(e){a.$Message.confirm(a.$t("task.SCRZ"),a.$t("task.SFSCRZ")).then((function(t){0===t&&(a.logLock=!0,a.FesApi.fetch("/jobtask/delete/"+e.id,"delete").then((function(){a.search(a.pagination.current,10),a.$Toast.success(a.$t("task.SCRZCG"))}))["catch"]((function(){a.logLock=!1})))}))},speedLimitAciton:function(t){var s;r()(s=["RUNNING","RUNNING_TIMEOUT"]).call(s,e.status)?(a.speedLimitShow=!0,a.currentSpeedLimit=t.speedLimit||"",a.taskId=t.id):a.$Toast(a.$t("message.newAllPage.Theexecutionoftaskcanbesetup"))}},template:y()(t=y()(s='
KILL'.concat(a.$t("task.XXRZ"),'')).call(t,a.$t("message.newAllPage.Thedynamicspeedlimit"),"
")})},tooltipComponent:function(e){return new Vue({data:function(){return{taskParams:Gs()(e.taskParams),option1:{direction:"left",align:"center",component:new Vue({data:function(){return{a:e.taskParams}},template:"{{a}}"})}}},methods:{defaultValue:function(){var e;return y()(e="".concat(this.taskParams[0][0]," : ")).call(e,this.taskParams[0][1])}},template:'{{defaultValue()}}'})},statusCompoennt:function(e){return new Vue({data:function(){return{trData:e}},methods:{statusFilter:function(e){switch(e.status){case"SUCCESS":return{color:"SUCCESS",lable:a.$t("message.newAllPage.Executesuccessfully")};case"RUNNING":return{color:"RUNNING",lable:a.$t("message.newAllPage.Intheoperationofthe")};case"FAILD":return{color:"FAILD",lable:a.$t("message.newAllPage.Onfailure")};case"RUNNING_TIMEOUT":return{color:"RUNNING_TIMEOUT",lable:a.$t("message.newAllPage.Runatimeout")};case"COMMIT":return{color:"COMMIT",lable:a.$t("message.newAllPage.Inthequeue")};case"KILL":return{color:"KILL",lable:a.$t("message.newAllPage.Hasstopped")};default:return{color:"",lable:"---"}}}},template:'{{statusFilter(trData).lable}}'})},ruleValidate:{speedLimit:[{required:!0,message:this.$t("components.SRZQZYSL")},{validator:t,trigger:"change"}]}}},components:{weLoading:L,weModal:w["a"]},FesReady:function(){this.logLock=!0,this.search()},watch:{data:{handler:function(e,t){var a=this;t.length>0&&ae()(e).call(e,(function(e,s){var n,i,r;if(t[s]&&e.status!==t[s].status&&e.id===t[s].id)if("SUCCESS"===e.status)a.$Toast.success(y()(n=y()(i=y()(r="".concat(a.$t("task.RW"),":")).call(r,e.jobName,",ID:")).call(i,e.id)).call(n,a.$t("task.ZXCG"),"!"));else if("FAILD"===e.status){var o,l,c;a.$Toast.success(y()(o=y()(l=y()(c="".concat(a.$t("task.RW"),":")).call(c,e.jobName,",ID:")).call(l,e.id)).call(o,a.$t("task.ZXSB"),"!"))}}))},deep:!0}},beforeDestroy:function(){clearTimeout(this.logTimer),clearTimeout(this.timer)},methods:{logDetail:function(e,t,a){var s=this;this.logLock||(this.logLock=!0,this.FesApi.fetch("/jobtask/log",{taskId:e,startLine:t,windSize:a},"get").then((function(t){s.logLock=!1,t.endLineNum!==t.startLineNum&&(s.endLineNum=t.endLineNum,s.startLineNum=t.startLineNum),b()(t.endLineNum)<0?s.$Toast.warn(s.$t("task.WFHQRZ")):("undefined"!==typeof t.logContent&&(s.textarea=t.logContent),s.showLog(),t.end?s.disabled=!1:s.logTimer=Qs()((function(){s.logDetail(e,-1,-50)}),5e3))}))["catch"]((function(){s.logLock=!1})))},newLine:function(e){e.target.scrollTop=e.target.scrollHeight},showLog:function(){this.detailShow=!0},detailLog_close:function(){null!=this.logTimer&&(clearTimeout(this.logTimer),this.logTimer=null),this.logLock=!1},search:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.pagination.total=0,this.FesApi.fetch("/jobtask/pageList",{taskId:this.query.jobId,fuzzyName:this.query.jobName,status:this.query.status,triggerTimeBegin:this.query.triggerTimeBegin,triggerTimeEnd:this.query.triggerTimeEnd,page:t,pageSize:a},"get").then((function(s){e.timer&&clearTimeout(e.timer),e.searchTimestamp=(new Date).getTime(),e.data=s.data,e.pagination.total=s.totalPages,e.pagination.current=t,e.pagination.size=a,e.logLock=!1,e.repetitionRunning()}))["catch"]((function(){clearTimeout(e.timer),e.repetitionRunning(),e.logLock=!1}))},repetitionRunning:function(){var e=this;if(this.data.length>0){var t={};for(var a in this.data){var s=this.data[a];"RUNNING"!==s.status&&"COMMIT"!==s.status&&"RUNNING_TIMEOUT"!==s.status||(t[a]=s.id)}var n=h()(t).length;n>0&&(this.timer=Qs()((function(){e.search(e.pagination.current,e.pagination.size)}),6e3))}},changePage:function(e){var t=e.current,a=e.size;this.search(t,a)},prePage:function(){this.detailLog_close(),this.buttonFlag===Vs["a"].NEXT?this.logDetail(this.taskId,this.startLineNum,-50):this.logDetail(this.taskId,this.endLineNum,-50),this.buttonFlag=Vs["a"].PRE},nextPage:function(){this.detailLog_close(),this.buttonFlag===Vs["a"].PRE?this.logDetail(this.taskId,this.startLineNum,50):this.logDetail(this.taskId,this.endLineNum,50),this.buttonFlag=Vs["a"].NEXT},newLog:function(){this.buttonFlag=null,this.detailLog_close(),this.logDetail(this.taskId,-1,-50)},setSpeedLimit:function(){var e=this;this.$refs.speedLimit.validate((function(t){var a;t?e.FesApi.fetch(y()(a="/jobtask/".concat(e.taskId,"/speed/limit/")).call(a,e.currentSpeedLimit),{},"put").then((function(t){e.search(e.pagination.current,e.pagination.size)})):e.speedLimitShow=!0}))},speedLimitStyle:function(e){return e>=1&&e<50?"normal":e>=50&&e<100?"warnig":e>=100?"error":void 0}}},zs=qs,Ks=(a("3e01"),Object(_["a"])(zs,js,Ys,!1,null,null,null));Ks.options.__file="src/pages/task/index.fes";var en=Ks.exports;t["a"]=[{path:"/sys/executor/bind",component:Ts,name:"sys_executor_bind_index",count:21},{path:"/sys/user/bind",component:Os,name:"sys_user_bind_index",count:21},{path:"/ds/dataTemplate",component:B,name:"ds_dataTemplate_index",count:14},{path:"/group/groupDetail",component:ve,name:"group_groupDetail_index",count:14},{path:"/ds/newManager",component:z,name:"ds_newManager_index",count:14},{path:"/sys/executeUser",component:hs,name:"sys_executeUser_index",count:14},{path:"/sys/executor",component:Ds,name:"sys_executor_index",count:14},{path:"/sys/owner",component:Ls,name:"sys_owner_index",count:14},{path:"/sys/user",component:Xs,name:"sys_user_index",count:14},{path:"/help",component:Fe,name:"help_index",count:7},{path:"/home",component:Ne,name:"home_index",count:7},{path:"/job",component:Xe,name:"job_index",count:7},{path:"/group",component:re,name:"group_index",count:7},{path:"/task",component:en,name:"task_index",count:7},{path:"/login",component:rs,name:"login_index",count:7}]},"9d64":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHUAAAAXCAYAAAA1OADtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjVGREZCMjNGRkM2NTExRTU4RjdDRDFCNjdDMUYwQjQ0IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjVGREZCMjQwRkM2NTExRTU4RjdDRDFCNjdDMUYwQjQ0Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NUZERkIyM0RGQzY1MTFFNThGN0NEMUI2N0MxRjBCNDQiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NUZERkIyM0VGQzY1MTFFNThGN0NEMUI2N0MxRjBCNDQiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7i+XFBAAAHJklEQVR42uxaaWxVRRS+3WwRC61QVoUGUHApD+PGqhCQRSug4AIxJGjQKCq4gAoEEeMCiAEUTAQDVRKVKIEoiBIKiRaQBCxVikLZbBEKRSl7F3meMd/F43Bm7tz3atIfnuRLe2fOrGfmbPMSotGo9z/VS3qBMI2Qhu8qwkjC8qCGydr37YQ8dKSgJL6T0D2GSb1FeIhN6hxhFmF2HS78EswvycJTTThDOELYRVhPWE04W8+FeiPbO0WpmL8XVqi3ENpqZSdjnFRfQnP23ZhQXscLv5bQLgT/HYSxhArCGMKKeizUiPZdQ/jZpWGi9t1Z4Nkew4SSseF10ZeNOsfYrinhMxzi+kgNCB20smJCbSw3NUfgKYphUp2gGjnVup60OIX6B+GEpqKbCwdYqezxsFMmuoIwmnAroTXKSgirCJ/+hyr8OmG+RWFulE8pIW5XLuFFDDydsMbhcBRDhUiUhLGvIWRhs34lbCKctsxfGudpwlKtrAnhc/gM+uaZaCLhVeFwdiEMJ7yMv1sD9rgJTFojZuP3Eg6HXFdMQu0IwQbp8TsJK9lJWg5hHAi4QT8KZRmESYSHsXidlMe3hDCZcMzxpkqLV23nC0I9b9iXVwhT8b8SWhlsXDbjycZhztEEdDPhLkJPODsZhjFKcdtnwYmz2VNp/3oQ7oUDdRlbz0+eCmmAkdGLqZDVK3QhnBT43tb4Vgs8EzWe2whHom70G+F6rX2WwFdDSNH4fDwi8K8U+HIItYS9hBtYeRJhidDHHMaTEQ1P5RiTzyFf4GvJ6h8kVAs8OwhteEdvCkx5rF51WmqYWCUhnfGWCTwDWX1PwpmQi99DaMD66CvwbDcIVAmkQOB/jvFkE74gHCScx0ZPIByCsBRPW8OB8/voFY2NNmnzrdDqK1jdREMfG/x5JjqqsksJX8JxkKgRHArfhrS29KXU0TJ4eHo8qeLHDwiFQnsVuowKsDv7oRZ9dIQq/EqItVXc/CH7TiBcSWhF+AXqTpmeb8ErOZaKWrIwMMewP79j/cWI/XXqyvaspWCKiuB3LCDMENp/QuhPOP73FzsB0i3sh1O+wuG0lRASCb2FOn7SXhfqt+EW8PlMF/i+YfWLo/HRo8KNTiOcgGpT8xxDGEroTxhk2Ycn0f49oS5XG6MTNJtOPVE/QKh7H6ZCohmEBD6G/0+moUEzwuwQGzWYME4oX49xGgo2uVKzFz6SBZtbyuq3xiHQHVibPuasGPsbi/aSis8Uxlkl8HVD3QShrkoo+5PwhGRuki2q9zC8q2eFuqNQualauYr79lnCosHMU/NpG+JAzzBOFvtuqIVA8WSiNmLcY0z9PhZjf9sM6vcg4mad0oWyMoss9LBKhXwjEIUYQxpTR+8K5btgnwYK8WAfQ+znu+MDhLregAsdxd+rtLyoh4TDYq3sctjIHgJ/e8TaE/A9BptdQNiNMK2DIdTSbfP3sOHpjrFlByEVWxZglzkVmgTKbepCRzVzlNCOqccDju1uQpudcdrBdejnfqEu3+D5+uHPRkvIlgIv9hShBWvXyGGNm8F7t8He6XNpKvAVsHlUO+7FPab1JobIoapEwFBkQ/y033yHdufh9XnCY0FY+iFk0oHf8NeEcl+dD4LX+ZGWSHie0CZgTvkh52TLFnUSEkCeIas2Q1DLFxL6iQHpMp9GQTVxWohnLRuVgCdVCGP8UCXTEZMtGxP0WCCFY3uZUD3h1Wa0w76sDpnai1j4pD7egQnZrZUrE/S4Sajt2Ik10STEllLyPC+gbRG76VVC/UDEVzZU4m9ViDQaJxV/viSUr9UEzp8GW1nicm7HNxsEYnrAsKVQI4Y5qnGeEeqm4rBfJNQgw6ySAW9Y6uc5CtUTTpsHZ2wmHBOf0pBDHQ/tMFtLdEhqPAXJdh/K+XoAJmKH0OYc8sqKTgkOTGOHW7oFwktFosPlAaNzyJvq16mXoXWCIzhFcpSmWYzxWksulWONpY8hDikun1Tq8LhQrspSWYqxLugpNq8RzGFJQlkThz4WsZy4TksN6cqzGt9+S3r1uNY+ghQmp2rmvF5wlExOUjGelmocTuwcx5s6z5AC5I/D0g1RZb3ifBjnDt842CqfliFu7Y6Xk0zEr6UBfWVYbnWRIZRJM/gCmUJ6dbvwnSdoqJm6+pU2qRxPbJWOG/W1wX6cRD6Wq7x++NWBK9UgJiuz2B0XUu+zcwlXCyYj1/vnpzfDIMwFAQdQ0RAIST3P7XSw8ZGQ9lQ6GFOEx/lheOq7kHxYgyxPOpiVIBZp76NBFEXmKZc5XUqAe4QEtroB98HjVsn2boQWOPVVOEjlsIMqU7PB+/fvpL4jHHKY0wmsZz8O3L4AD30pMk3NIODhCBlqWZLmHPotwYZ/zJL9ESRf2uPmbhHGOQQfIh0RwWk83nv4nosxE7AX0uE/iPfnrrilKWibjb3x/hJgANWjL/Qrnss7AAAAAElFTkSuQmCC"},ab38:function(e,t,a){},abc4:function(e){e.exports=JSON.parse('{"message":{"newAllPage":{"Projectbuttoncomponent":"Project button component","Onlysupertubeandadministratorshaveaddpermissions":"Only super tube and administrators have add permissions","Noaddgrouppermissions":"No add group permissions","Nodeletegrouppermissions":"No delete group permissions","Helpdocumentrefertothebelow":"Help document refer to the below","address":"address","Thedocumentdetails":"The document details","Welcometologin":"Welcome to login Exchangis system","system":"system","Pleaseenteryourusername":"Please enter your user name","Pleaseenterthepassword":"Please enter the password","Thelogin":"The login","Musthavealetter":"Must have a letter","Andonlysupportletter":"And only support letter","digital":"digital","Theunderline":"The underline","Namecannotbemorethanlength":"Name cannot be more than length","Passwordlengthcantmorethan":"Password length can\'t more than","Thesuperuser":"The super user","Manageusers":"Manage users","Theaverageuser":"The average user","Notloggedin":"Not logged in","rate":"rate","Setoperationrate":"Set operation rate","Operatingrate":"Operating rate","Pleaseentertheoperationrate":"Please enter the operation rate","Pleaseenterthecorrectnumber":"Please enter the correct number","Whethertodisablelogbuttonatthebottom":"Whether to disable log button at the bottom","Detailedlogbutton":"Detailed log button","Determinewhethertoclickdetails":"Determine whether to click details","and":"and","state":"state","button":"button","Thedeletebutton":"The delete button","Displayinputbox":"Display input box","Theexecutionoftaskcanbesetup":"The execution of task can be set up","Thedynamicspeedlimit":"The dynamic speed limit","Executesuccessfully":"Execute successfully","Intheoperationofthe":"In the operation of the","Onfailure":"On failure","Runatimeout":"Run a timeout","Inthequeue":"In the queue","Hasstopped":"Has stopped","Backlog":"Back log","Thenextpagelog":"The next page log","Toviewthelatestlog":"To view the latest log","Adjustablemeetagainafterthemodificationoftheinterfacedata":"Adjustable meet again after the modification of the interface data","Thecolorofthestate":"The color of the state","Queryconditions":"Query conditions","Tasknameand":"Task name and","Forthetree":"For the tree","Tochoosetimedeterminewhetherillegal":"To choose time determine whether illegal","Aslegal":"As legal","Performatask":"Perform a task","Ifconfirmtoperformatask":"If confirm to perform a task","Searchproject":"Search project","Determinethestartandendarelegal":"Determine the start and end are legal","Getalltheprojectlist":"Get all the project list","Getsthecurrentgroupofmembersallcanbeadded":"Gets the current group of members all can be added","Getpacketdetails":"Get packet details","Addagroupingandupdategroup":"Add a grouping and update group","Firsttakethegroupmembersdidnotsave":"First take the group members did not save","Groupeddataispaging":"Grouped data is paging","Unabletogetalistofall":"Unable to get a list of all","Thetotalnumberofpagestocalculate":"The total number of pages to calculate","Whensearchingthecustomusername":"When searching the custom user name","Firstdeterminevalueandvalue":"First determine value and value","Havevaluetodeterminewhethertorepeat":"Have value to determine whether to repeat"},"newComponents":{"XY":"Less","DY":"Greater","DYH":"Equal","BDY":"Unequal","XYDY":"LE","DYDY":"GE","SimplifiedChinese":"Simplified Chinese","Notlessthanminimummemory":"Not less than minimum memory","Taskvariables":"Task variables","Pleaseselecttheexecutionnode":"Please select the execution node","Checkthetype":"Check the type","Pleaseselectacalibrationtype":"Please select a calibration type","Checknumber":"Check number","Pleasefillinthechecklist":"Please fill in the check list","new":"new","Fieldlengthcantmorethan":"Field length can\'t more than","Supportonlyalphanumericunderlineandhorizontalline":"Support only alphanumeric underline and horizontal line","Pleasefilloutthe":"Please fill out the","value":"value","Pleasefillinavariablesvalue":"Please fill in a variable\'s value","confirm":"confirm","Pleaseenterthechecknumber":"Please enter the check number","SupportonlylettersandNumbers":"Support only letters and Numbers","Thereare":"There are","Multi-selectlistnobindingvalueisnotempty":"Multi-select list no binding value is not empty","Ifnotedit":"If not edit","Thedefaultexecutionuserisloggedinuser":"The default execution user is logged in user","Taskvariablesexistduplicatekey/valuepair":"Task variables exist duplicate key/value pair","Confirmationbeforeyoucheckitagain":"Confirmation before you check it again","Convertedto":"Converted to","Thenewfield":"The new field","Pleaseenterthesourcefield":"Please enter the source field","Pleaseenterthepurposefield":"Please enter the purpose field","point":"point","delete":"delete","Needtojudgewhetherasourceforthestructure":"Need to judge whether a source for the structure","Purposeisnottocanmanuallyaddcolumnsstructure":"Purpose is not to can manually add columns structure","Todeterminewhether":"To determine whether","engine":"engine","Thetotalnumberofpagestocalculate":"The total number of pages to calculate","Ifthesourcefieldhastheoptionofarepeatrunwrong":"If the source field has the option of a repeat run wrong","Repeatingfield":"Repeating field","Checkfunctionvalue":"Check function value","Checkfunctionparametersbuttontoadd":"Check function parameters button to add","Checkthefunction":"Check the function","Parameterlength":"Parameter length","Thesequenceofstoredinthearray":"The sequence of stored in the array","Setwhetherthereisafearofjudgmenttochoosefirst":"Set whether there is a fear of judgment to choose first","Didntstopthenextstep":"Didn\'t stop the next step","Mappingfieldcannotbeempty":"Mapping field cannot be empty","Sourcefieldandthetargetfieldischoice":"Source field and the target field is choice","Objectivefieldlengthisnotgreaterthanthesourcefield":"Objective field length is not greater than the source field","Thetargetfieldisnotgreaterthanthesourcefield":"The target field is not greater than the source field","Anewfield":"A new field","Deleteacertainfield":"Delete a certain field","Needtousethelibrary":"Need to use the library","Thetableset":"The table set","Thecurrentneedtobeconfigured":"The current need to be configured","Thesubscript":"The subscript","Ifallthetabletoshowinthelist":"If all the table to show in the list","Willbeatablebeforethelasttableandfieldsfortheuseofpop-upwindow":"Will be a table before the last table and fields for the use of pop-up window","Ifthefirstitemnovalueaddadefaultvalue":"If the first item no value add a default value","if":"if","Quantityislessthan2":"Quantity is less than 2","empty":"empty","Accesstothedatasource":"Access to the data source","Selectthedatasource":"Select the data source","Increasetheconnectionconfigurationfield":"Increase the connection configuration field","Deletethecurrentitemthelastitemonthefieldconfiguration":"Delete the current item the last item on the field configuration","Theconnectionconfigurationfieldtojoin":"The connection configuration field to join","Ifisnewadded":"If is new added","to":"to","Ormodify":"Or modify","Canceltheconfigurationshouldbejustadddeletetable":"Cancel the configuration should be just add delete table","Ifitisnew":"If it is new","Whenconfiguredtocanceladdtablewillbedeleted":"When configured to cancel add table will be deleted","Validationofconfigurationitemsarefree":"Validation of configuration items are free","Addconfirmationbefore":"Add confirmation before","Arefreejudgment":"Are free judgment","Ifthelasttablefieldsdidntmatch":"If the last table fields didn\'t match","Thedefaultvalue":"The default value","Theindexset":"The index set","Emptydirectory":"Empty directory","Additionaldata":"Append data","Collectionisanasynchronousreturnedsotheasynchronouscantassignmentbeforereturntheresult":"Collection is an asynchronous returned so the asynchronous can\'t assignment before return the result","Determineenginefirstchoice":"Determine engine first choice","Injudgingrecord":"In judging record","Ifitis":"If it is","Engineistheresponsibilityofthesourcedatasourcejudgmentobjectivedatasourceoption":"Engine is the responsibility of the source data source judgment objective data source option","Datasourceschangeinitialvalue":"Data sources change initial value","Selectthedatasourceinterfacetoget":"Select the data source interface to get","data":"data","through":"through","Toobtain":"To obtain","Acollectionof":"A collection of","Byselectingtheindexnameiscustom":"By selecting the index name is custom","Todeterminetheindextype":"To determine the index type","Queryconditions":"Query conditions","Tasknameandprojectname":"Task name and project name","Tohideanddisplayofthecontrolprocess":"To hide and display of the control process","Chooseexecutionengine":"Choose execution engine","Settheglobalenginevariables":"Set the global engine variables","Thepreviousstep":"The previous step","Thenextstep":"The next step","Togettothefieldofinformationforuseinstep3":"To get to the field of information for use in step 3","Bynametoheavy":"By name to heavy","Whenthesourcedata":"When the source data","Whencanchoosesynchronousmetainformation":"When can choose synchronous meta information","Checkwhenthereisnofieldmappingandpostprocessor":"Check when there is no field mapping and post processor","Havesynchronousmetainformation":"Have synchronous meta information","Nofurtheroperation":"No further operation","Thepurposeof":"The purpose of","Thesourcearestructured":"The source are structured","Thepurposeofunstructured":"The purpose of unstructured","Sourceforstructured":"Source for structured","Copyoftasks":"Copy of tasks","Afterselectiontableagain":"After selection table again","Savetheinformationandmetadatasourcesonnoproblem":"Save the information and metadata sources on no problem","Isthetabletocompare":"Is the table to compare","Ifyoudontlike":"If you don\'t like","Emptyeditcachedata":"Empty edit cache data","Ifthesecondstepis":"If the second step is","type":"type","Edittemplatedatawasobtainedfromthebackground":"Edit template data was obtained from the background","Ifitisinediting":"If it is in editing","Todeterminewhetherthereisatemplateinformation":"To determine whether there is a template information","Ifyouhaveused":"If you have used","Nobackgroundrequesttemplate":"No background request template","Ifitisthecustom":"If it is the custom","Alsocalculatetheobjectivevalue":"Also calculate the objective value","Stepontheeditor":"Step on the editor","Editoristhenextstep":"Editor is the next step","Thesecondpart":"The second part","Checkiftheinformationsource":"Check if the information source","Addtoedit":"Add to edit","Thefirstpart":"The first part","Whenthetransmissionmodeisrecordtypeisthecompressiontypeandfileseparator":"When the transmission mode is record type is the compression type and file separator","Thefourthpart":"The fourth part","Thefifthpart":"The fifth part","Thenewdemand":"The new demand","Aslongasitisthesourcedataisstructureddatasources":"As long as it is the source data is structured data sources","Therewillbe4fields":"There will be 4 fields","Therearetwofieldmapping:":"There are two field mapping:","Sourceanddestinationarestructured":"Source and destination are structured","Thesourceisstructured":"The source is structured","Thepurposeisnotstructured":"The purpose is not structured","Synchronousmetainformationdata":"Synchronous meta information data","Tojudgewhetherthereisafirst":"To judge whether there is a first","Todeterminewhethermorethanthreelayers":"To determine whether more than three layers","Onlysupportsnomorethanthreelayersofengineering":"Only supports no more than three layers of engineering","Selectedbydefaultthefirstproject":"Selected by default the first project"},"newUitemplate":{"Librarytable":"Library table","Pleaseselectthedatabase":"Please select the database","Pleaseselectadatatable":"Please select a data table","new":"new","timing":"timing","OnMonday,":"On Monday,","OnTuesday,":"On Tuesday,","OnWednesday,":"On Wednesday,","OnThursday,":"On Thursday,","OnFriday,":"On Friday,","OnSaturday,":"On Saturday,","OnSunday,":"On Sunday,","minutes":"minutes","Perhour":"Per hour","Everyday,":"Every day,","Onceaweek":"Once a week","Amonth":"A month","Everyyear,":"Every year,","points":"points","when":"when","month":"month","day":"day","every":"Per","Willbeconvertedtotheselectedtime":"Will be converted to the selected time","format":"format","Stillhavetomakesurewhatisthefirstchoicetodeterminetheexpressionishowtowrite":"Still have to make sure what is the first choice to determine the expression is how to write","Ifyouchooseday23selectionboxthereisnoshow":"If you choose day 23 selection box there is no show","Fourorfiveselectionbox":"Four or five selection box","will":"will","Formatistransformedintotimeformat":"Format is transformed into time format","Todeterminewhetherselectedyearfirst":"To determine whether selected year first","Usedtostorecustomindexname":"Used to store custom index name","Indexofcustomlogic":"Index of custom logic","Whenuserssearchforthevalueofthereturnisnotthebackgroundofthelist":"When users search for the value of the return is not the background of the list","Willaddaandindextypeonly":"Will add a and index type only","Searchthevalueofthereturninthebackgroundandnotreturnthedatainthedata":"Search the value of the return in the background and not return the data in the data","Tomonitorthefiletype":"To monitor the file type","Modifythecompressedmode":"Modify the compressed mode","Todeterminewhether":"To determine whether","engine":"engine","Transferthedatasource":"Transfer the data source","Dothedatatransfer":"Do the data transfer","Willusethedirectorysemaphorefileread/writesynchronization":"Will use the directory semaphore file read/write synchronization","Pleaseenterthe":"Please enter the","Wheneveryouchosedatareadorwritedatacanbeused":"Whenever you chose data read or write data can be used","Thepasswordboxforthefocus":"The password box for the focus","Whenediting":"When editing","Ifgetfocusvalueasthedefaultvalueisempty":"If get focus value as the default value is empty","Passwordboxlosesfocustojudgewhetherthereisamodifytheinitialvalue":"Password box loses focus to judge whether there is a modify the initial value","Ifthevalueisnull":"If the value is null","Changethevaluetothedefaultvalue":"Change the value to the default value","Transferstoobtaintemplatepage":"Transfers to obtain template page","Accesstothedatasourcetemplate":"Access to the data source template","Ifitisnotneedtoaddnew":"If it is not need to add new","Withoutpermissioninthetemplate":"Without permission in the template","Dontpassthistwofields":"Don\'t pass this two fields","Judgewhetherthecurrentusertotheadministratorusersandowner":"Judge whether the current user to the administrator users and owner","Checkwhethertheirowner":"Check whether their owner","through":"through","Todeterminewhethercanoperation":"To determine whether can operation","Changechangescorrespondingtothealias":"Change changes corresponding to the alias","Prompttheuserwhetherdeletetodeletethemiddletable":"Prompt the user whether delete to delete the middle table","Mustfirstdeterminewhetherthelastitem":"Must first determine whether the last item","Accordingtothesubscripttakecorrespondingtorenamethetable":"According to the subscript take corresponding to rename the table","and":"and","Willbelostundostack":"Will be lost undo stack","Tocancelthestack":"To cancel the stack"}},"pageDs":{"XZWQXS":"Choose the right to limit","BYCXMCS":"Don\'t pass the following parameters","YHWSCQX":"The current user remove permissions","YHWBJQX":"The current user has no edit permissions","PDSFGLY":"Judge whether the current user to the administrator users and owner","XJCSBSZJSZ":"Check whether their owner","ZTON":"through","LPAND":"To determine whether can operation","TG":"through","HQDYGCM":"To obtain the corresponding project name","HQSOGOCS":"Get all the engineering data","CKXQ":"Check the details","TONJKHQXX":"Through the interface for more details information"},"manager":{"resourceManager":"Data Source Management","resourceType":"Data Source Type","selectResourceType":"Select the data source type","resourceName":"Data Source Name","SRSZYM":"Enter the data source name","SZYSZ":"Data Source Owner","XZSJYSZ":"Select source","CX":"Select","XZCX":"New Data Source","LX":"Type","CJZ":"Creator","XM":"Project","CJZSJ":"Created Time","XQ":"Detail","BJ":"Edit","SC":"Delete","LJXX":"Connection Information","CKLJXX":"View Connection Information","XZSJK":"Select Data Source","GXSJK":"RMDB","SJY":"Data Source","SJK":"DB","DSJCC":"Big Data Storage","BJGHCC":"Semi-structured Storage","ZW":"None","WJGHCC":"Unstructured Storage","FW":"Server","SJYSZJK":"The api of obtaining data soruce onwers","CXSJ":"Query Data","DJFY":"Click paging","CJSJYCG":"Success to create data source","GXSJ":"Update","GXCG":"Success to update data source","LJSJYCG":"Success to connect data source","SCSJY":"Delete Data Source","SFSCSJY":"Do you want to delete data source named \'{name}\'","SCSJYCG":"Success to delete data source"},"dataTemplate":{"SJYMBGL":"Data Source Model Management","SJYLJCSMBGL":"Model Management Of Data Source Parameters","MBLX":"Model Type","QXZSJY":"Please select data source type","MBMC":"Model Name","CXMBMC":"Please enter the model name of query","CX":"Query","XZMB":"New Model","CKXQ":"View Details","XG":"Edit","SC":"Delete","XZSJYLX":"Data Source Type","SRWB":"Please enter text","MBMS":"Model Desc","DZ":"Address","QSR":"Please enter","LJCS":"connectParameters","CSM":"Param Name","CSZ":"Param Value","PZX":"Configuration","PZM":"Configuration Name","PZZ":"Configuration Value","DZDKH":"Address Port","RZFS":"Auth Mode","SZYLXBMK":"Data Source type cannot be empty","MBMCBLK":"Model name cannot be empty","MCCDBNDY":"Name length cannot be greater than 100","ZU":"Only support letters, numbers, Chinese and specific characters: (_ . :)","MOMSBNK":"Model description cannot be empty","MBCDBNDY":"Description length cannot be greater than ","DZBNK":"Address cannot be empty","CDBNDY":"URL length cannot be greater than 1000","DZBNWK":"Address Port cannot be empty","BNWK":"cannot be empty","MR":"default","WQX":"None","CKMB":"View Model","XGMB":"Edit Model","TJMB":"Add Model","TJJK":"Call add interface","MBMCBKTM":"Model name cannot have the same","XZMBCG":"Succe","XGMBCG":"Success to create model","XGMBSB":"Fail to modify model","SCMB":"Delete Model","KECRWB":"Allow to enter text and ","QRSCMB":"Whether confirm to delete model","ZDLG":"Two max","DYTPZYG":"First of the first configuration","QR":"Confirm","PZDRG":"Second of the configuration","FQ":"Abort","MB":"Model","SCCG":"Success to delete","CXSJ":"Query Data","DJFY":"Click paging","PZSJDCC":"Configuration value out of focus duplicate check","PZ":"Configuration","J":"Key","Z":"Value","CF":"Duplicate","JC":"Check","SFCF":"If duplicate"},"job":{"projectlist":"Project List","taskNameLable":"Project Name:","input":"Please enter","task":"Project ID","query":"Query","addJob":"Add Job","taskName":"Job Name","timeJob":"Cron Job","jobDesc":"Job Desc","jobStatus":"Job Status","creatTime":"Created Time","action":"Operation","addProject":"Add Job","XZXM":"Add Project","MXMC":"Project Name","SRXMMC":"Please enter the project name","MS":"Description","TJ":"Submit","LS":"Run History","QXZQSSJ":"Start time:","QXZZZSJ":"End time:","JGSJ":"Interval Unit:","JGCD":"Interval Length:","SRSJCD":"Please enter the length","CXTJ":"Query Condition","MCY":"Job name and ","HDS":"Acquire tree","XZSJSFBHF":"Whether the time selected is not illegeal","WHF":"is illegal","BJ":"Edit","ZX":"Execute","FZ":"Copy","RWKSZX":"Job Start To Run","SC":"Delete","SCRW":"Delete Job","SFSC":"Whether confirm to delete job?","SCRWCG":"Success to delete job","DSZT":"Pause Corn","ZTCG":"Success to pause corn","DSQD":"Start Corn","DSCG":"Success to start corn","ZTDS":"Pause Corn","QDDS":"Start Corn","LSSJCP":"Run History","KSSJBNWK":"Start time cannot be empty","JSSJBNWK":"End time cannot be empty","SJBNWK":"Time cannot be empty","JGCDBNWK":"Interval length cannot be empty","XZZQDKSSJ":"Please select the right start time","XZZQDJSSJ":"Please select the right end time","PDKSHJS":"Judge if the start and end time is illegal","QXZHFSJD":"Please the illegal time slot","QRCP":"Whether confirm to run history of {name} job ?","CPCG":"Success to run history","TXZQBD":"Please enter the right form item","XMTJCG":"Success to add project","JGCDDY30":"The interval length cannot be greater than 30 days","JGCDDY24":"The interval length cannot be greater than 24 hours","JGCDDY60":"The interval length cannot be greater than 60 minutes","XJ":"Add","SRXMMCSS":"Enter the project name search"},"task":{"ZYID":"Task ID","QSR":"Please enter","RWZT":"Task state","XZRWZT":"Please select task state","KSSJ":"Start Time","JSSJ":"End Time","CX":"Query","ZWSJ":"No Data","ZXJD":"Execution Node","RWMC":"Job Name","CFLX":"Trigger Type","CFSJ":"Trigger Time","CFZT":"Trigger Status","ZXYH":"Created User","ZT":"State","WCSJ":"Finish Time","CS":"Parameters","CZ":"Operation","RWYXRZ":"Task Run Log","SYY":"Previous Page","XYY":"Next Page","CKZXRZ":"Latest Log","ZZRW":"Kill Task","SFZZRW":"Whether confirm to kill task?","RWYZZ":"Task has been killed","SCRZ":"Delete Log","SFSCRZ":"Whether confirm to delete log","SCRZCG":"Success to delete log","XXRZ":"Detail Log","SC":"Delete","RW":"Task","ZXCG":"Execute Success","ZXSB":"Execute Fail, Please view related logs","WFHQRZ":"Cannot acquire the log file"},"sys":{"Performusermanagement":"Perform user management","Theusername":"The user name","Thenewperformuser":"The new perform user","Pleasefillinusername":"Please fill in user name","describe":"describe","Pleasefillintheusername":"Please fill in the user name","Musthavealetter":"Must have a letter","Andonlysupportletter":"And only support letter","digital":"digital","Theunderline":"The underline","Callstoaddaninterface":"Calls to add an interface","Addausersuccessfully":"Add a user successfully","Deleteperformuser":"Delete perform user","Whetheryouwanttodelete":"Whether you want to delete","Deletetheusersuccessfully":"Delete the user successfully","Thedefaultnode":"The default node","Thelabel":"The label","Bindingthenodelabel":"Binding the node label","Pleaseselectalabel":"Please select a label","Themanagementnode":"The management node","Nodeauthorizationpage":"Node authorization page","delete":"delete","Removenodes":"Remove nodes","Whetherornottodelete":"Whether or not to delete","Deletethesuccess":"Delete the success","Bindingtothecurrentnode":"Binding to the current node","Updatethelist":"Update the list","Initialpassword":"Initial password","Pleaseenterthepassword":"Please enter the password","Confirmpasswordagain":"Confirm password again","Pleaseenterthepasswordagain":"Please enter the password again","Passwordisnotcorrect":"Password is not correct","Pleaseinputvalidationagain":"Please input validation again","Namecannotbemorethanlength":"Name cannot be more than length","Pleaseentertheinitialpassword":"Please enter the initial password","Passwordlengthcantmorethan":"Password length can\'t more than","Editbutton":"Edit button","Bindingauthorization":"Binding authorization","Toresetyourpassword":"To reset your password","Passwordresetsuccessfully":"Password reset successfully","Deleteoperation":"Delete operation","Emptythenewlyaddeddata":"Empty the newly added data","Torequestthedatalist":"To request the data list","Nodemanagement":"Node management","state":"state","normal":"normal","Hasbeenrolledofftheproductionline":"Has been rolled off the production line","Thenodeaddress":"The node address","Theheartbeatoftime":"The heartbeat of time","Memoryusage":"Memory usage","usage":"usage","Performausername":"Perform a user name","Pleaseenteryourusername":"Please enter your user name","Pleaseenterthe":"Please enter the","add":"add","return":"return","Temporarilynodata":"Temporarily no data","Associatedwiththeusertypes":"Associated with the user types","Associatedstates":"Associated states","Therecentmodificationtime":"The recent modification time","operation":"operation","Bindtheuser":"Bind the user","Selecttheuser":"Select the user","Bindingtype":"Binding type","Pleaseselectabindingtype":"Please select a binding type","Hasbeenassociateduser":"Has been associated user","Donotdelete":"Do not delete","Confirmtodeletetheuserexecution":"Confirm to delete the user execution","associated":"associated","confirm":"confirm","Executionofuser":"Execution of user","Canceltheassociated":"Cancel the associated","Canceltheexecutionoftheuser":"Cancel the execution of the user","Notassociated":"Not associated","Hasbeenassociated":"Has been associated","Connectionfailure":"Connection failure","Thebinding":"The binding","bindings":"bindings","Callstoadduserinterface":"Calls to add user interface","Usermanagement":"User management","Performuserandexecutionnodebindingauthority":"Perform user and execution node binding authority","Theexecutionnode":"The execution node","Addanode":"Add a node","Address:":"Address:","Status:":"Status:","offline":"offline","Memory:":"Memory:","Performuser":"Perform user","Adduser":"Add user","Name:":"Name:","Bindingnodes":"Binding nodes","Selectthenode":"Select the node","Gettheexecutionnodecanchoose":"Get the execution node can choose","Afterthecalltoaddinterface":"After the call to add interface","Pullthedataagain":"Pull the data again","Boundnodesuccess":"Bound node success","Bindingusersuccessfully":"Binding user successfully","Confirmtodeletetheexecutionnode":"Confirm to delete the execution node","Deletenodesuccess":"Delete node success","Deleteuser":"Delete user","executor":{"DZ":"Address","QSR":"Please enter","CX":"Query","ZWSJ":"No Data","XTSJ":"Heartbeat Time","ZT":"Status","NCSYL":"Memory Usage","SYL":"CPU Usage","CZ":"Opeartion","WH":"Repair","XX":"Down","SX":"Up","JD":"Node","SFCG":"Whether confirm to {action} node?","JDCG":"node success","ZC":"Normal","YXX":"Offline"},"owner":{"SZYSZ":"Data Source Owner Name:","QSR":"Please enter","CX":"Query","XZSJYSZ":"Add Data Source Owner","MYSZSJ":"No Owner Data","MC":"Name","MS":"Desc","CJYH":"Created User","CJSJ":"Created Time","XGYH":"Modified User","XGSJ":"Modified Time","CZ":"Operation","XZMC":"Owner Name","SRSJSZ":"Please enter Data Source Owner","TJ":"Submit","XGSJSZ":"Alter Data Source Owner","SZMCBNK":"Data Source Owner Name cannot be empty","BJ":"Edit","BJAN":"Edit Button","SC":"Delete","SCCZ":"Delete Operation","SCSJYSZ":"Delete Data Source Owner","SFSCSJYSZ":"Whether confirm to delete Data Source Owner?","SCCG":"Success to delete Data Source Owner","XGCG":"Success to modify Data Source Owner","TJSJYCG":"Success toa add Data Source Owner"},"user":{"YHM":"Username","QSR":"Please enter","CX":"Query","XZYH":"Add User","ZSWSJ":"No Data","YHLX":"User Type","CJSJ":"Created Time","XGSJ":"Modified Time","CZ":"Operation","SZMC":"Owner Name","SRYHM":"Please enter username","PTYH":"Ordinary User","GLYH":"Manage User","CJYH":"Super User","TJ":"Submit","XGYHXX":"Modify User Info","YHXXBNWK":"Username cannot be empty","BJ":"Edit","SC":"Delete","SCYH":"Delete User","SFSCYH":"Whether confirm to delete user","SCCG":"Success to delete user","XGCG":"Success to modify user","TJYHCG":"Success to add user"}},"group":{"SCYXX":"Delete Selected","SRDZGSS":"Please enter goup No. to search","SRFZMSS":"Please enter group name to search","CX":"Query","TJFZ":"Add Group","ZWSJ":"No Data","FZBH":"Group No.","FZM":"Group Name","MS":"Desc","CJR":"Created User","BDXM":"Bind Project","CJSJ":"Created Time","GXSJ":"Updated Time","XQ":"Detail","SCFZ":"Delete Group","QX":"Cancel","QRSCFZ":"Whether confirm to delete group","CKXQ":"View Detail","XZYSCDFZ":"Please select the group to delete","FZSCCG":"Success tot delete group","FZXQ":"Group Detail","FH":"Back","JCXX":"Basic Info","FZMBNK":"Group name cannot be empty","ZCZZM":"Only support letters, numbers, underline and Chinese!","QSR":"Please enter","FZMS":"Group Desc","FZCY":"Group Members","SRYHMSS":"Please enter username to serach","TICY":"Add Memeber","YH":"User ID","YHM":"Username","XZYH":"Select User","SRWB":"Please enter text","QRSCYH":"Whether confirm to delete user","SFYXG":"Whether is been modified","BCXG":"Save Changes","BCTS":"Save Tip","FZXXTXSFBC":"Whether confirm to save the changes in group?","XGFZNRWBC":"Changes not saved!","TJZCY":"Please add group member","FZNBKCF":"Group name cannot have the same","FZXG":"Success to modify group{name}","CJCG":"Success to create group{name}","TXZQBD":"Please enter the right form item","FYZS":"Calculate the summary of pages","XZYSCDYH":"Please select the user to delete","SCCG":"Success to delete group member","FZCYSCSB":"Fail to delete group member","XZYHS":"Please select user"},"uiTemplate":{"SJY":"Data Source","SYMC":"Index Name","XZSYMC":"Please select the index name","SYLX":"Index Type","XZSYLX":"Please select the index type","PLDX":"Batch Size","SRPLDX":"Please enter the batch size","HZCLQ":"Post Processor","LJ":"Path","SRLJ":"Please enter the path","YSLX":"Compress Type","XZYSLX":"Please select the compress type","BM":"Encoding","QXZBM":"Please select the encoding","CSGS":"Transport Type","QXZCSFS":"Please select the transport type","EJZ":"Binary","JL":"Record","WJLX":"File Type","XZWJLX":"Please select the file type","ZDFGF":"Field Separator","WJMQZ":"File Name Prefix","QSRWJMQZ":"Please enter the filename prefix","K":"Database","B":"Table","FQXIN":"Partition Info","FQZD":"Partition Field","ZDYFQM":"Custom partition name","MYSJ":"No Data","SJYMC":"Data Source Name","SRSJYMC":"Please enter the Data Source Name","SJYMS":"Data Source Desc","TXXQMS":"Please enter the Data Source description","SJYSZ":"Data Source Onwer","LJMB":"Connection Model","WJ":"keytab File","MYWJ":"Private-key File","YHM":"Username","GSXR":"Format such as:_NAME","MA":"Password","LJCS":"Connect Test","SUBMIT":"Submit","GX":"Update","SJYMCBNK":"Data Souce name cannot be empty","MCCDBNDY":"Name length cannot be greater than 100","ZZCZM":"Only support letters, numbers, Chinese and specific characters: (_.:)","MSCDBNDY":"Desc length cannot be greater than 100","SJYSZBNWK":"Data Source Owner cannot be null","QXZ":"Please select","RZSTBNWK":"Auth Entity cannot be empty","YHMCDBNDY":"Username length cannot be greater than 1000","YHMBNWK":"Username cannot be empty","MABNWK":"Password cannot be empty","YHMABNDY":"Password cannot be greater than 30","LJMBBNWK":"Connection Model cannot be empty","QTXZQBDX":"Please enter the right form item!","RZST":"Auth Entity","KM":"Database","TABLENAMW":"Table","BBNWK":"Table cannot be empty","LJTJ":"Link conditions","TJ":"Where condition","QSR":"Please enter the where condition","SCJG":"Delete Warn","SFSCCBZHDSYBJLJPZ":"Whether confirm to remove this table?","XRFS":"Write Mode","QSRPLDXZ":"Please enter the batch size","QR":"Confirm","YWC":"Done","JXZ":"In Progress","DJX":"Pend","BINLOGHOST":"BINLOG Address cannot be empty","BJXR":"Write Mode","SX":"Refrech","CJMB":"Create Template?","BDXM":"Bin Project","DWQX":"Foreign Authority","KD":"Read","KBJ":"Write","KSY":"Execute","SJDQ":"Data Read","SJXR":"Data Write","TGSH":"Spik header"},"components":{"TYSJJHPTWNFW":"Exchangies welcome you","ZW":"Chinese","TCCG":"Success to exit","DCXTSB":"Fail to logout system!","BCLL":"Save Browse","RWMC":"Job Name","QSRRWMC":"Please enter job name","TXR":"Alarm Users","QSRTXR":"Please enter the alarm users","DS":"Corn","BDS":"corn expression","RWMS":"Job Desc","SRRWMS":"Please enter the job description","ZXYH":"Executive User:","XZZXYH":"Please select the executive user","ZXJD":"Execution Node:","XZZXJD":"Please select the execution node","DH":"No.","QSR":"Please enter","CSSJ":"Timeout","SRCSSJ":"Please enter the timeout, unit is second","TBFS":"Sync Method","QL":"FULL","ZL":"INCREMENT","SYB":"Previous Step","BC":"Save","TXRWM":"Please enter the job name","XZZXDH":"Please select the execution","QTX":"Please enter","DXBNCG":"Cannot be greater than 5 digits","ZZCSZ":"Only support numbers","DYCLQ":"Define Processor","XYB":"Next Step","DZCLQ":"Content of processor cannot be empty","SDKZ":"Speed Limit","ZYSLXZ":"Task Byte Speed Limit","ZYJLXZ":"Task Record Speed Limit","T":"strip","CWJLCG":"Error Recod Over","RWSB":"task fail","GJ":"Adavance","ZYZDBXS":"Task Max Parallel Num","G":"","ZYZDNC":"Task Max Memory Size","SYT":"Previous","NCBCG":"Max memeory size cannot be greater than","ZYZDBXSBCG":"Max parallel number cannot be greater than","ZYSLBCG":"Max task byte speed cannot be greater than","SRZQZYSL":"Please enter the right task byte speed","ZQSRZYJLSXZ":"Please enter the right task record speed","QSRZQCWJLS":"Please enter the right error record limit","SRZQQZYZDBXS":"Please enter the right max parallel number","SRZQZYZDNC":"Please enter the right max memory size","XZSJY":"Select Data Source","SJYLX":"Data Source Type","LLSJ":"View Data","LJTJPZ":"Connection Adjustment Configuration","QX":"Cancel","QBZDXX":"Column information in previous table ","LJTJ":"Link Condition","DQBZDXX":"Column information in current table","GNZWKF":"Function is not open yet, please wait","QXTXWZLJXX":"Please complete the connected column information","QTXQBZDXX":"Please enter the connected column information in previous table before","QTXDQBZDXX":"Please enter the connected collumn informtion in current table before","ZDYS":"Column Mappings","YZD":"Source Column","LX":"Type","MBZD":"Dest Column","JYHS":"Check Function","ZHHS":"Transfer Function","CS":"Parameter","SZCS":"Set parameter","CS:":"Parameter:","QR":"Confirm","YZDBNWK":"Source column cannot be empty","CXTJ":"Query Condition","XZMD":"Select Destination","JBXX":"Basic Information","BSJJH":"Table Data Collection","RWBCCG":"Success to save job","RWXGSC":"Success to modify job","TBYXXSJ":"Sync Meta Data","XZXM":"Add Project","XMMC":"Project Name","SRXMMC":"Please enter project name","MS":"Desc","TJ":"Submit","ZJZJD":"Add Child Node","SCJD":"Delete Node","SC":"Delete","SFSC":"Whether confirm to delete the project node?","SCCG":"Success to delete","TJCG":"Success to add","TBYXX":"Sync Meta Data"},"mixin":{"FGFBCC":"Don\'t support separator like: \\\\","QZQTX":"Please enter the right unicode","PLDXBCG":"Batch size cannot be greater than 100000","SJYBNK":"Data Source cnnot be empty","BBK":"Cannot be empty","LJBKBJKG":"Path cannot contain white sapce","BMLXZC":"Only support :ISO-8859-1、GB2312、GBK、UTF-8、UTF-16","CZBNRSZW":"Cannot enter Chinese","QXZWJLX":"Please select the file type","SJKBNNQJ":"Database cannot be empty","BBNWK":"Table cannot be empty","SYMCBNWK":"Index name cannot be empty","BXYZMKR":"Must start with a letter,and only support letters, numbers, (_.-#${})","STLXBNWK":"Index type cannot be empty","DRFSBNWK":"Write mode cannot be empty","XZSJYLX":"Please select the Data Source type","XZSJY":"Please select the Data Source","XZK":"Please select database","QXZB":"Please select table"},"navBar":{"dataManager":"Data Source Management","dataSource":"Data Source","templaceManagert":"Model Management","taskConfig":"Job Configuration","tasking":"Job Tasks","group":"Group Management","help":"Help Doc","sysManagert":"System Management","owner":"Data Source Owner","execotor":"Execution Node","user":"User Management","executeUser":"executed user"}}')},b79c:function(e,t,a){"use strict";a("4fa7")},b80f:function(e,t,a){},b8a3:function(e,t,a){},bac2:function(e,t,a){},bd85:function(e,t,a){"use strict";a("81ee")},c4b5:function(e,t,a){},c4ed:function(e,t,a){"use strict";a("7426")},c86c:function(e,t,a){"use strict";a("6f5a8")},c95e:function(e,t,a){"use strict";a("7682")},cb80:function(e,t,a){},cca7:function(e,t,a){},cd9c:function(e,t,a){"use strict";a("bac2")},d674:function(e,t,a){},d7a2:function(e,t,a){"use strict";a("c4b5")},e072:function(e,t,a){"use strict";a("824e")},e769:function(e,t,a){"use strict";a("62d2")},f4fa:function(e,t,a){},f902:function(e,t,a){"use strict";a("118a")},fc79:function(e,t,a){},fd48:function(e,t,a){}},[[0,"runtime~app","chunk-vendors"]]]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d0a3577.c4a7a7d4.js b/modules/gateway/src/main/resources/static/js/chunk-2d0a3577.c4a7a7d4.js deleted file mode 100644 index 3043cc5ec..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d0a3577.c4a7a7d4.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d0a3577"],{"0287":function(e,t,n){"use strict";n.r(t),n.d(t,"conf",(function(){return r})),n.d(t,"language",(function(){return a}));var r={comments:{lineComment:";;"},brackets:[["(",")"],["[","]"],["{","}"]],autoClosingPairs:[{open:"(",close:")"},{open:"[",close:"]"},{open:"{",close:"}"},{open:'"',close:'"'}],surroundingPairs:[{open:"(",close:")"},{open:"[",close:"]"},{open:"{",close:"}"},{open:'"',close:'"'}]},a={defaultToken:"",ignoreCase:!0,tokenPostfix:".clj",brackets:[{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"}],specialForms:[".","catch","def","do","if","monitor-enter","monitor-exit","new","quote","recur","set!","throw","try","var"],coreSymbols:["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","StackTraceElement->vec","Throwable->map","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc","assoc!","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","cast","cat","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj","conj!","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj","disj!","dissoc","dissoc!","distinct","distinct?","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","indexed?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","munge","name","namespace","namespace-munge","nat-int?","neg-int?","neg?","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop","pop!","pop-thread-bindings","pos-int?","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seqable?","seque","sequence","sequential?","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","swap-vals!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","uri?","use","uuid?","val","vals","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"],constants:["true","false","nil"],symbolCharacter:/[!#'*+\-.\/:<=>?_\w\xa1-\uffff]/,numbers:/[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?/,characters:/\\(?:backspace|formfeed|newline|return|space|tab|x[0-9A-Fa-f]{4}|u[0-9A-Fa-f]{4}|o[0-7]{3}|@symbolCharacter|[\\"()\[\]{}])/,tokenizer:{root:[{include:"@whitespace"},[/@numbers/,"number"],[/@characters/,"string"],{include:"@string"},[/[()\[\]{}]/,"@brackets"],[/\/#"(?:\.|(?:")|[^"\n])*"\/g/,"regexp"],[/[#'@^`~]/,"meta"],[/:@symbolCharacter+/,"constant"],[/@symbolCharacter+/,{cases:{"@specialForms":"keyword","@coreSymbols":"keyword","@constants":"constant","@default":"identifier"}}]],whitespace:[[/\s+/,"white"],[/;.*$/,"comment"],[/\(comment/,"comment","@comment"]],comment:[[/\(/,"comment","@push"],[/\)/,"comment","@pop"],[/[^)]/,"comment"]],string:[[/"/,"string","@multiLineString"]],multiLineString:[[/[^\\"]+/,"string"],[/@characters/,"string"],[/"/,"string","@pop"]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d0a43df.a972dbd2.js b/modules/gateway/src/main/resources/static/js/chunk-2d0a43df.a972dbd2.js deleted file mode 100644 index 5b75bbd6f..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d0a43df.a972dbd2.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d0a43df"],{"0636":function(e,t,n){"use strict";n.r(t),n.d(t,"conf",(function(){return o})),n.d(t,"language",(function(){return s}));var o={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:))")}}},s={defaultToken:"",tokenPostfix:".java",keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/0[xX](@hexdigits)[Ll]?/,"number.hex"],[/0(@octaldigits)[Ll]?/,"number.octal"],[/0[bB](@binarydigits)[Ll]?/,"number.binary"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@javadoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],javadoc:[[/[^\/*]+/,"comment.doc"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d0aab07.dd71e44d.js b/modules/gateway/src/main/resources/static/js/chunk-2d0aab07.dd71e44d.js deleted file mode 100644 index 76ec542a6..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d0aab07.dd71e44d.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d0aab07"],{"11a2":function(e,n,t){"use strict";t.r(n),t.d(n,"conf",(function(){return r})),t.d(n,"language",(function(){return o}));var r={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{offSide:!0}},o={tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|.*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+$/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|][0-9]*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,"number"],[/@numberFloat(?=[ \t]*[,\]\}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]\}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]\}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]\}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]\}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]\}])/,"number.date"]],tagHandle:[[/\![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d0abc00.17532746.js b/modules/gateway/src/main/resources/static/js/chunk-2d0abc00.17532746.js deleted file mode 100644 index 6e6ac8764..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d0abc00.17532746.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d0abc00"],{1737:function(e,t,o){"use strict";o.r(t),o.d(t,"conf",(function(){return i})),o.d(t,"language",(function(){return m}));var r="undefined"===typeof monaco?self.monaco:monaco,n=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],i={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["\x3c!--","--\x3e"]},brackets:[["\x3c!--","--\x3e"],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp("<(?!(?:"+n.join("|")+"))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$","i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:r.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp("<(?!(?:"+n.join("|")+"))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$","i"),action:{indentAction:r.languages.IndentAction.Indent}}]},m={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/@@/],[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.root"}],[/)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],razorInSimpleState:[[/@\*/,"comment.cs","@razorBlockCommentTopLevel"],[/@[{(]/,"metatag.cs","@razorRootTopLevel"],[/(@)(\s*[\w]+)/,["metatag.cs",{token:"identifier.cs",switchTo:"@$S2.$S3"}]],[/[})]/,{token:"metatag.cs",switchTo:"@$S2.$S3"}],[/\*@/,{token:"comment.cs",switchTo:"@$S2.$S3"}]],razorInEmbeddedState:[[/@\*/,"comment.cs","@razorBlockCommentTopLevel"],[/@[{(]/,"metatag.cs","@razorRootTopLevel"],[/(@)(\s*[\w]+)/,["metatag.cs",{token:"identifier.cs",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}]],[/[})]/,{token:"metatag.cs",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],[/\*@/,{token:"comment.cs",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}]],razorBlockCommentTopLevel:[[/\*@/,"@rematch","@pop"],[/[^*]+/,"comment.cs"],[/./,"comment.cs"]],razorBlockComment:[[/\*@/,"comment.cs","@pop"],[/[^*]+/,"comment.cs"],[/./,"comment.cs"]],razorRootTopLevel:[[/\{/,"delimiter.bracket.cs","@razorRoot"],[/\(/,"delimiter.parenthesis.cs","@razorRoot"],[/[})]/,"@rematch","@pop"],{include:"razorCommon"}],razorRoot:[[/\{/,"delimiter.bracket.cs","@razorRoot"],[/\(/,"delimiter.parenthesis.cs","@razorRoot"],[/\}/,"delimiter.bracket.cs","@pop"],[/\)/,"delimiter.parenthesis.cs","@pop"],{include:"razorCommon"}],razorCommon:[[/[a-zA-Z_]\w*/,{cases:{"@razorKeywords":{token:"keyword.cs"},"@default":"identifier.cs"}}],[/[\[\]]/,"delimiter.array.cs"],[/[ \t\r\n]+/],[/\/\/.*$/,"comment.cs"],[/@\*/,"comment.cs","@razorBlockComment"],[/"([^"]*)"/,"string.cs"],[/'([^']*)'/,"string.cs"],[/(<)(\w+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(\w+)(>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<\/)(\w+)(>)/,["delimiter.html","tag.html","delimiter.html"]],[/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,]/,"delimiter.cs"],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float.cs"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float.cs"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/,"number.hex.cs"],[/0[0-7']*[0-7]/,"number.octal.cs"],[/0[bB][0-1']*[0-1]/,"number.binary.cs"],[/\d[\d']*/,"number.cs"],[/\d/,"number.cs"]]},razorKeywords:["abstract","as","async","await","base","bool","break","by","byte","case","catch","char","checked","class","const","continue","decimal","default","delegate","do","double","descending","explicit","event","extern","else","enum","false","finally","fixed","float","for","foreach","from","goto","group","if","implicit","in","int","interface","internal","into","is","lock","long","nameof","new","null","namespace","object","operator","out","override","orderby","params","private","protected","public","readonly","ref","return","switch","struct","sbyte","sealed","short","sizeof","stackalloc","static","string","select","this","throw","true","try","typeof","uint","ulong","unchecked","unsafe","ushort","using","var","virtual","volatile","void","when","while","where","yield","model","inject"],escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d0ae937.4c227896.js b/modules/gateway/src/main/resources/static/js/chunk-2d0ae937.4c227896.js deleted file mode 100644 index d75caee14..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d0ae937.4c227896.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d0ae937"],{"0b3b":function(E,T,R){"use strict";R.r(T),R.d(T,"conf",(function(){return A})),R.d(T,"language",(function(){return I}));var A={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},I={defaultToken:"",tokenPostfix:".sql",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["ABORT_AFTER_WAIT","ABSENT","ABSOLUTE","ACCENT_SENSITIVITY","ACTION","ACTIVATION","ACTIVE","ADD","ADDRESS","ADMIN","AES","AES_128","AES_192","AES_256","AFFINITY","AFTER","AGGREGATE","ALGORITHM","ALL_CONSTRAINTS","ALL_ERRORMSGS","ALL_INDEXES","ALL_LEVELS","ALL_SPARSE_COLUMNS","ALLOW_CONNECTIONS","ALLOW_MULTIPLE_EVENT_LOSS","ALLOW_PAGE_LOCKS","ALLOW_ROW_LOCKS","ALLOW_SINGLE_EVENT_LOSS","ALLOW_SNAPSHOT_ISOLATION","ALLOWED","ALTER","ANONYMOUS","ANSI_DEFAULTS","ANSI_NULL_DEFAULT","ANSI_NULL_DFLT_OFF","ANSI_NULL_DFLT_ON","ANSI_NULLS","ANSI_PADDING","ANSI_WARNINGS","APPEND","APPLICATION","APPLICATION_LOG","ARITHABORT","ARITHIGNORE","AS","ASC","ASSEMBLY","ASYMMETRIC","ASYNCHRONOUS_COMMIT","AT","ATOMIC","ATTACH","ATTACH_REBUILD_LOG","AUDIT","AUDIT_GUID","AUTHENTICATION","AUTHORIZATION","AUTO","AUTO_CLEANUP","AUTO_CLOSE","AUTO_CREATE_STATISTICS","AUTO_SHRINK","AUTO_UPDATE_STATISTICS","AUTO_UPDATE_STATISTICS_ASYNC","AUTOMATED_BACKUP_PREFERENCE","AUTOMATIC","AVAILABILITY","AVAILABILITY_MODE","BACKUP","BACKUP_PRIORITY","BASE64","BATCHSIZE","BEGIN","BEGIN_DIALOG","BIGINT","BINARY","BINDING","BIT","BLOCKERS","BLOCKSIZE","BOUNDING_BOX","BREAK","BROKER","BROKER_INSTANCE","BROWSE","BUCKET_COUNT","BUFFER","BUFFERCOUNT","BULK","BULK_LOGGED","BY","CACHE","CALL","CALLED","CALLER","CAP_CPU_PERCENT","CASCADE","CASE","CATALOG","CATCH","CELLS_PER_OBJECT","CERTIFICATE","CHANGE_RETENTION","CHANGE_TRACKING","CHANGES","CHAR","CHARACTER","CHECK","CHECK_CONSTRAINTS","CHECK_EXPIRATION","CHECK_POLICY","CHECKALLOC","CHECKCATALOG","CHECKCONSTRAINTS","CHECKDB","CHECKFILEGROUP","CHECKIDENT","CHECKPOINT","CHECKTABLE","CLASSIFIER_FUNCTION","CLEANTABLE","CLEANUP","CLEAR","CLOSE","CLUSTER","CLUSTERED","CODEPAGE","COLLATE","COLLECTION","COLUMN","COLUMN_SET","COLUMNS","COLUMNSTORE","COLUMNSTORE_ARCHIVE","COMMIT","COMMITTED","COMPATIBILITY_LEVEL","COMPRESSION","COMPUTE","CONCAT","CONCAT_NULL_YIELDS_NULL","CONFIGURATION","CONNECT","CONSTRAINT","CONTAINMENT","CONTENT","CONTEXT","CONTINUE","CONTINUE_AFTER_ERROR","CONTRACT","CONTRACT_NAME","CONTROL","CONVERSATION","COOKIE","COPY_ONLY","COUNTER","CPU","CREATE","CREATE_NEW","CREATION_DISPOSITION","CREDENTIAL","CRYPTOGRAPHIC","CUBE","CURRENT","CURRENT_DATE","CURSOR","CURSOR_CLOSE_ON_COMMIT","CURSOR_DEFAULT","CYCLE","DATA","DATA_COMPRESSION","DATA_PURITY","DATABASE","DATABASE_DEFAULT","DATABASE_MIRRORING","DATABASE_SNAPSHOT","DATAFILETYPE","DATE","DATE_CORRELATION_OPTIMIZATION","DATEFIRST","DATEFORMAT","DATETIME","DATETIME2","DATETIMEOFFSET","DAY","DAYOFYEAR","DAYS","DB_CHAINING","DBCC","DBREINDEX","DDL_DATABASE_LEVEL_EVENTS","DEADLOCK_PRIORITY","DEALLOCATE","DEC","DECIMAL","DECLARE","DECRYPTION","DEFAULT","DEFAULT_DATABASE","DEFAULT_FULLTEXT_LANGUAGE","DEFAULT_LANGUAGE","DEFAULT_SCHEMA","DEFINITION","DELAY","DELAYED_DURABILITY","DELETE","DELETED","DENSITY_VECTOR","DENY","DEPENDENTS","DES","DESC","DESCRIPTION","DESX","DHCP","DIAGNOSTICS","DIALOG","DIFFERENTIAL","DIRECTORY_NAME","DISABLE","DISABLE_BROKER","DISABLED","DISK","DISTINCT","DISTRIBUTED","DOCUMENT","DOUBLE","DROP","DROP_EXISTING","DROPCLEANBUFFERS","DUMP","DURABILITY","DYNAMIC","EDITION","ELEMENTS","ELSE","EMERGENCY","EMPTY","EMPTYFILE","ENABLE","ENABLE_BROKER","ENABLED","ENCRYPTION","END","ENDPOINT","ENDPOINT_URL","ERRLVL","ERROR","ERROR_BROKER_CONVERSATIONS","ERRORFILE","ESCAPE","ESTIMATEONLY","EVENT","EVENT_RETENTION_MODE","EXEC","EXECUTABLE","EXECUTE","EXIT","EXPAND","EXPIREDATE","EXPIRY_DATE","EXPLICIT","EXTENDED_LOGICAL_CHECKS","EXTENSION","EXTERNAL","EXTERNAL_ACCESS","FAIL_OPERATION","FAILOVER","FAILOVER_MODE","FAILURE_CONDITION_LEVEL","FALSE","FAN_IN","FAST","FAST_FORWARD","FETCH","FIELDTERMINATOR","FILE","FILEGROUP","FILEGROWTH","FILELISTONLY","FILENAME","FILEPATH","FILESTREAM","FILESTREAM_ON","FILETABLE_COLLATE_FILENAME","FILETABLE_DIRECTORY","FILETABLE_FULLPATH_UNIQUE_CONSTRAINT_NAME","FILETABLE_NAMESPACE","FILETABLE_PRIMARY_KEY_CONSTRAINT_NAME","FILETABLE_STREAMID_UNIQUE_CONSTRAINT_NAME","FILLFACTOR","FILTERING","FIRE_TRIGGERS","FIRST","FIRSTROW","FLOAT","FMTONLY","FOLLOWING","FOR","FORCE","FORCE_FAILOVER_ALLOW_DATA_LOSS","FORCE_SERVICE_ALLOW_DATA_LOSS","FORCED","FORCEPLAN","FORCESCAN","FORCESEEK","FOREIGN","FORMATFILE","FORMSOF","FORWARD_ONLY","FREE","FREEPROCCACHE","FREESESSIONCACHE","FREESYSTEMCACHE","FROM","FULL","FULLSCAN","FULLTEXT","FUNCTION","GB","GEOGRAPHY_AUTO_GRID","GEOGRAPHY_GRID","GEOMETRY_AUTO_GRID","GEOMETRY_GRID","GET","GLOBAL","GO","GOTO","GOVERNOR","GRANT","GRIDS","GROUP","GROUP_MAX_REQUESTS","HADR","HASH","HASHED","HAVING","HEADERONLY","HEALTH_CHECK_TIMEOUT","HELP","HIERARCHYID","HIGH","HINT","HISTOGRAM","HOLDLOCK","HONOR_BROKER_PRIORITY","HOUR","HOURS","IDENTITY","IDENTITY_INSERT","IDENTITY_VALUE","IDENTITYCOL","IF","IGNORE_CONSTRAINTS","IGNORE_DUP_KEY","IGNORE_NONCLUSTERED_COLUMNSTORE_INDEX","IGNORE_TRIGGERS","IMAGE","IMMEDIATE","IMPERSONATE","IMPLICIT_TRANSACTIONS","IMPORTANCE","INCLUDE","INCREMENT","INCREMENTAL","INDEX","INDEXDEFRAG","INFINITE","INFLECTIONAL","INIT","INITIATOR","INPUT","INPUTBUFFER","INSENSITIVE","INSERT","INSERTED","INSTEAD","INT","INTEGER","INTO","IO","IP","ISABOUT","ISOLATION","JOB","KB","KEEP","KEEP_CDC","KEEP_NULLS","KEEP_REPLICATION","KEEPDEFAULTS","KEEPFIXED","KEEPIDENTITY","KEEPNULLS","KERBEROS","KEY","KEY_SOURCE","KEYS","KEYSET","KILL","KILOBYTES_PER_BATCH","LABELONLY","LANGUAGE","LAST","LASTROW","LEVEL","LEVEL_1","LEVEL_2","LEVEL_3","LEVEL_4","LIFETIME","LIMIT","LINENO","LIST","LISTENER","LISTENER_IP","LISTENER_PORT","LOAD","LOADHISTORY","LOB_COMPACTION","LOCAL","LOCAL_SERVICE_NAME","LOCK_ESCALATION","LOCK_TIMEOUT","LOGIN","LOGSPACE","LOOP","LOW","MANUAL","MARK","MARK_IN_USE_FOR_REMOVAL","MASTER","MAX_CPU_PERCENT","MAX_DISPATCH_LATENCY","MAX_DOP","MAX_DURATION","MAX_EVENT_SIZE","MAX_FILES","MAX_IOPS_PER_VOLUME","MAX_MEMORY","MAX_MEMORY_PERCENT","MAX_QUEUE_READERS","MAX_ROLLOVER_FILES","MAX_SIZE","MAXDOP","MAXERRORS","MAXLENGTH","MAXRECURSION","MAXSIZE","MAXTRANSFERSIZE","MAXVALUE","MB","MEDIADESCRIPTION","MEDIANAME","MEDIAPASSWORD","MEDIUM","MEMBER","MEMORY_OPTIMIZED","MEMORY_OPTIMIZED_DATA","MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT","MEMORY_PARTITION_MODE","MERGE","MESSAGE","MESSAGE_FORWARD_SIZE","MESSAGE_FORWARDING","MICROSECOND","MILLISECOND","MIN_CPU_PERCENT","MIN_IOPS_PER_VOLUME","MIN_MEMORY_PERCENT","MINUTE","MINUTES","MINVALUE","MIRROR","MIRROR_ADDRESS","MODIFY","MONEY","MONTH","MOVE","MULTI_USER","MUST_CHANGE","NAME","NANOSECOND","NATIONAL","NATIVE_COMPILATION","NCHAR","NEGOTIATE","NESTED_TRIGGERS","NEW_ACCOUNT","NEW_BROKER","NEW_PASSWORD","NEWNAME","NEXT","NO","NO_BROWSETABLE","NO_CHECKSUM","NO_COMPRESSION","NO_EVENT_LOSS","NO_INFOMSGS","NO_TRUNCATE","NO_WAIT","NOCHECK","NOCOUNT","NOEXEC","NOEXPAND","NOFORMAT","NOINDEX","NOINIT","NOLOCK","NON","NON_TRANSACTED_ACCESS","NONCLUSTERED","NONE","NORECOMPUTE","NORECOVERY","NORESEED","NORESET","NOREWIND","NORMAL","NOSKIP","NOTIFICATION","NOTRUNCATE","NOUNLOAD","NOWAIT","NTEXT","NTLM","NUMANODE","NUMERIC","NUMERIC_ROUNDABORT","NVARCHAR","OBJECT","OF","OFF","OFFLINE","OFFSET","OFFSETS","OLD_ACCOUNT","OLD_PASSWORD","ON","ON_FAILURE","ONLINE","ONLY","OPEN","OPEN_EXISTING","OPENTRAN","OPTIMISTIC","OPTIMIZE","OPTION","ORDER","OUT","OUTPUT","OUTPUTBUFFER","OVER","OVERRIDE","OWNER","OWNERSHIP","PAD_INDEX","PAGE","PAGE_VERIFY","PAGECOUNT","PAGLOCK","PARAMETERIZATION","PARSEONLY","PARTIAL","PARTITION","PARTITIONS","PARTNER","PASSWORD","PATH","PER_CPU","PER_NODE","PERCENT","PERMISSION_SET","PERSISTED","PHYSICAL_ONLY","PLAN","POISON_MESSAGE_HANDLING","POOL","POPULATION","PORT","PRECEDING","PRECISION","PRIMARY","PRIMARY_ROLE","PRINT","PRIOR","PRIORITY","PRIORITY_LEVEL","PRIVATE","PRIVILEGES","PROC","PROCCACHE","PROCEDURE","PROCEDURE_NAME","PROCESS","PROFILE","PROPERTY","PROPERTY_DESCRIPTION","PROPERTY_INT_ID","PROPERTY_SET_GUID","PROVIDER","PROVIDER_KEY_NAME","PUBLIC","PUT","QUARTER","QUERY","QUERY_GOVERNOR_COST_LIMIT","QUEUE","QUEUE_DELAY","QUOTED_IDENTIFIER","RAISERROR","RANGE","RAW","RC2","RC4","RC4_128","READ","READ_COMMITTED_SNAPSHOT","READ_ONLY","READ_ONLY_ROUTING_LIST","READ_ONLY_ROUTING_URL","READ_WRITE","READ_WRITE_FILEGROUPS","READCOMMITTED","READCOMMITTEDLOCK","READONLY","READPAST","READTEXT","READUNCOMMITTED","READWRITE","REAL","REBUILD","RECEIVE","RECOMPILE","RECONFIGURE","RECOVERY","RECURSIVE","RECURSIVE_TRIGGERS","REFERENCES","REGENERATE","RELATED_CONVERSATION","RELATED_CONVERSATION_GROUP","RELATIVE","REMOTE","REMOTE_PROC_TRANSACTIONS","REMOTE_SERVICE_NAME","REMOVE","REORGANIZE","REPAIR_ALLOW_DATA_LOSS","REPAIR_FAST","REPAIR_REBUILD","REPEATABLE","REPEATABLEREAD","REPLICA","REPLICATION","REQUEST_MAX_CPU_TIME_SEC","REQUEST_MAX_MEMORY_GRANT_PERCENT","REQUEST_MEMORY_GRANT_TIMEOUT_SEC","REQUIRED","RESAMPLE","RESEED","RESERVE_DISK_SPACE","RESET","RESOURCE","RESTART","RESTORE","RESTRICT","RESTRICTED_USER","RESULT","RESUME","RETAINDAYS","RETENTION","RETURN","RETURNS","REVERT","REVOKE","REWIND","REWINDONLY","ROBUST","ROLE","ROLLBACK","ROLLUP","ROOT","ROUTE","ROW","ROWCOUNT","ROWGUIDCOL","ROWLOCK","ROWS","ROWS_PER_BATCH","ROWTERMINATOR","ROWVERSION","RSA_1024","RSA_2048","RSA_512","RULE","SAFE","SAFETY","SAMPLE","SAVE","SCHEDULER","SCHEMA","SCHEMA_AND_DATA","SCHEMA_ONLY","SCHEMABINDING","SCHEME","SCROLL","SCROLL_LOCKS","SEARCH","SECOND","SECONDARY","SECONDARY_ONLY","SECONDARY_ROLE","SECONDS","SECRET","SECURITY_LOG","SECURITYAUDIT","SELECT","SELECTIVE","SELF","SEND","SENT","SEQUENCE","SERIALIZABLE","SERVER","SERVICE","SERVICE_BROKER","SERVICE_NAME","SESSION","SESSION_TIMEOUT","SET","SETS","SETUSER","SHOW_STATISTICS","SHOWCONTIG","SHOWPLAN","SHOWPLAN_ALL","SHOWPLAN_TEXT","SHOWPLAN_XML","SHRINKDATABASE","SHRINKFILE","SHUTDOWN","SID","SIGNATURE","SIMPLE","SINGLE_BLOB","SINGLE_CLOB","SINGLE_NCLOB","SINGLE_USER","SINGLETON","SIZE","SKIP","SMALLDATETIME","SMALLINT","SMALLMONEY","SNAPSHOT","SORT_IN_TEMPDB","SOURCE","SPARSE","SPATIAL","SPATIAL_WINDOW_MAX_CELLS","SPECIFICATION","SPLIT","SQL","SQL_VARIANT","SQLPERF","STANDBY","START","START_DATE","STARTED","STARTUP_STATE","STAT_HEADER","STATE","STATEMENT","STATIC","STATISTICAL_SEMANTICS","STATISTICS","STATISTICS_INCREMENTAL","STATISTICS_NORECOMPUTE","STATS","STATS_STREAM","STATUS","STATUSONLY","STOP","STOP_ON_ERROR","STOPAT","STOPATMARK","STOPBEFOREMARK","STOPLIST","STOPPED","SUBJECT","SUBSCRIPTION","SUPPORTED","SUSPEND","SWITCH","SYMMETRIC","SYNCHRONOUS_COMMIT","SYNONYM","SYSNAME","SYSTEM","TABLE","TABLERESULTS","TABLESAMPLE","TABLOCK","TABLOCKX","TAKE","TAPE","TARGET","TARGET_RECOVERY_TIME","TB","TCP","TEXT","TEXTIMAGE_ON","TEXTSIZE","THEN","THESAURUS","THROW","TIES","TIME","TIMEOUT","TIMER","TIMESTAMP","TINYINT","TO","TOP","TORN_PAGE_DETECTION","TRACEOFF","TRACEON","TRACESTATUS","TRACK_CAUSALITY","TRACK_COLUMNS_UPDATED","TRAN","TRANSACTION","TRANSFER","TRANSFORM_NOISE_WORDS","TRIGGER","TRIPLE_DES","TRIPLE_DES_3KEY","TRUE","TRUNCATE","TRUNCATEONLY","TRUSTWORTHY","TRY","TSQL","TWO_DIGIT_YEAR_CUTOFF","TYPE","TYPE_WARNING","UNBOUNDED","UNCHECKED","UNCOMMITTED","UNDEFINED","UNIQUE","UNIQUEIDENTIFIER","UNKNOWN","UNLIMITED","UNLOAD","UNSAFE","UPDATE","UPDATETEXT","UPDATEUSAGE","UPDLOCK","URL","USE","USED","USER","USEROPTIONS","USING","VALID_XML","VALIDATION","VALUE","VALUES","VARBINARY","VARCHAR","VARYING","VERIFYONLY","VERSION","VIEW","VIEW_METADATA","VIEWS","VISIBILITY","WAIT_AT_LOW_PRIORITY","WAITFOR","WEEK","WEIGHT","WELL_FORMED_XML","WHEN","WHERE","WHILE","WINDOWS","WITH","WITHIN","WITHOUT","WITNESS","WORK","WORKLOAD","WRITETEXT","XACT_ABORT","XLOCK","XMAX","XMIN","XML","XMLDATA","XMLNAMESPACES","XMLSCHEMA","XQUERY","XSINIL","YEAR","YMAX","YMIN"],operators:["ALL","AND","ANY","BETWEEN","EXISTS","IN","LIKE","NOT","OR","SOME","EXCEPT","INTERSECT","UNION","APPLY","CROSS","FULL","INNER","JOIN","LEFT","OUTER","RIGHT","CONTAINS","FREETEXT","IS","NULL","PIVOT","UNPIVOT","MATCHED"],builtinFunctions:["AVG","CHECKSUM_AGG","COUNT","COUNT_BIG","GROUPING","GROUPING_ID","MAX","MIN","SUM","STDEV","STDEVP","VAR","VARP","CUME_DIST","FIRST_VALUE","LAG","LAST_VALUE","LEAD","PERCENTILE_CONT","PERCENTILE_DISC","PERCENT_RANK","COLLATE","COLLATIONPROPERTY","TERTIARY_WEIGHTS","FEDERATION_FILTERING_VALUE","CAST","CONVERT","PARSE","TRY_CAST","TRY_CONVERT","TRY_PARSE","ASYMKEY_ID","ASYMKEYPROPERTY","CERTPROPERTY","CERT_ID","CRYPT_GEN_RANDOM","DECRYPTBYASYMKEY","DECRYPTBYCERT","DECRYPTBYKEY","DECRYPTBYKEYAUTOASYMKEY","DECRYPTBYKEYAUTOCERT","DECRYPTBYPASSPHRASE","ENCRYPTBYASYMKEY","ENCRYPTBYCERT","ENCRYPTBYKEY","ENCRYPTBYPASSPHRASE","HASHBYTES","IS_OBJECTSIGNED","KEY_GUID","KEY_ID","KEY_NAME","SIGNBYASYMKEY","SIGNBYCERT","SYMKEYPROPERTY","VERIFYSIGNEDBYCERT","VERIFYSIGNEDBYASYMKEY","CURSOR_STATUS","DATALENGTH","IDENT_CURRENT","IDENT_INCR","IDENT_SEED","IDENTITY","SQL_VARIANT_PROPERTY","CURRENT_TIMESTAMP","DATEADD","DATEDIFF","DATEFROMPARTS","DATENAME","DATEPART","DATETIME2FROMPARTS","DATETIMEFROMPARTS","DATETIMEOFFSETFROMPARTS","DAY","EOMONTH","GETDATE","GETUTCDATE","ISDATE","MONTH","SMALLDATETIMEFROMPARTS","SWITCHOFFSET","SYSDATETIME","SYSDATETIMEOFFSET","SYSUTCDATETIME","TIMEFROMPARTS","TODATETIMEOFFSET","YEAR","CHOOSE","COALESCE","IIF","NULLIF","ABS","ACOS","ASIN","ATAN","ATN2","CEILING","COS","COT","DEGREES","EXP","FLOOR","LOG","LOG10","PI","POWER","RADIANS","RAND","ROUND","SIGN","SIN","SQRT","SQUARE","TAN","APP_NAME","APPLOCK_MODE","APPLOCK_TEST","ASSEMBLYPROPERTY","COL_LENGTH","COL_NAME","COLUMNPROPERTY","DATABASE_PRINCIPAL_ID","DATABASEPROPERTYEX","DB_ID","DB_NAME","FILE_ID","FILE_IDEX","FILE_NAME","FILEGROUP_ID","FILEGROUP_NAME","FILEGROUPPROPERTY","FILEPROPERTY","FULLTEXTCATALOGPROPERTY","FULLTEXTSERVICEPROPERTY","INDEX_COL","INDEXKEY_PROPERTY","INDEXPROPERTY","OBJECT_DEFINITION","OBJECT_ID","OBJECT_NAME","OBJECT_SCHEMA_NAME","OBJECTPROPERTY","OBJECTPROPERTYEX","ORIGINAL_DB_NAME","PARSENAME","SCHEMA_ID","SCHEMA_NAME","SCOPE_IDENTITY","SERVERPROPERTY","STATS_DATE","TYPE_ID","TYPE_NAME","TYPEPROPERTY","DENSE_RANK","NTILE","RANK","ROW_NUMBER","PUBLISHINGSERVERNAME","OPENDATASOURCE","OPENQUERY","OPENROWSET","OPENXML","CERTENCODED","CERTPRIVATEKEY","CURRENT_USER","HAS_DBACCESS","HAS_PERMS_BY_NAME","IS_MEMBER","IS_ROLEMEMBER","IS_SRVROLEMEMBER","LOGINPROPERTY","ORIGINAL_LOGIN","PERMISSIONS","PWDENCRYPT","PWDCOMPARE","SESSION_USER","SESSIONPROPERTY","SUSER_ID","SUSER_NAME","SUSER_SID","SUSER_SNAME","SYSTEM_USER","USER","USER_ID","USER_NAME","ASCII","CHAR","CHARINDEX","CONCAT","DIFFERENCE","FORMAT","LEFT","LEN","LOWER","LTRIM","NCHAR","PATINDEX","QUOTENAME","REPLACE","REPLICATE","REVERSE","RIGHT","RTRIM","SOUNDEX","SPACE","STR","STUFF","SUBSTRING","UNICODE","UPPER","BINARY_CHECKSUM","CHECKSUM","CONNECTIONPROPERTY","CONTEXT_INFO","CURRENT_REQUEST_ID","ERROR_LINE","ERROR_NUMBER","ERROR_MESSAGE","ERROR_PROCEDURE","ERROR_SEVERITY","ERROR_STATE","FORMATMESSAGE","GETANSINULL","GET_FILESTREAM_TRANSACTION_CONTEXT","HOST_ID","HOST_NAME","ISNULL","ISNUMERIC","MIN_ACTIVE_ROWVERSION","NEWID","NEWSEQUENTIALID","ROWCOUNT_BIG","XACT_STATE","TEXTPTR","TEXTVALID","COLUMNS_UPDATED","EVENTDATA","TRIGGER_NESTLEVEL","UPDATE","CHANGETABLE","CHANGE_TRACKING_CONTEXT","CHANGE_TRACKING_CURRENT_VERSION","CHANGE_TRACKING_IS_COLUMN_IN_MASK","CHANGE_TRACKING_MIN_VALID_VERSION","CONTAINSTABLE","FREETEXTTABLE","SEMANTICKEYPHRASETABLE","SEMANTICSIMILARITYDETAILSTABLE","SEMANTICSIMILARITYTABLE","FILETABLEROOTPATH","GETFILENAMESPACEPATH","GETPATHLOCATOR","PATHNAME","GET_TRANSMISSION_STATUS"],builtinVariables:["@@DATEFIRST","@@DBTS","@@LANGID","@@LANGUAGE","@@LOCK_TIMEOUT","@@MAX_CONNECTIONS","@@MAX_PRECISION","@@NESTLEVEL","@@OPTIONS","@@REMSERVER","@@SERVERNAME","@@SERVICENAME","@@SPID","@@TEXTSIZE","@@VERSION","@@CURSOR_ROWS","@@FETCH_STATUS","@@DATEFIRST","@@PROCID","@@ERROR","@@IDENTITY","@@ROWCOUNT","@@TRANCOUNT","@@CONNECTIONS","@@CPU_BUSY","@@IDLE","@@IO_BUSY","@@PACKET_ERRORS","@@PACK_RECEIVED","@@PACK_SENT","@@TIMETICKS","@@TOTAL_ERRORS","@@TOTAL_READ","@@TOTAL_WRITE"],pseudoColumns:["$ACTION","$IDENTITY","$ROWGUID","$PARTITION"],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@pseudoColumns"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@keywords":"keyword","@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],pseudoColumns:[[/[$][A-Za-z_][\w@#$]*/,{cases:{"@pseudoColumns":"predefined","@default":"identifier"}}]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/\[/,{token:"identifier.quote",next:"@bracketedIdentifier"}],[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],bracketedIdentifier:[[/[^\]]+/,"identifier"],[/]]/,"identifier"],[/]/,{token:"identifier.quote",next:"@pop"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[[/BEGIN\s+(DISTRIBUTED\s+)?TRAN(SACTION)?\b/i,"keyword"],[/BEGIN\s+TRY\b/i,{token:"keyword.try"}],[/END\s+TRY\b/i,{token:"keyword.try"}],[/BEGIN\s+CATCH\b/i,{token:"keyword.catch"}],[/END\s+CATCH\b/i,{token:"keyword.catch"}],[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d0aeb45.b17c1f93.js b/modules/gateway/src/main/resources/static/js/chunk-2d0aeb45.b17c1f93.js deleted file mode 100644 index 7697faed3..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d0aeb45.b17c1f93.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d0aeb45"],{"0aca":function(x,e,i){"use strict";i.r(e),i.d(e,"conf",(function(){return d})),i.d(e,"language",(function(){return f}));var d={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"]],autoClosingPairs:[{open:'"',close:'"',notIn:["string","comment"]},{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]}]},f={defaultToken:"",tokenPostfix:".sol",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.angle",open:"<",close:">"}],keywords:["pragma","solidity","contract","library","using","struct","function","modifier","address","string","bool","Int","Uint","Byte","Fixed","Ufixed","int","int8","int16","int24","int32","int40","int48","int56","int64","int72","int80","int88","int96","int104","int112","int120","int128","int136","int144","int152","int160","int168","int176","int184","int192","int200","int208","int216","int224","int232","int240","int248","int256","uint","uint8","uint16","uint24","uint32","uint40","uint48","uint56","uint64","uint72","uint80","uint88","uint96","uint104","uint112","uint120","uint128","uint136","uint144","uint152","uint160","uint168","uint176","uint184","uint192","uint200","uint208","uint216","uint224","uint232","uint240","uint248","uint256","byte","bytes","bytes1","bytes2","bytes3","bytes4","bytes5","bytes6","bytes7","bytes8","bytes9","bytes10","bytes11","bytes12","bytes13","bytes14","bytes15","bytes16","bytes17","bytes18","bytes19","bytes20","bytes21","bytes22","bytes23","bytes24","bytes25","bytes26","bytes27","bytes28","bytes29","bytes30","bytes31","bytes32","fixed","fixed0x8","fixed0x16","fixed0x24","fixed0x32","fixed0x40","fixed0x48","fixed0x56","fixed0x64","fixed0x72","fixed0x80","fixed0x88","fixed0x96","fixed0x104","fixed0x112","fixed0x120","fixed0x128","fixed0x136","fixed0x144","fixed0x152","fixed0x160","fixed0x168","fixed0x176","fixed0x184","fixed0x192","fixed0x200","fixed0x208","fixed0x216","fixed0x224","fixed0x232","fixed0x240","fixed0x248","fixed0x256","fixed8x8","fixed8x16","fixed8x24","fixed8x32","fixed8x40","fixed8x48","fixed8x56","fixed8x64","fixed8x72","fixed8x80","fixed8x88","fixed8x96","fixed8x104","fixed8x112","fixed8x120","fixed8x128","fixed8x136","fixed8x144","fixed8x152","fixed8x160","fixed8x168","fixed8x176","fixed8x184","fixed8x192","fixed8x200","fixed8x208","fixed8x216","fixed8x224","fixed8x232","fixed8x240","fixed8x248","fixed16x8","fixed16x16","fixed16x24","fixed16x32","fixed16x40","fixed16x48","fixed16x56","fixed16x64","fixed16x72","fixed16x80","fixed16x88","fixed16x96","fixed16x104","fixed16x112","fixed16x120","fixed16x128","fixed16x136","fixed16x144","fixed16x152","fixed16x160","fixed16x168","fixed16x176","fixed16x184","fixed16x192","fixed16x200","fixed16x208","fixed16x216","fixed16x224","fixed16x232","fixed16x240","fixed24x8","fixed24x16","fixed24x24","fixed24x32","fixed24x40","fixed24x48","fixed24x56","fixed24x64","fixed24x72","fixed24x80","fixed24x88","fixed24x96","fixed24x104","fixed24x112","fixed24x120","fixed24x128","fixed24x136","fixed24x144","fixed24x152","fixed24x160","fixed24x168","fixed24x176","fixed24x184","fixed24x192","fixed24x200","fixed24x208","fixed24x216","fixed24x224","fixed24x232","fixed32x8","fixed32x16","fixed32x24","fixed32x32","fixed32x40","fixed32x48","fixed32x56","fixed32x64","fixed32x72","fixed32x80","fixed32x88","fixed32x96","fixed32x104","fixed32x112","fixed32x120","fixed32x128","fixed32x136","fixed32x144","fixed32x152","fixed32x160","fixed32x168","fixed32x176","fixed32x184","fixed32x192","fixed32x200","fixed32x208","fixed32x216","fixed32x224","fixed40x8","fixed40x16","fixed40x24","fixed40x32","fixed40x40","fixed40x48","fixed40x56","fixed40x64","fixed40x72","fixed40x80","fixed40x88","fixed40x96","fixed40x104","fixed40x112","fixed40x120","fixed40x128","fixed40x136","fixed40x144","fixed40x152","fixed40x160","fixed40x168","fixed40x176","fixed40x184","fixed40x192","fixed40x200","fixed40x208","fixed40x216","fixed48x8","fixed48x16","fixed48x24","fixed48x32","fixed48x40","fixed48x48","fixed48x56","fixed48x64","fixed48x72","fixed48x80","fixed48x88","fixed48x96","fixed48x104","fixed48x112","fixed48x120","fixed48x128","fixed48x136","fixed48x144","fixed48x152","fixed48x160","fixed48x168","fixed48x176","fixed48x184","fixed48x192","fixed48x200","fixed48x208","fixed56x8","fixed56x16","fixed56x24","fixed56x32","fixed56x40","fixed56x48","fixed56x56","fixed56x64","fixed56x72","fixed56x80","fixed56x88","fixed56x96","fixed56x104","fixed56x112","fixed56x120","fixed56x128","fixed56x136","fixed56x144","fixed56x152","fixed56x160","fixed56x168","fixed56x176","fixed56x184","fixed56x192","fixed56x200","fixed64x8","fixed64x16","fixed64x24","fixed64x32","fixed64x40","fixed64x48","fixed64x56","fixed64x64","fixed64x72","fixed64x80","fixed64x88","fixed64x96","fixed64x104","fixed64x112","fixed64x120","fixed64x128","fixed64x136","fixed64x144","fixed64x152","fixed64x160","fixed64x168","fixed64x176","fixed64x184","fixed64x192","fixed72x8","fixed72x16","fixed72x24","fixed72x32","fixed72x40","fixed72x48","fixed72x56","fixed72x64","fixed72x72","fixed72x80","fixed72x88","fixed72x96","fixed72x104","fixed72x112","fixed72x120","fixed72x128","fixed72x136","fixed72x144","fixed72x152","fixed72x160","fixed72x168","fixed72x176","fixed72x184","fixed80x8","fixed80x16","fixed80x24","fixed80x32","fixed80x40","fixed80x48","fixed80x56","fixed80x64","fixed80x72","fixed80x80","fixed80x88","fixed80x96","fixed80x104","fixed80x112","fixed80x120","fixed80x128","fixed80x136","fixed80x144","fixed80x152","fixed80x160","fixed80x168","fixed80x176","fixed88x8","fixed88x16","fixed88x24","fixed88x32","fixed88x40","fixed88x48","fixed88x56","fixed88x64","fixed88x72","fixed88x80","fixed88x88","fixed88x96","fixed88x104","fixed88x112","fixed88x120","fixed88x128","fixed88x136","fixed88x144","fixed88x152","fixed88x160","fixed88x168","fixed96x8","fixed96x16","fixed96x24","fixed96x32","fixed96x40","fixed96x48","fixed96x56","fixed96x64","fixed96x72","fixed96x80","fixed96x88","fixed96x96","fixed96x104","fixed96x112","fixed96x120","fixed96x128","fixed96x136","fixed96x144","fixed96x152","fixed96x160","fixed104x8","fixed104x16","fixed104x24","fixed104x32","fixed104x40","fixed104x48","fixed104x56","fixed104x64","fixed104x72","fixed104x80","fixed104x88","fixed104x96","fixed104x104","fixed104x112","fixed104x120","fixed104x128","fixed104x136","fixed104x144","fixed104x152","fixed112x8","fixed112x16","fixed112x24","fixed112x32","fixed112x40","fixed112x48","fixed112x56","fixed112x64","fixed112x72","fixed112x80","fixed112x88","fixed112x96","fixed112x104","fixed112x112","fixed112x120","fixed112x128","fixed112x136","fixed112x144","fixed120x8","fixed120x16","fixed120x24","fixed120x32","fixed120x40","fixed120x48","fixed120x56","fixed120x64","fixed120x72","fixed120x80","fixed120x88","fixed120x96","fixed120x104","fixed120x112","fixed120x120","fixed120x128","fixed120x136","fixed128x8","fixed128x16","fixed128x24","fixed128x32","fixed128x40","fixed128x48","fixed128x56","fixed128x64","fixed128x72","fixed128x80","fixed128x88","fixed128x96","fixed128x104","fixed128x112","fixed128x120","fixed128x128","fixed136x8","fixed136x16","fixed136x24","fixed136x32","fixed136x40","fixed136x48","fixed136x56","fixed136x64","fixed136x72","fixed136x80","fixed136x88","fixed136x96","fixed136x104","fixed136x112","fixed136x120","fixed144x8","fixed144x16","fixed144x24","fixed144x32","fixed144x40","fixed144x48","fixed144x56","fixed144x64","fixed144x72","fixed144x80","fixed144x88","fixed144x96","fixed144x104","fixed144x112","fixed152x8","fixed152x16","fixed152x24","fixed152x32","fixed152x40","fixed152x48","fixed152x56","fixed152x64","fixed152x72","fixed152x80","fixed152x88","fixed152x96","fixed152x104","fixed160x8","fixed160x16","fixed160x24","fixed160x32","fixed160x40","fixed160x48","fixed160x56","fixed160x64","fixed160x72","fixed160x80","fixed160x88","fixed160x96","fixed168x8","fixed168x16","fixed168x24","fixed168x32","fixed168x40","fixed168x48","fixed168x56","fixed168x64","fixed168x72","fixed168x80","fixed168x88","fixed176x8","fixed176x16","fixed176x24","fixed176x32","fixed176x40","fixed176x48","fixed176x56","fixed176x64","fixed176x72","fixed176x80","fixed184x8","fixed184x16","fixed184x24","fixed184x32","fixed184x40","fixed184x48","fixed184x56","fixed184x64","fixed184x72","fixed192x8","fixed192x16","fixed192x24","fixed192x32","fixed192x40","fixed192x48","fixed192x56","fixed192x64","fixed200x8","fixed200x16","fixed200x24","fixed200x32","fixed200x40","fixed200x48","fixed200x56","fixed208x8","fixed208x16","fixed208x24","fixed208x32","fixed208x40","fixed208x48","fixed216x8","fixed216x16","fixed216x24","fixed216x32","fixed216x40","fixed224x8","fixed224x16","fixed224x24","fixed224x32","fixed232x8","fixed232x16","fixed232x24","fixed240x8","fixed240x16","fixed248x8","ufixed","ufixed0x8","ufixed0x16","ufixed0x24","ufixed0x32","ufixed0x40","ufixed0x48","ufixed0x56","ufixed0x64","ufixed0x72","ufixed0x80","ufixed0x88","ufixed0x96","ufixed0x104","ufixed0x112","ufixed0x120","ufixed0x128","ufixed0x136","ufixed0x144","ufixed0x152","ufixed0x160","ufixed0x168","ufixed0x176","ufixed0x184","ufixed0x192","ufixed0x200","ufixed0x208","ufixed0x216","ufixed0x224","ufixed0x232","ufixed0x240","ufixed0x248","ufixed0x256","ufixed8x8","ufixed8x16","ufixed8x24","ufixed8x32","ufixed8x40","ufixed8x48","ufixed8x56","ufixed8x64","ufixed8x72","ufixed8x80","ufixed8x88","ufixed8x96","ufixed8x104","ufixed8x112","ufixed8x120","ufixed8x128","ufixed8x136","ufixed8x144","ufixed8x152","ufixed8x160","ufixed8x168","ufixed8x176","ufixed8x184","ufixed8x192","ufixed8x200","ufixed8x208","ufixed8x216","ufixed8x224","ufixed8x232","ufixed8x240","ufixed8x248","ufixed16x8","ufixed16x16","ufixed16x24","ufixed16x32","ufixed16x40","ufixed16x48","ufixed16x56","ufixed16x64","ufixed16x72","ufixed16x80","ufixed16x88","ufixed16x96","ufixed16x104","ufixed16x112","ufixed16x120","ufixed16x128","ufixed16x136","ufixed16x144","ufixed16x152","ufixed16x160","ufixed16x168","ufixed16x176","ufixed16x184","ufixed16x192","ufixed16x200","ufixed16x208","ufixed16x216","ufixed16x224","ufixed16x232","ufixed16x240","ufixed24x8","ufixed24x16","ufixed24x24","ufixed24x32","ufixed24x40","ufixed24x48","ufixed24x56","ufixed24x64","ufixed24x72","ufixed24x80","ufixed24x88","ufixed24x96","ufixed24x104","ufixed24x112","ufixed24x120","ufixed24x128","ufixed24x136","ufixed24x144","ufixed24x152","ufixed24x160","ufixed24x168","ufixed24x176","ufixed24x184","ufixed24x192","ufixed24x200","ufixed24x208","ufixed24x216","ufixed24x224","ufixed24x232","ufixed32x8","ufixed32x16","ufixed32x24","ufixed32x32","ufixed32x40","ufixed32x48","ufixed32x56","ufixed32x64","ufixed32x72","ufixed32x80","ufixed32x88","ufixed32x96","ufixed32x104","ufixed32x112","ufixed32x120","ufixed32x128","ufixed32x136","ufixed32x144","ufixed32x152","ufixed32x160","ufixed32x168","ufixed32x176","ufixed32x184","ufixed32x192","ufixed32x200","ufixed32x208","ufixed32x216","ufixed32x224","ufixed40x8","ufixed40x16","ufixed40x24","ufixed40x32","ufixed40x40","ufixed40x48","ufixed40x56","ufixed40x64","ufixed40x72","ufixed40x80","ufixed40x88","ufixed40x96","ufixed40x104","ufixed40x112","ufixed40x120","ufixed40x128","ufixed40x136","ufixed40x144","ufixed40x152","ufixed40x160","ufixed40x168","ufixed40x176","ufixed40x184","ufixed40x192","ufixed40x200","ufixed40x208","ufixed40x216","ufixed48x8","ufixed48x16","ufixed48x24","ufixed48x32","ufixed48x40","ufixed48x48","ufixed48x56","ufixed48x64","ufixed48x72","ufixed48x80","ufixed48x88","ufixed48x96","ufixed48x104","ufixed48x112","ufixed48x120","ufixed48x128","ufixed48x136","ufixed48x144","ufixed48x152","ufixed48x160","ufixed48x168","ufixed48x176","ufixed48x184","ufixed48x192","ufixed48x200","ufixed48x208","ufixed56x8","ufixed56x16","ufixed56x24","ufixed56x32","ufixed56x40","ufixed56x48","ufixed56x56","ufixed56x64","ufixed56x72","ufixed56x80","ufixed56x88","ufixed56x96","ufixed56x104","ufixed56x112","ufixed56x120","ufixed56x128","ufixed56x136","ufixed56x144","ufixed56x152","ufixed56x160","ufixed56x168","ufixed56x176","ufixed56x184","ufixed56x192","ufixed56x200","ufixed64x8","ufixed64x16","ufixed64x24","ufixed64x32","ufixed64x40","ufixed64x48","ufixed64x56","ufixed64x64","ufixed64x72","ufixed64x80","ufixed64x88","ufixed64x96","ufixed64x104","ufixed64x112","ufixed64x120","ufixed64x128","ufixed64x136","ufixed64x144","ufixed64x152","ufixed64x160","ufixed64x168","ufixed64x176","ufixed64x184","ufixed64x192","ufixed72x8","ufixed72x16","ufixed72x24","ufixed72x32","ufixed72x40","ufixed72x48","ufixed72x56","ufixed72x64","ufixed72x72","ufixed72x80","ufixed72x88","ufixed72x96","ufixed72x104","ufixed72x112","ufixed72x120","ufixed72x128","ufixed72x136","ufixed72x144","ufixed72x152","ufixed72x160","ufixed72x168","ufixed72x176","ufixed72x184","ufixed80x8","ufixed80x16","ufixed80x24","ufixed80x32","ufixed80x40","ufixed80x48","ufixed80x56","ufixed80x64","ufixed80x72","ufixed80x80","ufixed80x88","ufixed80x96","ufixed80x104","ufixed80x112","ufixed80x120","ufixed80x128","ufixed80x136","ufixed80x144","ufixed80x152","ufixed80x160","ufixed80x168","ufixed80x176","ufixed88x8","ufixed88x16","ufixed88x24","ufixed88x32","ufixed88x40","ufixed88x48","ufixed88x56","ufixed88x64","ufixed88x72","ufixed88x80","ufixed88x88","ufixed88x96","ufixed88x104","ufixed88x112","ufixed88x120","ufixed88x128","ufixed88x136","ufixed88x144","ufixed88x152","ufixed88x160","ufixed88x168","ufixed96x8","ufixed96x16","ufixed96x24","ufixed96x32","ufixed96x40","ufixed96x48","ufixed96x56","ufixed96x64","ufixed96x72","ufixed96x80","ufixed96x88","ufixed96x96","ufixed96x104","ufixed96x112","ufixed96x120","ufixed96x128","ufixed96x136","ufixed96x144","ufixed96x152","ufixed96x160","ufixed104x8","ufixed104x16","ufixed104x24","ufixed104x32","ufixed104x40","ufixed104x48","ufixed104x56","ufixed104x64","ufixed104x72","ufixed104x80","ufixed104x88","ufixed104x96","ufixed104x104","ufixed104x112","ufixed104x120","ufixed104x128","ufixed104x136","ufixed104x144","ufixed104x152","ufixed112x8","ufixed112x16","ufixed112x24","ufixed112x32","ufixed112x40","ufixed112x48","ufixed112x56","ufixed112x64","ufixed112x72","ufixed112x80","ufixed112x88","ufixed112x96","ufixed112x104","ufixed112x112","ufixed112x120","ufixed112x128","ufixed112x136","ufixed112x144","ufixed120x8","ufixed120x16","ufixed120x24","ufixed120x32","ufixed120x40","ufixed120x48","ufixed120x56","ufixed120x64","ufixed120x72","ufixed120x80","ufixed120x88","ufixed120x96","ufixed120x104","ufixed120x112","ufixed120x120","ufixed120x128","ufixed120x136","ufixed128x8","ufixed128x16","ufixed128x24","ufixed128x32","ufixed128x40","ufixed128x48","ufixed128x56","ufixed128x64","ufixed128x72","ufixed128x80","ufixed128x88","ufixed128x96","ufixed128x104","ufixed128x112","ufixed128x120","ufixed128x128","ufixed136x8","ufixed136x16","ufixed136x24","ufixed136x32","ufixed136x40","ufixed136x48","ufixed136x56","ufixed136x64","ufixed136x72","ufixed136x80","ufixed136x88","ufixed136x96","ufixed136x104","ufixed136x112","ufixed136x120","ufixed144x8","ufixed144x16","ufixed144x24","ufixed144x32","ufixed144x40","ufixed144x48","ufixed144x56","ufixed144x64","ufixed144x72","ufixed144x80","ufixed144x88","ufixed144x96","ufixed144x104","ufixed144x112","ufixed152x8","ufixed152x16","ufixed152x24","ufixed152x32","ufixed152x40","ufixed152x48","ufixed152x56","ufixed152x64","ufixed152x72","ufixed152x80","ufixed152x88","ufixed152x96","ufixed152x104","ufixed160x8","ufixed160x16","ufixed160x24","ufixed160x32","ufixed160x40","ufixed160x48","ufixed160x56","ufixed160x64","ufixed160x72","ufixed160x80","ufixed160x88","ufixed160x96","ufixed168x8","ufixed168x16","ufixed168x24","ufixed168x32","ufixed168x40","ufixed168x48","ufixed168x56","ufixed168x64","ufixed168x72","ufixed168x80","ufixed168x88","ufixed176x8","ufixed176x16","ufixed176x24","ufixed176x32","ufixed176x40","ufixed176x48","ufixed176x56","ufixed176x64","ufixed176x72","ufixed176x80","ufixed184x8","ufixed184x16","ufixed184x24","ufixed184x32","ufixed184x40","ufixed184x48","ufixed184x56","ufixed184x64","ufixed184x72","ufixed192x8","ufixed192x16","ufixed192x24","ufixed192x32","ufixed192x40","ufixed192x48","ufixed192x56","ufixed192x64","ufixed200x8","ufixed200x16","ufixed200x24","ufixed200x32","ufixed200x40","ufixed200x48","ufixed200x56","ufixed208x8","ufixed208x16","ufixed208x24","ufixed208x32","ufixed208x40","ufixed208x48","ufixed216x8","ufixed216x16","ufixed216x24","ufixed216x32","ufixed216x40","ufixed224x8","ufixed224x16","ufixed224x24","ufixed224x32","ufixed232x8","ufixed232x16","ufixed232x24","ufixed240x8","ufixed240x16","ufixed248x8","event","enum","let","mapping","private","public","external","inherited","payable","true","false","var","import","constant","if","else","for","else","for","while","do","break","continue","throw","returns","return","suicide","new","is","this","super"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/,"number.hex"],[/0[0-7']*[0-7](@integersuffix)/,"number.octal"],[/0[bB][0-1']*[0-1](@integersuffix)/,"number.binary"],[/\d[\d']*\d(@integersuffix)/,"number"],[/\d(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d0afa49.38212f37.js b/modules/gateway/src/main/resources/static/js/chunk-2d0afa49.38212f37.js deleted file mode 100644 index 006e211e2..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d0afa49.38212f37.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d0afa49"],{"0eca":function(e,n,s){"use strict";s.r(n),s.d(n,"conf",(function(){return t})),s.d(n,"language",(function(){return o}));var t={brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},o={defaultToken:"",tokenPostfix:".dockerfile",instructions:/FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|ARG|VOLUME|LABEL|USER|WORKDIR|COPY|CMD|STOPSIGNAL|SHELL|HEALTHCHECK|ENTRYPOINT/,instructionAfter:/ONBUILD/,variableAfter:/ENV/,variable:/\${?[\w]+}?/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/(@instructionAfter)(\s+)/,["keyword",{token:"",next:"@instructions"}]],["","keyword","@instructions"]],instructions:[[/(@variableAfter)(\s+)([\w]+)/,["keyword","",{token:"variable",next:"@arguments"}]],[/(@instructions)/,"keyword","@arguments"]],arguments:[{include:"@whitespace"},{include:"@strings"},[/(@variable)/,{cases:{"@eos":{token:"variable",next:"@popall"},"@default":"variable"}}],[/\\/,{cases:{"@eos":"","@default":""}}],[/./,{cases:{"@eos":{token:"",next:"@popall"},"@default":""}}]],whitespace:[[/\s+/,{cases:{"@eos":{token:"",next:"@popall"},"@default":""}}]],comment:[[/(^#.*$)/,"comment","@popall"]],strings:[[/'$/,"string","@popall"],[/'/,"string","@stringBody"],[/"$/,"string","@popall"],[/"/,"string","@dblStringBody"]],stringBody:[[/[^\\\$']/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/\\./,"string.escape"],[/'$/,"string","@popall"],[/'/,"string","@pop"],[/(@variable)/,"variable"],[/\\$/,"string"],[/$/,"string","@popall"]],dblStringBody:[[/[^\\\$"]/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/\\./,"string.escape"],[/"$/,"string","@popall"],[/"/,"string","@pop"],[/(@variable)/,"variable"],[/\\$/,"string"],[/$/,"string","@popall"]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d0b2762.ccc9a28c.js b/modules/gateway/src/main/resources/static/js/chunk-2d0b2762.ccc9a28c.js deleted file mode 100644 index fafd10b1a..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d0b2762.ccc9a28c.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d0b2762"],{"23e0":function(e,t,n){"use strict";n.r(t),n.d(t,"conf",(function(){return o})),n.d(t,"language",(function(){return a}));var o={comments:{lineComment:"//"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]}],folding:{offSide:!0}},a={defaultToken:"",tokenPostfix:".pug",ignoreCase:!0,brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.array",open:"[",close:"]"},{token:"delimiter.parenthesis",open:"(",close:")"}],keywords:["append","block","case","default","doctype","each","else","extends","for","if","in","include","mixin","typeof","unless","var","when"],tags:["a","abbr","acronym","address","area","article","aside","audio","b","base","basefont","bdi","bdo","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","keygen","kbd","label","li","link","map","mark","menu","meta","meter","nav","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strike","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","tracks","tt","u","ul","video","wbr"],symbols:/[\+\-\*\%\&\|\!\=\/\.\,\:]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^(\s*)([a-zA-Z_-][\w-]*)/,{cases:{"$2@tags":{cases:{"@eos":["","tag"],"@default":["",{token:"tag",next:"@tag.$1"}]}},"$2@keywords":["",{token:"keyword.$2"}],"@default":["",""]}}],[/^(\s*)(#[a-zA-Z_-][\w-]*)/,{cases:{"@eos":["","tag.id"],"@default":["",{token:"tag.id",next:"@tag.$1"}]}}],[/^(\s*)(\.[a-zA-Z_-][\w-]*)/,{cases:{"@eos":["","tag.class"],"@default":["",{token:"tag.class",next:"@tag.$1"}]}}],[/^(\s*)(\|.*)$/,""],{include:"@whitespace"},[/[a-zA-Z_$][\w$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":""}}],[/[{}()\[\]]/,"@brackets"],[/@symbols/,"delimiter"],[/\d+\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\d+/,"number"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],tag:[[/(\.)(\s*$)/,[{token:"delimiter",next:"@blockText.$S2."},""]],[/\s+/,{token:"",next:"@simpleText"}],[/#[a-zA-Z_-][\w-]*/,{cases:{"@eos":{token:"tag.id",next:"@pop"},"@default":"tag.id"}}],[/\.[a-zA-Z_-][\w-]*/,{cases:{"@eos":{token:"tag.class",next:"@pop"},"@default":"tag.class"}}],[/\(/,{token:"delimiter.parenthesis",next:"@attributeList"}]],simpleText:[[/[^#]+$/,{token:"",next:"@popall"}],[/[^#]+/,{token:""}],[/(#{)([^}]*)(})/,{cases:{"@eos":["interpolation.delimiter","interpolation",{token:"interpolation.delimiter",next:"@popall"}],"@default":["interpolation.delimiter","interpolation","interpolation.delimiter"]}}],[/#$/,{token:"",next:"@popall"}],[/#/,""]],attributeList:[[/\s+/,""],[/(\w+)(\s*=\s*)("|')/,["attribute.name","delimiter",{token:"attribute.value",next:"@value.$3"}]],[/\w+/,"attribute.name"],[/,/,{cases:{"@eos":{token:"attribute.delimiter",next:"@popall"},"@default":"attribute.delimiter"}}],[/\)$/,{token:"delimiter.parenthesis",next:"@popall"}],[/\)/,{token:"delimiter.parenthesis",next:"@pop"}]],whitespace:[[/^(\s*)(\/\/.*)$/,{token:"comment",next:"@blockText.$1.comment"}],[/[ \t\r\n]+/,""],[//,{token:"comment",next:"@pop"}],[//,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d0c512b.f1df22a1.js b/modules/gateway/src/main/resources/static/js/chunk-2d0c512b.f1df22a1.js deleted file mode 100644 index 69169ba0d..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d0c512b.f1df22a1.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d0c512b"],{"3e14":function(e,t,n){"use strict";n.r(t),n.d(t,"conf",(function(){return s})),n.d(t,"language",(function(){return o}));var s={comments:{blockComment:["\x3c!--","--\x3e"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">",notIn:["string"]}],surroundingPairs:[{open:"(",close:")"},{open:"[",close:"]"},{open:"`",close:"`"}],folding:{markers:{start:new RegExp("^\\s*\x3c!--\\s*#?region\\b.*--\x3e"),end:new RegExp("^\\s*\x3c!--\\s*#?endregion\\b.*--\x3e")}}},o={defaultToken:"",tokenPostfix:".md",control:/[\\`*_\[\]{}()#+\-\.!]/,noncontrol:/[^\\`*_\[\]{}()#+\-\.!]/,escapes:/\\(?:@control)/,jsescapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,empty:["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param"],tokenizer:{root:[[/^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/,["white","keyword","keyword","keyword"]],[/^\s*(=+|\-+)\s*$/,"keyword"],[/^\s*((\*[ ]?)+)\s*$/,"meta.separator"],[/^\s*>+/,"comment"],[/^\s*([\*\-+:]|\d+\.)\s/,"keyword"],[/^(\t|[ ]{4})[^ ].*$/,"string"],[/^\s*~~~\s*((?:\w|[\/\-#])+)?\s*$/,{token:"string",next:"@codeblock"}],[/^\s*```\s*((?:\w|[\/\-#])+)\s*$/,{token:"string",next:"@codeblockgh",nextEmbedded:"$1"}],[/^\s*```\s*$/,{token:"string",next:"@codeblock"}],{include:"@linecontent"}],codeblock:[[/^\s*~~~\s*$/,{token:"string",next:"@pop"}],[/^\s*```\s*$/,{token:"string",next:"@pop"}],[/.*$/,"variable.source"]],codeblockgh:[[/```\s*$/,{token:"variable.source",next:"@pop",nextEmbedded:"@pop"}],[/[^`]+/,"variable.source"]],linecontent:[[/&\w+;/,"string.escape"],[/@escapes/,"escape"],[/\b__([^\\_]|@escapes|_(?!_))+__\b/,"strong"],[/\*\*([^\\*]|@escapes|\*(?!\*))+\*\*/,"strong"],[/\b_[^_]+_\b/,"emphasis"],[/\*([^\\*]|@escapes)+\*/,"emphasis"],[/`([^\\`]|@escapes)+`/,"variable"],[/\{+[^}]+\}+/,"string.target"],[/(!?\[)((?:[^\]\\]|@escapes)*)(\]\([^\)]+\))/,["string.link","","string.link"]],[/(!?\[)((?:[^\]\\]|@escapes)*)(\])/,"string.link"],{include:"html"}],html:[[/<(\w+)\/>/,"tag"],[/<(\w+)/,{cases:{"@empty":{token:"tag",next:"@tag.$1"},"@default":{token:"tag",next:"@tag.$1"}}}],[/<\/(\w+)\s*>/,{token:"tag"}],[//,"comment","@pop"],[//,{token:"comment",next:"@pop"}],[//,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],phpInSimpleState:[[/<\?((php)|=)?/,"metatag.php"],[/\?>/,{token:"metatag.php",switchTo:"@$S2.$S3"}],{include:"phpRoot"}],phpInEmbeddedState:[[/<\?((php)|=)?/,"metatag.php"],[/\?>/,{token:"metatag.php",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"phpRoot"}],phpRoot:[[/[a-zA-Z_]\w*/,{cases:{"@phpKeywords":{token:"keyword.php"},"@phpCompileTimeConstants":{token:"constant.php"},"@default":"identifier.php"}}],[/[$a-zA-Z_]\w*/,{cases:{"@phpPreDefinedVariables":{token:"variable.predefined.php"},"@default":"variable.php"}}],[/[{}]/,"delimiter.bracket.php"],[/[\[\]]/,"delimiter.array.php"],[/[()]/,"delimiter.parenthesis.php"],[/[ \t\r\n]+/],[/#/,"comment.php","@phpLineComment"],[/\/\//,"comment.php","@phpLineComment"],[/\/\*/,"comment.php","@phpComment"],[/"/,"string.php","@phpDoubleQuoteString"],[/'/,"string.php","@phpSingleQuoteString"],[/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,\@]/,"delimiter.php"],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float.php"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float.php"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/,"number.hex.php"],[/0[0-7']*[0-7]/,"number.octal.php"],[/0[bB][0-1']*[0-1]/,"number.binary.php"],[/\d[\d']*/,"number.php"],[/\d/,"number.php"]],phpComment:[[/\*\//,"comment.php","@pop"],[/[^*]+/,"comment.php"],[/./,"comment.php"]],phpLineComment:[[/\?>/,{token:"@rematch",next:"@pop"}],[/.$/,"comment.php","@pop"],[/[^?]+$/,"comment.php","@pop"],[/[^?]+/,"comment.php"],[/./,"comment.php"]],phpDoubleQuoteString:[[/[^\\"]+/,"string.php"],[/@escapes/,"string.escape.php"],[/\\./,"string.escape.invalid.php"],[/"/,"string.php","@pop"]],phpSingleQuoteString:[[/[^\\']+/,"string.php"],[/@escapes/,"string.escape.php"],[/\\./,"string.escape.invalid.php"],[/'/,"string.php","@pop"]]},phpKeywords:["abstract","and","array","as","break","callable","case","catch","cfunction","class","clone","const","continue","declare","default","do","else","elseif","enddeclare","endfor","endforeach","endif","endswitch","endwhile","extends","false","final","for","foreach","function","global","goto","if","implements","interface","instanceof","insteadof","namespace","new","null","object","old_function","or","private","protected","public","resource","static","switch","throw","trait","try","true","use","var","while","xor","die","echo","empty","exit","eval","include","include_once","isset","list","require","require_once","return","print","unset","yield","__construct"],phpCompileTimeConstants:["__CLASS__","__DIR__","__FILE__","__LINE__","__NAMESPACE__","__METHOD__","__FUNCTION__","__TRAIT__"],phpPreDefinedVariables:["$GLOBALS","$_SERVER","$_GET","$_POST","$_FILES","$_REQUEST","$_SESSION","$_ENV","$_COOKIE","$php_errormsg","$HTTP_RAW_POST_DATA","$http_response_header","$argc","$argv"],escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d0e6553.f4980434.js b/modules/gateway/src/main/resources/static/js/chunk-2d0e6553.f4980434.js deleted file mode 100644 index aa02740d4..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d0e6553.f4980434.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d0e6553"],{"97fe":function(e,r,t){"use strict";t.r(r),t.d(r,"conf",(function(){return o})),t.d(r,"language",(function(){return i}));var o={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}]},i={defaultToken:"",ignoreCase:!0,tokenPostfix:".shell",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["if","then","do","else","elif","while","until","for","in","esac","fi","fin","fil","done","exit","set","unset","export","function"],builtins:["ab","awk","bash","beep","cat","cc","cd","chown","chmod","chroot","clear","cp","curl","cut","diff","echo","find","gawk","gcc","get","git","grep","hg","kill","killall","ln","ls","make","mkdir","openssl","mv","nc","node","npm","ping","ps","restart","rm","rmdir","sed","service","sh","shopt","shred","source","sort","sleep","ssh","start","stop","su","sudo","svn","tee","telnet","top","touch","vi","vim","wall","wc","wget","who","write","yes","zsh"],symbols:/[=>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],pseudoColumns:[[/[$][A-Za-z_][\w@#$]*/,{cases:{"@pseudoColumns":"predefined","@default":"identifier"}}]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/'/,{token:"string",next:"@string"}],[/"/,{token:"string.double",next:"@stringDouble"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],stringDouble:[[/[^"]+/,"string.double"],[/""/,"string.double"],[/"/,{token:"string.double",next:"@pop"}]],scopes:[]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d208ac5.8490da1b.js b/modules/gateway/src/main/resources/static/js/chunk-2d208ac5.8490da1b.js deleted file mode 100644 index 3869c50e9..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d208ac5.8490da1b.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d208ac5"],{a693:function(e,n,s){"use strict";s.r(n),s.d(n,"conf",(function(){return t})),s.d(n,"language",(function(){return o}));var t={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"#",blockComment:["<#","#>"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},o={defaultToken:"",ignoreCase:!0,tokenPostfix:".ps1",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.parenthesis",open:"(",close:")"}],keywords:["begin","break","catch","class","continue","data","define","do","dynamicparam","else","elseif","end","exit","filter","finally","for","foreach","from","function","if","in","param","process","return","switch","throw","trap","try","until","using","var","while","workflow","parallel","sequence","inlinescript","configuration"],helpKeywords:/SYNOPSIS|DESCRIPTION|PARAMETER|EXAMPLE|INPUTS|OUTPUTS|NOTES|LINK|COMPONENT|ROLE|FUNCTIONALITY|FORWARDHELPTARGETNAME|FORWARDHELPCATEGORY|REMOTEHELPRUNSPACE|EXTERNALHELP/,symbols:/[=>/,"comment","@pop"],[/(\.)(@helpKeywords)(?!\w)/,{token:"comment.keyword.$2"}],[/[\.#]/,"comment"]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d209408.891ecbaa.js b/modules/gateway/src/main/resources/static/js/chunk-2d209408.891ecbaa.js deleted file mode 100644 index 9fbc2bc08..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d209408.891ecbaa.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d209408"],{a7ea:function(t,r,e){"use strict";e.r(r),e.d(r,"conf",(function(){return s})),e.d(r,"language",(function(){return n}));var s={brackets:[],autoClosingPairs:[],surroundingPairs:[]},n={keywords:[],typeKeywords:[],tokenPostfix:".csp",operators:[],symbols:/[=>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/#+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/'/,{token:"string",next:"@string"}],[/"/,{token:"string.double",next:"@stringDouble"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],stringDouble:[[/[^"]+/,"string.double"],[/""/,"string.double"],[/"/,{token:"string.double",next:"@pop"}]],complexIdentifiers:[[/`/,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[/[^`]+/,"identifier"],[/``/,"identifier"],[/`/,{token:"identifier.quote",next:"@pop"}]],scopes:[]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d20ff23.bc1845e1.js b/modules/gateway/src/main/resources/static/js/chunk-2d20ff23.bc1845e1.js deleted file mode 100644 index d426ec0f8..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d20ff23.bc1845e1.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d20ff23"],{b692:function(e,t,n){"use strict";n.r(t),n.d(t,"conf",(function(){return o})),n.d(t,"language",(function(){return d}));var i="undefined"===typeof monaco?self.monaco:monaco,r=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],o={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["\x3c!--","--\x3e"]},brackets:[["\x3c!--","--\x3e"],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp("<(?!(?:"+r.join("|")+"))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$","i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:i.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp("<(?!(?:"+r.join("|")+"))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$","i"),action:{indentAction:i.languages.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*\x3c!--\\s*#region\\b.*--\x3e"),end:new RegExp("^\\s*\x3c!--\\s*#endregion\\b.*--\x3e")}}},d={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d2138c7.0645ba29.js b/modules/gateway/src/main/resources/static/js/chunk-2d2138c7.0645ba29.js deleted file mode 100644 index 7240559db..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d2138c7.0645ba29.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d2138c7"],{acc2:function(e,n,o){"use strict";o.r(n),o.d(n,"conf",(function(){return t})),o.d(n,"language",(function(){return r}));var t={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"],["var","end_var"],["var_input","end_var"],["var_output","end_var"],["var_in_out","end_var"],["var_temp","end_var"],["var_global","end_var"],["var_access","end_var"],["var_external","end_var"],["type","end_type"],["struct","end_struct"],["program","end_program"],["function","end_function"],["function_block","end_function_block"],["action","end_action"],["step","end_step"],["initial_step","end_step"],["transaction","end_transaction"],["configuration","end_configuration"],["tcp","end_tcp"],["recource","end_recource"],["channel","end_channel"],["library","end_library"],["folder","end_folder"],["binaries","end_binaries"],["includes","end_includes"],["sources","end_sources"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:"/*",close:"*/"},{open:"'",close:"'",notIn:["string_sq"]},{open:'"',close:'"',notIn:["string_dq"]},{open:"var",close:"end_var"},{open:"var_input",close:"end_var"},{open:"var_output",close:"end_var"},{open:"var_in_out",close:"end_var"},{open:"var_temp",close:"end_var"},{open:"var_global",close:"end_var"},{open:"var_access",close:"end_var"},{open:"var_external",close:"end_var"},{open:"type",close:"end_type"},{open:"struct",close:"end_struct"},{open:"program",close:"end_program"},{open:"function",close:"end_function"},{open:"function_block",close:"end_function_block"},{open:"action",close:"end_action"},{open:"step",close:"end_step"},{open:"initial_step",close:"end_step"},{open:"transaction",close:"end_transaction"},{open:"configuration",close:"end_configuration"},{open:"tcp",close:"end_tcp"},{open:"recource",close:"end_recource"},{open:"channel",close:"end_channel"},{open:"library",close:"end_library"},{open:"folder",close:"end_folder"},{open:"binaries",close:"end_binaries"},{open:"includes",close:"end_includes"},{open:"sources",close:"end_sources"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"var",close:"end_var"},{open:"var_input",close:"end_var"},{open:"var_output",close:"end_var"},{open:"var_in_out",close:"end_var"},{open:"var_temp",close:"end_var"},{open:"var_global",close:"end_var"},{open:"var_access",close:"end_var"},{open:"var_external",close:"end_var"},{open:"type",close:"end_type"},{open:"struct",close:"end_struct"},{open:"program",close:"end_program"},{open:"function",close:"end_function"},{open:"function_block",close:"end_function_block"},{open:"action",close:"end_action"},{open:"step",close:"end_step"},{open:"initial_step",close:"end_step"},{open:"transaction",close:"end_transaction"},{open:"configuration",close:"end_configuration"},{open:"tcp",close:"end_tcp"},{open:"recource",close:"end_recource"},{open:"channel",close:"end_channel"},{open:"library",close:"end_library"},{open:"folder",close:"end_folder"},{open:"binaries",close:"end_binaries"},{open:"includes",close:"end_includes"},{open:"sources",close:"end_sources"}],folding:{markers:{start:new RegExp("^\\s*#pragma\\s+region\\b"),end:new RegExp("^\\s*#pragma\\s+endregion\\b")}}},r={defaultToken:"",tokenPostfix:".st",ignoreCase:!0,brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["if","end_if","elsif","else","case","of","to","do","with","by","while","repeat","end_while","end_repeat","end_case","for","end_for","task","retain","non_retain","constant","with","at","exit","return","interval","priority","address","port","on_channel","then","iec","file","uses","version","packagetype","displayname","copyright","summary","vendor","common_source","from"],constant:["false","true","null"],defineKeywords:["var","var_input","var_output","var_in_out","var_temp","var_global","var_access","var_external","end_var","type","end_type","struct","end_struct","program","end_program","function","end_function","function_block","end_function_block","configuration","end_configuration","tcp","end_tcp","recource","end_recource","channel","end_channel","library","end_library","folder","end_folder","binaries","end_binaries","includes","end_includes","sources","end_sources","action","end_action","step","initial_step","end_step","transaction","end_transaction"],typeKeywords:["int","sint","dint","lint","usint","uint","udint","ulint","real","lreal","time","date","time_of_day","date_and_time","string","bool","byte","world","dworld","array","pointer","lworld"],operators:["=",">","<",":",":=","<=",">=","<>","&","+","-","*","**","MOD","^","or","and","not","xor","abs","acos","asin","atan","cos","exp","expt","ln","log","sin","sqrt","tan","sel","max","min","limit","mux","shl","shr","rol","ror","indexof","sizeof","adr","adrinst","bitadr","is_valid"],builtinVariables:[],builtinFunctions:["sr","rs","tp","ton","tof","eq","ge","le","lt","ne","round","trunc","ctd","сtu","ctud","r_trig","f_trig","move","concat","delete","find","insert","left","len","replace","right","rtc"],symbols:/[=>=","<",">","=",";",":",",",".","..","..."],symbols:/[=>",token:"delimiter.angle"}],tokenizer:{root:[{include:"@selector"}],selector:[{include:"@comments"},{include:"@import"},{include:"@strings"},["[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",{token:"keyword",next:"@keyframedeclaration"}],["[@](page|content|font-face|-moz-document)",{token:"keyword"}],["[@](charset|namespace)",{token:"keyword",next:"@declarationbody"}],["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@selectorname"},["[\\*]","tag"],["[>\\+,]","delimiter"],["\\[",{token:"delimiter.bracket",next:"@selectorattribute"}],["{",{token:"delimiter.bracket",next:"@selectorbody"}]],selectorbody:[{include:"@comments"},["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))","attribute.name","@rulevalue"],["}",{token:"delimiter.bracket",next:"@pop"}]],selectorname:[["(\\.|#(?=[^{])|%|(@identifier)|:)+","tag"]],selectorattribute:[{include:"@term"},["]",{token:"delimiter.bracket",next:"@pop"}]],term:[{include:"@comments"},["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@functioninvocation"},{include:"@numbers"},{include:"@name"},["([<>=\\+\\-\\*\\/\\^\\|\\~,])","delimiter"],[",","delimiter"]],rulevalue:[{include:"@comments"},{include:"@strings"},{include:"@term"},["!important","keyword"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],warndebug:[["[@](warn|debug)",{token:"keyword",next:"@declarationbody"}]],import:[["[@](import)",{token:"keyword",next:"@declarationbody"}]],urldeclaration:[{include:"@strings"},["[^)\r\n]+","string"],["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],parenthizedterm:[{include:"@term"},["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],declarationbody:[{include:"@term"},[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[/[^*/]+/,"comment"],[/./,"comment"]],name:[["@identifier","attribute.value"]],numbers:[["-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],keyframedeclaration:[["@identifier","attribute.value"],["{",{token:"delimiter.bracket",switchTo:"@keyframebody"}]],keyframebody:[{include:"@term"},["{",{token:"delimiter.bracket",next:"@selectorbody"}],["}",{token:"delimiter.bracket",next:"@pop"}]],functioninvocation:[["@identifier\\(",{token:"attribute.value",next:"@functionarguments"}]],functionarguments:[["\\$@identifier@ws:","attribute.name"],["[,]","delimiter"],{include:"@term"},["\\)",{token:"attribute.value",next:"@pop"}]],strings:[['~?"',{token:"string",next:"@stringenddoublequote"}],["~?'",{token:"string",next:"@stringendquote"}]],stringenddoublequote:[["\\\\.","string"],['"',{token:"string",next:"@pop"}],[/[^\\"]+/,"string"],[".","string"]],stringendquote:[["\\\\.","string"],["'",{token:"string",next:"@pop"}],[/[^\\']+/,"string"],[".","string"]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d21dcd2.c8d0e30e.js b/modules/gateway/src/main/resources/static/js/chunk-2d21dcd2.c8d0e30e.js deleted file mode 100644 index b673082b6..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d21dcd2.c8d0e30e.js +++ /dev/null @@ -1,5 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d21dcd2"],{d39f:function(e,o,t){"use strict";t.r(o),t.d(o,"conf",(function(){return n})),t.d(o,"language",(function(){return i})); -/*!--------------------------------------------------------------------------------------------- - * Copyright (C) David Owens II, owensd.io. All rights reserved. - *--------------------------------------------------------------------------------------------*/ -var n={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}]},i={defaultToken:"",tokenPostfix:".swift",identifier:/[a-zA-Z_][\w$]*/,attributes:["@autoclosure","@noescape","@noreturn","@NSApplicationMain","@NSCopying","@NSManaged","@objc","@UIApplicationMain","@noreturn","@availability","@IBAction","@IBDesignable","@IBInspectable","@IBOutlet"],accessmodifiers:["public","private","internal"],keywords:["__COLUMN__","__FILE__","__FUNCTION__","__LINE__","as","as!","as?","associativity","break","case","catch","class","continue","convenience","default","deinit","didSet","do","dynamic","dynamicType","else","enum","extension","fallthrough","final","for","func","get","guard","if","import","in","infix","init","inout","internal","is","lazy","left","let","mutating","nil","none","nonmutating","operator","optional","override","postfix","precedence","prefix","private","protocol","Protocol","public","repeat","required","return","right","self","Self","set","static","struct","subscript","super","switch","throw","throws","try","try!","Type","typealias","unowned","var","weak","where","while","willSet","FALSE","TRUE"],symbols:/[=(){}\[\].,:;@#\_&\-<>`?!+*\\\/]/,operatorstart:/[\/=\-+!*%<>&|^~?\u00A1-\u00A7\u00A9\u00AB\u00AC\u00AE\u00B0-\u00B1\u00B6\u00BB\u00BF\u00D7\u00F7\u2016-\u2017\u2020-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u23FF\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3030]/,operatorend:/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE00-\uFE0F\uFE20-\uFE2F\uE0100-\uE01EF]/,operators:/(@operatorstart)((@operatorstart)|(@operatorend))*/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[{include:"@comment"},{include:"@attribute"},{include:"@literal"},{include:"@keyword"},{include:"@invokedmethod"},{include:"@symbol"}],symbol:[[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/[.]/,"delimiter"],[/@operators/,"operator"],[/@symbols/,"operator"]],comment:[[/\/\/\/.*$/,"comment.doc"],[/\/\*\*/,"comment.doc","@commentdocbody"],[/\/\/.*$/,"comment"],[/\/\*/,"comment","@commentbody"]],commentdocbody:[[/\/\*/,"comment","@commentbody"],[/\*\//,"comment.doc","@pop"],[/\:[a-zA-Z]+\:/,"comment.doc.param"],[/./,"comment.doc"]],commentbody:[[/\/\*/,"comment","@commentbody"],[/\*\//,"comment","@pop"],[/./,"comment"]],attribute:[[/\@@identifier/,{cases:{"@attributes":"keyword.control","@default":""}}]],literal:[[/"/,{token:"string.quote",next:"@stringlit"}],[/0[b]([01]_?)+/,"number.binary"],[/0[o]([0-7]_?)+/,"number.octal"],[/0[x]([0-9a-fA-F]_?)+([pP][\-+](\d_?)+)?/,"number.hex"],[/(\d_?)*\.(\d_?)+([eE][\-+]?(\d_?)+)?/,"number.float"],[/(\d_?)+/,"number"]],stringlit:[[/\\\(/,{token:"operator",next:"@interpolatedexpression"}],[/@escapes/,"string"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",next:"@pop"}],[/./,"string"]],interpolatedexpression:[[/\(/,{token:"operator",next:"@interpolatedexpression"}],[/\)/,{token:"operator",next:"@pop"}],{include:"@literal"},{include:"@keyword"},{include:"@symbol"}],keyword:[[/`/,{token:"operator",next:"@escapedkeyword"}],[/@identifier/,{cases:{"@keywords":"keyword","[A-Z][a-zA-Z0-9$]*":"type.identifier","@default":"identifier"}}]],escapedkeyword:[[/`/,{token:"operator",next:"@pop"}],[/./,"identifier"]],invokedmethod:[[/([.])(@identifier)/,{cases:{$2:["delimeter","type.identifier"],"@default":""}}]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d21f327.af36c6a9.js b/modules/gateway/src/main/resources/static/js/chunk-2d21f327.af36c6a9.js deleted file mode 100644 index 05f887590..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d21f327.af36c6a9.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d21f327"],{d995:function(e,n,t){"use strict";t.r(n),t.d(n,"conf",(function(){return r})),t.d(n,"language",(function(){return s}));var r={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{blockComment:["###","###"],lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},s={defaultToken:"",ignoreCase:!0,tokenPostfix:".coffee",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],regEx:/\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,keywords:["and","or","is","isnt","not","on","yes","@","no","off","true","false","null","this","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","if","else","switch","for","while","do","try","catch","finally","class","extends","super","undefined","then","unless","until","loop","of","by","when"],symbols:/[=>","<","<>","<=",">=","And","Or","+","-","*","/","="],identifier:/[a-zA-Z_][\w]*/,symbols:/[=><:+\-*\/%\.,]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[{include:"@whitespace"},[/(@identifier)(?=[.])/,"type"],[/@identifier/,{cases:{"@keywords":{token:"keyword.$0"},"@operators":"operator","@default":"variable.name"}}],[/([.])(@identifier)/,{cases:{$2:["delimiter","type.member"],"@default":""}}],[/\d*\.\d+/,"number.float"],[/\d+/,"number"],[/[()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":"delimiter"}}],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"]],whitespace:[[/[ \t\r\n]+/,""],[/(\').*$/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"C?/,"string","@pop"]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d221a34.d1d0e8c6.js b/modules/gateway/src/main/resources/static/js/chunk-2d221a34.d1d0e8c6.js deleted file mode 100644 index 17b256426..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d221a34.d1d0e8c6.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d221a34"],{cacc:function(e,n,t){"use strict";t.r(n),t.d(n,"conf",(function(){return s})),t.d(n,"language",(function(){return o}));var s={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)"),end:new RegExp("^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)")}}},o={defaultToken:"",tokenPostfix:".fs",keywords:["abstract","and","atomic","as","assert","asr","base","begin","break","checked","component","const","constraint","constructor","continue","class","default","delegate","do","done","downcast","downto","elif","else","end","exception","eager","event","external","extern","false","finally","for","fun","function","fixed","functor","global","if","in","include","inherit","inline","interface","internal","land","lor","lsl","lsr","lxor","lazy","let","match","member","mod","module","mutable","namespace","method","mixin","new","not","null","of","open","or","object","override","private","parallel","process","protected","pure","public","rec","return","static","sealed","struct","sig","then","to","true","tailcall","trait","try","type","upcast","use","val","void","virtual","volatile","when","while","with","yield"],symbols:/[=>\]/,"annotation"],[/^#(if|else|endif)/,"keyword"],[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0x[0-9a-fA-F]+LF/,"number.float"],[/0x[0-9a-fA-F]+(@integersuffix)/,"number.hex"],[/0b[0-1]+(@integersuffix)/,"number.bin"],[/\d+(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"""/,"string",'@string."""'],[/"/,"string",'@string."'],[/\@"/,{token:"string.quote",next:"@litstring"}],[/'[^\\']'B?/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\(\*(?!\))/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\*]+/,"comment"],[/\*\)/,"comment","@pop"],[/\*/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/("""|"B?)/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d22502a.0c26a2a1.js b/modules/gateway/src/main/resources/static/js/chunk-2d22502a.0c26a2a1.js deleted file mode 100644 index 7aa3996af..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d22502a.0c26a2a1.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d22502a"],{e328:function(e,t,n){"use strict";n.r(t),n.d(t,"setupTypeScript",(function(){return C})),n.d(t,"setupJavaScript",(function(){return P})),n.d(t,"getJavaScriptWorker",(function(){return x})),n.d(t,"getTypeScriptWorker",(function(){return O}));var r,o=function(){function e(e,t){var n=this;this._modeId=e,this._defaults=t,this._worker=null,this._idleCheckInterval=setInterval((function(){return n._checkIfIdle()}),3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange((function(){return n._stopWorker()}))}return e.prototype._stopWorker=function(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null},e.prototype.dispose=function(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()},e.prototype._checkIfIdle=function(){if(this._worker){var e=this._defaults.getWorkerMaxIdleTime(),t=Date.now()-this._lastUsedTime;e>0&&t>e&&this._stopWorker()}},e.prototype._getClient=function(){var e=this;if(this._lastUsedTime=Date.now(),!this._client){this._worker=monaco.editor.createWebWorker({moduleId:"vs/language/typescript/tsWorker",label:this._modeId,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs()}});var t=this._worker.getProxy();this._defaults.getEagerModelSync()&&(t=t.then((function(t){return e._worker.withSyncedResources(monaco.editor.getModels().filter((function(t){return t.getModeId()===e._modeId})).map((function(e){return e.uri})))}))),this._client=t}return this._client},e.prototype.getLanguageServiceWorker=function(){for(var e,t=this,n=[],r=0;r0)for(var s=0,u=o.childItems;sy&&this._stopWorker()}},e.prototype._getClient=function(){return this._lastUsedTime=Date.now(),this._client||(this._worker=monaco.editor.createWebWorker({moduleId:"vs/language/css/cssWorker",label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client},e.prototype.getLanguageServiceWorker=function(){for(var e,n=this,t=[],r=0;r0&&(i.arguments=t),i}function t(e){var n=e;return $.defined(n)&&$.string(n.title)&&$.string(n.command)}e.create=n,e.is=t}(h||(h={})),function(e){function n(e,n){return{range:e,newText:n}}function t(e,n){return{range:{start:e,end:e},newText:n}}function r(e){return{range:e,newText:""}}function o(e){var n=e;return $.objectLiteral(n)&&$.string(n.newText)&&i.is(n.range)}e.replace=n,e.insert=t,e.del=r,e.is=o}(p||(p={})),function(e){function n(e,n){return{textDocument:e,edits:n}}function t(e){var n=e;return $.defined(n)&&w.is(n.textDocument)&&Array.isArray(n.edits)}e.create=n,e.is=t}(m||(m={})),function(e){function n(e){var n=e;return n&&(void 0!==n.changes||void 0!==n.documentChanges)&&(void 0===n.documentChanges||$.typedArray(n.documentChanges,m.is))}e.is=n}(v||(v={}));var _,w,k,x,C,E,I,T,S,M,P,R,A,D,F,O,L,j=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,n){this.edits.push(p.insert(e,n))},e.prototype.replace=function(e,n){this.edits.push(p.replace(e,n))},e.prototype.delete=function(e){this.edits.push(p.del(e))},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}();(function(){function e(e){var n=this;this._textEditChanges=Object.create(null),e&&(this._workspaceEdit=e,e.documentChanges?e.documentChanges.forEach((function(e){var t=new j(e.edits);n._textEditChanges[e.textDocument.uri]=t})):e.changes&&Object.keys(e.changes).forEach((function(t){var r=new j(e.changes[t]);n._textEditChanges[t]=r})))}Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(w.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for versioned document changes.");var n=e,t=this._textEditChanges[n.uri];if(!t){var r=[],i={textDocument:n,edits:r};this._workspaceEdit.documentChanges.push(i),t=new j(r),this._textEditChanges[n.uri]=t}return t}if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");t=this._textEditChanges[e];if(!t){r=[];this._workspaceEdit.changes[e]=r,t=new j(r),this._textEditChanges[e]=t}return t}})();(function(e){function n(e){return{uri:e}}function t(e){var n=e;return $.defined(n)&&$.string(n.uri)}e.create=n,e.is=t})(_||(_={})),function(e){function n(e,n){return{uri:e,version:n}}function t(e){var n=e;return $.defined(n)&&$.string(n.uri)&&$.number(n.version)}e.create=n,e.is=t}(w||(w={})),function(e){function n(e,n,t,r){return{uri:e,languageId:n,version:t,text:r}}function t(e){var n=e;return $.defined(n)&&$.string(n.uri)&&$.string(n.languageId)&&$.number(n.version)&&$.string(n.text)}e.create=n,e.is=t}(k||(k={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(x||(x={})),function(e){function n(n){var t=n;return t===e.PlainText||t===e.Markdown}e.is=n}(x||(x={})),function(e){function n(e){var n=e;return $.objectLiteral(e)&&x.is(n.kind)&&$.string(n.value)}e.is=n}(C||(C={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(E||(E={})),function(e){e.PlainText=1,e.Snippet=2}(I||(I={})),function(e){function n(e){return{label:e}}e.create=n}(T||(T={})),function(e){function n(e,n){return{items:e||[],isIncomplete:!!n}}e.create=n}(S||(S={})),function(e){function n(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function t(e){var n=e;return $.string(n)||$.objectLiteral(n)&&$.string(n.language)&&$.string(n.value)}e.fromPlainText=n,e.is=t}(M||(M={})),function(e){function n(e){var n=e;return $.objectLiteral(n)&&(C.is(n.contents)||M.is(n.contents)||$.typedArray(n.contents,M.is))&&(void 0===e.range||i.is(e.range))}e.is=n}(P||(P={})),function(e){function n(e,n){return n?{label:e,documentation:n}:{label:e}}e.create=n}(R||(R={})),function(e){function n(e,n){for(var t=[],r=2;r=0;a--){var u=r[a],c=e.offsetAt(u.range.start),s=e.offsetAt(u.range.end);if(!(s<=o))throw new Error("Ovelapping edit");t=t.substring(0,c)+u.newText+t.substring(s,t.length),o=c}return t}function i(e,n){if(e.length<=1)return e;var t=e.length/2|0,r=e.slice(0,t),o=e.slice(t);i(r,n),i(o,n);var a=0,u=0,c=0;while(a0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var n=this.getLineOffsets(),t=0,i=n.length;if(0===i)return r.create(0,e);while(te?i=o:t=o+1}var a=t-1;return r.create(a,e-n[a])},e.prototype.offsetAt=function(e){var n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;var t=n[e.line],r=e.line+1"],builtins:["require","public","private","include","extend","attr_reader","protected","private_class_method","protected_class_method","new"],declarations:["module","class","def","case","do","begin","for","if","while","until","unless"],linedecls:["def","case","do","begin","for","if","while","until","unless"],operators:["^","&","|","<=>","==","===","!~","=~",">",">=","<","<=","<<",">>","+","-","*","/","%","**","~","+@","-@","[]","[]=","`","+=","-=","*=","**=","/=","^=","%=","<<=",">>=","&=","&&=","||=","|="],brackets:[{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"}],symbols:/[=>"}],[/%([qws])(@delim)/,{token:"string.$1.delim",switchTo:"@qstring.$1.$2.$2"}],[/%r\(/,{token:"regexp.delim",switchTo:"@pregexp.(.)"}],[/%r\[/,{token:"regexp.delim",switchTo:"@pregexp.[.]"}],[/%r\{/,{token:"regexp.delim",switchTo:"@pregexp.{.}"}],[/%r"}],[/%r(@delim)/,{token:"regexp.delim",switchTo:"@pregexp.$1.$1"}],[/%(x|W|Q?)\(/,{token:"string.$1.delim",switchTo:"@qqstring.$1.(.)"}],[/%(x|W|Q?)\[/,{token:"string.$1.delim",switchTo:"@qqstring.$1.[.]"}],[/%(x|W|Q?)\{/,{token:"string.$1.delim",switchTo:"@qqstring.$1.{.}"}],[/%(x|W|Q?)"}],[/%(x|W|Q?)(@delim)/,{token:"string.$1.delim",switchTo:"@qqstring.$1.$2.$2"}],[/%([rqwsxW]|Q?)./,{token:"invalid",next:"@pop"}],[/./,{token:"invalid",next:"@pop"}]],qstring:[[/\\$/,"string.$S2.escape"],[/\\./,"string.$S2.escape"],[/./,{cases:{"$#==$S4":{token:"string.$S2.delim",next:"@pop"},"$#==$S3":{token:"string.$S2.delim",next:"@push"},"@default":"string.$S2"}}]],qqstring:[[/#/,"string.$S2.escape","@interpolated"],{include:"@qstring"}],whitespace:[[/[ \t\r\n]+/,""],[/^\s*=begin\b/,"comment","@comment"],[/#.*$/,"comment"]],comment:[[/[^=]+/,"comment"],[/^\s*=begin\b/,"comment.invalid"],[/^\s*=end\b.*/,"comment","@pop"],[/[=]/,"comment"]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d22c171.6ca6fdd3.js b/modules/gateway/src/main/resources/static/js/chunk-2d22c171.6ca6fdd3.js deleted file mode 100644 index 014790bd9..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d22c171.6ca6fdd3.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d22c171"],{f26e:function(E,T,A){"use strict";A.r(T),A.d(T,"conf",(function(){return N})),A.d(T,"language",(function(){return R}));var N={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["[","]"],["(",")"],["{","}"]],autoClosingPairs:[{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:"{",close:"}",notIn:["string","comment"]}]},R={defaultToken:"",tokenPostfix:".msdax",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"{",close:"}",token:"delimiter.brackets"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["VAR","RETURN","NOT","EVALUATE","DATATABLE","ORDER","BY","START","AT","DEFINE","MEASURE","ASC","DESC","IN","BOOLEAN","DOUBLE","INTEGER","DATETIME","CURRENCY","STRING"],functions:["CLOSINGBALANCEMONTH","CLOSINGBALANCEQUARTER","CLOSINGBALANCEYEAR","DATEADD","DATESBETWEEN","DATESINPERIOD","DATESMTD","DATESQTD","DATESYTD","ENDOFMONTH","ENDOFQUARTER","ENDOFYEAR","FIRSTDATE","FIRSTNONBLANK","LASTDATE","LASTNONBLANK","NEXTDAY","NEXTMONTH","NEXTQUARTER","NEXTYEAR","OPENINGBALANCEMONTH","OPENINGBALANCEQUARTER","OPENINGBALANCEYEAR","PARALLELPERIOD","PREVIOUSDAY","PREVIOUSMONTH","PREVIOUSQUARTER","PREVIOUSYEAR","SAMEPERIODLASTYEAR","STARTOFMONTH","STARTOFQUARTER","STARTOFYEAR","TOTALMTD","TOTALQTD","TOTALYTD","ADDCOLUMNS","ADDMISSINGITEMS","ALL","ALLEXCEPT","ALLNOBLANKROW","ALLSELECTED","CALCULATE","CALCULATETABLE","CALENDAR","CALENDARAUTO","CROSSFILTER","CROSSJOIN","CURRENTGROUP","DATATABLE","DETAILROWS","DISTINCT","EARLIER","EARLIEST","EXCEPT","FILTER","FILTERS","GENERATE","GENERATEALL","GROUPBY","IGNORE","INTERSECT","ISONORAFTER","KEEPFILTERS","LOOKUPVALUE","NATURALINNERJOIN","NATURALLEFTOUTERJOIN","RELATED","RELATEDTABLE","ROLLUP","ROLLUPADDISSUBTOTAL","ROLLUPGROUP","ROLLUPISSUBTOTAL","ROW","SAMPLE","SELECTCOLUMNS","SUBSTITUTEWITHINDEX","SUMMARIZE","SUMMARIZECOLUMNS","TOPN","TREATAS","UNION","USERELATIONSHIP","VALUES","SUM","SUMX","PATH","PATHCONTAINS","PATHITEM","PATHITEMREVERSE","PATHLENGTH","AVERAGE","AVERAGEA","AVERAGEX","COUNT","COUNTA","COUNTAX","COUNTBLANK","COUNTROWS","COUNTX","DISTINCTCOUNT","DIVIDE","GEOMEAN","GEOMEANX","MAX","MAXA","MAXX","MEDIAN","MEDIANX","MIN","MINA","MINX","PERCENTILE.EXC","PERCENTILE.INC","PERCENTILEX.EXC","PERCENTILEX.INC","PRODUCT","PRODUCTX","RANK.EQ","RANKX","STDEV.P","STDEV.S","STDEVX.P","STDEVX.S","VAR.P","VAR.S","VARX.P","VARX.S","XIRR","XNPV","DATE","DATEDIFF","DATEVALUE","DAY","EDATE","EOMONTH","HOUR","MINUTE","MONTH","NOW","SECOND","TIME","TIMEVALUE","TODAY","WEEKDAY","WEEKNUM","YEAR","YEARFRAC","CONTAINS","CONTAINSROW","CUSTOMDATA","ERROR","HASONEFILTER","HASONEVALUE","ISBLANK","ISCROSSFILTERED","ISEMPTY","ISERROR","ISEVEN","ISFILTERED","ISLOGICAL","ISNONTEXT","ISNUMBER","ISODD","ISSUBTOTAL","ISTEXT","USERNAME","USERPRINCIPALNAME","AND","FALSE","IF","IFERROR","NOT","OR","SWITCH","TRUE","ABS","ACOS","ACOSH","ACOT","ACOTH","ASIN","ASINH","ATAN","ATANH","BETA.DIST","BETA.INV","CEILING","CHISQ.DIST","CHISQ.DIST.RT","CHISQ.INV","CHISQ.INV.RT","COMBIN","COMBINA","CONFIDENCE.NORM","CONFIDENCE.T","COS","COSH","COT","COTH","CURRENCY","DEGREES","EVEN","EXP","EXPON.DIST","FACT","FLOOR","GCD","INT","ISO.CEILING","LCM","LN","LOG","LOG10","MOD","MROUND","ODD","PERMUT","PI","POISSON.DIST","POWER","QUOTIENT","RADIANS","RAND","RANDBETWEEN","ROUND","ROUNDDOWN","ROUNDUP","SIGN","SIN","SINH","SQRT","SQRTPI","TAN","TANH","TRUNC","BLANK","CONCATENATE","CONCATENATEX","EXACT","FIND","FIXED","FORMAT","LEFT","LEN","LOWER","MID","REPLACE","REPT","RIGHT","SEARCH","SUBSTITUTE","TRIM","UNICHAR","UNICODE","UPPER","VALUE"],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},[/[;,.]/,"delimiter"],[/[({})]/,"@brackets"],[/[a-z_][a-zA-Z0-9_]*/,{cases:{"@keywords":"keyword","@functions":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/\/\/+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N"/,{token:"string",next:"@string"}],[/"/,{token:"string",next:"@string"}]],string:[[/[^"]+/,"string"],[/""/,"string"],[/"/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/\[/,{token:"identifier.quote",next:"@bracketedIdentifier"}],[/'/,{token:"identifier.quote",next:"@quotedIdentifier"}]],bracketedIdentifier:[[/[^\]]+/,"identifier"],[/]]/,"identifier"],[/]/,{token:"identifier.quote",next:"@pop"}]],quotedIdentifier:[[/[^']+/,"identifier"],[/''/,"identifier"],[/'/,{token:"identifier.quote",next:"@pop"}]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d22c2b8.9bf1de8d.js b/modules/gateway/src/main/resources/static/js/chunk-2d22c2b8.9bf1de8d.js deleted file mode 100644 index a83ec4aca..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d22c2b8.9bf1de8d.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d22c2b8"],{f1a8:function(e,n,t){"use strict";t.r(n),t.d(n,"conf",(function(){return r})),t.d(n,"language",(function(){return o}));var s="undefined"===typeof monaco?self.monaco:monaco,r={comments:{lineComment:"#",blockComment:["'''","'''"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp("^\\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\\s*$"),action:{indentAction:s.languages.IndentAction.Indent}}],folding:{offSide:!0,markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},o={defaultToken:"",tokenPostfix:".python",keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","print","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"}],tokenizer:{root:[{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},[/[,:;]/,"delimiter"],[/[{}\[\]()]/,"@brackets"],[/@[a-zA-Z]\w*/,"tag"],[/[a-zA-Z]\w*/,{cases:{"@keywords":"keyword","@default":"identifier"}}]],whitespace:[[/\s+/,"white"],[/(^#.*$)/,"comment"],[/'''/,"string","@endDocString"],[/"""/,"string","@endDblDocString"]],endDocString:[[/[^']+/,"string"],[/\\'/,"string"],[/'''/,"string","@popall"],[/'/,"string"]],endDblDocString:[[/[^"]+/,"string"],[/\\"/,"string"],[/"""/,"string","@popall"],[/"/,"string"]],numbers:[[/-?0x([abcdef]|[ABCDEF]|\d)+[lL]?/,"number.hex"],[/-?(\d*\.)?\d+([eE][+\-]?\d+)?[jJ]?[lL]?/,"number"]],strings:[[/'$/,"string.escape","@popall"],[/'/,"string.escape","@stringBody"],[/"$/,"string.escape","@popall"],[/"/,"string.escape","@dblStringBody"]],stringBody:[[/[^\\']+$/,"string","@popall"],[/[^\\']+/,"string"],[/\\./,"string"],[/'/,"string.escape","@popall"],[/\\$/,"string"]],dblStringBody:[[/[^\\"]+$/,"string","@popall"],[/[^\\"]+/,"string"],[/\\./,"string"],[/"/,"string.escape","@popall"],[/\\$/,"string"]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d22ca58.8d07bad6.js b/modules/gateway/src/main/resources/static/js/chunk-2d22ca58.8d07bad6.js deleted file mode 100644 index 9283942e5..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d22ca58.8d07bad6.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d22ca58"],{f3b7:function(e,n,t){"use strict";t.r(n),t.d(n,"conf",(function(){return r})),t.d(n,"language",(function(){return i}));var o="undefined"===typeof monaco?self.monaco:monaco,r={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:o.languages.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:o.languages.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:o.languages.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:o.languages.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}}},i={defaultToken:"invalid",tokenPostfix:".ts",keywords:["abstract","as","break","case","catch","class","continue","const","constructor","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","infer","instanceof","interface","is","keyof","let","module","namespace","never","new","null","package","private","protected","public","readonly","require","global","return","set","static","super","switch","symbol","this","throw","true","try","type","typeof","unique","var","void","while","with","yield","async","await","of"],typeKeywords:["any","boolean","number","object","string","undefined"],operators:["<=",">=","==","!=","===","!==","=>","+","-","**","*","/","%","++","--","<<",">",">>>","&","|","^","!","~","&&","||","?",":","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=","@"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)/,"number.hex"],[/0[oO]?(@octaldigits)/,"number.octal"],[/0[bB](@binarydigits)/,"number.binary"],[/(@digits)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"],[/`/,"string","@string_backtick"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([gimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,"@brackets.regexp.escape.control","@pop"]],string_double:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],string_single:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],string_backtick:[[/\$\{/,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/`/,"string","@pop"]],bracketCounting:[[/\{/,"delimiter.bracket","@bracketCounting"],[/\}/,"delimiter.bracket","@pop"],{include:"common"}]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d2311f7.056433b8.js b/modules/gateway/src/main/resources/static/js/chunk-2d2311f7.056433b8.js deleted file mode 100644 index 7249f6991..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d2311f7.056433b8.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d2311f7"],{eecd:function(e,s,o){"use strict";o.r(s),o.d(s,"conf",(function(){return t})),o.d(s,"language",(function(){return n}));var t={comments:{lineComment:"REM"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|REM\\s+)#region"),end:new RegExp("^\\s*(::\\s*|REM\\s+)#endregion")}}},n={defaultToken:"",ignoreCase:!0,tokenPostfix:".bat",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:/call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,symbols:/[=>b&&this._stopWorker()}},e.prototype._getClient=function(){return this._lastUsedTime=Date.now(),this._client||(this._worker=monaco.editor.createWebWorker({moduleId:"vs/language/html/htmlWorker",createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._client=this._worker.getProxy()),this._client},e.prototype.getLanguageServiceWorker=function(){for(var e,t=this,n=[],r=0;r0&&(i.arguments=n),i}function n(e){var t=e;return B.defined(t)&&B.string(t.title)&&B.string(t.command)}e.create=t,e.is=n}(h||(h={})),function(e){function t(e,t){return{range:e,newText:t}}function n(e,t){return{range:{start:e,end:e},newText:t}}function r(e){return{range:e,newText:""}}function o(e){var t=e;return B.objectLiteral(t)&&B.string(t.newText)&&i.is(t.range)}e.replace=t,e.insert=n,e.del=r,e.is=o}(p||(p={})),function(e){function t(e,t){return{textDocument:e,edits:t}}function n(e){var t=e;return B.defined(t)&&k.is(t.textDocument)&&Array.isArray(t.edits)}e.create=t,e.is=n}(m||(m={})),function(e){function t(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||B.typedArray(t.documentChanges,m.is))}e.is=t}(v||(v={}));var y,k,w,x,C,E,I,T,S,M,R,P,A,F,L,O,j,D=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,t){this.edits.push(p.insert(e,t))},e.prototype.replace=function(e,t){this.edits.push(p.replace(e,t))},e.prototype.delete=function(e){this.edits.push(p.del(e))},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}();(function(){function e(e){var t=this;this._textEditChanges=Object.create(null),e&&(this._workspaceEdit=e,e.documentChanges?e.documentChanges.forEach((function(e){var n=new D(e.edits);t._textEditChanges[e.textDocument.uri]=n})):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new D(e.changes[n]);t._textEditChanges[n]=r})))}Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(k.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for versioned document changes.");var t=e,n=this._textEditChanges[t.uri];if(!n){var r=[],i={textDocument:t,edits:r};this._workspaceEdit.documentChanges.push(i),n=new D(r),this._textEditChanges[t.uri]=n}return n}if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");n=this._textEditChanges[e];if(!n){r=[];this._workspaceEdit.changes[e]=r,n=new D(r),this._textEditChanges[e]=n}return n}})();(function(e){function t(e){return{uri:e}}function n(e){var t=e;return B.defined(t)&&B.string(t.uri)}e.create=t,e.is=n})(y||(y={})),function(e){function t(e,t){return{uri:e,version:t}}function n(e){var t=e;return B.defined(t)&&B.string(t.uri)&&B.number(t.version)}e.create=t,e.is=n}(k||(k={})),function(e){function t(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}}function n(e){var t=e;return B.defined(t)&&B.string(t.uri)&&B.string(t.languageId)&&B.number(t.version)&&B.string(t.text)}e.create=t,e.is=n}(w||(w={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(x||(x={})),function(e){function t(t){var n=t;return n===e.PlainText||n===e.Markdown}e.is=t}(x||(x={})),function(e){function t(e){var t=e;return B.objectLiteral(e)&&x.is(t.kind)&&B.string(t.value)}e.is=t}(C||(C={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(E||(E={})),function(e){e.PlainText=1,e.Snippet=2}(I||(I={})),function(e){function t(e){return{label:e}}e.create=t}(T||(T={})),function(e){function t(e,t){return{items:e||[],isIncomplete:!!t}}e.create=t}(S||(S={})),function(e){function t(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function n(e){var t=e;return B.string(t)||B.objectLiteral(t)&&B.string(t.language)&&B.string(t.value)}e.fromPlainText=t,e.is=n}(M||(M={})),function(e){function t(e){var t=e;return B.objectLiteral(t)&&(C.is(t.contents)||M.is(t.contents)||B.typedArray(t.contents,M.is))&&(void 0===e.range||i.is(e.range))}e.is=t}(R||(R={})),function(e){function t(e,t){return t?{label:e,documentation:t}:{label:e}}e.create=t}(P||(P={})),function(e){function t(e,t){for(var n=[],r=2;r=0;a--){var u=r[a],s=e.offsetAt(u.range.start),c=e.offsetAt(u.range.end);if(!(c<=o))throw new Error("Ovelapping edit");n=n.substring(0,s)+u.newText+n.substring(c,n.length),o=s}return n}function i(e,t){if(e.length<=1)return e;var n=e.length/2|0,r=e.slice(0,n),o=e.slice(n);i(r,t),i(o,t);var a=0,u=0,s=0;while(a0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,i=t.length;if(0===i)return r.create(0,e);while(ne?i=o:n=o+1}var a=n-1;return r.create(a,e-t[a])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},o={defaultToken:"",tokenPostfix:".cs",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["extern","alias","using","bool","decimal","sbyte","byte","short","ushort","int","uint","long","ulong","char","float","double","object","dynamic","string","assembly","is","as","ref","out","this","base","new","typeof","void","checked","unchecked","default","delegate","var","const","if","else","switch","case","while","do","for","foreach","in","break","continue","goto","return","throw","try","catch","finally","lock","yield","from","let","where","join","on","equals","into","orderby","ascending","descending","select","group","by","namespace","partial","class","field","event","method","param","property","public","protected","internal","private","abstract","sealed","static","struct","readonly","volatile","virtual","override","params","get","set","add","remove","operator","true","false","implicit","explicit","interface","enum","null","async","await","fixed","sizeof","stackalloc","unsafe","nameof","when"],namespaceFollows:["namespace","using"],parenFollows:["if","for","while","switch","foreach","using","catch","when"],operators:["=","??","||","&&","|","^","&","==","!=","<=",">=","<<","+","-","*","/","%","!","~","++","--","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=",">>","=>"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?[fFdD]?/,"number.float"],[/0[xX][0-9a-fA-F_]+/,"number.hex"],[/0[bB][01_]+/,"number.hex"],[/[0-9_]+/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",next:"@string"}],[/\$\@"/,{token:"string.quote",next:"@litinterpstring"}],[/\@"/,{token:"string.quote",next:"@litstring"}],[/\$"/,{token:"string.quote",next:"@interpolatedstring"}],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],qualified:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/\./,"delimiter"],["","","@pop"]],namespace:[{include:"@whitespace"},[/[A-Z]\w*/,"namespace"],[/[\.=]/,"delimiter"],["","","@pop"]],comment:[[/[^\/*]+/,"comment"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",next:"@pop"}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]],litinterpstring:[[/[^"{]+/,"string"],[/""/,"string.escape"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.litinterpstring"}],[/"/,{token:"string.quote",next:"@pop"}]],interpolatedstring:[[/[^\\"{]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.interpolatedstring"}],[/"/,{token:"string.quote",next:"@pop"}]],whitespace:[[/^[ \t\v\f]*#((r)|(load))(?=\s)/,"directive.csx"],[/^[ \t\v\f]*#\w.*$/,"namespace.cpp"],[/[ \t\v\f\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-2d238465.fd682e24.js b/modules/gateway/src/main/resources/static/js/chunk-2d238465.fd682e24.js deleted file mode 100644 index fd97fb152..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-2d238465.fd682e24.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-2d238465"],{ff4c:function(e,t,o){"use strict";o.r(t),o.d(t,"conf",(function(){return n})),o.d(t,"language",(function(){return s}));var n={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#pragma\\s+region\\b"),end:new RegExp("^\\s*#pragma\\s+endregion\\b")}}},s={tokenPostfix:".rust",defaultToken:"invalid",keywords:["as","box","break","const","continue","crate","else","enum","extern","false","fn","for","if","impl","in","let","loop","match","mod","move","mut","pub","ref","return","self","static","struct","super","trait","true","type","unsafe","use","where","while","catch","default","union","static","abstract","alignof","become","do","final","macro","offsetof","override","priv","proc","pure","sizeof","typeof","unsized","virtual","yield"],typeKeywords:["Self","m32","m64","m128","f80","f16","f128","int","uint","float","char","bool","u8","u16","u32","u64","f32","f64","i8","i16","i32","i64","str","Option","Either","c_float","c_double","c_void","FILE","fpos_t","DIR","dirent","c_char","c_schar","c_uchar","c_short","c_ushort","c_int","c_uint","c_long","c_ulong","size_t","ptrdiff_t","clock_t","time_t","c_longlong","c_ulonglong","intptr_t","uintptr_t","off_t","dev_t","ino_t","pid_t","mode_t","ssize_t"],constants:["true","false","Some","None","Left","Right","Ok","Err"],supportConstants:["EXIT_FAILURE","EXIT_SUCCESS","RAND_MAX","EOF","SEEK_SET","SEEK_CUR","SEEK_END","_IOFBF","_IONBF","_IOLBF","BUFSIZ","FOPEN_MAX","FILENAME_MAX","L_tmpnam","TMP_MAX","O_RDONLY","O_WRONLY","O_RDWR","O_APPEND","O_CREAT","O_EXCL","O_TRUNC","S_IFIFO","S_IFCHR","S_IFBLK","S_IFDIR","S_IFREG","S_IFMT","S_IEXEC","S_IWRITE","S_IREAD","S_IRWXU","S_IXUSR","S_IWUSR","S_IRUSR","F_OK","R_OK","W_OK","X_OK","STDIN_FILENO","STDOUT_FILENO","STDERR_FILENO"],supportMacros:["format!","print!","println!","panic!","format_args!","unreachable!","write!","writeln!"],operators:["!","!=","%","%=","&","&=","&&","*","*=","+","+=","-","-=","->",".","..","...","/","/=",":",";","<<","<<=","<","<=","=","==","=>",">",">=",">>",">>=","@","^","^=","|","|=","||","_","?","#"],escapes:/\\([nrt0\"''\\]|x\h{2}|u\{\h{1,6}\})/,delimiters:/[,]/,symbols:/[\#\!\%\&\*\+\-\.\/\:\;\<\=\>\@\^\|_\?]+/,intSuffixes:/[iu](8|16|32|64|128|size)/,floatSuffixes:/f(32|64)/,tokenizer:{root:[[/[a-zA-Z][a-zA-Z0-9_]*!?|_[a-zA-Z0-9_]+/,{cases:{"@typeKeywords":"keyword.type","@keywords":"keyword","@supportConstants":"keyword","@supportMacros":"keyword","@constants":"keyword","@default":"identifier"}}],[/\$/,"identifier"],[/'[a-zA-Z_][a-zA-Z0-9_]*(?=[^\'])/,"identifier"],[/'\S'/,"string.byteliteral"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],{include:"@numbers"},{include:"@whitespace"},[/@delimiters/,{cases:{"@keywords":"keyword","@default":"delimiter"}}],[/[{}()\[\]<>]/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\/\*/,"comment","@push"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],numbers:[[/(0o[0-7_]+)(@intSuffixes)?/,{token:"number"}],[/(0b[0-1_]+)(@intSuffixes)?/,{token:"number"}],[/[\d][\d_]*(\.[\d][\d_]*)?[eE][+-][\d_]+(@floatSuffixes)?/,{token:"number"}],[/\b(\d\.?[\d_]*)(@floatSuffixes)?\b/,{token:"number"}],[/(0x[\da-fA-F]+)_?(@intSuffixes)?/,{token:"number"}],[/[\d][\d_]*(@intSuffixes?)?/,{token:"number"}]]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-7532b3ea.370d2b0e.js b/modules/gateway/src/main/resources/static/js/chunk-7532b3ea.370d2b0e.js deleted file mode 100644 index 0315b1d40..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-7532b3ea.370d2b0e.js +++ /dev/null @@ -1 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-7532b3ea","chunk-2d22ca58"],{ed79:function(e,n,t){"use strict";t.r(n),t.d(n,"conf",(function(){return i})),t.d(n,"language",(function(){return r}));var o=t("f3b7"),i=("undefined"===typeof monaco?self.monaco:monaco,o["conf"]),r={defaultToken:"invalid",tokenPostfix:".js",keywords:["break","case","catch","class","continue","const","constructor","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","get","if","import","in","instanceof","let","new","null","return","set","super","switch","symbol","this","throw","true","try","typeof","undefined","var","void","while","with","yield","async","await","of"],typeKeywords:[],operators:o["language"].operators,symbols:o["language"].symbols,escapes:o["language"].escapes,digits:o["language"].digits,octaldigits:o["language"].octaldigits,binarydigits:o["language"].binarydigits,hexdigits:o["language"].hexdigits,regexpctl:o["language"].regexpctl,regexpesc:o["language"].regexpesc,tokenizer:o["language"].tokenizer}},f3b7:function(e,n,t){"use strict";t.r(n),t.d(n,"conf",(function(){return i})),t.d(n,"language",(function(){return r}));var o="undefined"===typeof monaco?self.monaco:monaco,i={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:o.languages.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:o.languages.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:o.languages.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:o.languages.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}}},r={defaultToken:"invalid",tokenPostfix:".ts",keywords:["abstract","as","break","case","catch","class","continue","const","constructor","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","infer","instanceof","interface","is","keyof","let","module","namespace","never","new","null","package","private","protected","public","readonly","require","global","return","set","static","super","switch","symbol","this","throw","true","try","type","typeof","unique","var","void","while","with","yield","async","await","of"],typeKeywords:["any","boolean","number","object","string","undefined"],operators:["<=",">=","==","!=","===","!==","=>","+","-","**","*","/","%","++","--","<<",">",">>>","&","|","^","!","~","&&","||","?",":","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=","@"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)/,"number.hex"],[/0[oO]?(@octaldigits)/,"number.octal"],[/0[bB](@binarydigits)/,"number.binary"],[/(@digits)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"],[/`/,"string","@string_backtick"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([gimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,"@brackets.regexp.escape.control","@pop"]],string_double:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],string_single:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],string_backtick:[[/\$\{/,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/`/,"string","@pop"]],bracketCounting:[[/\{/,"delimiter.bracket","@bracketCounting"],[/\}/,"delimiter.bracket","@pop"],{include:"common"}]}}}}]); \ No newline at end of file diff --git a/modules/gateway/src/main/resources/static/js/chunk-vendors.33c21af8.js b/modules/gateway/src/main/resources/static/js/chunk-vendors.33c21af8.js deleted file mode 100644 index 6d1b95e5c..000000000 --- a/modules/gateway/src/main/resources/static/js/chunk-vendors.33c21af8.js +++ /dev/null @@ -1,27 +0,0 @@ -(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["chunk-vendors"],{"0055":function(e,t){},"0144":function(e,t,n){var i=n("a995");t.f=i},"015f":function(e,t,n){var i=n("642b"),o=n("6199"),r=i.document,s=o(r)&&o(r.createElement);e.exports=function(e){return s?r.createElement(e):{}}},"0182":function(e,t,n){"use strict";var i=n("b0d9"),o=n("2b1b"),r=n("0e6b"),s=n("bef9"),a=n("503c"),u=n("caad"),l=n("0a7c"),c=function(e,t){var n=this;if(!(n instanceof c))return new c(e,t);r&&(n=r(new Error(void 0),o(n))),void 0!==t&&a(n,"message",String(t));var i=[];return l(e,i.push,{that:i}),a(n,"errors",i),n};c.prototype=s(Error.prototype,{constructor:u(5,c),message:u(5,""),name:u(5,"AggregateError")}),i({global:!0},{AggregateError:c})},"01b0":function(e,t,n){},"0217":function(e,t,n){var i=n("7fb9"),o=n("f052");e.exports=Object.keys||function(e){return i(e,o)}},"0277":function(e,t,n){var i=n("642b");e.exports=i.Promise},"02b9":function(e,t,n){var i=n("5e14"),o=Array.prototype;e.exports=function(e){var t=e.map;return e===o||e instanceof Array&&t===o.map?i:t}},"02f5":function(e,t,n){var i=n("60a9");e.exports=i},"040d":function(e,t,n){var i=n("8870"),o=Math.max,r=Math.min;e.exports=function(e,t){var n=i(e);return n<0?o(n+t,0):r(n,t)}},"044b":function(e,t){function n(e){return!!e.constructor&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function i(e){return"function"===typeof e.readFloatLE&&"function"===typeof e.slice&&n(e.slice(0,0))} -/*! - * Determine if an object is a Buffer - * - * @author Feross Aboukhadijeh - * @license MIT - */ -e.exports=function(e){return null!=e&&(n(e)||i(e)||!!e._isBuffer)}},"0503":function(e,t,n){var i=n("e99a");e.exports=i},"05a6":function(e,t,n){var i=n("a287");e.exports=i},"062d":function(e,t,n){var i=n("0739"),o=n("3793"),r=n("a995"),s=r("toStringTag"),a="Arguments"==o(function(){return arguments}()),u=function(e,t){try{return e[t]}catch(n){}};e.exports=i?o:function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=u(t=Object(e),s))?n:a?o(t):"Object"==(i=o(t))&&"function"==typeof t.callee?"Arguments":i}},"0632":function(e,t,n){},"0686":function(e,t,n){var i=n("f948"),o=n("295b");(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.8.2",mode:i?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},"06cb":function(e,t,n){var i=n("a995"),o=i("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[o]=!1,"/./"[e](t)}catch(i){}}return!1}},"0707":function(e,t,n){var i=n("68d5");e.exports=i},"0739":function(e,t,n){var i=n("a995"),o=i("toStringTag"),r={};r[o]="z",e.exports="[object z]"===String(r)},"0829":function(e,t,n){},"0876":function(e,t,n){},"0a06":function(e,t,n){"use strict";var i=n("2444"),o=n("c532"),r=n("f6b4"),s=n("5270"),a=n("d925"),u=n("e683");function l(e){this.defaults=e,this.interceptors={request:new r,response:new r}}l.prototype.request=function(e){"string"===typeof e&&(e=o.merge({url:arguments[0]},arguments[1])),e=o.merge(i,this.defaults,{method:"get"},e),e.method=e.method.toLowerCase(),e.baseURL&&!a(e.url)&&(e.url=u(e.baseURL,e.url));var t=[s,void 0],n=Promise.resolve(e);this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));while(t.length)n=n.then(t.shift(),t.shift());return n},o.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(o.merge(n||{},{method:e,url:t}))}})),o.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,i){return this.request(o.merge(i||{},{method:e,url:t,data:n}))}})),e.exports=l},"0a33":function(e,t,n){},"0a7c":function(e,t,n){var i=n("545b"),o=n("1cc3"),r=n("d607"),s=n("d3c1"),a=n("42f0"),u=n("e643"),l=function(e,t){this.stopped=e,this.result=t};e.exports=function(e,t,n){var c,h,d,f,p,g,m,v=n&&n.that,_=!(!n||!n.AS_ENTRIES),y=!(!n||!n.IS_ITERATOR),b=!(!n||!n.INTERRUPTED),w=s(t,v,1+_+b),C=function(e){return c&&u(c),new l(!0,e)},S=function(e){return _?(i(e),b?w(e[0],e[1],C):w(e[0],e[1])):b?w(e,C):w(e)};if(y)c=e;else{if(h=a(e),"function"!=typeof h)throw TypeError("Target is not iterable");if(o(h)){for(d=0,f=r(e.length);f>d;d++)if(p=S(e[d]),p&&p instanceof l)return p;return new l(!1)}c=h.call(e)}g=c.next;while(!(m=g.call(c)).done){try{p=S(m.value)}catch(x){throw u(c),x}if("object"==typeof p&&p&&p instanceof l)return p}return new l(!1)}},"0aea":function(e,t,n){var i=n("4f4e"),o=n("3793"),r="".split;e.exports=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?r.call(e,""):Object(e)}:Object},"0b0c":function(e,t,n){var i=n("6199");e.exports=function(e,t){if(!i(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!i(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!i(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!i(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},"0b69":function(e,t,n){var i=n("d1fd");i("observable")},"0baa":function(e,t,n){},"0bda":function(e,t,n){},"0d30":function(e,t,n){n("66a9");var i=n("16f8");e.exports=i.Object.keys},"0d30e":function(e,t,n){},"0d98":function(e,t,n){var i=n("16f8"),o=n("642b"),r=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?r(i[e])||r(o[e]):i[e]&&i[e][t]||o[e]&&o[e][t]}},"0de6":function(e,t,n){var i=n("3793"),o=n("642b");e.exports="process"==i(o.process)},"0df6":function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},"0e6b":function(e,t,n){var i=n("545b"),o=n("577c");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,e.call(n,[]),t=n instanceof Array}catch(r){}return function(n,r){return i(n),o(r),t?e.call(n,r):n.__proto__=r,n}}():void 0)},"10f4":function(e,t,n){},"10fe":function(e,t,n){"use strict";var i=n("b0d9"),o=n("fc35").find,r=n("7783"),s=n("6c2a"),a="find",u=!0,l=s(a);a in[]&&Array(1)[a]((function(){u=!1})),i({target:"Array",proto:!0,forced:u||!l},{find:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),r(a)},"133b":function(e,t,n){},1407:function(e,t,n){var i=n("d1fd");i("asyncIterator")},1428:function(e,t,n){var i=n("642b"),o=n("7248").trim,r=n("419c"),s=i.parseInt,a=/^[+-]?0[Xx]/,u=8!==s(r+"08")||22!==s(r+"0x16");e.exports=u?function(e,t){var n=o(String(e));return s(n,t>>>0||(a.test(n)?16:10))}:s},"14ad":function(e,t,n){e.exports=n("9fa7")},1500:function(e,t,n){var i=n("d1fd");i("isConcatSpreadable")},1503:function(e,t,n){var i=n("545b"),o=n("e643");e.exports=function(e,t,n,r){try{return r?t(i(n)[0],n[1]):t(n)}catch(s){throw o(e),s}}},1576:function(e,t,n){e.exports=n("6908")},"161f":function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},"16f8":function(e,t){e.exports={}},1736:function(e,t,n){(function(t,i){e.exports=i(n("a026"))})("undefined"!==typeof self&&self,(function(e){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=145)}([function(e,t){e.exports=function(e,t,n,i,o){var r,s=e=e||{},a=typeof e.default;"object"!==a&&"function"!==a||(r=e,s=e.default);var u,l="function"===typeof s?s.options:s;if(t&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns),i&&(l._scopeId=i),o?(u=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},l._ssrRegister=u):n&&(u=n),u){var c=l.functional,h=c?l.render:l.beforeCreate;c?l.render=function(e,t){return u.call(t),h(e,t)}:l.beforeCreate=h?[].concat(h,u):[u]}return{esModule:r,exports:s,options:l}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=t.debounce=void 0;var i=n(31),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.isIEVersion=d,t.getClass=f,t.hasClass=p,t.setClass=g,t.addClass=m,t.removeClass=v,t.contains=_,t.merge=y,t.extend=b,t.isNumber=w,t.isDate=C,t.isFunction=S,t.isObject=x,t.isArray=L,t.isObjectLike=k,t.isString=N,t.getPositionWhenAfterBorther=E,t.typeOf=O,t.deepCopy=D,t.findComponentUpward=I,t.findComponentDownward=M,t.getScroll=T,t.getOffset=P,t.getViewport=A,t.oneOf=R,t.hasOwn=W,t.scrollTo=V;var s="undefined"!==typeof window&&"[object Object]"!==Object.prototype.toString.call(window),a=s&&window.navigator.userAgent.toLowerCase(),u=a&&a.indexOf("msie 9.0")>0,l=Object.prototype.toString;function c(e){var t=document.createElement("b");return t.innerHTML="\x3c!--[if IE "+e+"]>9?h(e):c(e)}function f(e){var t=e.className;return"object"===("undefined"===typeof t?"undefined":(0,o.default)(t))&&(t=t.baseVal||""),t}function p(e,t){if(e){var n=f(e),i=n.split(" ");return-1!=i.indexOf(t)}}function g(e,t){u&&!/svg$/.test(e.namespaceURI)?e.className=t:e.setAttribute("class",t)}function m(e,t){if(e.classList)e.classList.add(t);else{var n=" "+f(e)+" ";n.indexOf(" "+t+" ")<0&&g(e,(n+t).trim())}}function v(e,t){if(e.classList)e.classList.remove(t);else{var n=" "+f(e)+" ",i=" "+t+" ";while(n.indexOf(i)>=0)n=n.replace(i," ");g(e,n.trim())}e.className||e.removeAttribute("class")}function _(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!n.contains(i))}function y(){var e=arguments[0];if(e)return[].forEach.call(arguments,(function(t,n){if(n>0)for(var i in t)e[i]=t[i]})),e}function b(){var e=arguments[0];if(e)return[].forEach.call(arguments,(function(t,n){if(n>0)for(var i in t)void 0!==e[i]&&(e[i]=t[i])})),e}function w(e){return"number"===typeof e}function C(e){return"[object Date]"===toString.call(e)}function S(e){return"function"===typeof e}function x(e){var t="undefined"===typeof e?"undefined":(0,o.default)(e);return!!e&&("object"==t||"function"==t)}function L(e){return Array.isArray(e)}function k(e){return!!e&&"object"===("undefined"===typeof e?"undefined":(0,o.default)(e))}function N(e){return"string"===typeof e||!L(e)&&k(e)&&"[object String]"==l.call(e)}function E(e,t,n,i,o){var r={left:0,top:0,position:null};i=i||0,o=o||0,t=t||"bottom",n=n||"left";var s=window.getComputedStyle(e,null),a=e.getBoundingClientRect(),u=a.height||a.bottom-a.top,l=a.width||a.right-a.left;switch("fixed"===s.position||"absolute"===s.position?(r.position=s.position,r.left=Number(/^([0-9]*)/.exec(s.left)[0])+i,r.top=Number(/^([0-9]*)/.exec(s.top)[0])+o):(r.position="absolute",e.offsetParent?(r.left=e.offsetLeft+i,r.top=e.offsetTop+o):(r.left=a.left+document.documentElement.scrollLeft+i,r.top=a.top+document.documentElement.scrollTop+o)),t){case"top":"left"===n||("center"===n?r.left+=l/2:"right"===n&&(r.left+=l));break;case"bottom":r.top+=u,"left"===n||("center"===n?r.left+=l/2:"right"===n&&(r.left+=l));break;case"left":"top"===n||("center"===n?r.top+=u/2:"bottom"===n&&(r.top+=u));break;case"right":r.left+=l,"top"===n||("center"===n?r.top+=u/2:"bottom"===n&&(r.top+=u));break;default:break}return r.left+="px",r.top+="px",r}function O(e){var t=Object.prototype.toString,n={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"};return n[t.call(e)]}function D(e){var t=O(e),n=void 0;if("array"===t)n=[];else{if("object"!==t)return e;n={}}if("array"===t)for(var i=0;i0?i=setTimeout(u,t-l):(i=null,n||(a=e.apply(r,o),i||(r=o=null)))};return function(){r=this,o=arguments,s=(new Date).getTime();var l=n&&!i;return i||(i=setTimeout(u,t)),l&&(a=e.apply(r,o),r=o=null),a}};function T(e,t){if("undefined"===typeof window)return 0;var n=t?"pageYOffset":"pageXOffset",i=t?"scrollTop":"scrollLeft",o=e===window,r=o?e[n]:e[i];if(o&&"number"!==typeof r){var s=window.document;r="CSS1Compat"===document.compatMode?s.documentElement[i]:s.body[i]}return r}function P(e,t){var n=e.getBoundingClientRect(),i=t===window?{top:0,left:0,bottom:window.innerHeight}:t.getBoundingClientRect(),o=e.clientTop||0,r=e.clientLeft||0,s=T(t,!0),a=T(t,!1),u=s-i.top,l=a-i.left;return{top:n.top+u-o,left:n.left+l-r,bottom:n.bottom+u-o}}function A(){return"BackCompat"==document.compatMode?{width:document.body.clientWidth,height:document.body.clientHeight}:{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}}function R(e,t){for(var n=0;n=s)return e;switch(e){case"%s":return String(t[i++]);case"%d":return Number(t[i++]);case"%j":try{return JSON.stringify(t[i++])}catch(n){return"[Circular]"}break;default:return e}})),u=t[i];i=i.F1&&t<=i.F12)return!1;switch(t){case i.ALT:case i.CAPS_LOCK:case i.CONTEXT_MENU:case i.CTRL:case i.DOWN:case i.END:case i.ESC:case i.HOME:case i.INSERT:case i.LEFT:case i.MAC_FF_META:case i.META:case i.NUMLOCK:case i.NUM_CENTER:case i.PAGE_DOWN:case i.PAGE_UP:case i.PAUSE:case i.PRINT_SCREEN:case i.RIGHT:case i.SHIFT:case i.UP:case i.WIN_KEY:case i.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=i.ZERO&&e<=i.NINE)return!0;if(e>=i.NUM_ZERO&&e<=i.NUM_MULTIPLY)return!0;if(e>=i.A&&e<=i.Z)return!0;if(-1!==window.navigation.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case i.SPACE:case i.QUESTION_MARK:case i.NUM_PLUS:case i.NUM_MINUS:case i.NUM_PERIOD:case i.NUM_DIVISION:case i.SEMICOLON:case i.DASH:case i.EQUALS:case i.COMMA:case i.PERIOD:case i.SLASH:case i.APOSTROPHE:case i.SINGLE_QUOTE:case i.OPEN_SQUARE_BRACKET:case i.BACKSLASH:case i.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};t.default=i},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var i=n(17),o=n(102),r=n(68),s=Object.defineProperty;t.f=n(18)?Object.defineProperty:function(e,t,n){if(i(e),t=r(t,!0),i(n),o)try{return s(e,t,n)}catch(a){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var i=n(46),o=n(48);e.exports=function(e){return i(o(e))}},function(e,t,n){var i=n(48);e.exports=function(e){return Object(i(e))}},function(e,t,n){var i=n(21),o=n(52);e.exports=n(18)?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i);function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}var s={},a=1;t.default={inserted:function(e,t){e.outsideKey=a++;var n={documentHandler:function(n){if(o.contains(e,n.target))return!1;t.value&&t.value()}};s[e.outsideKey]=n,document.addEventListener("click",n.documentHandler)},unbind:function(e){var t=s[e.outsideKey];t&&(document.removeEventListener("click",t.documentHandler),delete s[e.outsideKey])}}},function(e,t,n){var i=n(104),o=n(53);e.exports=function(e){return i(o(e))}},function(e,t,n){"use strict";t.__esModule=!0;var i=n(226),o=u(i),r=n(235),s=u(r),a="function"===typeof s.default&&"symbol"===typeof o.default?function(e){return typeof e}:function(e){return e&&"function"===typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":typeof e};function u(e){return e&&e.__esModule?e:{default:e}}t.default="function"===typeof s.default&&"symbol"===a(o.default)?function(e){return"undefined"===typeof e?"undefined":a(e)}:function(e){return e&&"function"===typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":"undefined"===typeof e?"undefined":a(e)}},function(e,t){e.exports={}},function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(e,t,n){var i=n(35),o=n(87),r=n(60),s=Object.defineProperty;t.f=n(16)?Object.defineProperty:function(e,t,n){if(i(e),t=r(t,!0),i(n),o)try{return s(e,t,n)}catch(a){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var i=n(11);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var i=n(38),o=Math.min;e.exports=function(e){return e>0?o(i(e),9007199254740991):0}},function(e,t){var n=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:n)(e)}},function(e,t,n){var i=n(91),o=n(46),r=n(23),s=n(37),a=n(176);e.exports=function(e,t){var n=1==e,u=2==e,l=3==e,c=4==e,h=6==e,d=5==e||h,f=t||a;return function(t,a,p){for(var g,m,v=r(t),_=o(v),y=i(a,p,3),b=s(_.length),w=0,C=n?f(t,b):u?f(t,0):void 0;b>w;w++)if((d||w in _)&&(g=_[w],m=y(g,w,v),e))if(n)C[w]=m;else if(m)switch(e){case 3:return!0;case 5:return g;case 6:return w;case 2:C.push(g)}else if(c)return!1;return h?-1:l||c?c:C}}},function(e,t,n){var i=n(103),o=n(72);e.exports=Object.keys||function(e){return i(e,o)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=!0},function(e,t,n){e.exports={default:n(319),__esModule:!0}},function(e,t){var n=0,i=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+i).toString(36))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var i=n(47);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==i(e)?e.split(""):Object(e)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){e.exports={default:n(202),__esModule:!0}},function(e,t,n){var i=n(51);e.exports=function(e,t,n){if(i(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,o){return e.call(t,n,i,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){var n=0,i=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+i).toString(36))}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var i=n(53);e.exports=function(e){return Object(i(e))}},function(e,t,n){"use strict";var i=n(228)(!0);n(106)(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=i(t,n),this._i+=e.length,{value:e,done:!1})}))},function(e,t,n){var i=n(21).f,o=n(27),r=n(8)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,r)&&i(e,r,{configurable:!0,value:t})}},function(e,t,n){n(232);for(var i=n(7),o=n(24),r=n(32),s=n(8)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u0?i:n)(e)}},function(e,t,n){var i=n(71)("keys"),o=n(54);e.exports=function(e){return i[e]||(i[e]=o(e))}},function(e,t,n){var i=n(6),o=n(7),r="__core-js_shared__",s=o[r]||(o[r]={});(e.exports=function(e,t){return s[e]||(s[e]=void 0!==t?t:{})})("versions",[]).push({version:i.version,mode:n(42)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){e.exports={default:n(207),__esModule:!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(220),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default=o.default},function(e,t,n){t.f=n(8)},function(e,t,n){var i=n(7),o=n(6),r=n(42),s=n(76),a=n(21).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=r?{}:i.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:s.f(e)})}},function(e,t,n){"use strict";t.__esModule=!0;var i=n(288),o=a(i),r=n(116),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(){function e(e,t){var n=[],i=!0,o=!1,r=void 0;try{for(var a,u=(0,s.default)(e);!(i=(a=u.next()).done);i=!0)if(n.push(a.value),t&&n.length===t)break}catch(l){o=!0,r=l}finally{try{!i&&u["return"]&&u["return"]()}finally{if(o)throw r}}return n}return function(t,n){if(Array.isArray(t))return t;if((0,o.default)(Object(t)))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(e,t,n){var i=n(41),o=n(8)("toStringTag"),r="Arguments"==i(function(){return arguments}()),s=function(e,t){try{return e[t]}catch(n){}};e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=s(t=Object(e),o))?n:r?i(t):"Object"==(a=i(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(118),o=a(i),r=n(78),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}t.default={computed:{vFormat:function(){return this.onlyMonth?"YYYY-MM":this.enableTime?this.enableSeconds?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD HH:mm":this.format}},methods:{timeFormat:function(e,t){var n=e.getFullYear(),i=e.getMonth(),o=e.getDate(),r=e.getHours(),s=r%12===0?12:r%12,a=e.getMinutes(),u=e.getSeconds(),l=e.getMilliseconds(),c=function(e){return("0"+e).slice(-2)},h={YYYY:n,MM:c(i+1),MMMM:this.t("el.datepicker.month"+(i+1)),M:i+1,DD:c(o),D:o,HH:c(r),H:r,hh:c(s),h:s,mm:c(a),m:a,ss:c(u),s:u,S:l};return(t||this.vFormat||this.format).replace(/Y+|M+|D+|H+|h+|m+|s+|S+/g,(function(e){return h[e]}))},isSameDay:function(e,t){return this.timeFormat(e,"YYYY-MM-DD")===this.timeFormat(t,"YYYY-MM-DD")},contrastDate:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD HH:mm:ss",i=this.timeFormat(e,n),o=this.timeFormat(t,n);return i>o?1:i===o?0:-1},isEmpty:function(e){return!e||!!Array.isArray(e)&&(0===e.length||!e.some((function(e){return e})))},isEqual:function(e,t){var n=this,i=this.isEmpty(e),o=this.isEmpty(t);return!(!i||!o)||!(i&&!o||!i&&o)&&("single"===this.model?0===this.contrastDate(new Date(t),new Date(e)):e.length===t.length&&e.every((function(e,i){return 0===n.contrastDate(new Date(t[i]),new Date(e))})))},inOnePanel:function(e,t){var n=(0,s.default)(e,2),i=n[0],r=n[1];if(i&&r)if(-1!==t.indexOf("D")){if(this.timeFormat(i,"YYYYMM")===this.timeFormat(r,"YYYYMM"))return!0}else if(-1!==t.indexOf("M")){if(i.getFullYear()===r.getFullYear())return!0}else if((0,o.default)(i.getFullYear()/10)===(0,o.default)(r.getFullYear()/10))return!0;return!1}}}},function(e,t,n){"use strict";var i=n(51);function o(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=i})),this.resolve=i(t),this.reject=i(n)}e.exports.f=function(e){return new o(e)}},function(e,t,n){var i=n(130),o=n(335);function r(e,t){var n=new o(t);return n.process(e)}for(var s in t=e.exports=r,t.FilterCSS=o,i)t[s]=i[s];"undefined"!==typeof window&&(window.filterCSS=e.exports)},function(e,t){e.exports={indexOf:function(e,t){var n,i;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,i=e.length;nu)i.f(e,n=s[u++],t[n]);return e}},function(e,t,n){var i=n(94),o=n(63);e.exports=Object.keys||function(e){return i(e,o)}},function(e,t,n){var i=n(36),o=n(22),r=n(95)(!1),s=n(62)("IE_PROTO");e.exports=function(e,t){var n,a=o(e),u=0,l=[];for(n in a)n!=s&&i(a,n)&&l.push(n);while(t.length>u)i(a,n=t[u++])&&(~r(l,n)||l.push(n));return l}},function(e,t,n){var i=n(22),o=n(37),r=n(96);e.exports=function(e){return function(t,n,s){var a,u=i(t),l=o(u.length),c=r(s,l);if(e&&n!=n){while(l>c)if(a=u[c++],a!=a)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===n)return e||c||0;return!e&&-1}}},function(e,t,n){var i=n(38),o=Math.max,r=Math.min;e.exports=function(e,t){return e=i(e),e<0?o(e+t,0):r(e,t)}},function(e,t,n){var i=n(20).document;e.exports=i&&i.documentElement},function(e,t,n){var i=n(47);e.exports=Array.isArray||function(e){return"Array"==i(e)}},function(e,t,n){var i=n(45),o=n(23),r=n(46),s=n(37);e.exports=function(e,t,n,a,u){i(t);var l=o(e),c=r(l),h=s(l.length),d=u?h-1:0,f=u?-1:1;if(n<2)for(;;){if(d in c){a=c[d],d+=f;break}if(d+=f,u?d<0:h<=d)throw TypeError("Reduce of empty array with no initial value")}for(;u?d>=0:h>d;d+=f)d in c&&(a=t(a,c[d],d,l));return a}},function(e,t,n){var i=n(47);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=i(e))throw TypeError(t);return+e}},function(e,t,n){"use strict";var i=n(35);e.exports=function(){var e=i(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){e.exports=!n(18)&&!n(26)((function(){return 7!=Object.defineProperty(n(67)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var i=n(27),o=n(30),r=n(205)(!1),s=n(70)("IE_PROTO");e.exports=function(e,t){var n,a=o(e),u=0,l=[];for(n in a)n!=s&&i(a,n)&&l.push(n);while(t.length>u)i(a,n=t[u++])&&(~r(l,n)||l.push(n));return l}},function(e,t,n){var i=n(41);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==i(e)?e.split(""):Object(e)}},function(e,t,n){var i=n(69),o=Math.min;e.exports=function(e){return e>0?o(i(e),9007199254740991):0}},function(e,t,n){"use strict";var i=n(42),o=n(14),r=n(107),s=n(24),a=n(32),u=n(229),l=n(58),c=n(231),h=n(8)("iterator"),d=!([].keys&&"next"in[].keys()),f="@@iterator",p="keys",g="values",m=function(){return this};e.exports=function(e,t,n,v,_,y,b){u(n,t,v);var w,C,S,x=function(e){if(!d&&e in E)return E[e];switch(e){case p:return function(){return new n(this,e)};case g:return function(){return new n(this,e)}}return function(){return new n(this,e)}},L=t+" Iterator",k=_==g,N=!1,E=e.prototype,O=E[h]||E[f]||_&&E[_],D=O||x(_),I=_?k?x("entries"):D:void 0,M="Array"==t&&E.entries||O;if(M&&(S=c(M.call(new e)),S!==Object.prototype&&S.next&&(l(S,L,!0),i||"function"==typeof S[h]||s(S,h,m))),k&&O&&O.name!==g&&(N=!0,D=function(){return O.call(this)}),i&&!b||!d&&!N&&E[h]||s(E,h,D),a[t]=D,a[L]=m,_)if(w={values:k?D:x(g),keys:y?D:x(p),entries:I},b)for(C in w)C in E||r(E,C,w[C]);else o(o.P+o.F*(d||N),t,w);return w}},function(e,t,n){e.exports=n(24)},function(e,t,n){var i=n(17),o=n(230),r=n(72),s=n(70)("IE_PROTO"),a=function(){},u="prototype",l=function(){var e,t=n(67)("iframe"),i=r.length,o="<",s=">";t.style.display="none",n(109).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(o+"script"+s+"document.F=Object"+o+"/script"+s),e.close(),l=e.F;while(i--)delete l[u][r[i]];return l()};e.exports=Object.create||function(e,t){var n;return null!==e?(a[u]=i(e),n=new a,a[u]=null,n[s]=e):n=l(),void 0===t?n:o(n,t)}},function(e,t,n){var i=n(7).document;e.exports=i&&i.documentElement},function(e,t,n){var i=n(103),o=n(72).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,o)}},function(e,t){},function(e,t,n){var i=n(0)(n(253),n(276),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/table.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] table.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeLocaleMessage=t.setHandler=t.setLocale=t.t=void 0;var i=n(31),o=d(i),r=n(28),s=d(r),a=n(254),u=d(a),l=n(255),c=d(l),h=n(114);function d(e){return e&&e.__esModule?e:{default:e}}var f=(0,c.default)(s.default),p="zh-cn",g=!1,m=function(){if(this instanceof s.default){var e=this.$t,t=this.$i18n;if("function"===typeof e&&"object"===("undefined"===typeof t?"undefined":(0,o.default)(t))){if(!g)for(var n in g=!0,u.default)t.mergeLocaleMessage(n,u.default[n]);return e.apply(this,arguments)}}},v=t.t=function(e,t){var n=m.apply(this,arguments);if(null!==n&&void 0!==n)return n;for(var i=e.split("."),o=u.default[p],r=0,s=i.length;rn)t.push(arguments[n++]);return v[++m]=function(){a("function"==typeof e?e:Function(e),t)},i(m),m},f=function(e){delete v[e]},"process"==n(41)(h)?i=function(e){h.nextTick(s(y,e,1))}:g&&g.now?i=function(e){g.now(s(y,e,1))}:p?(o=new p,r=o.port2,o.port1.onmessage=b,i=s(r.postMessage,r,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(i=function(e){c.postMessage(e+"","*")},c.addEventListener("message",b,!1)):i=_ in l("script")?function(e){u.appendChild(l("script"))[_]=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(s(y,e,1),0)}),e.exports={set:d,clear:f}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(t){return{e:!0,v:t}}}},function(e,t,n){var i=n(17),o=n(25),r=n(81);e.exports=function(e,t){if(i(e),o(t)&&t.constructor===e)return t;var n=r.f(e),s=n.resolve;return s(t),n.promise}},function(e,t,n){var i=n(129),o=n(132),r=n(337);function s(e,t){var n=new r(t);return n.process(e)}for(var a in t=e.exports=s,t.filterXSS=s,t.FilterXSS=r,i)t[a]=i[a];for(var a in o)t[a]=o[a];function u(){return"undefined"!==typeof self&&"undefined"!==typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope}"undefined"!==typeof window&&(window.filterXSS=e.exports),u()&&(self.filterXSS=e.exports)},function(e,t,n){var i=n(82).FilterCSS,o=n(82).getDefaultWhiteList,r=n(83);function s(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","loop","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],sup:[],strong:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","loop","preload","src","height","width"]}}var a=new i;function u(e,t,n){}function l(e,t,n){}function c(e,t,n){}function h(e,t,n){}function d(e){return e.replace(p,"<").replace(g,">")}function f(e,t,n,i){if(n=O(n),"href"===t||"src"===t){if(n=r.trim(n),"#"===n)return"#";if("http://"!==n.substr(0,7)&&"https://"!==n.substr(0,8)&&"mailto:"!==n.substr(0,7)&&"tel:"!==n.substr(0,4)&&"data:image/"!==n.substr(0,11)&&"ftp://"!==n.substr(0,6)&&"./"!==n.substr(0,2)&&"../"!==n.substr(0,3)&&"#"!==n[0]&&"/"!==n[0])return""}else if("background"===t){if(w.lastIndex=0,w.test(n))return""}else if("style"===t){if(C.lastIndex=0,C.test(n))return"";if(S.lastIndex=0,S.test(n)&&(w.lastIndex=0,w.test(n)))return"";!1!==i&&(i=i||a,n=i.process(n))}return n=D(n),n}var p=//g,m=/"/g,v=/"/g,_=/&#([a-zA-Z0-9]*);?/gim,y=/:?/gim,b=/&newline;?/gim,w=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a)\:/gi,C=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,S=/u\s*r\s*l\s*\(.*/gi;function x(e){return e.replace(m,""")}function L(e){return e.replace(v,'"')}function k(e){return e.replace(_,(function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))}))}function N(e){return e.replace(y,":").replace(b," ")}function E(e){for(var t="",n=0,i=e.length;n/g;function A(e){var t=e.split("");return t=t.filter((function(e){var t=e.charCodeAt(0);return 127!==t&&(!(t<=31)||(10===t||13===t))})),t.join("")}t.whiteList=s(),t.getDefaultWhiteList=s,t.onTag=u,t.onIgnoreTag=l,t.onTagAttr=c,t.onIgnoreTagAttr=h,t.safeAttrValue=f,t.escapeHtml=d,t.escapeQuote=x,t.unescapeQuote=L,t.escapeHtmlEntities=k,t.escapeDangerHtml5Entities=N,t.clearNonPrintableCharacter=E,t.friendlyAttrValue=O,t.escapeAttrValue=D,t.onIgnoreTagStripAll=I,t.StripTagBody=M,t.stripCommentTag=T,t.stripBlankChar=A,t.cssFilter=a,t.getDefaultCSSWhiteList=o},function(e,t){function n(){var e={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return e}function i(e,t,n){}function o(e,t,n){}var r=/javascript\s*\:/gim;function s(e,t){return r.test(t)?"":t}t.whiteList=n(),t.getDefaultWhiteList=n,t.onAttr=i,t.onIgnoreAttr=o,t.safeAttrValue=s},function(e,t){e.exports={indexOf:function(e,t){var n,i;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,i=e.length;n"===f){i+=n(e.slice(s,a)),d=e.slice(a,l+1),h=o(d),i+=t(a,i.length,h,d,r(d)),s=l+1,a=!1;continue}if('"'===f||"'"===f){var p=1,g=e.charAt(l-p);while(" "===g||"="===g){if("="===g){u=f;continue e}g=e.charAt(l-++p)}}}else if(f===u){u=!1;continue}}return s0;t--){var n=e[t];if(" "!==n)return"="===n?t:-1}}function h(e){return'"'===e[0]&&'"'===e[e.length-1]||"'"===e[0]&&"'"===e[e.length-1]}function d(e){return h(e)?e.substr(1,e.length-2):e}t.parseTag=s,t.parseAttr=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){var e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){return setTimeout((function(){e&&e()}),20)};return function(t){return e(t)}}(),o=function(){var e=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout;return function(t){return e(t)}}();function r(e){var t=e.target||e.srcElement;t.__resizeRAF__&&o(t.__resizeRAF__),t.__resizeRAF__=i((function(){var n=t.__resizeTrigger__,i=n&&n.__resizeListeners__;i&&i.forEach((function(t){t.call(n,e)}))}))}var s=function(e,t){var n=window.document,i=n.attachEvent;function o(){this.contentDocument.defaultView.__resizeTrigger__=this.__resizeElement__,this.contentDocument.defaultView.addEventListener("resize",r)}if(!e.__resizeListeners__)if(e.__resizeListeners__=[],i)e.__resizeTrigger__=e,e.attachEvent("onresize",r);else{"static"===getComputedStyle(e).position&&(e.style.position="relative");var s=e.__resizeTrigger__=n.createElement("object");s.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1; opacity: 0;"),s.setAttribute("class","resize-sensor"),s.__resizeElement__=e,s.onload=o,s.type="text/html",s.data="about:blank",e.appendChild(s)}e.__resizeListeners__.push(t)};s="undefined"===typeof window?s:s.bind(window),s.unbind=function(e,t){var n=document.attachEvent,i=e.__resizeListeners__||[];if(t){var o=i.indexOf(t);-1!==o&&i.splice(o,1)}else i=e.__resizeListeners__=[];i.length||(n?e.detachEvent("onresize",r):e.__resizeTrigger__&&(e.__resizeTrigger__.contentDocument&&(e.__resizeTrigger__.contentDocument.defaultView.removeEventListener("resize",r),delete e.__resizeTrigger__.contentDocument.defaultView.__resizeTrigger__),e.__resizeTrigger__=!e.removeChild(e.__resizeTrigger__)),delete e.__resizeListeners__)},t.default=s},function(e,t,n){var i=n(0)(n(377),n(378),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/zoom/zoom.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] zoom.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){var i=n(0)(n(388),n(392),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/tooltip/tooltip.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] tooltip.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(397),o=l(i),r=n(400),s=l(r),a=n(403),u=l(a);function l(e){return e&&e.__esModule?e:{default:e}}t.default={WbSelect:o.default,WbOption:s.default,OptionGroup:u.default}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(406),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},a=e,l=n,h=s;if("function"===typeof l&&(h=l,l={}),!this.rules||0===Object.keys(this.rules).length)return h&&h(),Promise.resolve();function d(e){var t=void 0,n=[],i={};function o(e){var t;Array.isArray(e)?n=(t=n).concat.apply(t,e):n.push(e)}for(t=0;t0&&void 0!==arguments[0]?arguments[0]:[],u=o;if(Array.isArray(u)||(u=[u]),!l.suppressWarning&&u.length&&c.warning("async-validator:",u),u.length&&n.message&&(u=[].concat(n.message)),u=u.map((0,r.complementError)(n)),l.first&&u.length)return _[n.field]=1,t(u);if(s){if(n.required&&!e.value)return u=n.message?[].concat(n.message).map((0,r.complementError)(n)):l.error?[l.error(n,(0,r.format)(l.messages.required,n.field))]:[],t(u);var h={};if(n.defaultField)for(var d in e.value)e.value.hasOwnProperty(d)&&(h[d]=n.defaultField);for(var f in h=i({},h,e.rule.fields),h)if(h.hasOwnProperty(f)){var p=Array.isArray(h[f])?h[f]:[h[f]];h[f]=p.map(a.bind(null,f))}var g=new c(h);g.messages(l.messages),e.rule.options&&(e.rule.options.messages=l.messages,e.rule.options.error=l.error),g.validate(e.value,e.rule.options||l,(function(e){var n=[];u&&u.length&&n.push.apply(n,u),e&&e.length&&n.push.apply(n,e),t(n.length?n:null)}))}else t(u)}s=s&&(n.required||!n.required&&e.value),n.field=e.field;var h=void 0;n.asyncValidator?h=n.asyncValidator(n,e.value,u,e.source,l):n.validator&&(h=n.validator(n,e.value,u,e.source,l),!0===h?u():!1===h?u(n.message||n.field+" fails"):h instanceof Array?u(h):h instanceof Error&&u(h.message)),h&&h.then&&h.then((function(){return u()}),(function(e){return u(e)}))}),(function(e){d(e)}))},getType:function(e){if(void 0===e.type&&e.pattern instanceof RegExp&&(e.type="pattern"),"function"!==typeof e.validator&&e.type&&!a["default"].hasOwnProperty(e.type))throw new Error((0,r.format)("Unknown rule type %s",e.type));return e.type||"string"},getValidationMethod:function(e){if("function"===typeof e.validator)return e.validator;var t=Object.keys(e),n=t.indexOf("message");return-1!==n&&t.splice(n,1),1===t.length&&"required"===t[0]?a["default"].required:a["default"][this.getType(e)]||!1}},c.register=function(e,t){if("function"!==typeof t)throw new Error("Cannot register a validator by type, validator is not a function");a["default"][e]=t},c.warning=r.warning,c.messages=u.messages,t["default"]=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i);function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function s(e,t,n,i,r,s){!e.required||n.hasOwnProperty(e.field)&&!o.isEmptyValue(t,s||e.type)||i.push(o.format(r.messages.required,e.fullField))}t["default"]=s},function(e,t,n){var i=n(0)(n(459),n(460),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/menu/menu.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] menu.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){var i=n(0)(n(461),n(462),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/menu/subMenu.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] subMenu.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){var i=n(0)(n(463),n(464),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/menu/menuItem.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] menuItem.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={listen:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return e.addEventListener?(e.addEventListener(t,n,i),{remove:function(){e.removeEventListener(t,n,i)}}):(e.attachEvent("on"+t,n,i),{remove:function(){e.detachEvent("on"+t,n,i)}})}};t.default=i},function(e,t,n){var i=n(0)(n(490),n(491),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/dropdown-com/dropdownMenu.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] dropdownMenu.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){n(146),e.exports=n(201)},function(e,t,n){n(147),n(151),n(152),n(153),n(156),n(158),n(159),n(162),n(163),n(164),n(165),n(166),n(167),n(168),n(171),n(172),n(173),n(174),n(175),n(179),n(180),n(181),n(182),n(183),n(184),n(185),n(186),n(187),n(189),n(190),n(191),n(193),n(194),n(196),n(198),n(199),e.exports=n(33)},function(e,t,n){var i=n(2);i(i.S,"Object",{create:n(150)})},function(e,t,n){e.exports=n(61)("native-function-to-string",Function.toString)},function(e,t){e.exports=!1},function(e,t,n){var i=n(35),o=n(92),r=n(63),s=n(62)("IE_PROTO"),a=function(){},u="prototype",l=function(){var e,t=n(88)("iframe"),i=r.length,o="<",s=">";t.style.display="none",n(97).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(o+"script"+s+"document.F=Object"+o+"/script"+s),e.close(),l=e.F;while(i--)delete l[u][r[i]];return l()};e.exports=Object.create||function(e,t){var n;return null!==e?(a[u]=i(e),n=new a,a[u]=null,n[s]=e):n=l(),void 0===t?n:o(n,t)}},function(e,t,n){var i=n(2);i(i.S+i.F*!n(16),"Object",{defineProperty:n(34).f})},function(e,t,n){var i=n(2);i(i.S+i.F*!n(16),"Object",{defineProperties:n(92)})},function(e,t,n){var i=n(22),o=n(154).f;n(15)("getOwnPropertyDescriptor",(function(){return function(e,t){return o(i(e),t)}}))},function(e,t,n){var i=n(155),o=n(89),r=n(22),s=n(60),a=n(36),u=n(87),l=Object.getOwnPropertyDescriptor;t.f=n(16)?l:function(e,t){if(e=r(e),t=s(t,!0),u)try{return l(e,t)}catch(n){}if(a(e,t))return o(!i.f.call(e,t),e[t])}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var i=n(23),o=n(157);n(15)("getPrototypeOf",(function(){return function(e){return o(i(e))}}))},function(e,t,n){var i=n(36),o=n(23),r=n(62)("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),i(e,r)?e[r]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,n){var i=n(23),o=n(93);n(15)("keys",(function(){return function(e){return o(i(e))}}))},function(e,t,n){n(15)("getOwnPropertyNames",(function(){return n(160).f}))},function(e,t,n){var i=n(22),o=n(161).f,r={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(e){try{return o(e)}catch(t){return s.slice()}};e.exports.f=function(e){return s&&"[object Window]"==r.call(e)?a(e):o(i(e))}},function(e,t,n){var i=n(94),o=n(63).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,o)}},function(e,t,n){var i=n(11),o=n(64).onFreeze;n(15)("freeze",(function(e){return function(t){return e&&i(t)?e(o(t)):t}}))},function(e,t,n){var i=n(11),o=n(64).onFreeze;n(15)("seal",(function(e){return function(t){return e&&i(t)?e(o(t)):t}}))},function(e,t,n){var i=n(11),o=n(64).onFreeze;n(15)("preventExtensions",(function(e){return function(t){return e&&i(t)?e(o(t)):t}}))},function(e,t,n){var i=n(11);n(15)("isFrozen",(function(e){return function(t){return!i(t)||!!e&&e(t)}}))},function(e,t,n){var i=n(11);n(15)("isSealed",(function(e){return function(t){return!i(t)||!!e&&e(t)}}))},function(e,t,n){var i=n(11);n(15)("isExtensible",(function(e){return function(t){return!!i(t)&&(!e||e(t))}}))},function(e,t,n){var i=n(2);i(i.P,"Function",{bind:n(169)})},function(e,t,n){"use strict";var i=n(45),o=n(11),r=n(170),s=[].slice,a={},u=function(e,t,n){if(!(t in a)){for(var i=[],o=0;o1&&(i=Math.min(i,r(arguments[1]))),i<0&&(i=n+i);i>=0;i--)if(i in t&&t[i]===e)return i||0;return-1}})},function(e,t,n){"use strict";var i=n(2),o=n(38),r=n(100),s=n(188),a=1..toFixed,u=Math.floor,l=[0,0,0,0,0,0],c="Number.toFixed: incorrect invocation!",h="0",d=function(e,t){var n=-1,i=t;while(++n<6)i+=e*l[n],l[n]=i%1e7,i=u(i/1e7)},f=function(e){var t=6,n=0;while(--t>=0)n+=l[t],l[t]=u(n/e),n=n%e*1e7},p=function(){var e=6,t="";while(--e>=0)if(""!==t||0===e||0!==l[e]){var n=String(l[e]);t=""===t?n:t+s.call(h,7-n.length)+n}return t},g=function(e,t,n){return 0===t?n:t%2===1?g(e,t-1,n*e):g(e*e,t/2,n)},m=function(e){var t=0,n=e;while(n>=4096)t+=12,n/=4096;while(n>=2)t+=1,n/=2;return t};i(i.P+i.F*(!!a&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(10)((function(){a.call({})}))),"Number",{toFixed:function(e){var t,n,i,a,u=r(this,c),l=o(e),v="",_=h;if(l<0||l>20)throw RangeError(c);if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return String(u);if(u<0&&(v="-",u=-u),u>1e-21)if(t=m(u*g(2,69,1))-69,n=t<0?u*g(2,-t,1):u/g(2,t,1),n*=4503599627370496,t=52-t,t>0){d(0,n),i=l;while(i>=7)d(1e7,0),i-=7;d(g(10,i,1),0),i=t-1;while(i>=23)f(1<<23),i-=23;f(1<0?(a=_.length,_=v+(a<=l?"0."+s.call(h,l-a)+_:_.slice(0,a-l)+"."+_.slice(a-l))):_=v+_,_}})},function(e,t,n){"use strict";var i=n(38),o=n(48);e.exports=function(e){var t=String(o(this)),n="",r=i(e);if(r<0||r==1/0)throw RangeError("Count can't be negative");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n}},function(e,t,n){"use strict";var i=n(2),o=n(10),r=n(100),s=1..toPrecision;i(i.P+i.F*(o((function(){return"1"!==s.call(1,void 0)}))||!o((function(){s.call({})}))),"Number",{toPrecision:function(e){var t=r(this,"Number#toPrecision: incorrect invocation!");return void 0===e?s.call(t):s.call(t,e)}})},function(e,t,n){var i=n(2);i(i.S,"Date",{now:function(){return(new Date).getTime()}})},function(e,t,n){var i=n(2),o=n(192);i(i.P+i.F*(Date.prototype.toISOString!==o),"Date",{toISOString:o})},function(e,t,n){"use strict";var i=n(10),o=Date.prototype.getTime,r=Date.prototype.toISOString,s=function(e){return e>9?e:"0"+e};e.exports=i((function(){return"0385-07-25T07:06:39.999Z"!=r.call(new Date(-50000000000001))}))||!i((function(){r.call(new Date(NaN))}))?function(){if(!isFinite(o.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),i=t<0?"-":t>9999?"+":"";return i+("00000"+Math.abs(t)).slice(i?-6:-4)+"-"+s(e.getUTCMonth()+1)+"-"+s(e.getUTCDate())+"T"+s(e.getUTCHours())+":"+s(e.getUTCMinutes())+":"+s(e.getUTCSeconds())+"."+(n>99?n:"0"+s(n))+"Z"}:r},function(e,t,n){"use strict";var i=n(2),o=n(23),r=n(60);i(i.P+i.F*n(10)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(e){var t=o(this),n=r(t);return"number"!=typeof n||isFinite(n)?t.toISOString():null}})},function(e,t,n){var i=n(2),o=n(195);i(i.G+i.F*(parseInt!=o),{parseInt:o})},function(e,t,n){var i=n(20).parseInt,o=n(65).trim,r=n(66),s=/^[-+]?0[xX]/;e.exports=8!==i(r+"08")||22!==i(r+"0x16")?function(e,t){var n=o(String(e),3);return i(n,t>>>0||(s.test(n)?16:10))}:i},function(e,t,n){var i=n(2),o=n(197);i(i.G+i.F*(parseFloat!=o),{parseFloat:o})},function(e,t,n){var i=n(20).parseFloat,o=n(65).trim;e.exports=1/i(n(66)+"-0")!==-1/0?function(e){var t=o(String(e),3),n=i(t);return 0===n&&"-"==t.charAt(0)?-0:n}:i},function(e,t,n){"use strict";n(65)("trim",(function(e){return function(){return e(this,3)}}))},function(e,t,n){"use strict";n(200);var i=n(35),o=n(101),r=n(16),s="toString",a=/./[s],u=function(e){n(90)(RegExp.prototype,s,e,!0)};n(10)((function(){return"/a/b"!=a.call({source:"a",flags:"b"})}))?u((function(){var e=i(this);return"/".concat(e.source,"/","flags"in e?e.flags:!r&&e instanceof RegExp?o.call(e):void 0)})):a.name!=s&&u((function(){return a.call(this)}))},function(e,t,n){n(16)&&"g"!=/./g.flags&&n(34).f(RegExp.prototype,"flags",{configurable:!0,get:n(101)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(49),o=Se(i),r=n(74),s=Se(r),a=n(210),u=Se(a),l=n(3),c=Se(l),h=n(75),d=Se(h),f=n(223),p=Se(f),g=n(252),m=Se(g),v=n(282),_=Se(v),y=n(286),b=Se(y),w=n(315),C=Se(w),S=n(318),x=Se(S),L=n(339),k=Se(L),N=n(347),E=Se(N),O=n(84),D=Se(O),I=n(357),M=Se(I),T=n(366),P=Se(T),A=n(376),R=Se(A),F=n(380),W=Se(F),V=n(387),B=Se(V),H=n(394),j=Se(H),z=n(137),U=Se(z),$=n(136),K=Se($),q=n(414),G=Se(q),Y=n(421),Z=Se(Y),X=n(428),J=Se(X),Q=n(458),ee=Se(Q),te=n(471),ne=Se(te),ie=n(475),oe=Se(ie),re=n(479),se=Se(re),ae=n(483),ue=Se(ae),le=n(487),ce=Se(le),he=n(493),de=Se(he),fe=n(507),pe=Se(fe),ge=n(512),me=Se(ge),ve=n(519),_e=Se(ve),ye=n(523),be=Se(ye),we=n(113),Ce=Se(we);function Se(e){return e&&e.__esModule?e:{default:e}}var xe={Row:u.default.Row,Cell:u.default.Cell,Icon:c.default,WbButton:d.default,Tabs:p.default.Tabs,Tab:p.default.Tab,Carousel:_.default,WbTable:m.default.WbTable,TreeTable:m.default.TreeTable,Column:m.default.Column,WbInputDatePicker:b.default,DatePicker:y.Calendar,Loading:C.default,Modal:k.default,WbSwitch:E.default,Tree:M.default,Zoom:R.default,Steps:W.default.Steps,Step:W.default.Step,Tooltip:B.default,Pagination:j.default,WbInput:U.default,WbSelect:K.default.WbSelect,WbOption:K.default.WbOption,OptionGroup:K.default.OptionGroup,Radio:G.default.Radio,RadioGroup:G.default.RadioGroup,Checkbox:Z.default.Checkbox,CheckboxGroup:Z.default.CheckboxGroup,WbForm:J.default.WbForm,FormItem:J.default.FormItem,Panel:ne.default,WbMenu:ee.default.WbMenu,WbMenuItem:ee.default.WbMenuItem,WbSubMenu:ee.default.WbSubMenu,WbMenuGroup:ee.default.WbMenuGroup,RouteMenu:ee.default.RouteMenu,Upload:P.default,Affix:oe.default,BackTop:se.default,ProcessCircle:ue.default,Dropdown:ce.default.Dropdown,DropdownMenu:ce.default.DropdownMenu,Draggable:de.default,Contextmenu:pe.default,Split:me.default.Split,SplitItem:me.default.SplitItem,TimePicker:_e.default,Collapse:be.default,CollapsePanel:ye.CollapsePanel},Le=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ce.default.setLocale(t.locale),Ce.default.setHandler(t.handle),(0,s.default)(xe).forEach((function(t){e.component(t,xe[t])})),e.directive("Zoom",R.default._directive),e.directive("Tooltip",B.default._directive),e.prototype.$Message=window.Message=x.default,e.prototype.$Toast=window.Toast=D.default,e.mixin({created:function(){this.$root&&(x.default.root=this.$root,D.default.root=this.$root)}})};"undefined"!==typeof window&&window.Vue&&Le(window.Vue),t.default=(0,o.default)(xe,{install:Le,version:"2.3.6",i18n:Ce.default})},function(e,t,n){n(203),e.exports=n(6).Object.assign},function(e,t,n){var i=n(14);i(i.S+i.F,"Object",{assign:n(204)})},function(e,t,n){"use strict";var i=n(18),o=n(40),r=n(73),s=n(55),a=n(56),u=n(104),l=Object.assign;e.exports=!l||n(26)((function(){var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=l({},e)[n]||Object.keys(l({},t)).join("")!=i}))?function(e,t){var n=a(e),l=arguments.length,c=1,h=r.f,d=s.f;while(l>c){var f,p=u(arguments[c++]),g=h?o(p).concat(h(p)):o(p),m=g.length,v=0;while(m>v)f=g[v++],i&&!d.call(p,f)||(n[f]=p[f])}return n}:l},function(e,t,n){var i=n(30),o=n(105),r=n(206);e.exports=function(e){return function(t,n,s){var a,u=i(t),l=o(u.length),c=r(s,l);if(e&&n!=n){while(l>c)if(a=u[c++],a!=a)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===n)return e||c||0;return!e&&-1}}},function(e,t,n){var i=n(69),o=Math.max,r=Math.min;e.exports=function(e,t){return e=i(e),e<0?o(e+t,0):r(e,t)}},function(e,t,n){n(208),e.exports=n(6).Object.keys},function(e,t,n){var i=n(56),o=n(40);n(209)("keys",(function(){return function(e){return o(i(e))}}))},function(e,t,n){var i=n(14),o=n(6),r=n(26);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],s={};s[e]=t(n),i(i.S+i.F*r((function(){n(1)})),"Object",s)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(211),o=a(i),r=n(214),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}t.default={Row:o.default,Cell:s.default}},function(e,t,n){var i=n(0)(n(212),n(213),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/layout/row.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] row.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"Row"}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-row"},[e._t("default")],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(215),n(216),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/layout/cell.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] cell.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"Cell",props:{span:{required:!0,type:[String,Number]},offset:{type:[String,Number],default:void 0}},computed:{getClass:function(){var e=["ui-cell-span-"+this.span];return this.offset&&e.push("ui-cell-offset-"+this.offset),e}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-cell",class:e.getClass},[e._t("default")],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(218),n(219),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/icon/icon.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] icon.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"Icon",props:{type:{required:!0,type:String},size:{type:String,default:void 0},color:{type:String,default:void 0}},data:function(){return{}},computed:{getClass:function(){return"ui-icon-"+this.type},getStyle:function(){var e={};return this.size&&(e["font-size"]=this.size+"px"),this.color&&(e.color=this.color),e}},methods:{click:function(e){this.$emit("click",e)}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("i",{staticClass:"ui-icon",class:e.getClass,style:e.getStyle,on:{click:e.click}})},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(221),n(222),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/button/button.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] button.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default={name:"Button",components:{Icon:o.default},props:{type:{type:String,default:""},long:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},icon:{type:String,default:""},control:{type:Number,default:300},disabled:{type:Boolean,default:!1},buttonType:{type:String,default:"button"}},data:function(){return{currentDisabled:this.disabled,iconOnly:!1}},computed:{getClass:function(){var e=[];return this.type&&e.push("ui-button-type-"+this.type),this.circle&&e.push("ui-button-circle"),this.long&&e.push("ui-button-long"),this.iconOnly&&e.push("ui-button-icon-only"),this.currentDisabled&&e.push("ui-button-disabled"),e}},watch:{disabled:function(){this.currentDisabled=this.disabled}},created:function(){this.iconOnly=void 0===this.$slots.default&&this.icon},methods:{handleClick:function(e){var t=this;this.currentDisabled||this.notAllowed||(this.notAllowed=!0,setTimeout((function(){t.notAllowed=!1}),this.control),this.$emit("click",e,this))}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("button",{staticClass:"ui-button",class:e.getClass,attrs:{type:e.buttonType},on:{click:e.handleClick}},[e.icon?n("Icon",{attrs:{type:e.icon}}):e._e(),e._v(" "),n("span",{staticClass:"content"},[e._t("default")],2)],1)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(224),o=a(i),r=n(249),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}t.default={Tabs:o.default,Tab:s.default}},function(e,t,n){var i=n(0)(n(225),n(248),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/tab-com/tabs.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] tabs.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(245),r=u(o),s=n(3),a=u(s);function u(e){return e&&e.__esModule?e:{default:e}}t.default={name:"Tabs",components:{Icon:a.default,tabComponent:r.default},props:{value:{type:[Number,String],default:1},type:{type:String,default:void 0},closable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},data:function(){return{uid:1,activeKey:this.value,tabs:[],cacheTabs:[],scrollable:!1,navStyle:{transform:""},dragIndex:null,dragItem:null,scrollIndex:0}},computed:{isCard:function(){return"card"===this.type}},watch:{value:function(){this.activeKey=this.value},tabs:function(){var e=this;this.tabs.length>0&&this.$nextTick((function(){e.isScrollable()}))},scrollIndex:function(){for(var e=0,t=0;tt,this.scrollable||(this.scrollIndex=0)},getHeaderClass:function(e,t){var n=[];return e.show&&n.push("ui-tabs-header-current"),e.disabled&&n.push("ui-tabs-header-disabled"),t==this.dragIndex&&n.push("ui-tabs-header-draging"),n},addTab:function(e){e.tabName=e.name||this.uid,this.tabs.push(e),this.cacheTabs.push(e),this.uid++},removeTab:function(e){var t=this.tabs.indexOf(e);if(-1!=t&&(this.tabs.splice(t,1),this.$emit("on-tab-remove",e.tabName,t)),e.show&&this.tabs.length>0){var n=t-1<0?t:t-1;this.activeKey=this.tabs[n].tabName}},choose:function(e){this.activeKey=e.tabName,this.$emit("input",e.tabName),this.$emit("on-click",e.tabName)},getCurrentScrollOffset:function(){return this.navStyle.transform?Number(this.navStyle.transform.match(/translateX\(-(\d+(\.\d+)*)px\)/)[1]):0},scrollNext:function(){this.scrollIndex0&&(this.scrollIndex-=1)},setOffset:function(e){this.navStyle.transform="translateX(-"+e+"px)"},dragstart:function(e,t){this.draggable&&(this.dragIndex=t,this.dragItem=this.tabs[t])},dragenter:function(e,t){if(this.draggable&&this.dragIndex!=t){var n=this.tabs[this.dragIndex];this.tabs.splice(this.dragIndex,1),this.tabs.splice(t,0,n),this.$emit("on-tab-change",{from:this.dragIndex,to:t}),this.dragIndex=t}},dragend:function(){this.draggable&&(this.dragItem=null,this.dragIndex=null)},reset:function(){var e=this;this.tabs=this.cacheTabs,this.cacheTabs=[],this.tabs.forEach((function(t){e.cacheTabs.push(t)}))}}}},function(e,t,n){e.exports={default:n(227),__esModule:!0}},function(e,t,n){n(57),n(59),e.exports=n(76).f("iterator")},function(e,t,n){var i=n(69),o=n(53);e.exports=function(e){return function(t,n){var r,s,a=String(o(t)),u=i(n),l=a.length;return u<0||u>=l?e?"":void 0:(r=a.charCodeAt(u),r<55296||r>56319||u+1===l||(s=a.charCodeAt(u+1))<56320||s>57343?e?a.charAt(u):r:e?a.slice(u,u+2):s-56320+(r-55296<<10)+65536)}}},function(e,t,n){"use strict";var i=n(108),o=n(52),r=n(58),s={};n(24)(s,n(8)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=i(s,{next:o(1,n)}),r(e,t+" Iterator")}},function(e,t,n){var i=n(21),o=n(17),r=n(40);e.exports=n(18)?Object.defineProperties:function(e,t){o(e);var n,s=r(t),a=s.length,u=0;while(a>u)i.f(e,n=s[u++],t[n]);return e}},function(e,t,n){var i=n(27),o=n(56),r=n(70)("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),i(e,r)?e[r]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,n){"use strict";var i=n(233),o=n(234),r=n(32),s=n(30);e.exports=n(106)(Array,"Array",(function(e,t){this._t=s(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),r.Arguments=r.Array,i("keys"),i("values"),i("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){e.exports={default:n(236),__esModule:!0}},function(e,t,n){n(237),n(111),n(243),n(244),e.exports=n(6).Symbol},function(e,t,n){"use strict";var i=n(7),o=n(27),r=n(18),s=n(14),a=n(107),u=n(238).KEY,l=n(26),c=n(71),h=n(58),d=n(54),f=n(8),p=n(76),g=n(77),m=n(239),v=n(240),_=n(17),y=n(25),b=n(56),w=n(30),C=n(68),S=n(52),x=n(108),L=n(241),k=n(242),N=n(73),E=n(21),O=n(40),D=k.f,I=E.f,M=L.f,T=i.Symbol,P=i.JSON,A=P&&P.stringify,R="prototype",F=f("_hidden"),W=f("toPrimitive"),V={}.propertyIsEnumerable,B=c("symbol-registry"),H=c("symbols"),j=c("op-symbols"),z=Object[R],U="function"==typeof T&&!!N.f,$=i.QObject,K=!$||!$[R]||!$[R].findChild,q=r&&l((function(){return 7!=x(I({},"a",{get:function(){return I(this,"a",{value:7}).a}})).a}))?function(e,t,n){var i=D(z,t);i&&delete z[t],I(e,t,n),i&&e!==z&&I(z,t,i)}:I,G=function(e){var t=H[e]=x(T[R]);return t._k=e,t},Y=U&&"symbol"==typeof T.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof T},Z=function(e,t,n){return e===z&&Z(j,t,n),_(e),t=C(t,!0),_(n),o(H,t)?(n.enumerable?(o(e,F)&&e[F][t]&&(e[F][t]=!1),n=x(n,{enumerable:S(0,!1)})):(o(e,F)||I(e,F,S(1,{})),e[F][t]=!0),q(e,t,n)):I(e,t,n)},X=function(e,t){_(e);var n,i=m(t=w(t)),o=0,r=i.length;while(r>o)Z(e,n=i[o++],t[n]);return e},J=function(e,t){return void 0===t?x(e):X(x(e),t)},Q=function(e){var t=V.call(this,e=C(e,!0));return!(this===z&&o(H,e)&&!o(j,e))&&(!(t||!o(this,e)||!o(H,e)||o(this,F)&&this[F][e])||t)},ee=function(e,t){if(e=w(e),t=C(t,!0),e!==z||!o(H,t)||o(j,t)){var n=D(e,t);return!n||!o(H,t)||o(e,F)&&e[F][t]||(n.enumerable=!0),n}},te=function(e){var t,n=M(w(e)),i=[],r=0;while(n.length>r)o(H,t=n[r++])||t==F||t==u||i.push(t);return i},ne=function(e){var t,n=e===z,i=M(n?j:w(e)),r=[],s=0;while(i.length>s)!o(H,t=i[s++])||n&&!o(z,t)||r.push(H[t]);return r};U||(T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var e=d(arguments.length>0?arguments[0]:void 0),t=function(n){this===z&&t.call(j,n),o(this,F)&&o(this[F],e)&&(this[F][e]=!1),q(this,e,S(1,n))};return r&&K&&q(z,e,{configurable:!0,set:t}),G(e)},a(T[R],"toString",(function(){return this._k})),k.f=ee,E.f=Z,n(110).f=L.f=te,n(55).f=Q,N.f=ne,r&&!n(42)&&a(z,"propertyIsEnumerable",Q,!0),p.f=function(e){return G(f(e))}),s(s.G+s.W+s.F*!U,{Symbol:T});for(var ie="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),oe=0;ie.length>oe;)f(ie[oe++]);for(var re=O(f.store),se=0;re.length>se;)g(re[se++]);s(s.S+s.F*!U,"Symbol",{for:function(e){return o(B,e+="")?B[e]:B[e]=T(e)},keyFor:function(e){if(!Y(e))throw TypeError(e+" is not a symbol!");for(var t in B)if(B[t]===e)return t},useSetter:function(){K=!0},useSimple:function(){K=!1}}),s(s.S+s.F*!U,"Object",{create:J,defineProperty:Z,defineProperties:X,getOwnPropertyDescriptor:ee,getOwnPropertyNames:te,getOwnPropertySymbols:ne});var ae=l((function(){N.f(1)}));s(s.S+s.F*ae,"Object",{getOwnPropertySymbols:function(e){return N.f(b(e))}}),P&&s(s.S+s.F*(!U||l((function(){var e=T();return"[null]"!=A([e])||"{}"!=A({a:e})||"{}"!=A(Object(e))}))),"JSON",{stringify:function(e){var t,n,i=[e],o=1;while(arguments.length>o)i.push(arguments[o++]);if(n=t=i[1],(y(t)||void 0!==e)&&!Y(e))return v(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Y(t))return t}),i[1]=t,A.apply(P,i)}}),T[R][W]||n(24)(T[R],W,T[R].valueOf),h(T,"Symbol"),h(Math,"Math",!0),h(i.JSON,"JSON",!0)},function(e,t,n){var i=n(54)("meta"),o=n(25),r=n(27),s=n(21).f,a=0,u=Object.isExtensible||function(){return!0},l=!n(26)((function(){return u(Object.preventExtensions({}))})),c=function(e){s(e,i,{value:{i:"O"+ ++a,w:{}}})},h=function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!r(e,i)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[i].i},d=function(e,t){if(!r(e,i)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[i].w},f=function(e){return l&&p.NEED&&u(e)&&!r(e,i)&&c(e),e},p=e.exports={KEY:i,NEED:!1,fastKey:h,getWeak:d,onFreeze:f}},function(e,t,n){var i=n(40),o=n(73),r=n(55);e.exports=function(e){var t=i(e),n=o.f;if(n){var s,a=n(e),u=r.f,l=0;while(a.length>l)u.call(e,s=a[l++])&&t.push(s)}return t}},function(e,t,n){var i=n(41);e.exports=Array.isArray||function(e){return"Array"==i(e)}},function(e,t,n){var i=n(30),o=n(110).f,r={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(e){try{return o(e)}catch(t){return s.slice()}};e.exports.f=function(e){return s&&"[object Window]"==r.call(e)?a(e):o(i(e))}},function(e,t,n){var i=n(55),o=n(52),r=n(30),s=n(68),a=n(27),u=n(102),l=Object.getOwnPropertyDescriptor;t.f=n(18)?l:function(e,t){if(e=r(e),t=s(t,!0),u)try{return l(e,t)}catch(n){}if(a(e,t))return o(!i.f.call(e,t),e[t])}},function(e,t,n){n(77)("asyncIterator")},function(e,t,n){n(77)("observable")},function(e,t,n){var i=n(0)(n(246),n(247),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/tab-com/tabComponent.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] tabComponent.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i);function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}t.default={props:{component:{type:Object,default:void 0}},mounted:function(){this.component&&o.isObject(this.component)&&this.component.$mount(this.$refs.swap)}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"swap"})},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-tabs"},[n("div",{staticClass:"ui-tabs-header",class:{"ui-tabs-header-card":e.isCard}},[n("div",{ref:"container",staticClass:"ui-tabs-header-container",class:{"ui-tabs-header-scroll":e.scrollable}},[e.scrollable?[n("Icon",{staticClass:"button-left",class:{disabled:0===e.scrollIndex},attrs:{type:"ios-arrow-back",size:"14"},on:{click:e.scrollPrev}}),e._v(" "),n("Icon",{staticClass:"button-right",class:{disabled:e.scrollIndex===e.tabs.length-1},attrs:{type:"ios-arrow-forward",size:"14"},on:{click:e.scrollNext}})]:e._e(),e._v(" "),n("div",{ref:"nav",staticClass:"ui-tabs-header-swap",style:e.navStyle},e._l(e.tabs,(function(t,i){return n("div",{key:t.tabName,ref:t.tabName,refInFor:!0,staticClass:"ui-tabs-header-item",class:e.getHeaderClass(t,i),attrs:{draggable:e.draggable},on:{click:function(n){return e.choose(t,i)},dragstart:function(t){return t.stopPropagation(),e.dragstart(t,i)},dragenter:function(t){return t.stopPropagation(),e.dragenter(t,i)},dragend:function(t){return t.stopPropagation(),e.dragend(t)}}},[n("div",{staticClass:"ui-tabs-header-label"},[t.icon?n("Icon",{attrs:{type:t.icon}}):e._e(),e._v(" "),e.isString(t.label)?[e._v("\n "+e._s(t.label)+"\n ")]:e._e(),e._v(" "),e.isObject(t.label)?[n("tab-component",{attrs:{component:t.label}})]:e._e()],2),e._v(" "),e.closable?n("Icon",{staticClass:"button-close",attrs:{type:"md-close",size:"14"},on:{click:function(n){return n.stopPropagation(),e.removeTab(t)}}}):e._e()],1)})),0)],2),e._v(" "),n("div",{staticClass:"ui-tab-buttons"},[e._t("action")],2)]),e._v(" "),n("div",{staticClass:"ui-tabs-body"},[e._t("default")],2)])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(250),n(251),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/tab-com/tab.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] tab.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1);t.default={name:"Tab",props:{name:{type:[String,Number],default:void 0},label:{type:[String,Object],required:!0},icon:{type:String,default:""},disabled:{type:Boolean,default:!1}},data:function(){return{tabName:"",parent:(0,i.findComponentUpward)(this,"Tabs")}},computed:{show:function(){return this.tabName==this.parent.activeKey}},mounted:function(){this.parent.addTab(this)},destroyed:function(){this.parent.removeTab(this)}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"tabfade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],staticClass:"ui-tab"},[e._t("default")],2)])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(112),o=l(i),r=n(277),s=l(r),a=n(280),u=l(a);function l(e){return e&&e.__esModule?e:{default:e}}t.default={WbTable:o.default,TreeTable:s.default,Column:u.default}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=x(i),r=n(12),s=S(r),a=n(3),u=S(a),l=n(256),c=S(l),h=n(259),d=S(h),f=n(262),p=S(f),g=n(265),m=S(g),v=n(268),_=S(v),y=n(271),b=S(y),w=n(273),C=S(w);function S(e){return e&&e.__esModule?e:{default:e}}function x(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}var L=1;t.default={name:"Table",components:{Icon:u.default,tableAction:c.default,tableText:d.default,tableComponent:p.default,tableExpand:b.default,headComponent:_.default,tableDetailComponent:m.default,editCell:C.default},mixins:[s.default],props:{data:{type:Array,default:void 0},border:{type:Boolean,default:!1},trClass:{type:Function,default:void 0},noDataText:{type:String,default:void 0}},data:function(){return{sortCol:null,renderExpanded:null,expandedList:[],showData:[],children:[],detailList:{}}},computed:{cols:function(){return this.getAllColumns(this.children).filter((function(e){return!e.children.length}))},headerRows:function(){return this.convertToRows(this.children)},classes:function(){return this.border?"ui-table-swap-border":""},selectedAllRow:function(){var e=this,t=this.showData.filter((function(){return!e.disabledRow.apply(e,arguments)}));return t.length&&t.every((function(e){return e._selected}))}},watch:{data:{handler:function(){this.showData=this.makeData()},deep:!0},selectedAllRow:function(){this.$emit("on-select-all",this.getSelected())}},created:function(){this.showData=this.makeData()},methods:{addColumn:function(e){this.children.push(e)},removeColumn:function(e){var t=this.children.indexOf(e);-1!=t&&this.children.splice(t,1)},makeData:function(e){e=e||this.data;var t=[];return o.isArray(e)&&(t=o.deepCopy(e),t.forEach((function(e,t){e._index=t,e._rowKey=L++,void 0===e._selected&&(e._selected=!1)})),this.sortCol&&this.sortData(t)),t},getAllColumns:function(e){var t=this,n=[];return e.forEach((function(e){"Column"==e.$options.name&&(n.push(e),e.children&&e.children.length>0&&n.push.apply(n,t.getAllColumns(e.children)))})),n.forEach((function(e,t){return e.__old_index=t})),n.sort((function(e,t){return e.index-t.index||e.__old_index-t.__old_index}))},convertToRows:function(e){var t=1,n=function e(n,i){if(i&&(n.level=i.level+1,t0){var o=0;n.children.forEach((function(t){e(t,n),o+=t.colSpan||1})),n.colSpan=o}else n.colSpan=1};e.forEach((function(e){"Column"==e.$options.name&&(e.level=1,n(e))}));for(var i=[],o=0;o0&&s.forEach((function(e){r.push(e)}))}return r},getThClass:function(e){var t="",n="ui-table-th-";return e.headTip&&(t=n+"headtip"),t},getTdStyle:function(e){return{"text-align":e.align,width:e.width}},getSortClass:function(e,t){var n=[];return this.sortCol==e&&e.sortDirection==t&&n.push("on"),n},sortData:function(e){var t=this;e.sort((function(e,n){var i=t.sortCol.sortDirection;return"up"===i?e[t.sortCol.prop]>n[t.sortCol.prop]?1:-1:"down"===i?n[t.sortCol.prop]>e[t.sortCol.prop]?1:-1:0}))},sortUp:function(e){this.sortCol=e,this.sortCol.sortDirection="up",this.sortData(this.showData)},sortDown:function(e){this.sortCol=e,this.sortCol.sortDirection="down",this.sortData(this.showData)},thClick:function(e,t,n){e.sort&&(this.sortCol=e,""==this.sortCol.sortDirection?this.sortCol.sortDirection="up":"up"==this.sortCol.sortDirection?this.sortCol.sortDirection="down":"down"==this.sortCol.sortDirection?this.sortCol.sortDirection="up":this.sortCol=null,this.sortData(this.showData)),this.$emit("on-th-click",e,t,n)},trClick:function(e,t,n){this.$emit("on-tr-click",e,t,n)},tdClick:function(e,t,n,i,o,r){if(this.$emit("on-td-click",e,t,n,i),o&&o.detailComponent){var s=r+"_detail_"+o.prop;this.detailList[s]?(this.detailList[s].show=!this.detailList[s].show,this.detailList[s].updateTime=Date.now()):this.$set(this.detailList,s,{rowkey:r,key:s,col:o,show:!0,updateTime:Date.now()})}},fireAction:function(e,t,n){var i=null;this.$vnode&&(i=this.$vnode.context),o.isString(e.func)&&i&&i[e.func]&&i[e.func].call(i||this,t,n),o.isFunction(e.func)&&e.func.call(i||this,t,n)},expand:function(e,t,n){var i=this.expandedList.indexOf(t);-1!=i?(this.expandedList.splice(i,1),this.$emit("on-expand-hide",e,t,n)):(this.expandedList.push(t),this.$emit("on-expand-show",e,t,n))},disabledRow:function(){return!1},changeRowsSelected:function(e){var t=this;e?this.showData.filter((function(e,n){return!t.disabledRow(e,n)})).forEach((function(e){e._selected=!0})):this.showData.filter((function(e,n){return!t.disabledRow(e,n)})).forEach((function(e){e._selected=!1}))},changeRowSelected:function(e,t,n){this.$emit("on-select",e,t,n)},getSelected:function(){var e=this,t=[];return this.showData.filter((function(e){return e._selected})).forEach((function(n){t.push(e.data[n._index])})),t},getTrDetailList:function(e){var t=[];for(var n in this.detailList)this.detailList[n].rowkey===e&&t.push(this.detailList[n]);return t=t.sort((function(e,t){return t.updateTime-e.updateTime})),t},getTdDetailType:function(e,t){var n=t+"_detail_"+e.prop;return this.detailList[n]&&this.detailList[n].show?"down":"ellipsis"}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={"zh-cn":{el:{table:{expandOpen:"展开",expandClose:"关闭"},datepicker:{weekFirstDay:"1",wheel:"滚动选择",prevMonth:"上个月",nextMonth:"下个月",selectDate:"请选择日期",confirmBtn:"确定",timeTitle:"YYYY年 MMMM DD日",footSelectTime:"选择时间",footSelectDate:"选择日期",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},yearSuffix:"年",month1:"1月",month2:"2月",month3:"3月",month4:"4月",month5:"5月",month6:"6月",month7:"7月",month8:"8月",month9:"9月",month10:"10月",month11:"11月",month12:"12月",months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},timepicker:{placeholder:"请选择时间"},input:{chooseFile:"请选择文件"},message:{confirm:"确定",cancel:"取消"},select:{placeholder:"请选择",searchPlaceholder:"请输入关键字搜索"},tooltip:{confirm:"确定",cancel:"取消"},upload:{placeholder:"点击选择上传文件",suffixTip:'文件"{filename}"格式不正确, 只支持上传"{suffix}"后缀的文件',sizeTip:'文件"{filename}"大小不能超过{size}MB',heightTip:'文件"{filename}"高度不能超过{height}px',widthTip:'文件"{filename}"宽度不能超过{width}px'},zoom:{close:"关闭"},pagination:{pprev:"向前{n}页",prev:"上一页",next:"下一页",nnext:"向后{n}页",first:"第一页",last:"最后一页",n:"第{n}页",select:"{n} 条/页",jumper:{pre:"跳至",next:"页"}}}},en:{el:{table:{expandOpen:"Open",expandClose:"Close"},datepicker:{weekFirstDay:"7",wheel:"Wheel select",prevMonth:"Previous month",nextMonth:"Next month",selectDate:"Select date",confirmBtn:"OK",timeTitle:"MMMM DD YYYY",footSelectTime:"select time",footSelectDate:"select date",yearSuffix:"",weeks:{sun:"Su",mon:"Mo",tue:"Tu",wed:"We",thu:"Th",fri:"Fr",sat:"Sa"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"},month1:"Jan",month2:"Feb",month3:"Mar",month4:"Apr",month5:"May",month6:"Jun",month7:"Jul",month8:"Aug",month9:"Sep",month10:"Oct",month11:"Nov",month12:"Dec"},timepicker:{placeholder:"Select time"},input:{chooseFile:"Select a file"},message:{confirm:"OK",cancel:"Cancel"},select:{placeholder:"Select",searchPlaceholder:"Enter a keyword search"},tooltip:{confirm:"OK",cancel:"Cancel"},upload:{placeholder:"Upload files",suffixTip:'File "{filename}" format is incorrect. Only files with suffix {suffix} can be uploaded',sizeTip:'File "{filename}" size exceeds {size}MB',heightTip:'File "{filename}" height exceeds {height}px',widthTip:'File "{filename}" width exceeds {width}px'},zoom:{close:"Close"},pagination:{pprev:"Previous {n} pages",prev:"Previous page",next:"Next page",nnext:"Next {n} pages",first:"Frist page",last:"Last page",n:"Page {n}",select:"{n} / Page",jumper:{pre:"Goto",next:""}}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(31),o=s(i);t.default=function(){function e(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i0&&(n=i[0].text)}else o.isFunction(e.filter)&&(n=e.filter(n,this.trData));return n}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",[e._v("\n "+e._s(e.text)+"\n")])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(263),n(264),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/tableComponent.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] tableComponent.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i);function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}t.default={props:{col:{type:Object,default:void 0},trData:{type:Object,default:void 0}},mounted:function(){if(this.col.component&&o.isFunction(this.col.component)){var e=null;this.$parent&&this.$parent.$vnode&&(e=this.$parent.$vnode.context);var t=this.col.component.call(e||this.col,this.trData,this.trData[this.col.prop]);t.$mount(this.$refs.swap)}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"swap"})},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(266),n(267),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/tableDetailComponent.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] tableDetailComponent.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i);function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}t.default={props:{cols:{type:Array,default:void 0},col:{type:Object,default:void 0},trData:{type:Object,default:void 0},tdData:{type:Object,default:void 0}},mounted:function(){if(this.col.detailComponent&&o.isFunction(this.col.detailComponent)){var e=null;this.$parent&&this.$parent.$vnode&&(e=this.$parent.$vnode.context);var t=this.col.detailComponent.call(e||this.col,this.trData,this.trData[this.col.prop]);t.$mount(this.$refs.swap)}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("td",{staticClass:"ui-table-detail-cell",attrs:{colspan:e.cols.length}},[n("div",{ref:"swap"})])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(269),n(270),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/headComponent.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] headComponent.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i);function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}t.default={props:{col:{type:Object,default:void 0}},mounted:function(){var e=null,t=void 0;this.$parent&&this.$parent.$vnode&&(e=this.$parent.$vnode.context),this.col.name&&o.isFunction(this.col.name)&&(t=this.col.name.call(e||this.col)),this.col.name&&o.isObject(this.col.name)&&(t=this.col.name),t&&t.$mount(this.$refs.swap)}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"swap"})},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(272),null,null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/tableExpand.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{cols:{type:Array,default:void 0},trData:{type:Object,default:void 0},renderExpanded:{type:Function,default:void 0}},data:function(){return{}},render:function(e){return e("td",{attrs:{colspan:this.cols.length},class:"ui-table-expanded-cell"},[this.renderExpanded(this.trData)])}}},function(e,t,n){var i=n(0)(n(274),n(275),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/editCell.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] editCell.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=c(i),r=n(1),s=l(r),a=n(29),u=c(a);function l(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function c(e){return e&&e.__esModule?e:{default:e}}t.default={components:{Icon:o.default},directives:{clickoutside:u.default},props:{col:{type:Object,default:void 0},trData:{type:Object,default:void 0}},data:function(){return{newValue:"",isEditing:!1,editConf:this.col.editableConf,optionList:this.col.editableConf.list||[],limit:this.col.editableConf.multipleLimit,multiple:this.col.editableConf.multiple}},computed:{text:function(){var e=this.col,t=this.trData[e.prop];return s.isFunction(e.filter)?t=e.filter(t,this.trData):s.isArray(t)&&(t=t.join(",")),t}},mounted:function(){"select"===this.editConf.type&&this.multiple&&(this.newValue=[])},methods:{edit:function(){var e=this;if(this.newValue=this.text,"select"===this.editConf.type)if(this.multiple)this.newValue=[].concat(this.trData[this.col.prop]);else{var t=this.optionList.find((function(t){return t.value===e.trData[e.col.prop]||t.label===e.trData[e.col.prop]}));this.newValue=t&&t.value}this.initValue=this.newValue,this.isEditing=!0},confirmChange:function(){var e=this;if(this.newValue===this.initValue)return this.reset();var t=!0,n=this.editConf,i=n.validate,o=n.confirm;if(s.isFunction(i)){var r=[this.trData[this.col.prop],this.newValue,this.trData];t=i.apply(this.col,r)}o?!0===t?this.showConfirm():t&&s.isFunction(t.then)&&t.then((function(){e.showConfirm()})):this.change()},showConfirm:function(){var e=this,t="";"string"===typeof this.col.name&&(t=this.col.name),this.$Message.confirm("修改","是否确认修改"+t+"?").then((function(t){0===t&&e.change(),e.reset()}))},change:function(){if(s.isFunction(this.editConf.change)){var e=[this.trData[this.col.prop],this.newValue,this.col,this.trData];this.editConf.change.apply(null,e),this.reset()}},reset:function(){this.isEditing=!1}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.reset,expression:"reset"}],staticClass:"ui-table-edit-cell"},[e.isEditing?"input"===e.editConf.type?n("Wb-input",{model:{value:e.newValue,callback:function(t){e.newValue=t},expression:"newValue"}}):"select"===e.editConf.type?n("Wb-select",{attrs:{"multiple-limit":e.limit,multiple:e.multiple,filterable:""},model:{value:e.newValue,callback:function(t){e.newValue=t},expression:"newValue"}},e._l(e.optionList,(function(t){return n("wb-option",{key:t.value,attrs:{value:t.value}},[e._v("\n "+e._s(t.label)+"\n ")])})),1):e._e():n("div",[e._v("\n "+e._s(e.text)+"\n "),n("Icon",{staticClass:"edit-icon",attrs:{type:"md-create",size:"12"},on:{click:function(t){return t.stopPropagation(),e.edit(t)}}})],1),e._v(" "),e.isEditing?n("Icon",{staticClass:"edit-icon",attrs:{type:"md-checkmark",size:"14"},on:{click:e.confirmChange}}):e._e()],1)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-table-swap",class:e.classes},[e._t("default"),e._v(" "),n("table",{staticClass:"ui-table"},[n("thead",{staticClass:"ui-table-thead"},e._l(e.headerRows,(function(t,i){return n("tr",{key:i},e._l(t,(function(t,i){return n("th",{key:t.uid,class:e.getThClass(t,i),style:e.getTdStyle(t),attrs:{colspan:t.colSpan,rowspan:t.rowSpan},on:{click:function(n){return e.thClick(t,i,n)}}},[t.type?e._e():[t.headTip?[n("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.headTip,expression:"col.headTip"}]},[e._v(e._s(t.name))]),e._v(" "),n("Icon",{attrs:{type:"md-information-circle-outline",color:"#aaa",size:"12"}})]:["string"===typeof t.name?[e._v("\n "+e._s(t.name)+"\n ")]:[n("head-component",{attrs:{col:t}})],e._v(" "),t.sort?n("div",{staticClass:"ui-table-column-sorter"},[n("span",{staticClass:"ui-table-column-sorter-up",class:e.getSortClass(t,"up"),attrs:{title:"↑"},on:{click:function(n){return n.stopPropagation(),e.sortUp(t)}}},[n("Icon",{attrs:{type:"md-arrow-dropup"}})],1),e._v(" "),n("span",{staticClass:"ui-table-column-sorter-down",class:e.getSortClass(t,"down"),attrs:{title:"↓"},on:{click:function(n){return n.stopPropagation(),e.sortDown(t)}}},[n("Icon",{attrs:{type:"md-arrow-dropdown"}})],1)]):e._e()]],e._v(" "),"selection"==t.type?[n("Checkbox",{attrs:{value:e.selectedAllRow},on:{click:e.changeRowsSelected}})]:e._e()],2)})),0)})),0),e._v(" "),n("tbody",{staticClass:"ui-table-tbody"},[e._l(e.showData,(function(t,i){return[n("tr",{key:t._rowKey,class:e.getTrClass(i,e.data[t._index]),on:{click:function(n){return e.trClick(e.data[t._index],i,n)}}},e._l(e.cols,(function(o,r){return n("td",{key:o.uid,class:e.getTdClass(o,r,e.data[t._index][o.prop],e.data[t._index]),style:e.getTdStyle(o),on:{click:function(n){return e.tdClick(e.data[t._index],e.data[t._index][o.prop],r,n,o,t._rowKey)}}},["expand"===o.type?[n("div",{directives:[{name:"show",rawName:"v-show",value:-1==e.expandedList.indexOf(i),expression:"expandedList.indexOf(rowIndex) == -1"}],staticClass:"ui-table-icon",attrs:{title:e.t("el.table.expandOpen")},on:{click:function(n){return e.expand(e.data[t._index],i,n)}}},[n("Icon",{attrs:{type:"ios-arrow-forward"}})],1),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:-1!=e.expandedList.indexOf(i),expression:"expandedList.indexOf(rowIndex) != -1"}],staticClass:"ui-table-icon",attrs:{title:e.t("el.table.expandClose")},on:{click:function(n){return e.expand(e.data[t._index],i,n)}}},[n("Icon",{attrs:{type:"ios-arrow-down"}})],1)]:e._e(),e._v(" "),"selection"===o.type?[n("Checkbox",{attrs:{disabled:e.disabledRow(e.data[t._index],i)},on:{"on-change":function(n){return e.changeRowSelected(e.data[t._index],i,t._selected)}},model:{value:t._selected,callback:function(n){e.$set(t,"_selected",n)},expression:"trData._selected"}})]:[o.action||o.component||o.editable?e._e():n("table-text",{attrs:{col:o,"tr-data":e.data[t._index]}}),e._v(" "),o.action?n("table-action",{attrs:{col:o,"tr-data":e.data[t._index]},on:{"on-click":e.fireAction}}):e._e(),e._v(" "),!o.editable&&o.component?n("table-component",{attrs:{col:o,"tr-data":e.data[t._index]}}):e._e(),e._v(" "),o.editable&&!o.component?n("edit-cell",{attrs:{col:o,"tr-data":e.data[t._index]}}):e._e()],e._v(" "),o.detailComponent?n("Icon",{staticClass:"ui-table-detail-icon",attrs:{type:e.getTdDetailType(o,t._rowKey)}}):e._e()],2)})),0),e._v(" "),e.renderExpanded?n("tr",{key:t._rowKey+"_expanded"},[n("table-expand",{directives:[{name:"show",rawName:"v-show",value:-1!=e.expandedList.indexOf(i),expression:"expandedList.indexOf(rowIndex) != -1"}],attrs:{"render-expanded":e.renderExpanded,cols:e.cols,"tr-data":e.data[t._index]}})],1):e._e(),e._v(" "),e._l(e.getTrDetailList(t._rowKey),(function(i){return n("tr",{key:i.key},[n("table-detail-component",{directives:[{name:"show",rawName:"v-show",value:i.show,expression:"detail.show"}],attrs:{cols:e.cols,col:i.col,"tr-data":e.data[t._index]}})],1)}))]}))],2)]),e._v(" "),e.noDataText?n("div",{directives:[{name:"show",rawName:"v-show",value:0==e.showData.length,expression:"showData.length == 0"}],staticClass:"ui-table-empty"},[e._v("\n "+e._s(e.noDataText)+"\n ")]):e._e()],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(278),n(279),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/treeTable.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] treeTable.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(112),o=u(i),r=n(1),s=a(r);function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function u(e){return e&&e.__esModule?e:{default:e}}t.default={name:"TreeTable",extends:o.default,watch:{data:{handler:function(){this.showData=this.makeData(this.objectToArray(this.data))},deep:!0}},created:function(){this.showData=this.makeData(this.objectToArray(this.data))},methods:{getArrowType:function(e){var t="";return t=e?"md-arrow-dropdown":"md-arrow-dropright",t},getTdStyle:function(e,t){return{"text-align":0===t?"left":e.align,width:e.width}},objectToArray:function(e,t,n){if(t=t||[],s.isArray(e))for(var i=s.deepCopy(e),o=i.length,r=0;r0&&(a._expanded=void 0!==a._expanded&&a._expanded,this.objectToArray(a.children,t,a))}return t},getTreeTdClass:function(e,t,n,i){var o=this.getTdClass(e,t,n,i);return 0==t&&o.push("tree-level-"+i._seq.split(".").length),o},isShow:function(e){var t=this,n=function e(n){var i=t.showData.filter((function(e){return e._seq==n._parentSeq}));return!i[0]||!!i[0]._expanded&&e(i[0])};return n(e)},toggle:function(e){void 0!==e._expanded&&(e._expanded=!e._expanded)},getOriginalData:function(e){var t=this,n=null;return e._seq.split(".").forEach((function(e){n=null==n?t.data[e-1]:n.children[e-1]})),n}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-table-swap",class:e.classes},[e._t("default"),e._v(" "),n("table",{staticClass:"ui-table"},[n("thead",{staticClass:"ui-table-thead"},e._l(e.headerRows,(function(t,i){return n("tr",{key:i},e._l(t,(function(t,i){return n("th",{key:i,style:e.getTdStyle(t,i),attrs:{colspan:t.colSpan,rowspan:t.rowSpan},on:{click:function(n){return e.thClick(t,i,n)}}},[n("span",[e._v("\n "+e._s(t.name)+"\n "),t.sort?n("div",{staticClass:"ui-table-column-sorter"},[n("span",{staticClass:"ui-table-column-sorter-up",class:e.getSortClass(t,"up"),attrs:{title:"↑"},on:{click:function(n){return n.stopPropagation(),e.sortUp(t)}}},[n("Icon",{attrs:{type:"md-arrow-dropup"}})],1),e._v(" "),n("span",{staticClass:"ui-table-column-sorter-down",class:e.getSortClass(t,"down"),attrs:{title:"↓"},on:{click:function(n){return n.stopPropagation(),e.sortDown(t)}}},[n("Icon",{attrs:{type:"md-arrow-dropdown"}})],1)]):e._e()])])})),0)})),0),e._v(" "),n("tbody",{staticClass:"ui-table-tbody"},e._l(e.showData,(function(t,i){return n("tr",{directives:[{name:"show",rawName:"v-show",value:e.isShow(t),expression:"isShow(trData)"}],key:t._rowKey,class:e.getTrClass(i),on:{click:function(n){e.trClick(e.getOriginalData(t),i,n)}}},e._l(e.cols,(function(i,o){return n("td",{key:o,class:e.getTreeTdClass(i,o,t[i.prop],t),style:e.getTdStyle(i,o),on:{click:function(n){return e.tdClick(t,t[i.prop],o,n)}}},[t.children&&t.children.length>0&&0==o?n("Icon",{staticClass:"ui-expand-arrow",attrs:{type:e.getArrowType(t._expanded)},on:{click:function(n){return n.stopPropagation(),e.toggle(t,n)}}}):n("i",{staticClass:"ui-expand-null"}),e._v(" "),i.action||i.component?e._e():n("table-text",{attrs:{col:i,"tr-data":t}}),e._v(" "),i.action?n("table-action",{attrs:{col:i,"tr-data":t},on:{"on-click":e.fireAction}}):e._e(),e._v(" "),i.component?n("table-component",{attrs:{col:i,"tr-data":t}}):e._e()],1)})),0)})),0)]),e._v(" "),e.noDataText?n("div",{directives:[{name:"show",rawName:"v-show",value:0==e.showData.length,expression:"showData.length == 0"}],staticClass:"ui-table-empty"},[e._v("\n "+e._s(e.noDataText)+"\n ")]):e._e()],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(281),null,null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/column.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(49),o=u(i),r=n(1),s=a(r);function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function u(e){return e&&e.__esModule?e:{default:e}}var l={type:"input",multiple:!1,multipleLimit:1,confirm:!1,validate:function(){return!0},change:void 0};t.default={name:"Column",props:{prop:{type:String,default:void 0},name:{type:[String,Function,Object],default:void 0},align:{type:String,default:"center"},index:{type:Number,default:0},filter:{type:[Array,Function],default:void 0},action:{type:[Array,Object],default:void 0},sort:{type:Boolean,default:!1},width:{type:String,default:void 0},classes:{type:[String,Function],default:void 0},component:{type:Function,default:void 0},type:{type:String,default:void 0},headTip:{type:String,default:""},disabled:{type:Function,default:void 0},detailComponent:{type:Function,default:void 0},editable:{type:Object,default:null}},data:function(){return{sortDirection:"",children:[],parent:this.$parent}},computed:{editableConf:function(){var e={};return s.isObject(this.editable)&&(e=(0,o.default)({},l,this.editable)),e}},created:function(){var e=this;this.$options.render=function(t){return t("span",e.$slots.default)};var t=this;"expand"===this.type&&(this.parent.renderExpanded=function(e){return t.$scopedSlots.default?t.$scopedSlots.default(e):t.$slots.default}),"selection"==this.type&&s.isFunction(this.disabled)&&(this.parent.disabledRow=this.disabled)},mounted:function(){this.action&&s.isObject(this.action)&&!s.isArray(this.action)&&(this.action=[this.action]),this.children=this.$children.filter((function(e){return"Column"==e.$options.name})),!this.parent||"Table"!=this.parent.$options.name&&"TreeTable"!=this.parent.$options.name||(this.uid=this._uid,this.parent.addColumn(this))},beforeDestroy:function(){!this.parent||"Table"!=this.parent.$options.name&&"TreeTable"!=this.parent.$options.name||this.parent.removeColumn(this)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(283),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default=o.default},function(e,t,n){var i=n(0)(n(284),n(285),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/carousel/carousel.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] carousel.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"Carousel",props:{interval:{type:Number,default:6e3},data:{type:Array,required:!0}},data:function(){return{baseWidth:0,current:0,timerId:null}},computed:{listWidth:function(){return this.useList.length*this.baseWidth},getListStyle:function(){return{width:this.listWidth+"px",transform:"translate("+-1*this.baseWidth*this.current+"px, 0)"}},getItemStyle:function(){return{width:this.baseWidth+"px"}},useList:function(){var e=this.data.slice(0);return e.forEach((function(e){e.link=e.link||"javascript:void 0"})),e}},mounted:function(){this.baseWidth=this.$refs.carousel.offsetWidth,this.timerId=this.createTimer()},destroyed:function(){this.timerId&&(clearTimeout(this.timerId),this.timerId=null)},methods:{createTimer:function(){var e=this;return setTimeout((function(){e.useList&&e.useList.length>0&&(e.current==e.useList.length-1?e.current=0:e.current+=1),e.timerId=e.createTimer()}),this.interval)},go:function(e){clearTimeout(this.timerId),this.timerId=null,this.current=e,this.timerId=this.createTimer()}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"carousel",staticClass:"ui-carousel"},[n("div",{staticClass:"ui-carousel-list",style:e.getListStyle},e._l(e.useList,(function(t,i){return n("div",{key:i,staticClass:"ui-carousel-list-item",style:e.getItemStyle},[n("a",{attrs:{href:t.link}},[n("img",{attrs:{src:t.image}})])])})),0),e._v(" "),e.useList.length>1?n("div",{staticClass:"ui-carousel-dot"},e._l(e.useList,(function(t,i){return n("li",{key:i,staticClass:"ui-carousel-dot-item",class:{current:e.current==i},on:{click:function(t){return e.go(i)}}})})),0):e._e()])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Calendar=void 0;var i=n(115);Object.defineProperty(t,"Calendar",{enumerable:!0,get:function(){return s(i).default}});var o=n(306),r=s(o);function s(e){return e&&e.__esModule?e:{default:e}}t.default=r.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(78),o=_(i),r=n(293),s=_(r),a=n(29),u=_(a),l=n(75),c=_(l),h=n(80),d=_(h),f=n(12),p=_(f),g=n(1),m=v(g);function v(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function _(e){return e&&e.__esModule?e:{default:e}}t.default={name:"Calendars",components:{Calendar:s.default,WbButton:c.default},directives:{clickoutside:u.default},mixins:[d.default,p.default],props:{value:{type:[Date,Array,Number],default:null},model:{default:"single",validator:function(e){return-1!==["single","multiple","range"].indexOf(e)}},showConfirm:{type:Boolean,default:!1},showInline:{type:Boolean,default:!0},inline:{type:Boolean,default:!0},enableTime:{type:Boolean,default:!1},enableSeconds:{type:Boolean,default:!1},onlyMonth:{type:Boolean,default:!1},format:{type:String,default:"YYYY-MM-DD"},maxDate:{type:Date,default:null},minDate:{type:Date,default:null},maxRange:{type:String,default:void 0},disable:{type:Array,default:function(){return[]}},enable:{type:Array,default:function(){return[]}},disabledDate:{type:Function,default:function(){return!1}}},leftTime:null,rightTime:null,data:function(){return{dates:null,showArrow:!1,showTime:!1}},computed:{range:function(){return"range"===this.model},showTimeBth:function(){return-1!==this.vFormat.indexOf("H")},confirm:function(){return this.showConfirm||-1!==this.vFormat.indexOf("H")||"multiple"===this.model},confirmDisabled:function(){return this.range?!(this.dates[0]&&this.dates[1]):!this.dates||0===this.dates.length}},watch:{value:function(){var e=this.get();this.isEqual(this.value,e)||this.valueToDate(this.value)}},created:function(){this.valueToDate(this.value)},methods:{get:function(){return Array.isArray(this.dates)?this.dates[0]?this.dates.map((function(e){return e.getTime()})):null:this.dates?this.dates.getTime():null},valueToDate:function(e){"single"===this.model?this.dates=e?new Date(e):null:this.isEmpty(e)?this.dates="range"===this.model?[null,null]:[]:this.dates=e.map((function(e){return new Date(e)}))},formatRangeStartTime:function(e,t){var n=this,i=function(e){return-1!==(t||n.vFormat).indexOf(e)},o=e.getFullYear(),r=e.getMonth(),s=e.getDate(),a=e.getHours(),u=e.getMinutes();return i("s")?new Date(e):i("m")&&(i("h")||i("H"))?new Date(o,r,s,a,u,0):i("D")?new Date(o,r,s,0,0,0):i("M")?new Date(o,r,1,0,0,0):i("Y")?new Date(o,0,1,0,0,0):new Date(e)},formatRangeEndTime:function(e,t){var n=this,i=function(e){return-1!==(t||n.vFormat).indexOf(e)},o=new Date(e);if(i("s"))return o;if(i("m")&&(i("h")||i("H")))return new Date(o.getTime()+59e3);if(i("D"))return new Date(o.getTime()+864e5-1e3);if(i("M"))return o.setMonth(o.getMonth()+1),new Date(o.getTime()-1e3);if(i("Y"))return o.setFullYear(o.getFullYear()+1),new Date(o.getTime()-1e3);throw new Error("Error time format: "+this.vFormat)},resetRangeDates:function(){this.rangeIsComplete()&&(this.dates=[null,null])},rangeIsComplete:function(){return this.dates&&this.dates[0]&&this.dates[1]},leftRangeChange:function(e,t,n){if(n)this.rightRangeChange(e,t);else{if(t)this.dates.splice(0,1,e);else{this.resetRangeDates();var i=this.dates;this.isEmpty(i)||!this.dates[0]?i.splice(0,1,e):i[0]>e?(i.splice(1,1,this.formatRangeEndTime(i[0])),i.splice(0,1,e)):i.splice(1,1,this.formatRangeEndTime(e))}this.rangeChange(e,t)}},rightRangeChange:function(e,t,n){if(n)this.leftRangeChange(e,t);else{if(t)this.dates.splice(1,1,this.formatRangeEndTime(e));else{this.resetRangeDates();var i=this.dates;this.isEmpty(i)||!this.dates[1]?i.splice(1,1,this.formatRangeEndTime(e)):i[1]>e?i.splice(0,1,e):(i.splice(0,1,this.formatRangeStartTime(i[1])),i.splice(1,1,this.formatRangeEndTime(e)))}this.rangeChange(e,t)}},rangeChange:function(e,t){if(this.rangeIsComplete()){if(1===this.contrastDate(this.dates[0],this.dates[1],this.vFormat))if(t&&this.isSameDay(this.dates[0],this.dates[1]))this.dates.splice(1,1,this.formatRangeEndTime(this.dates[0]));else{var n=(0,o.default)(this.dates,2),i=n[0],r=n[1];this.dates=[this.formatRangeStartTime(r),this.formatRangeEndTime(i)]}this.noticeParent(e,t)}},change:function(e,t){var n=this;if("single"===this.model)this.dates&&0===this.contrastDate(e,this.dates,this.vFormat)||(this.dates=e,this.noticeParent(e,t));else if("multiple"===this.model){if(t)this.dates.pop(),this.dates.push(e);else{var i=this.dates.findIndex((function(t){return 0===n.contrastDate(t,e,n.vFormat)}));-1!==i?this.dates.splice(i,1):this.dates.push(e)}this.noticeParent(e,t)}},noticeParent:function(e,t){this.$emit("input",this.get()),this.$emit("on-change",this.get(),e),t||this.confirm||this.finished()},beyondTimeScope:function(e,t,n,i){return-1===this.contrastDate(n,e,i)||1===this.contrastDate(n,t,i)},isTagTime:function(e,t,n){var i=e.length;if(i>0)for(var o=0;o0&&(o=!this.isTagTime(this.enable,e,t)),n||i||this.isTagTime(this.disable,e,t)||o||this.maxRangeDisabled(e,t)||this.disabledDate(e,t)},finished:function(){this.showTime=!1,this.$emit("on-finish")},is:function(e){return-1!==this.vFormat.indexOf(e)},currentChange:function(){var e=this.$options,t=e.leftTime,n=e.rightTime;if(t&&n)if(this.is("D")){var i=Math.abs(n.month-t.month);n.year===t.year&&(1===i||11===i)||n.year-t.year===1&&11===i?this.showArrow=!1:this.showArrow=!0}else this.is("M")?Math.abs(n.year-t.year)<=1?this.showArrow=!1:this.showArrow=!0:Math.abs((n.year/10|0)-(t.year/10|0))<=1?this.showArrow=!1:this.showArrow=!0},leftCurrentChange:function(e){this.$options.leftTime=e,this.currentChange()},rightCurrentChange:function(e){this.$options.rightTime=e,this.currentChange()},onSelectTime:function(){this.confirmDisabled||(this.showTime=!this.showTime)},formatRange:function(){if(this.range)if(this.dates[1]&&!this.dates[0]){var e=this.formatRangeStartTime(this.dates[1]);this.dates.splice(0,1,e),this.noticeParent(e,!1)}else if(this.dates[0]&&!this.dates[1]){var t=this.formatRangeEndTime(this.dates[0]);this.dates.splice(1,1,t),this.noticeParent(t,!1)}}}}},function(e,t,n){e.exports={default:n(289),__esModule:!0}},function(e,t,n){n(59),n(57),e.exports=n(290)},function(e,t,n){var i=n(79),o=n(8)("iterator"),r=n(32);e.exports=n(6).isIterable=function(e){var t=Object(e);return void 0!==t[o]||"@@iterator"in t||r.hasOwnProperty(i(t))}},function(e,t,n){n(59),n(57),e.exports=n(292)},function(e,t,n){var i=n(17),o=n(117);e.exports=n(6).getIterator=function(e){var t=o(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return i(t.call(e))}},function(e,t,n){var i=n(0)(n(294),n(304),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/date-picker/calendar.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] calendar.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(78),o=g(i),r=n(118),s=g(r),a=n(3),u=g(a),l=n(120),c=g(l),h=n(80),d=g(h),f=n(12),p=g(f);function g(e){return e&&e.__esModule?e:{default:e}}var m=1,v=2,_=4,y=8,b=16,w=32,C=m+v,S=C+_,x=S+y,L=x+b,k=L+w,N=["sun","mon","tue","wed","thu","fri","sat"];t.default={name:"Calendar",components:{Icon:u.default,TimeSelect:c.default},mixins:[d.default,p.default],props:{value:{type:[Date,Array],default:function(){return new Date}},model:{default:"single",validator:function(e){return-1!==["single","range","multiple"].indexOf(e)}},format:{type:String,default:"YYYY-MM-DD"},position:{default:void 0,validator:function(e){return["left","right"].includes(e)}},disabledDate:{type:Function,default:function(){return!1}},showLeftArrow:{type:Boolean,default:!0},showRightArrow:{type:Boolean,default:!0},showTime:{type:Boolean,default:!1}},data:function(){return{months:["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],pattern:0,showYears:!1,showMonths:!1,showHours:!1,showMinutes:!1,showSeconds:!1,times:"",current:{}}},computed:{weekFirstDay:function(){return(0,s.default)(this.t("el.datepicker.weekFirstDay"))},WEEKS:function(){var e=this.weekFirstDay;return N.concat(N).slice(e,e+7)},yearStart:function(){return 10*parseInt(this.current.year/10)},yearEnd:function(){return this.yearStart+9},years:function(){var e=[],t=this.yearStart;while(e.length<10)e.push(t++);return e},days:function(){var e=[],t=this.current,n=t.year,i=t.month,o=new Date(n,i,1),r=this.weekFirstDay;o.setDate(0);var s=o.getDate(),a=o.getDay()||7,u=r<=a?a-r+1:a+(7-r+1);while(u>0)e.push({day:s-u+1,year:i>0?n:n-1,month:i>0?i-1:11,pre:!0}),u--;o.setMonth(o.getMonth()+2,0),s=o.getDate();var l=1;for(l=1;l<=s;l++)e.push({day:l,year:n,month:i});for(l=1;e.length<42;l++)e.push({day:l,year:i<11?n:n+1,month:i<11?i+1:0,next:!0});return e},hasMonth:function(){return this.pattern>=C},hasDay:function(){return this.pattern>=S},hasHour:function(){return this.pattern>=x},hasMinute:function(){return this.pattern>=L},hasSecond:function(){return this.pattern>=k},tFormat:function(){var e=[];return this.hasHour&&e.push("HH"),this.hasMinute&&e.push("mm"),this.hasSecond&&e.push("ss"),e.join(":")},vShowTime:function(){return this.showTime&&this.pattern>=x},getSeletedTime:function(){var e=this.value;return"single"===this.model?[e]:e.filter((function(e){return e}))},timeTitle:function(){var e=this.t("el.datepicker.timeTitle");return"single"===this.model?this.timeFormat(this.value,e):"multiple"===this.model?this.timeFormat(this.value[this.value.length-1],e):"left"===this.position?this.timeFormat(this.value[0],e):this.timeFormat(this.value[1],e)}},watch:{value:function(e){this.initTime(e)},current:{handler:function(){this.$emit("onCurrentChange",this.current)},deep:!0}},created:function(){var e=this,t=function(t){return-1!==e.format.indexOf(t)};t("Y")&&(this.pattern+=m),t("M")&&(this.pattern+=v),t("D")&&(this.pattern+=_),t("H")&&(this.pattern+=y),t("m")&&(this.pattern+=b),t("s")&&(this.pattern+=w),this.pattern===m?this.showYears=!0:this.pattern===C&&(this.showMonths=!0),this.initTime(this.value)},methods:{parseDate:function(e){var t=new Date(e);return{year:t.getFullYear(),month:t.getMonth(),day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),raw:t}},defaultDate:function(){var e=new Date;return"range"===this.model&&"right"===this.position&&(this.hasDay?e.setMonth(e.getMonth()+1):this.pattern===C?e.setFullYear(e.getFullYear()+1):this.pattern===m&&e.setFullYear(e.getFullYear()+10)),e},initTime:function(e){this.times=this.getTime(e),this.current=this.getCurrentDate(e)},padStartZero:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(""+e).padStart(t,"0")},getTime:function(e){var t=this.get(e,!0),n=t.hour,i=t.minute,o=t.second,r=[];return this.hasHour&&r.push(this.padStartZero(n)),this.hasMinute&&r.push(this.padStartZero(i)),this.hasSecond&&r.push(this.padStartZero(o)),r.join(":")},getRangeDate:function(e,t){return this.inOnePanel(e,this.format)?e[0].getFullYear()===t.getFullYear()&&("left"===this.position&&e[0].getMonth()<=t.getMonth()||"right"===this.position&&e[0].getMonth()>=t.getMonth())?e[0]:t:"left"===this.position?e[0]||t:e[1]||t},getCurrentDate:function(e){var t=this.get(e),n=t.year,i=t.month,o=t.day;return{year:n,month:i,day:o}},get:function(e,t){var n=this.defaultDate();if(!this.isEmpty(e)){var i=this.model;"multiple"===i?n=e[e.length-1]:"range"===i?n=t?("left"===this.position?e[0]:e[1])||n:this.getRangeDate(e,n):"single"===i&&(n=e)}return this.parseDate(n)},isSelected:function(e,t){var n=this;if(this.isEmpty(this.value))return!1;var i=this.getSeletedTime;return i.some((function(i){var o=n.timeFormat(i,t)===n.timeFormat(e,t);if("range"===n.model){if(n.pattern>=S)return o&&n.current.month===e.getMonth();if(n.pattern===m)return o&&(n.current.year/10|0)===(e.getFullYear()/10|0)}return o}))},isSelectedYear:function(e,t){return this.pattern!==m?e.getFullYear()===this.current.year:this.isSelected(e,t)},isSelectedMonth:function(e,t){return this.pattern!==C?e.getMonth()===this.current.month:this.isSelected(e,t)},inRangeDate:function(e,t){if("range"===this.model&&!this.isEmpty(this.value)){var n=(0,o.default)(this.value,2),i=n[0],r=n[1],s=i&&r&&1===this.contrastDate(e,i,t)&&-1===this.contrastDate(e,r,t);return this.pattern>=S?s&&e.getMonth()===this.current.month:s}return!1},yearCls:function(e){var t=new Date(e,0),n="YYYY",i={"ui-calendar-date":!0,"ui-calendar-date-disabled":this.disabledDate(t,n),"ui-calendar-date-selected":this.isSelectedYear(t,n)};return this.pattern===m&&(i["ui-calendar-date-on"]=this.inRangeDate(t,n)),i},monthCls:function(e){var t="YYYY-MM",n=this.current.year,i=new Date(n,e),o={"ui-calendar-date":!0,"ui-calendar-date-disabled":this.disabledDate(i,t),"ui-calendar-date-selected":this.isSelectedMonth(i,t)};return this.pattern===C&&(o["ui-calendar-date-on"]=this.inRangeDate(i,t)),o},dayCls:function(e){var t="YYYY-MM-DD",n=e.year,i=e.month,o=new Date(n,i+1,0).getDate(),r=e.day>o?o:e.day,s=new Date(n,i,r);return{"ui-calendar-date-out":e.pre||e.next,"ui-calendar-date":!0,"ui-calendar-date-disabled":this.disabledDate(s,t),"ui-calendar-date-on":this.inRangeDate(s,t),"ui-calendar-date-selected":this.isSelected(s,t),"ui-calendar-date-today":this.timeFormat(s,t)===this.timeFormat(new Date,t)}},getTimesDate:function(){return"range"===this.model&&this.inOnePanel(this.value,"YYYY-MM-DD")?"left"===this.position?this.parseDate(this.value[0]):this.parseDate(this.value[1]):this.current},disabledHours:function(){for(var e=this.getTimesDate(),t=e.year,n=e.month,i=e.day,o="YYYY-MM-DD HH",r=[],s=new Date(t,n,i,0),a="right"===this.position&&this.isSameDay(this.value[0],s),u="right"===this.position?this.value[0].getHours():0,l=0;l<24;l++)s.setHours(l),(this.disabledDate(s,o)||a&&u>l)&&r.push(l);return r},disabledMinutes:function(){for(var e=this.getTimesDate(),t=e.year,n=e.month,i=e.day,o="YYYY-MM-DD HH:mm",r=[],a=this.times?(0,s.default)(this.times.split(":")[0]):0,u=new Date(t,n,i,a),l="right"===this.position&&this.isSameDay(this.value[0],u),c=0;c<60;c++)u.setMinutes(c),(this.disabledDate(u,o)||l&&1===this.contrastDate(this.value[0],u,o))&&r.push(c);return r},disabledSeconds:function(){for(var e=this.getTimesDate(),t=e.year,n=e.month,i=e.day,r="YYYY-MM-DD HH:mm:ss",s=[],a=this.times?this.times.split(":").map((function(e){return parseInt(e)})):[0,0],u=(0,o.default)(a,2),l=u[0],c=u[1],h=new Date(t,n,i,l,c),d="right"===this.position&&this.isSameDay(this.value[0],h),f=0;f<60;f++)h.setSeconds(f),(this.disabledDate(h,r)||d&&1===this.contrastDate(this.value[0],h,r))&&s.push(f);return s},monthToNext:function(){this.current.month<11?this.current.month++:(this.current.month=0,this.current.year++)},monthToPre:function(){this.current.month>0?this.current.month--:(this.current.month=11,this.current.year--)},is:function(e){return-1===e.target.className.indexOf("ui-calendar-date-disabled")},selectedYear:function(e){var t=this.pattern;if(this.showYears=t===m,t===m){var n=!1;"range"===this.model&&(!this.showLeftArrow&&(e/10|0)<(this.current.year/10|0)||!this.showRightArrow&&(e/10|0)>(this.current.year/10|0))&&(n=!0),n||(this.current.year=e);var i=new Date(e,0);this.onChange(i,!1,n)}else this.current.year=e},selectedMonth:function(e){var t=this.pattern;if(this.current.month=e,this.showMonths=t===C,t===C){var n=new Date(this.current.year,e);this.onChange(n)}},timesToNum:function(){var e=this.times.split(":"),t=0,n=0,i=0;return this.hasHour&&(t=(0,s.default)(e.shift())),this.hasMinute&&(n=(0,s.default)(e.shift())),this.hasSecond&&(i=(0,s.default)(e.shift())),{hour:t,minute:n,second:i}},selectedDay:function(e){var t=!1;"range"===this.model&&(!this.showLeftArrow&&e.pre||!this.showRightArrow&&e.next)&&(t=!0),t||(e.next&&this.monthToNext(),e.pre&&this.monthToPre(),this.current.day=e.day);var n=e.year,i=e.month,o=e.day,r=this.timesToNum(),s=r.hour,a=r.minute,u=r.second,l=new Date(n,i,o,s,a,u);this.onChange(l,!1,t)},changeTimes:function(){var e=void 0;e="single"===this.model?this.parseDate(this.value):"range"===this.model?"left"===this.position?this.parseDate(this.value[0]):this.parseDate(this.value[1]):this.parseDate(this.value[this.value.length-1]);var t=this.timesToNum(),n=t.hour,i=t.minute,o=t.second;this.onChange(new Date(e.year,e.month,e.day,n,i,o),!0)},onChange:function(e,t,n){this.$emit("on-change",e,t,n)}}}},function(e,t,n){n(296),e.exports=n(6).Number.parseInt},function(e,t,n){var i=n(14),o=n(297);i(i.S+i.F*(Number.parseInt!=o),"Number",{parseInt:o})},function(e,t,n){var i=n(7).parseInt,o=n(298).trim,r=n(119),s=/^[-+]?0[xX]/;e.exports=8!==i(r+"08")||22!==i(r+"0x16")?function(e,t){var n=o(String(e),3);return i(n,t>>>0||(s.test(n)?16:10))}:i},function(e,t,n){var i=n(14),o=n(53),r=n(26),s=n(119),a="["+s+"]",u="​…",l=RegExp("^"+a+a+"*"),c=RegExp(a+a+"*$"),h=function(e,t,n){var o={},a=r((function(){return!!s[e]()||u[e]()!=u})),l=o[e]=a?t(d):s[e];n&&(o[n]=l),i(i.P+i.F*a,"String",o)},d=h.trim=function(e,t){return e=String(o(e)),1&t&&(e=e.replace(l,"")),2&t&&(e=e.replace(c,"")),e};e.exports=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(19),o=a(i),r=n(300),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}t.default={components:{PickerItem:s.default},props:{value:{type:String,default:""},format:{type:String,default:"HH:mm:ss"},hourStep:{type:Number,default:1},minuteStep:{type:Number,default:1},secondStep:{type:Number,default:1},disabledHours:{type:Function,default:void 0},disabledMinutes:{type:Function,default:void 0},disabledSeconds:{type:Function,default:void 0}},data:function(){var e=this.parseTime(),t=e.hour,n=void 0===t?"":t,i=e.minute,o=void 0===i?"":i,r=e.seconds,s=void 0===r?"":r;return{show:!1,hasFocus:!1,selectedHour:n,selectedMinute:o,selectedSeconds:s,focus:{1:-1,2:-1,4:-1},historyFocus:{1:-1,2:-1,4:-1},focusType:""}},computed:{bit:function(){var e=0;return/H/.test(this.format)&&(e+=1),/m/.test(this.format)&&(e+=2),/s/.test(this.format)&&(e+=4),e},tabindex:function(){return this.disabled||this.readonly?-1:0},hours:function(){var e=this.disabledHours?this.disabledHours():[];return-1!==this.format.indexOf("H")?this.formatTime(24,this.hourStep,e,/HH/.test(this.format)):null},minutes:function(){var e=this.disabledMinutes?this.disabledMinutes(this.selectedHour):[];return-1!==this.format.indexOf("m")?this.formatTime(60,this.minuteStep,e,/mm/.test(this.format)):null},seconds:function(){var e=this.disabledSeconds?this.disabledSeconds(this.selectedHour,this.selectedMinute):[];return-1!==this.format.indexOf("s")?this.formatTime(60,this.secondStep,e,/ss/.test(this.format)):null},times:function(){var e="",t=this.selectedHour,n=this.selectedMinute,i=this.selectedSeconds;return t||n||i?(/H/.test(this.format)&&(e+=t),/m/.test(this.format)&&(e+=e.length>0?":"+n:n),/s/.test(this.format)&&(e+=e.length>0?":"+i:i),e):e}},watch:{value:function(){if(this.times!==this.value){var e=this.parseTime(),t=e.hour,n=e.minute,i=e.seconds;this.selectedHour=t,this.selectedMinute=n,this.selectedSeconds=i}},times:function(){this.$emit("input",this.times),this.$emit("change",this.times)}},methods:{parseTime:function(){if(!this.value)return{};var e=this.value.split(":"),t=void 0,n=void 0,i=void 0;return/H/.test(this.format)&&(t=e.shift()||this.formatSingleTime("HH")),/m/.test(this.format)&&(n=e.shift()||this.formatSingleTime("mm")),/s/.test(this.format)&&(i=e.shift()||this.formatSingleTime("ss")),{hour:t,minute:n,seconds:i}},formatTime:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=[],r=0;r0){for(var i=t;i=0;--o)if(!e[o].disabled)return o;return null},resetFindFocus:function(e,t,n){var i=this.findCanFocus(e,t,n);return null!==i?i:-1},findFocus:function(){var e=void 0;1&this.bit?(e=this.resetFindFocus(this.hours,0,1),this.focusType=1):2&this.bit?(e=this.resetFindFocus(this.minutes,0,1),this.focusType=2):4&this.bit&&(e=this.resetFindFocus(this.seconds,0,1),this.focusType=4),this.focus[this.focusType]=e},preventCalculateOverflow:function(e,t,n){var i=n.length,o=e+t;return o<0?0:o===i?e:(o=this.findCanFocus(n,o,t),null!==o?o:e)},updateFocusElem:function(e){var t=e?-1:1,n=void 0;1&this.focusType?n=this.hours:2&this.focusType?n=this.minutes:4&this.focusType&&(n=this.seconds),this.focus[this.focusType]=this.preventCalculateOverflow(this.focus[this.focusType],t,n)},resetFromHistory:function(e){return-1!==this.historyFocus[this.focusType]?this.historyFocus[this.focusType]:this.resetFindFocus(e,0,1)},changeCurrentFocus:function(){1&this.focusType?this.focus={1:this.resetFromHistory(this.hours),2:-1,4:-1}:2&this.focusType?this.focus={1:-1,2:this.resetFromHistory(this.minutes),4:-1}:4&this.focusType&&(this.focus={1:-1,2:-1,4:this.resetFromHistory(this.seconds)})},moveFocus:function(e){7===this.bit?(e&&3&this.focusType&&(this.historyFocus[this.focusType]=this.focus[this.focusType],this.focusType<<=1,this.changeCurrentFocus()),!e&&6&this.focusType&&(this.historyFocus[this.focusType]=this.focus[this.focusType],this.focusType>>>=1,this.changeCurrentFocus())):3===this.bit?(e&&1&this.focusType&&(this.historyFocus[this.focusType]=this.focus[this.focusType],this.focusType<<=1,this.changeCurrentFocus()),!e&&2&this.focusType&&(this.historyFocus[this.focusType]=this.focus[this.focusType],this.focusType>>>=1,this.changeCurrentFocus())):6===this.bit&&(e&&2&this.focusType&&(this.historyFocus[this.focusType]=this.focus[this.focusType],this.focusType<<=1,this.changeCurrentFocus()),!e&&4&this.focusType&&(this.historyFocus[this.focusType]=this.focus[this.focusType],this.focusType>>>=1,this.changeCurrentFocus()))},selectFocusElem:function(){1&this.focusType?this.changeSelectedHour(this.hours[this.focus[this.focusType]]):2&this.focusType?this.changeSelectedMinute(this.minutes[this.focus[this.focusType]]):4&this.focusType&&this.changeSelectedSeconds(this.seconds[this.focus[this.focusType]])},keydown:function(e){e.keyCode==o.default.TAB?(e.preventDefault(),this.hasFocus?this.$emit("blur"):this.findFocus(),this.hasFocus=!this.hasFocus):e.keyCode==o.default.DOWN||e.keyCode==o.default.UP?(e.preventDefault(),this.updateFocusElem(e.keyCode==o.default.UP)):e.keyCode==o.default.LEFT||e.keyCode==o.default.RIGHT?(e.preventDefault(),this.moveFocus(e.keyCode==o.default.RIGHT)):e.keyCode!=o.default.ENTER&&e.keyCode!=o.default.MAC_ENTER&&e.keyCode!=o.default.SPACE||(e.preventDefault(),this.selectFocusElem())}}}},function(e,t,n){var i=n(0)(n(301),n(302),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/time-picker/PickerItem.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] PickerItem.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1);t.default={props:{value:{type:String,default:""},focus:{type:Number,default:-1},times:{type:Array,default:function(){return[]}}},computed:{selectedIndex:function(){var e=this;return this.value?this.times.findIndex((function(t){return t.value===e.value})):-1}},watch:{selectedIndex:function(){var e=this;this.$nextTick((function(){e.scrollToSelected(120)}))},focus:function(){var e=this;this.$nextTick((function(){e.scrollToView(0)}))}},mounted:function(){var e=this;this.$nextTick((function(){e.scrollToSelected(0)}))},methods:{scrollToSelected:function(e){var t=this.$el,n=this.$refs.list;if(n){var o=this.selectedIndex;o<0&&(o=0);var r=n.children[o].offsetTop,s=n.children[0].offsetTop;(0,i.scrollTo)(t,r-s,e)}},scrollToView:function(e){var t=this.$el,n=this.$refs.list,o=this.focus;if(n&&!(o<0)){var r=t.scrollTop,s=n.children[o].offsetTop,a=s-r;a<0?(0,i.scrollTo)(t,s,e):a>160&&(0,i.scrollTo)(t,r+(a-160),e)}},selectedTime:function(e){var t=e.target.getAttribute("data-key"),n=this.times.filter((function(e){return e.value===t}));n.length>0&&!1===n[0].disabled&&this.$emit("change",n[0])}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ul",{ref:"list",staticClass:"picker-item",on:{click:function(t){return t.stopPropagation(),e.selectedTime(t)}}},e._l(e.times,(function(t,i){return n("li",{key:t.value,staticClass:"picker-item-child",class:{disabled:t.disabled,active:t.value===e.value,focus:e.focus===i},attrs:{"data-key":t.value}},[e._v("\n "+e._s(t.value)+"\n ")])})),0)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-time-picker-content",attrs:{tabindex:"0"},on:{keydown:e.keydown}},[e.hours?n("picker-item",{attrs:{times:e.hours,value:e.selectedHour,focus:e.focus["1"]},on:{change:e.changeSelectedHour}}):e._e(),e._v(" "),e.minutes?n("picker-item",{attrs:{times:e.minutes,value:e.selectedMinute,focus:e.focus["2"]},on:{change:e.changeSelectedMinute}}):e._e(),e._v(" "),e.seconds?n("picker-item",{attrs:{times:e.seconds,value:e.selectedSeconds,focus:e.focus["4"]},on:{change:e.changeSelectedSeconds}}):e._e()],1)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-calendar"},[n("div",{staticClass:"ui-calendar-head"},[n("div",{staticClass:"ui-calendar-head-left"},[n("span",{directives:[{name:"show",rawName:"v-show",value:e.showYears&&e.showLeftArrow,expression:"showYears && showLeftArrow"}],staticClass:"icon",on:{click:function(t){e.current.year-=10}}},[n("Icon",{attrs:{type:"ios-arrow-back",size:"10"}}),e._v(" "),n("Icon",{staticClass:"next-icon",attrs:{type:"ios-arrow-back",size:"10"}})],1),e._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:!e.showYears&&e.showLeftArrow,expression:"!showYears && showLeftArrow"}],staticClass:"icon",on:{click:function(t){e.current.year--}}},[n("Icon",{attrs:{type:"ios-arrow-back",size:"10"}}),e._v(" "),n("Icon",{staticClass:"next-icon",attrs:{type:"ios-arrow-back",size:"10"}})],1),e._v(" "),n("Icon",{directives:[{name:"show",rawName:"v-show",value:!e.showYears&&!e.showMonths&&e.showLeftArrow,expression:"!showYears && !showMonths && showLeftArrow"}],staticClass:"icon",attrs:{type:"ios-arrow-back",size:"10"},on:{click:e.monthToPre}})],1),e._v(" "),n("div",{staticClass:"ui-calendar-head-middle"},[n("a",{directives:[{name:"show",rawName:"v-show",value:e.showYears,expression:"showYears"}]},[e._v(e._s(e.yearStart+"-"+e.yearEnd))]),e._v(" "),e.t("el.datepicker.yearSuffix")?[n("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears,expression:"!showYears"}],on:{click:function(t){e.showYears=!e.showYears}}},[e._v(e._s(e.current.year)+"\n "+e._s(e.t("el.datepicker.yearSuffix")))]),e._v(" "),n("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears&&!e.showMonths,expression:"!showYears && !showMonths"}],on:{click:function(t){e.showMonths=!e.showMonths}}},[e._v(e._s(e.t("el.datepicker.month"+(e.current.month+1))))])]:[n("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears&&!e.showMonths,expression:"!showYears && !showMonths"}],on:{click:function(t){e.showMonths=!e.showMonths}}},[e._v(e._s(e.t("el.datepicker.month"+(e.current.month+1))))]),e._v(" "),n("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears,expression:"!showYears"}],on:{click:function(t){e.showYears=!e.showYears}}},[e._v(e._s(e.current.year))])]],2),e._v(" "),n("div",{staticClass:"ui-calendar-head-right"},[n("Icon",{directives:[{name:"show",rawName:"v-show",value:!e.showYears&&!e.showMonths&&e.showRightArrow,expression:"!showYears && !showMonths && showRightArrow"}],staticClass:"icon",attrs:{type:"ios-arrow-forward",size:"10"},on:{click:e.monthToNext}}),e._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:!e.showYears&&e.showRightArrow,expression:"!showYears && showRightArrow"}],staticClass:"icon",on:{click:function(t){e.current.year++}}},[n("Icon",{attrs:{type:"ios-arrow-forward",size:"10"}}),e._v(" "),n("Icon",{staticClass:"next-icon",attrs:{type:"ios-arrow-forward",size:"10"}})],1),e._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:e.showYears&&e.showRightArrow,expression:"showYears && showRightArrow"}],staticClass:"icon",on:{click:function(t){e.current.year+=10}}},[n("Icon",{attrs:{type:"ios-arrow-forward",size:"10"}}),e._v(" "),n("Icon",{staticClass:"next-icon",attrs:{type:"ios-arrow-forward",size:"10"}})],1)],1)]),e._v(" "),n("div",{staticClass:"ui-calendar-body"},[e.hasDay?n("div",{staticClass:"ui-calendar-days"},[e._l(e.WEEKS,(function(t){return n("span",{key:t,staticClass:"ui-calendar-week"},[e._v(e._s(e.t("el.datepicker.weeks."+t)))])})),e._v(" "),e._l(e.days,(function(t,i){return n("span",{key:i,class:e.dayCls(t),on:{click:function(n){e.is(n)&&e.selectedDay(t)}}},[e._v(e._s(t.day))])}))],2):e._e(),e._v(" "),e.hasMonth?n("div",{directives:[{name:"show",rawName:"v-show",value:e.showMonths,expression:"showMonths"}],staticClass:"ui-calendar-months"},e._l(e.months,(function(t,i){return n("span",{key:i,class:e.monthCls(i),on:{click:function(t){e.is(t)&&e.selectedMonth(i)}}},[e._v(e._s(e.t("el.datepicker.months."+t)))])})),0):e._e(),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.showYears,expression:"showYears"}],staticClass:"ui-calendar-years"},e._l(e.years,(function(t,i){return n("span",{key:i,class:e.yearCls(t,i),on:{click:function(n){e.is(n)&&e.selectedYear(t)}}},[e._v(e._s(t))])})),0),e._v(" "),e.vShowTime?n("div",{staticClass:"ui-calendar-times-wrapper"},[n("div",{staticClass:"ui-calendar-title"},[e._v("\n "+e._s(e.timeTitle)+"\n ")]),e._v(" "),n("div",{staticClass:"ui-calendar-times"},[n("time-select",{attrs:{format:e.tFormat,"disabled-hours":e.disabledHours,"disabled-minutes":e.disabledMinutes,"disabled-seconds":e.disabledSeconds},on:{change:e.changeTimes},model:{value:e.times,callback:function(t){e.times=t},expression:"times"}})],1)]):e._e()])])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.formatRange,expression:"formatRange"}],staticClass:"ui-calendars",class:{position:e.inline,inline:e.showInline}},[e.range?[n("div",{staticClass:"ui-calendars-range"},[n("calendar",{attrs:{value:e.dates,format:e.vFormat,model:e.model,"disabled-date":e.disabled,"show-right-arrow":e.showArrow,"show-time":e.showTime,position:"left"},on:{"on-change":e.leftRangeChange,onCurrentChange:e.leftCurrentChange}}),e._v(" "),n("calendar",{attrs:{value:e.dates,format:e.vFormat,model:e.model,"show-left-arrow":e.showArrow,"disabled-date":e.disabled,"show-time":e.showTime,position:"right"},on:{"on-change":e.rightRangeChange,onCurrentChange:e.rightCurrentChange}})],1)]:[n("calendar",{attrs:{value:e.dates,format:e.vFormat,model:e.model,"disabled-date":e.disabled,"show-time":e.showTime},on:{"on-change":e.change}})],e._v(" "),e.$slots.addon||e.confirm?n("div",{staticClass:"ui-calendars-footer"},[e._t("addon"),e._v(" "),e.confirm||e.showTimeBth?n("div",{staticClass:"inner-footer"},[e.showTimeBth?n("span",{staticClass:"select-time",class:{disabled:e.confirmDisabled},on:{click:e.onSelectTime}},[e._v("\n "+e._s(e.showTime?e.t("el.datepicker.footSelectDate"):e.t("el.datepicker.footSelectTime"))+"\n ")]):e._e(),e._v(" "),n("wb-button",{attrs:{disabled:e.confirmDisabled,type:"primary"},on:{click:e.finished}},[e._v("\n "+e._s(e.t("el.datepicker.confirmBtn"))+"\n ")])],1):e._e()],2):e._e()],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(307),n(314),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/date-picker/datePicker.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] datePicker.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(115),o=y(i),r=n(121),s=y(r),a=n(122),u=y(a),l=n(19),c=y(l),h=n(80),d=y(h),f=n(29),p=y(f),g=n(12),m=y(g),v=n(5),_=y(v);function y(e){return e&&e.__esModule?e:{default:e}}t.default={name:"InputDatePicker",directives:{clickoutside:p.default},components:{Calendars:o.default,ReadonlyInput:s.default,PickerPopup:u.default},mixins:[d.default,m.default,_.default],props:{icon:{type:String,default:"md-calendar"},value:{type:[Date,Array,Number],default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},position:{type:String,default:null},model:{default:"single",validator:function(e){return-1!==["single","multiple","range"].indexOf(e)}},showConfirm:{type:Boolean,default:!1},rangeSeparator:{type:String,default:"~"},clearable:{type:Boolean,default:!1},placeholder:{type:String,default:"请选择日期"},format:{type:String,default:"YYYY-MM-DD"},enableTime:{type:Boolean,default:!1},enableSeconds:{type:Boolean,default:!1},onlyMonth:{type:Boolean,default:!1},minDate:{type:Date,default:void 0},maxDate:{type:Date,default:void 0},maxRange:{type:String,default:void 0},disable:{type:Array,default:function(){return[]}},enable:{type:Array,default:function(){return[]}},disabledDate:{type:Function,default:function(){return!1}}},data:function(){return{show:!1,dates:this.value}},computed:{text:function(){var e=this,t=this.dates;return this.isEmpty(t)?"":"single"===this.model?this.timeFormat(new Date(t)):"range"===this.model?t.map((function(t){return e.timeFormat(new Date(t))})):t.map((function(t){return e.timeFormat(new Date(t))})).join(", ")}},watch:{value:function(){this.isEqual(this.value,this.dates)||(this.dates=this.value)}},methods:{hidePopup:function(){this.show&&(this.show=!1,this.dispatch("FormItem","on-form-blur",[this.dates]))},showPopup:function(){this.readonly||this.disabled||(this.show=!0)},keydown:function(e){e.keyCode==c.default.ENTER||e.keyCode==c.default.MAC_ENTER?this.$emit("on-enter",e):this.show||e.keyCode!=c.default.SPACE&&e.keyCode!=c.default.TAB||(e.preventDefault(),this.showPopup())},clear:function(){this.$emit("clear"),this.$emit("input","single"===this.model?null:[])},change:function(e,t){this.$emit("input",e,t),this.$emit("on-input",e,t),this.$emit("on-change",e,t),this.$emit("on-input-change",e,t),this.dispatch("FormItem","on-form-change",[e])},onBlur:function(e){this.$emit("on-blur",e)},finish:function(){this.hidePopup()}}}},function(e,t,n){var i=n(0)(n(309),n(310),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/v-readonly-input/readonlyInput.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] readonlyInput.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default={components:{Icon:o.default},props:{value:{type:[String,Array],default:""},placeholder:{type:String,default:""},icon:{type:String,default:""},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},data:function(){return{showClear:!1}},computed:{showClearIcon:function(){return this.clearable&&!this.disabled&&!this.readonly&&this.value&&this.showClear},tabindex:function(){return this.disabled||this.readonly?-1:0}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",{staticClass:"ui-readonly-input",class:{disabled:e.disabled},attrs:{tabindex:e.tabindex},on:{mouseenter:function(t){e.showClear=!0},mouseleave:function(t){e.showClear=!1},click:function(t){return e.$emit("click")},focus:function(t){return e.$emit("on-focus",t)},blur:function(t){return e.$emit("on-blur",t)},keydown:function(t){return e.$emit("keydown",t)}}},[n("span",{staticClass:"ui-readonly-input-content",class:{placeholder:!e.value}},[e._t("default",[e._v(e._s(e.value||e.placeholder))])],2),e._v(" "),e.icon?n("Icon",{directives:[{name:"show",rawName:"v-show",value:!e.showClearIcon,expression:"!showClearIcon"}],attrs:{type:e.icon}}):e._e(),e._v(" "),n("Icon",{directives:[{name:"show",rawName:"v-show",value:e.showClearIcon,expression:"showClearIcon"}],attrs:{type:"md-close-circle"},on:{click:function(t){return t.stopPropagation(),e.$emit("clear")}}})],1)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(312),n(313),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/v-picker-popup/pickerPopup.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] pickerPopup.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{show:{type:Boolean,default:!1},position:{default:null,validator:function(e){return-1!==[null,"bottomLeft","bottomRight","topLeft","topRight"].indexOf(e)}}},data:function(){return{popupPosition:"bottomLeft"}},watch:{show:function(){var e=this;!this.position&&this.show&&this.$nextTick((function(){e.calPosition()}))}},methods:{calPosition:function(){var e=this.$parent.$el.getBoundingClientRect(),t=e.left,n=e.right,i=e.top,o=e.bottom,r=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,s=document.documentElement.scrollLeft||window.pageXOffset||document.body.scrollLeft,a=this.$refs.pickerPopup.offsetWidth,u=this.$refs.pickerPopup.offsetHeight,l=document.documentElement.scrollWidth,c=document.documentElement.scrollHeight,h=i+r,d=l-(t+s),f=c-(o+r),p=n+s;this.popupPosition=f>=u?d=a?"bottomRight":"bottomLeft":h>=u?d=a?"topRight":"topLeft":"bottomLeft"}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"slide-to-down"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],ref:"pickerPopup",staticClass:"ui-picker-popup",class:[e.position||e.popupPosition]},[e._t("default")],2)])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.hidePopup,expression:"hidePopup"}],staticClass:"ui-date-picker"},[n("readonly-input",{class:e.model,attrs:{value:e.text,placeholder:e.placeholder||e.t("el.datepicker.selectDate"),icon:e.icon,disabled:e.disabled,readonly:e.readonly,clearable:e.clearable},on:{"on-focus":function(t){return e.$emit("on-focus",t)},"on-blur":e.onBlur,clear:e.clear,click:e.showPopup,keydown:e.keydown}},["range"===e.model&&e.text.length>0?n("span",[n("span",[e._v(e._s(e.text[0]))]),n("span",{staticClass:"range-separator"},[e._v(e._s(e.rangeSeparator))]),n("span",[e._v(e._s(e.text[1]))])]):e._e()]),e._v(" "),n("picker-popup",{attrs:{show:e.show,position:e.position}},[n("calendars",{attrs:{model:e.model,format:e.format,"disabled-date":e.disabledDate,"enable-time":e.enableTime,"enable-seconds":e.enableSeconds,"only-month":e.onlyMonth,"show-confirm":e.showConfirm,"show-inline":!1,"min-date":e.minDate,"max-date":e.maxDate,"max-range":e.maxRange,disable:e.disable,enable:e.enable},on:{"on-change":e.change,"on-finish":e.finish},scopedSlots:e._u([{key:"addon",fn:function(){return[e._t("addon")]},proxy:!0}],null,!0),model:{value:e.dates,callback:function(t){e.dates=t},expression:"dates"}})],1)],1)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(123),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{color:{type:String,default:"#2db7f5"},size:{type:String,default:"32px"},borderWidth:{type:String,default:"2px"}},computed:{clipStyle:function(){var e={height:this.size,width:this.size,borderWidth:this.borderWidth,borderStyle:"solid"};return this.color&&(e.borderColor=this.color+" "+this.color+" transparent"),e}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-loading",style:e.clipStyle})},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(43),o=m(i),r=n(31),s=m(r),a=n(28),u=m(a),l=n(333),c=m(l),h=n(1),d=g(h),f=n(12),p=m(f);function g(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function m(e){return e&&e.__esModule?e:{default:e}}var v=null,_=function(){var e={},t=arguments[0],n=arguments[1];if("string"===typeof t)n?(e.title=t,e.template=n):e.template=t;else if("object"===("undefined"===typeof t?"undefined":(0,s.default)(t))){var i=t;i.buttons&&!d.isArray(i.buttons)&&delete i.buttons,i.buttons&&i.buttons.forEach((function(e){void 0===e.show&&(e.show=!0)})),d.merge(e,i)}return e},y=function(e,t,n){e instanceof u.default||(e=b.root),v&&(v.$destroy(!0),v=null);var i=new o.default((function(i){var o=v=new u.default({name:"MessageSwap",parent:e,components:{message:c.default},mixins:[p.default],computed:{confirmText:function(){return this.t("el.message.confirm")},cancelText:function(){return this.t("el.message.cancel")},option:function(){return"alert"===n&&(t.buttons=[{text:this.confirmText,show:!0}]),"confirm"===n&&(t.buttons=[{text:this.confirmText,show:!0},{text:this.cancelText,show:!0}]),t.buttons||(t.buttons=[{text:this.confirmText,show:!0},{text:this.cancelText,show:!0}]),t}},mounted:function(){this.$on("on-close",(function(e){this.$destroy(!0),i(e)}))},destroyed:function(){this.$el.remove()},render:function(e){return e("message",{props:{title:this.option.title,template:this.option.template,buttons:this.option.buttons}})}});o.$mount(),document.body.appendChild(o.$el)}));return i},b=function(){var e=this;return y(e,_.apply(this,arguments))};b.alert=function(){var e=_.apply(this,arguments);return y(void 0,e,"alert")},b.confirm=function(){var e=_.apply(this,arguments);return y(void 0,e,"confirm")},t.default=b},function(e,t,n){n(111),n(57),n(59),n(320),n(331),n(332),e.exports=n(6).Promise},function(e,t,n){"use strict";var i,o,r,s,a=n(42),u=n(7),l=n(50),c=n(79),h=n(14),d=n(25),f=n(51),p=n(321),g=n(322),m=n(124),v=n(125).set,_=n(326)(),y=n(81),b=n(126),w=n(327),C=n(127),S="Promise",x=u.TypeError,L=u.process,k=L&&L.versions,N=k&&k.v8||"",E=u[S],O="process"==c(L),D=function(){},I=o=y.f,M=!!function(){try{var e=E.resolve(1),t=(e.constructor={})[n(8)("species")]=function(e){e(D,D)};return(O||"function"==typeof PromiseRejectionEvent)&&e.then(D)instanceof t&&0!==N.indexOf("6.6")&&-1===w.indexOf("Chrome/66")}catch(i){}}(),T=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},P=function(e,t){if(!e._n){e._n=!0;var n=e._c;_((function(){var i=e._v,o=1==e._s,r=0,s=function(t){var n,r,s,a=o?t.ok:t.fail,u=t.resolve,l=t.reject,c=t.domain;try{a?(o||(2==e._h&&F(e),e._h=1),!0===a?n=i:(c&&c.enter(),n=a(i),c&&(c.exit(),s=!0)),n===t.promise?l(x("Promise-chain cycle")):(r=T(n))?r.call(n,u,l):u(n)):l(i)}catch(h){c&&!s&&c.exit(),l(h)}};while(n.length>r)s(n[r++]);e._c=[],e._n=!1,t&&!e._h&&A(e)}))}},A=function(e){v.call(u,(function(){var t,n,i,o=e._v,r=R(e);if(r&&(t=b((function(){O?L.emit("unhandledRejection",o,e):(n=u.onunhandledrejection)?n({promise:e,reason:o}):(i=u.console)&&i.error&&i.error("Unhandled promise rejection",o)})),e._h=O||R(e)?2:1),e._a=void 0,r&&t.e)throw t.v}))},R=function(e){return 1!==e._h&&0===(e._a||e._c).length},F=function(e){v.call(u,(function(){var t;O?L.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})}))},W=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),P(t,!0))},V=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw x("Promise can't be resolved itself");(t=T(e))?_((function(){var i={_w:n,_d:!1};try{t.call(e,l(V,i,1),l(W,i,1))}catch(o){W.call(i,o)}})):(n._v=e,n._s=1,P(n,!1))}catch(i){W.call({_w:n,_d:!1},i)}}};M||(E=function(e){p(this,E,S,"_h"),f(e),i.call(this);try{e(l(V,this,1),l(W,this,1))}catch(t){W.call(this,t)}},i=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},i.prototype=n(328)(E.prototype,{then:function(e,t){var n=I(m(this,E));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=O?L.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&P(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),r=function(){var e=new i;this.promise=e,this.resolve=l(V,e,1),this.reject=l(W,e,1)},y.f=I=function(e){return e===E||e===s?new r(e):o(e)}),h(h.G+h.W+h.F*!M,{Promise:E}),n(58)(E,S),n(329)(S),s=n(6)[S],h(h.S+h.F*!M,S,{reject:function(e){var t=I(this),n=t.reject;return n(e),t.promise}}),h(h.S+h.F*(a||!M),S,{resolve:function(e){return C(a&&this===s?E:this,e)}}),h(h.S+h.F*!(M&&n(330)((function(e){E.all(e)["catch"](D)}))),S,{all:function(e){var t=this,n=I(t),i=n.resolve,o=n.reject,r=b((function(){var n=[],r=0,s=1;g(e,!1,(function(e){var a=r++,u=!1;n.push(void 0),s++,t.resolve(e).then((function(e){u||(u=!0,n[a]=e,--s||i(n))}),o)})),--s||i(n)}));return r.e&&o(r.v),n.promise},race:function(e){var t=this,n=I(t),i=n.reject,o=b((function(){g(e,!1,(function(e){t.resolve(e).then(n.resolve,i)}))}));return o.e&&i(o.v),n.promise}})},function(e,t){e.exports=function(e,t,n,i){if(!(e instanceof t)||void 0!==i&&i in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var i=n(50),o=n(323),r=n(324),s=n(17),a=n(105),u=n(117),l={},c={};t=e.exports=function(e,t,n,h,d){var f,p,g,m,v=d?function(){return e}:u(e),_=i(n,h,t?2:1),y=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(r(v)){for(f=a(e.length);f>y;y++)if(m=t?_(s(p=e[y])[0],p[1]):_(e[y]),m===l||m===c)return m}else for(g=v.call(e);!(p=g.next()).done;)if(m=o(g,_,p.value,t),m===l||m===c)return m};t.BREAK=l,t.RETURN=c},function(e,t,n){var i=n(17);e.exports=function(e,t,n,o){try{return o?t(i(n)[0],n[1]):t(n)}catch(s){var r=e["return"];throw void 0!==r&&i(r.call(e)),s}}},function(e,t,n){var i=n(32),o=n(8)("iterator"),r=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||r[o]===e)}},function(e,t){e.exports=function(e,t,n){var i=void 0===n;switch(t.length){case 0:return i?e():e.call(n);case 1:return i?e(t[0]):e.call(n,t[0]);case 2:return i?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return i?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return i?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var i=n(7),o=n(125).set,r=i.MutationObserver||i.WebKitMutationObserver,s=i.process,a=i.Promise,u="process"==n(41)(s);e.exports=function(){var e,t,n,l=function(){var i,o;u&&(i=s.domain)&&i.exit();while(e){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,i&&i.enter()};if(u)n=function(){s.nextTick(l)};else if(!r||i.navigator&&i.navigator.standalone)if(a&&a.resolve){var c=a.resolve(void 0);n=function(){c.then(l)}}else n=function(){o.call(i,l)};else{var h=!0,d=document.createTextNode("");new r(l).observe(d,{characterData:!0}),n=function(){d.data=h=!h}}return function(i){var o={fn:i,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t,n){var i=n(7),o=i.navigator;e.exports=o&&o.userAgent||""},function(e,t,n){var i=n(24);e.exports=function(e,t,n){for(var o in t)n&&e[o]?e[o]=t[o]:i(e,o,t[o]);return e}},function(e,t,n){"use strict";var i=n(7),o=n(6),r=n(21),s=n(18),a=n(8)("species");e.exports=function(e){var t="function"==typeof o[e]?o[e]:i[e];s&&t&&!t[a]&&r.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){var i=n(8)("iterator"),o=!1;try{var r=[7][i]();r["return"]=function(){o=!0},Array.from(r,(function(){throw 2}))}catch(s){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var r=[7],a=r[i]();a.next=function(){return{done:n=!0}},r[i]=function(){return a},e(r)}catch(s){}return n}},function(e,t,n){"use strict";var i=n(14),o=n(6),r=n(7),s=n(124),a=n(127);i(i.P+i.R,"Promise",{finally:function(e){var t=s(this,o.Promise||r.Promise),n="function"==typeof e;return this.then(n?function(n){return a(t,e()).then((function(){return n}))}:e,n?function(n){return a(t,e()).then((function(){throw n}))}:e)}})},function(e,t,n){"use strict";var i=n(14),o=n(81),r=n(126);i(i.S,"Promise",{try:function(e){var t=o.f(this),n=r(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){var i=n(0)(n(334),n(338),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/message/message.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] message.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(128),o=l(i),r=n(5),s=l(r),a=n(3),u=l(a);function l(e){return e&&e.__esModule?e:{default:e}}t.default={name:"Message",components:{Icon:u.default},mixins:[s.default],props:{title:{type:String,default:void 0},template:{type:String,required:!0},buttons:{type:Array,default:void 0}},methods:{xssFilter:function(e){return(0,o.default)(e,{onIgnoreTagAttr:function(e,t,n){if("style"===t||"class"===t)return t+'="'+(0,i.safeAttrValue)(e,t,n)+'"'}})},getButtonClass:function(e){return e.class},click:function(e){this.dispatch("MessageSwap","on-close",e)}}}},function(e,t,n){var i=n(130),o=n(336);n(131);function r(e){return void 0===e||null===e}function s(e){var t={};for(var n in e)t[n]=e[n];return t}function a(e){e=s(e||{}),e.whiteList=e.whiteList||i.whiteList,e.onAttr=e.onAttr||i.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||i.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||i.safeAttrValue,this.options=e}a.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,i=n.whiteList,s=n.onAttr,a=n.onIgnoreAttr,u=n.safeAttrValue,l=o(e,(function(e,t,n,o,l){var c=i[n],h=!1;if(!0===c?h=c:"function"===typeof c?h=c(o):c instanceof RegExp&&(h=c.test(o)),!0!==h&&(h=!1),o=u(n,o),o){var d={position:t,sourcePosition:e,source:l,isWhite:h};if(h){var f=s(n,o,d);return r(f)?n+":"+o:f}f=a(n,o,d);return r(f)?void 0:f}}));return l},e.exports=a},function(e,t,n){var i=n(131);function o(e,t){e=i.trimRight(e),";"!==e[e.length-1]&&(e+=";");var n=e.length,o=!1,r=0,s=0,a="";function u(){if(!o){var n=i.trim(e.slice(r,s)),u=n.indexOf(":");if(-1!==u){var l=i.trim(n.slice(0,u)),c=i.trim(n.slice(u+1));if(l){var h=t(r,a.length,l,c,n);h&&(a+=h+"; ")}}}r=s+1}for(;s";var y=c(o),b=i[n],w=a(y.html,(function(e,t){var i=-1!==u.indexOf(b,e),o=d(n,e,t,i);if(!l(o))return o;if(i)return t=p(n,e,t,m),t?e+'="'+t+'"':e;o=f(n,e,t,i);return l(o)?void 0:o}));o="<"+n;return w&&(o+=" "+w),y.closing&&(o+=" /"),o+=">",o}_=h(n,o,v);return l(_)?g(o):_}),g);return v&&(_=v.remove(_)),_},e.exports=d},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-message"},[n("div",{staticClass:"ui-message-swap"},[n("div",{staticClass:"ui-message-body"},[e.title?n("div",{staticClass:"ui-message-title"},[n("Icon",{attrs:{type:"md-help-circle"}}),e._v(" "),n("span",{staticClass:"ui-message-title-text",domProps:{innerHTML:e._s(e.xssFilter(e.title))}})],1):e._e(),e._v(" "),n("div",{staticClass:"ui-message-content",domProps:{innerHTML:e._s(e.xssFilter(e.template))}})]),e._v(" "),n("div",{staticClass:"ui-message-buttons"},e._l(e.buttons,(function(t,i){return n("div",{directives:[{name:"show",rawName:"v-show",value:t.show,expression:"button.show"}],key:i,staticClass:"ui-button",class:e.getButtonClass(t),domProps:{textContent:e._s(t.text)},on:{click:function(t){return e.click(i,t)}}})})),0)])])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(340),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default=o.default},function(e,t,n){var i=n(0)(n(341),n(346),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/modal/modal.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] modal.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(342),o=p(i),r=n(345),s=p(r),a=n(3),u=p(a),l=n(1),c=f(l),h=n(133),d=p(h);function f(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function p(e){return e&&e.__esModule?e:{default:e}}t.default={components:{Icon:u.default},props:{title:{type:String,required:!0},subTitle:{type:String,default:void 0},width:{type:[Number,String],default:400},closeOnClickShadow:{type:Boolean,default:!0},canFullScreen:{type:Boolean,default:!1},disableEsc:{type:Boolean,default:!1},beforeClose:{type:Function,default:void 0}},data:function(){return{isShow:!1,isScroll:!1,isFullScreen:!1}},computed:{getStyle:function(){return this.width?{width:this.width+"px"}:{}}},watch:{isShow:function(){var e=this,t=document.body;this.isShow?(this.closeOnClickShadow&&setTimeout((function(){e.$el.addEventListener("click",e.clickFn,!1)}),0),c.addClass(t,"ui-modal-open"),this.$nextTick(this.computeScroll)):(c.removeClass(t,"ui-modal-open"),this.closeOnClickShadow&&this.$el.removeEventListener("click",this.clickFn))}},mounted:function(){document.addEventListener("keydown",this.esc,!1),(0,d.default)(this.$refs.dialog,this.computeScroll)},beforeDestroy:function(){document.removeEventListener("keydown",this.esc),d.default.unbind(this.$refs.dialog)},methods:{computeScroll:function(){var e=window.innerHeight,t=window.getComputedStyle(this.$refs.dialog,null),n=/^([0-9]*)/.exec(t.height)[0];this.isScroll=n>e-50},esc:function(e){if(!this.disableEsc){var t=e.which||e.keyCode;if(this.isShow&&27==t){if(this.isFullScreen)return this.fullScreen();this.handleClose()}}},clickFn:function(e){e.target===this.$el&&this.isShow&&this.handleClose()},handleClose:function(){var e=this;return(0,s.default)(o.default.mark((function t(){var n;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=!0,!e.beforeClose){t.next=11;break}return t.prev=2,t.next=5,e.beforeClose({isFullScreen:e.isFullScreen});case 5:n=t.sent,t.next=11;break;case 8:t.prev=8,t.t0=t["catch"](2),n=!1;case 11:n&&e.close();case 12:case"end":return t.stop()}}),t,e,[[2,8]])})))()},close:function(){this.isShow=!1,this.$emit("on-close")},hide:function(){this.handleClose()},scroll:function(e){this.$emit("on-scroll",e)},show:function(){this.isShow=!0},fullScreen:function(){this.isFullScreen=!this.isFullScreen}}}},function(e,t,n){e.exports=n(343)},function(e,t,n){var i=function(){return this}()||Function("return this")(),o=i.regeneratorRuntime&&Object.getOwnPropertyNames(i).indexOf("regeneratorRuntime")>=0,r=o&&i.regeneratorRuntime;if(i.regeneratorRuntime=void 0,e.exports=n(344),o)i.regeneratorRuntime=r;else try{delete i.regeneratorRuntime}catch(s){i.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n,i=Object.prototype,o=i.hasOwnProperty,r="function"===typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag",l="object"===typeof e,c=t.regeneratorRuntime;if(c)l&&(e.exports=c);else{c=t.regeneratorRuntime=l?e.exports:{},c.wrap=b;var h="suspendedStart",d="suspendedYield",f="executing",p="completed",g={},m={};m[s]=function(){return this};var v=Object.getPrototypeOf,_=v&&v(v(M([])));_&&_!==i&&o.call(_,s)&&(m=_);var y=x.prototype=C.prototype=Object.create(m);S.prototype=y.constructor=x,x.constructor=S,x[u]=S.displayName="GeneratorFunction",c.isGeneratorFunction=function(e){var t="function"===typeof e&&e.constructor;return!!t&&(t===S||"GeneratorFunction"===(t.displayName||t.name))},c.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(y),e},c.awrap=function(e){return{__await:e}},L(k.prototype),k.prototype[a]=function(){return this},c.AsyncIterator=k,c.async=function(e,t,n,i){var o=new k(b(e,t,n,i));return c.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},L(y),y[u]="Generator",y[s]=function(){return this},y.toString=function(){return"[object Generator]"},c.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){while(t.length){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},c.values=M,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(D),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,o){return a.type="throw",a.arg=e,t.next=i,o&&(t.method="next",t.arg=n),!!o}for(var r=this.tryEntries.length-1;r>=0;--r){var s=this.tryEntries[r],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=o.call(s,"catchLoc"),l=o.call(s,"finallyLoc");if(u&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),D(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var o=i.arg;D(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:M(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=n),g}}}function b(e,t,n,i){var o=t&&t.prototype instanceof C?t:C,r=Object.create(o.prototype),s=new I(i||[]);return r._invoke=N(e,n,s),r}function w(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(i){return{type:"throw",arg:i}}}function C(){}function S(){}function x(){}function L(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function k(e){function t(n,i,r,s){var a=w(e[n],e,i);if("throw"!==a.type){var u=a.arg,l=u.value;return l&&"object"===typeof l&&o.call(l,"__await")?Promise.resolve(l.__await).then((function(e){t("next",e,r,s)}),(function(e){t("throw",e,r,s)})):Promise.resolve(l).then((function(e){u.value=e,r(u)}),s)}s(a.arg)}var n;function i(e,i){function o(){return new Promise((function(n,o){t(e,i,n,o)}))}return n=n?n.then(o,o):o()}this._invoke=i}function N(e,t,n){var i=h;return function(o,r){if(i===f)throw new Error("Generator is already running");if(i===p){if("throw"===o)throw r;return T()}n.method=o,n.arg=r;while(1){var s=n.delegate;if(s){var a=E(s,n);if(a){if(a===g)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=f;var u=w(e,t,n);if("normal"===u.type){if(i=n.done?p:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=p,n.method="throw",n.arg=u.arg)}}}function E(e,t){var i=e.iterator[t.method];if(i===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,E(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var o=w(i,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,g;var r=o.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,g):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function M(e){if(e){var t=e[s];if(t)return t.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){while(++i0&&e.children.forEach((function(e){n.setChild(e,t)}))},setParent:function(e){var t=e.parent;if(t){t.checked=t.children.some((function(e){return e.checked}));var n=void 0;n=t.children.every((function(e){return"0"===e.childrenCheckedStatus}))?"0":t.children.every((function(e){return"2"===e.childrenCheckedStatus}))?"2":"1",t.childrenCheckedStatus=n,this.setParent(t)}},getCheckedNode:function(e){e=e||this.root.children;var t=[],n=!0,i=!1,o=void 0;try{for(var r,a=(0,s.default)(e);!(n=(r=a.next()).done);n=!0){var u=r.value;u.checked&&t.push(u),u.children&&u.children.length&&(t=t.concat(this.getCheckedNode(u.children)))}}catch(l){i=!0,o=l}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}return t},recursion:function(e,t,n){var i=this,r=(0,o.default)({},t,{children:[]});if(this.$set(r,"_key",c++),this.$set(r,"parent",n),this.$set(r,"expand",t.expand||!1),this.$set(r,"selected",!this.multiple&&(t.selected||!1)),t.children&&t.children.length>0){var s=t.children.every((function(e){return!e.children||0==e.children.length}));s&&this.$set(r,"onlyDataChild",!0),this.$set(r,"checked",!1),this.$set(r,"childrenCheckedStatus","0"),t.children.forEach((function(e){i.recursion(r.children,e,r)}));var a=r.children.filter((function(e){return e.checked}));a.length==r.children.length?(r.childrenCheckedStatus="2",r.checked=!0):a.length>0&&a.length0&&n.setLoadData(t,t.children),e.children.push(i)}))},addNode:function(e,t){var n=(0,o.default)({},t,{children:[]});this.$set(n,"_key",c++),this.$set(n,"parent",e),this.$set(n,"expand",!1),this.$set(n,"selected",!1),this.$set(n,"checked",e.checked),this.$set(n,"childrenCheckedStatus",e.checked?"2":"0"),e.children.push(n)},removeNode:function(e){if(e.parent){var t=e.parent;e.parent=null;var n=t.children.indexOf(e);if(-1!=n){t.children.splice(n,1);var i=t.children.length>0?t.children[0]:t;this.setParent(i)}}}}}},function(e,t,n){var i=n(0)(n(361),n(364),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/tree/treeNode.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] treeNode.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),o=d(i),r=n(1),s=n(123),a=d(s),u=n(362),l=d(u),c=n(3),h=d(c);function d(e){return e&&e.__esModule?e:{default:e}}t.default={name:"TreeNode",components:{Icon:h.default,loading:a.default,nodeText:l.default},mixins:[o.default],props:{multiple:{type:Boolean,default:!1},parentNode:{type:Object,default:void 0},node:{type:Object,default:void 0}},data:function(){return{rootTree:(0,r.findComponentUpward)(this,"Tree"),dataLoading:!1,dataLoaded:!1}},computed:{getClass:function(){var e=["ui-tree","ui-child-tree"];return this.node.onlyDataChild&&e.push("ui-tree-just-data"),e},showArrow:function(){return this.rootTree.loadData&&!this.dataLoaded||this.node.children&&this.node.children.length>0}},methods:{getArrowType:function(e){var t="";return t=e.expand?"md-arrow-dropdown":"md-arrow-dropright",t},getCheckClass:function(e){var t=[];return"1"==e.childrenCheckedStatus&&t.push("ui-checkbox-indeterminate"),"2"==e.childrenCheckedStatus&&t.push("ui-checkbox-checked"),t},toggle:function(e){this.rootTree.loadData&&!this.dataLoaded?(this.dataLoading=!0,this.rootTree.loadData(this.node,this.addData)):e.expand=!e.expand},addData:function(e){this.dispatch("Tree","on-load-data",[this.node,e]),this.node.expand=!0,this.dataLoading=!1,this.dataLoaded=!0},clickNode:function(){this.rootTree.multiple?this.dispatch("Tree","on-check-click",this.node):this.dispatch("Tree","on-node-click",this.node)},clickCheckBox:function(){this.rootTree.multiple&&this.dispatch("Tree","on-check-click",this.node)}}}},function(e,t,n){var i=n(0)(n(363),null,null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/tree/nodeText.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{root:{type:Object,default:void 0},node:{type:Object,default:void 0},render:{type:Function,default:void 0}},methods:{clickHandler:function(){this.$emit("on-click")}},render:function(e){var t=[];return this.root.$scopedSlots.default?t.push(this.root.$scopedSlots.default({node:this.node,root:this.root})):t.push(this.node.name),e("span",{class:{"ui-tree-node-text":!0,selected:this.node.selected},on:{click:this.clickHandler}},t)}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{staticClass:"ui-tree-node"},[e.showArrow?[e.dataLoading?e._e():n("Icon",{staticClass:"ui-expand-arrow",attrs:{type:e.getArrowType(e.node)},on:{click:function(t){return e.toggle(e.node)}}}),e._v(" "),e.dataLoading?n("i",{staticClass:"loading"},[n("Loading",{attrs:{size:"14px",color:"#657180"}})],1):e._e()]:n("i",{staticClass:"ui-expand-null"}),e._v(" "),e.multiple?n("label",{staticClass:"ui-checkbox",class:e.getCheckClass(e.node),on:{click:e.clickCheckBox}},[n("span",{staticClass:"ui-checkbox-inner"})]):e._e(),e._v(" "),n("nodeText",{attrs:{root:e.rootTree,node:e.node},on:{"on-click":e.clickNode}}),e._v(" "),e.node.children&&e.node.children.length>0?n("ul",{directives:[{name:"show",rawName:"v-show",value:e.node.expand,expression:"node.expand"}],class:e.getClass},e._l(e.node.children,(function(t){return n("Tree-node",{key:t._key,attrs:{"parent-node":e.node,node:t,multiple:e.multiple},on:{"update:parentNode":function(t){e.node=t},"update:parent-node":function(t){e.node=t},"update:node":function(e){t=e}}})})),1):e._e()],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ul",{staticClass:"ui-tree",class:e.getClass},e._l(e.root.children,(function(t){return n("tree-node",{key:t._key,attrs:{node:t,"parent-node":e.root,multiple:e.multiple},on:{"update:node":function(e){t=e},"update:parentNode":function(t){e.root=t},"update:parent-node":function(t){e.root=t}}})})),1)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(367),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default=o.default},function(e,t,n){var i=!1;function o(e){i||n(368)}var r=n(0)(n(372),n(375),o,null,null);r.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/upload/upload.vue",r.esModule&&Object.keys(r.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),r.options.functional&&console.error("[vue-loader] upload.vue: functional components are not supported with templates, they should use render functions."),e.exports=r.exports},function(e,t,n){var i=n(369);"string"===typeof i&&(i=[[e.i,i,""]]);n(371)(i,{});i.locals&&(e.exports=i.locals)},function(e,t,n){t=e.exports=n(370)(),t.push([e.i,"\n.ui-upload {\n position: relative;\n}\n.ui-upload .ie-hack {\n display: block;\n position: absolute;\n top: 0;\n right: 0;\n opacity: 0;\n z-index: 1000;\n}\n",""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t=0&&u.splice(t,1)}function f(e){var t=document.createElement("style");return t.type="text/css",h(e,t),t}function p(e,t){var n,i,o;if(t.singleton){var r=a++;n=s||(s=f(t)),i=m.bind(null,n,r,!1),o=m.bind(null,n,r,!0)}else n=f(t),i=v.bind(null,n),o=function(){d(n)};return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else o()}}e.exports=function(e,t){if("undefined"!==typeof DEBUG&&DEBUG&&"object"!==typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");t=t||{},"undefined"===typeof t.singleton&&(t.singleton=o()),"undefined"===typeof t.insertAt&&(t.insertAt="bottom");var i=c(e);return l(i,t),function(e){for(var o=[],r=0;rt.maxSize&&(u.default.error(t.t("el.upload.sizeTip",{filename:e.name,size:t.maxSize/1024/1024})),i()),-1!=e.type.indexOf("image")&&t.imageSize){var a=document.createElement("img");a.src=window.URL.createObjectURL(e),a.onload=function(){t.imageSize.height&&t.imageSize.height!=a.height&&(u.default.error(t.t("el.upload.heightTip",{filename:e.name,height:t.imageSize.height})),i()),t.imageSize.width&&t.imageSize.width!=a.width&&(u.default.error(t.t("el.upload.widthTip",{filename:e.name,width:t.imageSize.width})),i()),window.URL.revokeObjectURL(a.src),n(e)}}else n(e)}))},change:function(e){var t=this;if(this.$emit("on-change",e),this.isIE(9))return this.iePost(e);for(var n=e.target.files,i=n.length,o=[],r=0;r=200&&o.status<300||304==o.status)try{var e=JSON.parse(o.responseText);t.$emit("on-success",n,e)}catch(i){console.error("响应格式不正确")}else t.$emit("on-fail",n,o.status);t.$refs.input.value=""}},o.open("POST",t.url),o.send(i)}}),(function(){t.$refs.input.value="",t.action?t.action(!1):t.$emit("on-fail",n,-1)}))}}}},function(e,t,n){var i=n(6),o=i.JSON||(i.JSON={stringify:JSON.stringify});e.exports=function(e){return o.stringify.apply(o,arguments)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(74),o=c(i),r=n(85),s=c(r),a=n(84),u=c(a),l=n(1);function c(e){return e&&e.__esModule?e:{default:e}}t.default={mounted:function(){this.computedIEStyle()},methods:{computedIEStyle:function(){var e=this,t=this.$slots.default&&this.$slots.default[0]&&this.$slots.default[0].elm;t&&this.isIE(9)&&this.$nextTick((function(){e.$refs.input.style.width=t.clientWidth+"px",e.$refs.input.style.height=t.clientHeight+"px"}))},isIE:function(e){return(0,l.isIEVersion)(e)},iePost:function(){var e=this,t=document.createElement("form"),n=document.createElement("iframe"),i=this.$refs.input,r=i.value.split("."),a=r[r.length-1];if(Array.isArray(this.accept)&&-1==this.accept.indexOf(a))return u.default.error("文件["+i.value+"]格式不正确,只能上传后缀为"+(0,s.default)(this.accept)+"的文件"),this.$refs.input.value="",void this.$emit("on-fail",this.$refs.input);i.name=this.param,t.style.display="none",n.name="vueUploadFile"+Date.now(),t.action=this.url,t.method="post",t.target=n.name,t.enctype="multipart/form-data",t.encoding="multipart/form-data",this.$refs.input.parentNode.insertBefore(t,this.$refs.input),t.appendChild(i),t.appendChild(n),n.addEventListener("load",(function(){try{for(var r=n.contentDocument.all,s={},a={result:{}},l=0;l=this.maxWidth&&(t.imgHeight=i.height*this.maxWidth/t.imgWidth,t.imgWidth=this.maxWidth),n.style.width=t.imgWidth+"px",n.style.height=t.imgHeight+"px";var r=(t.bodyWidth-t.imgWidth)/2+"px",s=(t.bodyHeight-t.imgHeight)/2;s=(s>0?s:0)+"px",o.style.left=r,o.style.top=s,t.bodyHeighte.current?t.status="ready":t.index==e.current?t.status="doing":t.status="done"}))}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-steps",class:{"ui-steps-small":"small"==e.size,"ui-steps-vertical":"vertical"==e.direction}},[e._t("default")],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(385),n(386),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/step-com/step.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] step.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default={name:"Step",components:{Icon:o.default},props:{title:{type:String,default:""},content:{type:String,default:void 0},icon:{type:String,default:void 0}},data:function(){return{status:"ready",index:0}},computed:{showTail:function(){return this.$parent.len!=this.index},getClass:function(){return"ui-step-"+this.status},getStyles:function(){return{width:this.$parent.sonWidth}}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-step",class:e.getClass,style:e.getStyles},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.showTail,expression:"showTail"}],staticClass:"ui-step-tail"},[n("i")]),e._v(" "),n("div",{staticClass:"ui-step-head"},[n("div",{staticClass:"ui-step-head-swap"},[e.$slots.default?[e._t("default")]:["done"==e.status?n("Icon",{attrs:{type:"md-checkmark"}}):n("span",[e._v("\n "+e._s(e.index)+"\n ")])]],2)]),e._v(" "),n("div",{staticClass:"ui-step-main"},[n("div",{staticClass:"ui-step-title"},[e._v("\n "+e._s(e.title)+"\n ")]),e._v(" "),n("div",{staticClass:"ui-step-desc"},[e._v("\n "+e._s(e.content)+"\n ")])])])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(135),o=a(i),r=n(393),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}o.default._directive=s.default,t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(28),o=g(i),r=n(128),s=g(r),a=n(5),u=g(a),l=n(389),c=g(l),h=n(12),d=g(h),f=n(3),p=g(f);function g(e){return e&&e.__esModule?e:{default:e}}t.default={name:"Tooltip",components:{Icon:p.default,tooltipComponent:c.default},mixins:[u.default,d.default],props:{text:{type:String,default:void 0},html:{type:String,default:void 0},component:{type:[Object,null],default:void 0},styleObject:{type:Object,default:void 0},direction:{type:String,default:void 0},align:{type:String,default:void 0},confirm:{type:[Boolean,String],default:void 0}},computed:{isComponent:function(){return null!=this.component&&this.component.constructor===o.default},isHtml:function(){return!this.isComponent&&this.html&&this.html.length>0},isText:function(){return!this.isComponent&&!this.isHtml&&this.text&&this.text.length>0},getClass:function(){var e=["ui-tooltip-direction-"+this.direction,"ui-tooltip-align-"+this.align];return(this.isHtml||this.isComponent)&&e.push("ui-tooltip-rich"),("true"===this.confirm||"confirm"===this.confirm||this.confirm)&&e.push("ui-tooltip-confirm"),e}},methods:{xssFilter:function(e){return(0,s.default)(e,{onIgnoreTagAttr:function(e,t,n){if("style"===t||"class"===t)return t+'="'+(0,r.safeAttrValue)(e,t,n)+'"'}})},ok:function(){this.dispatch("TooltipDirective","tooltip.ok")},cancel:function(){this.dispatch("TooltipDirective","tooltip.cancel")},mouseenter:function(){this.dispatch("TooltipDirective","tooltip.mouseenter")},mouseleave:function(){this.dispatch("TooltipDirective","tooltip.mouseleave")}}}},function(e,t,n){var i=n(0)(n(390),n(391),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/tooltip/tooltipComponent.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] tooltipComponent.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{component:{type:[Object,null],default:void 0}},data:function(){return{}},mounted:function(){this.component&&this.component.$mount(this.$refs.swap)}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"swap"})},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-tooltip",class:e.getClass,style:e.styleObject,on:{mouseenter:e.mouseenter,mouseleave:e.mouseleave}},[n("div",{staticClass:"ui-tooltip-swap"},[n("div",{staticClass:"ui-tooltip-arrow"}),e._v(" "),n("div",{staticClass:"ui-tooltip-inner"},[e.isText?n("div",{staticClass:"ui-tooltip-text"},[e.confirm?n("Icon",{attrs:{type:"md-help-circle"}}):e._e(),e._v("\n "+e._s(e.text)+"\n ")],1):e._e(),e._v(" "),e.isHtml?n("div",{domProps:{innerHTML:e._s(e.xssFilter(e.html))}}):e._e(),e._v(" "),e.isComponent?n("div",[n("tooltip-component",{attrs:{component:e.component}})],1):e._e(),e._v(" "),e.confirm?n("div",{staticClass:"ui-tooltip-buttons"},[n("div",{staticClass:"ui-button",on:{click:e.ok}},[e._v("\n "+e._s(e.t("el.tooltip.confirm"))+"\n ")]),e._v(" "),n("div",{staticClass:"ui-button",on:{click:e.cancel}},[e._v("\n "+e._s(e.t("el.tooltip.cancel"))+"\n ")])]):e._e()])])])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(28),o=c(i),r=n(135),s=c(r),a=n(1),u=l(a);function l(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function c(e){return e&&e.__esModule?e:{default:e}}var h={},d={mouseenter:["mouseenter","mouseleave"],click:["click","click"],focus:["focus","blur"],outsideClick:["click","outsideClick"]},f=function(e,t){var n=new o.default({name:"TooltipDirective",components:{Tooltip:s.default},data:function(){var e={show:!1,direction:"bottom",align:"center",styleObject:{},text:"",html:"",confirm:!1,component:null};return u.extend(e,t||{})},created:function(){this.$on("tooltip.ok",this.ok),this.$on("tooltip.cancel",this.cancel),this.$on("tooltip.mouseenter",this.mouseenter),this.$on("tooltip.mouseleave",this.mouseleave)},beforeDestroy:function(){this.$off("tooltip.ok"),this.$off("tooltip.cancel"),this.$off("tooltip.mouseenter"),this.$off("tooltip.mouseleave")},methods:{mouseenter:function(){this.show=!0},mouseleave:function(){this.show=!1},ok:function(){t.onOk&&t.onOk.call(e.vm)},cancel:function(){t.onCancel&&t.onCancel.call(e.vm)}},render:function(e){return e("tooltip",{props:{direction:this.direction,align:this.align,text:this.text,html:this.html,component:this.component,confirm:this.confirm,styleObject:this.styleObject,transition:"fade"},style:{display:this.show?"block":"none"}})}}),i=n.$mount();return e.el.parentNode?e.el.parentNode.appendChild(i.$el):e.el.appendChild(i.$el),n};t.default={inserted:function(e,t){var n={el:e};if(h[e]=n,"string"==u.typeOf(t.value))n.tooltipOption={text:t.value};else{if("object"!=u.typeOf(t.value))return console.warn("请正确使用tooltip组件!");n.tooltipOption=t.value}n.tooltipOption.direction||(n.tooltipOption.direction="bottom"),n.tooltipOption.align||(n.tooltipOption.align="center"),n.tooltipOption.trigger=n.tooltipOption.trigger||"mouseenter",n.triggerBind=function(){n.tooltipComponent&&(n.tooltipComponent.show=!n.tooltipComponent.show)},n.showTooltipBind=function(){n.tooltipComponent&&(n.tooltipComponent.show=!0)},n.hideTooltipBind=function(){n.tooltipComponent&&(n.tooltipComponent.show=!1)},n.bodyHideTooltipBind=function(e){n.tooltipComponent&&(n.el==e.target||n.tooltipComponent.$el==e.target||u.contains(n.el,e.target)||u.contains(n.tooltipComponent.$el,e.target)||(n.tooltipComponent.show=!1))};var i=d[n.tooltipOption.trigger][0],o=d[n.tooltipOption.trigger][1];"outsideClick"===o?(e.addEventListener("click",n.triggerBind,!1),document.addEventListener("click",n.bodyHideTooltipBind,!1)):i===o?e.addEventListener(i,n.triggerBind,!1):(e.addEventListener(i,n.showTooltipBind,!1),e.addEventListener(o,n.hideTooltipBind,!1)),n.tooltipOption.styleObject=u.getPositionWhenAfterBorther(e,n.tooltipOption.direction,n.tooltipOption.align),n.tooltipComponent=f(n,n.tooltipOption)},unbind:function(e){var t=h[e],n=d[t.tooltipOption.trigger][0],i=d[t.tooltipOption.trigger][1];"outsideClick"===i?(e.removeEventListener("click",t.triggerBind),document.removeEventListener("click",t.bodyHideTooltipBind)):n===i?e.removeEventListener(n,t.triggerBind):(e.removeEventListener(n,t.showTooltipBind),e.removeEventListener(i,t.hideTooltipBind))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(395),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default=o.default},function(e,t,n){var i=n(0)(n(396),n(413),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/pagination/pagination.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] pagination.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=h(i),r=n(136),s=h(r),a=n(137),u=h(a),l=n(12),c=h(l);function h(e){return e&&e.__esModule?e:{default:e}}var d=s.default.WbSelect,f=s.default.WbOption;t.default={components:{Icon:o.default,WbSelect:d,WbOption:f,WbInput:u.default},mixins:[c.default],props:{size:{type:Number,default:8},current:{type:Number,default:1},total:{type:Number,default:0},locking:{type:Boolean,default:!1},showSizeChanger:{type:Boolean,default:!0},showQuickJumper:{type:Boolean,default:!1},sizeList:{type:Array,default:function(){return[8,16,32,50,100]}}},data:function(){return{pageSizeList:this.sizeList,len:6,myCurrent:this.current,mySize:this.size,jumperPage:""}},computed:{pageCode:function(){for(var e=[],t=1;t<=this.total;t++)e.push(t);return e},codes:function(){var e=this,t=[];return this.pageCode.length>0&&this.pageCode.slice(0).forEach((function(n){Math.floor((e.myCurrent-1)/e.len)*e.lenthis.len},showLast:function(){return this.codes[this.len-1]1&&!this.locking&&(this.myCurrent-=1,this.dispatch())},next:function(){this.myCurrent1&&!this.locking&&(this.myCurrent-=this.len,this.myCurrent<1&&(this.myCurrent=1),this.dispatch())},nnext:function(){this.myCurrentthis.total&&(this.myCurrent=this.total),this.dispatch())},go:function(e){this.myCurrent>=1&&this.myCurrent<=this.total&&!this.locking&&(this.myCurrent=e,this.dispatch())},jumper:function(){this.go(this.jumperPage)},changePageSize:function(){this.myCurrent=1,this.dispatch()}}}},function(e,t,n){var i=n(0)(n(398),n(399),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/select/select.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] select.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(49),o=_(i),r=n(29),s=_(r),a=n(5),u=_(a),l=n(1),c=v(l),h=n(19),d=_(h),f=n(12),p=_(f),g=n(3),m=_(g);function v(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function _(e){return e&&e.__esModule?e:{default:e}}t.default={name:"WbSelect",components:{Icon:m.default},directives:{clickoutside:s.default},mixins:[u.default,p.default],props:{value:{type:[String,Number,Array],default:""},placeholder:{type:String,default:function(){return""}},disabled:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},multipleLimit:{type:Number,default:0},options:{type:Array,default:function(){return[]}},optionsValueName:{type:String,default:"value"},optionsTextName:{type:String,default:"text"}},data:function(){var e=this.makeData();return{focusOption:null,currentValue:this.value,searchValue:"",showClear:!1,showList:!1,myOptions:e,noChildren:e.length,pagination:{size:100,current:0},searching:!1}},computed:{getTabindex:function(){return this.disabled||this.readonly?-1:0},getUISelectClass:function(){return this.selectedOption&&this.selectedOption.currentLabel?"ui-select-selected-value":"ui-select-placeholder"},localPlaceholder:function(){return this.t("el.select.placeholder")},selectedOption:function(){var e=[];return this.myOptions.forEach((function(t){t.selected&&e.push(t)})),this.multiple?e:e.length>0?e[0]:null},disableLimit:function(){var e=this.currentValue,t=this.multiple,n=this.multipleLimit,i=!1;return t&&(i=(e||[]).length>=n&&n>0),i},searchOptions:function(){var e=this,t=[];return this.myOptions.forEach((function(n){e.searchValue&&-1!=n.text.indexOf(e.searchValue)?t.push(n):e.searchValue||t.push(n)})),t},currentOptions:function(){var e=this.pagination.size*this.pagination.current,t=this.searchOptions.slice(e,e+this.pagination.size);return t}},watch:{value:function(e){e!==this.currentValue&&(this.currentValue=e,this.changeCurrentValue())},showList:function(e){this.filterable&&e&&this.$nextTick((function(){this.$refs.searchInput.focus()}))},options:{handler:function(){this.myOptions=this.makeData(),this.noChildren=this.myOptions.length},deep:!0}},created:function(){this.addOptionCache=[];var e=function(e){var t=void 0;return function(){if(!t){t=!0;var n=this,i=arguments,o=function(){t=!1,e.apply(n,i)};this.$nextTick(o)}}};this.debouncedAppend=e((function(){this.myOptions=this.myOptions.concat(this.addOptionCache),this.addOptionCache=[]}))},beforeDestroy:function(){this.myOptions=[]},methods:{addTitleAttr:function(e,t){e.clientWidth0){var i=n[0];if(i.disabled)return;if(this.disableLimit&&!i.selected)return;this.clickOption(i)}}},clickOption:function(e){if(!this.disabled&&!this.readonly){if(this.multiple){var t=this.currentValue.indexOf(e.value);-1!=t?this.currentValue.splice(t,1):(this.multipleLimit<=0||this.currentValue.length0)&&(this.showClear=!0)},toggle:function(){this.$emit("on-click"),this.disabled||this.readonly||(this.showList=!this.showList,this.$nextTick((function(){var e=c.getViewport().height-this.$el.getBoundingClientRect().bottom;this.listHeight||(this.listHeight=this.$refs.list.clientHeight),e-this.listHeight<0?this.$refs.list.style.top="-"+(this.listHeight+10)+"px":this.$refs.list.style.top="32px"})))},clear:function(){this.disabled||this.readonly||(this.showClear=!1,this.multiple?this.currentValue=[]:this.currentValue="",this.searchValue="",this.finished(),this.changeCurrentValue())},close:function(){this.showList&&(this.finished(),this.dispatch("FormItem","on-form-blur",[this.currentValue])),this.showList=!1,this.searchValue=""},finished:function(){this.$emit("finished",this.currentValue)},prev:function(){this.pagination.current>0&&(this.pagination.current-=1,this.$nextTick((function(){this.$refs.list.scrollTop=0})))},next:function(){this.pagination.currentt.myOptions.length-1&&(n=0):e==d.default.UP&&n<0&&(n=t.myOptions.length-1))}));var i=this.myOptions[n];this.focusOption&&(this.focusOption.isFocus=!1,this.focusOption=null),i.isFocus=!0,this.focusOption=i,(this.focusOption.disabled||this.disableLimit&&!this.focusOption.selected)&&this.mouseChooseOption(e)}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.close,expression:"close"}],staticClass:"ui-select",class:{"ui-select-visible":e.showList,"ui-select-disabled":e.disabled,"ui-select-readonly":e.readonly,"ui-select-multiple":e.multiple}},[n("div",{ref:"selection",staticClass:"ui-select-selection",attrs:{tabindex:e.getTabindex},on:{click:e.toggle,mouseenter:e.focus,focus:e.focus,mouseleave:e.blur,blur:e.blur,keydown:e.keydown}},[e.multiple?[""===e.currentValue||0==e.currentValue.length?n("span",{staticClass:"ui-select-placeholder"},[e._v("\n "+e._s(e.placeholder||e.localPlaceholder)+"\n ")]):[n("div",{staticClass:"ui-select-multiple-selected"},e._l(e.selectedOption,(function(t,i){return n("span",{key:i,staticClass:"ui-select-selected-value"},[e._v("\n "+e._s(t.currentLabel)+"\n "),n("Icon",{attrs:{type:"md-close"},on:{click:function(n){return n.stopPropagation(),e.removeSelectedOption(t)}}})],1)})),0)]]:[n("span",{class:e.getUISelectClass,on:{mouseenter:e.handleTitleAttr}},[e._v("\n "+e._s(e.selectedOption&&e.selectedOption.currentLabel||e.placeholder||e.localPlaceholder)+"\n ")])],e._v(" "),n("div",{staticClass:"ui-select-selection-icons"},[n("Icon",{directives:[{name:"show",rawName:"v-show",value:!e.showClear,expression:"!showClear"}],attrs:{type:"md-arrow-dropdown"}}),e._v(" "),e.clearable?n("Icon",{directives:[{name:"show",rawName:"v-show",value:e.showClear,expression:"showClear"}],attrs:{type:"md-close-circle"},on:{click:function(t){return t.stopPropagation(),e.clear(t)}}}):e._e()],1)],2),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.showList,expression:"showList"}],ref:"list",staticClass:"ui-select-dropdown",class:{"no-option-children":e.noChildren},attrs:{transition:"slide"}},[e.filterable?[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchValue,expression:"searchValue"}],ref:"searchInput",staticClass:"ui-select-selected-input",attrs:{placeholder:e.t("el.select.searchPlaceholder")},domProps:{value:e.searchValue},on:{input:[function(t){t.target.composing||(e.searchValue=t.target.value)},e.changeSearchValue],keydown:e.keydown}})]:e._e(),e._v(" "),n("ul",{staticClass:"ui-select-dropdown-list",on:{click:e.selectOption}},[e._t("default"),e._v(" "),e.noChildren?[e._l(e.currentOptions,(function(t,i){return n("li",{key:i,staticClass:"ui-select-item",class:{"ui-select-item-selected":t.selected,"ui-select-item-disabled":t.disabled||e.disableLimit&&!t.selected,focus:t.isFocus},attrs:{"data-key":t.value},on:{mouseenter:e.handleTitleAttr,mouseover:function(n){return e.doFocus(t)}}},[e._v("\n "+e._s(t.text)+"\n ")])})),e._v(" "),n("li",{staticClass:"ui-select-pagination"},[n("wb-button",{attrs:{disabled:0==e.pagination.current,icon:"md-arrow-back",type:"text"},on:{click:function(t){return t.stopPropagation(),e.prev(t)}}}),e._v(" "),n("wb-button",{attrs:{disabled:e.pagination.current==Math.ceil(e.searchOptions.length/e.pagination.size)-1,icon:"md-arrow-forward",type:"text"},on:{click:function(t){return t.stopPropagation(),e.next(t)}}})],1)]:e._e()],2)],2)])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(401),n(402),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/select/option.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] option.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=u(i),r=n(5),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}t.default={name:"SelectOption",mixins:[s.default],props:{value:{type:[String,Number],required:!0},label:{type:[String,Number],default:void 0},disabled:{type:Boolean,default:!1}},data:function(){return{currentLabel:this.label,wbSelect:(0,i.findComponentUpward)(this,"WbSelect"),isFocus:!1}},computed:{selected:function(){return this.wbSelect.multiple?o.isArray(this.wbSelect.currentValue)&&-1!=this.wbSelect.currentValue.indexOf(this.value):this.wbSelect.currentValue==this.value},show:function(){return!this.wbSelect.searchValue||!this.currentLabel||-1!=this.currentLabel.indexOf(this.wbSelect.searchValue)}},created:function(){this.wbSelect?this.wbSelect.addOption(this):(0,i.findComponentUpward)(this,"WbSelect").addOption(this)},mounted:function(){this.currentLabel=this.label||this.$el.innerText||this.value},updated:function(){this.currentLabel=this.label||this.$el.innerText||this.value},beforeDestroy:function(){this.wbSelect?this.wbSelect.removeOption(this):(0,i.findComponentUpward)(this,"WbSelect").removeOption(this)},methods:{mouseenter:function(e){e.target.clientWidth=a*n.max&&(h=a*n.max+l),s.isIEVersion(9))return a=c<12?12:c,void(e.style.height=a*n.max+l+u+"px");s.isIEVersion(10)||(e.style.height=h+u+"px")},n.handler()},update:function(e){if(null!==e._value||"object"!==(0,o.default)(e._value)){var t=l[e.autoRowKey];t&&(e.style.overflow="hidden",t.handler(),e.style.overflow="auto")}},unbind:function(e){var t=l[e.autoRowKey];t&&(e.removeEventListener("input",t.handler),e.removeEventListener("keydown",t.keydown),e.removeEventListener("keyup",t.keyup))}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-input-swap",class:e.getClass,style:e.getStyle},[e.prepend?n("div",{ref:"prepend",staticClass:"ui-input-prepend"},[e._t("prepend")],2):e._e(),e._v(" "),n("div",{staticClass:"ui-input-content",on:{mouseenter:function(t){e.over=!0},mouseleave:function(t){e.over=!1}}},[e.icon?[n("Icon",{staticClass:"ui-input-icon",attrs:{type:e.icon},on:{click:function(t){return t.stopPropagation(),e.handleIconClick(t)}}})]:e._e(),e._v(" "),e.password?[e.showPassword?n("Icon",{staticClass:"ui-input-icon",attrs:{type:"md-eye"},on:{click:function(t){return t.stopPropagation(),e.changeInputType(t)}}}):e._e(),e._v(" "),e.showPassword?e._e():n("Icon",{staticClass:"ui-input-icon",attrs:{type:"md-eye-off"},on:{click:function(t){return t.stopPropagation(),e.changeInputType(t)}}})]:e._e(),e._v(" "),e.clearable&&!e.readonly&&!e.disabled&&e.over?[n("Icon",{staticClass:"ui-input-icon",attrs:{type:"md-close-circle"},on:{click:function(t){return t.stopPropagation(),e.clear(t)}}})]:e._e(),e._v(" "),e.isNormal?[n("input",{staticClass:"ui-input",attrs:{maxlength:e.maxlength,readonly:e.readonly,type:e.currentType,disabled:e.disabled,placeholder:e.placeholder,autocomplete:e.autocomplete,name:e.name},domProps:{value:e.currentValue},on:{keyup:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleEnter(t)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:e.handleDelete(t)}],focus:e.handleFocus,blur:e.handleBlur,input:e.handleInput,click:e.click}})]:e._e(),e._v(" "),"file"==e.type?[n("div",{staticClass:"ui-upload"},[n("Wb-button",{attrs:{disabled:e.disabled||e.readonly,type:"ghost",icon:"md-cloud-upload"},on:{click:e.chooseFile}},[e._v("\n "+e._s(e.placeholder||e.t("el.input.chooseFile"))+"\n ")]),e._v(" "),n("span",{staticClass:"ui-input-file-text"},[e._v(e._s(e.currentValue&&e.currentValue.name))]),e._v(" "),n("input",{ref:"input",staticClass:"ui-upload-file",attrs:{accept:e.accept,type:"file"},on:{change:e.updateFile}})],1)]:e._e(),e._v(" "),e.textarea?[n("textarea",{directives:[{name:"auto-row",rawName:"v-auto-row",value:e.autosize,expression:"autosize"}],staticClass:"ui-input",attrs:{rows:e.rows,maxlength:e.maxlength,readonly:e.readonly,disabled:e.disabled,placeholder:e.placeholder},domProps:{value:e.currentValue},on:{keyup:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleEnter(t)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:e.handleDelete(t)}],focus:e.handleFocus,blur:e.handleBlur,input:e.handleInput,click:e.click}})]:e._e()],2),e._v(" "),e.append?n("div",{ref:"append",staticClass:"ui-input-append"},[e._t("append")],2):e._e()])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ul",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total > 0"}],staticClass:"ui-page"},[n("li",{staticClass:"ui-page-prev",attrs:{title:e.t("el.pagination.prev")},on:{click:e.last}},[n("Icon",{attrs:{type:"ios-arrow-back"}})],1),e._v(" "),e.showFirst?n("li",{staticClass:"ui-page-item",attrs:{title:e.t("el.pagination.first")},on:{click:function(t){return e.go(1)}}},[e._v("\n 1\n ")]):e._e(),e._v(" "),e.showFirst?n("li",{staticClass:"ui-page-item-jump-prev",attrs:{title:e.t("el.pagination.pprev",{n:e.len})},on:{click:function(t){return e.prev()}}},[n("Icon",{attrs:{type:"ios-arrow-back"}}),e._v(" "),n("Icon",{staticClass:"second-icon",attrs:{type:"ios-arrow-back"}})],1):e._e(),e._v(" "),e._l(e.codes,(function(t,i){return n("li",{key:i,staticClass:"ui-page-item",class:{"ui-page-item-active":e.myCurrent==t},attrs:{title:e.t("el.pagination.n",{n:t})},on:{click:function(n){return e.go(t)}}},[e._v("\n "+e._s(t)+"\n ")])})),e._v(" "),e.showLast?n("li",{staticClass:"ui-page-item-jump-next",attrs:{title:e.t("el.pagination.nnext",{n:e.len})},on:{click:function(t){return e.nnext()}}},[n("Icon",{attrs:{type:"ios-arrow-forward"}}),e._v(" "),n("Icon",{staticClass:"second-icon",attrs:{type:"ios-arrow-forward"}})],1):e._e(),e._v(" "),e.showLast?n("li",{staticClass:"ui-page-item",attrs:{title:e.t("el.pagination.last")},on:{click:function(t){return e.go(e.total)}}},[e._v("\n "+e._s(e.total)+"\n ")]):e._e(),e._v(" "),n("li",{staticClass:"ui-page-next",attrs:{title:e.t("el.pagination.next")},on:{click:e.next}},[n("Icon",{attrs:{type:"ios-arrow-forward"}})],1),e._v(" "),e.showSizeChanger?n("li",{staticClass:"ui-page-select"},[n("wb-select",{attrs:{clearable:!1},on:{"on-change":e.changePageSize},model:{value:e.mySize,callback:function(t){e.mySize=t},expression:"mySize"}},e._l(e.pageSizeList,(function(t,i){return n("wb-option",{key:i,attrs:{value:t}},[e._v("\n "+e._s(e.t("el.pagination.select",{n:t}))+"\n ")])})),1)],1):e._e(),e._v(" "),e.showQuickJumper?n("li",{staticClass:"ui-page-quick-jumper",on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.jumper(t)}}},[e._v("\n "+e._s(e.t("el.pagination.jumper.pre"))+"\n "),n("wb-input",{staticClass:"jumper-input",model:{value:e.jumperPage,callback:function(t){e.jumperPage=t},expression:"jumperPage"}}),e._v("\n "+e._s(e.t("el.pagination.jumper.next"))+"\n ")],1):e._e()],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(415),o=a(i),r=n(418),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}t.default={Radio:o.default,RadioGroup:s.default}},function(e,t,n){var i=n(0)(n(416),n(417),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/radio-com/radio.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] radio.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(19),r=s(o);function s(e){return e&&e.__esModule?e:{default:e}}t.default={name:"Radio",props:{value:{type:[String,Number,Boolean],default:!1},label:{type:[String,Number],default:void 0},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},data:function(){return{name:"",group:!1,checked:this.value,tabindex:0,parent:(0,i.findComponentUpward)(this,"RadioGroup"),isFoucs:!1}},computed:{getClass:function(){var e=[];return this.checked&&e.push("ui-radio-wrapper-checked"),(this.readonly||this.parent&&this.parent.readonly)&&e.push("ui-radio-wrapper-readonly"),(this.disabled||this.parent&&this.parent.disabled)&&e.push("ui-radio-wrapper-disabled"),this.isFoucs&&e.push("ui-radio-wrapper-focus"),e}},watch:{value:function(e){this.group||(this.checked=e,this.$emit("change",this.checked),this.$emit("on-change",this.checked))}},mounted:function(){this.parent&&(this.checked=!1,this.tabindex=-1,this.parent.addItem(this))},methods:{click:function(){if(this.disabled||this.readonly||this.parent&&this.parent.disabled||this.parent&&this.parent.readonly)return!1;if(this.group){if(this.checked)return!1;this.parent.change(this.value)}else this.checked=!this.checked,this.$emit("click",this.checked),this.$emit("input",this.checked),this.$emit("change",this.checked),this.$emit("on-change",this.checked)},keydown:function(e){if(this.disabled||this.readonly||this.parent&&this.parent.disabled||this.parent&&this.parent.readonly)return!1;this.group||e.keyCode!=r.default.ENTER&&e.keyCode!=r.default.MAC_ENTER&&e.keyCode!=r.default.SPACE||(e.preventDefault(),this.click())}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("label",{staticClass:"ui-radio-wrapper",class:e.getClass,attrs:{tabindex:e.tabindex},on:{click:e.click,keydown:e.keydown}},[n("span",{staticClass:"ui-radio",class:{"ui-radio-checked":e.checked}},[n("span",{staticClass:"ui-radio-inner"})]),e._v(" "),n("span",{staticClass:"ui-radio-content"},[e._t("default",[e._v(e._s(e.label))])],2)])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(419),n(420),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/radio-com/radioGroup.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] radioGroup.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),o=a(i),r=n(19),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}t.default={name:"RadioGroup",mixins:[o.default],props:{value:{type:[String,Number,Boolean],default:""},vertical:{type:Boolean,default:!1},type:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},data:function(){return{name:"RadioGroup_"+(new Date).getTime(),currentValue:this.value,options:[],selectedOption:null,focusIndex:null}},computed:{getClass:function(){var e=[];return this.vertical&&e.push("ui-radio-group-vertical"),this.type&&e.push("ui-radio-group-"+this.type),e}},watch:{value:function(e){e!==this.currentValue&&(this.currentValue=e,this.changeValue(this.currentValue))},focusIndex:function(e,t){this.$children[t]&&(this.$children[t].isFoucs=!1),this.$children[e]&&(this.$children[e].isFoucs=!0)}},methods:{addItem:function(e){e.name=this.name,e.group=!0,this.options.push(e),this.init(this.currentValue)},changeValue:function(e){this.selectedOption&&(this.selectedOption.checked=!1,this.selectedOption=null),this.init(e),this.$emit("input",e),this.$emit("change",e),this.$emit("on-change",e),this.dispatch("FormItem","on-form-change",[e])},init:function(e){var t=this;this.options&&this.options.forEach((function(n){n.value===e&&(n.checked=!0,t.selectedOption=n)}))},change:function(e){this.currentValue==e?this.currentValue="":this.currentValue=e,this.changeValue(this.currentValue)},keydown:function(e){if(!this.disabled&&!this.readonly){if(e.keyCode==s.default.DOWN||e.keyCode==s.default.RIGHT){e.preventDefault(),this.focusIndex+=1,this.focusIndex>this.$children.length-1&&(this.focusIndex=0);var t=this.$children[this.focusIndex];t.disabled||t.readonly?this.keydown(e):t.click()}if(e.keyCode==s.default.UP||e.keyCode==s.default.LEFT){e.preventDefault(),this.focusIndex-=1,this.focusIndex<0&&(this.focusIndex=this.$children.length-1);var n=this.$children[this.focusIndex];n.disabled||n.readonly?this.keydown(e):n.click()}if(e.keyCode==s.default.ENTER||e.keyCode==s.default.MAC_ENTER||e.keyCode==s.default.SPACE){e.preventDefault();var i=this.$children[this.focusIndex];i&&i.click()}}},focus:function(){if(!this.disabled&&!this.readonly){var e=this.$children.length;e>0&&(this.focusIndex=0)}},blur:function(){this.focusIndex=null}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-radio-group",class:e.getClass,attrs:{tabindex:"0"},on:{keydown:e.keydown,focus:e.focus,blur:e.blur}},[e._t("default")],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(422),o=a(i),r=n(425),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}t.default={Checkbox:o.default,CheckboxGroup:s.default}},function(e,t,n){var i=n(0)(n(423),n(424),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/checkbox-com/checkbox.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] checkbox.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(19),r=s(o);function s(e){return e&&e.__esModule?e:{default:e}}t.default={name:"CheckBox",props:{value:{type:[String,Number,Boolean],default:!1},label:{type:[String,Number],default:void 0},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},data:function(){var e=(0,i.findComponentUpward)(this,"CheckboxGroup");return{name:"",checked:!e&&this.value,group:!1,parent:e,tabindex:0,isFoucs:!1}},computed:{getClass:function(){var e=[];return this.checked&&e.push("ui-checkbox-wrapper-checked"),(this.readonly||this.parent&&this.parent.readonly)&&e.push("ui-checkbox-wrapper-readonly"),(this.disabled||this.parent&&this.parent.disabled)&&e.push("ui-checkbox-wrapper-disabled"),this.isFoucs&&e.push("ui-checkbox-wrapper-focus"),e}},watch:{value:function(e){this.group||this.checked==e||(this.checked=e,this.$emit("change",this.checked),this.$emit("on-change",this.checked))}},mounted:function(){this.parent&&(-1!=this.parent.currentValue.indexOf(this.value)?this.checked=!0:this.checked=!1,this.parent.addItem(this),this.tabindex=-1)},methods:{click:function(){if(this.disabled||this.readonly||this.parent&&this.parent.disabled||this.parent&&this.parent.readonly)return!1;this.checked=!this.checked,this.group?this.parent.change(this.value,this.checked):(this.$emit("click",this.checked),this.$emit("input",this.checked),this.$emit("change",this.checked),this.$emit("on-change",this.checked))},keydown:function(e){if(this.disabled||this.readonly||this.parent&&this.parent.disabled||this.parent&&this.parent.readonly)return!1;this.group||e.keyCode!=r.default.ENTER&&e.keyCode!=r.default.MAC_ENTER&&e.keyCode!=r.default.SPACE||(e.preventDefault(),this.click())}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("label",{staticClass:"ui-checkbox-wrapper",class:e.getClass,attrs:{tabindex:e.tabindex},on:{click:e.click,keydown:e.keydown}},[n("span",{staticClass:"ui-checkbox",class:{"ui-checkbox-checked":e.checked}},[n("span",{staticClass:"ui-checkbox-inner"})]),e._v(" "),n("span",{staticClass:"ui-checkbox-content"},[e._t("default",[e._v(e._s(e.label))])],2)])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(426),n(427),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/checkbox-com/checkboxGroup.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] checkboxGroup.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),o=a(i),r=n(19),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}t.default={name:"CheckboxGroup",mixins:[o.default],props:{value:{type:Array,default:function(){return[]}},vertical:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},data:function(){return{currentValue:this.value,name:"checkbox_"+(new Date).getTime(),options:[],focusIndex:null}},computed:{getClass:function(){var e=[];return this.vertical&&e.push("ui-checkbox-group-vertical"),e}},watch:{value:function(){this.currentValue=this.value,this.updateChild()},focusIndex:function(e,t){this.$children[t]&&(this.$children[t].isFoucs=!1),this.$children[e]&&(this.$children[e].isFoucs=!0)}},methods:{updateChild:function(){var e=this;this.options.forEach((function(t){-1!=e.currentValue.indexOf(t.value)?t.checked=!0:t.checked=!1}))},addItem:function(e){e.name=this.name,e.group=!0,this.options.push(e)},change:function(e,t){if(t)this.currentValue.push(e);else{var n=this.currentValue.indexOf(e);-1!=n?this.currentValue.splice(n,1):console.warn("checkbox组件出现异常")}this.changeValue()},changeValue:function(){this.$emit("input",this.currentValue),this.$emit("change",this.currentValue),this.$emit("on-change",this.currentValue),this.dispatch("FormItem","on-form-change",[this.currentValue])},keydown:function(e){if(!this.disabled&&!this.readonly){if(e.keyCode==s.default.DOWN||e.keyCode==s.default.RIGHT){e.preventDefault(),this.focusIndex+=1,this.focusIndex>this.$children.length-1&&(this.focusIndex=0);var t=this.$children[this.focusIndex];(t.disabled||t.readonly)&&this.keydown(e)}if(e.keyCode==s.default.UP||e.keyCode==s.default.LEFT){e.preventDefault(),this.focusIndex-=1,this.focusIndex<0&&(this.focusIndex=this.$children.length-1);var n=this.$children[this.focusIndex];(n.disabled||n.readonly)&&this.keydown(e)}if(e.keyCode==s.default.SPACE||e.keyCode==s.default.ENTER||e.keyCode==s.default.MAC_ENTER){e.preventDefault();var i=this.$children[this.focusIndex];i.click()}}},focus:function(){if(!this.disabled&&!this.readonly){var e=this.$children.length;e>0&&(this.focusIndex=0)}},blur:function(){this.focusIndex=null}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-checkbox-group",class:e.getClass,attrs:{tabindex:"0"},on:{keydown:e.keydown,focus:e.focus,blur:e.blur}},[e._t("default")],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(429),o=a(i),r=n(455),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}t.default={WbForm:s.default,FormItem:o.default}},function(e,t,n){var i=n(0)(n(430),n(454),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/form/formItem.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] formItem.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(138),o=u(i);n(453);var r=n(1),s=n(5),a=u(s);function u(e){return e&&e.__esModule?e:{default:e}}t.default={name:"FormItem",mixins:[a.default],props:{prop:{type:String,default:void 0},label:{type:String,default:void 0},labelWidth:{type:Number,default:void 0},labelPosition:{type:String,default:void 0},showMessage:{type:Boolean,default:!0},rule:{type:Array,default:void 0},value:{type:[String,Number,Array,Boolean,Object],default:null}},data:function(){return{validateState:"",validateMessage:"",form:(0,r.findComponentUpward)(this,"WbForm")}},computed:{currentRule:function(){return[].concat(this.rule||[]).concat(this.form.rule&&this.form.rule[this.prop]||[])},required:function(){return!!(this.currentRule&&this.currentRule.length>0)&&this.currentRule.filter((function(e){return e.required})).length>0},getClass:function(){var e=[];return this.required&&e.push("ui-form-item-required"),"error"==this.validateState&&e.push("ui-form-item-error"),e.push("ui-form-position-"+(this.labelPosition||this.form.labelPosition)),e},getLabelStyle:function(){return{width:(this.labelWidth||this.form.labelWidth)+"px"}},getContentStyle:function(){return{marginLeft:"top"==(this.labelPosition||this.form.labelPosition)?0:(this.labelWidth||this.form.labelWidth)+"px"}}},mounted:function(){this.prop&&(this.$on("on-form-blur",this.onFieldBlur),this.$on("on-form-change",this.onFieldChange)),this.form.addItem(this)},beforeDestroy:function(){this.form.removeItem(this)},methods:{validate:function(e,t,n){var i=this;t=t||r.noop;var s=void 0;if(void 0!==n)s=n;else if(null!==this.value)s=this.value;else{var a=(0,r.findComponentDownward)(this,["Input","CheckboxGroup","InputDatePicker","RadioGroup","WbSelect","Switch","TimePicker"]);if(!a)return console.warn("表单组件请用FormItem组件包裹");s=a.value}if(!this.currentRule||0==this.currentRule.length)return t(),!0;var u=this.currentRule.filter((function(t){return!t.trigger||-1!==t.trigger.indexOf(e)}));if(0===u.length)return t(),!0;this.validateState="validating";var l={},c={};l[this.prop]=u,c[this.prop]=s;var h=new o.default(l);h.validate(c,(function(e){i.dispatch("WbForm","on-item-validate",[e]),e?(i.validateState="error",i.validateMessage=e[0].message,t(e)):(i.validateState="",t())}))},resetField:function(){this.validateState="",this.validateMessage=""},onFieldBlur:function(e){this.validate("blur",null,e)},onFieldChange:function(e){this.validate("change",null,e)}}}},function(e,t){var n,i,o=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}function u(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(function(){try{n="function"===typeof setTimeout?setTimeout:r}catch(e){n=r}try{i="function"===typeof clearTimeout?clearTimeout:s}catch(e){i=s}})();var l,c=[],h=!1,d=-1;function f(){h&&l&&(h=!1,l.length?c=l.concat(c):d=-1,c.length&&p())}function p(){if(!h){var e=a(f);h=!0;var t=c.length;while(t){l=c,c=[];while(++d1)for(var n=1;n()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i"),hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},h={integer:function(e){return h.number(e)&&parseInt(e,10)===e},float:function(e){return h.number(e)&&!h.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(t){return!1}},date:function(e){return"function"===typeof e.getTime&&"function"===typeof e.getMonth&&"function"===typeof e.getYear},number:function(e){return!isNaN(e)&&"number"===typeof e},object:function(e){return"object"===("undefined"===typeof e?"undefined":i(e))&&!h.array(e)},method:function(e){return"function"===typeof e},email:function(e){return"string"===typeof e&&!!e.match(c.email)&&e.length<255},url:function(e){return"string"===typeof e&&!!e.match(c.url)},hex:function(e){return"string"===typeof e&&!!e.match(c.hex)}};function d(e,t,n,o,s){if(e.required&&void 0===t)(0,a["default"])(e,t,n,o,s);else{var u=["integer","float","array","regexp","object","method","email","number","date","url","hex"],l=e.type;u.indexOf(l)>-1?h[l](t)||o.push(r.format(s.messages.types[l],e.fullField,e.type)):l&&("undefined"===typeof t?"undefined":i(t))!==e.type&&o.push(r.format(s.messages.types[l],e.fullField,e.type))}}t["default"]=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i);function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function s(e,t,n,i,r){var s="number"===typeof e.len,a="number"===typeof e.min,u="number"===typeof e.max,l=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=t,h=null,d="number"===typeof t,f="string"===typeof t,p=Array.isArray(t);if(d?h="number":f?h="string":p&&(h="array"),!h)return!1;p&&(c=t.length),f&&(c=t.replace(l,"_").length),s?c!==e.len&&i.push(o.format(r.messages[h].len,e.fullField,e.len)):a&&!u&&ce.max?i.push(o.format(r.messages[h].max,e.fullField,e.max)):a&&u&&(ce.max)&&i.push(o.format(r.messages[h].range,e.fullField,e.min,e.max))}t["default"]=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i);function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}var s="enum";function a(e,t,n,i,r){e[s]=Array.isArray(e[s])?e[s]:[],-1===e[s].indexOf(t)&&i.push(o.format(r.messages[s],e.fullField,e[s].join(", ")))}t["default"]=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i);function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function s(e,t,n,i,r){if(e.pattern)if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||i.push(o.format(r.messages.pattern.mismatch,e.fullField,t,e.pattern));else if("string"===typeof e.pattern){var s=new RegExp(e.pattern);s.test(t)||i.push(o.format(r.messages.pattern.mismatch,e.fullField,t,e.pattern))}}t["default"]=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(9),o=s(i),r=n(4);function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n,i,s){var a=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if((0,r.isEmptyValue)(t)&&!e.required)return n();o["default"].required(e,t,i,a,s),void 0!==t&&o["default"].type(e,t,i,a,s)}n(a)}t["default"]=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(9),o=s(i),r=n(4);function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n,i,s){var a=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(""===t&&(t=void 0),(0,r.isEmptyValue)(t)&&!e.required)return n();o["default"].required(e,t,i,a,s),void 0!==t&&(o["default"].type(e,t,i,a,s),o["default"].range(e,t,i,a,s))}n(a)}t["default"]=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=n(9),r=s(o);function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n,o,s){var a=[],u=e.required||!e.required&&o.hasOwnProperty(e.field);if(u){if((0,i.isEmptyValue)(t)&&!e.required)return n();r["default"].required(e,t,o,a,s),void 0!==t&&r["default"].type(e,t,o,a,s)}n(a)}t["default"]=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(9),o=s(i),r=n(4);function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n,i,s){var a=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if((0,r.isEmptyValue)(t)&&!e.required)return n();o["default"].required(e,t,i,a,s),(0,r.isEmptyValue)(t)||o["default"].type(e,t,i,a,s)}n(a)}t["default"]=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(9),o=s(i),r=n(4);function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n,i,s){var a=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if((0,r.isEmptyValue)(t)&&!e.required)return n();o["default"].required(e,t,i,a,s),void 0!==t&&(o["default"].type(e,t,i,a,s),o["default"].range(e,t,i,a,s))}n(a)}t["default"]=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(9),o=s(i),r=n(4);function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n,i,s){var a=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if((0,r.isEmptyValue)(t)&&!e.required)return n();o["default"].required(e,t,i,a,s),void 0!==t&&(o["default"].type(e,t,i,a,s),o["default"].range(e,t,i,a,s))}n(a)}t["default"]=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(9),o=s(i),r=n(4);function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n,i,s){var a=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if((0,r.isEmptyValue)(t,"array")&&!e.required)return n();o["default"].required(e,t,i,a,s,"array"),(0,r.isEmptyValue)(t,"array")||(o["default"].type(e,t,i,a,s),o["default"].range(e,t,i,a,s))}n(a)}t["default"]=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(9),o=s(i),r=n(4);function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n,i,s){var a=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if((0,r.isEmptyValue)(t)&&!e.required)return n();o["default"].required(e,t,i,a,s),void 0!==t&&o["default"].type(e,t,i,a,s)}n(a)}t["default"]=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(9),o=s(i),r=n(4);function s(e){return e&&e.__esModule?e:{default:e}}var a="enum";function u(e,t,n,i,s){var u=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if((0,r.isEmptyValue)(t)&&!e.required)return n();o["default"].required(e,t,i,u,s),t&&o["default"][a](e,t,i,u,s)}n(u)}t["default"]=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(9),o=s(i),r=n(4);function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n,i,s){var a=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if((0,r.isEmptyValue)(t,"string")&&!e.required)return n();o["default"].required(e,t,i,a,s),(0,r.isEmptyValue)(t,"string")||o["default"].pattern(e,t,i,a,s)}n(a)}t["default"]=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(9),o=s(i),r=n(4);function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n,i,s){var a=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if((0,r.isEmptyValue)(t)&&!e.required)return n();if(o["default"].required(e,t,i,a,s),!(0,r.isEmptyValue)(t)){var l=void 0;l="number"===typeof t?new Date(t):t,o["default"].type(e,l,i,a,s),l&&o["default"].range(e,l.getTime(),i,a,s)}}n(a)}t["default"]=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=n(9),r=s(o);function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n,o,s){var a=[],u=Array.isArray(t)?"array":"undefined"===typeof t?"undefined":i(t);r["default"].required(e,t,o,a,s,u),n(a)}t["default"]=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(9),o=s(i),r=n(4);function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n,i,s){var a=e.type,u=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if((0,r.isEmptyValue)(t,a)&&!e.required)return n();o["default"].required(e,t,i,u,s,a),(0,r.isEmptyValue)(t,a)||o["default"].type(e,t,i,u,s)}n(u)}t["default"]=a},function(e,t,n){"use strict";function i(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}Object.defineProperty(t,"__esModule",{value:!0}),t.newMessages=i;t.messages=i()},function(e,t,n){"use strict";var i=n(138),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}o.default.register("mobile",(function(e,t,n){""==t||/^1\d{10}$/.test(t)?n():n(new Error(e.message||"请输入正确的手机号码"))})),o.default.register("cname",(function(e,t,n){""==t||/^[\u4E00-\u9FA50-9a-zA-Z]{2,10}$/.test(t)?n():n(new Error(e.message||"请输入正确的中文名"))})),o.default.register("password",(function(e,t,n){""!=t&&(t.length>16||t.length<8||!/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{8,16}$/.test(t))?n(new Error(e.message||"请输入正确的密码,必须包含大写、小写字符和数字,8-16位")):n()})),o.default.register("money",(function(e,t,n){var i=e.afterPoint||2;""==t||new RegExp("(^[1-9]\\d*(\\.\\d{1,"+i+"})?$)|(^0(\\.\\d{1,"+i+"})?$)").test(t)?n():n(new Error(e.message||"请输入正确的金额"))})),o.default.register("equal",(function(e,t,n){var i=e.enqualTo;t!=i?n(new Error(e.message)):n()})),o.default.register("min",(function(e,t,n){var i=e.minTo;""!==t&&null!==t&&void 0!==t&&Number(t)Number(i)?n(new Error(e.message)):n()}))},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-form-item",class:e.getClass},[e.label?n("label",{ref:"label",staticClass:"ui-form-label",style:e.getLabelStyle},[e._v(e._s(e.label))]):e._e(),e._v(" "),n("div",{staticClass:"ui-form-content",style:e.getContentStyle},[e._t("default"),e._v(" "),"error"===e.validateState&&e.showMessage&&e.form.currentShowMessage?n("div",{staticClass:"ui-form-error-tip"},[e._v("\n "+e._s(e.validateMessage)+"\n ")]):e._e()],2)])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(456),n(457),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/form/form.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] form.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"WbForm",props:{labelPosition:{type:String,default:"right"},labelWidth:{type:Number,default:80},rule:{type:[Object,Array],default:void 0},type:{type:String,default:"normal"},showMessage:{type:Boolean,default:!0},autocomplete:{type:String,default:"off"}},data:function(){return{validateFormItems:[]}},computed:{getClass:function(){var e=[];return e.push("ui-form-type-"+this.type),e},currentShowMessage:function(){return"query"!=this.type&&this.showMessage}},mounted:function(){this.$on("on-item-validate",(function(e){this.$emit("on-validate",e)}))},methods:{addItem:function(e){-1==this.validateFormItems.indexOf(e)&&e.prop&&e.currentRule.length>0&&this.validateFormItems.push(e)},removeItem:function(e){var t=this.validateFormItems.indexOf(e);-1!=t&&this.validateFormItems.splice(t,1)},validate:function(e){var t=this.validateFormItems.length,n=0,i=!0,o=[];if(t>0)for(var r=0;r0&&n.push.apply(n,t.getItems(e.$children))})),n}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{class:e.subMenuClassNames,on:{mouseover:e.toggle,mouseout:e.toggle}},[n("div",{staticClass:"ui-menu-submenu-title",on:{click:e.click}},[e.icon?n("img",{staticClass:"ui-menu-submenu-icon",attrs:{src:e.icon},on:{load:e.loadIcon}}):e._e(),e._v("\n "+e._s(e.title)+"\n "),n("div",{class:e.arrowClassNames},[n("Icon",{attrs:{type:"ios-arrow-down",size:"12"}})],1)]),e._v(" "),n("ul",{directives:[{name:"show",rawName:"v-show",value:e.active,expression:"active"}],ref:"submenuSwap",staticClass:"ui-menu-submenu-ul"},[e._t("default")],2)])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default={name:"MenuItem",mixins:[o.default],props:{name:{required:!0,type:[String,Number]},icon:{required:!1,type:String,default:""}},data:function(){return{actived:!1}},computed:{classNames:function(){return{"ui-menu-item-actived":this.actived,"ui-menu-item":!0}}},mounted:function(){var e=this;this.$on("fes_menu_activeName",(function(t){e.actived=t===e.name}))},methods:{click:function(){this.dispatch("Menu","fes_menu_item_click",this.name)}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{class:e.classNames,on:{click:e.click}},[e.icon?n("img",{staticClass:"ui-menu-item-icon",attrs:{src:e.icon}}):e._e(),e._v(" "),e._t("default")],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(466),n(467),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/menu/menuGroup.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] menuGroup.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"MenuGroup",props:{title:{type:String,default:void 0}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-menu-group"},[n("div",{staticClass:"ui-menu-group-title"},[e._v("\n "+e._s(e.title)+"\n ")]),e._v(" "),n("ul",[e._t("default")],2)])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(469),n(470),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/menu/routeMenu.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] routeMenu.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(43),o=p(i),r=n(1),s=n(140),a=p(s),u=n(142),l=p(u),c=n(141),h=p(c),d=n(5),f=p(d);function p(e){return e&&e.__esModule?e:{default:e}}t.default={name:"RouteMenu",components:{WbMenu:a.default,WbMenuItem:l.default,WbSubMenu:h.default},mixins:[f.default],props:{mode:{validator:function(e){return(0,r.oneOf)(e,["horizontal","vertical"])},default:"vertical"},width:{type:[String,Number],default:void 0},menu:{type:Array,default:void 0},type:{validator:function(e){return(0,r.oneOf)(e,["light","dark"])},default:"light"},autoClose:{type:Boolean,default:!1}},data:function(){return{activeName:""}},computed:{allPath:function(){for(var e=this.menu,t=[],n=0;n0)for(var o=0;o0?[e._l(e.menu,(function(t,i){return[t.subMenu&&t.subMenu.length>0?n("wb-sub-menu",{key:t.title+i,attrs:{title:t.title,icon:t.icon}},e._l(t.subMenu,(function(t){return n("wb-menu-item",{key:t.path,attrs:{name:t.path,icon:t.icon}},[e._v("\n "+e._s(t.title)+"\n ")])})),1):n("wb-menu-item",{key:t.path,attrs:{name:t.path,icon:t.icon}},[e._v("\n "+e._s(t.title)+"\n ")])]}))]:e._e()],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(472),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default=o.default},function(e,t,n){var i=n(0)(n(473),n(474),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/panel/panel.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] panel.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"Panel",props:{title:{type:String,default:void 0}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-panel"},[n("div",{staticClass:"ui-panel-title"},[e._v("\n "+e._s(e.title)+"\n "),n("div",{staticClass:"ui-panel-title-button"},[e._t("action")],2)]),e._v(" "),n("div",{staticClass:"ui-panel-content"},[e._t("default")],2)])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(476),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default=o.default},function(e,t,n){var i=n(0)(n(477),n(478),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/affix/affix.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] affix.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(143),o=s(i),r=n(1);function s(e){return e&&e.__esModule?e:{default:e}}t.default={name:"Affix",props:{offsetTop:{type:Number,default:0},offsetBottom:{type:Number,default:void 0},target:{type:Function,default:function(){return document.body}}},data:function(){return{affix:!1,styles:null,elHeight:0}},computed:{offsetType:function(){var e="top";return this.offsetBottom>=0&&(e="bottom"),e}},watch:{affix:function(e){this.$emit("on-change",e)}},mounted:function(){var e=this;this.$nextTick((function(){e._target=e.target();var t=e.$el.getBoundingClientRect(),n=e._target.getBoundingClientRect();e._height=t.height,e._width=t.width,e.initDistance=t.top-n.top,e._scrollEvent=o.default.listen(e._target,"scroll",e.handleScroll),e._resizeEvent=o.default.listen(e._target,"resize",e.handleScroll),e.handleScroll()}))},beforeDestroy:function(){this._scrollEvent.remove(),this._resizeEvent.remove()},methods:{handleScroll:function(){var e=this.$el,t=this._target,n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),o=(0,r.getScroll)(t,!0),s=(0,r.getScroll)(t,!1),a=e.clientLeft||0,u=n.left+s-a,l=i.height;if("top"===this.offsetType){if(this.offsetTop+this._height>l)return;this.offsetTop+o>=this.initDistance?this.affix||(this.affix=!0,this.styles={top:this.offsetTop+i.top+"px",left:u+"px",height:this._height+"px",width:this._width+"px"}):this.affix&&(this.affix=!1,this.styles=null)}else{if(this.offsetBottom+this._height>l)return;this.initDistance+this._height+this.offsetBottom>o+l?this.affix||(this.affix=!0,this.styles={top:i.bottom-this.offsetBottom-this._height+"px",left:u+"px",height:this._height+"px",width:this._width+"px"}):this.affix&&(this.affix=!1,this.styles=null)}}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{"ui-affix":e.affix},style:e.styles},[e._t("default")],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(480),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default=o.default},function(e,t,n){var i=n(0)(n(481),n(482),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/back-top/backTop.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] backTop.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=u(i),r=n(1),s=n(143),a=u(s);function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t,n,i){var o=n-t,r=e/(i/2),s=0;return s=r<1?o/2*r*r*r+t:o/2*((r-=2)*r*r+2)+t,s}function c(){var e=r.noop;return"undefined"!==typeof window&&(e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout((function(){e&&e()}),1e3/60)}),e}t.default={name:"BackTop",components:{Icon:o.default},props:{heightToShow:{type:Number,default:400},target:{type:Function,default:function(){return document.documentElement}}},data:function(){return{visible:!1,container:null}},mounted:function(){var e=this;this.$nextTick((function(){e.container=e.target(),e.container===document.documentElement?e._scrollEvent=a.default.listen(window,"scroll",e.handleScroll):e._scrollEvent=a.default.listen(e.container,"scroll",e.handleScroll)}))},beforeDestroy:function(){this._scrollEvent.remove()},methods:{setScrollTop:function(e){this.container.scrollTop=e},scrollToTop:function(){var e=this,t=this.container.scrollTop,n=c(),i=Date.now(),o=function o(){var r=Date.now(),s=r-i;e.setScrollTop(l(s,t,0,400)),s<400&&n(o)};n(o)},handleScroll:function(){var e=(0,r.getScroll)(this.container,!0);this.visible=e>this.heightToShow}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"ui-back-top-outer",on:{click:e.scrollToTop}},[e._t("default",[n("div",{staticClass:"ui-back-top-inner"},[n("Icon",{attrs:{type:"md-arrow-up",size:"25"}})],1)])],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(484),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default=o.default},function(e,t,n){var i=n(0)(n(485),n(486),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/process-circle/processCircle.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] processCircle.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"ProcessCircle",props:{percent:{type:Number,default:0},size:{type:Number,default:120},strokeWidth:{type:Number,default:6},strokeColor:{type:String,default:"#3399ff"},strokeType:{validator:function(e){return-1!==["square","round"].indexOf(e)},default:"round"},trailWidth:{type:Number,default:5},trailColor:{type:String,default:"#eaeef2"}},computed:{getSize:function(){return{width:this.size+"px",height:this.size+"px"}},radius:function(){return 50-this.strokeWidth/2},pathString:function(){return"M 50 , 50 m 0 ,-"+this.radius+" a "+this.radius+" , "+this.radius+" 0 1 1 0 , "+2*this.radius+" a "+this.radius+" , "+this.radius+" 0 1 1 0 , -"+2*this.radius},circleLen:function(){return 2*Math.PI*this.radius},pathStyle:function(){return{"stroke-dasharray":this.circleLen+"px "+this.circleLen+"px","stroke-dashoffset":(100-this.percent)/100*this.circleLen+"px",transition:"stroke-dashoffset 0.6s ease 0s, stroke 0.6s ease"}}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-process-circle",style:e.getSize},[n("svg",{attrs:{viewBox:"0 0 100 100"}},[n("path",{attrs:{d:e.pathString,stroke:e.trailColor,"stroke-width":e.trailWidth,"fill-opacity":0}}),e._v(" "),n("path",{style:e.pathStyle,attrs:{d:e.pathString,"stroke-linecap":e.strokeType,stroke:e.strokeColor,"stroke-width":e.strokeWidth,"fill-opacity":"0"}})]),e._v(" "),n("div",{staticClass:"ui-process-circle-inner"},[e._t("default")],2)])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(488),o=a(i),r=n(144),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}t.default={Dropdown:o.default,DropdownMenu:s.default}},function(e,t,n){var i=n(0)(n(489),n(492),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/dropdown-com/dropdown.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] dropdown.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(144),o=c(i),r=n(5),s=c(r),a=n(1),u=n(29),l=c(u);function c(e){return e&&e.__esModule?e:{default:e}}t.default={name:"Dropdown",directives:{clickoutside:l.default},components:{dropdownMenu:o.default},mixins:[s.default],props:{trigger:{required:!1,type:String,default:"hover",validator:function(e){return-1!==["click","hover"].indexOf(e)}},data:{type:Array,default:void 0}},data:function(){return{sonOpen:!1,timer:null}},mounted:function(){var e=this;this.$on("chooseItem",(function(t,n){e.$emit("on-choose",t,n),e.close()}))},methods:{close:function(){var e=this;this.sonOpen=!1,this.closing=!0,setTimeout((function(){e.closing=!1}),300),this.broadcast("DropdownMenu","hideSubmenu",this)},mouseover:function(e){"hover"!=this.trigger||this.closing&&!(0,a.contains)(this.$refs["dropdown-slot"],e.target)||(this.timer&&clearTimeout(this.timer),this.sonOpen=!0)},mouseout:function(){var e=this;"hover"==this.trigger&&(this.timer=setTimeout((function(){e.sonOpen=!1}),300))},click:function(){"click"==this.trigger&&(this.sonOpen=!this.sonOpen)},clickoutside:function(){"click"==this.trigger&&this.sonOpen&&this.close()}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default={name:"DropdownMenu",mixins:[o.default],props:{type:{required:!1,type:String,default:"root"},data:{type:Array,default:void 0},open:{type:Boolean,default:!1}},data:function(){return{currentData:this.data,timer:null}},computed:{dropdownMenuClass:function(){if("sub"===this.type)return"wb-dropdown-menu-sub"}},created:function(){var e=this;this.$on("hideSubmenu",(function(){e.broadcast("DropdownMenu","hideSubmenu",e),e.currentData.forEach((function(e){e.children&&e.children.length>0&&(e.sonOpen=!1)}))}))},mounted:function(){var e=this;this.currentData.forEach((function(t){t.children&&t.children.length>0&&e.$set(t,"sonOpen",!1)}))},methods:{getItemClass:function(e){var t=["wb-dropdown-menu-item",{"wb-dropdown-menu-item-disabled":e.disabled},{"wb-dropdown-menu-item-divider":e.divided}];return e.children&&e.children.length>0&&t.push("wb-dropdown-menu-item-swap"),t},mouseover:function(e){e.children&&0!=e.children.length&&(e.timer&&clearTimeout(e.timer),e.sonOpen=!0)},mouseout:function(e){e.children&&0!=e.children.length&&(e.timer=setTimeout((function(){e.sonOpen=!1}),300))},choose:function(e,t){e.children&&0!=e.children.length||this.dispatch("Dropdown","chooseItem",[e,t])}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"slide-to-down"}},[n("ul",{directives:[{name:"show",rawName:"v-show",value:e.open,expression:"open"}],ref:"list",staticClass:"wb-dropdown-menu",class:e.dropdownMenuClass},e._l(e.currentData,(function(t,i){return n("li",{key:i,class:e.getItemClass(t),on:{mouseover:function(n){return e.mouseover(t)},mouseout:function(n){return e.mouseout(t)},click:function(n){return e.choose(t,n)}}},[e._v("\n "+e._s(t.content)+"\n "),t.children&&t.children.length?[n("dropdown-menu",{attrs:{data:t.children,open:t.sonOpen,type:"sub"}})]:e._e()],2)})),0)])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.clickoutside,expression:"clickoutside"}],staticClass:"wb-dropdown",on:{mouseover:e.mouseover,mouseout:e.mouseout}},[n("div",{ref:"dropdown-slot",staticClass:"wb-dropdown-slot",on:{click:e.click}},[e._t("default")],2),e._v(" "),n("dropdown-menu",{attrs:{data:e.data,open:e.sonOpen}})],1)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(494),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default=o.default},function(e,t,n){var i=n(0)(n(495),n(506),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/draggable/Draggable.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] Draggable.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(74),o=c(i),r=n(496),s=c(r),a=n(499),u=n(500),l=c(u);function c(e){return e&&e.__esModule?e:{default:e}}t.default={name:"Draggable",components:{DraggableItem:s.default},props:{value:{type:Array,required:!0},disabled:{type:Boolean,default:!1}},data:function(){return{manager:new l.default,collection:"default",events:{mousedown:"handleStart",mousemove:"handleMove",mouseup:"handleUp"}}},provide:function(){return{manager:this.manager}},mounted:function(){var e=this;this.collection=this._uid,this.container=this.$el,this._window=window,(0,o.default)(this.events).forEach((function(t){e.container.addEventListener(t,e[e.events[t]],!1)}))},beforeDestroy:function(){var e=this;(0,o.default)(this.events).forEach((function(t){e.container.removeEventListener(t,e[e.events[t]])}))},methods:{handleStart:function(e){if(e.stopPropagation(),!this.disabled){this._pos={x:e.pageX,y:e.pageY};var t=(0,a.closest)(e.target,(function(e){return e.sortableInfo&&null!=e.sortableInfo}));if(t&&t.sortableInfo){var n=t.sortableInfo,i=n.index,o=n.item;this.activeNode=t,this.$emit("on-sort-ready",{e:e,item:o,index:i}),this.handlePress(e)}}},handlePress:function(){var e=this,t=this.manager.getOrderedRefs(this.collection);this.activeIndex=t.findIndex((function(t){return t===e.activeNode})),this.nodeRect=this.activeNode.getBoundingClientRect(),this.width=this.nodeRect.width,this.height=this.nodeRect.height,this.offsetEdge=this.getEdgeOffset(this.activeNode),this.sorting=!0},handleUp:function(){this.sorting=!1},handleMove:function(e){if(e.preventDefault(),this.sorting){var t={x:e.pageX-this._pos.x,y:e.pageY-this._pos.y};if(Math.abs(t.x)>5||Math.abs(t.y)>5){var n=this.activeNode.sortableInfo,i=n.index,o=n.item;if(this.$emit("on-sort-start",{e:e,item:o,index:i}),o.sortDisabled)return;if(!this.helper){this._window.addEventListener("mousemove",this.handleSortMove,!1),this._window.addEventListener("mouseup",this.handleSortEnd,!1);var r=this.activeNode.cloneNode(!0);this.activeNode.style.opacity=0,this.activeNode.style.visibility="hidden",this.initHelper(r)}}}},handleSortMove:function(e){var t={x:e.pageX-this._pos.x,y:e.pageY-this._pos.y},n={left:this.offsetEdge.left+t.x,top:this.offsetEdge.top+t.y};this.newIndex=null;for(var i=this.manager.getOrderedRefs(this.collection),o=0;os?s/2:this.width/2,height:this.height>u?u/2:this.height/2},c=r.edgeOffset;c||(r.edgeOffset=c=this.getEdgeOffset(r)),o!==this.activeIndex&&(o>this.activeIndex&&n.top+l.height>c.top?(this.newIndex=o,this._translate.y=-u):o1&&void 0!==arguments[1]?arguments[1]:{top:0,left:0},n={top:t.top+e.offsetTop,left:t.left+e.offsetLeft};return e.parentNode&&e.parentNode!==this.container?this.getEdgeOffset(e.parentNode,n):n}}}},function(e,t,n){var i=n(0)(n(497),n(498),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/draggable/DraggableItem.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] DraggableItem.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"DraggableItem",props:{index:{type:Number,default:void 0},item:{type:Object,default:void 0}},data:function(){return{collection:"default"}},inject:["manager"],watch:{index:function(e){this.$el&&(this.$el.sortableInfo.newIndex=e)},item:{handler:function(e){this.$el&&(this.$el.sortableInfo.item=e)},deep:!0}},mounted:function(){this.collection=this.getClosetDraggable(this)._uid,this.initItem(this.index,this.item)},beforeDestroy:function(){this.removeDraggable()},methods:{initItem:function(e,t){var n=this.$el;n.sortableInfo={index:e,item:t},this.ref=n,this.manager.add(this.ref,this.collection)},removeDraggable:function(){this.manager.remove(this.ref,this.collection)},getClosetDraggable:function(e){var t=e.$parent;return t?"Draggable"===t.$options.name?t:this.getClosetDraggable(t):null}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"draggable-item"},[e._t("default")],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";function i(e,t,n){var i=e.slice(0);if(n>=i.length){var o=n-i.length;while(1+o--)i.push(void 0)}return i.splice(n,0,i.splice(t,1)[0]),i}Object.defineProperty(t,"__esModule",{value:!0}),t.arrayMove=i,t.closest=o,t.limit=r,t.getElementMargin=a,t.getHelperDimensions=u;t.vendorPrefix=function(){if("undefined"===typeof window||"undefined"===typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];switch(t){case"ms":return"ms";default:return t&&t.length?t[0].toUpperCase()+t.substr(1):""}}();function o(e,t){while(e){if(t(e))return e;e=e.parentNode}}function r(e,t,n){return nt?t:n}function s(e){return"px"===e.substr(-2)?parseFloat(e):0}function a(e){var t=window.getComputedStyle(e);return{top:s(t.marginTop),right:s(t.marginRight),bottom:s(t.marginBottom),left:s(t.marginLeft)}}function u(e){return{width:e.offsetWidth,height:e.offsetHeight}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(501),o=a(i),r=n(502),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(){(0,o.default)(this,e),this.refs={}}return(0,s.default)(e,[{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";this.refs[t]||(this.refs[t]=[]),this.refs[t].push(e)}},{key:"remove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",n=this.getIndex(e,t);-1!==n&&this.refs[t].splice(n,1)}},{key:"isActive",value:function(){return this.active}},{key:"getActive",value:function(){var e=this,t="default";return this.refs[t].find((function(t){return t.sortableInfo.index==e.active.index}))}},{key:"getIndex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";return this.refs[t].indexOf(e)}},{key:"getOrderedRefs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return this.refs[e]}}]),e}();t.default=u},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var i=n(503),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default=function(){function e(e,t){for(var n=0;n0?n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.clickoutside("list"),expression:"clickoutside('list')"},{name:"mouseoutside",rawName:"v-mouseoutside",value:e.clickoutside("list"),expression:"clickoutside('list')"},{name:"show",rawName:"v-show",value:e.show,expression:"show"}],staticClass:"ui-contextmenu-list",style:e.getStyle,on:{click:function(e){e.stopPropagation()}}},e._l(e.data,(function(t,i){return n("div",{key:i,staticClass:"ui-contextmenu-item",on:{click:function(n){return e.choose(t,i)}}},[e._v(e._s(t))])})),0):e._e()])},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(513),o=a(i),r=n(516),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}t.default={Split:o.default,SplitItem:s.default}},function(e,t,n){var i=n(0)(n(514),n(515),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/split-com/split.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] split.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=u(i),r=n(133),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}t.default={props:{diretion:{type:String,default:"horizontal"}},data:function(){return{items:[],clientWidth:0,clientHeight:0,readyToAllocationWidth:0,readyToAllocationHeight:0,readyToAllocationItemLength:0,moveIndex:null,currentChange:null}},computed:{getClass:function(){return"ui-split-"+this.diretion},itemLength:function(){return this.items.length},fristItem:function(){var e=this;if(this.moveIndex){var t=this.items.filter((function(t){return t.index==e.moveIndex-1}))[0];return t}},secondItem:function(){var e=this;if(this.moveIndex){var t=this.items.filter((function(t){return t.index==e.moveIndex}))[0];return t}}},mounted:function(){window.addEventListener("mousemove",this.handleMouseMove),window.addEventListener("mouseup",this.handleMouseUp),s.default.bind(this.$el,this.resize)},beforeDestroy:function(){window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("mouseup",this.handleMouseUp),s.default.unbind(this.$el)},methods:{resize:function(){this.clientWidth=this.$el.clientWidth,this.clientHeight=this.$el.clientHeight,this.initItem()},initItem:function(){var e=this;this.clientWidth||this.clientHeight||(this.clientWidth=this.$el.clientWidth,this.clientHeight=this.$el.clientHeight),this.readyToAllocationItemLength=0,"horizontal"==this.diretion&&(this.readyToAllocationWidth=this.clientWidth,this.items.forEach((function(t){if(t.width){var n=t.width;o.isString(n)&&(n=Number(n)),n<1&&(n=e.clientWidth*n),t.currentWidth=n,e.readyToAllocationWidth-=t.currentWidth}else e.readyToAllocationItemLength+=1})),this.items.forEach((function(t){t.width||(t.currentWidth=e.readyToAllocationWidth/e.readyToAllocationItemLength)}))),"vertical"==this.diretion&&(this.readyToAllocationHeight=this.clientHeight,this.items.forEach((function(t){if(t.height){var n=t.height;o.isString(n)&&(n=Number(n)),n<1&&(n=e.clientHeight*n),t.currentHeight=n,e.readyToAllocationHeight-=t.currentHeight}else e.readyToAllocationItemLength+=1})),this.items.forEach((function(t){t.height||(t.currentHeight=e.readyToAllocationHeight/e.readyToAllocationItemLength)})))},addItem:function(e){this.items.push(e),this.items.length==this.$children.length&&this.initItem()},removeItem:function(e){var t=this.items.indexOf(e);-1!=t&&this.items.splice(t,1),this.initItem()},getLeft:function(e){var t=0;return this.items.forEach((function(n){n.indexthis.fristItem.maxSize?this.currentChange=this.fristItem.maxSize-this.fristItem[i]:this.secondItem.minSize&&rthis.secondItem.maxSize?this.currentChange=this.secondItem[i]-this.secondItem.maxSize:o<10?this.currentChange=10-this.fristItem[i]:r<10&&(this.currentChange=this.secondItem[i]-10),window.requestAnimationFrame((function(){t.currentChange&&(t.fristItem.currentChange=t.currentChange,t.secondItem.currentChange=-t.currentChange)}))}},handleMouseUp:function(e){var t=this;if(this.moveIndex){this.$emit("on-move-end",e),e.stopPropagation(),e.preventDefault();var n="";"horizontal"==this.diretion&&(n="currentWidth"),"vertical"==this.diretion&&(n="currentHeight"),window.requestAnimationFrame((function(){var e=t.fristItem[n]+t.currentChange,i=t.secondItem[n]-t.currentChange;t.fristItem[n]=e,t.fristItem.currentChange=0,t.secondItem[n]=i,t.secondItem.currentChange=0,t.moveIndex=null,t.startX=null,t.startY=null,t.currentX=null,t.currentY=null,t.currentChange=null}))}},getStdMouseEvent:function(e){return{positionX:e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,positionY:e.clientY+document.body.scrollTop+document.documentElement.scrollTop}}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-split",class:e.getClass},[e._t("default"),e._v(" "),e._l(e.itemLength,(function(t){return t>1?n("div",{key:t,staticClass:"ui-split-dash",style:e.getDashStyle(t),on:{mousedown:function(n){return n.stopPropagation(),e.handleMouseDown(t,n)}}}):e._e()}))],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(517),n(518),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/split-com/splitItem.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] splitItem.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i);function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}t.default={props:{min:{type:[Number,String],default:void 0},max:{type:[Number,String],default:void 0},width:{type:[Number,String],default:void 0},height:{type:[Number,String],default:void 0}},data:function(){return{index:null,parent:this.$parent,currentWidth:0,currentHeight:0,currentChange:0,isFullScreen:!1}},computed:{minSize:function(){var e=this.min;if(o.isString(e)&&(e=Number(e)),e<1){var t=this.parent.diretion;"horizontal"==t&&(e=this.parent.clientWidth*e),"vertical"==t&&(e=this.parent.clientHeight*e)}return e},maxSize:function(){var e=this.max;if(o.isString(e)&&(e=Number(e)),e<1){var t=this.parent.diretion;"horizontal"==t&&(e=this.parent.clientWidth*e),"vertical"==t&&(e=this.parent.clientHeight*e)}return e},cWidth:function(){return this.currentWidth+this.currentChange},cHeight:function(){return this.currentHeight+this.currentChange},left:function(){return this.parent.getLeft(this.index)},top:function(){return this.parent.getTop(this.index)},getStyle:function(){if(this.isFullScreen)return{position:"fixed",left:0,right:0,top:0,bottom:0,"z-index":2010};var e=this.parent.diretion;return"horizontal"==e?{left:this.left+"px",top:0,bottom:0,width:this.cWidth+"px"}:"vertical"==e?{top:this.top+"px",left:0,right:0,height:this.cHeight+"px"}:void 0}},watch:{height:function(){this.parent.initItem()},width:function(){this.parent.initItem()},cWidth:function(){this.$emit("on-change",{height:this.cHeight,width:this.cWidth})},cHeight:function(){this.$emit("on-change",{height:this.cHeight,width:this.cWidth})}},mounted:function(){this.index=this.parent.$children.indexOf(this)+1,this.parent.addItem(this)},beforeDestroy:function(){this.parent.removeItem(this)},methods:{fullScreen:function(){this.isFullScreen=!0},releaseFullScreen:function(){this.isFullScreen=!1}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-split-item",style:e.getStyle},[e._t("default")],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(520),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default=o.default},function(e,t,n){var i=n(0)(n(521),n(522),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/time-picker/timePicker.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] timePicker.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(120),o=v(i),r=n(121),s=v(r),a=n(122),u=v(a),l=n(29),c=v(l),h=n(19),d=v(h),f=n(5),p=v(f),g=n(12),m=v(g);function v(e){return e&&e.__esModule?e:{default:e}}t.default={name:"TimePicker",directives:{clickoutside:c.default},components:{TimeSelect:o.default,ReadonlyInput:s.default,PickerPopup:u.default},mixins:[p.default,m.default],props:{value:{type:String,default:""},placeholder:{type:String,default:""},icon:{type:String,default:"md-time"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},format:{type:String,default:"HH:mm:ss"},hourStep:{type:Number,default:1},minuteStep:{type:Number,default:1},secondStep:{type:Number,default:1},disabledHours:{type:Function,default:void 0},disabledMinutes:{type:Function,default:void 0},disabledSeconds:{type:Function,default:void 0}},data:function(){return{show:!1,times:this.value||""}},watch:{value:function(){this.times!==this.value&&(this.times=this.value)},times:function(){this.$emit("input",this.times),this.$emit("change",this.times),this.dispatch("FormItem","on-form-change",[this.times])}},methods:{outside:function(){this.show&&(this.show=!1,this.dispatch("FormItem","on-form-blur",[this.times]))},showPopup:function(){this.readonly||this.disabled||(this.show=!0)},keydown:function(e){this.show||e.keyCode!=d.default.SPACE&&e.keyCode!=d.default.ENTER&&e.keyCode!=d.default.MAC_ENTER&&e.keyCode!=d.default.TAB||this.showPopup()},selectBlur:function(){this.outside()},clear:function(){this.times=""}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.outside,expression:"outside"}],staticClass:"ui-time-picker"},[n("readonly-input",{attrs:{value:e.times,placeholder:e.placeholder||e.t("el.timepicker.placeholder"),icon:e.icon,disabled:e.disabled,readonly:e.readonly,clearable:e.clearable},on:{clear:e.clear,click:e.showPopup,keydown:e.keydown}}),e._v(" "),n("picker-popup",{attrs:{show:e.show}},[n("time-select",{attrs:{format:e.format,"hour-step":e.hourStep,"minute-step":e.minuteStep,"second-step":e.secondStep,"disabled-hours":e.disabledHours,"disabled-minutes":e.disabledMinutes,"disabled-seconds":e.disabledSeconds},on:{blur:e.selectBlur},model:{value:e.times,callback:function(t){e.times=t},expression:"times"}}),e._v(" "),e._t("addon")],2)],1)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CollapsePanel=void 0;var i=n(524);Object.defineProperty(t,"CollapsePanel",{enumerable:!0,get:function(){return s(i).default}});var o=n(530),r=s(o);function s(e){return e&&e.__esModule?e:{default:e}}t.default=r.default},function(e,t,n){var i=n(0)(n(525),n(529),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/collapse/collapsePanel.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] collapsePanel.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=u(i),r=n(526),s=u(r),a=n(1);function u(e){return e&&e.__esModule?e:{default:e}}t.default={name:"CollapsePanel",components:{Icon:o.default,OpenAnim:s.default},props:{disabled:{type:Boolean,default:!1},title:{type:String,default:""},name:{type:[String,Number],required:!0,default:null},forceRender:{type:Boolean,default:!1},showArrow:{type:Boolean,default:!0}},data:function(){return{collapse:(0,a.findComponentUpward)(this,"Collapse")}},computed:{leftArrow:function(){return this.showArrow&&"left"===this.collapse.iconPosition},rightArrow:function(){return this.showArrow&&"right"===this.collapse.iconPosition},active:function(){if(this.forceRender)return!0;var e=this.collapse.activeNames;return Array.isArray(e)?e.includes(this.name):this.collapse.value===this.name}},methods:{handlePanel:function(){if(!this.disabled){var e=!this.forceRender&&this.active;this.collapse.change(this.name,e)}}}}},function(e,t,n){var i=n(0)(n(527),n(528),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/collapse/openAnim.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] openAnim.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={methods:{beforeEnter:function(e){e.style.height=0,e.style.transition="height .15s ease-out"},enter:function(e){0!==e.scrollHeight?e.style.height=e.scrollHeight+"px":e.style.height=""},afterEnter:function(e){e.style.transition="",e.style.height=""},beforeLeave:function(e){e.style.height=e.scrollHeight+"px",e.style.overflow="hidden"},leave:function(e){0!==e.scrollHeight&&(e.style.transition="height .15s cubic-bezier(0.55, 0.055, 0.675, 0.19)",e.style.height=0)},afterLeave:function(e){e.style.transition="",e.style.height=""}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{on:{"before-enter":e.beforeEnter,enter:e.enter,"after-enter":e.afterEnter,"before-leave":e.beforeLeave,leave:e.leave,"after-leave":e.afterLeave}},[e._t("default")],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-collapse-panel"},[n("div",{staticClass:"ui-collapse-panel-title",class:{"left-icon":e.leftArrow,disabled:e.disabled},on:{click:e.handlePanel}},[e.leftArrow?n("Icon",{class:{active:e.active},attrs:{type:"ios-arrow-forward"}}):e._e(),e._v(" "),n("div",[e._t("title",[e._v("\n "+e._s(e.title)+"\n ")])],2),e._v(" "),e.rightArrow?n("Icon",{class:{active:e.active},attrs:{type:"ios-arrow-forward"}}):e._e()],1),e._v(" "),n("open-anim",[n("div",{directives:[{name:"show",rawName:"v-show",value:e.active||e.forceRender,expression:"active || forceRender"}],staticClass:"ui-collapse-panel-content",class:{"left-icon":e.leftArrow}},[e._t("default")],2)])],1)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){var i=n(0)(n(531),n(532),null,null,null);i.options.__file="/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/collapse/collapse.vue",i.esModule&&Object.keys(i.esModule).some((function(e){return"default"!==e&&"__"!==e.substr(0,2)}))&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] collapse.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(85),o=r(i);function r(e){return e&&e.__esModule?e:{default:e}}t.default={name:"Collapse",props:{value:{type:[String,Number,Array],default:null},bordered:{type:Boolean,default:!1},accordion:{type:Boolean,default:!1},iconPosition:{validator:function(e){return["left","right"].includes(e)},default:"right"}},data:function(){return{activeNames:null}},watch:{value:{handler:function(){(0,o.default)(this.value)!==(0,o.default)(this.activeNames)&&this.resetActiveNames()},immediate:!0}},methods:{resetActiveNames:function(){this.accordion&&Array.isArray(this.value)?(this.activeNames=this.value[0],this.noticeParent()):this.activeNames=this.value},change:function(e,t){this.accordion?this.activeNames=t?"":e:t?Array.isArray(this.activeNames)?this.activeNames=this.activeNames.filter((function(t){return t!==e})):this.activeNames="":Array.isArray(this.activeNames)?this.activeNames.push(e):this.activeNames?this.activeNames=[this.activeNames,e]:this.activeNames=[e],this.noticeParent()},noticeParent:function(){this.$emit("input",this.activeNames),this.$emit("change",this.activeNames)}}}},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-collapse",class:{bordered:e.bordered}},[e._t("default")],2)},staticRenderFns:[]},e.exports.render._withStripped=!0}])}))},"1a4d":function(e,t,n){var i=n("d1fd");i("matchAll")},"1bbb":function(e,t,n){var i,o,r=n("642b"),s=n("968f"),a=r.process,u=a&&a.versions,l=u&&u.v8;l?(i=l.split("."),o=i[0]+i[1]):s&&(i=s.match(/Edge\/(\d+)/),(!i||i[1]>=74)&&(i=s.match(/Chrome\/(\d+)/),i&&(o=i[1]))),e.exports=o&&+o},"1c11":function(e,t,n){"use strict";var i=n("b0d9"),o=n("4f4e"),r=n("a126"),s=n("6199"),a=n("6f48"),u=n("d607"),l=n("cd55"),c=n("56bb"),h=n("dc19"),d=n("a995"),f=n("1bbb"),p=d("isConcatSpreadable"),g=9007199254740991,m="Maximum allowed index exceeded",v=f>=51||!o((function(){var e=[];return e[p]=!1,e.concat()[0]!==e})),_=h("concat"),y=function(e){if(!s(e))return!1;var t=e[p];return void 0!==t?!!t:r(e)},b=!v||!_;i({target:"Array",proto:!0,forced:b},{concat:function(e){var t,n,i,o,r,s=a(this),h=c(s,0),d=0;for(t=-1,i=arguments.length;tg)throw TypeError(m);for(n=0;n=g)throw TypeError(m);l(h,d++,r)}return h.length=d,h}})},"1c1b":function(e,t,n){e.exports=n("cb0b")},"1c5c":function(e,t,n){var i=n("70d8");e.exports=i},"1cb6":function(e,t,n){n("5dd6");var i=n("36b9");e.exports=i("Array").splice},"1cc3":function(e,t,n){var i=n("a995"),o=n("6bb6"),r=i("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||s[r]===e)}},"1d2b":function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),i=0;i=0:h>d;d+=f)d in c&&(u=n(u,c[d],d,l));return u}};e.exports={left:a(!1),right:a(!0)}},"224f":function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}}},2444:function(e,t,n){"use strict";(function(t){var i=n("c532"),o=n("c8af"),r={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function a(){var e;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof t)&&(e=n("b50d")),e}var u={adapter:a(),transformRequest:[function(e,t){return o(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)?(s(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"===typeof e)try{e=JSON.parse(e)}catch(t){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),i.forEach(["post","put","patch"],(function(e){u.headers[e]=i.merge(r)})),e.exports=u}).call(this,n("d701"))},"27e6":function(e,t,n){},"295b":function(e,t,n){var i=n("642b"),o=n("7bd7"),r="__core-js_shared__",s=i[r]||o(r,{});e.exports=s},"2a04":function(e,t,n){},"2ab7":function(e,t,n){},"2afd":function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},"2b1b":function(e,t,n){var i=n("161f"),o=n("6f48"),r=n("9b42"),s=n("bea7"),a=r("IE_PROTO"),u=Object.prototype;e.exports=s?Object.getPrototypeOf:function(e){return e=o(e),i(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?u:null}},"2b3d":function(e,t,n){var i=n("fa76");e.exports=i},"2cd9":function(e,t,n){var i=n("a4e7"),o=Array.prototype;e.exports=function(e){var t=e.every;return e===o||e instanceof Array&&t===o.every?i:t}},"2d14":function(e,t,n){var i=n("fe9f"),o=n("0217"),r=n("ee30"),s=n("8726").f,a=function(e){return function(t){var n,a=r(t),u=o(a),l=u.length,c=0,h=[];while(l>c)n=u[c++],i&&!s.call(a,n)||h.push(e?[n,a[n]]:a[n]);return h}};e.exports={entries:a(!0),values:a(!1)}},"2d81":function(e,t,n){var i=n("9ff8"),o=n("9d77"),r=Array.prototype,s=String.prototype;e.exports=function(e){var t=e.includes;return e===r||e instanceof Array&&t===r.includes?i:"string"===typeof e||e===s||e instanceof String&&t===s.includes?o:t}},"2d83":function(e,t,n){"use strict";var i=n("387f");e.exports=function(e,t,n,o,r){var s=new Error(e);return i(s,t,n,o,r)}},"2e4c":function(e,t,n){var i=n("d1fd");i("iterator")},"2e67":function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},"2ef0":function(e,t,n){(function(e,i){var o; -/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(){var r,s="4.17.20",a=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",c="__lodash_hash_undefined__",h=500,d="__lodash_placeholder__",f=1,p=2,g=4,m=1,v=2,_=1,y=2,b=4,w=8,C=16,S=32,x=64,L=128,k=256,N=512,E=30,O="...",D=800,I=16,M=1,T=2,P=3,A=1/0,R=9007199254740991,F=17976931348623157e292,W=NaN,V=4294967295,B=V-1,H=V>>>1,j=[["ary",L],["bind",_],["bindKey",y],["curry",w],["curryRight",C],["flip",N],["partial",S],["partialRight",x],["rearg",k]],z="[object Arguments]",U="[object Array]",$="[object AsyncFunction]",K="[object Boolean]",q="[object Date]",G="[object DOMException]",Y="[object Error]",Z="[object Function]",X="[object GeneratorFunction]",J="[object Map]",Q="[object Number]",ee="[object Null]",te="[object Object]",ne="[object Promise]",ie="[object Proxy]",oe="[object RegExp]",re="[object Set]",se="[object String]",ae="[object Symbol]",ue="[object Undefined]",le="[object WeakMap]",ce="[object WeakSet]",he="[object ArrayBuffer]",de="[object DataView]",fe="[object Float32Array]",pe="[object Float64Array]",ge="[object Int8Array]",me="[object Int16Array]",ve="[object Int32Array]",_e="[object Uint8Array]",ye="[object Uint8ClampedArray]",be="[object Uint16Array]",we="[object Uint32Array]",Ce=/\b__p \+= '';/g,Se=/\b(__p \+=) '' \+/g,xe=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Le=/&(?:amp|lt|gt|quot|#39);/g,ke=/[&<>"']/g,Ne=RegExp(Le.source),Ee=RegExp(ke.source),Oe=/<%-([\s\S]+?)%>/g,De=/<%([\s\S]+?)%>/g,Ie=/<%=([\s\S]+?)%>/g,Me=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Te=/^\w*$/,Pe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ae=/[\\^$.*+?()[\]{}|]/g,Re=RegExp(Ae.source),Fe=/^\s+|\s+$/g,We=/^\s+/,Ve=/\s+$/,Be=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,He=/\{\n\/\* \[wrapped with (.+)\] \*/,je=/,? & /,ze=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ue=/\\(\\)?/g,$e=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ke=/\w*$/,qe=/^[-+]0x[0-9a-f]+$/i,Ge=/^0b[01]+$/i,Ye=/^\[object .+?Constructor\]$/,Ze=/^0o[0-7]+$/i,Xe=/^(?:0|[1-9]\d*)$/,Je=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qe=/($^)/,et=/['\n\r\u2028\u2029\\]/g,tt="\\ud800-\\udfff",nt="\\u0300-\\u036f",it="\\ufe20-\\ufe2f",ot="\\u20d0-\\u20ff",rt=nt+it+ot,st="\\u2700-\\u27bf",at="a-z\\xdf-\\xf6\\xf8-\\xff",ut="\\xac\\xb1\\xd7\\xf7",lt="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ct="\\u2000-\\u206f",ht=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",dt="A-Z\\xc0-\\xd6\\xd8-\\xde",ft="\\ufe0e\\ufe0f",pt=ut+lt+ct+ht,gt="['’]",mt="["+tt+"]",vt="["+pt+"]",_t="["+rt+"]",yt="\\d+",bt="["+st+"]",wt="["+at+"]",Ct="[^"+tt+pt+yt+st+at+dt+"]",St="\\ud83c[\\udffb-\\udfff]",xt="(?:"+_t+"|"+St+")",Lt="[^"+tt+"]",kt="(?:\\ud83c[\\udde6-\\uddff]){2}",Nt="[\\ud800-\\udbff][\\udc00-\\udfff]",Et="["+dt+"]",Ot="\\u200d",Dt="(?:"+wt+"|"+Ct+")",It="(?:"+Et+"|"+Ct+")",Mt="(?:"+gt+"(?:d|ll|m|re|s|t|ve))?",Tt="(?:"+gt+"(?:D|LL|M|RE|S|T|VE))?",Pt=xt+"?",At="["+ft+"]?",Rt="(?:"+Ot+"(?:"+[Lt,kt,Nt].join("|")+")"+At+Pt+")*",Ft="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Wt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vt=At+Pt+Rt,Bt="(?:"+[bt,kt,Nt].join("|")+")"+Vt,Ht="(?:"+[Lt+_t+"?",_t,kt,Nt,mt].join("|")+")",jt=RegExp(gt,"g"),zt=RegExp(_t,"g"),Ut=RegExp(St+"(?="+St+")|"+Ht+Vt,"g"),$t=RegExp([Et+"?"+wt+"+"+Mt+"(?="+[vt,Et,"$"].join("|")+")",It+"+"+Tt+"(?="+[vt,Et+Dt,"$"].join("|")+")",Et+"?"+Dt+"+"+Mt,Et+"+"+Tt,Wt,Ft,yt,Bt].join("|"),"g"),Kt=RegExp("["+Ot+tt+rt+ft+"]"),qt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Yt=-1,Zt={};Zt[fe]=Zt[pe]=Zt[ge]=Zt[me]=Zt[ve]=Zt[_e]=Zt[ye]=Zt[be]=Zt[we]=!0,Zt[z]=Zt[U]=Zt[he]=Zt[K]=Zt[de]=Zt[q]=Zt[Y]=Zt[Z]=Zt[J]=Zt[Q]=Zt[te]=Zt[oe]=Zt[re]=Zt[se]=Zt[le]=!1;var Xt={};Xt[z]=Xt[U]=Xt[he]=Xt[de]=Xt[K]=Xt[q]=Xt[fe]=Xt[pe]=Xt[ge]=Xt[me]=Xt[ve]=Xt[J]=Xt[Q]=Xt[te]=Xt[oe]=Xt[re]=Xt[se]=Xt[ae]=Xt[_e]=Xt[ye]=Xt[be]=Xt[we]=!0,Xt[Y]=Xt[Z]=Xt[le]=!1;var Jt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},Qt={"&":"&","<":"<",">":">",'"':""","'":"'"},en={"&":"&","<":"<",">":">",""":'"',"'":"'"},tn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},nn=parseFloat,on=parseInt,rn="object"==typeof e&&e&&e.Object===Object&&e,sn="object"==typeof self&&self&&self.Object===Object&&self,an=rn||sn||Function("return this")(),un=t&&!t.nodeType&&t,ln=un&&"object"==typeof i&&i&&!i.nodeType&&i,cn=ln&&ln.exports===un,hn=cn&&rn.process,dn=function(){try{var e=ln&&ln.require&&ln.require("util").types;return e||hn&&hn.binding&&hn.binding("util")}catch(t){}}(),fn=dn&&dn.isArrayBuffer,pn=dn&&dn.isDate,gn=dn&&dn.isMap,mn=dn&&dn.isRegExp,vn=dn&&dn.isSet,_n=dn&&dn.isTypedArray;function yn(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function bn(e,t,n,i){var o=-1,r=null==e?0:e.length;while(++o-1}function kn(e,t,n){var i=-1,o=null==e?0:e.length;while(++i-1);return n}function Jn(e,t){var n=e.length;while(n--&&Fn(t,e[n],0)>-1);return n}function Qn(e,t){var n=e.length,i=0;while(n--)e[n]===t&&++i;return i}var ei=jn(Jt),ti=jn(Qt);function ni(e){return"\\"+tn[e]}function ii(e,t){return null==e?r:e[t]}function oi(e){return Kt.test(e)}function ri(e){return qt.test(e)}function si(e){var t,n=[];while(!(t=e.next()).done)n.push(t.value);return n}function ai(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function ui(e,t){return function(n){return e(t(n))}}function li(e,t){var n=-1,i=e.length,o=0,r=[];while(++n-1}function Bi(e,t){var n=this.__data__,i=uo(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function Hi(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t=t?e:t)),e}function mo(e,t,n,i,o,s){var a,u=t&f,l=t&p,c=t&g;if(n&&(a=o?n(e,i,o,s):n(e)),a!==r)return a;if(!Cc(e))return e;var h=sc(e);if(h){if(a=Qs(e),!u)return ns(e,a)}else{var d=Ys(e),m=d==Z||d==X;if(hc(e))return Kr(e,u);if(d==te||d==z||m&&!o){if(a=l||m?{}:ea(e),!u)return l?rs(e,ho(a,e)):os(e,co(a,e))}else{if(!Xt[d])return o?e:{};a=ta(e,d,u)}}s||(s=new Zi);var v=s.get(e);if(v)return v;s.set(e,a),Ac(e)?e.forEach((function(i){a.add(mo(i,t,n,i,e,s))})):xc(e)&&e.forEach((function(i,o){a.set(o,mo(i,t,n,o,e,s))}));var _=c?l?Ws:Fs:l?wh:bh,y=h?r:_(e);return wn(y||e,(function(i,o){y&&(o=i,i=e[o]),ao(a,o,mo(i,t,n,o,e,s))})),a}function vo(e){var t=bh(e);return function(n){return _o(n,e,t)}}function _o(e,t,n){var i=n.length;if(null==e)return!i;e=nt(e);while(i--){var o=n[i],s=t[o],a=e[o];if(a===r&&!(o in e)||!s(a))return!1}return!0}function yo(e,t,n){if("function"!=typeof e)throw new rt(l);return Sa((function(){e.apply(r,n)}),t)}function bo(e,t,n,i){var o=-1,r=Ln,s=!0,u=e.length,l=[],c=t.length;if(!u)return l;n&&(t=Nn(t,Gn(n))),i?(r=kn,s=!1):t.length>=a&&(r=Zn,s=!1,t=new qi(t));e:while(++oo?0:o+n),i=i===r||i>o?o:Kc(i),i<0&&(i+=o),i=n>i?0:qc(i);while(n0&&n(a)?t>1?No(a,t-1,n,i,o):En(o,a):i||(o[o.length]=a)}return o}var Eo=ls(),Oo=ls(!0);function Do(e,t){return e&&Eo(e,t,bh)}function Io(e,t){return e&&Oo(e,t,bh)}function Mo(e,t){return xn(t,(function(t){return yc(e[t])}))}function To(e,t){t=jr(t,e);var n=0,i=t.length;while(null!=e&&nt}function Fo(e,t){return null!=e&&ht.call(e,t)}function Wo(e,t){return null!=e&&t in nt(e)}function Vo(e,t,n){return e>=Ht(t,n)&&e=120&&d.length>=120)?new qi(u&&d):r}d=e[0];var f=-1,p=l[0];e:while(++f-1)a!==e&&Lt.call(a,u,1),Lt.call(e,u,1)}return e}function gr(e,t){var n=e?t.length:0,i=n-1;while(n--){var o=t[n];if(n==i||o!==r){var r=o;oa(o)?Lt.call(e,o,1):Pr(e,o)}}return e}function mr(e,t){return e+Pt(Kt()*(t-e+1))}function vr(e,t,i,o){var r=-1,s=Bt(Tt((t-e)/(i||1)),0),a=n(s);while(s--)a[o?s:++r]=e,e+=i;return a}function _r(e,t){var n="";if(!e||t<1||t>R)return n;do{t%2&&(n+=e),t=Pt(t/2),t&&(e+=e)}while(t);return n}function yr(e,t){return xa(_a(e,t,Ed),e+"")}function br(e){return io(Vh(e))}function wr(e,t){var n=Vh(e);return Na(n,go(t,0,n.length))}function Cr(e,t,n,i){if(!Cc(e))return e;t=jr(t,e);var o=-1,s=t.length,a=s-1,u=e;while(null!=u&&++or?0:r+t),i=i>r?r:i,i<0&&(i+=r),r=t>i?0:i-t>>>0,t>>>=0;var s=n(r);while(++o>>1,s=e[r];null!==s&&!Fc(s)&&(n?s<=t:s=a){var c=t?null:Ns(e);if(c)return ci(c);s=!1,o=Zn,l=new qi}else l=t?[]:u;e:while(++i=i?e:kr(e,t,n)}var $r=Dt||function(e){return an.clearTimeout(e)};function Kr(e,t){if(t)return e.slice();var n=e.length,i=wt?wt(n):new e.constructor(n);return e.copy(i),i}function qr(e){var t=new e.constructor(e.byteLength);return new bt(t).set(new bt(e)),t}function Gr(e,t){var n=t?qr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Yr(e){var t=new e.constructor(e.source,Ke.exec(e));return t.lastIndex=e.lastIndex,t}function Zr(e){return vi?nt(vi.call(e)):{}}function Xr(e,t){var n=t?qr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Jr(e,t){if(e!==t){var n=e!==r,i=null===e,o=e===e,s=Fc(e),a=t!==r,u=null===t,l=t===t,c=Fc(t);if(!u&&!c&&!s&&e>t||s&&a&&l&&!u&&!c||i&&a&&l||!n&&l||!o)return 1;if(!i&&!s&&!c&&e=a)return u;var l=n[i];return u*("desc"==l?-1:1)}}return e.index-t.index}function es(e,t,i,o){var r=-1,s=e.length,a=i.length,u=-1,l=t.length,c=Bt(s-a,0),h=n(l+c),d=!o;while(++u1?n[o-1]:r,a=o>2?n[2]:r;s=e.length>3&&"function"==typeof s?(o--,s):r,a&&ra(n[0],n[1],a)&&(s=o<3?r:s,o=1),t=nt(t);while(++i-1?o[s?t[a]:a]:r}}function ms(e){return Rs((function(t){var n=t.length,i=n,o=xi.prototype.thru;e&&t.reverse();while(i--){var s=t[i];if("function"!=typeof s)throw new rt(l);if(o&&!a&&"wrapper"==Bs(s))var a=new xi([],!0)}i=a?i:n;while(++i1&&_.reverse(),d&&cu))return!1;var c=s.get(e),h=s.get(t);if(c&&h)return c==t&&h==e;var d=-1,f=!0,p=n&v?new qi:r;s.set(e,t),s.set(t,e);while(++d1?"& ":"")+t[i],t=t.join(n>2?", ":" "),e.replace(Be,"{\n/* [wrapped with "+t+"] */\n")}function ia(e){return sc(e)||rc(e)||!!(kt&&e&&e[kt])}function oa(e,t){var n=typeof e;return t=null==t?R:t,!!t&&("number"==n||"symbol"!=n&&Xe.test(e))&&e>-1&&e%1==0&&e0){if(++t>=D)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Na(e,t){var n=-1,i=e.length,o=i-1;t=t===r?i:t;while(++n1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,Pu(e,n)}));function zu(e){var t=bi(e);return t.__chain__=!0,t}function Uu(e,t){return t(e),e}function $u(e,t){return t(e)}var Ku=Rs((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return po(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Li&&oa(n)?(i=i.slice(n,+n+(t?1:0)),i.__actions__.push({func:$u,args:[o],thisArg:r}),new xi(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)}));function qu(){return zu(this)}function Gu(){return new xi(this.value(),this.__chain__)}function Yu(){this.__values__===r&&(this.__values__=Uc(this.value()));var e=this.__index__>=this.__values__.length,t=e?r:this.__values__[this.__index__++];return{done:e,value:t}}function Zu(){return this}function Xu(e){var t,n=this;while(n instanceof Si){var i=Ma(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t}function Ju(){var e=this.__wrapped__;if(e instanceof Li){var t=e;return this.__actions__.length&&(t=new Li(this)),t=t.reverse(),t.__actions__.push({func:$u,args:[du],thisArg:r}),new xi(t,this.__chain__)}return this.thru(du)}function Qu(){return Fr(this.__wrapped__,this.__actions__)}var el=ss((function(e,t,n){ht.call(e,n)?++e[n]:fo(e,n,1)}));function tl(e,t,n){var i=sc(e)?Sn:So;return n&&ra(e,t,n)&&(t=r),i(e,js(t,3))}function nl(e,t){var n=sc(e)?xn:ko;return n(e,js(t,3))}var il=gs(Ua),ol=gs($a);function rl(e,t){return No(pl(e,t),1)}function sl(e,t){return No(pl(e,t),A)}function al(e,t,n){return n=n===r?1:Kc(n),No(pl(e,t),n)}function ul(e,t){var n=sc(e)?wn:wo;return n(e,js(t,3))}function ll(e,t){var n=sc(e)?Cn:Co;return n(e,js(t,3))}var cl=ss((function(e,t,n){ht.call(e,n)?e[n].push(t):fo(e,n,[t])}));function hl(e,t,n,i){e=uc(e)?e:Vh(e),n=n&&!i?Kc(n):0;var o=e.length;return n<0&&(n=Bt(o+n,0)),Rc(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Fn(e,t,n)>-1}var dl=yr((function(e,t,i){var o=-1,r="function"==typeof t,s=uc(e)?n(e.length):[];return wo(e,(function(e){s[++o]=r?yn(t,e,i):jo(e,t,i)})),s})),fl=ss((function(e,t,n){fo(e,n,t)}));function pl(e,t){var n=sc(e)?Nn:or;return n(e,js(t,3))}function gl(e,t,n,i){return null==e?[]:(sc(t)||(t=null==t?[]:[t]),n=i?r:n,sc(n)||(n=null==n?[]:[n]),cr(e,t,n))}var ml=ss((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));function vl(e,t,n){var i=sc(e)?On:zn,o=arguments.length<3;return i(e,js(t,4),n,o,wo)}function _l(e,t,n){var i=sc(e)?Dn:zn,o=arguments.length<3;return i(e,js(t,4),n,o,Co)}function yl(e,t){var n=sc(e)?xn:ko;return n(e,Vl(js(t,3)))}function bl(e){var t=sc(e)?io:br;return t(e)}function wl(e,t,n){t=(n?ra(e,t,n):t===r)?1:Kc(t);var i=sc(e)?oo:wr;return i(e,t)}function Cl(e){var t=sc(e)?ro:Lr;return t(e)}function Sl(e){if(null==e)return 0;if(uc(e))return Rc(e)?pi(e):e.length;var t=Ys(e);return t==J||t==re?e.size:tr(e).length}function xl(e,t,n){var i=sc(e)?In:Nr;return n&&ra(e,t,n)&&(t=r),i(e,js(t,3))}var Ll=yr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ra(e,t[0],t[1])?t=[]:n>2&&ra(t[0],t[1],t[2])&&(t=[t[0]]),cr(e,No(t,1),[])})),kl=It||function(){return an.Date.now()};function Nl(e,t){if("function"!=typeof t)throw new rt(l);return e=Kc(e),function(){if(--e<1)return t.apply(this,arguments)}}function El(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Os(e,L,r,r,r,r,t)}function Ol(e,t){var n;if("function"!=typeof t)throw new rt(l);return e=Kc(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=r),n}}var Dl=yr((function(e,t,n){var i=_;if(n.length){var o=li(n,Hs(Dl));i|=S}return Os(e,i,t,n,o)})),Il=yr((function(e,t,n){var i=_|y;if(n.length){var o=li(n,Hs(Il));i|=S}return Os(t,i,e,n,o)}));function Ml(e,t,n){t=n?r:t;var i=Os(e,w,r,r,r,r,r,t);return i.placeholder=Ml.placeholder,i}function Tl(e,t,n){t=n?r:t;var i=Os(e,C,r,r,r,r,r,t);return i.placeholder=Tl.placeholder,i}function Pl(e,t,n){var i,o,s,a,u,c,h=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw new rt(l);function g(t){var n=i,s=o;return i=o=r,h=t,a=e.apply(s,n),a}function m(e){return h=e,u=Sa(y,t),d?g(e):a}function v(e){var n=e-c,i=e-h,o=t-n;return f?Ht(o,s-i):o}function _(e){var n=e-c,i=e-h;return c===r||n>=t||n<0||f&&i>=s}function y(){var e=kl();if(_(e))return b(e);u=Sa(y,v(e))}function b(e){return u=r,p&&i?g(e):(i=o=r,a)}function w(){u!==r&&$r(u),h=0,i=c=o=u=r}function C(){return u===r?a:b(kl())}function S(){var e=kl(),n=_(e);if(i=arguments,o=this,c=e,n){if(u===r)return m(c);if(f)return $r(u),u=Sa(y,t),g(c)}return u===r&&(u=Sa(y,t)),a}return t=Gc(t)||0,Cc(n)&&(d=!!n.leading,f="maxWait"in n,s=f?Bt(Gc(n.maxWait)||0,t):s,p="trailing"in n?!!n.trailing:p),S.cancel=w,S.flush=C,S}var Al=yr((function(e,t){return yo(e,1,t)})),Rl=yr((function(e,t,n){return yo(e,Gc(t)||0,n)}));function Fl(e){return Os(e,N)}function Wl(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new rt(l);var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],r=n.cache;if(r.has(o))return r.get(o);var s=e.apply(this,i);return n.cache=r.set(o,s)||r,s};return n.cache=new(Wl.Cache||Hi),n}function Vl(e){if("function"!=typeof e)throw new rt(l);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Bl(e){return Ol(2,e)}Wl.Cache=Hi;var Hl=zr((function(e,t){t=1==t.length&&sc(t[0])?Nn(t[0],Gn(js())):Nn(No(t,1),Gn(js()));var n=t.length;return yr((function(i){var o=-1,r=Ht(i.length,n);while(++o=t})),rc=zo(function(){return arguments}())?zo:function(e){return Sc(e)&&ht.call(e,"callee")&&!xt.call(e,"callee")},sc=n.isArray,ac=fn?Gn(fn):Uo;function uc(e){return null!=e&&wc(e.length)&&!yc(e)}function lc(e){return Sc(e)&&uc(e)}function cc(e){return!0===e||!1===e||Sc(e)&&Ao(e)==K}var hc=Rt||Kd,dc=pn?Gn(pn):$o;function fc(e){return Sc(e)&&1===e.nodeType&&!Mc(e)}function pc(e){if(null==e)return!0;if(uc(e)&&(sc(e)||"string"==typeof e||"function"==typeof e.splice||hc(e)||Wc(e)||rc(e)))return!e.length;var t=Ys(e);if(t==J||t==re)return!e.size;if(ha(e))return!tr(e).length;for(var n in e)if(ht.call(e,n))return!1;return!0}function gc(e,t){return Ko(e,t)}function mc(e,t,n){n="function"==typeof n?n:r;var i=n?n(e,t):r;return i===r?Ko(e,t,r,n):!!i}function vc(e){if(!Sc(e))return!1;var t=Ao(e);return t==Y||t==G||"string"==typeof e.message&&"string"==typeof e.name&&!Mc(e)}function _c(e){return"number"==typeof e&&Ft(e)}function yc(e){if(!Cc(e))return!1;var t=Ao(e);return t==Z||t==X||t==$||t==ie}function bc(e){return"number"==typeof e&&e==Kc(e)}function wc(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=R}function Cc(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Sc(e){return null!=e&&"object"==typeof e}var xc=gn?Gn(gn):Go;function Lc(e,t){return e===t||Yo(e,t,Us(t))}function kc(e,t,n){return n="function"==typeof n?n:r,Yo(e,t,Us(t),n)}function Nc(e){return Ic(e)&&e!=+e}function Ec(e){if(ca(e))throw new o(u);return Zo(e)}function Oc(e){return null===e}function Dc(e){return null==e}function Ic(e){return"number"==typeof e||Sc(e)&&Ao(e)==Q}function Mc(e){if(!Sc(e)||Ao(e)!=te)return!1;var t=Ct(e);if(null===t)return!0;var n=ht.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ct.call(n)==gt}var Tc=mn?Gn(mn):Xo;function Pc(e){return bc(e)&&e>=-R&&e<=R}var Ac=vn?Gn(vn):Jo;function Rc(e){return"string"==typeof e||!sc(e)&&Sc(e)&&Ao(e)==se}function Fc(e){return"symbol"==typeof e||Sc(e)&&Ao(e)==ae}var Wc=_n?Gn(_n):Qo;function Vc(e){return e===r}function Bc(e){return Sc(e)&&Ys(e)==le}function Hc(e){return Sc(e)&&Ao(e)==ce}var jc=xs(ir),zc=xs((function(e,t){return e<=t}));function Uc(e){if(!e)return[];if(uc(e))return Rc(e)?gi(e):ns(e);if(Nt&&e[Nt])return si(e[Nt]());var t=Ys(e),n=t==J?ai:t==re?ci:Vh;return n(e)}function $c(e){if(!e)return 0===e?e:0;if(e=Gc(e),e===A||e===-A){var t=e<0?-1:1;return t*F}return e===e?e:0}function Kc(e){var t=$c(e),n=t%1;return t===t?n?t-n:t:0}function qc(e){return e?go(Kc(e),0,V):0}function Gc(e){if("number"==typeof e)return e;if(Fc(e))return W;if(Cc(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Cc(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Fe,"");var n=Ge.test(e);return n||Ze.test(e)?on(e.slice(2),n?2:8):qe.test(e)?W:+e}function Yc(e){return is(e,wh(e))}function Zc(e){return e?go(Kc(e),-R,R):0===e?e:0}function Xc(e){return null==e?"":Mr(e)}var Jc=as((function(e,t){if(ha(t)||uc(t))is(t,bh(t),e);else for(var n in t)ht.call(t,n)&&ao(e,n,t[n])})),Qc=as((function(e,t){is(t,wh(t),e)})),eh=as((function(e,t,n,i){is(t,wh(t),e,i)})),th=as((function(e,t,n,i){is(t,bh(t),e,i)})),nh=Rs(po);function ih(e,t){var n=Ci(e);return null==t?n:co(n,t)}var oh=yr((function(e,t){e=nt(e);var n=-1,i=t.length,o=i>2?t[2]:r;o&&ra(t[0],t[1],o)&&(i=1);while(++n1),t})),is(e,Ws(e),n),i&&(n=mo(n,f|p|g,Ms));var o=t.length;while(o--)Pr(n,t[o]);return n}));function Nh(e,t){return Oh(e,Vl(js(t)))}var Eh=Rs((function(e,t){return null==e?{}:hr(e,t)}));function Oh(e,t){if(null==e)return{};var n=Nn(Ws(e),(function(e){return[e]}));return t=js(t),dr(e,n,(function(e,n){return t(e,n[0])}))}function Dh(e,t,n){t=jr(t,e);var i=-1,o=t.length;o||(o=1,e=r);while(++it){var i=e;e=t,t=i}if(n||e%1||t%1){var o=Kt();return Ht(e+o*(t-e+nn("1e-"+((o+"").length-1))),t)}return mr(e,t)}var Uh=ds((function(e,t,n){return t=t.toLowerCase(),e+(n?$h(t):t)}));function $h(e){return _d(Xc(e).toLowerCase())}function Kh(e){return e=Xc(e),e&&e.replace(Je,ei).replace(zt,"")}function qh(e,t,n){e=Xc(e),t=Mr(t);var i=e.length;n=n===r?i:go(Kc(n),0,i);var o=n;return n-=t.length,n>=0&&e.slice(n,o)==t}function Gh(e){return e=Xc(e),e&&Ee.test(e)?e.replace(ke,ti):e}function Yh(e){return e=Xc(e),e&&Re.test(e)?e.replace(Ae,"\\$&"):e}var Zh=ds((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Xh=ds((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Jh=hs("toLowerCase");function Qh(e,t,n){e=Xc(e),t=Kc(t);var i=t?pi(e):0;if(!t||i>=t)return e;var o=(t-i)/2;return ws(Pt(o),n)+e+ws(Tt(o),n)}function ed(e,t,n){e=Xc(e),t=Kc(t);var i=t?pi(e):0;return t&&i>>0,n?(e=Xc(e),e&&("string"==typeof t||null!=t&&!Tc(t))&&(t=Mr(t),!t&&oi(e))?Ur(gi(e),0,n):e.split(t,n)):[]}var ad=ds((function(e,t,n){return e+(n?" ":"")+_d(t)}));function ud(e,t,n){return e=Xc(e),n=null==n?0:go(Kc(n),0,e.length),t=Mr(t),e.slice(n,n+t.length)==t}function ld(e,t,n){var i=bi.templateSettings;n&&ra(e,t,n)&&(t=r),e=Xc(e),t=eh({},t,i,Ds);var o,s,a=eh({},t.imports,i.imports,Ds),u=bh(a),l=Yn(a,u),c=0,h=t.interpolate||Qe,d="__p += '",f=it((t.escape||Qe).source+"|"+h.source+"|"+(h===Ie?$e:Qe).source+"|"+(t.evaluate||Qe).source+"|$","g"),p="//# sourceURL="+(ht.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Yt+"]")+"\n";e.replace(f,(function(t,n,i,r,a,u){return i||(i=r),d+=e.slice(c,u).replace(et,ni),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),a&&(s=!0,d+="';\n"+a+";\n__p += '"),i&&(d+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),c=u+t.length,t})),d+="';\n";var g=ht.call(t,"variable")&&t.variable;g||(d="with (obj) {\n"+d+"\n}\n"),d=(s?d.replace(Ce,""):d).replace(Se,"$1").replace(xe,"$1;"),d="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=bd((function(){return ze(u,p+"return "+d).apply(r,l)}));if(m.source=d,vc(m))throw m;return m}function cd(e){return Xc(e).toLowerCase()}function hd(e){return Xc(e).toUpperCase()}function dd(e,t,n){if(e=Xc(e),e&&(n||t===r))return e.replace(Fe,"");if(!e||!(t=Mr(t)))return e;var i=gi(e),o=gi(t),s=Xn(i,o),a=Jn(i,o)+1;return Ur(i,s,a).join("")}function fd(e,t,n){if(e=Xc(e),e&&(n||t===r))return e.replace(Ve,"");if(!e||!(t=Mr(t)))return e;var i=gi(e),o=Jn(i,gi(t))+1;return Ur(i,0,o).join("")}function pd(e,t,n){if(e=Xc(e),e&&(n||t===r))return e.replace(We,"");if(!e||!(t=Mr(t)))return e;var i=gi(e),o=Xn(i,gi(t));return Ur(i,o).join("")}function gd(e,t){var n=E,i=O;if(Cc(t)){var o="separator"in t?t.separator:o;n="length"in t?Kc(t.length):n,i="omission"in t?Mr(t.omission):i}e=Xc(e);var s=e.length;if(oi(e)){var a=gi(e);s=a.length}if(n>=s)return e;var u=n-pi(i);if(u<1)return i;var l=a?Ur(a,0,u).join(""):e.slice(0,u);if(o===r)return l+i;if(a&&(u+=l.length-u),Tc(o)){if(e.slice(u).search(o)){var c,h=l;o.global||(o=it(o.source,Xc(Ke.exec(o))+"g")),o.lastIndex=0;while(c=o.exec(h))var d=c.index;l=l.slice(0,d===r?u:d)}}else if(e.indexOf(Mr(o),u)!=u){var f=l.lastIndexOf(o);f>-1&&(l=l.slice(0,f))}return l+i}function md(e){return e=Xc(e),e&&Ne.test(e)?e.replace(Le,mi):e}var vd=ds((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),_d=hs("toUpperCase");function yd(e,t,n){return e=Xc(e),t=n?r:t,t===r?ri(e)?yi(e):Pn(e):e.match(t)||[]}var bd=yr((function(e,t){try{return yn(e,r,t)}catch(n){return vc(n)?n:new o(n)}})),wd=Rs((function(e,t){return wn(t,(function(t){t=Oa(t),fo(e,t,Dl(e[t],e))})),e}));function Cd(e){var t=null==e?0:e.length,n=js();return e=t?Nn(e,(function(e){if("function"!=typeof e[1])throw new rt(l);return[n(e[0]),e[1]]})):[],yr((function(n){var i=-1;while(++iR)return[];var n=V,i=Ht(e,V);t=js(t),e-=V;var o=Kn(i,t);while(++n0||t<0)?new Li(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(t=Kc(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},Li.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Li.prototype.toArray=function(){return this.take(V)},Do(Li.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=bi[i?"take"+("last"==t?"Right":""):t],s=i||/^find/.test(t);o&&(bi.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,u=t instanceof Li,l=a[0],c=u||sc(t),h=function(e){var t=o.apply(bi,En([e],a));return i&&d?t[0]:t};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var d=this.__chain__,f=!!this.__actions__.length,p=s&&!d,g=u&&!f;if(!s&&c){t=g?t:new Li(this);var m=e.apply(t,a);return m.__actions__.push({func:$u,args:[h],thisArg:r}),new xi(m,d)}return p&&g?e.apply(this,a):(m=this.thru(h),p?i?m.value()[0]:m.value():m)})})),wn(["pop","push","shift","sort","splice","unshift"],(function(e){var t=st[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);bi.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var o=this.value();return t.apply(sc(o)?o:[],e)}return this[n]((function(n){return t.apply(sc(n)?n:[],e)}))}})),Do(Li.prototype,(function(e,t){var n=bi[t];if(n){var i=n.name+"";ht.call(ln,i)||(ln[i]=[]),ln[i].push({name:t,func:n})}})),ln[vs(r,y).name]=[{name:"wrapper",func:r}],Li.prototype.clone=ki,Li.prototype.reverse=Ni,Li.prototype.value=Ei,bi.prototype.at=Ku,bi.prototype.chain=qu,bi.prototype.commit=Gu,bi.prototype.next=Yu,bi.prototype.plant=Xu,bi.prototype.reverse=Ju,bi.prototype.toJSON=bi.prototype.valueOf=bi.prototype.value=Qu,bi.prototype.first=bi.prototype.head,Nt&&(bi.prototype[Nt]=Zu),bi},wi=bi();an._=wi,o=function(){return wi}.call(t,n,t,i),o===r||(i.exports=o)}).call(this)}).call(this,n("47fd"),n("8686")(e))},"30b5":function(e,t,n){"use strict";var i=n("c532");function o(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(i.isURLSearchParams(t))r=t.toString();else{var s=[];i.forEach(t,(function(e,t){null!==e&&"undefined"!==typeof e&&(i.isArray(e)&&(t+="[]"),i.isArray(e)||(e=[e]),i.forEach(e,(function(e){i.isDate(e)?e=e.toISOString():i.isObject(e)&&(e=JSON.stringify(e)),s.push(o(t)+"="+o(e))})))})),r=s.join("&")}return r&&(e+=(-1===e.indexOf("?")?"?":"&")+r),e}},"30d5":function(e,t,n){},"30db":function(e,t,n){"use strict";(function(e,i){n.d(t,"g",(function(){return m})),n.d(t,"d",(function(){return v})),n.d(t,"c",(function(){return _})),n.d(t,"e",(function(){return y})),n.d(t,"f",(function(){return b})),n.d(t,"b",(function(){return C})),n.d(t,"h",(function(){return x})),n.d(t,"a",(function(){return L}));var o=!1,r=!1,s=!1,a=!1,u=!1,l=void 0,c="en",h="undefined"!==typeof e&&"undefined"!==typeof e.versions&&"undefined"!==typeof e.versions.electron&&"renderer"===e.type;if("object"!==typeof navigator||h){if("object"===typeof e){o="win32"===e.platform,r="darwin"===e.platform,s="linux"===e.platform,l=c,c;var d=Object({env:"prod",command:"build"})["VSCODE_NLS_CONFIG"];if(d)try{var f=JSON.parse(d),p=f.availableLanguages["*"];l=f.locale,p||c,f._translationsConfigFile}catch(k){}a=!0}}else{var g=navigator.userAgent;o=g.indexOf("Windows")>=0,r=g.indexOf("Macintosh")>=0,s=g.indexOf("Linux")>=0,u=!0,l=navigator.language,l}var m=o,v=r,_=s,y=a,b=u,w="object"===typeof self?self:"object"===typeof i?i:{},C=w,S=null;function x(t){return null===S&&(S=C.setImmediate?C.setImmediate.bind(C):"undefined"!==typeof e&&"function"===typeof e.nextTick?e.nextTick.bind(e):C.setTimeout.bind(C)),S(t)}var L=r?2:o?1:3}).call(this,n("d701"),n("47fd"))},"310e":function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var i=n("914a"),o=n.n(i);function r(e){if(o()(e))return e}var s=n("f8dc"),a=n.n(s),u=n("3b04"),l=n.n(u),c=n("53bf"),h=n.n(c);function d(e,t){if("undefined"!==typeof h.a&&l()(Object(e))){var n=[],i=!0,o=!1,r=void 0;try{for(var s,u=a()(e);!(i=(s=u.next()).done);i=!0)if(n.push(s.value),t&&n.length===t)break}catch(c){o=!0,r=c}finally{try{i||null==u["return"]||u["return"]()}finally{if(o)throw r}}return n}}var f=n("9c88"),p=n.n(f),g=n("56ed"),m=n.n(g);function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1?arguments[1]:void 0,t.length)),i=String(e);return c?c.call(t,i,n):t.slice(n,n+i.length)===i}})},3359:function(e,t,n){},3370:function(e,t,n){"use strict";var i=n("b0d9"),o=n("f948"),r=n("0277"),s=n("4f4e"),a=n("0d98"),u=n("611d"),l=n("4f78"),c=n("8339"),h=!!r&&s((function(){r.prototype["finally"].call({then:function(){}},(function(){}))}));i({target:"Promise",proto:!0,real:!0,forced:h},{finally:function(e){var t=u(this,a("Promise")),n="function"==typeof e;return this.then(n?function(n){return l(t,e()).then((function(){return n}))}:e,n?function(n){return l(t,e()).then((function(){throw n}))}:e)}}),o||"function"!=typeof r||r.prototype["finally"]||c(r.prototype,"finally",a("Promise").prototype["finally"])},"36b9":function(e,t,n){var i=n("16f8");e.exports=function(e){return i[e+"Prototype"]}},3733:function(e,t,n){n("acd6");var i=n("16f8");e.exports=i.Object.getOwnPropertyDescriptors},3793:function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},"37e6":function(e,t,n){var i=n("6894"),o=String.prototype;e.exports=function(e){var t=e.startsWith;return"string"===typeof e||e===o||e instanceof String&&t===o.startsWith?i:t}},"387f":function(e,t,n){"use strict";e.exports=function(e,t,n,i,o){return e.config=t,n&&(e.code=n),e.request=i,e.response=o,e}},"38a2":function(e,t,n){},3934:function(e,t,n){"use strict";var i=n("c532");e.exports=i.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var i=e;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=i.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return function(){return!0}}()},"3a19":function(e,t,n){},"3a37":function(e,t,n){n("b4ff");var i=n("36b9");e.exports=i("Array").indexOf},"3a6f":function(e,t,n){e.exports=n("05a6")},"3b04":function(e,t,n){e.exports=n("9e5b")},"3bef":function(e,t,n){var i=n("968f");e.exports=/web0s(?!.*chrome)/i.test(i)},"3d9b":function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},"3eca":function(e,t,n){var i=n("6199"),o=n("3793"),r=n("a995"),s=r("match");e.exports=function(e){var t;return i(e)&&(void 0!==(t=e[s])?!!t:"RegExp"==o(e))}},"3fec":function(e,t,n){n("f9e7")},4001:function(e,t,n){var i=n("d1fd");i("toStringTag")},"419c":function(e,t){e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},"41a0":function(e,t,n){},"42a0":function(e,t,n){n("f4d5");var i=n("3d9b"),o=n("642b"),r=n("062d"),s=n("503c"),a=n("6bb6"),u=n("a995"),l=u("toStringTag");for(var c in i){var h=o[c],d=h&&h.prototype;d&&r(d)!==l&&s(d,l,c),a[c]=a.Array}},"42f0":function(e,t,n){var i=n("062d"),o=n("6bb6"),r=n("a995"),s=r("iterator");e.exports=function(e){if(void 0!=e)return e[s]||e["@@iterator"]||o[i(e)]}},"42f03":function(e,t,n){},4341:function(e,t,n){"use strict";var i=n("b0d9"),o=n("ed3f").includes,r=n("7783"),s=n("6c2a"),a=s("indexOf",{ACCESSORS:!0,1:0});i({target:"Array",proto:!0,forced:!a},{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),r("includes")},4378:function(e,t){e.exports={}},"44c7":function(e,t,n){},"467f":function(e,t,n){"use strict";var i=n("2d83");e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(i("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},"47fd":function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(i){"object"===typeof window&&(n=window)}e.exports=n},4828:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("95fd"),o=n.n(i),r=n("53bf"),s=n.n(r);function a(e){return a="function"===typeof s.a&&"symbol"===typeof o.a?function(e){return typeof e}:function(e){return e&&"function"===typeof s.a&&e.constructor===s.a&&e!==s.a.prototype?"symbol":typeof e},a(e)}},"4acc":function(e,t,n){var i=n("b0d9"),o=n("a126");i({target:"Array",stat:!0},{isArray:o})},"4b9a":function(e,t,n){"use strict";var i=n("b0d9"),o=n("2afd"),r=n("1e11"),s=n("224f"),a=n("0a7c");i({target:"Promise",stat:!0},{allSettled:function(e){var t=this,n=r.f(t),i=n.resolve,u=n.reject,l=s((function(){var n=o(t.resolve),r=[],s=0,u=1;a(e,(function(e){var o=s++,a=!1;r.push(void 0),u++,n.call(t,e).then((function(e){a||(a=!0,r[o]={status:"fulfilled",value:e},--u||i(r))}),(function(e){a||(a=!0,r[o]={status:"rejected",reason:e},--u||i(r))}))})),--u||i(r)}));return l.error&&u(l.value),n.promise}})},"4c02":function(e,t,n){"use strict";var i=n("0d98"),o=n("cb29"),r=n("a995"),s=n("fe9f"),a=r("species");e.exports=function(e){var t=i(e),n=o.f;s&&t&&!t[a]&&n(t,a,{configurable:!0,get:function(){return this}})}},"4c58":function(e,t,n){"use strict";var i=n("ca9d").IteratorPrototype,o=n("bef9"),r=n("caad"),s=n("da56"),a=n("6bb6"),u=function(){return this};e.exports=function(e,t,n){var l=t+" Iterator";return e.prototype=o(i,{next:r(1,n)}),s(e,l,!1,!0),a[l]=u,e}},"4cdc":function(e,t,n){n("7c09");var i=n("16f8"),o=i.Object,r=e.exports=function(e,t){return o.getOwnPropertyDescriptor(e,t)};o.getOwnPropertyDescriptor.sham&&(r.sham=!0)},"4d3d":function(e,t,n){},"4daf":function(e,t,n){var i=n("b0d9"),o=n("1428");i({global:!0,forced:parseInt!=o},{parseInt:o})},"4e7d":function(e,t,n){},"4f4e":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"4f78":function(e,t,n){var i=n("545b"),o=n("6199"),r=n("1e11");e.exports=function(e,t){if(i(e),o(t)&&t.constructor===e)return t;var n=r.f(e),s=n.resolve;return s(t),n.promise}},"4fa3":function(e,t,n){var i=n("02b9");e.exports=i},"4fab":function(e,t,n){n("42a0");var i=n("8781"),o=n("062d"),r=Array.prototype,s={DOMTokenList:!0,NodeList:!0};e.exports=function(e){var t=e.forEach;return e===r||e instanceof Array&&t===r.forEach||s.hasOwnProperty(o(e))?i:t}},5029:function(e,t,n){},"503c":function(e,t,n){var i=n("fe9f"),o=n("cb29"),r=n("caad");e.exports=i?function(e,t,n){return o.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},"514a":function(e,t,n){var i=n("a995"),o=i("iterator"),r=!1;try{var s=0,a={next:function(){return{done:!!s++}},return:function(){r=!0}};a[o]=function(){return this},Array.from(a,(function(){throw 2}))}catch(u){}e.exports=function(e,t){if(!t&&!r)return!1;var n=!1;try{var i={};i[o]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(u){}return n}},5270:function(e,t,n){"use strict";var i=n("c532"),o=n("c401"),r=n("2e67"),s=n("2444");function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){a(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=i.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),i.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]}));var t=e.adapter||s.adapter;return t(e).then((function(t){return a(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return r(t)||(a(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},"52c8":function(e,t,n){},"53bf":function(e,t,n){e.exports=n("d6b2")},5411:function(e,t,n){var i=n("b0d9"),o=n("b911");i({target:"Array",proto:!0,forced:o!==[].lastIndexOf},{lastIndexOf:o})},"545b":function(e,t,n){var i=n("6199");e.exports=function(e){if(!i(e))throw TypeError(String(e)+" is not an object");return e}},"54c2":function(e,t,n){"use strict";(function(e,i){var o;n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return s})),function(){var t=Object.create(null);t["WinJS/Core/_WinJS"]={};var n=function(e,n,i){var o={},r=!1,s=n.map((function(e){return"exports"===e?(r=!0,o):t[e]})),a=i.apply({},s);t[e]=r?o:a};n("WinJS/Core/_Global",[],(function(){var t="undefined"!==typeof window?window:"undefined"!==typeof self?self:"undefined"!==typeof e?e:{};return t})),n("WinJS/Core/_BaseCoreUtils",["WinJS/Core/_Global"],(function(e){var t=!!e.Windows;function n(e){return e.supportedForProcessing=!0,e}var o=null;return{hasWinRT:t,markSupportedForProcessing:n,_setImmediate:function(t){null===o&&(o=e.setImmediate?e.setImmediate.bind(e):"undefined"!==typeof i&&"function"===typeof i.nextTick?i.nextTick.bind(i):e.setTimeout.bind(e)),o(t)}}})),n("WinJS/Core/_WriteProfilerMark",["WinJS/Core/_Global"],(function(e){return e.msWriteProfilerMark||function(){}})),n("WinJS/Core/_Base",["WinJS/Core/_WinJS","WinJS/Core/_Global","WinJS/Core/_BaseCoreUtils","WinJS/Core/_WriteProfilerMark"],(function(e,t,n,i){function o(e,t,n){var i,o,r,s=Object.keys(t),a=Array.isArray(e);for(o=0,r=s.length;o"),i}function a(e,n){return s(t,e,n)}n.Namespace||(n.Namespace=Object.create(Object.prototype));var u={uninitialized:1,working:2,initialized:3};function l(e){var t,n,o=u.uninitialized;return{setName:function(e){t=e},get:function(){switch(o){case u.initialized:return n;case u.uninitialized:o=u.working;try{i("WinJS.Namespace._lazy:"+t+",StartTM"),n=e()}finally{i("WinJS.Namespace._lazy:"+t+",StopTM"),o=u.uninitialized}return e=null,o=u.initialized,n;case u.working:throw"Illegal: reentrancy on initialization";default:throw"Illegal"}},set:function(e){switch(o){case u.working:throw"Illegal: reentrancy on initialization";default:o=u.initialized,n=e;break}},enumerable:!0,configurable:!0}}function c(e,n,i){var s=[e],a=null;return n&&(a=r(t,n),s.push(a)),o(s,i,n||""),a}Object.defineProperties(n.Namespace,{defineWithParent:{value:s,writable:!0,enumerable:!0,configurable:!0},define:{value:a,writable:!0,enumerable:!0,configurable:!0},_lazy:{value:l,writable:!0,enumerable:!0,configurable:!0},_moduleDefine:{value:c,writable:!0,enumerable:!0,configurable:!0}})}(),function(){function t(e,t,i){return e=e||function(){},n.markSupportedForProcessing(e),t&&o(e.prototype,t),i&&o(e,i),e}function i(e,i,r,s){if(e){i=i||function(){};var a=e.prototype;return i.prototype=Object.create(a),n.markSupportedForProcessing(i),Object.defineProperty(i.prototype,"constructor",{value:i,writable:!0,configurable:!0,enumerable:!0}),r&&o(i.prototype,r),s&&o(i,s),i}return t(i,r,s)}function r(e){var t,n;for(e=e||function(){},t=1,n=arguments.length;t-1}var d={name:"router-view",functional:!0,props:{name:{type:String,default:"default"}},render:function(e,t){var n=t.props,i=t.children,o=t.parent,r=t.data;r.routerView=!0;var s=o.$createElement,a=n.name,u=o.$route,l=o._routerViewCache||(o._routerViewCache={}),c=0,h=!1;while(o&&o._routerRoot!==o)o.$vnode&&o.$vnode.data.routerView&&c++,o._inactive&&(h=!0),o=o.$parent;if(r.routerViewDepth=c,h)return s(l[a],r,i);var d=u.matched[c];if(!d)return l[a]=null,s();var g=l[a]=d.components[a];r.registerRouteInstance=function(e,t){var n=d.instances[a];(t&&n!==e||!t&&n===e)&&(d.instances[a]=t)},(r.hook||(r.hook={})).prepatch=function(e,t){d.instances[a]=t.componentInstance};var m=r.props=f(u,d.props&&d.props[a]);if(m){m=r.props=p({},m);var v=r.attrs=r.attrs||{};for(var _ in m)g.props&&_ in g.props||(v[_]=m[_],delete m[_])}return s(g,r,i)}};function f(e,t){switch(typeof t){case"undefined":return;case"object":return t;case"function":return t(e);case"boolean":return t?e.params:void 0;default:0}}function p(e,t){for(var n in t)e[n]=t[n];return e}var g=/[!'()*]/g,m=function(e){return"%"+e.charCodeAt(0).toString(16)},v=/%2C/g,_=function(e){return encodeURIComponent(e).replace(g,m).replace(v,",")},y=decodeURIComponent;function b(e,t,n){void 0===t&&(t={});var i,o=n||w;try{i=o(e||"")}catch(s){i={}}for(var r in t)i[r]=t[r];return i}function w(e){var t={};return e=e.trim().replace(/^(\?|#|&)/,""),e?(e.split("&").forEach((function(e){var n=e.replace(/\+/g," ").split("="),i=y(n.shift()),o=n.length>0?y(n.join("=")):null;void 0===t[i]?t[i]=o:Array.isArray(t[i])?t[i].push(o):t[i]=[t[i],o]})),t):t}function C(e){var t=e?Object.keys(e).map((function(t){var n=e[t];if(void 0===n)return"";if(null===n)return _(t);if(Array.isArray(n)){var i=[];return n.forEach((function(e){void 0!==e&&(null===e?i.push(_(t)):i.push(_(t)+"="+_(e)))})),i.join("&")}return _(t)+"="+_(n)})).filter((function(e){return e.length>0})).join("&"):null;return t?"?"+t:""}var S=/\/?$/;function x(e,t,n,i){var o=i&&i.options.stringifyQuery,r=t.query||{};try{r=L(r)}catch(a){}var s={name:t.name||e&&e.name,meta:e&&e.meta||{},path:t.path||"/",hash:t.hash||"",query:r,params:t.params||{},fullPath:E(t,o),matched:e?N(e):[]};return n&&(s.redirectedFrom=E(n,o)),Object.freeze(s)}function L(e){if(Array.isArray(e))return e.map(L);if(e&&"object"===typeof e){var t={};for(var n in e)t[n]=L(e[n]);return t}return e}var k=x(null,{path:"/"});function N(e){var t=[];while(e)t.unshift(e),e=e.parent;return t}function E(e,t){var n=e.path,i=e.query;void 0===i&&(i={});var o=e.hash;void 0===o&&(o="");var r=t||C;return(n||"/")+r(i)+o}function O(e,t){return t===k?e===t:!!t&&(e.path&&t.path?e.path.replace(S,"")===t.path.replace(S,"")&&e.hash===t.hash&&D(e.query,t.query):!(!e.name||!t.name)&&(e.name===t.name&&e.hash===t.hash&&D(e.query,t.query)&&D(e.params,t.params)))}function D(e,t){if(void 0===e&&(e={}),void 0===t&&(t={}),!e||!t)return e===t;var n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&n.every((function(n){var i=e[n],o=t[n];return"object"===typeof i&&"object"===typeof o?D(i,o):String(i)===String(o)}))}function I(e,t){return 0===e.path.replace(S,"/").indexOf(t.path.replace(S,"/"))&&(!t.hash||e.hash===t.hash)&&M(e.query,t.query)}function M(e,t){for(var n in t)if(!(n in e))return!1;return!0}var T,P=[String,Object],A=[String,Array],R={name:"router-link",props:{to:{type:P,required:!0},tag:{type:String,default:"a"},exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,event:{type:A,default:"click"}},render:function(e){var t=this,n=this.$router,i=this.$route,o=n.resolve(this.to,i,this.append),r=o.location,s=o.route,a=o.href,u={},l=n.options.linkActiveClass,c=n.options.linkExactActiveClass,h=null==l?"router-link-active":l,d=null==c?"router-link-exact-active":c,f=null==this.activeClass?h:this.activeClass,p=null==this.exactActiveClass?d:this.exactActiveClass,g=r.path?x(null,r,null,n):s;u[p]=O(i,g),u[f]=this.exact?u[p]:I(i,g);var m=function(e){F(e)&&(t.replace?n.replace(r):n.push(r))},v={click:F};Array.isArray(this.event)?this.event.forEach((function(e){v[e]=m})):v[this.event]=m;var _={class:u};if("a"===this.tag)_.on=v,_.attrs={href:a};else{var y=W(this.$slots.default);if(y){y.isStatic=!1;var b=T.util.extend,w=y.data=b({},y.data);w.on=v;var C=y.data.attrs=b({},y.data.attrs);C.href=a}else _.on=v}return e(this.tag,_,this.$slots.default)}};function F(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(void 0===e.button||0===e.button)){if(e.currentTarget&&e.currentTarget.getAttribute){var t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function W(e){if(e)for(var t,n=0;n=0&&(t=e.slice(i),e=e.slice(0,i));var o=e.indexOf("?");return o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),{path:e,query:n,hash:t}}function z(e){return e.replace(/\/\//g,"/")}var U=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)},$=ce,K=X,q=J,G=te,Y=le,Z=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function X(e,t){var n,i=[],o=0,r=0,s="",a=t&&t.delimiter||"/";while(null!=(n=Z.exec(e))){var u=n[0],l=n[1],c=n.index;if(s+=e.slice(r,c),r=c+u.length,l)s+=l[1];else{var h=e[r],d=n[2],f=n[3],p=n[4],g=n[5],m=n[6],v=n[7];s&&(i.push(s),s="");var _=null!=d&&null!=h&&h!==d,y="+"===m||"*"===m,b="?"===m||"*"===m,w=n[2]||a,C=p||g;i.push({name:f||o++,prefix:d||"",delimiter:w,optional:b,repeat:y,partial:_,asterisk:!!v,pattern:C?ie(C):v?".*":"[^"+ne(w)+"]+?"})}}return r-1&&(a.params[d]=n.params[d]);if(l)return a.path=de(l.path,a.params,'named route "'+u+'"'),c(l,a,s)}else if(a.path){a.params={};for(var f=0;f=e.length?n():e[o]?t(e[o],(function(){i(o+1)})):i(o+1)};i(0)}function je(e){return function(t,n,i){var o=!1,r=0,s=null;ze(e,(function(e,t,n,a){if("function"===typeof e&&void 0===e.cid){o=!0,r++;var u,l=qe((function(t){Ke(t)&&(t=t.default),e.resolved="function"===typeof t?t:T.extend(t),n.components[a]=t,r--,r<=0&&i()})),c=qe((function(e){var t="Failed to resolve async component "+a+": "+e;s||(s=h(e)?e:new Error(t),i(s))}));try{u=e(l,c)}catch(f){c(f)}if(u)if("function"===typeof u.then)u.then(l,c);else{var d=u.component;d&&"function"===typeof d.then&&d.then(l,c)}}})),o||i()}}function ze(e,t){return Ue(e.map((function(e){return Object.keys(e.components).map((function(n){return t(e.components[n],e.instances[n],e,n)}))})))}function Ue(e){return Array.prototype.concat.apply([],e)}var $e="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag;function Ke(e){return e.__esModule||$e&&"Module"===e[Symbol.toStringTag]}function qe(e){var t=!1;return function(){var n=[],i=arguments.length;while(i--)n[i]=arguments[i];if(!t)return t=!0,e.apply(this,n)}}var Ge=function(e,t){this.router=e,this.base=Ye(t),this.current=k,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[]};function Ye(e){if(!e)if(B){var t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^https?:\/\/[^\/]+/,"")}else e="/";return"/"!==e.charAt(0)&&(e="/"+e),e.replace(/\/$/,"")}function Ze(e,t){var n,i=Math.max(e.length,t.length);for(n=0;n=0?t.slice(0,n):t;return i+"#"+e}function dt(e){Te?Ve(ht(e)):window.location.hash=e}function ft(e){Te?Be(ht(e)):window.location.replace(ht(e))}var pt=function(e){function t(t,n){e.call(this,t,n),this.stack=[],this.index=-1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.push=function(e,t,n){var i=this;this.transitionTo(e,(function(e){i.stack=i.stack.slice(0,i.index+1).concat(e),i.index++,t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var i=this;this.transitionTo(e,(function(e){i.stack=i.stack.slice(0,i.index).concat(e),t&&t(e)}),n)},t.prototype.go=function(e){var t=this,n=this.index+e;if(!(n<0||n>=this.stack.length)){var i=this.stack[n];this.confirmTransition(i,(function(){t.index=n,t.updateRoute(i)}))}},t.prototype.getCurrentLocation=function(){var e=this.stack[this.stack.length-1];return e?e.fullPath:"/"},t.prototype.ensureURL=function(){},t}(Ge),gt=function(e){void 0===e&&(e={}),this.app=null,this.apps=[],this.options=e,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=ye(e.routes||[],this);var t=e.mode||"hash";switch(this.fallback="history"===t&&!Te&&!1!==e.fallback,this.fallback&&(t="hash"),B||(t="abstract"),this.mode=t,t){case"history":this.history=new rt(this,e.base);break;case"hash":this.history=new at(this,e.base,this.fallback);break;case"abstract":this.history=new pt(this,e.base);break;default:0}},mt={currentRoute:{configurable:!0}};function vt(e,t){return e.push(t),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function _t(e,t,n){var i="hash"===n?"#"+t:t;return e?z(e+"/"+i):i}gt.prototype.match=function(e,t,n){return this.matcher.match(e,t,n)},mt.currentRoute.get=function(){return this.history&&this.history.current},gt.prototype.init=function(e){var t=this;if(this.apps.push(e),!this.app){this.app=e;var n=this.history;if(n instanceof rt)n.transitionTo(n.getCurrentLocation());else if(n instanceof at){var i=function(){n.setupListeners()};n.transitionTo(n.getCurrentLocation(),i,i)}n.listen((function(e){t.apps.forEach((function(t){t._route=e}))}))}},gt.prototype.beforeEach=function(e){return vt(this.beforeHooks,e)},gt.prototype.beforeResolve=function(e){return vt(this.resolveHooks,e)},gt.prototype.afterEach=function(e){return vt(this.afterHooks,e)},gt.prototype.onReady=function(e,t){this.history.onReady(e,t)},gt.prototype.onError=function(e){this.history.onError(e)},gt.prototype.push=function(e,t,n){this.history.push(e,t,n)},gt.prototype.replace=function(e,t,n){this.history.replace(e,t,n)},gt.prototype.go=function(e){this.history.go(e)},gt.prototype.back=function(){this.go(-1)},gt.prototype.forward=function(){this.go(1)},gt.prototype.getMatchedComponents=function(e){var t=e?e.matched?e:this.resolve(e).route:this.currentRoute;return t?[].concat.apply([],t.matched.map((function(e){return Object.keys(e.components).map((function(t){return e.components[t]}))}))):[]},gt.prototype.resolve=function(e,t,n){var i=ve(e,t||this.history.current,n,this),o=this.match(i,t),r=o.redirectedFrom||o.fullPath,s=this.history.base,a=_t(s,r,this.mode);return{location:i,route:o,href:a,normalizedTo:i,resolved:o}},gt.prototype.addRoutes=function(e){this.matcher.addRoutes(e),this.history.current!==k&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(gt.prototype,mt),gt.install=V,gt.version="2.8.1",B&&window.Vue&&window.Vue.use(gt);var yt=gt,bt=["compactDisplay","currency","currencyDisplay","currencySign","localeMatcher","notation","numberingSystem","signDisplay","style","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"]; -/*! - * vue-i18n v8.22.3 - * (c) 2021 kazuya kawaguchi - * Released under the MIT License. - */function wt(e,t){"undefined"!==typeof console&&(console.warn("[vue-i18n] "+e),t&&console.warn(t.stack))}function Ct(e,t){"undefined"!==typeof console&&(console.error("[vue-i18n] "+e),t&&console.error(t.stack))}var St=Array.isArray;function xt(e){return null!==e&&"object"===typeof e}function Lt(e){return"boolean"===typeof e}function kt(e){return"string"===typeof e}var Nt=Object.prototype.toString,Et="[object Object]";function Ot(e){return Nt.call(e)===Et}function Dt(e){return null===e||void 0===e}function It(e){return"function"===typeof e}function Mt(){var e=[],t=arguments.length;while(t--)e[t]=arguments[t];var n=null,i=null;return 1===e.length?xt(e[0])||St(e[0])?i=e[0]:"string"===typeof e[0]&&(n=e[0]):2===e.length&&("string"===typeof e[0]&&(n=e[0]),(xt(e[1])||St(e[1]))&&(i=e[1])),{locale:n,params:i}}function Tt(e){return JSON.parse(JSON.stringify(e))}function Pt(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}function At(e,t){return!!~e.indexOf(t)}var Rt=Object.prototype.hasOwnProperty;function Ft(e,t){return Rt.call(e,t)}function Wt(e){for(var t=arguments,n=Object(e),i=1;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ht(e){return null!=e&&Object.keys(e).forEach((function(t){"string"==typeof e[t]&&(e[t]=Bt(e[t]))})),e}function jt(e){e.prototype.hasOwnProperty("$i18n")||Object.defineProperty(e.prototype,"$i18n",{get:function(){return this._i18n}}),e.prototype.$t=function(e){var t=[],n=arguments.length-1;while(n-- >0)t[n]=arguments[n+1];var i=this.$i18n;return i._t.apply(i,[e,i.locale,i._getMessages(),this].concat(t))},e.prototype.$tc=function(e,t){var n=[],i=arguments.length-2;while(i-- >0)n[i]=arguments[i+2];var o=this.$i18n;return o._tc.apply(o,[e,o.locale,o._getMessages(),this,t].concat(n))},e.prototype.$te=function(e,t){var n=this.$i18n;return n._te(e,n.locale,n._getMessages(),t)},e.prototype.$d=function(e){var t,n=[],i=arguments.length-1;while(i-- >0)n[i]=arguments[i+1];return(t=this.$i18n).d.apply(t,[e].concat(n))},e.prototype.$n=function(e){var t,n=[],i=arguments.length-1;while(i-- >0)n[i]=arguments[i+1];return(t=this.$i18n).n.apply(t,[e].concat(n))}}var zt={beforeCreate:function(){var e=this.$options;if(e.i18n=e.i18n||(e.__i18n?{}:null),e.i18n)if(e.i18n instanceof jn){if(e.__i18n)try{var t=e.i18n&&e.i18n.messages?e.i18n.messages:{};e.__i18n.forEach((function(e){t=Wt(t,JSON.parse(e))})),Object.keys(t).forEach((function(n){e.i18n.mergeLocaleMessage(n,t[n])}))}catch(s){0}this._i18n=e.i18n,this._i18nWatcher=this._i18n.watchI18nData()}else if(Ot(e.i18n)){var n=this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof jn?this.$root.$i18n:null;if(n&&(e.i18n.root=this.$root,e.i18n.formatter=n.formatter,e.i18n.fallbackLocale=n.fallbackLocale,e.i18n.formatFallbackMessages=n.formatFallbackMessages,e.i18n.silentTranslationWarn=n.silentTranslationWarn,e.i18n.silentFallbackWarn=n.silentFallbackWarn,e.i18n.pluralizationRules=n.pluralizationRules,e.i18n.preserveDirectiveContent=n.preserveDirectiveContent),e.__i18n)try{var i=e.i18n&&e.i18n.messages?e.i18n.messages:{};e.__i18n.forEach((function(e){i=Wt(i,JSON.parse(e))})),e.i18n.messages=i}catch(s){0}var o=e.i18n,r=o.sharedMessages;r&&Ot(r)&&(e.i18n.messages=Wt(e.i18n.messages,r)),this._i18n=new jn(e.i18n),this._i18nWatcher=this._i18n.watchI18nData(),(void 0===e.i18n.sync||e.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale()),n&&n.onComponentInstanceCreated(this._i18n)}else 0;else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof jn?this._i18n=this.$root.$i18n:e.parent&&e.parent.$i18n&&e.parent.$i18n instanceof jn&&(this._i18n=e.parent.$i18n)},beforeMount:function(){var e=this.$options;e.i18n=e.i18n||(e.__i18n?{}:null),e.i18n?(e.i18n instanceof jn||Ot(e.i18n))&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0):(this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof jn||e.parent&&e.parent.$i18n&&e.parent.$i18n instanceof jn)&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0)},beforeDestroy:function(){if(this._i18n){var e=this;this.$nextTick((function(){e._subscribing&&(e._i18n.unsubscribeDataChanging(e),delete e._subscribing),e._i18nWatcher&&(e._i18nWatcher(),e._i18n.destroyVM(),delete e._i18nWatcher),e._localeWatcher&&(e._localeWatcher(),delete e._localeWatcher)}))}}},Ut={name:"i18n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render:function(e,t){var n=t.data,i=t.parent,o=t.props,r=t.slots,s=i.$i18n;if(s){var a=o.path,u=o.locale,l=o.places,c=r(),h=s.i(a,u,$t(c)||l?Kt(c.default,l):c),d=o.tag&&!0!==o.tag||!1===o.tag?o.tag:"span";return d?e(d,n,h):h}}};function $t(e){var t;for(t in e)if("default"!==t)return!1;return Boolean(t)}function Kt(e,t){var n=t?qt(t):{};if(!e)return n;e=e.filter((function(e){return e.tag||""!==e.text.trim()}));var i=e.every(Zt);return e.reduce(i?Gt:Yt,n)}function qt(e){return Array.isArray(e)?e.reduce(Yt,{}):Object.assign({},e)}function Gt(e,t){return t.data&&t.data.attrs&&t.data.attrs.place&&(e[t.data.attrs.place]=t),e}function Yt(e,t,n){return e[n]=t,e}function Zt(e){return Boolean(e.data&&e.data.attrs&&e.data.attrs.place)}var Xt,Jt={name:"i18n-n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},value:{type:Number,required:!0},format:{type:[String,Object]},locale:{type:String}},render:function(e,t){var n=t.props,i=t.parent,o=t.data,r=i.$i18n;if(!r)return null;var s=null,a=null;kt(n.format)?s=n.format:xt(n.format)&&(n.format.key&&(s=n.format.key),a=Object.keys(n.format).reduce((function(e,t){var i;return At(bt,t)?Object.assign({},e,(i={},i[t]=n.format[t],i)):e}),null));var u=n.locale||r.locale,l=r._ntp(n.value,u,s,a),c=l.map((function(e,t){var n,i=o.scopedSlots&&o.scopedSlots[e.type];return i?i((n={},n[e.type]=e.value,n.index=t,n.parts=l,n)):e.value})),h=n.tag&&!0!==n.tag||!1===n.tag?n.tag:"span";return h?e(h,{attrs:o.attrs,class:o["class"],staticClass:o.staticClass},c):c}};function Qt(e,t,n){nn(e,n)&&rn(e,t,n)}function en(e,t,n,i){if(nn(e,n)){var o=n.context.$i18n;on(e,n)&&Vt(t.value,t.oldValue)&&Vt(e._localeMessage,o.getLocaleMessage(o.locale))||rn(e,t,n)}}function tn(e,t,n,i){var o=n.context;if(o){var r=n.context.$i18n||{};t.modifiers.preserve||r.preserveDirectiveContent||(e.textContent=""),e._vt=void 0,delete e["_vt"],e._locale=void 0,delete e["_locale"],e._localeMessage=void 0,delete e["_localeMessage"]}else wt("Vue instance does not exists in VNode context")}function nn(e,t){var n=t.context;return n?!!n.$i18n||(wt("VueI18n instance does not exists in Vue instance"),!1):(wt("Vue instance does not exists in VNode context"),!1)}function on(e,t){var n=t.context;return e._locale===n.$i18n.locale}function rn(e,t,n){var i,o,r=t.value,s=sn(r),a=s.path,u=s.locale,l=s.args,c=s.choice;if(a||u||l)if(a){var h=n.context;e._vt=e.textContent=null!=c?(i=h.$i18n).tc.apply(i,[a,c].concat(an(u,l))):(o=h.$i18n).t.apply(o,[a].concat(an(u,l))),e._locale=h.$i18n.locale,e._localeMessage=h.$i18n.getLocaleMessage(h.$i18n.locale)}else wt("`path` is required in v-t directive");else wt("value type not supported")}function sn(e){var t,n,i,o;return kt(e)?t=e:Ot(e)&&(t=e.path,n=e.locale,i=e.args,o=e.choice),{path:t,locale:n,args:i,choice:o}}function an(e,t){var n=[];return e&&n.push(e),t&&(Array.isArray(t)||Ot(t))&&n.push(t),n}function un(e){un.installed=!0,Xt=e;Xt.version&&Number(Xt.version.split(".")[0]);jt(Xt),Xt.mixin(zt),Xt.directive("t",{bind:Qt,update:en,unbind:tn}),Xt.component(Ut.name,Ut),Xt.component(Jt.name,Jt);var t=Xt.config.optionMergeStrategies;t.i18n=function(e,t){return void 0===t?e:t}}var ln=function(){this._caches=Object.create(null)};ln.prototype.interpolate=function(e,t){if(!t)return[e];var n=this._caches[e];return n||(n=dn(e),this._caches[e]=n),fn(n,t)};var cn=/^(?:\d)+/,hn=/^(?:\w)+/;function dn(e){var t=[],n=0,i="";while(n0)h--,c=Cn,d[pn]();else{if(h=0,void 0===n)return!1;if(n=Mn(n),!1===n)return!1;d[gn]()}};while(null!==c)if(l++,t=e[l],"\\"!==t||!f()){if(o=In(t),a=Nn[c],r=a[o]||a["else"]||kn,r===kn)return;if(c=r[0],s=d[r[1]],s&&(i=r[2],i=void 0===i?t:i,!1===s()))return;if(c===Ln)return u}}var Pn=function(){this._cache=Object.create(null)};Pn.prototype.parsePath=function(e){var t=this._cache[e];return t||(t=Tn(e),t&&(this._cache[e]=t)),t||[]},Pn.prototype.getPathValue=function(e,t){if(!xt(e))return null;var n=this.parsePath(t);if(0===n.length)return null;var i=n.length,o=e,r=0;while(r/,Fn=/(?:@(?:\.[a-z]+)?:(?:[\w\-_|.]+|\([\w\-_|.]+\)))/g,Wn=/^@(?:\.([a-z]+))?:/,Vn=/[()]/g,Bn={upper:function(e){return e.toLocaleUpperCase()},lower:function(e){return e.toLocaleLowerCase()},capitalize:function(e){return""+e.charAt(0).toLocaleUpperCase()+e.substr(1)}},Hn=new ln,jn=function(e){var t=this;void 0===e&&(e={}),!Xt&&"undefined"!==typeof window&&window.Vue&&un(window.Vue);var n=e.locale||"en-US",i=!1!==e.fallbackLocale&&(e.fallbackLocale||"en-US"),o=e.messages||{},r=e.dateTimeFormats||{},s=e.numberFormats||{};this._vm=null,this._formatter=e.formatter||Hn,this._modifiers=e.modifiers||{},this._missing=e.missing||null,this._root=e.root||null,this._sync=void 0===e.sync||!!e.sync,this._fallbackRoot=void 0===e.fallbackRoot||!!e.fallbackRoot,this._formatFallbackMessages=void 0!==e.formatFallbackMessages&&!!e.formatFallbackMessages,this._silentTranslationWarn=void 0!==e.silentTranslationWarn&&e.silentTranslationWarn,this._silentFallbackWarn=void 0!==e.silentFallbackWarn&&!!e.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new Pn,this._dataListeners=[],this._componentInstanceCreatedListener=e.componentInstanceCreatedListener||null,this._preserveDirectiveContent=void 0!==e.preserveDirectiveContent&&!!e.preserveDirectiveContent,this.pluralizationRules=e.pluralizationRules||{},this._warnHtmlInMessage=e.warnHtmlInMessage||"off",this._postTranslation=e.postTranslation||null,this._escapeParameterHtml=e.escapeParameterHtml||!1,this.getChoiceIndex=function(e,n){var i=Object.getPrototypeOf(t);if(i&&i.getChoiceIndex){var o=i.getChoiceIndex;return o.call(t,e,n)}var r=function(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0};return t.locale in t.pluralizationRules?t.pluralizationRules[t.locale].apply(t,[e,n]):r(e,n)},this._exist=function(e,n){return!(!e||!n)&&(!Dt(t._path.getPathValue(e,n))||!!e[n])},"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||Object.keys(o).forEach((function(e){t._checkLocaleMessage(e,t._warnHtmlInMessage,o[e])})),this._initVM({locale:n,fallbackLocale:i,messages:o,dateTimeFormats:r,numberFormats:s})},zn={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},formatFallbackMessages:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0},warnHtmlInMessage:{configurable:!0},postTranslation:{configurable:!0}};jn.prototype._checkLocaleMessage=function(e,t,n){var i=[],o=function(e,t,n,i){if(Ot(n))Object.keys(n).forEach((function(r){var s=n[r];Ot(s)?(i.push(r),i.push("."),o(e,t,s,i),i.pop(),i.pop()):(i.push(r),o(e,t,s,i),i.pop())}));else if(St(n))n.forEach((function(n,r){Ot(n)?(i.push("["+r+"]"),i.push("."),o(e,t,n,i),i.pop(),i.pop()):(i.push("["+r+"]"),o(e,t,n,i),i.pop())}));else if(kt(n)){var r=Rn.test(n);if(r){var s="Detected HTML in message '"+n+"' of keypath '"+i.join("")+"' at '"+t+"'. Consider component interpolation with '' to avoid XSS. See https://bit.ly/2ZqJzkp";"warn"===e?wt(s):"error"===e&&Ct(s)}}};o(t,e,n,i)},jn.prototype._initVM=function(e){var t=Xt.config.silent;Xt.config.silent=!0,this._vm=new Xt({data:e}),Xt.config.silent=t},jn.prototype.destroyVM=function(){this._vm.$destroy()},jn.prototype.subscribeDataChanging=function(e){this._dataListeners.push(e)},jn.prototype.unsubscribeDataChanging=function(e){Pt(this._dataListeners,e)},jn.prototype.watchI18nData=function(){var e=this;return this._vm.$watch("$data",(function(){var t=e._dataListeners.length;while(t--)Xt.nextTick((function(){e._dataListeners[t]&&e._dataListeners[t].$forceUpdate()}))}),{deep:!0})},jn.prototype.watchLocale=function(){if(!this._sync||!this._root)return null;var e=this._vm;return this._root.$i18n.vm.$watch("locale",(function(t){e.$set(e,"locale",t),e.$forceUpdate()}),{immediate:!0})},jn.prototype.onComponentInstanceCreated=function(e){this._componentInstanceCreatedListener&&this._componentInstanceCreatedListener(e,this)},zn.vm.get=function(){return this._vm},zn.messages.get=function(){return Tt(this._getMessages())},zn.dateTimeFormats.get=function(){return Tt(this._getDateTimeFormats())},zn.numberFormats.get=function(){return Tt(this._getNumberFormats())},zn.availableLocales.get=function(){return Object.keys(this.messages).sort()},zn.locale.get=function(){return this._vm.locale},zn.locale.set=function(e){this._vm.$set(this._vm,"locale",e)},zn.fallbackLocale.get=function(){return this._vm.fallbackLocale},zn.fallbackLocale.set=function(e){this._localeChainCache={},this._vm.$set(this._vm,"fallbackLocale",e)},zn.formatFallbackMessages.get=function(){return this._formatFallbackMessages},zn.formatFallbackMessages.set=function(e){this._formatFallbackMessages=e},zn.missing.get=function(){return this._missing},zn.missing.set=function(e){this._missing=e},zn.formatter.get=function(){return this._formatter},zn.formatter.set=function(e){this._formatter=e},zn.silentTranslationWarn.get=function(){return this._silentTranslationWarn},zn.silentTranslationWarn.set=function(e){this._silentTranslationWarn=e},zn.silentFallbackWarn.get=function(){return this._silentFallbackWarn},zn.silentFallbackWarn.set=function(e){this._silentFallbackWarn=e},zn.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent},zn.preserveDirectiveContent.set=function(e){this._preserveDirectiveContent=e},zn.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage},zn.warnHtmlInMessage.set=function(e){var t=this,n=this._warnHtmlInMessage;if(this._warnHtmlInMessage=e,n!==e&&("warn"===e||"error"===e)){var i=this._getMessages();Object.keys(i).forEach((function(e){t._checkLocaleMessage(e,t._warnHtmlInMessage,i[e])}))}},zn.postTranslation.get=function(){return this._postTranslation},zn.postTranslation.set=function(e){this._postTranslation=e},jn.prototype._getMessages=function(){return this._vm.messages},jn.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},jn.prototype._getNumberFormats=function(){return this._vm.numberFormats},jn.prototype._warnDefault=function(e,t,n,i,o,r){if(!Dt(n))return n;if(this._missing){var s=this._missing.apply(null,[e,t,i,o]);if(kt(s))return s}else 0;if(this._formatFallbackMessages){var a=Mt.apply(void 0,o);return this._render(t,r,a.params,t)}return t},jn.prototype._isFallbackRoot=function(e){return!e&&!Dt(this._root)&&this._fallbackRoot},jn.prototype._isSilentFallbackWarn=function(e){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(e):this._silentFallbackWarn},jn.prototype._isSilentFallback=function(e,t){return this._isSilentFallbackWarn(t)&&(this._isFallbackRoot()||e!==this.fallbackLocale)},jn.prototype._isSilentTranslationWarn=function(e){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(e):this._silentTranslationWarn},jn.prototype._interpolate=function(e,t,n,i,o,r,s){if(!t)return null;var a,u=this._path.getPathValue(t,n);if(St(u)||Ot(u))return u;if(Dt(u)){if(!Ot(t))return null;if(a=t[n],!kt(a)&&!It(a))return null}else{if(!kt(u)&&!It(u))return null;a=u}return kt(a)&&(a.indexOf("@:")>=0||a.indexOf("@.")>=0)&&(a=this._link(e,t,a,i,"raw",r,s)),this._render(a,o,r,n)},jn.prototype._link=function(e,t,n,i,o,r,s){var a=n,u=a.match(Fn);for(var l in u)if(u.hasOwnProperty(l)){var c=u[l],h=c.match(Wn),d=h[0],f=h[1],p=c.replace(d,"").replace(Vn,"");if(At(s,p))return a;s.push(p);var g=this._interpolate(e,t,p,i,"raw"===o?"string":o,"raw"===o?void 0:r,s);if(this._isFallbackRoot(g)){if(!this._root)throw Error("unexpected error");var m=this._root.$i18n;g=m._translate(m._getMessages(),m.locale,m.fallbackLocale,p,i,o,r)}g=this._warnDefault(e,p,g,i,St(r)?r:[r],o),this._modifiers.hasOwnProperty(f)?g=this._modifiers[f](g):Bn.hasOwnProperty(f)&&(g=Bn[f](g)),s.pop(),a=g?a.replace(c,g):a}return a},jn.prototype._createMessageContext=function(e){var t=St(e)?e:[],n=xt(e)?e:{},i=function(e){return t[e]},o=function(e){return n[e]};return{list:i,named:o}},jn.prototype._render=function(e,t,n,i){if(It(e))return e(this._createMessageContext(n));var o=this._formatter.interpolate(e,n,i);return o||(o=Hn.interpolate(e,n,i)),"string"!==t||kt(o)?o:o.join("")},jn.prototype._appendItemToChain=function(e,t,n){var i=!1;return At(e,t)||(i=!0,t&&(i="!"!==t[t.length-1],t=t.replace(/!/g,""),e.push(t),n&&n[t]&&(i=n[t]))),i},jn.prototype._appendLocaleToChain=function(e,t,n){var i,o=t.split("-");do{var r=o.join("-");i=this._appendItemToChain(e,r,n),o.splice(-1,1)}while(o.length&&!0===i);return i},jn.prototype._appendBlockToChain=function(e,t,n){for(var i=!0,o=0;o0)r[s]=arguments[s+4];if(!e)return"";var a=Mt.apply(void 0,r);this._escapeParameterHtml&&(a.params=Ht(a.params));var u=a.locale||t,l=this._translate(n,u,this.fallbackLocale,e,i,"string",a.params);if(this._isFallbackRoot(l)){if(!this._root)throw Error("unexpected error");return(o=this._root).$t.apply(o,[e].concat(r))}return l=this._warnDefault(u,e,l,i,r,"string"),this._postTranslation&&null!==l&&void 0!==l&&(l=this._postTranslation(l,e)),l},jn.prototype.t=function(e){var t,n=[],i=arguments.length-1;while(i-- >0)n[i]=arguments[i+1];return(t=this)._t.apply(t,[e,this.locale,this._getMessages(),null].concat(n))},jn.prototype._i=function(e,t,n,i,o){var r=this._translate(n,t,this.fallbackLocale,e,i,"raw",o);if(this._isFallbackRoot(r)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(e,t,o)}return this._warnDefault(t,e,r,i,[o],"raw")},jn.prototype.i=function(e,t,n){return e?(kt(t)||(t=this.locale),this._i(e,t,this._getMessages(),null,n)):""},jn.prototype._tc=function(e,t,n,i,o){var r,s=[],a=arguments.length-5;while(a-- >0)s[a]=arguments[a+5];if(!e)return"";void 0===o&&(o=1);var u={count:o,n:o},l=Mt.apply(void 0,s);return l.params=Object.assign(u,l.params),s=null===l.locale?[l.params]:[l.locale,l.params],this.fetchChoice((r=this)._t.apply(r,[e,t,n,i].concat(s)),o)},jn.prototype.fetchChoice=function(e,t){if(!e||!kt(e))return null;var n=e.split("|");return t=this.getChoiceIndex(t,n.length),n[t]?n[t].trim():e},jn.prototype.tc=function(e,t){var n,i=[],o=arguments.length-2;while(o-- >0)i[o]=arguments[o+2];return(n=this)._tc.apply(n,[e,this.locale,this._getMessages(),null,t].concat(i))},jn.prototype._te=function(e,t,n){var i=[],o=arguments.length-3;while(o-- >0)i[o]=arguments[o+3];var r=Mt.apply(void 0,i).locale||t;return this._exist(n[r],e)},jn.prototype.te=function(e,t){return this._te(e,this.locale,this._getMessages(),t)},jn.prototype.getLocaleMessage=function(e){return Tt(this._vm.messages[e]||{})},jn.prototype.setLocaleMessage=function(e,t){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(e,this._warnHtmlInMessage,t),this._vm.$set(this._vm.messages,e,t)},jn.prototype.mergeLocaleMessage=function(e,t){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(e,this._warnHtmlInMessage,t),this._vm.$set(this._vm.messages,e,Wt({},this._vm.messages[e]||{},t))},jn.prototype.getDateTimeFormat=function(e){return Tt(this._vm.dateTimeFormats[e]||{})},jn.prototype.setDateTimeFormat=function(e,t){this._vm.$set(this._vm.dateTimeFormats,e,t),this._clearDateTimeFormat(e,t)},jn.prototype.mergeDateTimeFormat=function(e,t){this._vm.$set(this._vm.dateTimeFormats,e,Wt(this._vm.dateTimeFormats[e]||{},t)),this._clearDateTimeFormat(e,t)},jn.prototype._clearDateTimeFormat=function(e,t){for(var n in t){var i=e+"__"+n;this._dateTimeFormatters.hasOwnProperty(i)&&delete this._dateTimeFormatters[i]}},jn.prototype._localizeDateTime=function(e,t,n,i,o){for(var r=t,s=i[r],a=this._getLocaleChain(t,n),u=0;u0)t[n]=arguments[n+1];var i=this.locale,o=null;return 1===t.length?kt(t[0])?o=t[0]:xt(t[0])&&(t[0].locale&&(i=t[0].locale),t[0].key&&(o=t[0].key)):2===t.length&&(kt(t[0])&&(o=t[0]),kt(t[1])&&(i=t[1])),this._d(e,i,o)},jn.prototype.getNumberFormat=function(e){return Tt(this._vm.numberFormats[e]||{})},jn.prototype.setNumberFormat=function(e,t){this._vm.$set(this._vm.numberFormats,e,t),this._clearNumberFormat(e,t)},jn.prototype.mergeNumberFormat=function(e,t){this._vm.$set(this._vm.numberFormats,e,Wt(this._vm.numberFormats[e]||{},t)),this._clearNumberFormat(e,t)},jn.prototype._clearNumberFormat=function(e,t){for(var n in t){var i=e+"__"+n;this._numberFormatters.hasOwnProperty(i)&&delete this._numberFormatters[i]}},jn.prototype._getNumberFormatter=function(e,t,n,i,o,r){for(var s=t,a=i[s],u=this._getLocaleChain(t,n),l=0;l0)t[n]=arguments[n+1];var i=this.locale,o=null,r=null;return 1===t.length?kt(t[0])?o=t[0]:xt(t[0])&&(t[0].locale&&(i=t[0].locale),t[0].key&&(o=t[0].key),r=Object.keys(t[0]).reduce((function(e,n){var i;return At(bt,n)?Object.assign({},e,(i={},i[n]=t[0][n],i)):e}),null)):2===t.length&&(kt(t[0])&&(o=t[0]),kt(t[1])&&(i=t[1])),this._n(e,i,o,r)},jn.prototype._ntp=function(e,t,n,i){if(!jn.availabilities.numberFormat)return[];if(!n){var o=i?new Intl.NumberFormat(t,i):new Intl.NumberFormat(t);return o.formatToParts(e)}var r=this._getNumberFormatter(e,t,this.fallbackLocale,this._getNumberFormats(),n,i),s=r&&r.formatToParts(e);if(this._isFallbackRoot(s)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(e,t,n,i)}return s||[]},Object.defineProperties(jn.prototype,zn),Object.defineProperty(jn,"availabilities",{get:function(){if(!An){var e="undefined"!==typeof Intl;An={dateTimeFormat:e&&"undefined"!==typeof Intl.DateTimeFormat,numberFormat:e&&"undefined"!==typeof Intl.NumberFormat}}return An}}),jn.install=un,jn.version="8.22.3";var Un=jn,$n=n("1736"),Kn=n.n($n),qn=n("9b4c"),Gn=n("9299"),Yn=n("2ef0"),Zn=n.n(Yn);const Xn="undefined"!==typeof window&&"[object Object]"!==Object.prototype.toString.call(window),Jn=Xn&&window.navigator.userAgent.toLowerCase(),Qn=Jn&&Jn.indexOf("trident")>0,ei=Jn&&Jn.indexOf("msie 9.0")>0;function ti(e){let t=e.className;return"object"===typeof t&&(t=t.baseVal||""),t}function ni(e,t){if(!e)return null;const n=ti(e),i=n.split(" ");return-1!==i.indexOf(t)}function ii(e,t){ei&&!/svg$/.test(e.namespaceURI)?e.className=t:e.setAttribute("class",t)}function oi(e,t){if(e.classList)e.classList.add(t);else{const n=` ${ti(e)} `;n.indexOf(` ${t} `)<0&&ii(e,(n+t).trim())}}function ri(e,t){if(e.classList)e.classList.remove(t);else{let n=` ${ti(e)} `;const i=` ${t} `;while(n.indexOf(i)>=0)n=n.replace(i," ");ii(e,n.trim())}e.className||e.removeAttribute("class")}function si(e,t){const n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!n.contains(i))}function ai(...e){const t=e[0];return t?([].forEach.call(e,(e,n)=>{n>0&&Object.keys(e).forEach(n=>{t[n]=e[n]})}),t):null}function ui(...e){const t=e[0];return t?([].forEach.call(e,(e,n)=>{n>0&&Object.keys(e).forEach(n=>{void 0!==t[n]&&(t[n]=e[n])})}),t):null}const li=Object.prototype.toString,ci="[object Object]";function hi(e){return li.call(e)===ci}function di(e){return"number"===typeof e}function fi(e){return"[object Date]"===li.call(e)}function pi(e){return"function"===typeof e}function gi(e){const t=typeof e;return!!e&&("object"===t||"function"===t)}function mi(e){return Array.isArray(e)}function vi(e){return!!e&&"object"===typeof e}function _i(e){return"string"===typeof e||!mi(e)&&vi(e)&&"[object String]"===li.call(e)}function yi(e){return void 0===e||null===e||""===e}var bi=n("78a5");bi["a"].mode||(bi["a"].mode="vertical"),bi["a"].theme||(bi["a"].theme="blue"),bi["a"].env||(bi["a"].env={}),bi["a"].roles||(bi["a"].roles={}),bi["a"].menu||(bi["a"].menu=[]),bi["a"].i18n||(bi["a"].i18n={locale:"zh-cn",messages:{}}),bi["a"].i18n.locale||(bi["a"].i18n.locale="zh-cn"),bi["a"].i18n.messages||(bi["a"].i18n.messages={}),bi["a"].i18n.messages["zh-cn"]||(bi["a"].i18n.messages["zh-cn"]={}),bi["a"].i18n.messages.en||(bi["a"].i18n.messages.en={}),Object.assign(bi["a"].i18n.messages["zh-cn"],{fesMessages:{defaultError:"后台接口异常,请联系开发处理!",importInterfaceTip:"两个相同请求间隔小于 {s} 秒,是否继续?",tip:"提示",noPermission:"您没有访问当前路径的权限"}}),Object.assign(bi["a"].i18n.messages.en,{fesMessages:{defaultError:"Server-end API error, please contact the admin.",importInterfaceTip:"Repetitive request in {s} seconds, continue anyway?",tip:"Tips",noPermission:"You don’t have the authority to access."}});var wi=bi["a"];const Ci=Object.prototype.hasOwnProperty,Si=function(e,t){return Ci.call(e,t)},xi=/(%|)\{([0-9a-zA-Z_]+)\}/g,Li=function(e,...t){return 1===t.length&&"object"===typeof t[0]&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(xi,(n,i,o,r)=>{if("{"===e[r-1]&&"}"===e[r+n.length])return o;const s=Si(t,o)?t[o]:null;return null===s||void 0===s?"":s})};var ki=function(e,t){const n=e.split(".");let i,o=wi.i18n.messages[wi.i18n.locale];o||(o=wi.i18n.messages["zh-cn"]);for(let r=0,s=n.length;r0&&Object.keys(this.onObj[t]).forEach(n=>{this.onObj[t][n].apply(null,e)}),void 0!==this.oneObj[t]&&this.oneObj[t].length>0&&(Object.keys(this.oneObj[t]).forEach(n=>{this.oneObj[t][n].apply(null,e),this.oneObj[t][n]=void 0}),this.oneObj[t]=[]),null}};var Ei=Ni;const Oi={getItem(e){return decodeURIComponent(document.cookie.replace(new RegExp(`(?:(?:^|.*;)\\s*${encodeURIComponent(e).replace(/[-.+*]/g,"\\$&")}\\s*\\=\\s*([^;]*).*$)|^.*$`),"$1"))||null},setItem(e,t,n,i,o,r){if(!e||/^(?:expires|max-age|path|domain|secure)$/i.test(e))return!1;let s="";if(n)switch(n.constructor){case Number:s=n===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+n;break;case String:s="; expires="+n;break;case Date:s="; expires="+n.toUTCString();break;default:break}return document.cookie=`${encodeURIComponent(e)}=${encodeURIComponent(t)}${s}${o?"; domain="+o:""}${i?"; path="+i:""}${r?"; secure":""}`,!0},removeItem(e,t,n){return!(!e||!this.hasItem(e))&&(document.cookie=`${encodeURIComponent(e)}=; expires=Thu, 01 Jan 1970 00:00:00 GMT${n?"; domain="+n:""}${t?"; path="+t:""}`,!0)},hasItem(e){return new RegExp(`(?:^|;\\s*)${encodeURIComponent(e).replace(/[-.+*]/g,"\\$&")}\\s*\\=`).test(document.cookie)},keys:function(){const e=document.cookie.replace(/((?:^|\s*;)[^=]+)(?=;|$)|^\s*|\s*(?:=[^;]*)?(?:\1|$)/g,"").split(/\s*(?:=[^;]*)?;\s*/);for(let t=0;t{Oi.removeItem(e)})},remove(e){Oi.removeItem(e)}},Ti="session",Pi="local",Ai="cookie";var Ri={set(e,t,n=Ti,i){const{storage:o,isWebStorage:r=!0}=this._map(n);r?Ii.set(e,t,o):Mi.set(e,t,i)},get(e,t=Ti){const{storage:n,isWebStorage:i=!0}=this._map(t);return i?Ii.get(e,n):Mi.get(e)},clear(e=Ti){const{storage:t,isWebStorage:n=!0}=this._map(e);n?Ii.clear(t):Mi.clear()},remove(e,t=Ti){const{storage:n,isWebStorage:i=!0}=this._map(t);i?Ii.remove(e,n):Mi.remove(e)},_map(e){let t,n=!0;switch(!0){case e===Ti:t="sessionStorage";break;case e===Pi:t="localStorage";break;case e===Ai:t="cookie",n=!1;break;default:t="sessionStorage"}return{isWebStorage:n,storage:t}}};const Fi={data:Ri.get("Fes_History")||[],current:null,record:function(e){const t=Fi.data.length,n={href:e,type:""};if(0===t)n.type="forward";else if(t>0&&t<=1)Fi.data[t-1].href===e?n.type="refresh":n.type="forward";else if(t>1){const i=Fi.data[t-1],o=Fi.data[t-2];i.href===e?n.type="refresh":o.href===e?n.type="back":n.type="forward"}Fi.data.push(n),Fi.current=n,Ri.set("Fes_History",Fi.data)}};var Wi=Fi;const Vi={canRoute(e,t){if(e=e.split("?")[0],Array.isArray(t)&&t.length>0){if(""===e&&t.includes("/"))return!0;if(e)for(let n=0;n0?"?"+i.join("&"):"",s},proxyFn(e,t,n){e[t]={};const i={};return window.Proxy?e[t]=new Proxy(e[t],{get(e,t){return i[t]=i[t]?i[t]:[],e[t]||(e[t]=function(...e){i[t].push(e)}),e[t]}}):n.forEach(n=>{e[t][n]||(e[t][n]=function(...e){i[n]=i[n]?i[n]:[],i[n].push(e)})}),i},_:Zn.a};ai(Vi,i,o,r,{format:ki},{event:Ei},{history:Wi});var Bi=Vi,Hi=n("bc3a"),ji=n.n(Hi),zi=wi.env["prod"]||{};const Ui=function(e){Object.keys(e).forEach(t=>{Bi.isString(e[t])?e[t]=e[t].trim():(Bi.isPlainObject(e[t])||Bi.isArray(e[t]))&&Ui(e[t])})},$i={data:Ri.get("FES_AJAX_LOG")||[],importantApi:{},creatLog(e,t,n){let i;t&&(i=JSON.stringify(t)),i&&i.length>1e3&&(t=i.slice(0,1e3));const o=(new Date).getTime(),r={url:e,data:t,timestamp:o,status:n||"send"};this.data.length>=500&&this.data.shift(),this.data.push(r);try{Ri.set("FES_AJAX_LOG",this.data)}catch(s){Ri.remove("FES_AJAX_LOG"),this.data=[r],Ri.set("FES_AJAX_LOG",this.data)}return r},changeLogStatus(e,t){const n=this.data.filter(t=>t.timestamp===e.timestamp);n.length>0&&(n[0].status=t,Ri.set("FES_AJAX_LOG",this.data))},getLogByURL(e,t){return this.data.filter(n=>n.url===e&&JSON.stringify(t)===JSON.stringify(n.data))}},Ki=ji.a.create({method:"post",baseURL:zi.api,timeout:1e4,withCredentials:!0}),qi={instance:Ki,error:{},constructionOfResponse:{codePath:"code",successCode:"0",messagePath:"msg",resultPath:"result"}},Gi=function(e,t){const n=["codePath","messagePath","resultPath"],i=[],o={};for(let r=0;rt(e)):n.includes(o)||"*"===n||(t=r||Bi.format("fesMessages.defaultError"));const i=new Error(t);throw i.response=e,i}return s||{}},Zi=function(e){let t="";const n=e.response;if(n&&qi.error[n.status])qi.error[n.status].forEach(e=>e(n));else{t=Bi.format("fesMessages.defaultError");try{if(n&&n.data){let e;if(Bi.isString(n.data)?e=JSON.parse(n.data):Bi.isObject(n.data)&&(e=n.data),e){const{message:i}=Gi(e,n.config&&n.config.resultFormat||qi.constructionOfResponse);t=i}}}catch(i){}}throw e.message=t,e},Xi=function(e,t,n){const i=Ki.defaults.method||"post";if(Bi.isNull(e))return console.error("请传入URL");!Bi.isNull(e)&&Bi.isNull(t)&&Bi.isNull(n)?n={method:i}:Bi.isNull(e)||Bi.isNull(t)||!Bi.isNull(n)?Bi.isNull(e)||Bi.isNull(t)||Bi.isNull(n)||(Bi.isObject(t)||(t={}),Bi.isString(n)?n={method:n}:Bi.isObject(n)?n.method=n.method||i:n={method:i},"get"!==n.method&&"delete"!==n.method&&"head"!==n.method&&"options"!==n.method||(n.params=t),"post"!==n.method&&"put"!==n.method&&"patch"!==n.method||(n.data=t)):(n={method:i},Bi.isString(t)?n.method=t:Bi.isObject(t)&&(n.data=t));const o=n.params||n.data;return o&&Bi.isObject(o)&&!1!==n.trim&&Ui(o),n.url=e,n.button&&(n.button.currentDisabled=!0),Ki.request(n)},Ji=function(e,t,n){const i=$i.creatLog(e,t);return Xi(e,t,n).then(Yi,Zi).then(e=>($i.changeLogStatus(i,"success"),n&&n.button&&(n.button.currentDisabled=!1),e)).catch(e=>{throw $i.changeLogStatus(i,"fail"),n&&n.button&&(n.button.currentDisabled=!1),e.message&&window.Toast.error(e.message),e})};qi.fetch=function(e,t,n){if($i.importantApi[e]){const i=$i.getLogByURL(e,t);if(i.length>0){const o=i[i.length-1];if("compare"===o.status)return $i.creatLog(e,t,"notAllowed"),{then:()=>{}};const r=$i.importantApi[e],s=r.control||1e4,a=r.message||Bi.format("fesMessages.importInterfaceTip",{s:s/1e3});if((new Date).getTime()-o.timestamp{window.Message.confirm(Bi.format("fesMessages.tip"),a).then(a=>{"compare"===o.status&&$i.changeLogStatus(o,i),0===a?r(Ji(e,t,n)):s(new Error("不允许相同操作间隔过小"))})})}return Ji(e,t,n)}return Ji(e,t,n)}return Ji(e,t,n)},qi.setHeader=function(e={}){Object.keys(e).forEach(t=>{["delete","get","head","post","put","patch","common"].includes(t)?Ki.defaults.headers[t]=Object.assign({},Ki.defaults.headers[t],e[t]):Ki.defaults.headers.common[t]=e[t]})},qi.option=function(e={}){const{root:t,baseURL:n,timeout:i,headers:o,config:r,...s}=e;(t||n)&&(Ki.defaults.baseURL=t||n),i&&Bi.isNumber(i)&&(Ki.defaults.timeout=i),o&&qi.setHeader(o);const a=Object.assign({},s,r);Object.keys(a).forEach(e=>{Ki.defaults[e]=a[e]})},qi.setReqInterceptor=function(e,t){return Array.isArray(e)?Ki.interceptors.request.use(...e):Ki.interceptors.request.use(e,t)},qi.ejectReqInterceptor=function(e){return Ki.interceptors.request.eject(e)},qi.setResInterceptor=function(e,t){return Array.isArray(e)?Ki.interceptors.response.use(...e):Ki.interceptors.response.use(e,t)},qi.ejectResInterceptor=function(e){return Ki.interceptors.response.eject(e)},qi.setError=function(e){e&&Bi.isObject(e)&&Object.keys(e).forEach(t=>{Bi.isArray(qi.error[t])||(qi.error[t]=[]),qi.error[t].push(e[t])})},qi.setResponse=function(e){this.constructionOfResponse=e},qi.setImportant=function(e){e&&Bi.isObject(e)?$i.importantApi=e:console.error('【FEX】ImportantApi配置错误: 参数必须是对象{"/get": { message:"xxx", control: 10000 } }')};var Qi=qi;const eo=wi.map,to=Object.create({getValueByName(e,t){const n=this[e].filter(e=>e.text==t);return n[0]?n[0].value:""},getNameByValue(e,t){const n=this[e].filter(e=>e.value==t);return n[0]?n[0].text:""}});Object.keys(eo).forEach(e=>{to[e]=[],Bi.isArray(eo[e])?eo[e].forEach(t=>{t.length>=2?to[e].push({value:t[0],text:t[1]}):console.error(`【FEX】Map配置错误:Name${e}的值必输是数组,类似['1', '成功']`,t)}):console.error("【FEX】Map配置错误:后面的值必须是数组",eo[e])});var no=to;class io{constructor(e){Object.defineProperty(this,"name",{value:e,enumerable:!1}),Object.defineProperty(this,"pre",{value:`FesFesx_${this.name}_`,enumerable:!1});const t=Object.keys(sessionStorage),n=t.length;for(let i=0;ii)return e[0].components.default[t];const o=e[i-n].components.default;return"boolean"===typeof o[t]?o[t]:uo(e,t,n+1)},lo={install(e,t){e.mixin({data(){const e={FesMap:no,FesFesx:so},t=this.$options.FesDataCache;if(t&&ao[t]&&"forward"!==Bi.history.current.type)return ao[t];let n;return this.$options.FesSyncData&&Object.keys(this.$options.FesSyncData).forEach(t=>{e[t]=null}),Bi.isFunction(this.$options.FesData)?(this.FesFesx=so,this.FesMap=no,n=this.$options.FesData.call(this)):n=this.$options.FesData,n&&Object.keys(n).forEach(t=>{e[t]=n[t]}),e},created(){const e=void 0!==wi.FesHeader&&wi.FesHeader,t=void 0===wi.FesLeft||wi.FesLeft,n=this.$route&&this.$route.matched||[];if(n.length>0){const i=n[n.length-1].instances.default;if(this===i){const i=uo(n,"FesHeader");this.$root.header="boolean"===typeof i?i:e;const o=uo(n,"FesLeft");this.$root.left="boolean"===typeof o?o:t}}const i=this.$options.FesSyncData;if(i){const e=[];Object.keys(i).forEach(t=>{Bi.isArray(i[t])?e.push([t,i[t][0],i[t][1]]):console.error(`【FEX】异步参数【${t}】配置错误:值不是数组`,i[t])});const t=[];for(let n=0;n{t.forEach((t,n)=>{this[e[n][0]]=t})})}this.$options.FesCreated&&Bi.isFunction(this.$options.FesCreated)&&this.$options.FesCreated.call(this)},mounted(){this.$options.FesReady&&Bi.isFunction(this.$options.FesReady)&&this.$options.FesReady.call(this)},beforeDestroy(){const e=this.$options.FesDataCache;e&&(ao[e]=this.$data),this.$options.FesBeforeDestroy&&Bi.isFunction(this.$options.FesBeforeDestroy)&&this.$options.FesBeforeDestroy.call(this)},destroyed(){this.$options.FesDestroy&&Bi.isFunction(this.$options.FesDestroy)&&this.$options.FesDestroy.call(this)}}),e.prototype.FesApp=t,e.prototype.FesUtil=Bi,e.prototype.FesStorage=Ri,e.prototype.FesApi=Qi,e.prototype.FesEnv=zi}};var co=lo,ho=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("route-menu",{attrs:{menu:e.authMenu,width:e.width,type:e.type,mode:e.mode,"auto-close":e.autoClose}})},fo=[];ho._withStripped=!0;var po={props:{mode:{type:String,default:"vertical"},width:{type:[String,Number],default:void 0},menu:{type:Array,default(){return[]}},type:{type:String,default:"light"},autoClose:{type:Boolean,default:!1}},data(){return{allowPage:["*"]}},computed:{authMenu(){return this.filterMenu(this.menu,this.allowPage)}},created(){this.allowPage=this.FesApp.getAllowPage(),Bi.event.on("fes_allowPage_change",()=>{this.allowPage=this.FesApp.getAllowPage()})},methods:{filterMenu(e,t){if(t&&e){const n=[];for(let i=0;i0){const e=[];for(let n=0;n0&&n.push({...o,subMenu:e})}else n.push(o);else Bi.canRoute(o.path,t)&&n.push(o)}return n}return e}}},go=po,mo=n("dcb0"),vo=Object(mo["a"])(go,ho,fo,!1,null,null,null);vo.options.__file="node_modules/@webank/fes-core/src/views/components/routeMenu.vue";var _o=vo.exports,yo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"query-page"},[n("div",{staticClass:"query-page-search"},[e._t("default"),n("div",{staticClass:"query-page-search-buttons"},[e._t("button")],2)],2)])},bo=[];yo._withStripped=!0;var wo={},Co=wo,So=Object(mo["a"])(Co,yo,bo,!1,null,null,null);So.options.__file="node_modules/@webank/fes-core/src/views/components/searchPanel.vue";var xo=So.exports,Lo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"query-page"},[n("div",{staticClass:"query-page-table"},[e._t("default")],2)])},ko=[];Lo._withStripped=!0;var No={},Eo=No,Oo=Object(mo["a"])(Eo,Lo,ko,!1,null,null,null);Oo.options.__file="node_modules/@webank/fes-core/src/views/components/listPanel.vue";var Do=Oo.exports;const Io={FesRouteMenu:_o,FesSearchPanel:xo,FesListPanel:Do},Mo=function(e){Object.keys(Io).forEach(t=>{e.component(t,Io[t])})};"undefined"!==typeof window&&window.Vue&&Mo(window.Vue);var To={install:Mo,version:"2.0.0"},Po=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"layout",class:e.getRootClass()},[e.left?n("div",{staticClass:"layout-left"},[n("left"),"vertical"===e.mode?n("span",{staticClass:"layout-left-fold-menu",on:{click:e.toggleMenu}},[n("span",{directives:[{name:"show",rawName:"v-show",value:!e.leftHidden,expression:"!leftHidden"}]},[n("Icon",{attrs:{type:"ios-arrow-back"}}),n("Icon",{attrs:{type:"ios-arrow-back"}})],1),n("span",{directives:[{name:"show",rawName:"v-show",value:e.leftHidden,expression:"leftHidden"}]},[n("Icon",{attrs:{type:"ios-arrow-forward"}}),n("Icon",{attrs:{type:"ios-arrow-forward"}})],1)]):e._e()],1):e._e(),n("div",{staticClass:"layout-right"},[e.header?n("div",{staticClass:"layout-right-header"},[n("fes-header")],1):e._e(),n("div",{staticClass:"layout-right-body"},[n("router-view",{ref:"pageview"})],1)])])},Ao=[];Po._withStripped=!0;var Ro=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"layout-left-body"},[e.fesFesx.FesHideLeftLogo?e._e():i("div",{staticClass:"layout-left-logo",class:{hasLogoEvent:e.fesFesx.FesLogoEvent},on:{click:e.LogoClick}},[i("img",{attrs:{src:n("9d64")}}),i("p",[e._v(e._s(e.fesName))])]),i("div",{staticClass:"layout-left-menu"},[i("fes-route-menu",{attrs:{menu:e.fesMenu,type:e.menuTheme,mode:e.menuMode,"auto-close":!0}})],1),i("fes-left",{ref:"commonleft"}),e.showCommonLeft?e._e():i("div",{staticClass:"layout-left-user"},[i("div",{staticClass:"layout-left-user-name"},[i("p",[e._v(e._s(e.fesFesx.FesUserName))]),i("p",[e._v(e._s(e.fesFesx.FesRoleName))])]),i("div",{staticClass:"layout-left-user-logout"},[i("Icon",{attrs:{type:"md-log-out",size:"28"},on:{click:e.logout}})],1)])],1)},Fo=[];Ro._withStripped=!0;const Wo="inside_"+window.location.pathname.replace(/\//g,"_");var Vo=new oo(Wo),Bo={data(){const e={light:"light",blue:"dark",dark:"dark"};return{fesFesx:Vo,menuData:wi.menu||[],menuMode:this.$parent.mode,menuTheme:e[this.$parent.theme],showCommonLeft:!1}},computed:{fesName(){const e=Vo.get("FesName");return"$i18n."===e.slice(0,6)?this.$t(e.slice(6)):e},fesMenu(){const e=this.menuData;return e.forEach(e=>{e.__title||(e.__title=e.title),"$i18n."===e.__title.slice(0,6)&&(e.title=this.$t(e.__title.slice(6))),e.subMenu&&e.subMenu.forEach(e=>{e.__title||(e.__title=e.title),"$i18n."===e.__title.slice(0,6)&&(e.title=this.$t(e.__title.slice(6)))})}),e}},mounted(){this.showCommonLeft=this.$refs.commonleft&&this.$refs.commonleft.$el&&this.$refs.commonleft.$el.innerHTML&&""!==this.$refs.commonleft.$el.innerHTML.trim(),this.FesApp.on("fes_logout",()=>{const e=Vo.get("FesName");Vo.clear(),Vo.set("FesName",e)})},methods:{logout(){this.FesApp.set("FesRoleId",null);const e=this.FesApp.get("FesLogout");this.FesUtil.isFunction(e)&&e.call(this.FesApp),this.FesApp.trigger("fes_logout",this.FesApp)},LogoClick(){const e=this.fesFesx.get("FesLogoEvent");this.FesUtil.isFunction(e)&&e.call(this),this.FesApp.trigger("fes_logo_click",this.FesApp)}}},Ho=Bo,jo=Object(mo["a"])(Ho,Ro,Fo,!1,null,null,null);jo.options.__file="node_modules/@webank/fes-core/src/views/layout/left.vue";var zo=jo.exports,Uo={components:{left:zo},data(){return{mode:wi.mode,theme:wi.theme,leftHidden:!1,header:!1,left:!0,animate:!1}},methods:{getRootClass(){const e=["layout-mode-"+this.mode,"layout-theme-"+this.theme];return this.left||e.push("layout-left-hide"),this.leftHidden&&e.push("layout-left-hidden"),this.header||e.push("layout-header-hide"),this.animate&&e.push("layout-animate"),e},toggleMenu(){this.animate=!0,setTimeout(()=>{this.animate=!1},300),this.leftHidden=!this.leftHidden}}},$o=Uo,Ko=Object(mo["a"])($o,Po,Ao,!1,null,null,null);Ko.options.__file="node_modules/@webank/fes-core/src/views/layout/root.vue";var qo=Ko.exports;function Go(e,t){if(!e)return"";t=t||"yyyy-MM-dd hh:mm:ss",e=Number(e);const n=new Date(e),i={"y+":n.getFullYear(),"M+":n.getMonth()+1,"d+":n.getDate(),"h+":n.getHours(),"m+":n.getMinutes(),"s+":n.getSeconds()};return new RegExp("(y+)").test(t)&&(t=t.replace(RegExp.$1,i["y+"])),Object.keys(i).forEach(e=>{new RegExp(`(${e})`).test(t)&&(t=t.replace(RegExp.$1,1===RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)))}),t}function Yo(e){const t=[];e=Number(e).toFixed(2);const n=e.match(/\.[0-9]*/g),i=parseInt(e,10).toString(),o=i.split(""),r=o.length;function s(){let e=0;for(let n=r;n>0;n--,e++)e&&e%3===0&&(t.unshift(","),e=0),t.unshift(o.pop());const i=t.join("");return n?i.concat(n):i}return r>3?s():e}function Zo(e){e=""+e;const t=/([0-9]{4})/g;return e&&(e=e.replace(t,"$1 ")),e}function Xo(e,t,n){if(e){const i=e.length;let o="",r="";return t&&i>t&&(o=e.slice(0,t)),n&&i>t+n&&(r=e.slice(i-n)),`${o}***${r}`}return""}function Jo(e,t){let n="";return t&&Bi.isArray(t)&&t.forEach(t=>{t.value===e&&(n=t.text)}),n}function Qo(e,t){const n=[];return Bi.isArray(e)&&e.forEach(e=>{Bi.isArray(t)&&-1!==t.indexOf(e.value)&&n.push(e)}),n}function er(e){return e[0].toUpperCase()+e.slice(1)}function tr(e){return e.toUpperCase()}function nr(e){return e.toLowerCase()}const ir={bind(e,t){const n=e.style.display,i=()=>{const i=ur.getAllowPage()||[];-1===i.indexOf(t.value)?e.style.display="none":e.style.display=n};i(),ur.FesUtil.event.on("fes_allowPage_change",i)}},or={allowRoutesSync:[],allowRoutes:[],format(e){return Array.isArray(e)?e.map(e=>Promise.resolve(e)):[Promise.resolve(e)]},set(e){this.allowRoutesSync=e,this.allowRoutes=this.format(e)},getSync(){return this.allowRoutesSync},get(){return Promise.all(this.allowRoutes).then(e=>e.reduce((e,t)=>e.concat(t),[]))},merge(e){this.allowRoutes=this.allowRoutes.concat(this.format(e))},async match(e){const t=await this.get();return Bi.canRoute(e,t)}};var rr=or;const sr=wi.roles;class ar{constructor(){this.FesApp=this,this.FesApi=Qi,this.FesStorage=Ri,this.FesMap=no,this.FesFesx=so,this.FesUtil=Bi,this.FesEnv=zi,this._roleId=Vo.get("FesRoleId"),this._roleId?rr.set(sr[this._roleId]||["*"]):rr.set(Vo.get("FesAllowPageList")||["*"]),this.router=null,this.beforeRouter=null,this.afterRouter=null,this.i18n=null}init(e){window.Vue=l["default"],l["default"].use(yt),l["default"].use(Kn.a),l["default"].use(Un),l["default"].use(To),l["default"].use(co,this),Object.keys(s).forEach(e=>{l["default"].filter(e,s[e])}),Object.keys(Gn["a"]).forEach(e=>{l["default"].component(e,Gn["a"][e])}),Object.keys(a).forEach(e=>{l["default"].directive(e,a[e])}),wi.fesName&&this.set("FesName",wi.fesName),wi.favicon&&this.setFavicon(wi.favicon),Bi.isFunction(e)&&e.call(this),this.run()}run(){this.creatRouter(),this.creatI18n(),new l["default"]({el:"#app",extends:qo,router:this.router,i18n:this.i18n})}creatI18n(){this.i18n=new Un(wi.i18n),this.setLocale(wi.i18n.locale)}creatRouter(){this.router=new yt({routes:qn["a"],scrollBehavior(e,t,n){return n||{x:0,y:0}}}),this.handleRouter()}handleRouter(){this.router.beforeEach(async(e,t,n)=>{let i;Bi.history.record(e.path),i=1===e.matched.length?e.matched[0].path:e.path;const o=await rr.match(i);o?this.beforeRouter&&Bi.isFunction(this.beforeRouter)?this.beforeRouter(e,t,n):n():(window.Toast.error(Bi.format("fesMessages.noPermission")),t.path?n(!1):n("/"))}),this.router.afterEach(e=>{let t;wi.menu.forEach(n=>{n.path===e.path?t=n.title:n.subMenu&&n.subMenu.length>0&&n.subMenu.forEach(n=>{n.path===e.path&&(t=n.title)})});let n=this.get("FesName");"$i18n."===n.slice(0,6)&&(n=Bi.format(n.slice(6))),document.title=t?`${n} | ${t}`:n,this.afterRouter&&Bi.isFunction(this.afterRouter)&&this.afterRouter(e)}),this.setDefaultPage()}async getDefaultPage(e){if(this.router&&!e){const e=this.router.history.getCurrentLocation(),t=await rr.match(e);if(t)return e}const t=await rr.get();return t.length>0?t[0]:qn["a"][0]}async setDefaultPage(){const e=await this.getDefaultPage(!1);this.router.push(e)}async setRole(e,t=!0,n=!0){if(Vo.get("FesRoleId")!==e)if(sr[e]instanceof Array){if(rr.set(sr[e]),this.set("FesRoleId",e),this.router&&t){const e=await this.getDefaultPage(n);this.router.push(e)}Bi.event.trigger("fes_allowPage_change")}else console.error("rolesConfig配置错误,不存在角色"+e);return this}async setAllowPage(e,t=!0,n=!0){if(e instanceof Array){if(rr.set(e),this.set("FesRoleId",""),this.set("FesAllowPageList",e),this.router&&t){const e=await this.getDefaultPage(n);this.router.push(e)}Bi.event.trigger("fes_allowPage_change")}return this}getAllowPage(){return rr.getSync()}getAllowPageAsync(){return rr.get()}get(e){return Vo.get(e)}set(e,t){return Vo.set(e,t),this}addFilter(e,t){return l["default"].filter(e,t),this}addDirective(e,t){return l["default"].directive(e,t),this}addComponent(e,t){return l["default"].component(e,t),this}addThrid(e,t){return l["default"].use(e,t),this}setBeforeRouter(e){return this.beforeRouter=e,this}setAfterRouter(e){return this.afterRouter=e,this}setFavicon(e){let t=document.querySelector("#favicon");return t?t.href=e:(t=document.createElement("link"),t.id="favicon",t.rel="shortcut icon",t.type="image/png",t.href=e,document.head.appendChild(t)),this}setLocale(e){return this.i18n.locale=e,Kn.a.i18n.setLocale(e),this}}Bi.merge(ar.prototype,Bi.event),ar.prototype.engine="Vue";var ur=new ar;ur.init(u["a"])},5685:function(e,t,n){var i=n("b0d9"),o=n("2d14").entries;i({target:"Object",stat:!0},{entries:function(e){return o(e)}})},"56bb":function(e,t,n){var i=n("6199"),o=n("a126"),r=n("a995"),s=r("species");e.exports=function(e,t){var n;return o(e)&&(n=e.constructor,"function"!=typeof n||n!==Array&&!o(n.prototype)?i(n)&&(n=n[s],null===n&&(n=void 0)):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},"56dc":function(e,t,n){},"56ed":function(e,t,n){e.exports=n("d869")},"56f3":function(e,t,n){},"577c":function(e,t,n){var i=n("6199");e.exports=function(e){if(!i(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},"57e0":function(e,t,n){n("5411");var i=n("36b9");e.exports=i("Array").lastIndexOf},5940:function(e,t,n){e.exports=n("864e")},"5b3f":function(e,t,n){e.exports=n("67e6")},"5bac":function(e,t,n){var i=n("ef97");e.exports=i},"5c63":function(e,t,n){var i=n("d1fd");i("species")},"5ca4":function(e,t,n){"use strict";var i=n("0739"),o=n("062d");e.exports=i?{}.toString:function(){return"[object "+o(this)+"]"}},"5cd2":function(e,t,n){n("6a47");var i=n("36b9");e.exports=i("Array").reduce},"5d70":function(e,t,n){},"5dd6":function(e,t,n){"use strict";var i=n("b0d9"),o=n("040d"),r=n("8870"),s=n("d607"),a=n("6f48"),u=n("56bb"),l=n("cd55"),c=n("dc19"),h=n("6c2a"),d=c("splice"),f=h("splice",{ACCESSORS:!0,0:0,1:2}),p=Math.max,g=Math.min,m=9007199254740991,v="Maximum allowed length exceeded";i({target:"Array",proto:!0,forced:!d||!f},{splice:function(e,t){var n,i,c,h,d,f,_=a(this),y=s(_.length),b=o(e,y),w=arguments.length;if(0===w?n=i=0:1===w?(n=0,i=y-b):(n=w-2,i=g(p(r(t),0),y-b)),y+n-i>m)throw TypeError(v);for(c=u(_,i),h=0;hy-i+n;h--)delete _[h-1]}else if(n>i)for(h=y-i;h>b;h--)d=h+i-1,f=h+n-1,d in _?_[f]=_[d]:delete _[f];for(h=0;h=l?e?"":void 0:(r=a.charCodeAt(u),r<55296||r>56319||u+1===l||(s=a.charCodeAt(u+1))<56320||s>57343?e?a.charAt(u):r:e?a.slice(u,u+2):s-56320+(r-55296<<10)+65536)}};e.exports={codeAt:r(!1),charAt:r(!0)}},"642b":function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,n("47fd"))},6699:function(e,t,n){var i=n("642b");e.exports=function(e,t){var n=i.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},"66a9":function(e,t,n){var i=n("b0d9"),o=n("6f48"),r=n("0217"),s=n("4f4e"),a=s((function(){r(1)}));i({target:"Object",stat:!0,forced:a},{keys:function(e){return r(o(e))}})},"67e6":function(e,t,n){var i=n("8dbe");e.exports=i},6894:function(e,t,n){n("32f7");var i=n("36b9");e.exports=i("String").startsWith},"68d5":function(e,t,n){n("4acc");var i=n("16f8");e.exports=i.Array.isArray},6908:function(e,t,n){var i=n("4cdc");e.exports=i},"699c":function(e,t){},"6a47":function(e,t,n){"use strict";var i=n("b0d9"),o=n("20f2").left,r=n("832c"),s=n("6c2a"),a=n("1bbb"),u=n("0de6"),l=r("reduce"),c=s("reduce",{1:0}),h=!u&&a>79&&a<83;i({target:"Array",proto:!0,forced:!l||!c||h},{reduce:function(e){return o(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},"6a50":function(e,t,n){},"6a55":function(e,t,n){e.exports=n("1c5c")},"6b45":function(e,t,n){"use strict";var i=n("b0d9"),o=n("fc35").filter,r=n("dc19"),s=n("6c2a"),a=r("filter"),u=s("filter");i({target:"Array",proto:!0,forced:!a||!u},{filter:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},"6b79":function(e,t,n){"use strict";var i=n("b0d9"),o=n("fc35").every,r=n("832c"),s=n("6c2a"),a=r("every"),u=s("every");i({target:"Array",proto:!0,forced:!a||!u},{every:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},"6bb6":function(e,t){e.exports={}},"6c2a":function(e,t,n){var i=n("fe9f"),o=n("4f4e"),r=n("161f"),s=Object.defineProperty,a={},u=function(e){throw e};e.exports=function(e,t){if(r(a,e))return a[e];t||(t={});var n=[][e],l=!!r(t,"ACCESSORS")&&t.ACCESSORS,c=r(t,0)?t[0]:u,h=r(t,1)?t[1]:void 0;return a[e]=!!n&&!o((function(){if(l&&!i)return!0;var e={length:-1};l?s(e,1,{enumerable:!0,get:u}):e[1]=1,n.call(e,c,h)}))}},"6d34":function(e,t,n){"use strict";var i=n("b0d9"),o=n("6199"),r=n("a126"),s=n("040d"),a=n("d607"),u=n("ee30"),l=n("cd55"),c=n("a995"),h=n("dc19"),d=n("6c2a"),f=h("slice"),p=d("slice",{ACCESSORS:!0,0:0,1:2}),g=c("species"),m=[].slice,v=Math.max;i({target:"Array",proto:!0,forced:!f||!p},{slice:function(e,t){var n,i,c,h=u(this),d=a(h.length),f=s(e,d),p=s(void 0===t?d:t,d);if(r(h)&&(n=h.constructor,"function"!=typeof n||n!==Array&&!r(n.prototype)?o(n)&&(n=n[g],null===n&&(n=void 0)):n=void 0,n===Array||void 0===n))return m.call(h,f,p);for(i=new(void 0===n?Array:n)(v(p-f,0)),c=0;f1?arguments[1]:void 0)}})},"753e":function(e,t,n){e.exports=n("c242")},7783:function(e,t){e.exports=function(){}},"782d":function(e,t,n){},"7a2c":function(e,t,n){},"7a4f":function(e,t,n){var i=n("fe9f"),o=n("4f4e"),r=n("015f");e.exports=!i&&!o((function(){return 7!=Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))},"7a77":function(e,t,n){"use strict";function i(e){this.message=e}i.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},i.prototype.__CANCEL__=!0,e.exports=i},"7aac":function(e,t,n){"use strict";var i=n("c532");e.exports=i.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,r,s){var a=[];a.push(e+"="+encodeURIComponent(t)),i.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),i.isString(o)&&a.push("path="+o),i.isString(r)&&a.push("domain="+r),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},"7aad":function(e,t,n){},"7bd7":function(e,t,n){var i=n("642b"),o=n("503c");e.exports=function(e,t){try{o(i,e,t)}catch(n){i[e]=t}return t}},"7c09":function(e,t,n){var i=n("b0d9"),o=n("4f4e"),r=n("ee30"),s=n("7e91").f,a=n("fe9f"),u=o((function(){s(1)})),l=!a||u;i({target:"Object",stat:!0,forced:l,sham:!a},{getOwnPropertyDescriptor:function(e,t){return s(r(e),t)}})},"7cc2":function(e,t,n){var i=n("968f");e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(i)},"7e25":function(e,t,n){"use strict";var i,o,r,s,a=n("b0d9"),u=n("f948"),l=n("642b"),c=n("0d98"),h=n("0277"),d=n("8339"),f=n("da33"),p=n("da56"),g=n("4c02"),m=n("6199"),v=n("2afd"),_=n("8f3c"),y=n("e7dd"),b=n("0a7c"),w=n("514a"),C=n("611d"),S=n("7f29").set,x=n("993f"),L=n("4f78"),k=n("6699"),N=n("1e11"),E=n("224f"),O=n("8b1e"),D=n("564b"),I=n("a995"),M=n("0de6"),T=n("1bbb"),P=I("species"),A="Promise",R=O.get,F=O.set,W=O.getterFor(A),V=h,B=l.TypeError,H=l.document,j=l.process,z=c("fetch"),U=N.f,$=U,K=!!(H&&H.createEvent&&l.dispatchEvent),q="function"==typeof PromiseRejectionEvent,G="unhandledrejection",Y="rejectionhandled",Z=0,X=1,J=2,Q=1,ee=2,te=D(A,(function(){var e=y(V)!==String(V);if(!e){if(66===T)return!0;if(!M&&!q)return!0}if(u&&!V.prototype["finally"])return!0;if(T>=51&&/native code/.test(V))return!1;var t=V.resolve(1),n=function(e){e((function(){}),(function(){}))},i=t.constructor={};return i[P]=n,!(t.then((function(){}))instanceof n)})),ne=te||!w((function(e){V.all(e)["catch"]((function(){}))})),ie=function(e){var t;return!(!m(e)||"function"!=typeof(t=e.then))&&t},oe=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;x((function(){var i=e.value,o=e.state==X,r=0;while(n.length>r){var s,a,u,l=n[r++],c=o?l.ok:l.fail,h=l.resolve,d=l.reject,f=l.domain;try{c?(o||(e.rejection===ee&&ue(e),e.rejection=Q),!0===c?s=i:(f&&f.enter(),s=c(i),f&&(f.exit(),u=!0)),s===l.promise?d(B("Promise-chain cycle")):(a=ie(s))?a.call(s,h,d):h(s)):d(i)}catch(p){f&&!u&&f.exit(),d(p)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&se(e)}))}},re=function(e,t,n){var i,o;K?(i=H.createEvent("Event"),i.promise=t,i.reason=n,i.initEvent(e,!1,!0),l.dispatchEvent(i)):i={promise:t,reason:n},!q&&(o=l["on"+e])?o(i):e===G&&k("Unhandled promise rejection",n)},se=function(e){S.call(l,(function(){var t,n=e.facade,i=e.value,o=ae(e);if(o&&(t=E((function(){M?j.emit("unhandledRejection",i,n):re(G,n,i)})),e.rejection=M||ae(e)?ee:Q,t.error))throw t.value}))},ae=function(e){return e.rejection!==Q&&!e.parent},ue=function(e){S.call(l,(function(){var t=e.facade;M?j.emit("rejectionHandled",t):re(Y,t,e.value)}))},le=function(e,t,n){return function(i){e(t,i,n)}},ce=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=J,oe(e,!0))},he=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw B("Promise can't be resolved itself");var i=ie(t);i?x((function(){var n={done:!1};try{i.call(t,le(he,n,e),le(ce,n,e))}catch(o){ce(n,o,e)}})):(e.value=t,e.state=X,oe(e,!1))}catch(o){ce({done:!1},o,e)}}};te&&(V=function(e){_(this,V,A),v(e),i.call(this);var t=R(this);try{e(le(he,t),le(ce,t))}catch(n){ce(t,n)}},i=function(e){F(this,{type:A,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:Z,value:void 0})},i.prototype=f(V.prototype,{then:function(e,t){var n=W(this),i=U(C(this,V));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=M?j.domain:void 0,n.parent=!0,n.reactions.push(i),n.state!=Z&&oe(n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new i,t=R(e);this.promise=e,this.resolve=le(he,t),this.reject=le(ce,t)},N.f=U=function(e){return e===V||e===r?new o(e):$(e)},u||"function"!=typeof h||(s=h.prototype.then,d(h.prototype,"then",(function(e,t){var n=this;return new V((function(e,t){s.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof z&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return L(V,z.apply(l,arguments))}}))),a({global:!0,wrap:!0,forced:te},{Promise:V}),p(V,A,!1,!0),g(A),r=c(A),a({target:A,stat:!0,forced:te},{reject:function(e){var t=U(this);return t.reject.call(void 0,e),t.promise}}),a({target:A,stat:!0,forced:u||te},{resolve:function(e){return L(u&&this===r?V:this,e)}}),a({target:A,stat:!0,forced:ne},{all:function(e){var t=this,n=U(t),i=n.resolve,o=n.reject,r=E((function(){var n=v(t.resolve),r=[],s=0,a=1;b(e,(function(e){var u=s++,l=!1;r.push(void 0),a++,n.call(t,e).then((function(e){l||(l=!0,r[u]=e,--a||i(r))}),o)})),--a||i(r)}));return r.error&&o(r.value),n.promise},race:function(e){var t=this,n=U(t),i=n.reject,o=E((function(){var o=v(t.resolve);b(e,(function(e){o.call(t,e).then(n.resolve,i)}))}));return o.error&&i(o.value),n.promise}})},"7e91":function(e,t,n){var i=n("fe9f"),o=n("8726"),r=n("caad"),s=n("ee30"),a=n("0b0c"),u=n("161f"),l=n("7a4f"),c=Object.getOwnPropertyDescriptor;t.f=i?c:function(e,t){if(e=s(e),t=a(t,!0),l)try{return c(e,t)}catch(n){}if(u(e,t))return r(!o.f.call(e,t),e[t])}},"7f29":function(e,t,n){var i,o,r,s=n("642b"),a=n("4f4e"),u=n("d3c1"),l=n("e186"),c=n("015f"),h=n("7cc2"),d=n("0de6"),f=s.location,p=s.setImmediate,g=s.clearImmediate,m=s.process,v=s.MessageChannel,_=s.Dispatch,y=0,b={},w="onreadystatechange",C=function(e){if(b.hasOwnProperty(e)){var t=b[e];delete b[e],t()}},S=function(e){return function(){C(e)}},x=function(e){C(e.data)},L=function(e){s.postMessage(e+"",f.protocol+"//"+f.host)};p&&g||(p=function(e){var t=[],n=1;while(arguments.length>n)t.push(arguments[n++]);return b[++y]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},i(y),y},g=function(e){delete b[e]},d?i=function(e){m.nextTick(S(e))}:_&&_.now?i=function(e){_.now(S(e))}:v&&!h?(o=new v,r=o.port2,o.port1.onmessage=x,i=u(r.postMessage,r,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts&&f&&"file:"!==f.protocol&&!a(L)?(i=L,s.addEventListener("message",x,!1)):i=w in c("script")?function(e){l.appendChild(c("script"))[w]=function(){l.removeChild(this),C(e)}}:function(e){setTimeout(S(e),0)}),e.exports={set:p,clear:g}},"7fb9":function(e,t,n){var i=n("161f"),o=n("ee30"),r=n("ed3f").indexOf,s=n("4378");e.exports=function(e,t){var n,a=o(e),u=0,l=[];for(n in a)!i(s,n)&&i(a,n)&&l.push(n);while(t.length>u)i(a,n=t[u++])&&(~r(l,n)||l.push(n));return l}},"808e":function(e,t,n){var i=n("9740"),o=String.prototype;e.exports=function(e){var t=e.trim;return"string"===typeof e||e===o||e instanceof String&&t===o.trim?i:t}},"81de":function(e,t,n){"use strict";var i=n("b0d9"),o=n("7e91").f,r=n("d607"),s=n("ffef"),a=n("964c"),u=n("06cb"),l=n("f948"),c="".endsWith,h=Math.min,d=u("endsWith"),f=!l&&!d&&!!function(){var e=o(String.prototype,"endsWith");return e&&!e.writable}();i({target:"String",proto:!0,forced:!f&&!d},{endsWith:function(e){var t=String(a(this));s(e);var n=arguments.length>1?arguments[1]:void 0,i=r(t.length),o=void 0===n?i:h(r(n),i),u=String(e);return c?c.call(t,u,o):t.slice(o-u.length,o)===u}})},8245:function(e,t,n){var i=n("bc9d");e.exports=i},"82f8":function(e,t,n){var i=n("919c");e.exports=i},"832a":function(e,t,n){var i=n("9381"),o=Array.prototype;e.exports=function(e){var t=e.filter;return e===o||e instanceof Array&&t===o.filter?i:t}},"832c":function(e,t,n){"use strict";var i=n("4f4e");e.exports=function(e,t){var n=[][e];return!!n&&i((function(){n.call(null,t||function(){throw 1},1)}))}},8339:function(e,t,n){var i=n("503c");e.exports=function(e,t,n,o){o&&o.enumerable?e[t]=n:i(e,t,n)}},8408:function(e,t,n){var i=n("642b"),o=n("e7dd"),r=i.WeakMap;e.exports="function"===typeof r&&/native code/.test(o(r))},8476:function(e,t,n){var i=n("d1fd");i("split")},8478:function(e,t,n){},8489:function(e,t,n){var i=n("d1fd");i("dispose")},"864e":function(e,t,n){var i=n("a447");e.exports=i},8686:function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},8726:function(e,t,n){"use strict";var i={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,r=o&&!i.call({1:2},1);t.f=r?function(e){var t=o(this,e);return!!t&&t.enumerable}:i},8746:function(e,t,n){e.exports=n("0503")},8781:function(e,t,n){var i=n("c91f");e.exports=i},8870:function(e,t){var n=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:n)(e)}},8899:function(e,t,n){},"8b1e":function(e,t,n){var i,o,r,s=n("8408"),a=n("642b"),u=n("6199"),l=n("503c"),c=n("161f"),h=n("295b"),d=n("9b42"),f=n("4378"),p=a.WeakMap,g=function(e){return r(e)?o(e):i(e,{})},m=function(e){return function(t){var n;if(!u(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}};if(s){var v=h.state||(h.state=new p),_=v.get,y=v.has,b=v.set;i=function(e,t){return t.facade=e,b.call(v,e,t),t},o=function(e){return _.call(v,e)||{}},r=function(e){return y.call(v,e)}}else{var w=d("state");f[w]=!0,i=function(e,t){return t.facade=e,l(e,w,t),t},o=function(e){return c(e,w)?e[w]:{}},r=function(e){return c(e,w)}}e.exports={set:i,get:o,has:r,enforce:g,getterFor:m}},"8bc2":function(e,t,n){"use strict";var i=n("b0d9"),o=n("642b"),r=n("0d98"),s=n("f948"),a=n("fe9f"),u=n("5e1d"),l=n("bb05"),c=n("4f4e"),h=n("161f"),d=n("a126"),f=n("6199"),p=n("545b"),g=n("6f48"),m=n("ee30"),v=n("0b0c"),_=n("caad"),y=n("bef9"),b=n("0217"),w=n("b00b"),C=n("c8c7"),S=n("bd90"),x=n("7e91"),L=n("cb29"),k=n("8726"),N=n("503c"),E=n("8339"),O=n("0686"),D=n("9b42"),I=n("4378"),M=n("cd7c"),T=n("a995"),P=n("0144"),A=n("d1fd"),R=n("da56"),F=n("8b1e"),W=n("fc35").forEach,V=D("hidden"),B="Symbol",H="prototype",j=T("toPrimitive"),z=F.set,U=F.getterFor(B),$=Object[H],K=o.Symbol,q=r("JSON","stringify"),G=x.f,Y=L.f,Z=C.f,X=k.f,J=O("symbols"),Q=O("op-symbols"),ee=O("string-to-symbol-registry"),te=O("symbol-to-string-registry"),ne=O("wks"),ie=o.QObject,oe=!ie||!ie[H]||!ie[H].findChild,re=a&&c((function(){return 7!=y(Y({},"a",{get:function(){return Y(this,"a",{value:7}).a}})).a}))?function(e,t,n){var i=G($,t);i&&delete $[t],Y(e,t,n),i&&e!==$&&Y($,t,i)}:Y,se=function(e,t){var n=J[e]=y(K[H]);return z(n,{type:B,tag:e,description:t}),a||(n.description=t),n},ae=l?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof K},ue=function(e,t,n){e===$&&ue(Q,t,n),p(e);var i=v(t,!0);return p(n),h(J,i)?(n.enumerable?(h(e,V)&&e[V][i]&&(e[V][i]=!1),n=y(n,{enumerable:_(0,!1)})):(h(e,V)||Y(e,V,_(1,{})),e[V][i]=!0),re(e,i,n)):Y(e,i,n)},le=function(e,t){p(e);var n=m(t),i=b(n).concat(pe(n));return W(i,(function(t){a&&!he.call(n,t)||ue(e,t,n[t])})),e},ce=function(e,t){return void 0===t?y(e):le(y(e),t)},he=function(e){var t=v(e,!0),n=X.call(this,t);return!(this===$&&h(J,t)&&!h(Q,t))&&(!(n||!h(this,t)||!h(J,t)||h(this,V)&&this[V][t])||n)},de=function(e,t){var n=m(e),i=v(t,!0);if(n!==$||!h(J,i)||h(Q,i)){var o=G(n,i);return!o||!h(J,i)||h(n,V)&&n[V][i]||(o.enumerable=!0),o}},fe=function(e){var t=Z(m(e)),n=[];return W(t,(function(e){h(J,e)||h(I,e)||n.push(e)})),n},pe=function(e){var t=e===$,n=Z(t?Q:m(e)),i=[];return W(n,(function(e){!h(J,e)||t&&!h($,e)||i.push(J[e])})),i};if(u||(K=function(){if(this instanceof K)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=M(e),n=function(e){this===$&&n.call(Q,e),h(this,V)&&h(this[V],t)&&(this[V][t]=!1),re(this,t,_(1,e))};return a&&oe&&re($,t,{configurable:!0,set:n}),se(t,e)},E(K[H],"toString",(function(){return U(this).tag})),E(K,"withoutSetter",(function(e){return se(M(e),e)})),k.f=he,L.f=ue,x.f=de,w.f=C.f=fe,S.f=pe,P.f=function(e){return se(T(e),e)},a&&(Y(K[H],"description",{configurable:!0,get:function(){return U(this).description}}),s||E($,"propertyIsEnumerable",he,{unsafe:!0}))),i({global:!0,wrap:!0,forced:!u,sham:!u},{Symbol:K}),W(b(ne),(function(e){A(e)})),i({target:B,stat:!0,forced:!u},{for:function(e){var t=String(e);if(h(ee,t))return ee[t];var n=K(t);return ee[t]=n,te[n]=t,n},keyFor:function(e){if(!ae(e))throw TypeError(e+" is not a symbol");if(h(te,e))return te[e]},useSetter:function(){oe=!0},useSimple:function(){oe=!1}}),i({target:"Object",stat:!0,forced:!u,sham:!a},{create:ce,defineProperty:ue,defineProperties:le,getOwnPropertyDescriptor:de}),i({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:fe,getOwnPropertySymbols:pe}),i({target:"Object",stat:!0,forced:c((function(){S.f(1)}))},{getOwnPropertySymbols:function(e){return S.f(g(e))}}),q){var ge=!u||c((function(){var e=K();return"[null]"!=q([e])||"{}"!=q({a:e})||"{}"!=q(Object(e))}));i({target:"JSON",stat:!0,forced:ge},{stringify:function(e,t,n){var i,o=[e],r=1;while(arguments.length>r)o.push(arguments[r++]);if(i=t,(f(t)||void 0!==e)&&!ae(e))return d(t)||(t=function(e,t){if("function"==typeof i&&(t=i.call(this,e,t)),!ae(t))return t}),o[1]=t,q.apply(null,o)}})}K[H][j]||N(K[H],j,K[H].valueOf),R(K,B),I[V]=!0},"8bf4":function(e,t,n){},"8dbe":function(e,t,n){var i=n("5cd2"),o=Array.prototype;e.exports=function(e){var t=e.reduce;return e===o||e instanceof Array&&t===o.reduce?i:t}},"8df4":function(e,t,n){"use strict";var i=n("7a77");function o(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new i(e),t(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e,t=new o((function(t){e=t}));return{token:t,cancel:e}},e.exports=o},"8e16":function(e,t,n){var i=n("1ff4");e.exports=i},"8ea9":function(e,t,n){"use strict";n.r(t),n.d(t,"CancellationTokenSource",(function(){return yD})),n.d(t,"Emitter",(function(){return bD})),n.d(t,"KeyCode",(function(){return wD})),n.d(t,"KeyMod",(function(){return CD})),n.d(t,"Position",(function(){return SD})),n.d(t,"Range",(function(){return xD})),n.d(t,"Selection",(function(){return LD})),n.d(t,"SelectionDirection",(function(){return kD})),n.d(t,"MarkerSeverity",(function(){return ND})),n.d(t,"MarkerTag",(function(){return ED})),n.d(t,"Promise",(function(){return OD})),n.d(t,"Uri",(function(){return DD})),n.d(t,"Token",(function(){return ID})),n.d(t,"editor",(function(){return MD})),n.d(t,"languages",(function(){return TD}));var i=n("54c2"),o=n("30db"),r={};function s(e){var t=e.detail,n=t.id;t.parent?t.handler&&r&&delete r[n]:(r[n]=t,1===Object.keys(r).length&&setTimeout((function(){var e=r;r={},Object.keys(e).forEach((function(t){var n=e[t];n.exception?l(n.exception):n.error&&l(n.error),console.log("WARNING: Promise with no error callback:"+n.id),console.log(n),n.exception&&console.log(n.exception.stack)}))}),0))}i["b"].addEventListener("error",s);var a=function(){function e(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout((function(){if(e.stack)throw new Error(e.message+"\n\n"+e.stack);throw e}),0)}}return e.prototype.emit=function(e){this.listeners.forEach((function(t){t(e)}))},e.prototype.onUnexpectedError=function(e){this.unexpectedErrorHandler(e),this.emit(e)},e.prototype.onUnexpectedExternalError=function(e){this.unexpectedErrorHandler(e)},e}(),u=new a;function l(e){f(e)||u.onUnexpectedError(e)}function c(e){f(e)||u.onUnexpectedExternalError(e)}function h(e){if(e instanceof Error){var t=e.name,n=e.message,i=e.stacktrace||e.stack;return{$isError:!0,name:t,message:n,stack:i}}return e}var d="Canceled";function f(e){return e instanceof Error&&e.name===d&&e.message===d}function p(){var e=new Error(d);return e.name=e.message,e}function g(e){return e?new Error("Illegal argument: "+e):new Error("Illegal argument")}function m(e){return e?new Error("Illegal state: "+e):new Error("Illegal state")}function v(e){var t,n=this,i=!1;return function(){return i||(i=!0,t=e.apply(n,arguments)),t}}function _(e){return"function"===typeof e.dispose&&0===e.dispose.length}function y(e){for(var t=[],n=1;n=n?k:{done:!1,value:e[t++]}}}}function o(t){return t?Array.isArray(t)?e.fromArray(t):t:e.empty()}function r(e,t){return{next:function(){var n=e.next();return n.done?k:{done:!1,value:t(n.value)}}}}function s(e,t){return{next:function(){while(1){var n=e.next();if(n.done)return k;if(t(n.value))return{done:!1,value:n.value}}}}}function a(e,t){for(var n=e.next();!n.done;n=e.next())t(n.value)}function u(e){var t=[];return a(e,(function(e){return t.push(e)})),t}e.empty=n,e.fromArray=i,e.from=o,e.map=r,e.filter=s,e.forEach=a,e.collect=u})(C||(C={}));var N,E=function(){function e(e,t,n,i){void 0===t&&(t=0),void 0===n&&(n=e.length),void 0===i&&(i=t-1),this.items=e,this.start=t,this.end=n,this.index=i}return e.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},e.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},e}(),O=function(e){function t(t,n,i,o){return void 0===n&&(n=0),void 0===i&&(i=t.length),void 0===o&&(o=n-1),e.call(this,t,n,i,o)||this}return L(t,e),t.prototype.current=function(){return e.prototype.current.call(this)},t.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},t.prototype.first=function(){return this.index=this.start,this.current()},t.prototype.last=function(){return this.index=this.end-1,this.current()},t.prototype.parent=function(){return null},t}(E),D=function(){function e(e,t){this.iterator=e,this.fn=t}return e.prototype.next=function(){return this.fn(this.iterator.next())},e}(),I=function(){function e(e){this.element=e}return e}(),M=function(){function e(){}return e.prototype.isEmpty=function(){return!this._first},e.prototype.unshift=function(e){return this.insert(e,!1)},e.prototype.push=function(e){return this.insert(e,!0)},e.prototype.insert=function(e,t){var n=this,i=new I(e);if(this._first)if(t){var o=this._last;this._last=i,i.prev=o,o.next=i}else{var r=this._first;this._first=i,i.next=r,r.prev=i}else this._first=i,this._last=i;return function(){var e=n._first;while(e instanceof I){if(e===i){if(e.prev&&e.next){var t=e.prev;t.next=e.next,e.next.prev=t}else e.prev||e.next?e.next?e.prev||(n._first=n._first.next,n._first.prev=void 0):(n._last=n._last.prev,n._last.next=void 0):(n._first=void 0,n._last=void 0);break}e=e.next}}},e.prototype.iterator=function(){var e,t=this._first;return{next:function(){return t?(e?e.value=t.element:e={done:!1,value:t.element},t=t.next,e):k}}},e}();(function(e){var t={dispose:function(){}};e.None=function(){return t}})(N||(N={}));var T=function(){function e(e){void 0===e&&(e=null),this._options=e,this._event=null,this._disposed=!1,this._deliveryQueue=null,this._listeners=null}return Object.defineProperty(e.prototype,"event",{get:function(){var t=this;return this._event||(this._event=function(n,i,o){t._listeners||(t._listeners=new M);var r=t._listeners.isEmpty();r&&t._options&&t._options.onFirstListenerAdd&&t._options.onFirstListenerAdd(t);var s,a=t._listeners.push(i?[n,i]:n);return r&&t._options&&t._options.onFirstListenerDidAdd&&t._options.onFirstListenerDidAdd(t),t._options&&t._options.onListenerDidAdd&&t._options.onListenerDidAdd(t,n,i),s={dispose:function(){if(s.dispose=e._noop,!t._disposed&&(a(),t._options&&t._options.onLastListenerRemove)){var n=t._listeners&&!t._listeners.isEmpty();n||t._options.onLastListenerRemove(t)}}},Array.isArray(o)&&o.push(s),s}),this._event},enumerable:!0,configurable:!0}),e.prototype.fire=function(e){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=[]);for(var t=this._listeners.iterator(),n=t.next();!n.done;n=t.next())this._deliveryQueue.push([n.value,e]);while(this._deliveryQueue.length>0){var i=this._deliveryQueue.shift(),o=i[0],r=i[1];try{"function"===typeof o?o.call(void 0,r):o[0].call(o[1],r)}catch(n){l(n)}}}},e.prototype.dispose=function(){this._listeners&&(this._listeners=null),this._deliveryQueue&&(this._deliveryQueue.length=0),this._disposed=!0},e._noop=function(){},e}(),P=function(){function e(){var e=this;this.hasListeners=!1,this.events=[],this.emitter=new T({onFirstListenerAdd:function(){return e.onFirstListenerAdd()},onLastListenerRemove:function(){return e.onLastListenerRemove()}})}return Object.defineProperty(e.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this,n={event:e,listener:null};this.events.push(n),this.hasListeners&&this.hook(n);var i=function(){t.hasListeners&&t.unhook(n);var e=t.events.indexOf(n);t.events.splice(e,1)};return w(v(i))},e.prototype.onFirstListenerAdd=function(){var e=this;this.hasListeners=!0,this.events.forEach((function(t){return e.hook(t)}))},e.prototype.onLastListenerRemove=function(){var e=this;this.hasListeners=!1,this.events.forEach((function(t){return e.unhook(t)}))},e.prototype.hook=function(e){var t=this;e.listener=e.event((function(e){return t.emitter.fire(e)}))},e.prototype.unhook=function(e){e.listener&&e.listener.dispose(),e.listener=null},e.prototype.dispose=function(){this.emitter.dispose()},e}();function A(e){return function(t,n,i){void 0===n&&(n=null);var o=!1,r=e((function(e){if(!o)return r?r.dispose():o=!0,t.call(n,e)}),null,i);return o&&r.dispose(),r}}function R(){for(var e=[],t=0;t1)&&u.fire(e),a=0}),n)}))},onLastListenerRemove:function(){o.dispose()}});return u.event}var W=function(){function e(){this.buffers=[]}return e.prototype.wrapEvent=function(e){var t=this;return function(n,i,o){return e((function(e){var o=t.buffers[t.buffers.length-1];o?o.push((function(){return n.call(i,e)})):n.call(i,e)}),void 0,o)}},e.prototype.bufferEvents=function(e){var t=[];this.buffers.push(t);var n=e();return this.buffers.pop(),t.forEach((function(e){return e()})),n},e}();function V(e,t){return function(n,i,o){return void 0===i&&(i=null),e((function(e){return n.call(i,t(e))}),null,o)}}function B(e,t){return function(n,i,o){return void 0===i&&(i=null),e((function(e){return t(e)&&n.call(i,e)}),null,o)}}var H=function(){function e(e){this._event=e}return Object.defineProperty(e.prototype,"event",{get:function(){return this._event},enumerable:!0,configurable:!0}),e.prototype.map=function(t){return new e(V(this._event,t))},e.prototype.filter=function(t){return new e(B(this._event,t))},e.prototype.on=function(e,t,n){return this._event(e,t,n)},e}();function j(e){return new H(e)}var z,U=function(){function e(){var e=this;this.listening=!1,this.inputEvent=N.None,this.inputEventListener=S.None,this.emitter=new T({onFirstListenerDidAdd:function(){e.listening=!0,e.inputEventListener=e.inputEvent(e.emitter.fire,e.emitter)},onLastListenerRemove:function(){e.listening=!1,e.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(e.prototype,"input",{set:function(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},e}(),$=Object.freeze((function(e,t){var n=setTimeout(e.bind(t),0);return{dispose:function(){clearTimeout(n)}}}));(function(e){function t(t){return t===e.None||t===e.Cancelled||(t instanceof K||!(!t||"object"!==typeof t)&&("boolean"===typeof t.isCancellationRequested&&"function"===typeof t.onCancellationRequested))}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:N.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:$})})(z||(z={}));var K=function(){function e(){this._isCancelled=!1,this._emitter=null}return e.prototype.cancel=function(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))},Object.defineProperty(e.prototype,"isCancellationRequested",{get:function(){return this._isCancelled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onCancellationRequested",{get:function(){return this._isCancelled?$:(this._emitter||(this._emitter=new T),this._emitter.event)},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._emitter&&(this._emitter.dispose(),this._emitter=null)},e}(),q=function(){function e(){}return Object.defineProperty(e.prototype,"token",{get:function(){return this._token||(this._token=new K),this._token},enumerable:!0,configurable:!0}),e.prototype.cancel=function(){this._token?this._token instanceof K&&this._token.cancel():this._token=z.Cancelled},e.prototype.dispose=function(){this._token?this._token instanceof K&&this._token.dispose():this._token=z.None},e}(),G=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function Y(e){return e&&"function"===typeof e.then}function Z(e){var t=new q,n=e(t.token),i=new Promise((function(e,i){t.token.onCancellationRequested((function(){i(p())})),Promise.resolve(n).then((function(n){t.dispose(),e(n)}),(function(e){t.dispose(),i(e)}))}));return new(function(){function e(){}return e.prototype.cancel=function(){t.cancel()},e.prototype.then=function(e,t){return i.then(e,t)},e.prototype.catch=function(e){return this.then(void 0,e)},e}())}var X=function(){function e(e){this.defaultDelay=e,this.timeout=null,this.completionPromise=null,this.doResolve=null,this.task=null}return e.prototype.trigger=function(e,t){var n=this;return void 0===t&&(t=this.defaultDelay),this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new i["b"]((function(e,t){n.doResolve=e,n.doReject=t})).then((function(){n.completionPromise=null,n.doResolve=null;var e=n.task;return n.task=null,e()}))),this.timeout=setTimeout((function(){n.timeout=null,n.doResolve(null)}),t),this.completionPromise},e.prototype.cancel=function(){this.cancelTimeout(),this.completionPromise&&(this.doReject(p()),this.completionPromise=null)},e.prototype.cancelTimeout=function(){null!==this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},e.prototype.dispose=function(){this.cancelTimeout()},e}();function J(e,t){return t?new Promise((function(n,i){var o=setTimeout(n,e);t.onCancellationRequested((function(){clearTimeout(o),i(p())}))})):Z((function(t){return J(e,t)}))}function Q(e,t){function n(){try{t()}catch(e){l(e)}}return e.then((function(e){return n()}),(function(e){return n()})),Promise.resolve(e)}function ee(e,t,n){void 0===t&&(t=function(e){return!!e}),void 0===n&&(n=null);var i=0,o=e.length,r=function(){if(i>=o)return Promise.resolve(n);var s=e[i++],a=Promise.resolve(s());return a.then((function(e){return t(e)?Promise.resolve(e):r()}))};return r()}var te,ne=function(e){function t(t,n){var i=e.call(this)||this;return i._token=-1,"function"===typeof t&&"number"===typeof n&&i.setIfNotSet(t,n),i}return G(t,e),t.prototype.dispose=function(){this.cancel(),e.prototype.dispose.call(this)},t.prototype.cancel=function(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)},t.prototype.cancelAndSet=function(e,t){var n=this;this.cancel(),this._token=setTimeout((function(){n._token=-1,e()}),t)},t.prototype.setIfNotSet=function(e,t){var n=this;-1===this._token&&(this._token=setTimeout((function(){n._token=-1,e()}),t))},t}(S),ie=function(e){function t(){var t=e.call(this)||this;return t._token=-1,t}return G(t,e),t.prototype.dispose=function(){this.cancel(),e.prototype.dispose.call(this)},t.prototype.cancel=function(){-1!==this._token&&(clearInterval(this._token),this._token=-1)},t.prototype.cancelAndSet=function(e,t){this.cancel(),this._token=setInterval((function(){e()}),t)},t}(S),oe=function(){function e(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}return e.prototype.dispose=function(){this.cancel(),this.runner=null},e.prototype.cancel=function(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)},e.prototype.schedule=function(e){void 0===e&&(e=this.timeout),this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)},e.prototype.isScheduled=function(){return-1!==this.timeoutToken},e.prototype.onTimeout=function(){this.timeoutToken=-1,this.runner&&this.doRun()},e.prototype.doRun=function(){this.runner&&this.runner()},e}();(function(){if("function"!==typeof requestIdleCallback||"function"!==typeof cancelIdleCallback){var e=Object.freeze({didTimeout:!0,timeRemaining:function(){return 15}});te=function(t,n){void 0===n&&(n=0);var i=setTimeout((function(){return t(e)}),n),o=!1;return{dispose:function(){o||(o=!0,clearTimeout(i))}}}}else te=function(e,t){var n=requestIdleCallback(e,"number"===typeof t?{timeout:t}:void 0),i=!1;return{dispose:function(){i||(i=!0,cancelIdleCallback(n))}}}})();var re=function(){function e(e){var t=this;this._executor=function(){try{t._value=e()}catch(n){t._error=n}finally{t._didRun=!0}},this._handle=te((function(){return t._executor()}))}return e.prototype.dispose=function(){this._handle.dispose()},e.prototype.getValue=function(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value},e}();function se(e){return Y(e)&&"function"===typeof e.done}var ae=function(){function e(e){se(e)?this._winjsPromise=e:this._winjsPromise=new i["a"]((function(t,n){var i=!0;e((function(e){i?o["h"]((function(){return t(e)})):t(e)}),(function(e){i?o["h"]((function(){return n(e)})):n(e)})),i=!1}))}return e.all=function(t){return new e(i["a"].join(t).then(null,(function(e){for(var t in e)if(e.hasOwnProperty(t))return e[t]})))},e.race=function(t){return new e(i["a"].any(t).then((function(e){return e.value}),(function(e){return e.value})))},e.resolve=function(t){return new e(i["a"].wrap(t))},e.reject=function(t){return new e(i["a"].wrapError(t))},e.prototype.then=function(t,n){var r=!0,s=new e(this._winjsPromise.then(t&&function(e){return r?new i["a"]((function(n,i){o["h"]((function(){var o;try{o=t(e)}catch(r){return void i(r)}n(o)}))})):t(e)},n&&function(e){return r?new i["a"]((function(t,i){o["h"]((function(){var o;try{o=n(e)}catch(r){return void i(r)}t(o)}))})):n(e)}));return r=!1,s},e.prototype.catch=function(e){return this.then(null,e)},e}();function ue(e,t){var n;return n=0===t.length?e:e.replace(/\{(\d+)\}/g,(function(e,n){var i=n[0];return"undefined"!==typeof t[i]?t[i]:e})),n}function le(e,t){for(var n=[],i=2;i0))return r;o=r-1}}return-(i+1)}function fe(e,t){var n=0,i=e.length;if(0===i)return 0;while(ni?e[u]=r[a++]:a>o?e[u]=r[s++]:t(r[a],r[s])<0?e[u]=r[a++]:e[u]=r[s++]}function me(e,t,n,i,o){if(!(i<=n)){var r=n+(i-n)/2|0;me(e,t,n,r,o),me(e,t,r+1,i,o),t(e[r],e[r+1])<=0||ge(e,t,n,r,i,o)}}function ve(e,t){for(var n=[],i=void 0,o=0,r=pe(e.slice(0),t);ot;o--)i.push(o);return i}function Le(e,t,n){var i=e.slice(0,t),o=e.slice(t);return i.concat(n,o)}var ke={number:"number",string:"string",undefined:"undefined",object:"object",function:"function"};function Ne(e){return Array.isArray?Array.isArray(e):!(!e||typeof e.length!==ke.number||e.constructor!==Array)}function Ee(e){return typeof e===ke.string||e instanceof String}function Oe(e){return typeof e===ke.object&&null!==e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function De(e){return(typeof e===ke.number||e instanceof Number)&&!isNaN(e)}function Ie(e){return!0===e||!1===e}function Me(e){return typeof e===ke.undefined}function Te(e){return Me(e)||null===e}var Pe=Object.prototype.hasOwnProperty;function Ae(e){if(!Oe(e))return!1;for(var t in e)if(Pe.call(e,t))return!1;return!0}function Re(e){return typeof e===ke.function}function Fe(e,t){for(var n=Math.min(e.length,t.length),i=0;i0){var n=t.shift();for(var i in Object.freeze(n),n)if(je.call(n,i)){var o=n[i];"object"!==typeof o||Object.isFrozen(o)||t.push(o)}}return e}var je=Object.prototype.hasOwnProperty;function ze(e,t,n){return void 0===n&&(n=!0),Oe(e)?(Oe(t)&&Object.keys(t).forEach((function(i){i in e?n&&(Oe(e[i])&&Oe(t[i])?ze(e[i],t[i],n):e[i]=t[i]):e[i]=t[i]})),e):t}function Ue(e){for(var t=[],n=1;n/?";function Ze(e){void 0===e&&(e="");for(var t="(-?\\d*\\.\\d\\w*)|([^",n=0;n=0||(t+="\\"+Ye[n]);return t+="\\s]+)",new RegExp(t,"g")}var Xe=Ze();function Je(e){var t=Xe;if(e&&e instanceof RegExp)if(e.global)t=e;else{var n="g";e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),t=new RegExp(e.source,n)}return t.lastIndex=0,t}function Qe(e,t,n,i){var o,r=e-1-i,s=n.lastIndexOf(" ",r-1)+1,a=n.indexOf(" ",r);-1===a&&(a=n.length),t.lastIndex=s;while(o=t.exec(n)){var u=o.index||0;if(u<=r&&t.lastIndex>=r)return{word:o[0],startColumn:i+1+u,endColumn:i+1+t.lastIndex}}return null}function et(e,t,n,i){var o,r=e-1-i;t.lastIndex=0;while(o=t.exec(n)){var s=o.index||0;if(s>r)return null;if(t.lastIndex>=r)return{word:o[0],startColumn:i+1+s,endColumn:i+1+t.lastIndex}}return null}function tt(e,t,n,i){t.lastIndex=0;var o=t.exec(n);if(!o)return null;var r=o[0].indexOf(" ")>=0?et(e,t,n,i):Qe(e,t,n,i);return t.lastIndex=0,r}var nt,it=function(){return it=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=2?(S=v?2:4,M=2/y):(S=v?1:3,M=1/y),L=Math.max(0,Math.floor((I-h-2)*M/(l+M)));var T=L/M;T>_&&(L=Math.floor(_*M)),k=I-L,"left"===m?(x=0,N+=L,E+=L,O+=L,D+=L):x=t-L-h}else x=0,L=0,S=0,k=I;var P=Math.max(1,Math.floor((k-h-2)/l)),A=d?f:0;return{width:t,height:n,glyphMarginLeft:N,glyphMarginWidth:C,glyphMarginHeight:n,lineNumbersLeft:E,lineNumbersWidth:b,lineNumbersHeight:n,decorationsLeft:O,decorationsWidth:u,decorationsHeight:n,contentLeft:D,contentWidth:k,contentHeight:n,renderMinimap:S,minimapLeft:x,minimapWidth:L,viewportColumn:P,verticalScrollbarWidth:h,horizontalScrollbarHeight:p,overviewRuler:{top:A,width:h,height:n-2*A,right:0}}},e}(),wt="Consolas, 'Courier New', monospace",Ct="Menlo, Monaco, 'Courier New', monospace",St="'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",xt={fontFamily:o["d"]?Ct:o["c"]?St:wt,fontWeight:"normal",fontSize:o["d"]?12:14,lineHeight:0,letterSpacing:0},Lt={tabSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0},kt={inDiffEditor:!1,wordSeparators:Ye,lineNumbersMinChars:5,lineDecorationsWidth:10,readOnly:!1,mouseStyle:"text",disableLayerHinting:!1,automaticLayout:!1,wordWrap:"off",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:1,wordWrapBreakBeforeCharacters:"([{‘“〈《「『【〔([{「£¥$£¥++",wordWrapBreakAfterCharacters:" \t})]?|&,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」",wordWrapBreakObtrusiveCharacters:".",autoClosingBrackets:"languageDefined",autoClosingQuotes:"languageDefined",autoSurround:"languageDefined",autoIndent:!0,dragAndDrop:!0,emptySelectionClipboard:!0,copyWithSyntaxHighlighting:!0,useTabStops:!0,multiCursorModifier:"altKey",multiCursorMergeOverlapping:!0,accessibilitySupport:"auto",showUnused:!0,viewInfo:{extraEditorClassName:"",disableMonospaceOptimizations:!1,rulers:[],ariaLabel:le("editorViewAccessibleLabel","Editor content"),renderLineNumbers:1,renderCustomLineNumbers:null,selectOnLineNumbers:!0,glyphMargin:!0,revealHorizontalRightPadding:30,roundedSelection:!0,overviewRulerLanes:2,overviewRulerBorder:!0,cursorBlinking:1,mouseWheelZoom:!1,cursorStyle:nt.Line,cursorWidth:0,hideCursorInOverviewRuler:!1,scrollBeyondLastLine:!0,scrollBeyondLastColumn:5,smoothScrolling:!1,stopRenderingLineAfter:1e4,renderWhitespace:"none",renderControlCharacters:!1,fontLigatures:!1,renderIndentGuides:!0,highlightActiveIndentGuide:!0,renderLineHighlight:"line",scrollbar:{vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:10,horizontalSliderSize:10,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,mouseWheelScrollSensitivity:1},minimap:{enabled:!0,side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120},fixedOverflowWidgets:!1},contribInfo:{selectionClipboard:!0,hover:{enabled:!0,delay:300,sticky:!0},links:!0,contextmenu:!0,quickSuggestions:{other:!0,comments:!1,strings:!1},quickSuggestionsDelay:10,parameterHints:{enabled:!0,cycle:!1},iconsInSuggestions:!0,formatOnType:!1,formatOnPaste:!1,suggestOnTriggerCharacters:!0,acceptSuggestionOnEnter:"on",acceptSuggestionOnCommitCharacter:!0,wordBasedSuggestions:!0,suggestSelection:"recentlyUsed",suggestFontSize:0,suggestLineHeight:0,tabCompletion:"off",suggest:{filterGraceful:!0,snippets:"inline",snippetsPreventQuickSuggestions:!0,localityBonus:!1},selectionHighlight:!0,occurrencesHighlight:!0,codeLens:!0,folding:!0,foldingStrategy:"auto",showFoldingControls:"mouseover",matchBrackets:!0,find:{seedSearchStringFromSelection:!0,autoFindInSelection:!1,globalFindClipboard:!1},colorDecorators:!0,lightbulbEnabled:!0,codeActionsOnSave:{},codeActionsOnSaveTimeout:750}},Nt=function(){function e(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}return e.prototype.define=function(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e},e.prototype.keyCodeToStr=function(e){return this._keyCodeToStr[e]},e.prototype.strToKeyCode=function(e){return this._strToKeyCode[e.toLowerCase()]||0},e}(),Et=new Nt,Ot=new Nt,Dt=new Nt;function It(e,t){var n=(65535&t)<<16>>>0;return(e|n)>>>0}function Mt(e,t){if(0===e)return null;var n=(65535&e)>>>0,i=(4294901760&e)>>>16;return 0!==i?new Rt(Tt(n,t),Tt(i,t)):Tt(n,t)}function Tt(e,t){var n=!!(2048&e),i=!!(256&e),o=2===t?i:n,r=!!(1024&e),s=!!(512&e),a=2===t?n:i,u=255&e;return new At(o,r,s,a,u)}(function(){function e(e,t,n,i){void 0===n&&(n=t),void 0===i&&(i=n),Et.define(e,t),Ot.define(e,n),Dt.define(e,i)}e(0,"unknown"),e(1,"Backspace"),e(2,"Tab"),e(3,"Enter"),e(4,"Shift"),e(5,"Ctrl"),e(6,"Alt"),e(7,"PauseBreak"),e(8,"CapsLock"),e(9,"Escape"),e(10,"Space"),e(11,"PageUp"),e(12,"PageDown"),e(13,"End"),e(14,"Home"),e(15,"LeftArrow","Left"),e(16,"UpArrow","Up"),e(17,"RightArrow","Right"),e(18,"DownArrow","Down"),e(19,"Insert"),e(20,"Delete"),e(21,"0"),e(22,"1"),e(23,"2"),e(24,"3"),e(25,"4"),e(26,"5"),e(27,"6"),e(28,"7"),e(29,"8"),e(30,"9"),e(31,"A"),e(32,"B"),e(33,"C"),e(34,"D"),e(35,"E"),e(36,"F"),e(37,"G"),e(38,"H"),e(39,"I"),e(40,"J"),e(41,"K"),e(42,"L"),e(43,"M"),e(44,"N"),e(45,"O"),e(46,"P"),e(47,"Q"),e(48,"R"),e(49,"S"),e(50,"T"),e(51,"U"),e(52,"V"),e(53,"W"),e(54,"X"),e(55,"Y"),e(56,"Z"),e(57,"Meta"),e(58,"ContextMenu"),e(59,"F1"),e(60,"F2"),e(61,"F3"),e(62,"F4"),e(63,"F5"),e(64,"F6"),e(65,"F7"),e(66,"F8"),e(67,"F9"),e(68,"F10"),e(69,"F11"),e(70,"F12"),e(71,"F13"),e(72,"F14"),e(73,"F15"),e(74,"F16"),e(75,"F17"),e(76,"F18"),e(77,"F19"),e(78,"NumLock"),e(79,"ScrollLock"),e(80,";",";","OEM_1"),e(81,"=","=","OEM_PLUS"),e(82,",",",","OEM_COMMA"),e(83,"-","-","OEM_MINUS"),e(84,".",".","OEM_PERIOD"),e(85,"/","/","OEM_2"),e(86,"`","`","OEM_3"),e(110,"ABNT_C1"),e(111,"ABNT_C2"),e(87,"[","[","OEM_4"),e(88,"\\","\\","OEM_5"),e(89,"]","]","OEM_6"),e(90,"'","'","OEM_7"),e(91,"OEM_8"),e(92,"OEM_102"),e(93,"NumPad0"),e(94,"NumPad1"),e(95,"NumPad2"),e(96,"NumPad3"),e(97,"NumPad4"),e(98,"NumPad5"),e(99,"NumPad6"),e(100,"NumPad7"),e(101,"NumPad8"),e(102,"NumPad9"),e(103,"NumPad_Multiply"),e(104,"NumPad_Add"),e(105,"NumPad_Separator"),e(106,"NumPad_Subtract"),e(107,"NumPad_Decimal"),e(108,"NumPad_Divide")})(),function(e){function t(e){return Et.keyCodeToStr(e)}function n(e){return Et.strToKeyCode(e)}function i(e){return Ot.keyCodeToStr(e)}function o(e){return Dt.keyCodeToStr(e)}function r(e){return Ot.strToKeyCode(e)||Dt.strToKeyCode(e)}e.toString=t,e.fromString=n,e.toUserSettingsUS=i,e.toUserSettingsGeneral=o,e.fromUserSettings=r}(vt||(vt={}));var Pt,At=function(){function e(e,t,n,i,o){this.type=1,this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=i,this.keyCode=o}return e.prototype.equals=function(e){return 1===e.type&&(this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode)},e.prototype.isModifierKey=function(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode},e.prototype.isDuplicateModifierCase=function(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode},e}(),Rt=function(){function e(e,t){this.type=2,this.firstPart=e,this.chordPart=t}return e}(),Ft=function(){function e(e,t,n,i,o,r){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=i,this.keyLabel=o,this.keyAriaLabel=r}return e}(),Wt=function(){function e(){}return e}(),Vt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Bt=/^\w[\w\d+.-]*$/,Ht=/^\//,jt=/^\/\//,zt=!0;function Ut(e){if(!e.scheme){if(zt)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}');console.warn('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}')}if(e.scheme&&!Bt.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!Ht.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(jt.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}function $t(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==qt&&(t=qt+t):t=qt;break}return t}var Kt="",qt="/",Gt=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,Yt=function(){function e(e,t,n,i,o){"object"===typeof e?(this.scheme=e.scheme||Kt,this.authority=e.authority||Kt,this.path=e.path||Kt,this.query=e.query||Kt,this.fragment=e.fragment||Kt):(this.scheme=e||Kt,this.authority=t||Kt,this.path=$t(this.scheme,n||Kt),this.query=i||Kt,this.fragment=o||Kt,Ut(this))}return e.isUri=function(t){return t instanceof e||!!t&&("string"===typeof t.authority&&"string"===typeof t.fragment&&"string"===typeof t.path&&"string"===typeof t.query&&"string"===typeof t.scheme)},Object.defineProperty(e.prototype,"fsPath",{get:function(){return en(this)},enumerable:!0,configurable:!0}),e.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,i=e.path,o=e.query,r=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=Kt),void 0===n?n=this.authority:null===n&&(n=Kt),void 0===i?i=this.path:null===i&&(i=Kt),void 0===o?o=this.query:null===o&&(o=Kt),void 0===r?r=this.fragment:null===r&&(r=Kt),t===this.scheme&&n===this.authority&&i===this.path&&o===this.query&&r===this.fragment?this:new Zt(t,n,i,o,r)},e.parse=function(e){var t=Gt.exec(e);return t?new Zt(t[2]||Kt,decodeURIComponent(t[4]||Kt),decodeURIComponent(t[5]||Kt),decodeURIComponent(t[7]||Kt),decodeURIComponent(t[9]||Kt)):new Zt(Kt,Kt,Kt,Kt,Kt)},e.file=function(e){var t=Kt;if(o["g"]&&(e=e.replace(/\\/g,qt)),e[0]===qt&&e[1]===qt){var n=e.indexOf(qt,2);-1===n?(t=e.substring(2),e=qt):(t=e.substring(2,n),e=e.substring(n)||qt)}return new Zt("file",t,e,Kt,Kt)},e.from=function(e){return new Zt(e.scheme,e.authority,e.path,e.query,e.fragment)},e.prototype.toString=function(e){return void 0===e&&(e=!1),tn(this,e)},e.prototype.toJSON=function(){return this},e.revive=function(t){if(t){if(t instanceof e)return t;var n=new Zt(t);return n._fsPath=t.fsPath,n._formatted=t.external,n}return t},e}(),Zt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return Vt(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=en(this)),this._fsPath},enumerable:!0,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?tn(this,!0):(this._formatted||(this._formatted=tn(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(Yt),Xt=(Pt={},Pt[58]="%3A",Pt[47]="%2F",Pt[63]="%3F",Pt[35]="%23",Pt[91]="%5B",Pt[93]="%5D",Pt[64]="%40",Pt[33]="%21",Pt[36]="%24",Pt[38]="%26",Pt[39]="%27",Pt[40]="%28",Pt[41]="%29",Pt[42]="%2A",Pt[43]="%2B",Pt[44]="%2C",Pt[59]="%3B",Pt[61]="%3D",Pt[32]="%20",Pt);function Jt(e,t){for(var n=void 0,i=-1,o=0;o=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||45===r||46===r||95===r||126===r||t&&47===r)-1!==i&&(n+=encodeURIComponent(e.substring(i,o)),i=-1),void 0!==n&&(n+=e.charAt(o));else{void 0===n&&(n=e.substr(0,o));var s=Xt[r];void 0!==s?(-1!==i&&(n+=encodeURIComponent(e.substring(i,o)),i=-1),n+=s):-1===i&&(i=o)}}return-1!==i&&(n+=encodeURIComponent(e.substring(i))),void 0!==n?n:e}function Qt(e){for(var t=void 0,n=0;n1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?e.path[1].toLowerCase()+e.path.substr(2):e.path,o["g"]&&(t=t.replace(/\//g,"\\")),t}function tn(e,t){var n=t?Qt:Jt,i="",o=e.scheme,r=e.authority,s=e.path,a=e.query,u=e.fragment;if(o&&(i+=o,i+=":"),(r||"file"===o)&&(i+=qt,i+=qt),r){var l=r.indexOf("@");if(-1!==l){var c=r.substr(0,l);r=r.substr(l+1),l=c.indexOf(":"),-1===l?i+=n(c,!1):(i+=n(c.substr(0,l),!1),i+=":",i+=n(c.substr(l+1),!1)),i+="@"}r=r.toLowerCase(),l=r.indexOf(":"),-1===l?i+=n(r,!1):(i+=n(r.substr(0,l),!1),i+=r.substr(l))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2)){var h=s.charCodeAt(1);h>=65&&h<=90&&(s="/"+String.fromCharCode(h+32)+":"+s.substr(3))}else if(s.length>=2&&58===s.charCodeAt(1)){h=s.charCodeAt(0);h>=65&&h<=90&&(s=String.fromCharCode(h+32)+":"+s.substr(2))}i+=n(s,!0)}return a&&(i+="?",i+=n(a,!1)),u&&(i+="#",i+=t?u:Jt(u,!1)),i}var nn,on,rn,sn,an,un,ln,cn,hn,dn,fn,pn,gn,mn,vn,_n,yn,bn,wn,Cn,Sn,xn,Ln,kn,Nn,En,On,Dn=function(){function e(e,t){this.lineNumber=e,this.column=t}return e.prototype.with=function(t,n){return void 0===t&&(t=this.lineNumber),void 0===n&&(n=this.column),t===this.lineNumber&&n===this.column?this:new e(t,n)},e.prototype.delta=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=0),this.with(this.lineNumber+e,this.column+t)},e.prototype.equals=function(t){return e.equals(this,t)},e.equals=function(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column},e.prototype.isBefore=function(t){return e.isBefore(this,t)},e.isBefore=function(e,t){return e.lineNumbern||e===n&&t>i?(this.startLineNumber=n,this.startColumn=i,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=i)}return e.prototype.isEmpty=function(){return e.isEmpty(this)},e.isEmpty=function(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn},e.prototype.containsPosition=function(t){return e.containsPosition(this,t)},e.containsPosition=function(e,t){return!(t.lineNumbere.endLineNumber)&&(!(t.lineNumber===e.startLineNumber&&t.columne.endColumn))},e.prototype.containsRange=function(t){return e.containsRange(this,t)},e.containsRange=function(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)))},e.prototype.plusRange=function(t){return e.plusRange(this,t)},e.plusRange=function(t,n){var i,o,r,s;return n.startLineNumbert.endLineNumber?(r=n.endLineNumber,s=n.endColumn):n.endLineNumber===t.endLineNumber?(r=n.endLineNumber,s=Math.max(n.endColumn,t.endColumn)):(r=t.endLineNumber,s=t.endColumn),new e(i,o,r,s)},e.prototype.intersectRanges=function(t){return e.intersectRanges(this,t)},e.intersectRanges=function(t,n){var i=t.startLineNumber,o=t.startColumn,r=t.endLineNumber,s=t.endColumn,a=n.startLineNumber,u=n.startColumn,l=n.endLineNumber,c=n.endColumn;return il?(r=l,s=c):r===l&&(s=Math.min(s,c)),i>r||i===r&&o>s?null:new e(i,o,r,s)},e.prototype.equalsRange=function(t){return e.equalsRange(this,t)},e.equalsRange=function(e,t){return!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn},e.prototype.getEndPosition=function(){return new Dn(this.endLineNumber,this.endColumn)},e.prototype.getStartPosition=function(){return new Dn(this.startLineNumber,this.startColumn)},e.prototype.toString=function(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"},e.prototype.setEndPosition=function(t,n){return new e(this.startLineNumber,this.startColumn,t,n)},e.prototype.setStartPosition=function(t,n){return new e(t,n,this.endLineNumber,this.endColumn)},e.prototype.collapseToStart=function(){return e.collapseToStart(this)},e.collapseToStart=function(t){return new e(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)},e.fromPositions=function(t,n){return void 0===n&&(n=t),new e(t.lineNumber,t.column,n.lineNumber,n.column)},e.lift=function(t){return t?new e(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):null},e.isIRange=function(e){return e&&"number"===typeof e.startLineNumber&&"number"===typeof e.startColumn&&"number"===typeof e.endLineNumber&&"number"===typeof e.endColumn},e.areIntersectingOrTouching=function(e,t){return!(e.endLineNumbere.startLineNumber},e}(),Mn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Tn=function(e){function t(t,n,i,o){var r=e.call(this,t,n,i,o)||this;return r.selectionStartLineNumber=t,r.selectionStartColumn=n,r.positionLineNumber=i,r.positionColumn=o,r}return Mn(t,e),t.prototype.clone=function(){return new t(this.selectionStartLineNumber,this.selectionStartColumn,this.positionLineNumber,this.positionColumn)},t.prototype.toString=function(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"},t.prototype.equalsSelection=function(e){return t.selectionsEqual(this,e)},t.selectionsEqual=function(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn},t.prototype.getDirection=function(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1},t.prototype.setEndPosition=function(e,n){return 0===this.getDirection()?new t(this.startLineNumber,this.startColumn,e,n):new t(e,n,this.startLineNumber,this.startColumn)},t.prototype.getPosition=function(){return new Dn(this.positionLineNumber,this.positionColumn)},t.prototype.setStartPosition=function(e,n){return 0===this.getDirection()?new t(e,n,this.endLineNumber,this.endColumn):new t(this.endLineNumber,this.endColumn,e,n)},t.fromPositions=function(e,n){return void 0===n&&(n=e),new t(e.lineNumber,e.column,n.lineNumber,n.column)},t.liftSelection=function(e){return new t(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)},t.selectionsArrEqual=function(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(var n=0,i=e.length;n=0,ei=Jn.indexOf("Edge/")>=0,ti=Qn||ei,ni=Jn.indexOf("Firefox")>=0,ii=Jn.indexOf("AppleWebKit")>=0,oi=Jn.indexOf("Chrome")>=0,ri=-1===Jn.indexOf("Chrome")&&Jn.indexOf("Safari")>=0,si=Jn.indexOf("iPad")>=0,ai=ei&&Jn.indexOf("WebView/")>=0;function ui(){if(Qn)return!1;if(ei){var e=Jn.indexOf("Edge/"),t=parseInt(Jn.substring(e+5,Jn.indexOf(".",e)),10);if(!t||t>=12&&t<=16)return!1}return!0}var li=function(e,t,n){var i=function(e){return o.fire(e)},o=new T({onFirstListenerAdd:function(){e.addEventListener(t,i,n)},onLastListenerRemove:function(){e.removeEventListener(t,i,n)}});return o.event};function ci(e){return V(e,(function(e){return e.preventDefault(),e.stopPropagation(),e}))}var hi=new Array(230),di=new Array(112);function fi(e){if(e.charCode){var t=String.fromCharCode(e.charCode).toUpperCase();return vt.fromString(t)}return hi[e.keyCode]||0}(function(){for(var e=0;e=0){if(r=s+o,(0===s||32===n.charCodeAt(s-1))&&32===n.charCodeAt(r))return this._lastStart=s,void(this._lastEnd=r+1);if(s>0&&32===n.charCodeAt(s-1)&&r===i)return this._lastStart=s-1,void(this._lastEnd=r);if(0===s&&r===i)return this._lastStart=0,void(this._lastEnd=r)}this._lastStart=-1}else this._lastStart=-1}else this._lastStart=-1},e.prototype.hasClass=function(e,t){return this._findClassName(e,t),-1!==this._lastStart},e.prototype.addClasses=function(e){for(var t=this,n=[],i=1;i0){t.sort(Xi.sort);var o=t.shift();o.execute()}i=!1};Gi=function(t,i){void 0===i&&(i=0);var r=new Xi(t,i);return e.push(r),n||(n=!0,Zi(o)),r},qi=function(e,n){if(i){var o=new Xi(e,n);return t.push(o),o}return Gi(e,n)}})();var Ji=16,Qi=function(e,t){return t},eo=function(e){function t(t,n,i,o,r){void 0===o&&(o=Qi),void 0===r&&(r=Ji);var s=e.call(this)||this,a=null,u=0,l=s._register(new ne),c=function(){u=(new Date).getTime(),i(a),a=null};return s._register(ji(t,n,(function(e){a=o(a,e);var t=(new Date).getTime()-u;t>=r?(l.cancel(),c()):l.setIfNotSet(c,r-t)}))),s}return Ei(t,e),t}(S);function to(e,t,n,i,o){return new eo(e,t,n,i,o)}function no(e){return document.defaultView.getComputedStyle(e,null)}var io=function(){return function(e,t){return parseFloat(t)||0}}();function oo(e,t,n){var i=no(e),o="0";return i&&(o=i.getPropertyValue?i.getPropertyValue(t):i.getAttribute(n)),io(e,o)}function ro(e){if(e!==document.body)return new ao(e.clientWidth,e.clientHeight);if(window.innerWidth&&window.innerHeight)return new ao(window.innerWidth,window.innerHeight);if(document.body&&document.body.clientWidth&&document.body.clientHeight)return new ao(document.body.clientWidth,document.body.clientHeight);if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientHeight)return new ao(document.documentElement.clientWidth,document.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}var so={getBorderLeftWidth:function(e){return oo(e,"border-left-width","borderLeftWidth")},getBorderRightWidth:function(e){return oo(e,"border-right-width","borderRightWidth")},getBorderTopWidth:function(e){return oo(e,"border-top-width","borderTopWidth")},getBorderBottomWidth:function(e){return oo(e,"border-bottom-width","borderBottomWidth")},getPaddingLeft:function(e){return oo(e,"padding-left","paddingLeft")},getPaddingRight:function(e){return oo(e,"padding-right","paddingRight")},getPaddingTop:function(e){return oo(e,"padding-top","paddingTop")},getPaddingBottom:function(e){return oo(e,"padding-bottom","paddingBottom")},getMarginLeft:function(e){return oo(e,"margin-left","marginLeft")},getMarginTop:function(e){return oo(e,"margin-top","marginTop")},getMarginRight:function(e){return oo(e,"margin-right","marginRight")},getMarginBottom:function(e){return oo(e,"margin-bottom","marginBottom")},__commaSentinel:!1},ao=function(){function e(e,t){this.width=e,this.height=t}return e}();function uo(e){var t=e.offsetParent,n=e.offsetTop,i=e.offsetLeft;while(null!==(e=e.parentNode)&&e!==document.body&&e!==document.documentElement){n-=e.scrollTop;var o=no(e);o&&(i-="rtl"!==o.direction?e.scrollLeft:-e.scrollLeft),e===t&&(i+=so.getBorderLeftWidth(e),n+=so.getBorderTopWidth(e),n+=e.offsetTop,i+=e.offsetLeft,t=e.offsetParent)}return{left:i,top:n}}function lo(e){var t=e.getBoundingClientRect();return{left:t.left+co.scrollX,top:t.top+co.scrollY,width:t.width,height:t.height}}var co=new(function(){function e(){}return Object.defineProperty(e.prototype,"scrollX",{get:function(){return"number"===typeof window.scrollX?window.scrollX:document.body.scrollLeft+document.documentElement.scrollLeft},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrollY",{get:function(){return"number"===typeof window.scrollY?window.scrollY:document.body.scrollTop+document.documentElement.scrollTop},enumerable:!0,configurable:!0}),e}());function ho(e){var t=so.getMarginLeft(e)+so.getMarginRight(e);return e.offsetWidth+t}function fo(e){var t=so.getBorderLeftWidth(e)+so.getBorderRightWidth(e),n=so.getPaddingLeft(e)+so.getPaddingRight(e);return e.offsetWidth-t-n}function po(e){var t=so.getBorderTopWidth(e)+so.getBorderBottomWidth(e),n=so.getPaddingTop(e)+so.getPaddingBottom(e);return e.offsetHeight-t-n}function go(e){var t=so.getMarginTop(e)+so.getMarginBottom(e);return e.offsetHeight+t}function mo(e,t){while(e){if(e===t)return!0;e=e.parentNode}return!1}function vo(e,t,n){while(e){if(Ai(e,t))return e;if(n)if("string"===typeof n){if(Ai(e,n))return null}else if(e===n)return null;e=e.parentNode}return null}function _o(e){void 0===e&&(e=document.getElementsByTagName("head")[0]);var t=document.createElement("style");return t.type="text/css",t.media="screen",e.appendChild(t),t}var yo=null;function bo(){return yo||(yo=_o()),yo}function wo(e){return e&&e.sheet&&e.sheet.rules?e.sheet.rules:e&&e.sheet&&e.sheet.cssRules?e.sheet.cssRules:[]}function Co(e,t,n){void 0===n&&(n=bo()),n&&t&&n.sheet.insertRule(e+"{"+t+"}",0)}function So(e,t){if(void 0===t&&(t=bo()),t){for(var n=wo(t),i=[],o=0;o=0;o--)t.sheet.deleteRule(i[o])}}function xo(e){return"object"===typeof HTMLElement?e instanceof HTMLElement:e&&"object"===typeof e&&1===e.nodeType&&"string"===typeof e.nodeName}var Lo={CLICK:"click",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",UNLOAD:"unload",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:ii?"webkitAnimationStart":"animationstart",ANIMATION_END:ii?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:ii?"webkitAnimationIteration":"animationiteration"},ko={stop:function(e,t){e.preventDefault?e.preventDefault():e.returnValue=!1,t&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)}};function No(e){for(var t=[],n=0;e&&e.nodeType===e.ELEMENT_NODE;n++)t[n]=e.scrollTop,e=e.parentNode;return t}function Eo(e,t){for(var n=0;e&&e.nodeType===e.ELEMENT_NODE;n++)e.scrollTop!==t[n]&&(e.scrollTop=t[n]),e=e.parentNode}var Oo=function(){function e(e){var t=this;this._onDidFocus=new T,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new T,this.onDidBlur=this._onDidBlur.event,this.disposables=[];var n=mo(document.activeElement,e),i=!1,o=function(){i=!1,n||(n=!0,t._onDidFocus.fire())},r=function(){n&&(i=!0,window.setTimeout((function(){i&&(i=!1,n=!1,t._onDidBlur.fire())}),0))};li(e,Lo.FOCUS,!0)(o,null,this.disposables),li(e,Lo.BLUR,!0)(r,null,this.disposables)}return e.prototype.dispose=function(){this.disposables=y(this.disposables),this._onDidFocus.dispose(),this._onDidBlur.dispose()},e}();function Do(e){return new Oo(e)}function Io(e){for(var t=[],n=1;n200)return e;if("object"===typeof e){switch(e.$mid){case 1:return Yt.revive(e);case 2:return new RegExp(e.source,e.flags)}for(var n in e)Object.hasOwnProperty.call(e,n)&&(e[n]=zo(e[n],t+1))}return e}(function(e){e.inMemory="inmemory",e.vscode="vscode",e.internal="private",e.walkThrough="walkThrough",e.walkThroughSnippet="walkThroughSnippet",e.http="http",e.https="https",e.file="file",e.mailto="mailto",e.untitled="untitled",e.data="data"})(Mo||(Mo={}));var Uo="";function $o(e){return!e||"string"!==typeof e||0===e.trim().length}function Ko(e,t,n){void 0===n&&(n="0");for(var i=""+e,o=[i],r=i.length;r=t.length?e:t[i]}))}function Yo(e){return e.replace(/[<|>|&]/g,(function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}}))}function Zo(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\[\]\(\)\#]/g,"\\$&")}function Xo(e,t){void 0===t&&(t=" ");var n=Jo(e,t);return Qo(n,t)}function Jo(e,t){if(!e||!t)return e;var n=t.length;if(0===n||0===e.length)return e;var i=0;while(e.indexOf(t,i)===i)i+=n;return e.substring(i)}function Qo(e,t){if(!e||!t)return e;var n=t.length,i=e.length;if(0===n||0===i)return e;var o=i,r=-1;while(1){if(r=e.lastIndexOf(t,o-1),-1===r||r+n!==o)break;if(0===r)return"";o=r}return e.substring(0,o)}function er(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function tr(e,t){if(e.length0?e.indexOf(t,n)===n:0===n&&e===t}function ir(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("Cannot create regex from empty string");t||(e=Zo(e)),n.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));var i="";return n.global&&(i+="g"),n.matchCase||(i+="i"),n.multiline&&(i+="m"),new RegExp(e,i)}function or(e){if("^"===e.source||"^$"===e.source||"$"===e.source||"^\\s*$"===e.source)return!1;var t=e.exec("");return!(!t||0!==e.lastIndex)}function rr(e){for(var t=0,n=e.length;t=0;n--){var i=e.charCodeAt(n);if(32!==i&&9!==i)return n}return-1}function ur(e,t){return et?1:0}function lr(e){return e>=97&&e<=122}function cr(e){return e>=65&&e<=90}function hr(e){return lr(e)||cr(e)}function dr(e,t){var n=e?e.length:0,i=t?t.length:0;return n===i&&fr(e,t)}function fr(e,t,n){if(void 0===n&&(n=e.length),"string"!==typeof e||"string"!==typeof t)return!1;for(var i=0;ie.length)&&fr(e,t,n)}function gr(e,t){var n,i=Math.min(e.length,t.length);for(n=0;n=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}var Nr=String.fromCharCode(65279);function Er(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function Or(e){return btoa(encodeURIComponent(e))}function Dr(e,t){for(var n="",i=0;i0)&&".."!==d&&(l=-1===h?"":l.slice(0,h),u=!0)}else Br(e,a,c,".")&&(s||l||c=65&&i<=90||i>=97&&i<=122)&&58===e.charCodeAt(1))return i=e.charCodeAt(2),47===i||92===i?e.slice(0,2)+t:e.slice(0,2);var s=e.indexOf("://");if(-1!==s)for(s+=3;s0){var i=e.charCodeAt(e.length-1);if(47!==i&&92!==i){var o=n.charCodeAt(0);47!==o&&92!==o&&(e+=Ir)}}e+=n}return Vr(e)};function Ur(e,t,n,i){if(void 0===i&&(i=Mr),e===t)return!0;if(!e||!t)return!1;if(t.length>e.length)return!1;if(n){var o=pr(e,t);if(!o)return!1;if(t.length===e.length)return!0;var r=t.length;return t.charAt(t.length-1)===i&&r--,e.charAt(r)===i}return t.charAt(t.length-1)!==i&&(t+=i),0===e.indexOf(t)}function $r(e){return!e||e.scheme!==Mo.file||!o["c"]}function Kr(e){return Gr(e)||e.authority}function qr(e,t,n){void 0===n&&(n=$r(e));var i=e===t;return!!i||!(!e||!t)&&(n?dr(e.toString(),t.toString()):e.toString()===t.toString())}function Gr(e){return Pr(e.path)}function Yr(e){if(e.scheme===Mo.file)return Yt.file(Tr(Jr(e)));var t=Tr(e.path,"/");return e.authority&&t.length&&47!==t.charCodeAt(0)?null:e.with({path:t})}function Zr(e,t){var n;return n=e.scheme===Mo.file?Yt.file(zr(Jr(e),t)).path:zr(e.path,t),e.with({path:n})}function Xr(e){var t;return t=e.scheme===Mo.file?Yt.file(Vr(Jr(e))).path:Vr(e.path),e.with({path:t})}function Jr(e){var t;return t=e.authority&&e.path.length>1&&"file"===e.scheme?"//"+e.authority+e.path:o["g"]&&47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?e.path.substr(1):e.path,o["g"]&&(t=t.replace(/\//g,"\\")),t}(function(e){function t(t){var n=new Map,i=t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";"));i.split(";").forEach((function(e){var t=e.split(":"),i=t[0],o=t[1];i&&o&&n.set(i,o)}));var o=t.path.substring(0,t.path.indexOf(";"));return o&&n.set(e.META_DATA_MIME,o),n}e.META_DATA_LABEL="label",e.META_DATA_DESCRIPTION="description",e.META_DATA_SIZE="size",e.META_DATA_MIME="mime",e.parseMetaData=t})(jr||(jr={}));var Qr=jn("commandService"),es=new(function(){function e(){this._commands=new Map}return e.prototype.registerCommand=function(e,t){var n=this;if(!e)throw new Error("invalid command");if("string"===typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.description){for(var i=[],o=0,r=e.description.args;o=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},os=function(e,t){return function(n,i){t(n,i,e)}},rs=function(){function e(e,t,n){void 0===n&&(n=ns),this._editorService=e,this._commandService=t,this._telemetryService=n}return e.prototype.open=function(e,t){var n;this._telemetryService&&this._telemetryService.publicLog("openerService",{scheme:e.scheme});var i=e.scheme,o=e.path,r=e.query,s=e.fragment,a=void 0;if(i===Mo.http||i===Mo.https||i===Mo.mailto)Ho(e.toString(!0));else if("command"===i&&es.getCommand(o)){var u=[];try{u=jo(r),Array.isArray(u)||(u=[u])}catch(h){}a=(n=this._commandService).executeCommand.apply(n,[o].concat(u))}else{var l=void 0,c=/^L?(\d+)(?:,(\d+))?/.exec(s);if(c&&(l={startLineNumber:parseInt(c[1]),startColumn:c[2]?parseInt(c[2]):1},e=e.with({fragment:""})),!e.scheme)return Promise.resolve(void 0);e.scheme===Mo.file&&(e=Xr(e)),a=this._editorService.openCodeEditor({resource:e,options:{selection:l}},this._editorService.getFocusedCodeEditor(),t&&t.openToSide)}return Promise.resolve(a)},e=is([os(0,Un),os(1,Qr),os(2,zn(ts))],e),e}();function ss(e,t){if(!e||null===e)throw new Error(t?"Assertion failed ("+t+")":"Assertion Failed")}var as={followsCaret:!0,ignoreCharChanges:!0,alwaysRevealFirst:!0},us=function(){function e(e,t){void 0===t&&(t={});var n=this;this._onDidUpdate=new T,this._editor=e,this._options=ze(t,as,!1),this.disposed=!1,this._disposables=[],this.nextIdx=-1,this.ranges=[],this.ignoreSelectionChange=!1,this.revealFirst=Boolean(this._options.alwaysRevealFirst),this._disposables.push(this._editor.onDidDispose((function(){return n.dispose()}))),this._disposables.push(this._editor.onDidUpdateDiff((function(){return n._onDiffUpdated()}))),this._options.followsCaret&&this._disposables.push(this._editor.getModifiedEditor().onDidChangeCursorPosition((function(e){n.ignoreSelectionChange||(n.nextIdx=-1)}))),this._options.alwaysRevealFirst&&this._disposables.push(this._editor.getModifiedEditor().onDidChangeModel((function(e){n.revealFirst=!0}))),this._init()}return e.prototype._init=function(){this._editor.getLineChanges()},e.prototype._onDiffUpdated=function(){this._init(),this._compute(this._editor.getLineChanges()),this.revealFirst&&null!==this._editor.getLineChanges()&&(this.revealFirst=!1,this.nextIdx=-1,this.next(1))},e.prototype._compute=function(e){var t=this;this.ranges=[],e&&e.forEach((function(e){!t._options.ignoreCharChanges&&e.charChanges?e.charChanges.forEach((function(e){t.ranges.push({rhs:!0,range:new In(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)})})):t.ranges.push({rhs:!0,range:new In(e.modifiedStartLineNumber,1,e.modifiedStartLineNumber,1)})})),this.ranges.sort((function(e,t){return e.range.getStartPosition().isBeforeOrEqual(t.range.getStartPosition())?-1:t.range.getStartPosition().isBeforeOrEqual(e.range.getStartPosition())?1:0})),this._onDidUpdate.fire(this)},e.prototype._initIdx=function(e){var t=!1,n=this._editor.getPosition();if(n){for(var i=0,o=this.ranges.length;i=this.ranges.length&&(this.nextIdx=0)):(this.nextIdx-=1,this.nextIdx<0&&(this.nextIdx=this.ranges.length-1));var n=this.ranges[this.nextIdx];this.ignoreSelectionChange=!0;try{var i=n.range.getStartPosition();this._editor.setPosition(i),this._editor.revealPositionInCenter(i,t)}finally{this.ignoreSelectionChange=!1}}},e.prototype.canNavigate=function(){return this.ranges&&this.ranges.length>0},e.prototype.next=function(e){void 0===e&&(e=0),this._move(!0,e)},e.prototype.previous=function(e){void 0===e&&(e=0),this._move(!1,e)},e.prototype.dispose=function(){y(this._disposables),this._disposables.length=0,this._onDidUpdate.dispose(),this.ranges=[],this.disposed=!0},e}(),ls=new(function(){function e(){this._zoomLevel=0,this._onDidChangeZoomLevel=new T,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}return e.prototype.getZoomLevel=function(){return this._zoomLevel},e.prototype.setZoomLevel=function(e){e=Math.min(Math.max(-5,e),20),this._zoomLevel!==e&&(this._zoomLevel=e,this._onDidChangeZoomLevel.fire(this._zoomLevel))},e}()),cs=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),hs=o["d"]?1.5:1.35,ds=8,fs=100,ps=8,gs=150,ms=-5,vs=20;function _s(e,t){if("number"===typeof e)return e;if("undefined"===typeof e)return t;var n=parseFloat(e);return isNaN(n)?t:n}function ys(e,t){if("number"===typeof e)return Math.round(e);if("undefined"===typeof e)return t;var n=parseInt(e);return isNaN(n)?t:n}function bs(e,t,n){return en?n:e}function ws(e,t){return"string"!==typeof e?t:e}var Cs=function(){function e(e){this.zoomLevel=e.zoomLevel,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.lineHeight=0|e.lineHeight,this.letterSpacing=e.letterSpacing}return e.createFromRawSettings=function(t,n){var i=ws(t.fontFamily,xt.fontFamily),o=ws(t.fontWeight,xt.fontWeight),r=_s(t.fontSize,xt.fontSize);r=bs(r,0,fs),0===r?r=xt.fontSize:r0)n.left||(n.left=new Rs,n.left.segment=i.value()),n=n.left;else if(o<0)n.right||(n.right=new Rs,n.right.segment=i.value()),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new Rs,n.mid.segment=i.value()),n=n.mid}}var r=n.value;return n.value=t,n.key=e,r},e.prototype.get=function(e){var t=this._iter.reset(e),n=this._root;while(n){var i=t.cmp(n.segment);if(i>0)n=n.left;else if(i<0)n=n.right;else{if(!t.hasNext())break;t.next(),n=n.mid}}return n?n.value:void 0},e.prototype.findSubstr=function(e){var t=this._iter.reset(e),n=this._root,i=void 0;while(n){var o=t.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else{if(!t.hasNext())break;t.next(),i=n.value||i,n=n.mid}}return n&&n.value||i},e.prototype.forEach=function(e){this._forEach(this._root,e)},e.prototype._forEach=function(e,t){e&&(this._forEach(e.left,t),e.value&&t(e.value,e.key),this._forEach(e.mid,t),this._forEach(e.right,t))},e}(),Ws=function(){function e(){this.map=new Map,this.ignoreCase=!1}return e.prototype.set=function(e,t){this.map.set(this.toKey(e),t)},e.prototype.get=function(e){return this.map.get(this.toKey(e))},e.prototype.toKey=function(e){var t=e.toString();return this.ignoreCase&&(t=t.toLowerCase()),t},e}(),Vs=function(){function e(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return e.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),e.prototype.get=function(e,t){void 0===t&&(t=0);var n=this._map.get(e);if(n)return 0!==t&&this.touch(n,t),n.value},e.prototype.set=function(e,t,n){void 0===n&&(n=0);var i=this._map.get(e);if(i)i.value=t,0!==n&&this.touch(i,n);else{switch(i={key:e,value:t,next:void 0,previous:void 0},n){case 0:this.addItemLast(i);break;case 1:this.addItemFirst(i);break;case 2:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}},e.prototype.forEach=function(e,t){var n=this._head;while(n)t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),n=n.next},e.prototype.trimOld=function(e){if(!(e>=this.size))if(0!==e){var t=this._head,n=this.size;while(t&&n>e)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0)}else this.clear()},e.prototype.addItemFirst=function(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e},e.prototype.addItemLast=function(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e},e.prototype.touch=function(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(1===t||2===t)if(1===t){if(e===this._head)return;var n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e}else if(2===t){if(e===this._tail)return;n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e}},e.prototype.toJSON=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),e},e}(),Bs=function(e){function t(t,n){void 0===n&&(n=1);var i=e.call(this)||this;return i._limit=t,i._ratio=Math.min(Math.max(0,n),1),i}return Is(t,e),t.prototype.get=function(t){return e.prototype.get.call(this,t,2)},t.prototype.set=function(t,n){e.prototype.set.call(this,t,n,2),this.checkTrim()},t.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},t}(Vs),Hs="**",js="/",zs="[/\\\\]",Us="[^/\\\\]",$s=/\//g;function Ks(e){switch(e){case 0:return"";case 1:return Us+"*?";default:return"(?:"+zs+"|"+Us+"+"+zs+"|"+zs+Us+"+)*?"}}function qs(e,t){if(!e)return[];for(var n,i=[],o=!1,r=!1,s="",a=0;a0;n--){var r=e.charCodeAt(n-1);if(47===r||92===r)break}t=e.substr(n)}var s=o.indexOf(t);return-1!==s?i[s]:null};a.basenames=o,a.patterns=i,a.allBasenames=o;var u=e.filter((function(e){return!e.basenames}));return u.push(a),u}function va(e,t,n,i){if(Array.isArray(e)){for(var o=0,r=0,s=e;ro&&(o=u)}return o}if("string"===typeof e)return i?"*"===e?5:e===n?10:0:0;if(e){var l=e.language,c=e.pattern,h=e.scheme,d=e.hasAccessToAllModels;if(!i&&!d)return 0;o=0;if(h)if(h===t.scheme)o=10;else{if("*"!==h)return 0;o=5}if(l)if(l===n)o=10;else{if("*"!==l)return 0;o=Math.max(o,5)}if(c){if(c!==t.fsPath&&!ha(c,t.fsPath))return 0;o=10}return o}return 0}var _a=jn("modelService");function ya(e){return!e.isTooLargeForSyncing()&&!e.isForSimpleWidget}function ba(e){return"string"!==typeof e&&(Array.isArray(e)?e.every(ba):!!e.exclusive)}var wa,Ca,Sa=function(){function e(){this._clock=0,this._entries=[],this._onDidChange=new T}return Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t){var n=this,i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),w((function(){if(i){var e=n._entries.indexOf(i);e>=0&&(n._entries.splice(e,1),n._lastCandidate=void 0,n._onDidChange.fire(n._entries.length),i=void 0)}}))},e.prototype.has=function(e){return this.all(e).length>0},e.prototype.all=function(e){if(!e)return[];this._updateScores(e);for(var t=[],n=0,i=this._entries;n0&&t.push(o.provider)}return t},e.prototype.ordered=function(e){var t=[];return this._orderedForEach(e,(function(e){return t.push(e.provider)})),t},e.prototype.orderedGroups=function(e){var t,n,i=[];return this._orderedForEach(e,(function(e){t&&n===e._score?t.push(e.provider):(n=e._score,t=[e.provider],i.push(t))})),i},e.prototype._orderedForEach=function(e,t){if(e){this._updateScores(e);for(var n=0;n0&&t(i)}}},e.prototype._updateScores=function(t){var n={uri:t.uri.toString(),language:t.getLanguageIdentifier().language};if(!this._lastCandidate||this._lastCandidate.language!==n.language||this._lastCandidate.uri!==n.uri){this._lastCandidate=n;for(var i=0,o=this._entries;i0){for(var s=0,a=this._entries;st._score?-1:e._timet._time?-1:0},e}(),xa=function(){function e(){this._onDidChange=new T,this.onDidChange=this._onDidChange.event,this._map=Object.create(null),this._promises=Object.create(null),this._colorMap=null}return e.prototype.fire=function(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})},e.prototype.register=function(e,t){var n=this;return this._map[e]=t,this.fire([e]),w((function(){n._map[e]===t&&(delete n._map[e],n.fire([e]))}))},e.prototype.getPromise=function(e){var t=this,n=this.get(e);if(n)return Promise.resolve(n);var i=this._promises[e];return i?i.then((function(n){return t.get(e)})):null},e.prototype.get=function(e){return this._map[e]||null},e.prototype.setColorMap=function(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Object.keys(this._map),changedColorMap:!0})},e.prototype.getColorMap=function(){return this._colorMap},e.prototype.getDefaultBackground=function(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null},e}(),La=function(){function e(e,t){this.language=e,this.id=t}return e}(),ka=function(){function e(){}return e.getLanguageId=function(e){return(255&e)>>>0},e.getTokenType=function(e){return(1792&e)>>>8},e.getFontStyle=function(e){return(14336&e)>>>11},e.getForeground=function(e){return(8372224&e)>>>14},e.getBackground=function(e){return(4286578688&e)>>>23},e.getClassNameFromMetadata=function(e){var t=this.getForeground(e),n="mtk"+t,i=this.getFontStyle(e);return 1&i&&(n+=" mtki"),2&i&&(n+=" mtkb"),4&i&&(n+=" mtku"),n},e.getInlineStyleFromMetadata=function(e,t){var n=this.getForeground(e),i=this.getFontStyle(e),o="color: "+t[n]+";";return 1&i&&(o+="font-style: italic;"),2&i&&(o+="font-weight: bold;"),4&i&&(o+="text-decoration: underline;"),o},e}(),Na=function(){var e=Object.create(null);return e[0]="method",e[1]="function",e[2]="constructor",e[3]="field",e[4]="variable",e[5]="class",e[6]="struct",e[7]="interface",e[8]="module",e[9]="property",e[10]="event",e[11]="operator",e[12]="unit",e[13]="value",e[14]="constant",e[15]="enum",e[16]="enum-member",e[17]="keyword",e[25]="snippet",e[18]="text",e[19]="color",e[20]="file",e[21]="reference",e[22]="customcolor",e[23]="folder",e[24]="type-parameter",function(t){return e[t]||"property"}}(),Ea=function(){var e=Object.create(null);return e["method"]=0,e["function"]=1,e["constructor"]=2,e["field"]=3,e["variable"]=4,e["class"]=5,e["struct"]=6,e["interface"]=7,e["module"]=8,e["property"]=9,e["event"]=10,e["operator"]=11,e["unit"]=12,e["value"]=13,e["constant"]=14,e["enum"]=15,e["enum-member"]=16,e["keyword"]=17,e["snippet"]=25,e["text"]=18,e["color"]=19,e["file"]=20,e["reference"]=21,e["customcolor"]=22,e["folder"]=23,e["type-parameter"]=24,function(t){return e[t]||"property"}}();(function(e){e[e["Invoke"]=1]="Invoke",e[e["TriggerCharacter"]=2]="TriggerCharacter",e[e["ContentChange"]=3]="ContentChange"})(wa||(wa={})),function(e){e[e["Text"]=0]="Text",e[e["Read"]=1]="Read",e[e["Write"]=2]="Write"}(Ca||(Ca={}));var Oa=function(){var e=Object.create(null);return e[0]="file",e[1]="module",e[2]="namespace",e[3]="package",e[4]="class",e[5]="method",e[6]="property",e[7]="field",e[8]="constructor",e[9]="enum",e[10]="interface",e[11]="function",e[12]="variable",e[13]="constant",e[14]="string",e[15]="number",e[16]="boolean",e[17]="array",e[18]="object",e[19]="key",e[20]="null",e[21]="enum-member",e[22]="struct",e[23]="event",e[24]="operator",e[25]="type-parameter",function(t){return"symbol-icon "+(e[t]||"property")}}(),Da=function(){function e(e){this.value=e}return e.Comment=new e("comment"),e.Imports=new e("imports"),e.Region=new e("region"),e}();function Ia(e){return Oe(e)&&e.resource&&Array.isArray(e.edits)}var Ma=new Sa,Ta=new Sa,Pa=new Sa,Aa=new Sa,Ra=new Sa,Fa=new Sa,Wa=new Sa,Va=new Sa,Ba=new Sa,Ha=new Sa,ja=new Sa,za=new Sa,Ua=new Sa,$a=new Sa,Ka=new Sa,qa=new Sa,Ga=new Sa,Ya=new Sa,Za=new xa,Xa=function(){function e(){}return e.prototype.clone=function(){return this},e.prototype.equals=function(e){return this===e},e}(),Ja=new Xa,Qa="vs.editor.nullMode",eu=new La(Qa,0);function tu(e,t,n,i){return new An([new Pn(i,"",e)],n)}function nu(e,t,n,i){var o=new Uint32Array(2);return o[0]=i,o[1]=(16384|e<<0|2<<23)>>>0,new Rn(o,null===n?Ja:n)}var iu="editorWorkerService",ou=jn(iu),ru=jn("textModelService"),su=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),au=self;"undefined"===typeof au.Promise&&(au.Promise=ae);var uu="$initialize",lu=!1;function cu(e){o["f"]&&(lu||(lu=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq")),console.warn(e.message))}var hu=function(){function e(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null)}return e.prototype.setWorkerId=function(e){this._workerId=e},e.prototype.sendMessage=function(e,t){var n=this,i=String(++this._lastSentReq);return new Promise((function(o,r){n._pendingReplies[i]={resolve:o,reject:r},n._send({vsWorker:n._workerId,req:i,method:e,args:t})}))},e.prototype.handleMessage=function(e){var t;try{t=JSON.parse(e)}catch(n){return}t&&t.vsWorker&&(-1!==this._workerId&&t.vsWorker!==this._workerId||this._handleMessage(t))},e.prototype._handleMessage=function(e){var t=this;if(e.seq){var n=e;if(!this._pendingReplies[n.seq])return void console.warn("Got reply to unknown seq");var i=this._pendingReplies[n.seq];if(delete this._pendingReplies[n.seq],n.err){var o=n.err;return n.err.$isError&&(o=new Error,o.name=n.err.name,o.message=n.err.message,o.stack=n.err.stack),void i.reject(o)}i.resolve(n.res)}else{var r=e,s=r.req,a=this._handler.handleMessage(r.method,r.args);a.then((function(e){t._send({vsWorker:t._workerId,seq:s,res:e,err:void 0})}),(function(e){e.detail instanceof Error&&(e.detail=h(e.detail)),t._send({vsWorker:t._workerId,seq:s,res:void 0,err:h(e)})}))}},e.prototype._send=function(e){var t=JSON.stringify(e);this._handler.sendMessage(t)},e}(),du=function(e){function t(t,n){var i=e.call(this)||this,o=null;i._worker=i._register(t.create("vs/base/common/worker/simpleWorker",(function(e){i._protocol.handleMessage(e)}),(function(e){o&&o(e)}))),i._protocol=new hu({sendMessage:function(e){i._worker.postMessage(e)},handleMessage:function(e,t){return Promise.resolve(null)}}),i._protocol.setWorkerId(i._worker.getId());var r=null;"undefined"!==typeof self.require&&"function"===typeof self.require.getConfig?r=self.require.getConfig():"undefined"!==typeof self.requirejs&&(r=self.requirejs.s.contexts._.config),i._onModuleLoaded=i._protocol.sendMessage(uu,[i._worker.getId(),n,r]),i._lazyProxy=new Promise((function(e,t){o=t,i._onModuleLoaded.then((function(t){for(var n={},i=0;i0&&e.getLanguageId(s-1)===o)s--;return new yu(e,o,s,r+1,e.getStartOffset(s),e.getEndOffset(r))}var yu=function(){function e(e,t,n,i,o,r){this._actual=e,this.languageId=t,this._firstTokenIndex=n,this._lastTokenIndex=i,this.firstCharOffset=o,this._lastCharOffset=r}return e.prototype.getLineContent=function(){var e=this._actual.getLineContent();return e.substring(this.firstCharOffset,this._lastCharOffset)},e.prototype.getTokenCount=function(){return this._lastTokenIndex-this._firstTokenIndex},e.prototype.findTokenIndexAtOffset=function(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex},e.prototype.getStandardTokenType=function(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)},e}();function bu(e){return 0!==(7&e)}var wu=function(){function e(t){t.autoClosingPairs?this._autoClosingPairs=t.autoClosingPairs.map((function(e){return new vu(e)})):t.brackets?this._autoClosingPairs=t.brackets.map((function(e){return new vu({open:e[0],close:e[1]})})):this._autoClosingPairs=[],this._autoCloseBefore="string"===typeof t.autoCloseBefore?t.autoCloseBefore:e.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED,this._surroundingPairs=t.surroundingPairs||this._autoClosingPairs}return e.prototype.getAutoClosingPairs=function(){return this._autoClosingPairs},e.prototype.getAutoCloseBeforeSet=function(){return this._autoCloseBefore},e.prototype.shouldAutoClosePair=function(e,t,n){if(0===t.getTokenCount())return!0;for(var i=t.findTokenIndexAtOffset(n-2),o=t.getStandardTokenType(i),r=0;r=0;n--)t+=e.charAt(n);return t}var t=null,n=null;return function(i){return t!==i&&(t=i,n=e(t)),n}}(),Mu=function(){function e(){}return e._findPrevBracketInText=function(e,t,n,i){var o=n.match(e);if(!o)return null;var r=n.length-(o.index||0),s=o[0].length,a=i+r;return new In(t,a-s+1,t,a+1)},e.findPrevBracketInToken=function(e,t,n,i,o){var r=Iu(n),s=r.substring(n.length-o,n.length-i);return this._findPrevBracketInText(e,t,s,i)},e.findNextBracketInText=function(e,t,n,i){var o=n.match(e);if(!o)return null;var r=o.index||0,s=o[0].length;if(0===s)return null;var a=i+r;return new In(t,a+1,t,a+1+s)},e.findNextBracketInToken=function(e,t,n,i,o){var r=n.substring(i,o);return this.findNextBracketInText(e,t,r,i)},e}(),Tu=function(){function e(e,t,n){n=n||{},this._richEditBrackets=e,this._complexAutoClosePairs=t.filter((function(e){return e.open.length>1&&!!e.close})).map((function(e){return new vu(e)})),n.docComment&&this._complexAutoClosePairs.push(new vu({open:n.docComment.open,close:n.docComment.close}))}return e.prototype.getElectricCharacters=function(){var e=[];if(this._richEditBrackets)for(var t=0,n=this._richEditBrackets.brackets.length;t=0))return{appendText:s.close}}}}return null},e}(),Pu=function(){function e(e){this._indentationRules=e}return e.prototype.shouldIncrease=function(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&this._indentationRules.increaseIndentPattern.test(e))},e.prototype.shouldDecrease=function(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&this._indentationRules.decreaseIndentPattern.test(e))},e.prototype.shouldIndentNextLine=function(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&this._indentationRules.indentNextLinePattern.test(e))},e.prototype.shouldIgnore=function(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&this._indentationRules.unIndentedLinePattern.test(e))},e.prototype.getIndentMetadata=function(e){var t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t},e}(),Au=function(){function e(t){var n=this;t=t||{},t.brackets=t.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],t.brackets.forEach((function(t){var i=e._createOpenBracketRegExp(t[0]),o=e._createCloseBracketRegExp(t[1]);i&&o&&n._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:o})})),this._regExpRules=t.regExpRules||[]}return e.prototype.onEnter=function(e,t,n){for(var i=0,o=this._regExpRules.length;i0&&n.length>0)for(i=0,o=this._brackets.length;i0)for(i=0,o=this._brackets.length;i1){var o=t-1,r=-1;for(o=t-1;o>=1;o--){if(e.getLanguageIdAtPosition(o,0)!==i)return r;var s=e.getLineContent(o);if(!n.shouldIgnore(s)&&!/^\s+$/.test(s)&&""!==s)return o;r=o}}return-1},e.prototype.getInheritIndentForLine=function(e,t,n){void 0===n&&(n=!0);var i=this.getIndentRulesSupport(e.getLanguageIdentifier().id);if(!i)return null;if(t<=1)return{indentation:"",action:null};var o=this.getPrecedingValidLine(e,t,i);if(o<0)return null;if(o<1)return{indentation:"",action:null};var r=e.getLineContent(o);if(i.shouldIncrease(r)||i.shouldIndentNextLine(r))return{indentation:sr(r),action:pu.Indent,line:o};if(i.shouldDecrease(r))return{indentation:sr(r),action:null,line:o};if(1===o)return{indentation:sr(e.getLineContent(o)),action:null,line:o};var s=o-1,a=i.getIndentMetadata(e.getLineContent(s));if(!(3&a)&&4&a){for(var u=0,l=s-1;l>0;l--)if(!i.shouldIndentNextLine(e.getLineContent(l))){u=l;break}return{indentation:sr(e.getLineContent(u+1)),action:null,line:u+1}}if(n)return{indentation:sr(e.getLineContent(o)),action:null,line:o};for(l=o;l>0;l--){var c=e.getLineContent(l);if(i.shouldIncrease(c))return{indentation:sr(c),action:pu.Indent,line:l};if(i.shouldIndentNextLine(c)){u=0;for(var h=l-1;h>0;h--)if(!i.shouldIndentNextLine(e.getLineContent(l))){u=h;break}return{indentation:sr(e.getLineContent(u+1)),action:null,line:u+1}}if(i.shouldDecrease(c))return{indentation:sr(c),action:null,line:l}}return{indentation:sr(e.getLineContent(1)),action:null,line:1}},e.prototype.getGoodIndentForLine=function(e,t,n,i){var o=this.getIndentRulesSupport(t);if(!o)return null;var r=this.getInheritIndentForLine(e,n),s=e.getLineContent(n);if(r){var a=r.line;if(void 0!==a){var u=this._getOnEnterSupport(t),c=null;try{u&&(c=u.onEnter("",e.getLineContent(a),""))}catch(d){l(d)}if(c){var h=sr(e.getLineContent(a));return c.removeText&&(h=h.substring(0,h.length-c.removeText)),c.indentAction===pu.Indent||c.indentAction===pu.IndentOutdent?h=i.shiftIndent(h):c.indentAction===pu.Outdent&&(h=i.unshiftIndent(h)),o.shouldDecrease(s)&&(h=i.unshiftIndent(h)),c.appendText&&(h+=c.appendText),sr(h)}}return o.shouldDecrease(s)?r.action===pu.Indent?r.indentation:i.unshiftIndent(r.indentation):r.action===pu.Indent?i.shiftIndent(r.indentation):r.indentation}return null},e.prototype.getIndentForEnter=function(e,t,n,i){e.forceTokenization(t.startLineNumber);var o,r,s=e.getLineTokens(t.startLineNumber),a=_u(s,t.startColumn-1),u=a.getLineContent(),l=!1;if(a.firstCharOffset>0&&s.getLanguageId(0)!==a.languageId?(l=!0,o=u.substr(0,t.startColumn-1-a.firstCharOffset)):o=s.getLineContent().substring(0,t.startColumn-1),t.isEmpty())r=u.substr(t.startColumn-1-a.firstCharOffset);else{var c=this.getScopedLineTokens(e,t.endLineNumber,t.endColumn);r=c.getLineContent().substr(t.endColumn-1-a.firstCharOffset)}var h=this.getIndentRulesSupport(a.languageId);if(!h)return null;var d=o,f=sr(o);if(!i&&!l){var p=this.getInheritIndentForLine(e,t.startLineNumber);h.shouldDecrease(o)&&p&&(f=p.indentation,p.action!==pu.Indent&&(f=n.unshiftIndent(f))),d=f+Jo(Jo(o," "),"\t")}var g={getLineTokens:function(t){return e.getLineTokens(t)},getLanguageIdentifier:function(){return e.getLanguageIdentifier()},getLanguageIdAtPosition:function(t,n){return e.getLanguageIdAtPosition(t,n)},getLineContent:function(n){return n===t.startLineNumber?d:e.getLineContent(n)}},m=sr(s.getLineContent()),v=this.getInheritIndentForLine(g,t.startLineNumber+1);if(!v){var _=l?m:f;return{beforeEnter:_,afterEnter:_}}var y=l?m:v.indentation;return v.action===pu.Indent&&(y=n.shiftIndent(y)),h.shouldDecrease(r)&&(y=n.unshiftIndent(y)),{beforeEnter:l?m:f,afterEnter:y}},e.prototype.getIndentActionForType=function(e,t,n,i){var o=this.getScopedLineTokens(e,t.startLineNumber,t.startColumn),r=this.getIndentRulesSupport(o.languageId);if(!r)return null;var s,a=o.getLineContent(),u=a.substr(0,t.startColumn-1-o.firstCharOffset);if(t.isEmpty())s=a.substr(t.startColumn-1-o.firstCharOffset);else{var l=this.getScopedLineTokens(e,t.endLineNumber,t.endColumn);s=l.getLineContent().substr(t.endColumn-1-o.firstCharOffset)}if(!r.shouldDecrease(u+s)&&r.shouldDecrease(u+n+s)){var c=this.getInheritIndentForLine(e,t.startLineNumber,!1);if(!c)return null;var h=c.indentation;return c.action!==pu.Indent&&(h=i.unshiftIndent(h)),h}return null},e.prototype.getIndentMetadata=function(e,t){var n=this.getIndentRulesSupport(e.getLanguageIdentifier().id);return n?t<1||t>e.getLineCount()?null:n.getIndentMetadata(e.getLineContent(t)):null},e.prototype._getOnEnterSupport=function(e){var t=this._getRichEditSupport(e);return t&&t.onEnter||null},e.prototype.getRawEnterActionAtPosition=function(e,t,n){var i=this.getEnterAction(e,new In(t,n,t,n));return i?i.enterAction:null},e.prototype.getEnterAction=function(e,t){var n=this.getIndentationAtPosition(e,t.startLineNumber,t.startColumn),i=this.getScopedLineTokens(e,t.startLineNumber,t.startColumn),o=this._getOnEnterSupport(i.languageId);if(!o)return null;var r,s=i.getLineContent(),a=s.substr(0,t.startColumn-1-i.firstCharOffset);if(t.isEmpty())r=s.substr(t.startColumn-1-i.firstCharOffset);else{var u=this.getScopedLineTokens(e,t.endLineNumber,t.endColumn);r=u.getLineContent().substr(t.endColumn-1-i.firstCharOffset)}var c=t.startLineNumber,h="";if(c>1&&0===i.firstCharOffset){var d=this.getScopedLineTokens(e,c-1);d.languageId===i.languageId&&(h=d.getLineContent())}var f=null;try{f=o.onEnter(h,a,r)}catch(p){l(p)}return f?(f.appendText||(f.indentAction===pu.Indent||f.indentAction===pu.IndentOutdent?f.appendText="\t":f.appendText=""),f.removeText&&(n=n.substring(0,n.length-f.removeText)),{enterAction:f,indentation:n}):null},e.prototype.getIndentationAtPosition=function(e,t,n){var i=e.getLineContent(t),o=sr(i);return o.length>n-1&&(o=o.substring(0,n-1)),o},e.prototype.getScopedLineTokens=function(e,t,n){e.forceTokenization(t);var i=e.getLineTokens(t),o="undefined"===typeof n?e.getLineMaxColumn(t)-1:n-1,r=_u(i,o);return r},e.prototype.getBracketsSupport=function(e){var t=this._getRichEditSupport(e);return t&&t.brackets||null},e}()),Wu=new Fu,Vu=function(){function e(e,t,n,i){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=i}return e.prototype.getOriginalEnd=function(){return this.originalStart+this.originalLength},e.prototype.getModifiedEnd=function(){return this.modifiedStart+this.modifiedLength},e}();function Bu(e){return{getLength:function(){return e.length},getElementAtIndex:function(t){return e.charCodeAt(t)}}}function Hu(e,t,n){return new Ku(Bu(e),Bu(t)).ComputeDiff(n)}var ju=function(){function e(){}return e.Assert=function(e,t){if(!e)throw new Error(t)},e}(),zu=function(){function e(){}return e.Copy=function(e,t,n,i,o){for(var r=0;r0||this.m_modifiedCount>0)&&this.m_changes.push(new Vu(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=Number.MAX_VALUE,this.m_modifiedStart=Number.MAX_VALUE},e.prototype.AddOriginalElement=function(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++},e.prototype.AddModifiedElement=function(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++},e.prototype.getChanges=function(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes},e.prototype.getReverseChanges=function(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes},e}(),Ku=function(){function e(e,t,n){void 0===n&&(n=null),this.OriginalSequence=e,this.ModifiedSequence=t,this.ContinueProcessingPredicate=n,this.m_forwardHistory=[],this.m_reverseHistory=[]}return e.prototype.ElementsAreEqual=function(e,t){return this.OriginalSequence.getElementAtIndex(e)===this.ModifiedSequence.getElementAtIndex(t)},e.prototype.OriginalElementsAreEqual=function(e,t){return this.OriginalSequence.getElementAtIndex(e)===this.OriginalSequence.getElementAtIndex(t)},e.prototype.ModifiedElementsAreEqual=function(e,t){return this.ModifiedSequence.getElementAtIndex(e)===this.ModifiedSequence.getElementAtIndex(t)},e.prototype.ComputeDiff=function(e){return this._ComputeDiff(0,this.OriginalSequence.getLength()-1,0,this.ModifiedSequence.getLength()-1,e)},e.prototype._ComputeDiff=function(e,t,n,i,o){var r=[!1],s=this.ComputeDiffRecursive(e,t,n,i,r);return o?this.PrettifyChanges(s):s},e.prototype.ComputeDiffRecursive=function(e,t,n,i,o){o[0]=!1;while(e<=t&&n<=i&&this.ElementsAreEqual(e,n))e++,n++;while(t>=e&&i>=n&&this.ElementsAreEqual(t,i))t--,i--;if(e>t||n>i){var r=void 0;return n<=i?(ju.Assert(e===t+1,"originalStart should only be one more than originalEnd"),r=[new Vu(e,0,n,i-n+1)]):e<=t?(ju.Assert(n===i+1,"modifiedStart should only be one more than modifiedEnd"),r=[new Vu(e,t-e+1,n,0)]):(ju.Assert(e===t+1,"originalStart should only be one more than originalEnd"),ju.Assert(n===i+1,"modifiedStart should only be one more than modifiedEnd"),r=[]),r}var s=[0],a=[0],u=this.ComputeRecursionPoint(e,t,n,i,s,a,o),l=s[0],c=a[0];if(null!==u)return u;if(!o[0]){var h=this.ComputeDiffRecursive(e,l,n,c,o),d=[];return d=o[0]?[new Vu(l+1,t-(l+1)+1,c+1,i-(c+1)+1)]:this.ComputeDiffRecursive(l+1,t,c+1,i,o),this.ConcatenateChanges(h,d)}return[new Vu(e,t-e+1,n,i-n+1)]},e.prototype.WALKTRACE=function(e,t,n,i,o,r,s,a,u,l,c,h,d,f,p,g,m,v){var _,y=null,b=null,w=new $u,C=t,S=n,x=d[0]-g[0]-i,L=Number.MIN_VALUE,k=this.m_forwardHistory.length-1;do{_=x+e,_===C||_=0&&(u=this.m_forwardHistory[k],e=u[0],C=1,S=u.length-1)}while(--k>=-1);if(y=w.getReverseChanges(),v[0]){var N=d[0]+1,E=g[0]+1;if(null!==y&&y.length>0){var O=y[y.length-1];N=Math.max(N,O.getOriginalEnd()),E=Math.max(E,O.getModifiedEnd())}b=[new Vu(N,h-N+1,E,p-E+1)]}else{w=new $u,C=r,S=s,x=d[0]-g[0]-a,L=Number.MAX_VALUE,k=m?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{_=x+o,_===C||_=l[_+1]?(c=l[_+1]-1,f=c-x-a,c>L&&w.MarkNextChange(),L=c+1,w.AddOriginalElement(c+1,f+1),x=_+1-o):(c=l[_-1],f=c-x-a,c>L&&w.MarkNextChange(),L=c,w.AddModifiedElement(c+1,f+1),x=_-1-o),k>=0&&(l=this.m_reverseHistory[k],o=l[0],C=1,S=l.length-1)}while(--k>=-1);b=w.getChanges()}return this.ConcatenateChanges(y,b)},e.prototype.ComputeRecursionPoint=function(e,t,n,i,o,r,s){var a,u=0,l=0,c=0,h=0,d=0,f=0;e--,n--,o[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];var p,g,m=t-e+(i-n),v=m+1,_=new Array(v),y=new Array(v),b=i-n,w=t-e,C=e-n,S=t-i,x=w-b,L=x%2===0;for(_[b]=e,y[w]=t,s[0]=!1,a=1;a<=m/2+1;a++){var k=0,N=0;for(c=this.ClipDiagonalBound(b-a,a,b,v),h=this.ClipDiagonalBound(b+a,a,b,v),p=c;p<=h;p+=2){u=p===c||pk+N&&(k=u,N=l),!L&&Math.abs(p-w)<=a-1&&u>=y[p])return o[0]=u,r[0]=l,g<=y[p]&&Uu>0&&a<=Uu+1?this.WALKTRACE(b,c,h,C,w,d,f,S,_,y,u,t,o,l,i,r,L,s):null}var E=(k-e+(N-n)-a)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(k,this.OriginalSequence,E))return s[0]=!0,o[0]=k,r[0]=N,E>0&&Uu>0&&a<=Uu+1?this.WALKTRACE(b,c,h,C,w,d,f,S,_,y,u,t,o,l,i,r,L,s):(e++,n++,[new Vu(e,t-e+1,n,i-n+1)]);for(d=this.ClipDiagonalBound(w-a,a,w,v),f=this.ClipDiagonalBound(w+a,a,w,v),p=d;p<=f;p+=2){u=p===d||p=y[p+1]?y[p+1]-1:y[p-1],l=u-(p-w)-S,g=u;while(u>e&&l>n&&this.ElementsAreEqual(u,l))u--,l--;if(y[p]=u,L&&Math.abs(p-b)<=a&&u<=_[p])return o[0]=u,r[0]=l,g>=_[p]&&Uu>0&&a<=Uu+1?this.WALKTRACE(b,c,h,C,w,d,f,S,_,y,u,t,o,l,i,r,L,s):null}if(a<=Uu){var O=new Array(h-c+2);O[0]=b-c+1,zu.Copy(_,c,O,1,h-c+1),this.m_forwardHistory.push(O),O=new Array(f-d+2),O[0]=w-d+1,zu.Copy(y,d,O,1,f-d+1),this.m_reverseHistory.push(O)}}return this.WALKTRACE(b,c,h,C,w,d,f,S,_,y,u,t,o,l,i,r,L,s)},e.prototype.PrettifyChanges=function(e){for(var t=0;t0,s=n.modifiedLength>0;while(n.originalStart+n.originalLength=0;t--){n=e[t],i=0,o=0;if(t>0){var u=e[t-1];u.originalLength>0&&(i=u.originalStart+u.originalLength),u.modifiedLength>0&&(o=u.modifiedStart+u.modifiedLength)}r=n.originalLength>0,s=n.modifiedLength>0;for(var l=0,c=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength),h=1;;h++){var d=n.originalStart-h,f=n.modifiedStart-h;if(dc&&(c=p,l=h)}n.originalStart-=l,n.modifiedStart-=l}return e},e.prototype._OriginalIsBoundary=function(e){if(e<=0||e>=this.OriginalSequence.getLength()-1)return!0;var t=this.OriginalSequence.getElementAtIndex(e);return"string"===typeof t&&/^\s*$/.test(t)},e.prototype._OriginalRegionIsBoundary=function(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){var n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1},e.prototype._ModifiedIsBoundary=function(e){if(e<=0||e>=this.ModifiedSequence.getLength()-1)return!0;var t=this.ModifiedSequence.getElementAtIndex(e);return"string"===typeof t&&/^\s*$/.test(t)},e.prototype._ModifiedRegionIsBoundary=function(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){var n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1},e.prototype._boundaryScore=function(e,t,n,i){var o=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(n,i)?1:0;return o+r},e.prototype.ConcatenateChanges=function(e,t){var n=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){var i=new Array(e.length+t.length-1);return zu.Copy(e,0,i,0,e.length-1),i[e.length-1]=n[0],zu.Copy(t,1,i,e.length,t.length-1),i}i=new Array(e.length+t.length);return zu.Copy(e,0,i,0,e.length),zu.Copy(t,0,i,e.length,t.length),i},e.prototype.ChangesOverlap=function(e,t,n){if(ju.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),ju.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){var i=e.originalStart,o=e.originalLength,r=e.modifiedStart,s=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(s=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new Vu(i,o,r,s),!0}return n[0]=null,!1},e.prototype.ClipDiagonalBound=function(e,t,n,i){if(e>=0&&e1&&p>1){var g=h.charCodeAt(f-2),m=d.charCodeAt(p-2);if(g!==m)break;f--,p--}(f>1||p>1)&&this._pushTrimWhitespaceCharChange(o,r+1,1,f,s+1,1,p);var v=Zu._getLastNonBlankColumn(h,1),_=Zu._getLastNonBlankColumn(d,1),y=h.length+1,b=d.length+1;while(v255?255:0|e}function ol(e){return e<0?0:e>4294967295?4294967295:0|e}function rl(e){for(var t=e.length,n=new Uint32Array(t),i=0;i=0&&this.prefixSum.set(i.subarray(0,this.prefixSumValidIndex[0]+1)),!0)},e.prototype.changeValue=function(e,t){return e=ol(e),t=ol(t),this.values[e]!==t&&(this.values[e]=t,e-1=n.length)return!1;var o=n.length-e;return t>=o&&(t=o),0!==t&&(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(i.subarray(0,this.prefixSumValidIndex[0]+1)),!0)},e.prototype.getTotalValue=function(){return 0===this.values.length?0:this._getAccumulatedValue(this.values.length-1)},e.prototype.getAccumulatedValue=function(e){return e<0?0:(e=ol(e),this._getAccumulatedValue(e))},e.prototype._getAccumulatedValue=function(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];var t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(var n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]},e.prototype.getIndexOf=function(e){e=Math.floor(e),this.getTotalValue();var t=0,n=this.values.length-1,i=0,o=0,r=0;while(t<=n)if(i=t+(n-t)/2|0,o=this.prefixSum[i],r=o-this.values[i],e=o))break;t=i+1}return new sl(i,e-r)},e}(),ul=function(){function e(e){this._cacheAccumulatedValueStart=0,this._cache=null,this._actual=new al(e),this._bustCache()}return e.prototype._bustCache=function(){this._cacheAccumulatedValueStart=0,this._cache=null},e.prototype.insertValues=function(e,t){this._actual.insertValues(e,t)&&this._bustCache()},e.prototype.changeValue=function(e,t){this._actual.changeValue(e,t)&&this._bustCache()},e.prototype.removeValues=function(e,t){this._actual.removeValues(e,t)&&this._bustCache()},e.prototype.getTotalValue=function(){return this._actual.getTotalValue()},e.prototype.getAccumulatedValue=function(e){return this._actual.getAccumulatedValue(e)},e.prototype.getIndexOf=function(e){if(e=Math.floor(e),null!==this._cache){var t=e-this._cacheAccumulatedValueStart;if(t>=0&&t=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)},e.prototype.get=function(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue},e}(),hl=function(){function e(){this._actual=new cl(0)}return e.prototype.add=function(e){this._actual.set(e,1)},e.prototype.has=function(e){return 1===this._actual.get(e)},e}(),dl=function(){function e(e){for(var t=0,n=0,i=0,o=e.length;it&&(t=a),s>n&&(n=s),u>n&&(n=u)}t++,n++;var l=new nl(n,t,0);for(i=0,o=e.length;i=this._maxCharCode?0:this._states.get(e,t)},e}(),fl=null;function pl(){return null===fl&&(fl=new dl([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),fl}var gl=null;function ml(){if(null===gl){gl=new cl(0);for(var e=" \t<>'\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…",t=0;ti);if(i>0){var u=t.charCodeAt(i-1),l=t.charCodeAt(r);(40===u&&41===l||91===u&&93===l||123===u&&125===l)&&r--}return{range:{startLineNumber:n,startColumn:i+1,endLineNumber:n,endColumn:r+2},url:t.substring(i,r+1)}},e.computeLinks=function(t){for(var n=pl(),i=ml(),o=[],r=1,s=t.getLineCount();r<=s;r++){var a=t.getLineContent(r),u=a.length,l=0,c=0,h=0,d=1,f=!1,p=!1,g=!1;while(l=0?(i+=n?1:-1,i<0?i=e.length-1:i%=e.length,e[i]):null},e.INSTANCE=new e,e}(),bl=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),wl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return bl(t,e),Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._versionId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"eol",{get:function(){return this._eol},enumerable:!0,configurable:!0}),t.prototype.getValue=function(){return this.getText()},t.prototype.getLinesContent=function(){return this._lines.slice(0)},t.prototype.getLineCount=function(){return this._lines.length},t.prototype.getLineContent=function(e){return this._lines[e-1]},t.prototype.getWordAtPosition=function(e,t){var n=tt(e.column,Je(t),this._lines[e.lineNumber-1],0);return n?new In(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn):null},t.prototype.getWordUntilPosition=function(e,t){var n=this.getWordAtPosition(e,t);return n?{word:this._lines[e.lineNumber-1].substring(n.startColumn-1,e.column-1),startColumn:n.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}},t.prototype.createWordIterator=function(e){var t,n,i=this,o=0,r=0,s=[],a=function(){if(r=i._lines.length?k:(n=i._lines[o],s=i._wordenize(n,e),r=0,o+=1,a())};return{next:a}},t.prototype.getLineWords=function(e,t){for(var n=this._lines[e-1],i=this._wordenize(n,t),o=[],r=0,s=i;rthis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,i=!0;else{var o=this._lines[t-1].length+1;n<1?(n=1,i=!0):n>o&&(n=o,i=!0)}return i?{lineNumber:t,column:n}:e},t}(ll),Cl=function(){function e(e){this._foreignModuleFactory=e,this._foreignModule=null}return e.prototype.computeDiff=function(e,t,n){var i=this._getModel(e),o=this._getModel(t);if(!i||!o)return Promise.resolve(null);var r=i.getLinesContent(),s=o.getLinesContent(),a=new tl(r,s,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:n,shouldMakePrettyDiff:!0}),u=a.computeDiff(),l=!(u.length>0)&&this._modelsAreIdentical(i,o);return Promise.resolve({identical:l,changes:u})},e.prototype._modelsAreIdentical=function(e,t){var n=e.getLineCount(),i=t.getLineCount();if(n!==i)return!1;for(var o=1;o<=n;o++){var r=e.getLineContent(o),s=t.getLineContent(o);if(r!==s)return!1}return!0},e.prototype.computeMoreMinimalEdits=function(t,n){var i=this._getModel(t);if(!i)return Promise.resolve(n);var o=[],r=void 0;n=pe(n,(function(e,t){if(e.range&&t.range)return In.compareRangesUsingStarts(e.range,t.range);var n=e.range?0:1,i=t.range?0:1;return n-i}));for(var s=0,a=n;se._diffLimit)o.push({range:l,text:c});else for(var f=Hu(d,c,!1),p=i.offsetAt(In.lift(l).getStartPosition()),g=0,m=f;g=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},El=function(e,t){return function(n,i){t(n,i,e)}},Ol=6e4,Dl=3e5;function Il(e,t){var n=e.getModel(t);return!!n&&!n.isTooLargeForSyncing()}var Ml=function(e){function t(t,n){var i=e.call(this)||this;return i._modelService=t,i._workerManager=i._register(new Pl(i._modelService)),i._register(qa.register("*",{provideLinks:function(e,t){return Il(i._modelService,e.uri)?i._workerManager.withWorker().then((function(t){return t.computeLinks(e.uri)})):Promise.resolve([])}})),i._register(Pa.register("*",new Tl(i._workerManager,n,i._modelService))),i}return kl(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.canComputeDiff=function(e,t){return Il(this._modelService,e)&&Il(this._modelService,t)},t.prototype.computeDiff=function(e,t,n){return this._workerManager.withWorker().then((function(i){return i.computeDiff(e,t,n)}))},t.prototype.computeMoreMinimalEdits=function(e,t){return Array.isArray(t)&&0!==t.length&&Il(this._modelService,e)?this._workerManager.withWorker().then((function(n){return n.computeMoreMinimalEdits(e,t)})):Promise.resolve(t)},t.prototype.canNavigateValueSet=function(e){return Il(this._modelService,e)},t.prototype.navigateValueSet=function(e,t,n){return this._workerManager.withWorker().then((function(i){return i.navigateValueSet(e,t,n)}))},t.prototype.canComputeWordRanges=function(e){return Il(this._modelService,e)},t.prototype.computeWordRanges=function(e,t){return this._workerManager.withWorker().then((function(n){return n.computeWordRanges(e,t)}))},t=Nl([El(0,_a),El(1,xl)],t),t}(S),Tl=function(){function e(e,t,n){this._workerManager=e,this._configurationService=t,this._modelService=n}return e.prototype.provideCompletionItems=function(e,t){var n=this._configurationService.getValue(e.uri,t,"editor").wordBasedSuggestions;if(n&&Il(this._modelService,e.uri))return this._workerManager.withWorker().then((function(n){return n.textualSuggest(e.uri,t)}))},e}(),Pl=function(e){function t(t){var n=e.call(this)||this;n._modelService=t,n._editorWorkerClient=null;var i=n._register(new ie);return i.cancelAndSet((function(){return n._checkStopIdleWorker()}),Math.round(Dl/2)),n._register(n._modelService.onModelRemoved((function(e){return n._checkStopEmptyWorker()}))),n}return kl(t,e),t.prototype.dispose=function(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),e.prototype.dispose.call(this)},t.prototype._checkStopEmptyWorker=function(){if(this._editorWorkerClient){var e=this._modelService.getModels();0===e.length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}},t.prototype._checkStopIdleWorker=function(){if(this._editorWorkerClient){var e=(new Date).getTime()-this._lastWorkerUsedTime;e>Dl&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}},t.prototype.withWorker=function(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new Fl(this._modelService,"editorWorkerService")),Promise.resolve(this._editorWorkerClient)},t}(S),Al=function(e){function t(t,n,i){var o=e.call(this)||this;if(o._syncedModels=Object.create(null),o._syncedModelsLastUsedTime=Object.create(null),o._proxy=t,o._modelService=n,!i){var r=new ie;r.cancelAndSet((function(){return o._checkStopModelSync()}),Math.round(Ol/2)),o._register(r)}return o}return kl(t,e),t.prototype.dispose=function(){for(var t in this._syncedModels)y(this._syncedModels[t]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),e.prototype.dispose.call(this)},t.prototype.esureSyncedResources=function(e){for(var t=0;tOl&&t.push(n)}for(var o=0;o>>1,this._text=t}return e.prototype.equals=function(t){return t instanceof e&&this.slicedEquals(t,0,this._tokensCount)},e.prototype.slicedEquals=function(e,t,n){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;for(var i=t<<1,o=i+(n<<1),r=i;r0?this._tokens[e-1<<1]:0},e.prototype.getLanguageId=function(e){var t=this._tokens[1+(e<<1)];return ka.getLanguageId(t)},e.prototype.getStandardTokenType=function(e){var t=this._tokens[1+(e<<1)];return ka.getTokenType(t)},e.prototype.getForeground=function(e){var t=this._tokens[1+(e<<1)];return ka.getForeground(t)},e.prototype.getClassName=function(e){var t=this._tokens[1+(e<<1)];return ka.getClassNameFromMetadata(t)},e.prototype.getInlineStyle=function(e,t){var n=this._tokens[1+(e<<1)];return ka.getInlineStyleFromMetadata(n,t)},e.prototype.getEndOffset=function(e){return this._tokens[e<<1]},e.prototype.findTokenIndexAtOffset=function(t){return e.findIndexInTokensArray(this._tokens,t)},e.prototype.inflate=function(){return this},e.prototype.sliceAndInflate=function(e,t,n){return new zl(this,e,t,n)},e.convertToEndOffset=function(e,t){for(var n=e.length>>>1,i=n-1,o=0;o>>1)-1;while(nt&&(i=o)}return n},e}(),zl=function(){function e(e,t,n,i){this._source=e,this._startOffset=t,this._endOffset=n,this._deltaOffset=i,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(var o=this._firstTokenIndex,r=e.getCount();o=n)break;this._tokensCount++}}return e.prototype.equals=function(t){return t instanceof e&&(this._startOffset===t._startOffset&&this._endOffset===t._endOffset&&this._deltaOffset===t._deltaOffset&&this._source.slicedEquals(t._source,this._firstTokenIndex,this._tokensCount))},e.prototype.getCount=function(){return this._tokensCount},e.prototype.getForeground=function(e){return this._source.getForeground(this._firstTokenIndex+e)},e.prototype.getEndOffset=function(e){var t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset},e.prototype.getClassName=function(e){return this._source.getClassName(this._firstTokenIndex+e)},e.prototype.getInlineStyle=function(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)},e.prototype.findTokenIndexAtOffset=function(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex},e}();Bl="undefined"!==typeof TextDecoder?function(e){return new Ul(e)}:function(e){return new $l};var Ul=function(){function e(e){this._decoder=new TextDecoder("UTF-16LE"),this._capacity=0|e,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}return e.prototype.reset=function(){this._completedStrings=null,this._bufferLength=0},e.prototype.build=function(){return null!==this._completedStrings?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()},e.prototype._buildBuffer=function(){if(0===this._bufferLength)return"";var e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return this._decoder.decode(e)},e.prototype._flushBuffer=function(){var e=this._buildBuffer();this._bufferLength=0,null===this._completedStrings?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e},e.prototype.write1=function(e){var t=this._capacity-this._bufferLength;t<=1&&(0===t||vr(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e},e.prototype.appendASCII=function(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e},e.prototype.appendASCIIString=function(e){var t=e.length;if(this._bufferLength+t>=this._capacity)return this._flushBuffer(),void(this._completedStrings[this._completedStrings.length]=e);for(var n=0;nn)&&(!c.isEmpty()||0!==l.type&&3!==l.type)){var h=c.startLineNumber===n?c.startColumn:i,d=c.endLineNumber===n?c.endColumn:o;r[s++]=new e(h,d,l.inlineClassName,l.type)}}return r},e.compare=function(e,t){return e.startColumn===t.startColumn?e.endColumn===t.endColumn?e.classNamet.className?1:0:e.endColumn-t.endColumn:e.startColumn-t.startColumn},e}(),ql=function(){function e(e,t,n){this.startOffset=e,this.endOffset=t,this.className=n}return e}(),Gl=function(){function e(){this.stopOffsets=[],this.classNames=[],this.count=0}return e.prototype.consumeLowerThan=function(e,t,n){while(this.count>0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t);break}this.count++},e}(),Yl=function(){function e(){}return e.normalize=function(e,t){if(0===t.length)return[];for(var n=[],i=new Gl,o=0,r=0,s=t.length;r1){var h=e.charCodeAt(u-2);vr(h)&&u--}if(l>1){h=e.charCodeAt(l-2);vr(h)&&l--}var d=u-1,f=l-2;o=i.consumeLowerThan(d,o,n),0===i.count&&(o=d),i.insert(f,c)}return i.consumeLowerThan(1073741824,o,n),n},e}(),Zl=function(){function e(e,t){this.endIndex=e,this.type=t}return e}(),Xl=function(){function e(e,t,n,i,o,r,s,a,u,l,c,h,d,f,p){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.continuesWithWrappedLine=i,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=s,this.lineTokens=a,this.lineDecorations=u,this.tabSize=l,this.spaceWidth=c,this.stopRenderingLineAfter=h,this.renderWhitespace="all"===d?2:"boundary"===d?1:0,this.renderControlCharacters=f,this.fontLigatures=p}return e.prototype.equals=function(e){return this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineContent===e.lineContent&&this.continuesWithWrappedLine===e.continuesWithWrappedLine&&this.isBasicASCII===e.isBasicASCII&&this.containsRTL===e.containsRTL&&this.fauxIndentLength===e.fauxIndentLength&&this.tabSize===e.tabSize&&this.spaceWidth===e.spaceWidth&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.fontLigatures===e.fontLigatures&&Kl.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)},e}(),Jl=function(){function e(e,t){this.length=e,this._data=new Uint32Array(this.length),this._absoluteOffsets=new Uint32Array(this.length)}return e.getPartIndex=function(e){return(4294901760&e)>>>16},e.getCharIndex=function(e){return(65535&e)>>>0},e.prototype.setPartData=function(e,t,n,i){var o=(t<<16|n<<0)>>>0;this._data[e]=o,this._absoluteOffsets[e]=i+n},e.prototype.getAbsoluteOffsets=function(){return this._absoluteOffsets},e.prototype.charOffsetToPartData=function(e){return 0===this.length?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]},e.prototype.partDataToCharOffset=function(t,n,i){if(0===this.length)return 0;var o=(t<<16|i<<0)>>>0,r=0,s=this.length-1;while(r+1>>1,u=this._data[a];if(u===o)return a;u>o?s=a:r=a}if(r===s)return r;var l=this._data[r],c=this._data[s];if(l===o)return r;if(c===o)return s;var h,d=e.getPartIndex(l),f=e.getCharIndex(l),p=e.getPartIndex(c);h=d!==p?n:e.getCharIndex(c);var g=i-f,m=h-i;return g<=m?r:s},e}(),Ql=function(){function e(e,t,n){this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=n}return e}();function ec(e,t){if(0===e.lineContent.length){var n=0,i=" ";if(e.lineDecorations.length>0){for(var o=[],r=0,s=e.lineDecorations.length;r')}return t.appendASCIIString(i),new Ql(new Jl(0,0),!1,n)}return lc(oc(e),t)}var tc=function(){function e(e,t,n,i){this.characterMapping=e,this.html=t,this.containsRTL=n,this.containsForeignElements=i}return e}();function nc(e){var t=Bl(1e4),n=ec(e,t);return new tc(n.characterMapping,t.build(),n.containsRTL,n.containsForeignElements)}var ic=function(){function e(e,t,n,i,o,r,s,a,u,l,c,h){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.len=i,this.isOverflowing=o,this.parts=r,this.containsForeignElements=s,this.tabSize=a,this.containsRTL=u,this.spaceWidth=l,this.renderWhitespace=c,this.renderControlCharacters=h}return e}();function oc(e){var t,n,i=e.useMonospaceOptimizations,o=e.lineContent;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter0){for(var a=0,u=e.lineDecorations.length;a0&&(i[o++]=new Zl(t,""));for(var r=0,s=e.getCount();r=n){i[o++]=new Zl(n,u);break}i[o++]=new Zl(a,u)}}return i}function sc(e,t,n){var i=0,o=[],r=0;if(n)for(var s=0,a=t.length;s=50&&(o[r++]=new Zl(h+1,c),d=h+1,h=-1);d!==l&&(o[r++]=new Zl(l,c))}else o[r++]=u;i=l}else for(s=0,a=t.length;s50){c=u.type;var g=Math.ceil(p/50);for(f=1;fu)b=!0;else if(9===_)b=!0;else if(32===_)if(a)if(y)b=!0;else{var w=v+1=r)&&(l[c++]=new Zl(v,"vs-whitespace"),m%=r):(v===f||b&&v>o)&&(l[c++]=new Zl(v,d),m%=r),9===_?m=r:kr(_)?m+=2:m++,y=b,v===f&&(h++,h0?e.charCodeAt(t-1):0,x=t>1?e.charCodeAt(t-2):0,L=32===S&&32!==x&&9!==x;L||(C=!0)}else C=!0;return l[c++]=new Zl(t,C?"vs-whitespace":d),l}function uc(e,t,n,i){i.sort(Kl.compare);for(var o=Yl.normalize(e,i),r=o.length,s=0,a=[],u=0,l=0,c=0,h=n.length;cl&&(l=g.startOffset,a[u++]=new Zl(l,p)),!(g.endOffset+1<=f)){l=f,a[u++]=new Zl(l,p+" "+g.className);break}l=g.endOffset+1,a[u++]=new Zl(l,p+" "+g.className),s++}f>l&&(l=f,a[u++]=new Zl(l,p))}var m=n[n.length-1].endIndex;if(s");for(var b=0,w=u.length;b=0;if(v=0,t.appendASCIIString('0&&(!i||D>1?t.write1(8594):t.write1(65515),D--);while(D>0)t.write1(160),D--}else t.write1(183);v++}_=k}else{k=0;for(c&&t.appendASCIIString(' dir="ltr"'),t.appendASCII(62);g0)t.write1(160),k++,D--;break;case 32:t.write1(160),k++;break;case 60:t.appendASCIIString("<"),k++;break;case 62:t.appendASCIIString(">"),k++;break;case 38:t.appendASCIIString("&"),k++;break;case 0:t.appendASCIIString("�"),k++;break;case 65279:case 8232:t.write1(65533),k++;break;default:kr(O)&&m++,f&&O<32?(t.write1(9216+O),k++):(t.write1(O),k++)}v++}_=k}t.appendASCIIString("")}return p.setPartData(s,u.length-1,v,y),a&&t.appendASCIIString(""),t.appendASCIIString(""),new Ql(p,c,o)}var cc,hc=function(){function e(e,t,n,i){this.top=0|e,this.left=0|t,this.width=0|n,this.height=0|i}return e}(),dc=function(){function e(e,t){this.tabSize=e,this.data=t}return e}(),fc=function(){function e(e,t,n,i,o){this.content=e,this.continuesWithWrappedLine=t,this.minColumn=n,this.maxColumn=i,this.tokens=o}return e}(),pc=function(){function e(t,n,i,o,r,s,a,u,l){this.minColumn=t,this.maxColumn=n,this.content=i,this.continuesWithWrappedLine=o,this.isBasicASCII=e.isBasicASCII(i,s),this.containsRTL=e.containsRTL(i,this.isBasicASCII,r),this.tokens=a,this.inlineDecorations=u,this.tabSize=l}return e.isBasicASCII=function(e,t){return!t||xr(e)},e.containsRTL=function(e,t,n){return!(t||!n)&&br(e)},e}(),gc=function(){function e(e,t,n){this.range=e,this.inlineClassName=t,this.type=n}return e}(),mc=function(){function e(e,t){this.range=e,this.options=t}return e}(),vc=function(){function e(){}return e.colorizeElement=function(e,t,n,i){i=i||{};var o=i.theme||"vs",r=i.mimeType||n.getAttribute("lang")||n.getAttribute("data-lang");if(!r)return console.error("Mode not detected"),Promise.resolve();e.setTheme(o);var s=n.firstChild?n.firstChild.nodeValue:"";n.className+=" "+o;var a=function(e){n.innerHTML=e};return this.colorize(t,s||"",r,i).then(a,(function(e){return console.error(e)}))},e.colorize=function(e,t,n,i){var o=4;i&&"number"===typeof i.tabSize&&(o=i.tabSize),Er(t)&&(t=t.substr(1));var r=t.split(/\r\n|\r|\n/),s=e.getModeId(n);if(!s)return Promise.resolve(yc(r,o));e.triggerMode(s);var a=Za.get(s);return a?Promise.resolve(_c(r,o,a)):new Promise((function(e,t){var n=null,i=null,a=function(){n&&(n.dispose(),n=null),i&&(i.dispose(),i=null);var t=Za.get(s);return e(t?_c(r,o,t):yc(r,o))};i=new ne,i.cancelAndSet(a,500),n=Za.onDidChange((function(e){e.changedLanguages.indexOf(s)>=0&&a()}))}))},e.colorizeLine=function(e,t,n,i,o){void 0===o&&(o=4);var r=pc.isBasicASCII(e,t),s=pc.containsRTL(e,r,n),a=nc(new Xl(!1,!0,e,!1,r,s,0,i,[],o,0,-1,"none",!1,!1));return a.html},e.colorizeModelLine=function(e,t,n){void 0===n&&(n=4);var i=e.getLineContent(t);e.forceTokenization(t);var o=e.getLineTokens(t),r=o.inflate();return this.colorizeLine(i,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,n)},e}();function _c(e,t,n){return bc(e,t,n)}function yc(e,t){var n=[],i=16793600,o=new Uint32Array(2);o[0]=0,o[1]=i;for(var r=0,s=e.length;r")}return n.join("")}function bc(e,t,n){for(var i=[],o=n.getInitialState(),r=0,s=e.length;r"),o=u.endState}return i.join("")}(function(e){e[e["Ignore"]=0]="Ignore",e[e["Info"]=1]="Info",e[e["Warning"]=2]="Warning",e[e["Error"]=3]="Error"})(cc||(cc={})),function(e){var t="error",n="warning",i="warn",o="info",r=Object.create(null);function s(r){return r?dr(t,r)?e.Error:dr(n,r)||dr(i,r)?e.Warning:dr(o,r)?e.Info:e.Ignore:e.Ignore}r[e.Error]=le("sev.error","Error"),r[e.Warning]=le("sev.warning","Warning"),r[e.Info]=le("sev.info","Info"),e.fromValue=s}(cc||(cc={}));var wc=cc;function Cc(e){return!(!e||"function"!==typeof e.getEditorType)&&e.getEditorType()===ks.ICodeEditor}var Sc=function(){function e(){this.data={}}return e.prototype.add=function(e,t){ss(Ee(e)),ss(Oe(t)),ss(!this.data.hasOwnProperty(e),"There is already an extension with this id"),this.data[e]=t},e.prototype.as=function(e){return this.data[e]||null},e}(),xc=new Sc,Lc={JSONContribution:"base.contributions.json"};function kc(e){return e.length>0&&"#"===e.charAt(e.length-1)?e.substring(0,e.length-1):e}var Nc=function(){function e(){this._onDidChangeSchema=new T,this.schemasById={}}return e.prototype.registerSchema=function(e,t){this.schemasById[kc(e)]=t,this._onDidChangeSchema.fire(e)},e}(),Ec=new Nc;xc.add(Lc.JSONContribution,Ec);var Oc={Configuration:"base.contributions.configuration"},Dc={properties:{},patternProperties:{}},Ic={properties:{},patternProperties:{}},Mc={properties:{},patternProperties:{}},Tc={properties:{},patternProperties:{}},Pc="vscode://schemas/settings/editor",Ac=xc.as(Lc.JSONContribution),Rc=function(){function e(){this.overrideIdentifiers=[],this._onDidSchemaChange=new T,this._onDidRegisterConfiguration=new T,this.configurationContributors=[],this.editorConfigurationSchema={properties:{},patternProperties:{},additionalProperties:!1,errorMessage:"Unknown editor configuration setting"},this.configurationProperties={},this.excludedConfigurationProperties={},this.computeOverridePropertyPattern(),Ac.registerSchema(Pc,this.editorConfigurationSchema)}return e.prototype.registerConfiguration=function(e,t){void 0===t&&(t=!0),this.registerConfigurations([e],[],t)},e.prototype.registerConfigurations=function(e,t,n){var i=this;void 0===n&&(n=!0);var o=this.toConfiguration(t);o&&e.push(o);var r=[];e.forEach((function(e){r.push.apply(r,i.validateAndRegisterProperties(e,n)),i.configurationContributors.push(e),i.registerJSONConfiguration(e),i.updateSchemaForOverrideSettingsConfiguration(e)})),this._onDidRegisterConfiguration.fire(r)},e.prototype.registerOverrideIdentifiers=function(e){var t;(t=this.overrideIdentifiers).push.apply(t,e),this.updateOverridePropertyPatternKey()},e.prototype.toConfiguration=function(e){for(var t={id:"defaultOverrides",title:le("defaultConfigurations.title","Default Configuration Overrides"),properties:{}},n=0,i=e;n console.log` because `log` has been completed recently."),le("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],default:"recentlyUsed",description:le("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")},"editor.suggestFontSize":{type:"integer",default:0,minimum:0,markdownDescription:le("suggestFontSize","Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.")},"editor.suggestLineHeight":{type:"integer",default:0,minimum:0,markdownDescription:le("suggestLineHeight","Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used.")},"editor.tabCompletion":{type:"string",default:"off",enum:["on","off","onlySnippets"],enumDescriptions:[le("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),le("tabCompletion.off","Disable tab completions."),le("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:le("tabCompletion","Enables tab completions.")},"editor.suggest.filterGraceful":{type:"boolean",default:!0,description:le("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:!1,description:le("suggest.localityBonus","Controls whether sorting favours words that appear close to the cursor.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:!0,description:le("suggest.snippetsPreventQuickSuggestions","Control whether an active snippet prevents quick suggestions.")},"editor.selectionHighlight":{type:"boolean",default:$c.contribInfo.selectionHighlight,description:le("selectionHighlight","Controls whether the editor should highlight matches similar to the selection")},"editor.occurrencesHighlight":{type:"boolean",default:$c.contribInfo.occurrencesHighlight,description:le("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")},"editor.overviewRulerLanes":{type:"integer",default:3,description:le("overviewRulerLanes","Controls the number of decorations that can show up at the same position in the overview ruler.")},"editor.overviewRulerBorder":{type:"boolean",default:$c.viewInfo.overviewRulerBorder,description:le("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")},"editor.cursorBlinking":{type:"string",enum:["blink","smooth","phase","expand","solid"],default:ot($c.viewInfo.cursorBlinking),description:le("cursorBlinking","Control the cursor animation style.")},"editor.mouseWheelZoom":{type:"boolean",default:$c.viewInfo.mouseWheelZoom,markdownDescription:le("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")},"editor.cursorStyle":{type:"string",enum:["block","block-outline","line","line-thin","underline","underline-thin"],default:rt($c.viewInfo.cursorStyle),description:le("cursorStyle","Controls the cursor style.")},"editor.cursorWidth":{type:"integer",default:$c.viewInfo.cursorWidth,markdownDescription:le("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")},"editor.fontLigatures":{type:"boolean",default:$c.viewInfo.fontLigatures,description:le("fontLigatures","Enables/Disables font ligatures.")},"editor.hideCursorInOverviewRuler":{type:"boolean",default:$c.viewInfo.hideCursorInOverviewRuler,description:le("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")},"editor.renderWhitespace":{type:"string",enum:["none","boundary","all"],enumDescriptions:["",le("renderWhiteSpace.boundary","Render whitespace characters except for single spaces between words."),""],default:$c.viewInfo.renderWhitespace,description:le("renderWhitespace","Controls how the editor should render whitespace characters.")},"editor.renderControlCharacters":{type:"boolean",default:$c.viewInfo.renderControlCharacters,description:le("renderControlCharacters","Controls whether the editor should render control characters.")},"editor.renderIndentGuides":{type:"boolean",default:$c.viewInfo.renderIndentGuides,description:le("renderIndentGuides","Controls whether the editor should render indent guides.")},"editor.highlightActiveIndentGuide":{type:"boolean",default:$c.viewInfo.highlightActiveIndentGuide,description:le("highlightActiveIndentGuide","Controls whether the editor should highlight the active indent guide.")},"editor.renderLineHighlight":{type:"string",enum:["none","gutter","line","all"],enumDescriptions:["","","",le("renderLineHighlight.all","Highlights both the gutter and the current line.")],default:$c.viewInfo.renderLineHighlight,description:le("renderLineHighlight","Controls how the editor should render the current line highlight.")},"editor.codeLens":{type:"boolean",default:$c.contribInfo.codeLens,description:le("codeLens","Controls whether the editor shows CodeLens")},"editor.folding":{type:"boolean",default:$c.contribInfo.folding,description:le("folding","Controls whether the editor has code folding enabled")},"editor.foldingStrategy":{type:"string",enum:["auto","indentation"],default:$c.contribInfo.foldingStrategy,markdownDescription:le("foldingStrategy","Controls the strategy for computing folding ranges. `auto` uses a language specific folding strategy, if available. `indentation` uses the indentation based folding strategy.")},"editor.showFoldingControls":{type:"string",enum:["always","mouseover"],default:$c.contribInfo.showFoldingControls,description:le("showFoldingControls","Controls whether the fold controls on the gutter are automatically hidden.")},"editor.matchBrackets":{type:"boolean",default:$c.contribInfo.matchBrackets,description:le("matchBrackets","Highlight matching brackets when one of them is selected.")},"editor.glyphMargin":{type:"boolean",default:$c.viewInfo.glyphMargin,description:le("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")},"editor.useTabStops":{type:"boolean",default:$c.useTabStops,description:le("useTabStops","Inserting and deleting whitespace follows tab stops.")},"editor.trimAutoWhitespace":{type:"boolean",default:qc.trimAutoWhitespace,description:le("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:le("stablePeek","Keep peek editors open even when double clicking their content or when hitting `Escape`.")},"editor.dragAndDrop":{type:"boolean",default:$c.dragAndDrop,description:le("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")},"editor.accessibilitySupport":{type:"string",enum:["auto","on","off"],enumDescriptions:[le("accessibilitySupport.auto","The editor will use platform APIs to detect when a Screen Reader is attached."),le("accessibilitySupport.on","The editor will be permanently optimized for usage with a Screen Reader."),le("accessibilitySupport.off","The editor will never be optimized for usage with a Screen Reader.")],default:$c.accessibilitySupport,description:le("accessibilitySupport","Controls whether the editor should run in a mode where it is optimized for screen readers.")},"editor.showUnused":{type:"boolean",default:$c.showUnused,description:le("showUnused","Controls fading out of unused code.")},"editor.links":{type:"boolean",default:$c.contribInfo.links,description:le("links","Controls whether the editor should detect links and make them clickable.")},"editor.colorDecorators":{type:"boolean",default:$c.contribInfo.colorDecorators,description:le("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")},"editor.lightbulb.enabled":{type:"boolean",default:$c.contribInfo.lightbulbEnabled,description:le("codeActions","Enables the code action lightbulb in the editor.")},"editor.codeActionsOnSave":{type:"object",properties:{"source.organizeImports":{type:"boolean",description:le("codeActionsOnSave.organizeImports","Controls whether organize imports action should be run on file save.")}},additionalProperties:{type:"boolean"},default:$c.contribInfo.codeActionsOnSave,description:le("codeActionsOnSave","Code action kinds to be run on save.")},"editor.codeActionsOnSaveTimeout":{type:"number",default:$c.contribInfo.codeActionsOnSaveTimeout,description:le("codeActionsOnSaveTimeout","Timeout in milliseconds after which the code actions that are run on save are cancelled.")},"editor.selectionClipboard":{type:"boolean",default:$c.contribInfo.selectionClipboard,description:le("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:o["c"]},"diffEditor.renderSideBySide":{type:"boolean",default:!0,description:le("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:!0,description:le("ignoreTrimWhitespace","Controls whether the diff editor shows changes in leading or trailing whitespace as diffs.")},"editor.largeFileOptimizations":{type:"boolean",default:qc.largeFileOptimizations,description:le("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"diffEditor.renderIndicators":{type:"boolean",default:!0,description:le("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")}}},Qc=null;function eh(){return null===Qc&&(Qc=Object.create(null),Object.keys(Jc.properties).forEach((function(e){Qc[e]=!0}))),Qc}function th(e){var t=eh();return t["editor."+e]||!1}function nh(e){var t=eh();return t["diffEditor."+e]||!1}Xc.registerConfiguration(Jc);var ih=function(){function e(){}return e.insert=function(e,t){return{range:new In(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}},e.delete=function(e){return{range:e,text:null}},e.replace=function(e,t){return{range:e,text:t}},e.replaceMove=function(e,t){return{range:e,text:t,forceMoveMarkers:!0}},e}(),oh=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),rh=function(){function e(){}return e.has=function(e){return new ah(e)},e.equals=function(e,t){return new uh(e,t)},e.regex=function(e,t){return new hh(e,t)},e.not=function(e){return new ch(e)},e.and=function(){for(var e=[],t=0;t=0){var t=e.split("!=");return new lh(t[0].trim(),this._deserializeValue(t[1]))}if(e.indexOf("==")>=0){t=e.split("==");return new uh(t[0].trim(),this._deserializeValue(t[1]))}if(e.indexOf("=~")>=0){t=e.split("=~");return new hh(t[0].trim(),this._deserializeRegexValue(t[1]))}return/^\!\s*/.test(e)?new ch(e.substr(1).trim()):new ah(e)},e._deserializeValue=function(e){if(e=e.trim(),"true"===e)return!0;if("false"===e)return!1;var t=/^'([^']*)'$/.exec(e);return t?t[1].trim():e},e._deserializeRegexValue=function(e){if($o(e))return console.warn("missing regexp-value for =~-expression"),null;var t=e.indexOf("/"),n=e.lastIndexOf("/");if(t===n||t<0)return console.warn("bad regexp-value '"+e+"', missing /-enclosure"),null;var i=e.slice(t+1,n),o="i"===e[n+1]?"i":"";try{return new RegExp(i,o)}catch(r){return console.warn("bad regexp-value '"+e+"', parse error: "+r),null}},e}();function sh(e,t){var n=e.getType(),i=t.getType();if(n!==i)return n-i;switch(n){case 1:return e.cmp(t);case 2:return e.cmp(t);case 3:return e.cmp(t);case 4:return e.cmp(t);case 6:return e.cmp(t);default:throw new Error("Unknown ContextKeyExpr!")}}var ah=function(){function e(e){this.key=e}return e.prototype.getType=function(){return 1},e.prototype.cmp=function(e){return this.keye.key?1:0},e.prototype.equals=function(t){return t instanceof e&&this.key===t.key},e.prototype.evaluate=function(e){return!!e.getValue(this.key)},e.prototype.normalize=function(){return this},e.prototype.keys=function(){return[this.key]},e}(),uh=function(){function e(e,t){this.key=e,this.value=t}return e.prototype.getType=function(){return 3},e.prototype.cmp=function(e){return this.keye.key?1:this.valuee.value?1:0},e.prototype.equals=function(t){return t instanceof e&&(this.key===t.key&&this.value===t.value)},e.prototype.evaluate=function(e){return e.getValue(this.key)==this.value},e.prototype.normalize=function(){return"boolean"===typeof this.value?this.value?new ah(this.key):new ch(this.key):this},e.prototype.keys=function(){return[this.key]},e}(),lh=function(){function e(e,t){this.key=e,this.value=t}return e.prototype.getType=function(){return 4},e.prototype.cmp=function(e){return this.keye.key?1:this.valuee.value?1:0},e.prototype.equals=function(t){return t instanceof e&&(this.key===t.key&&this.value===t.value)},e.prototype.evaluate=function(e){return e.getValue(this.key)!=this.value},e.prototype.normalize=function(){return"boolean"===typeof this.value?this.value?new ch(this.key):new ah(this.key):this},e.prototype.keys=function(){return[this.key]},e}(),ch=function(){function e(e){this.key=e}return e.prototype.getType=function(){return 2},e.prototype.cmp=function(e){return this.keye.key?1:0},e.prototype.equals=function(t){return t instanceof e&&this.key===t.key},e.prototype.evaluate=function(e){return!e.getValue(this.key)},e.prototype.normalize=function(){return this},e.prototype.keys=function(){return[this.key]},e}(),hh=function(){function e(e,t){this.key=e,this.regexp=t}return e.prototype.getType=function(){return 6},e.prototype.cmp=function(e){if(this.keye.key)return 1;var t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return tn?1:0},e.prototype.equals=function(t){if(t instanceof e){var n=this.regexp?this.regexp.source:"",i=t.regexp?t.regexp.source:"";return this.key===t.key&&n===i}return!1},e.prototype.evaluate=function(e){var t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)},e.prototype.normalize=function(){return this},e.prototype.keys=function(){return[this.key]},e}(),dh=function(){function e(t){this.expr=e._normalizeArr(t)}return e.prototype.getType=function(){return 5},e.prototype.equals=function(t){if(t instanceof e){if(this.expr.length!==t.expr.length)return!1;for(var n=0,i=this.expr.length;n=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},wh=function(e,t){return function(n,i){t(n,i,e)}};function Ch(e){return void 0!==e.command}var Sh=function(){function e(){this.id=String(e.ID++)}return e.ID=1,e.EditorContext=new e,e.CommandPalette=new e,e.MenubarEditMenu=new e,e.MenubarSelectionMenu=new e,e.MenubarGoMenu=new e,e}(),xh=jn("menuService"),Lh=new(function(){function e(){this._commands=Object.create(null),this._menuItems=Object.create(null)}return e.prototype.addCommand=function(e){var t=this._commands[e.id];return this._commands[e.id]=e,void 0!==t},e.prototype.getCommand=function(e){return this._commands[e]},e.prototype.getCommands=function(){var e=Object.create(null);for(var t in this._commands)e[t]=this.getCommand(t);return e},e.prototype.appendMenuItem=function(e,t){var n=e.id,i=this._menuItems[n];return i?i.push(t):this._menuItems[n]=i=[t],{dispose:function(){var e=i.indexOf(t);e>=0&&i.splice(e,1)}}},e.prototype.getMenuItems=function(e){var t=e.id,n=this._menuItems[t]||[];return t===Sh.CommandPalette.id&&this._appendImplicitItems(n),n},e.prototype._appendImplicitItems=function(e){for(var t=new Set,n=e.filter((function(e){return Ch(e)})),i=0,o=n;i=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},Dh=function(e,t){return function(n,i){t(n,i,e)}},Ih=function(){function e(t,n,i,o){var r=this;this._commandService=i,this._contextKeyService=o,this._menuGroups=[],this._disposables=[],this._onDidChange=new T,n.then((function(n){var i,o=Lh.getMenuItems(t),s=new Set;o.sort(e._compareMenuItems);for(var a=0,u=o;a0&&t.push([r,a])}return t},e._fillInKbExprKeys=function(e,t){if(e)for(var n=0,i=e.keys();ns)return 1;var a="string"===typeof e.command.title?e.command.title:e.command.title.value,u="string"===typeof t.command.title?t.command.title:t.command.title.value;return a.localeCompare(u)},e=Oh([Dh(2,Qr),Dh(3,ph)],e),e}(),Mh=jn("configurationService");function Th(e,t){var n=Object.create(null);for(var i in e)Ph(n,i,e[i],t);return n}function Ph(e,t,n,i){for(var o=t.split("."),r=o.pop(),s=e,a=0;a5e3&&n._leaveChordMode():n._leaveChordMode()}),500)},t.prototype._leaveChordMode=function(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChord=null},t.prototype._dispatch=function(e,t){var n=this,i=!1,o=this.resolveKeyboardEvent(e);if(o.isChord())return console.warn("Unexpected keyboard event mapped to a chord"),!1;var r=o.getDispatchParts()[0];if(null===r)return i;var s=this._contextKeyService.getContext(t),a=this._currentChord?this._currentChord.keypress:null,u=o.getLabel(),l=this._getResolver().resolve(s,a,r);return l&&l.enterChord?(i=!0,this._enterChordMode(r,u),i):(this._statusService&&this._currentChord&&(l&&l.commandId||(this._statusService.setStatusMessage(le("missing.chord","The key combination ({0}, {1}) is not a command.",this._currentChord.label,u),1e4),i=!0)),this._leaveChordMode(),l&&l.commandId&&(l.bubble||(i=!0),"undefined"===typeof l.commandArgs?this._commandService.executeCommand(l.commandId).then(void 0,(function(e){return n._notificationService.warn(e)})):this._commandService.executeCommand(l.commandId,l.commandArgs).then(void 0,(function(e){return n._notificationService.warn(e)})),this._telemetryService.publicLog("workbenchActionExecuted",{id:l.commandId,from:"keybinding"})),i)},t}(S),qh=function(){function e(t,n){this._defaultKeybindings=t,this._defaultBoundCommands=new Map;for(var i=0,o=t.length;i=0;c--)this._isTargetedForRemoval(e[c],a,u,s,l)&&e.splice(c,1);else n.push(r)}return e.concat(n)},e.prototype._addKeyPress=function(t,n){var i=this._map.get(t);if("undefined"===typeof i)return this._map.set(t,[n]),void this._addToLookupMap(n);for(var o=i.length-1;o>=0;o--){var r=i[o];if(r.command!==n.command){var s=null!==r.keypressChordPart,a=null!==n.keypressChordPart;s&&a&&r.keypressChordPart!==n.keypressChordPart||e.whenIsEntirelyIncluded(r.when,n.when)&&this._removeFromLookupMap(r)}}i.push(n),this._addToLookupMap(n)},e.prototype._addToLookupMap=function(e){if(e.command){var t=this._lookupMap.get(e.command);"undefined"===typeof t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}},e.prototype._removeFromLookupMap=function(e){if(e.command){var t=this._lookupMap.get(e.command);if("undefined"!==typeof t)for(var n=0,i=t.length;n=0;i--){var o=n[i];if(e.contextMatchesRules(t,o.when))return o}return null},e.contextMatchesRules=function(e,t){return!t||t.evaluate(e)},e}(),Gh=function(){function e(){this._keybindings=[],this._keybindingsSorted=!0}return e.bindToCurrentPlatform=function(e){if(1===o["a"]){if(e&&e.win)return e.win}else if(2===o["a"]){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e},e.prototype.registerKeybindingRule=function(t,n){void 0===n&&(n=0);var i=e.bindToCurrentPlatform(t);if(i&&i.primary){var r=Mt(i.primary,o["a"]);r&&this._registerDefaultKeybinding(r,t.id,t.weight,0,t.when,n)}if(i&&Array.isArray(i.secondary))for(var s=0,a=i.secondary.length;s=21&&e<=30||(e>=31&&e<=56||(80===e||81===e||82===e||83===e||84===e||85===e||86===e||110===e||111===e||87===e||88===e||89===e||90===e||91===e||92===e))},e.prototype._assertNoCtrlAlt=function(t,n){t.ctrlKey&&t.altKey&&!t.metaKey&&e._mightProduceChar(t.keyCode)&&console.warn("Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ",t," for ",n)},e.prototype._registerDefaultKeybinding=function(e,t,n,i,r,s){0===s&&1===o["a"]&&(2===e.type?this._assertNoCtrlAlt(e.firstPart,t):this._assertNoCtrlAlt(e,t)),this._keybindings.push({keybinding:e,command:t,commandArgs:void 0,when:r,weight1:n,weight2:i}),this._keybindingsSorted=!1},e.prototype.getDefaultKeybindings=function(){return this._keybindingsSorted||(this._keybindings.sort(Xh),this._keybindingsSorted=!0),this._keybindings.slice(0)},e}(),Yh=new Gh,Zh={EditorModes:"platform.keybindingsRegistry"};function Xh(e,t){return e.weight1!==t.weight1?e.weight1-t.weight1:e.commandt.command?1:e.weight2-t.weight2}xc.add(Zh.EditorModes,Yh);var Jh=function(){function e(e,t,n,i,o){if(this.resolvedKeybinding=e,e){var r=e.getDispatchParts(),s=r[0],a=r[1];this.keypressFirstPart=s,this.keypressChordPart=a}else this.keypressFirstPart=null,this.keypressChordPart=null;this.bubble=!!t&&94===t.charCodeAt(0),this.command=this.bubble?t.substr(1):t,this.commandArgs=n,this.when=i,this.isDefault=o}return e}(),Qh=function(){function e(e,t,n){void 0===n&&(n=t),this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=n}return e.prototype.toLabel=function(e,t,n,i,o){return null===e||null===t?null:id(e,t,n,i,this.modifierLabels[o])},e}(),ed=new Qh({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:le({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:le({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:le({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:le({key:"windowsKey",comment:["This is the short form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:le({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:le({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:le({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:le({key:"superKey",comment:["This is the short form for the Super key on the keyboard"]},"Super"),separator:"+"}),td=new Qh({ctrlKey:le({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:le({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:le({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:le({key:"cmdKey.long",comment:["This is the long form for the Command key on the keyboard"]},"Command"),separator:"+"},{ctrlKey:le({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:le({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:le({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:le({key:"windowsKey.long",comment:["This is the long form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:le({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:le({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:le({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:le({key:"superKey.long",comment:["This is the long form for the Super key on the keyboard"]},"Super"),separator:"+"});function nd(e,t,n){if(null===t)return"";var i=[];return e.ctrlKey&&i.push(n.ctrlKey),e.shiftKey&&i.push(n.shiftKey),e.altKey&&i.push(n.altKey),e.metaKey&&i.push(n.metaKey),i.push(t),i.join(n.separator)}function id(e,t,n,i,o){var r=nd(e,t,o);return null!==n&&null!==i&&(r+=" ",r+=nd(n,i,o)),r}var od,rd,sd=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ad=function(e){function t(t,n){var i=e.call(this)||this;if(i._os=n,!t)throw new Error("Invalid USLayoutResolvedKeybinding");return 2===t.type?(i._firstPart=t.firstPart,i._chordPart=t.chordPart):(i._firstPart=t,i._chordPart=null),i}return sd(t,e),t.prototype._keyCodeToUILabel=function(e){if(2===this._os)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return vt.toString(e)},t.prototype._getUILabelForKeybinding=function(e){return e?e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode):null},t.prototype.getLabel=function(){var e=this._getUILabelForKeybinding(this._firstPart),t=this._getUILabelForKeybinding(this._chordPart);return ed.toLabel(this._firstPart,e,this._chordPart,t,this._os)},t.prototype._getAriaLabelForKeybinding=function(e){return e?e.isDuplicateModifierCase()?"":vt.toString(e.keyCode):null},t.prototype.getAriaLabel=function(){var e=this._getAriaLabelForKeybinding(this._firstPart),t=this._getAriaLabelForKeybinding(this._chordPart);return td.toLabel(this._firstPart,e,this._chordPart,t,this._os)},t.prototype.isChord=function(){return!!this._chordPart},t.prototype.getParts=function(){return[this._toResolvedKeybindingPart(this._firstPart),this._chordPart?this._toResolvedKeybindingPart(this._chordPart):null]},t.prototype._toResolvedKeybindingPart=function(e){return new Ft(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getUILabelForKeybinding(e),this._getAriaLabelForKeybinding(e))},t.prototype.getDispatchParts=function(){var e=this._firstPart?t.getDispatchStr(this._firstPart):null,n=this._chordPart?t.getDispatchStr(this._chordPart):null;return[e,n]},t.getDispatchStr=function(e){if(e.isModifierKey())return null;var t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=vt.toString(e.keyCode),t},t}(Wt),ud=jn("notificationService"),ld=function(){function e(){}return e}(),cd=jn("contextService");(function(e){function t(e){return e&&"object"===typeof e&&"string"===typeof e.id&&Array.isArray(e.folders)}e.isIWorkspace=t})(od||(od={})),function(e){function t(e){return e&&"object"===typeof e&&Yt.isUri(e.uri)&&"string"===typeof e.name&&"function"===typeof e.toResource}e.isIWorkspaceFolder=t}(rd||(rd={}));(function(){function e(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=null),this._id=e,this._configuration=n,this._foldersMap=Fs.forPaths(),this.folders=t}Object.defineProperty(e.prototype,"folders",{get:function(){return this._folders},set:function(e){this._folders=e,this.updateFoldersMap()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"configuration",{get:function(){return this._configuration},set:function(e){this._configuration=e},enumerable:!0,configurable:!0}),e.prototype.getFolder=function(e){return e?this._foldersMap.findSubstr(e.toString()):null},e.prototype.updateFoldersMap=function(){this._foldersMap=Fs.forPaths();for(var e=0,t=this.folders;e=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},pd=function(e,t){return function(n,i){t(n,i,e)}},gd=function(){function e(e){this.model=e,this._onDispose=new T}return Object.defineProperty(e.prototype,"textEditorModel",{get:function(){return this.model},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._onDispose.fire()},e}();function md(e,t,n){return Cc(e)?t(e):n(e)}var vd=function(){function e(){}return e.prototype.setEditor=function(e){this.editor=e},e.prototype.createModelReference=function(e){var t,n=this;return t=md(this.editor,(function(t){return n.findModel(t,e)}),(function(t){return n.findModel(t.getOriginalEditor(),e)||n.findModel(t.getModifiedEditor(),e)})),t?i["b"].as(new x(new gd(t))):i["b"].as(new x(null))},e.prototype.findModel=function(e,t){var n=e.getModel();return n&&n.uri.toString()!==t.toString()?null:n},e}(),_d=function(){function e(){}return e.prototype.showWhile=function(e,t){return null},e}(),yd=function(){function e(){}return e}(),bd=function(){function e(){}return e.prototype.info=function(e){return this.notify({severity:wc.Info,message:e})},e.prototype.warn=function(e){return this.notify({severity:wc.Warning,message:e})},e.prototype.error=function(e){return this.notify({severity:wc.Error,message:e})},e.prototype.notify=function(t){switch(t.severity){case wc.Error:console.error(t.message);break;case wc.Warning:console.warn(t.message);break;default:console.log(t.message);break}return e.NO_OP},e.NO_OP=new ld,e}(),wd=function(){function e(e){this._onWillExecuteCommand=new T,this._instantiationService=e,this._dynamicCommands=Object.create(null)}return e.prototype.addCommand=function(e){var t=this,n=e.id;return this._dynamicCommands[n]=e,w((function(){delete t._dynamicCommands[n]}))},e.prototype.executeCommand=function(e){for(var t=[],n=1;n.001){y=!1;break}}var x=!0;y&&v.width!==b&&(x=!1),v.width>m.width&&(x=!1);var L=qn()>2e3;return new Ss({zoomLevel:Kn(),fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:y,typicalHalfwidthCharacterWidth:i.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:x,spaceWidth:r.width,maxDigitWidth:_},L)},t.INSTANCE=new t,t}(S),Xd=function(e){function t(t,n){void 0===n&&(n=null);var i=e.call(this,t)||this;return i._elementSizeObserver=i._register(new qd(n,(function(){return i._onReferenceDomElementSizeChanged()}))),i._register(Zd.INSTANCE.onDidChange((function(){return i._onCSSBasedConfigurationChanged()}))),i._validatedOptions.automaticLayout&&i._elementSizeObserver.startObserving(),i._register(Gn((function(e){return i._recomputeOptions()}))),i._register(Xn((function(){return i._recomputeOptions()}))),i._recomputeOptions(),i}return Gd(t,e),t.applyFontInfoSlow=function(e,t){e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px"},t.applyFontInfo=function(e,t){e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)},t.prototype._onReferenceDomElementSizeChanged=function(){this._recomputeOptions()},t.prototype._onCSSBasedConfigurationChanged=function(){this._recomputeOptions()},t.prototype.observeReferenceElement=function(e){this._elementSizeObserver.observe(e)},t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype._getExtraEditorClassName=function(){var e="";return Qn?e+="ie ":ni?e+="ff ":ei?e+="edge ":ri&&(e+="safari "),o["d"]&&(e+="mac "),e},t.prototype._getEnvConfiguration=function(){return{extraEditorClassName:this._getExtraEditorClassName(),outerWidth:this._elementSizeObserver.getWidth(),outerHeight:this._elementSizeObserver.getHeight(),emptySelectionClipboard:ii||ni,pixelRatio:Yn(),zoomLevel:Kn(),accessibilitySupport:Zn()}},t.prototype.readConfiguration=function(e){return Zd.INSTANCE.readConfiguration(e)},t}(Zc),Jd=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Qd=function(){return Qd=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};(function(e){e.Tap="-monaco-gesturetap",e.Change="-monaco-gesturechange",e.Start="-monaco-gesturestart",e.End="-monaco-gesturesend",e.Contextmenu="-monaco-gesturecontextmenu"})(gf||(gf={}));var _f=function(e){function t(){var t=e.call(this)||this;return t.activeTouches={},t.handle=null,t.targets=[],t._register(ji(document,"touchstart",(function(e){return t.onTouchStart(e)}))),t._register(ji(document,"touchend",(function(e){return t.onTouchEnd(e)}))),t._register(ji(document,"touchmove",(function(e){return t.onTouchMove(e)}))),t}return mf(t,e),t.addTarget=function(e){t.isTouchDevice()&&(t.INSTANCE||(t.INSTANCE=new t),t.INSTANCE.targets.push(e))},t.isTouchDevice=function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||window.navigator.msMaxTouchPoints>0},t.prototype.dispose=function(){this.handle&&(this.handle.dispose(),this.handle=null),e.prototype.dispose.call(this)},t.prototype.onTouchStart=function(e){var t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(var n=0,i=e.targetTouches.length;n=t.HOLD_DELAY&&Math.abs(u.initialPageX-ce(u.rollingPageX))<30&&Math.abs(u.initialPageY-ce(u.rollingPageY))<30){c=r.newGestureEvent(gf.Contextmenu,u.initialTarget);c.pageX=ce(u.rollingPageX),c.pageY=ce(u.rollingPageY),r.dispatchEvent(c)}else if(1===i){var h=ce(u.rollingPageX),d=ce(u.rollingPageY),f=ce(u.rollingTimestamps)-u.rollingTimestamps[0],p=h-u.rollingPageX[0],g=d-u.rollingPageY[0],m=r.targets.filter((function(e){return u.initialTarget instanceof Node&&e.contains(u.initialTarget)}));r.inertia(m,n,Math.abs(p)/f,p>0?1:-1,h,Math.abs(g)/f,g>0?1:-1,d)}r.dispatchEvent(r.newGestureEvent(gf.End,u.initialTarget)),delete r.activeTouches[a.identifier]},r=this,s=0,a=e.changedTouches.length;s0&&(p=!1,d=o*i*h),s>0&&(p=!1,f=a*s*h);var g=l.newGestureEvent(gf.Change);g.translationX=d,g.translationY=f,e.forEach((function(e){return e.dispatchEvent(g)})),p||l.inertia(e,c,i,o,r+d,s,a,u+f)}))},t.prototype.onTouchMove=function(e){for(var t=Date.now(),n=0,i=e.changedTouches.length;n3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(o.pageX),r.rollingPageY.push(o.pageY),r.rollingTimestamps.push(t)}else console.warn("end of an UNKNOWN touch",o)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)},t.SCROLL_FRICTION=-.005,t.HOLD_DELAY=700,vf([pf],t,"isTouchDevice",null),t}(S),yf=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function bf(e,t){var n=new Li(t);return n.preventDefault(),{leftButton:n.leftButton,posx:n.posx,posy:n.posy}}var wf=function(e){function t(){var t=e.call(this)||this;return t.hooks=[],t.mouseMoveEventMerger=null,t.mouseMoveCallback=null,t.onStopCallback=null,t}return yf(t,e),t.prototype.dispose=function(){this.stopMonitoring(!1),e.prototype.dispose.call(this)},t.prototype.stopMonitoring=function(e){if(this.isMonitoring()){this.hooks=y(this.hooks),this.mouseMoveEventMerger=null,this.mouseMoveCallback=null;var t=this.onStopCallback;this.onStopCallback=null,e&&t&&t()}},t.prototype.isMonitoring=function(){return this.hooks.length>0},t.prototype.startMonitoring=function(e,t,n){var i=this;if(!this.isMonitoring()){this.mouseMoveEventMerger=e,this.mouseMoveCallback=t,this.onStopCallback=n;for(var o=Si.getSameOriginWindowChain(),r=0;r=u?o=Math.max(o,u+l-i):(t[n++]=new Vf(i,o),i=u,o=l)}return t[n++]=new Vf(i,o),t},e._createHorizontalRangesFromClientRects=function(e,t){if(!e||0===e.length)return null;for(var n=[],i=0,o=e.length;iu)return null;t=Math.min(u,Math.max(a,t)),i=Math.min(u,Math.max(a,i)),t!==i&&i>0&&0===o&&(i--,o=Number.MAX_VALUE);var l=e.children[t].firstChild,c=e.children[i].firstChild;if(l&&c||(!l&&0===n&&t>0&&(l=e.children[t-1].firstChild,n=1073741824),!c&&0===o&&i>0&&(c=e.children[i-1].firstChild,o=1073741824)),!l||!c)return null;n=Math.min(l.textContent.length,Math.max(0,n)),o=Math.min(c.textContent.length,Math.max(0,o));var h=this._readClientRects(l,n,c,o,s);return this._createHorizontalRangesFromClientRects(h,r)},e}(),jf=jn("themeService");function zf(e){return{id:e}}var Uf="dark",$f="hc";function Kf(e){switch(e){case Uf:return"vs-dark";case $f:return"hc-black";default:return"vs"}}var qf={ThemingContribution:"base.contributions.theming"},Gf=function(){function e(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new T}return e.prototype.onThemeChange=function(e){var t=this;return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),w((function(){var n=t.themingParticipants.indexOf(e);t.themingParticipants.splice(n,1)}))},e.prototype.getThemingParticipants=function(){return this.themingParticipants},e}(),Yf=new Gf;function Zf(e){return Yf.onThemeChange(e)}xc.add(qf.ThemingContribution,Yf);var Xf=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Jf=function(){return!!o["e"]||!(o["c"]||ni||ri)}(),Qf=ti,ep=function(){function e(e,t){this._domNode=e,this._clientRectDeltaLeft=0,this._clientRectDeltaLeftRead=!1,this.endNode=t}return Object.defineProperty(e.prototype,"clientRectDeltaLeft",{get:function(){return this._clientRectDeltaLeftRead||(this._clientRectDeltaLeftRead=!0,this._clientRectDeltaLeft=this._domNode.getBoundingClientRect().left),this._clientRectDeltaLeft},enumerable:!0,configurable:!0}),e}(),tp=function(){function e(e,t){this.themeType=t,this.renderWhitespace=e.editor.viewInfo.renderWhitespace,this.renderControlCharacters=e.editor.viewInfo.renderControlCharacters,this.spaceWidth=e.editor.fontInfo.spaceWidth,this.useMonospaceOptimizations=e.editor.fontInfo.isMonospace&&!e.editor.viewInfo.disableMonospaceOptimizations,this.canUseHalfwidthRightwardsArrow=e.editor.fontInfo.canUseHalfwidthRightwardsArrow,this.lineHeight=e.editor.lineHeight,this.stopRenderingLineAfter=e.editor.viewInfo.stopRenderingLineAfter,this.fontLigatures=e.editor.viewInfo.fontLigatures}return e.prototype.equals=function(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures},e}(),np=function(){function e(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}return e.prototype.getDomNode=function(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null},e.prototype.setDomNode=function(e){if(!this._renderedViewLine)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=ff(e)},e.prototype.onContentChanged=function(){this._isMaybeInvalid=!0},e.prototype.onTokensChanged=function(){this._isMaybeInvalid=!0},e.prototype.onDecorationsChanged=function(){this._isMaybeInvalid=!0},e.prototype.onOptionsChanged=function(e){this._isMaybeInvalid=!0,this._options=e},e.prototype.onSelectionChanged=function(){return!(!Qf&&this._options.themeType!==$f)&&(this._isMaybeInvalid=!0,!0)},e.prototype.renderLine=function(t,n,i,o){if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;var r=i.getViewLineRenderingData(t),s=this._options,a=Kl.filter(r.inlineDecorations,t,r.minColumn,r.maxColumn);if(Qf||s.themeType===$f)for(var u=i.selections,l=0,c=u.length;lt)){var d=h.startLineNumber===t?h.startColumn:r.minColumn,f=h.endLineNumber===t?h.endColumn:r.maxColumn;d');var g=ec(p,o);o.appendASCIIString("");var m=null;return Jf&&r.isBasicASCII&&s.useMonospaceOptimizations&&0===g.containsForeignElements&&r.content.length<300&&p.lineTokens.getCount()<100&&(m=new ip(this._renderedViewLine?this._renderedViewLine.domNode:null,p,g.characterMapping)),m||(m=sp(this._renderedViewLine?this._renderedViewLine.domNode:null,p,g.characterMapping,g.containsRTL,g.containsForeignElements)),this._renderedViewLine=m,!0},e.prototype.layoutLine=function(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))},e.prototype.getWidth=function(){return this._renderedViewLine?this._renderedViewLine.getWidth():0},e.prototype.getWidthIsFast=function(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()},e.prototype.getVisibleRangesForRange=function(e,t,n){if(!this._renderedViewLine)return null;e|=0,t|=0,e=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,e)),t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t));var i=0|this._renderedViewLine.input.stopRenderingLineAfter;return-1!==i&&e>i&&t>i?null:(-1!==i&&e>i&&(e=i),-1!==i&&t>i&&(t=i),this._renderedViewLine.getVisibleRangesForRange(e,t,n))},e.prototype.getColumnOfNodeOffset=function(e,t,n){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,n):1},e.CLASS_NAME="view-line",e}(),ip=function(){function e(e,t,n){this.domNode=e,this.input=t,this._characterMapping=n,this._charWidth=t.spaceWidth}return e.prototype.getWidth=function(){return this._getCharPosition(this._characterMapping.length)},e.prototype.getWidthIsFast=function(){return!0},e.prototype.getVisibleRangesForRange=function(e,t,n){var i=this._getCharPosition(e),o=this._getCharPosition(t);return[new Vf(i,o-i)]},e.prototype._getCharPosition=function(e){var t=this._characterMapping.getAbsoluteOffsets();return 0===t.length?0:Math.round(this._charWidth*t[e-1])},e.prototype.getColumnOfNodeOffset=function(e,t,n){var i=t.textContent.length,o=-1;while(t)t=t.previousSibling,o++;var r=this._characterMapping.partDataToCharOffset(o,i,n);return r+1},e}(),op=function(){function e(e,t,n,i,o){if(this.domNode=e,this.input=t,this._characterMapping=n,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!i||0===this._characterMapping.length){this._pixelOffsetCache=new Int32Array(Math.max(2,this._characterMapping.length+1));for(var r=0,s=this._characterMapping.length;r<=s;r++)this._pixelOffsetCache[r]=-1}}return e.prototype._getReadingTarget=function(){return this.domNode.domNode.firstChild},e.prototype.getWidth=function(){return-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget().offsetWidth),this._cachedWidth},e.prototype.getWidthIsFast=function(){return-1!==this._cachedWidth},e.prototype.getVisibleRangesForRange=function(e,t,n){if(null!==this._pixelOffsetCache){var i=this._readPixelOffset(e,n);if(-1===i)return null;var o=this._readPixelOffset(t,n);return-1===o?null:[new Vf(i,o-i)]}return this._readVisibleRangesForRange(e,t,n)},e.prototype._readVisibleRangesForRange=function(e,t,n){if(e===t){var i=this._readPixelOffset(e,n);return-1===i?null:[new Vf(i,0)]}return this._readRawVisibleRangesForRange(e,t,n)},e.prototype._readPixelOffset=function(e,t){if(0===this._characterMapping.length){if(0===this._containsForeignElements)return 0;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth()}if(null!==this._pixelOffsetCache){var n=this._pixelOffsetCache[e];if(-1!==n)return n;var i=this._actualReadPixelOffset(e,t);return this._pixelOffsetCache[e]=i,i}return this._actualReadPixelOffset(e,t)},e.prototype._actualReadPixelOffset=function(e,t){if(0===this._characterMapping.length){var n=Hf.readHorizontalRanges(this._getReadingTarget(),0,0,0,0,t.clientRectDeltaLeft,t.endNode);return n&&0!==n.length?n[0].left:-1}if(e===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth();var i=this._characterMapping.charOffsetToPartData(e-1),o=Jl.getPartIndex(i),r=Jl.getCharIndex(i),s=Hf.readHorizontalRanges(this._getReadingTarget(),o,r,o,r,t.clientRectDeltaLeft,t.endNode);return s&&0!==s.length?s[0].left:-1},e.prototype._readRawVisibleRangesForRange=function(e,t,n){if(1===e&&t===this._characterMapping.length)return[new Vf(0,this.getWidth())];var i=this._characterMapping.charOffsetToPartData(e-1),o=Jl.getPartIndex(i),r=Jl.getCharIndex(i),s=this._characterMapping.charOffsetToPartData(t-1),a=Jl.getPartIndex(s),u=Jl.getCharIndex(s);return Hf.readHorizontalRanges(this._getReadingTarget(),o,r,a,u,n.clientRectDeltaLeft,n.endNode)},e.prototype.getColumnOfNodeOffset=function(e,t,n){var i=t.textContent.length,o=-1;while(t)t=t.previousSibling,o++;var r=this._characterMapping.partDataToCharOffset(o,i,n);return r+1},e}(),rp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Xf(t,e),t.prototype._readVisibleRangesForRange=function(t,n,i){var o=e.prototype._readVisibleRangesForRange.call(this,t,n,i);if(!o||0===o.length||t===n||1===t&&n===this._characterMapping.length)return o;if(!this.input.containsRTL){var r=this._readPixelOffset(n,i);if(-1!==r){var s=o[o.length-1];s.left=4&&3===e[0]&&7===e[3]},e.isStrictChildOfViewLines=function(e){return e.length>4&&3===e[0]&&7===e[3]},e.isChildOfScrollableElement=function(e){return e.length>=2&&3===e[0]&&5===e[1]},e.isChildOfMinimap=function(e){return e.length>=2&&3===e[0]&&8===e[1]},e.isChildOfContentWidgets=function(e){return e.length>=4&&3===e[0]&&1===e[3]},e.isChildOfOverflowingContentWidgets=function(e){return e.length>=1&&2===e[0]},e.isChildOfOverlayWidgets=function(e){return e.length>=2&&3===e[0]&&4===e[1]},e}(),dp=function(){function e(e,t,n){this.model=e.model,this.layoutInfo=e.configuration.editor.layoutInfo,this.viewDomNode=t.viewDomNode,this.lineHeight=e.configuration.editor.lineHeight,this.typicalHalfwidthCharacterWidth=e.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,this.lastViewCursorsRenderData=n,this._context=e,this._viewHelper=t}return e.prototype.getZoneAtCoord=function(t){return e.getZoneAtCoord(this._context,t)},e.getZoneAtCoord=function(e,t){var n=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(n){var i=n.verticalOffset+n.height/2,o=e.model.getLineCount(),r=null,s=void 0,a=null;return n.afterLineNumber!==o&&(a=new Dn(n.afterLineNumber+1,1)),n.afterLineNumber>0&&(r=new Dn(n.afterLineNumber,e.model.getLineMaxColumn(n.afterLineNumber))),s=null===a?r:null===r?a:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,vp._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}return e}(),pp=function(e){function t(t,n,i,o){var r=e.call(this,t,n,i)||this;return r._ctx=t,o?(r.target=o,r.targetPath=Pf.collect(o,t.viewDomNode)):(r.target=null,r.targetPath=new Uint8Array(0)),r}return lp(t,e),t.prototype.toString=function(){return"pos("+this.pos.x+","+this.pos.y+"), editorPos("+this.editorPos.x+","+this.editorPos.y+"), mouseVerticalOffset: "+this.mouseVerticalOffset+", mouseContentHorizontalOffset: "+this.mouseContentHorizontalOffset+"\n\ttarget: "+(this.target?this.target.outerHTML:null)},t.prototype.fulfill=function(e,t,n,i){return void 0===t&&(t=null),void 0===n&&(n=null),void 0===i&&(i=null),new cp(this.target,e,this.mouseColumn,t,n,i)},t.prototype.withTarget=function(e){return new t(this._ctx,this.editorPos,this.pos,e)},t}(fp),gp={isAfterLines:!0};function mp(e){return{isAfterLines:!1,horizontalDistanceToText:e}}var vp=function(){function e(e,t){this._context=e,this._viewHelper=t}return e.prototype.mouseTargetIsWidget=function(e){var t=e.target,n=Pf.collect(t,this._viewHelper.viewDomNode);return!(!hp.isChildOfContentWidgets(n)&&!hp.isChildOfOverflowingContentWidgets(n))||!!hp.isChildOfOverlayWidgets(n)},e.prototype.createMouseTarget=function(t,n,i,o){var r=new dp(this._context,this._viewHelper,t),s=new pp(r,n,i,o);try{var a=e._createMouseTarget(r,s,!1);return a}catch(u){return s.fulfill(0)}},e._createMouseTarget=function(t,n,i){if(null===n.target){if(i)return n.fulfill(0);var o=e._doHitTest(t,n);return o.position?e.createMouseTargetFromHitTestPosition(t,n,o.position.lineNumber,o.position.column):this._createMouseTarget(t,n.withTarget(o.hitTarget),!0)}var r=n,s=null;return s=s||e._hitTestContentWidget(t,r),s=s||e._hitTestOverlayWidget(t,r),s=s||e._hitTestMinimap(t,r),s=s||e._hitTestScrollbarSlider(t,r),s=s||e._hitTestViewZone(t,r),s=s||e._hitTestMargin(t,r),s=s||e._hitTestViewCursor(t,r),s=s||e._hitTestTextArea(t,r),s=s||e._hitTestViewLines(t,r,i),s=s||e._hitTestScrollbar(t,r),s||n.fulfill(0)},e._hitTestContentWidget=function(e,t){if(hp.isChildOfContentWidgets(t.targetPath)||hp.isChildOfOverflowingContentWidgets(t.targetPath)){var n=e.findAttribute(t.target,"widgetId");return n?t.fulfill(9,null,null,n):t.fulfill(0)}return null},e._hitTestOverlayWidget=function(e,t){if(hp.isChildOfOverlayWidgets(t.targetPath)){var n=e.findAttribute(t.target,"widgetId");return n?t.fulfill(12,null,null,n):t.fulfill(0)}return null},e._hitTestViewCursor=function(e,t){if(t.target)for(var n=e.lastViewCursorsRenderData,i=0,o=n.length;ir.contentLeft+r.width)){var u=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(u<=a&&a<=u+r.height)return t.fulfill(6,r.position)}}}return null},e._hitTestViewZone=function(e,t){var n=e.getZoneAtCoord(t.mouseVerticalOffset);if(n){var i=t.isInContentArea?8:5;return t.fulfill(i,n.position,null,n)}return null},e._hitTestTextArea=function(e,t){return hp.isTextArea(t.targetPath)?t.fulfill(1):null},e._hitTestMargin=function(e,t){if(t.isInMarginArea){var n=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),i=n.range.getStartPosition(),o=Math.abs(t.pos.x-t.editorPos.x),r={isAfterLines:n.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfill(2,i,n.range,r):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfill(3,i,n.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfill(4,i,n.range,r)))}return null},e._hitTestViewLines=function(t,n,i){if(!hp.isChildOfViewLines(n.targetPath))return null;if(t.isAfterLines(n.mouseVerticalOffset)){var o=t.model.getLineCount(),r=t.model.getLineMaxColumn(o);return n.fulfill(7,new Dn(o,r),void 0,gp)}if(i){if(hp.isStrictChildOfViewLines(n.targetPath)){var s=t.getLineNumberAtVerticalOffset(n.mouseVerticalOffset);if(0===t.model.getLineLength(s)){var a=t.getLineWidth(s),u=mp(n.mouseContentHorizontalOffset-a);return n.fulfill(7,new Dn(s,1),void 0,u)}}return n.fulfill(0)}var l=e._doHitTest(t,n);return l.position?e.createMouseTargetFromHitTestPosition(t,n,l.position.lineNumber,l.position.column):this._createMouseTarget(t,n.withTarget(l.hitTarget),!0)},e._hitTestMinimap=function(e,t){if(hp.isChildOfMinimap(t.targetPath)){var n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),i=e.model.getLineMaxColumn(n);return t.fulfill(11,new Dn(n,i))}return null},e._hitTestScrollbarSlider=function(e,t){if(hp.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){var n=t.target.className;if(n&&/\b(slider|scrollbar)\b/.test(n)){var i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.model.getLineMaxColumn(i);return t.fulfill(11,new Dn(i,o))}}return null},e._hitTestScrollbar=function(e,t){if(hp.isChildOfScrollableElement(t.targetPath)){var n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),i=e.model.getLineMaxColumn(n);return t.fulfill(11,new Dn(n,i))}return null},e.prototype.getMouseColumn=function(t,n){var i=this._context.configuration.editor.layoutInfo,o=this._context.viewLayout.getCurrentScrollLeft()+n.x-t.x-i.contentLeft;return e._getMouseColumn(o,this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth)},e._getMouseColumn=function(e,t){if(e<0)return 1;var n=Math.round(e/t);return n+1},e.createMouseTargetFromHitTestPosition=function(e,t,n,i){var o=new Dn(n,i),r=e.getLineWidth(n);if(t.mouseContentHorizontalOffset>r){if(ei&&1===o.column){var s=mp(t.mouseContentHorizontalOffset-r);return t.fulfill(7,new Dn(n,e.model.getLineMaxColumn(n)),void 0,s)}var a=mp(t.mouseContentHorizontalOffset-r);return t.fulfill(7,o,void 0,a)}var u=e.visibleRangeForPosition2(n,i);if(!u)return t.fulfill(0,o);var l=u.left;if(t.mouseContentHorizontalOffset===l)return t.fulfill(6,o);var c=[];if(c.push({offset:u.left,column:i}),i>1){var h=e.visibleRangeForPosition2(n,i-1);h&&c.push({offset:h.left,column:i-1})}var d=e.model.getLineMaxColumn(n);if(i=t.editorPos.y+e.layoutInfo.height&&(r=t.editorPos.y+e.layoutInfo.height-1);var s=new Sf(t.pos.x,r),a=this._actualDoHitTestWithCaretRangeFromPoint(e,s.toClientCoordinates());return a.position?a:this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())},e._actualDoHitTestWithCaretRangeFromPoint=function(e,t){var n=document.caretRangeFromPoint(t.clientX,t.clientY);if(!n||!n.startContainer)return{position:null,hitTarget:null};var i=n.startContainer,o=null;if(i.nodeType===i.TEXT_NODE){var r=i.parentNode,s=r?r.parentNode:null,a=s?s.parentNode:null,u=a&&a.nodeType===a.ELEMENT_NODE?a.className:null;if(u===np.CLASS_NAME){var l=e.getPositionFromDOMInfo(r,n.startOffset);return{position:l,hitTarget:null}}o=i.parentNode}else if(i.nodeType===i.ELEMENT_NODE){r=i.parentNode,s=r?r.parentNode:null;var c=s&&s.nodeType===s.ELEMENT_NODE?s.className:null;if(c===np.CLASS_NAME){l=e.getPositionFromDOMInfo(i,i.textContent.length);return{position:l,hitTarget:null}}o=i}return{position:null,hitTarget:o}},e._doHitTestWithCaretPositionFromPoint=function(e,t){var n=document.caretPositionFromPoint(t.clientX,t.clientY);if(n.offsetNode.nodeType===n.offsetNode.TEXT_NODE){var i=n.offsetNode.parentNode,o=i?i.parentNode:null,r=o?o.parentNode:null,s=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(s===np.CLASS_NAME){var a=e.getPositionFromDOMInfo(n.offsetNode.parentNode,n.offset);return{position:a,hitTarget:null}}return{position:null,hitTarget:n.offsetNode.parentNode}}return{position:null,hitTarget:n.offsetNode}},e._doHitTestWithMoveToPoint=function(e,t){var n=null,i=null,o=document.body.createTextRange();try{o.moveToPoint(t.clientX,t.clientY)}catch(c){return{position:null,hitTarget:null}}o.collapse(!0);var r=o?o.parentElement():null,s=r?r.parentNode:null,a=s?s.parentNode:null,u=a&&a.nodeType===a.ELEMENT_NODE?a.className:"";if(u===np.CLASS_NAME){var l=o.duplicate();l.moveToElementText(r),l.setEndPoint("EndToStart",o),n=e.getPositionFromDOMInfo(r,l.text.length),l.moveToElementText(e.viewDomNode)}else i=r;return o.moveToElementText(e.viewDomNode),{position:n,hitTarget:i}},e._doHitTest=function(e,t){return document.caretRangeFromPoint?this._doHitTestWithCaretRangeFromPoint(e,t):document.caretPositionFromPoint?this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates()):document.body.createTextRange?this._doHitTestWithMoveToPoint(e,t.pos.toClientCoordinates()):{position:null,hitTarget:null}},e}(),_p=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function yp(e){return function(t,n){var i=!1;return e&&(i=e.mouseTargetIsWidget(n)),i||n.preventDefault(),n}}var bp=function(e){function t(n,i,o){var r=e.call(this)||this;r._isFocused=!1,r._context=n,r.viewController=i,r.viewHelper=o,r.mouseTargetFactory=new vp(r._context,o),r._mouseDownOperation=r._register(new wp(r._context,r.viewController,r.viewHelper,(function(e,t){return r._createMouseTarget(e,t)}),(function(e){return r._getMouseColumn(e)}))),r._asyncFocus=r._register(new oe((function(){return r.viewHelper.focusTextArea()}),0)),r.lastMouseLeaveTime=-1;var s=new Ef(r.viewHelper.viewDomNode);r._register(s.onContextMenu(r.viewHelper.viewDomNode,(function(e){return r._onContextMenu(e,!0)}))),r._register(s.onMouseMoveThrottled(r.viewHelper.viewDomNode,(function(e){return r._onMouseMove(e)}),yp(r.mouseTargetFactory),t.MOUSE_MOVE_MINIMUM_TIME)),r._register(s.onMouseUp(r.viewHelper.viewDomNode,(function(e){return r._onMouseUp(e)}))),r._register(s.onMouseLeave(r.viewHelper.viewDomNode,(function(e){return r._onMouseLeave(e)}))),r._register(s.onMouseDown(r.viewHelper.viewDomNode,(function(e){return r._onMouseDown(e)})));var a=function(e){if(r._context.configuration.editor.viewInfo.mouseWheelZoom){var t=new Ni(e);if(t.browserEvent.ctrlKey||t.browserEvent.metaKey){var n=ls.getZoomLevel(),i=t.deltaY>0?1:-1;ls.setZoomLevel(n+i),t.preventDefault(),t.stopPropagation()}}};return r._register(ji(r.viewHelper.viewDomNode,"mousewheel",a,!0)),r._register(ji(r.viewHelper.viewDomNode,"DOMMouseScroll",a,!0)),r._context.addEventHandler(r),r}return _p(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),e.prototype.dispose.call(this)},t.prototype.onCursorStateChanged=function(e){return this._mouseDownOperation.onCursorStateChanged(e),!1},t.prototype.onFocusChanged=function(e){return this._isFocused=e.isFocused,!1},t.prototype.onScrollChanged=function(e){return this._mouseDownOperation.onScrollChanged(),!1},t.prototype.getTargetAtClientPoint=function(e,t){var n=new xf(e,t),i=n.toPageCoordinates(),o=kf(this.viewHelper.viewDomNode);if(i.yo.y+o.height||i.xo.x+o.width)return null;var r=this.viewHelper.getLastViewCursorsRenderData();return this.mouseTargetFactory.createMouseTarget(r,o,i,null)},t.prototype._createMouseTarget=function(e,t){var n=this.viewHelper.getLastViewCursorsRenderData();return this.mouseTargetFactory.createMouseTarget(n,e.editorPos,e.pos,t?e.target:null)},t.prototype._getMouseColumn=function(e){return this.mouseTargetFactory.getMouseColumn(e.editorPos,e.pos)},t.prototype._onContextMenu=function(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})},t.prototype._onMouseMove=function(e){if(!this._mouseDownOperation.isActive()){var t=e.timestamp;tt.y+t.height){r=i.getCurrentScrollTop()+(e.posy-t.y),s=dp.getZoneAtCoord(this._context,r);if(s){a=this._helpPositionJumpOverViewZone(s);if(a)return new cp(null,13,o,a)}var l=i.getLineNumberAtVerticalOffset(r);return new cp(null,13,o,new Dn(l,n.getLineMaxColumn(l)))}var c=i.getLineNumberAtVerticalOffset(i.getCurrentScrollTop()+(e.posy-t.y));return e.posxt.x+t.width?new cp(null,13,o,new Dn(c,n.getLineMaxColumn(c))):null},t.prototype._findMousePosition=function(e,t){var n=this._getPositionOutsideEditor(e);if(n)return n;var i=this._createMouseTarget(e,t),o=i.position;if(!o)return null;if(8===i.type||5===i.type){var r=this._helpPositionJumpOverViewZone(i.detail);if(r)return new cp(i.element,i.type,i.mouseColumn,r,null,i.detail)}return i},t.prototype._helpPositionJumpOverViewZone=function(e){var t=new Dn(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),n=e.positionBefore,i=e.positionAfter;return n&&i?n.isBefore(t)?n:i:null},t.prototype._dispatchMouse=function(e,t){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton})},t}(S),Cp=function(){function e(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}return Object.defineProperty(e.prototype,"altKey",{get:function(){return this._altKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ctrlKey",{get:function(){return this._ctrlKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"metaKey",{get:function(){return this._metaKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shiftKey",{get:function(){return this._shiftKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftButton",{get:function(){return this._leftButton},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"middleButton",{get:function(){return this._middleButton},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startedOnLineNumbers",{get:function(){return this._startedOnLineNumbers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this._lastMouseDownCount},enumerable:!0,configurable:!0}),e.prototype.setModifiers=function(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey},e.prototype.setStartButtons=function(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton},e.prototype.setStartedOnLineNumbers=function(e){this._startedOnLineNumbers=e},e.prototype.trySetCount=function(t,n){var i=(new Date).getTime();i-this._lastSetMouseDownCountTime>e.CLEAR_MOUSE_DOWN_COUNT_TIME&&(t=1),this._lastSetMouseDownCountTime=i,t>this._lastMouseDownCount+1&&(t=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(n)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=n,this._lastMouseDownCount=Math.min(t,this._lastMouseDownPositionEqualCount)},e.CLEAR_MOUSE_DOWN_COUNT_TIME=400,e}(),Sp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function xp(e,t){var n={translationY:t.translationY,translationX:t.translationX};return e&&(n.translationY+=e.translationY,n.translationX+=e.translationX),n}var Lp=function(e){function t(t,n,i){var o=e.call(this,t,n,i)||this;return o.viewHelper.linesContentDomNode.style.msTouchAction="none",o.viewHelper.linesContentDomNode.style.msContentZooming="none",o._installGestureHandlerTimeout=window.setTimeout((function(){if(o._installGestureHandlerTimeout=-1,window.MSGesture){var e=new MSGesture,t=new MSGesture;e.target=o.viewHelper.linesContentDomNode,t.target=o.viewHelper.linesContentDomNode,o.viewHelper.linesContentDomNode.addEventListener("MSPointerDown",(function(n){var i=n.pointerType;i!==(n.MSPOINTER_TYPE_MOUSE||"mouse")?i===(n.MSPOINTER_TYPE_TOUCH||"touch")?(o._lastPointerType="touch",e.addPointer(n.pointerId)):(o._lastPointerType="pen",t.addPointer(n.pointerId)):o._lastPointerType="mouse"})),o._register(to(o.viewHelper.linesContentDomNode,"MSGestureChange",(function(e){return o._onGestureChange(e)}),xp)),o._register(ji(o.viewHelper.linesContentDomNode,"MSGestureTap",(function(e){return o._onCaptureGestureTap(e)}),!0))}}),100),o._lastPointerType="mouse",o}return Sp(t,e),t.prototype._onMouseDown=function(t){"mouse"===this._lastPointerType&&e.prototype._onMouseDown.call(this,t)},t.prototype._onCaptureGestureTap=function(e){var t=this,n=new Nf(e,this.viewHelper.viewDomNode),i=this._createMouseTarget(n,!1);i.position&&this.viewController.moveTo(i.position),n.browserEvent.fromElement?(n.preventDefault(),this.viewHelper.focusTextArea()):setTimeout((function(){t.viewHelper.focusTextArea()}))},t.prototype._onGestureChange=function(e){this._context.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)},t.prototype.dispose=function(){window.clearTimeout(this._installGestureHandlerTimeout),e.prototype.dispose.call(this)},t}(bp),kp=function(e){function t(t,n,i){var o=e.call(this,t,n,i)||this;return o.viewHelper.linesContentDomNode.style.touchAction="none",o._installGestureHandlerTimeout=window.setTimeout((function(){if(o._installGestureHandlerTimeout=-1,window.MSGesture){var e=new MSGesture,t=new MSGesture;e.target=o.viewHelper.linesContentDomNode,t.target=o.viewHelper.linesContentDomNode,o.viewHelper.linesContentDomNode.addEventListener("pointerdown",(function(n){var i=n.pointerType;"mouse"!==i?"touch"===i?(o._lastPointerType="touch",e.addPointer(n.pointerId)):(o._lastPointerType="pen",t.addPointer(n.pointerId)):o._lastPointerType="mouse"})),o._register(to(o.viewHelper.linesContentDomNode,"MSGestureChange",(function(e){return o._onGestureChange(e)}),xp)),o._register(ji(o.viewHelper.linesContentDomNode,"MSGestureTap",(function(e){return o._onCaptureGestureTap(e)}),!0))}}),100),o._lastPointerType="mouse",o}return Sp(t,e),t.prototype._onMouseDown=function(t){"mouse"===this._lastPointerType&&e.prototype._onMouseDown.call(this,t)},t.prototype._onCaptureGestureTap=function(e){var t=this,n=new Nf(e,this.viewHelper.viewDomNode),i=this._createMouseTarget(n,!1);i.position&&this.viewController.moveTo(i.position),n.browserEvent.fromElement?(n.preventDefault(),this.viewHelper.focusTextArea()):setTimeout((function(){t.viewHelper.focusTextArea()}))},t.prototype._onGestureChange=function(e){this._context.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)},t.prototype.dispose=function(){window.clearTimeout(this._installGestureHandlerTimeout),e.prototype.dispose.call(this)},t}(bp),Np=function(e){function t(t,n,i){var o=e.call(this,t,n,i)||this;return _f.addTarget(o.viewHelper.linesContentDomNode),o._register(ji(o.viewHelper.linesContentDomNode,gf.Tap,(function(e){return o.onTap(e)}))),o._register(ji(o.viewHelper.linesContentDomNode,gf.Change,(function(e){return o.onChange(e)}))),o._register(ji(o.viewHelper.linesContentDomNode,gf.Contextmenu,(function(e){return o._onContextMenu(new Nf(e,o.viewHelper.viewDomNode),!1)}))),o}return Sp(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.onTap=function(e){e.preventDefault(),this.viewHelper.focusTextArea();var t=this._createMouseTarget(new Nf(e,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.moveTo(t.position)},t.prototype.onChange=function(e){this._context.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)},t}(bp),Ep=function(){function e(e,t,n){window.navigator.msPointerEnabled?this.handler=new Lp(e,t,n):window.TouchEvent?this.handler=new Np(e,t,n):window.navigator.pointerEnabled||window.PointerEvent?this.handler=new kp(e,t,n):this.handler=new bp(e,t,n)}return e.prototype.getTargetAtClientPoint=function(e,t){return this.handler.getTargetAtClientPoint(e,t)},e.prototype.dispose=function(){this.handler.dispose()},e}(),Op=(n("56f3"),function(){function e(e,t,n,i,o){this.value=e,this.selectionStart=t,this.selectionEnd=n,this.selectionStartPosition=i,this.selectionEndPosition=o}return e.prototype.toString=function(){return"[ <"+this.value+">, selectionStart: "+this.selectionStart+", selectionEnd: "+this.selectionEnd+"]"},e.readFromTextArea=function(t){return new e(t.getValue(),t.getSelectionStart(),t.getSelectionEnd(),null,null)},e.prototype.collapseSelection=function(){return new e(this.value,this.value.length,this.value.length,null,null)},e.prototype.writeToTextArea=function(e,t,n){t.setValue(e,this.value),n&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)},e.prototype.deduceEditorPosition=function(e){if(e<=this.selectionStart){var t=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selectionStartPosition,t,-1)}if(e>=this.selectionEnd){t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selectionEndPosition,t,1)}var n=this.value.substring(this.selectionStart,e);if(-1===n.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(this.selectionStartPosition,n,1);var i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selectionEndPosition,i,-1)},e.prototype._finishDeduceEditorPosition=function(e,t,n){var i=0,o=-1;while(-1!==(o=t.indexOf("\n",o+1)))i++;return[e,n*t.length,i]},e.selectedText=function(t){return new e(t,0,t.length,null,null)},e.deduceInput=function(e,t,n,i){if(!e)return{text:"",replaceCharCnt:0};var o=e.value,r=e.selectionStart,s=e.selectionEnd,a=t.value,u=t.selectionStart,l=t.selectionEnd;i&&o.length>0&&r===s&&u===l&&!tr(a,o)&&nr(a,o)&&(r=0,s=0);var c=o.substring(s),h=a.substring(l),d=mr(c,h);a=a.substring(0,a.length-d),o=o.substring(0,o.length-d);var f=o.substring(0,r),p=a.substring(0,u),g=gr(f,p);if(a=a.substring(g),o=o.substring(g),u-=g,r-=g,l-=g,s-=g,n&&u===l&&o.length>0){var m=null;if(u===a.length?tr(a,o)&&(m=a.substring(o.length)):nr(a,o)&&(m=a.substring(0,a.length-o.length)),null!==m&&m.length>0&&(/\uFE0F/.test(m)||Cr(m)))return{text:m,replaceCharCnt:0}}if(u===l){if(o===a&&0===r&&s===o.length&&u===a.length&&-1===a.indexOf("\n")&&Lr(a))return{text:"",replaceCharCnt:0};var v=f.length-g;return{text:a,replaceCharCnt:v}}var _=s-r;return{text:a,replaceCharCnt:_}},e.EMPTY=new e("",0,0,null,null),e}()),Dp=function(){function e(){}return e._getPageOfLine=function(t){return Math.floor((t-1)/e._LINES_PER_PAGE)},e._getRangeForPage=function(t){var n=t*e._LINES_PER_PAGE,i=n+1,o=n+e._LINES_PER_PAGE;return new In(i,1,o+1,1)},e.fromEditorSelection=function(t,n,i,o){var r,s=e._getPageOfLine(i.startLineNumber),a=e._getRangeForPage(s),u=e._getPageOfLine(i.endLineNumber),l=e._getRangeForPage(u),c=a.intersectRanges(new In(1,1,i.startLineNumber,i.startColumn)),h=n.getValueInRange(c,1),d=n.getLineCount(),f=n.getLineMaxColumn(d),p=l.intersectRanges(new In(i.endLineNumber,i.endColumn,d,f)),g=n.getValueInRange(p,1);if(s===u||s+1===u)r=n.getValueInRange(i,1);else{var m=a.intersectRanges(i),v=l.intersectRanges(i);r=n.getValueInRange(m,1)+String.fromCharCode(8230)+n.getValueInRange(v,1)}if(o){var _=500;h.length>_&&(h=h.substring(h.length-_,h.length)),g.length>_&&(g=g.substring(0,_)),r.length>2*_&&(r=r.substring(0,_)+String.fromCharCode(8230)+r.substring(r.length-_,r.length))}return new Op(h+r+g,h.length,h.length+r.length,new Dn(i.startLineNumber,i.startColumn),new Dn(i.endLineNumber,i.endColumn))},e._LINES_PER_PAGE=10,e}(),Ip=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Mp={forceCopyWithSyntaxHighlighting:!1},Tp=function(e){function t(t,n){var i=e.call(this)||this;i._onFocus=i._register(new T),i.onFocus=i._onFocus.event,i._onBlur=i._register(new T),i.onBlur=i._onBlur.event,i._onKeyDown=i._register(new T),i.onKeyDown=i._onKeyDown.event,i._onKeyUp=i._register(new T),i.onKeyUp=i._onKeyUp.event,i._onCut=i._register(new T),i.onCut=i._onCut.event,i._onPaste=i._register(new T),i.onPaste=i._onPaste.event,i._onType=i._register(new T),i.onType=i._onType.event,i._onCompositionStart=i._register(new T),i.onCompositionStart=i._onCompositionStart.event,i._onCompositionUpdate=i._register(new T),i.onCompositionUpdate=i._onCompositionUpdate.event,i._onCompositionEnd=i._register(new T),i.onCompositionEnd=i._onCompositionEnd.event,i._onSelectionChangeRequest=i._register(new T),i.onSelectionChangeRequest=i._onSelectionChangeRequest.event,i._host=t,i._textArea=i._register(new Ap(n)),i._lastTextAreaEvent=0,i._asyncTriggerCut=i._register(new oe((function(){return i._onCut.fire()}),0)),i._textAreaState=Op.EMPTY,i.writeScreenReaderContent("ctor"),i._hasFocus=!1,i._isDoingComposition=!1,i._nextCommand=0,i._register($i(n.domNode,"keydown",(function(e){!i._isDoingComposition||109!==e.keyCode&&1!==e.keyCode||e.stopPropagation(),e.equals(9)&&e.preventDefault(),i._onKeyDown.fire(e)}))),i._register($i(n.domNode,"keyup",(function(e){i._onKeyUp.fire(e)}))),i._register(ji(n.domNode,"compositionstart",(function(e){i._lastTextAreaEvent=1,i._isDoingComposition||(i._isDoingComposition=!0,ti||i._setAndWriteTextAreaState("compositionstart",Op.EMPTY),i._onCompositionStart.fire())})));var r=function(e,t){var n=i._textAreaState,o=Op.readFromTextArea(i._textArea);return[o,Op.deduceInput(n,o,e,t)]},s=function(e){var t=i._textAreaState,n=Op.selectedText(e),o={text:n.value,replaceCharCnt:t.selectionEnd-t.selectionStart};return[n,o]},a=function(e){return!(!ti||"ja"!==e)||!(!Qn||0!==e.indexOf("zh-Han"))};i._register(ji(n.domNode,"compositionupdate",(function(e){if(i._lastTextAreaEvent=2,a(e.locale)){var t=r(!1,!1),n=t[0],o=t[1];return i._textAreaState=n,i._onType.fire(o),void i._onCompositionUpdate.fire(e)}var u=s(e.data),l=u[0],c=u[1];i._textAreaState=l,i._onType.fire(c),i._onCompositionUpdate.fire(e)}))),i._register(ji(n.domNode,"compositionend",(function(e){if(i._lastTextAreaEvent=3,a(e.locale)){var t=r(!1,!1),n=t[0],o=t[1];i._textAreaState=n,i._onType.fire(o)}else{var u=s(e.data);n=u[0],o=u[1];i._textAreaState=n,i._onType.fire(o)}(ti||oi)&&(i._textAreaState=Op.readFromTextArea(i._textArea)),i._isDoingComposition&&(i._isDoingComposition=!1,i._onCompositionEnd.fire())}))),i._register(ji(n.domNode,"input",(function(){var e=8===i._lastTextAreaEvent;if(i._lastTextAreaEvent=4,i._textArea.setIgnoreSelectionChangeTime("received input event"),!i._isDoingComposition){var t=r(o["d"],e&&o["d"]),n=t[0],s=t[1];0===s.replaceCharCnt&&1===s.text.length&&vr(s.text.charCodeAt(0))||(i._textAreaState=n,0===i._nextCommand?""!==s.text&&i._onType.fire(s):(""!==s.text&&i._onPaste.fire({text:s.text}),i._nextCommand=0))}}))),i._register(ji(n.domNode,"cut",(function(e){i._lastTextAreaEvent=5,i._textArea.setIgnoreSelectionChangeTime("received cut event"),i._ensureClipboardGetsEditorSelection(e),i._asyncTriggerCut.schedule()}))),i._register(ji(n.domNode,"copy",(function(e){i._lastTextAreaEvent=6,i._ensureClipboardGetsEditorSelection(e)}))),i._register(ji(n.domNode,"paste",(function(e){if(i._lastTextAreaEvent=7,i._textArea.setIgnoreSelectionChangeTime("received paste event"),Pp.canUseTextData(e)){var t=Pp.getTextData(e);""!==t&&i._onPaste.fire({text:t})}else i._textArea.getSelectionStart()!==i._textArea.getSelectionEnd()&&i._setAndWriteTextAreaState("paste",Op.EMPTY),i._nextCommand=1}))),i._register(ji(n.domNode,"focus",(function(){i._lastTextAreaEvent=8,i._setHasFocus(!0)}))),i._register(ji(n.domNode,"blur",(function(){i._lastTextAreaEvent=9,i._setHasFocus(!1)})));var u=0;return i._register(ji(document,"selectionchange",(function(e){if(i._hasFocus&&!i._isDoingComposition&&oi&&o["g"]){var t=Date.now(),n=t-u;if(u=t,!(n<5)){var r=t-i._textArea.getIgnoreSelectionChangeTime();if(i._textArea.resetSelectionChangeTime(),!(r<100)&&i._textAreaState.selectionStartPosition&&i._textAreaState.selectionEndPosition){var s=i._textArea.getValue();if(i._textAreaState.value===s){var a=i._textArea.getSelectionStart(),l=i._textArea.getSelectionEnd();if(i._textAreaState.selectionStart!==a||i._textAreaState.selectionEnd!==l){var c=i._textAreaState.deduceEditorPosition(a),h=i._host.deduceModelPosition(c[0],c[1],c[2]),d=i._textAreaState.deduceEditorPosition(l),f=i._host.deduceModelPosition(d[0],d[1],d[2]),p=new Tn(h.lineNumber,h.column,f.lineNumber,f.column);i._onSelectionChangeRequest.fire(p)}}}}}}))),i}return Ip(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.focusTextArea=function(){this._setHasFocus(!0)},t.prototype.isFocused=function(){return this._hasFocus},t.prototype._setHasFocus=function(e){this._hasFocus!==e&&(this._hasFocus=e,this._hasFocus&&(ei?this._setAndWriteTextAreaState("focusgain",Op.EMPTY):this.writeScreenReaderContent("focusgain")),this._hasFocus?this._onFocus.fire():this._onBlur.fire())},t.prototype._setAndWriteTextAreaState=function(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t},t.prototype.writeScreenReaderContent=function(e){this._isDoingComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent(this._textAreaState))},t.prototype._ensureClipboardGetsEditorSelection=function(e){var t=this._host.getPlainTextToCopy();if(Pp.canUseTextData(e)){var n=null;ui()&&(t.length<65536||Mp.forceCopyWithSyntaxHighlighting)&&(n=this._host.getHTMLToCopy()),Pp.setTextData(e,t,n)}else this._setAndWriteTextAreaState("copy or cut",Op.selectedText(t))},t}(S),Pp=function(){function e(){}return e.canUseTextData=function(e){return!!e.clipboardData||!!window.clipboardData},e.getTextData=function(e){if(e.clipboardData)return e.preventDefault(),e.clipboardData.getData("text/plain");if(window.clipboardData)return e.preventDefault(),window.clipboardData.getData("Text");throw new Error("ClipboardEventUtils.getTextData: Cannot use text data!")},e.setTextData=function(e,t,n){if(e.clipboardData)return e.clipboardData.setData("text/plain",t),null!==n&&e.clipboardData.setData("text/html",n),void e.preventDefault();if(window.clipboardData)return window.clipboardData.setData("Text",t),void e.preventDefault();throw new Error("ClipboardEventUtils.setTextData: Cannot use text data!")},e}(),Ap=function(e){function t(t){var n=e.call(this)||this;return n._actual=t,n._ignoreSelectionChangeTime=0,n}return Ip(t,e),t.prototype.setIgnoreSelectionChangeTime=function(e){this._ignoreSelectionChangeTime=Date.now()},t.prototype.getIgnoreSelectionChangeTime=function(){return this._ignoreSelectionChangeTime},t.prototype.resetSelectionChangeTime=function(){this._ignoreSelectionChangeTime=0},t.prototype.getValue=function(){return this._actual.domNode.value},t.prototype.setValue=function(e,t){var n=this._actual.domNode;n.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),n.value=t)},t.prototype.getSelectionStart=function(){return this._actual.domNode.selectionStart},t.prototype.getSelectionEnd=function(){return this._actual.domNode.selectionEnd},t.prototype.setSelectionRange=function(e,t,n){var i=this._actual.domNode,o=document.activeElement===i,r=i.selectionStart,s=i.selectionEnd;if(o&&r===t&&s===n)ni&&window.parent!==window&&i.focus();else{if(o)return this.setIgnoreSelectionChangeTime("setSelectionRange"),i.setSelectionRange(t,n),void(ni&&window.parent!==window&&i.focus());try{var a=No(i);this.setIgnoreSelectionChangeTime("setSelectionRange"),i.focus(),i.setSelectionRange(t,n),Eo(i,a)}catch(u){}}},t}(S),Rp=(n("2ab7"),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),Fp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Rp(t,e),t}(If);function Wp(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}var Vp=function(){function e(e,t,n,i){void 0===i&&(i=1),this.r=0|Math.min(255,Math.max(0,e)),this.g=0|Math.min(255,Math.max(0,t)),this.b=0|Math.min(255,Math.max(0,n)),this.a=Wp(Math.max(Math.min(1,i),0),3)}return e.equals=function(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a},e}(),Bp=function(){function e(e,t,n,i){this.h=0|Math.max(Math.min(360,e),0),this.s=Wp(Math.max(Math.min(1,t),0),3),this.l=Wp(Math.max(Math.min(1,n),0),3),this.a=Wp(Math.max(Math.min(1,i),0),3)}return e.equals=function(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a},e.fromRGBA=function(t){var n=t.r/255,i=t.g/255,o=t.b/255,r=t.a,s=Math.max(n,i,o),a=Math.min(n,i,o),u=0,l=0,c=(a+s)/2,h=s-a;if(h>0){switch(l=Math.min(c<=.5?h/(2*c):h/(2-2*c),1),s){case n:u=(i-o)/h+(i1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},e.toRGBA=function(t){var n,i,o,r=t.h/360,s=t.s,a=t.l,u=t.a;if(0===s)n=i=o=a;else{var l=a<.5?a*(1+s):a+s-a*s,c=2*a-l;n=e._hue2rgb(c,l,r+1/3),i=e._hue2rgb(c,l,r),o=e._hue2rgb(c,l,r-1/3)}return new Vp(Math.round(255*n),Math.round(255*i),Math.round(255*o),u)},e}(),Hp=function(){function e(e,t,n,i){this.h=0|Math.max(Math.min(360,e),0),this.s=Wp(Math.max(Math.min(1,t),0),3),this.v=Wp(Math.max(Math.min(1,n),0),3),this.a=Wp(Math.max(Math.min(1,i),0),3)}return e.equals=function(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a},e.fromRGBA=function(t){var n,i=t.r/255,o=t.g/255,r=t.b/255,s=Math.max(i,o,r),a=Math.min(i,o,r),u=s-a,l=0===s?0:u/s;return n=0===u?0:s===i?((o-r)/u%6+6)%6:s===o?(r-i)/u+2:(i-o)/u+4,new e(Math.round(60*n),l,s,t.a)},e.toRGBA=function(e){var t=e.h,n=e.s,i=e.v,o=e.a,r=i*n,s=r*(1-Math.abs(t/60%2-1)),a=i-r,u=[0,0,0],l=u[0],c=u[1],h=u[2];return t<60?(l=r,c=s):t<120?(l=s,c=r):t<180?(c=r,h=s):t<240?(c=s,h=r):t<300?(l=s,h=r):t<360&&(l=r,h=s),l=Math.round(255*(l+a)),c=Math.round(255*(c+a)),h=Math.round(255*(h+a)),new Vp(l,c,h,o)},e}(),jp=function(){function e(e){if(!e)throw new Error("Color needs a value");if(e instanceof Vp)this.rgba=e;else if(e instanceof Bp)this._hsla=e,this.rgba=Bp.toRGBA(e);else{if(!(e instanceof Hp))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=Hp.toRGBA(e)}}return e.fromHex=function(t){return e.Format.CSS.parseHex(t)||e.red},Object.defineProperty(e.prototype,"hsla",{get:function(){return this._hsla?this._hsla:Bp.fromRGBA(this.rgba)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hsva",{get:function(){return this._hsva?this._hsva:Hp.fromRGBA(this.rgba)},enumerable:!0,configurable:!0}),e.prototype.equals=function(e){return!!e&&Vp.equals(this.rgba,e.rgba)&&Bp.equals(this.hsla,e.hsla)&&Hp.equals(this.hsva,e.hsva)},e.prototype.getRelativeLuminance=function(){var t=e._relativeLuminanceForComponent(this.rgba.r),n=e._relativeLuminanceForComponent(this.rgba.g),i=e._relativeLuminanceForComponent(this.rgba.b),o=.2126*t+.7152*n+.0722*i;return Wp(o,4)},e._relativeLuminanceForComponent=function(e){var t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)},e.prototype.isLighter=function(){var e=(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3;return e>=128},e.prototype.isLighterThan=function(e){var t=this.getRelativeLuminance(),n=e.getRelativeLuminance();return t>n},e.prototype.isDarkerThan=function(e){var t=this.getRelativeLuminance(),n=e.getRelativeLuminance();return t'+n+"":String(i)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===n||n%10===0?String(n):"":String(n)},t.prototype.prepareRender=function(e){if(0!==this._renderLineNumbers){for(var n=o["c"]?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,s='
',a=[],u=i;u<=r;u++){var l=u-i,c=this._getLineRenderLineNumber(u);a[l]=c?s+c+"
":""}this._renderResult=a}else this._renderResult=null},t.prototype.render=function(e,t){if(!this._renderResult)return"";var n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]},t.CLASS_NAME="line-numbers",t}(Fp);Zf((function(e,t){var n=e.getColor(Rm);n&&t.addRule(".monaco-editor .line-numbers { color: "+n+"; }");var i=e.getColor(Wm);i&&t.addRule(".monaco-editor .current-line ~ .line-numbers { color: "+i+"; }")}));var sv=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),av=function(e){function t(t){var n=e.call(this,t)||this;return n._canUseLayerHinting=n._context.configuration.editor.canUseLayerHinting,n._contentLeft=n._context.configuration.editor.layoutInfo.contentLeft,n._glyphMarginLeft=n._context.configuration.editor.layoutInfo.glyphMarginLeft,n._glyphMarginWidth=n._context.configuration.editor.layoutInfo.glyphMarginWidth,n._domNode=n._createDomNode(),n}return sv(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.getDomNode=function(){return this._domNode},t.prototype._createDomNode=function(){var e=ff(document.createElement("div"));return e.setClassName(t.OUTER_CLASS_NAME),e.setPosition("absolute"),e.setAttribute("role","presentation"),e.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ff(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(t.CLASS_NAME),e.appendChild(this._glyphMarginBackgroundDomNode),e},t.prototype.onConfigurationChanged=function(e){return e.canUseLayerHinting&&(this._canUseLayerHinting=this._context.configuration.editor.canUseLayerHinting),e.layoutInfo&&(this._contentLeft=this._context.configuration.editor.layoutInfo.contentLeft,this._glyphMarginLeft=this._context.configuration.editor.layoutInfo.glyphMarginLeft,this._glyphMarginWidth=this._context.configuration.editor.layoutInfo.glyphMarginWidth),!0},t.prototype.onScrollChanged=function(t){return e.prototype.onScrollChanged.call(this,t)||t.scrollTopChanged},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){this._domNode.setLayerHinting(this._canUseLayerHinting);var t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);var n=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(n),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(n)},t.CLASS_NAME="glyph-margin",t.OUTER_CLASS_NAME="margin",t}(Tf),uv=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),lv=function(e){function t(t){for(var n=e.call(this,0)||this,i=0,o=t.length;i0&&this._emit(e)}},t.prototype._emit=function(e){for(var t=this._listeners.slice(0),n=0,i=t.length;n0)return new Op(i,i.length,i.length,n,n)}}return Op.EMPTY}return Dp.fromEditorSelection(e,a,r._selections[0],0===r._accessibilitySupport)},deduceModelPosition:function(e,t,n){return r._context.model.deduceModelPositionRelativeToViewPosition(e,t,n)}};return r._textAreaInput=r._register(new Tp(u,r.textArea)),r._register(r._textAreaInput.onKeyDown((function(e){r._viewController.emitKeyDown(e)}))),r._register(r._textAreaInput.onKeyUp((function(e){r._viewController.emitKeyUp(e)}))),r._register(r._textAreaInput.onPaste((function(e){var t=Av.INSTANCE.get(e.text),n=!1,i=null;t&&(n=r._emptySelectionClipboard&&t.isFromEmptySelection,i=t.multicursorText),r._viewController.paste("keyboard",e.text,n,i)}))),r._register(r._textAreaInput.onCut((function(){r._viewController.cut("keyboard")}))),r._register(r._textAreaInput.onType((function(e){e.replaceCharCnt?r._viewController.replacePreviousChar("keyboard",e.text,e.replaceCharCnt):r._viewController.type("keyboard",e.text)}))),r._register(r._textAreaInput.onSelectionChangeRequest((function(e){r._viewController.setSelection("keyboard",e)}))),r._register(r._textAreaInput.onCompositionStart((function(){var e=r._selections[0].startLineNumber,t=r._selections[0].startColumn;r._context.privateViewEventBus.emit(new Cv(new In(e,t,e,t),0,!0,1));var n=r._viewHelper.visibleRangeForPositionRelativeToEditor(e,t);n&&(r._visibleTextArea=new Tv(r._context.viewLayout.getVerticalOffsetForLineNumber(e),n.left,Pv?0:1),r._render()),r.textArea.setClassName("inputarea ime-input"),r._viewController.compositionStart("keyboard")}))),r._register(r._textAreaInput.onCompositionUpdate((function(e){r._visibleTextArea=ti?r._visibleTextArea.setWidth(0):r._visibleTextArea.setWidth(Fv(e.data,r._fontInfo)),r._render()}))),r._register(r._textAreaInput.onCompositionEnd((function(){r._visibleTextArea=null,r._render(),r.textArea.setClassName("inputarea"),r._viewController.compositionEnd("keyboard")}))),r._register(r._textAreaInput.onFocus((function(){r._context.privateViewEventBus.emit(new vv(!0))}))),r._register(r._textAreaInput.onBlur((function(){r._context.privateViewEventBus.emit(new vv(!1))}))),r}return Mv(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype._getWordBeforePosition=function(e){var t=this._context.model.getLineContent(e.lineNumber),n=hv(this._context.configuration.editor.wordSeparators),i=e.column,o=0;while(i>1){var r=t.charCodeAt(i-2),s=n.get(r);if(0!==s||o>50)return t.substring(i-1,e.column-1);o++,i--}return t.substring(0,e.column-1)},t.prototype._getCharacterBeforePosition=function(e){if(e.column>1){var t=this._context.model.getLineContent(e.lineNumber),n=t.charAt(e.column-2);if(!vr(n.charCodeAt(0)))return n}return""},t.prototype.onConfigurationChanged=function(e){var t=this._context.configuration.editor;return e.fontInfo&&(this._fontInfo=t.fontInfo),e.viewInfo&&this.textArea.setAttribute("aria-label",t.viewInfo.ariaLabel),e.layoutInfo&&(this._contentLeft=t.layoutInfo.contentLeft,this._contentWidth=t.layoutInfo.contentWidth,this._contentHeight=t.layoutInfo.contentHeight),e.lineHeight&&(this._lineHeight=t.lineHeight),e.accessibilitySupport&&(this._accessibilitySupport=t.accessibilitySupport,this._textAreaInput.writeScreenReaderContent("strategy changed")),e.emptySelectionClipboard&&(this._emptySelectionClipboard=t.emptySelectionClipboard),e.copyWithSyntaxHighlighting&&(this._copyWithSyntaxHighlighting=t.copyWithSyntaxHighlighting),!0},t.prototype.onCursorStateChanged=function(e){return this._selections=e.selections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0},t.prototype.onZonesChanged=function(e){return!0},t.prototype.isFocused=function(){return this._textAreaInput.isFocused()},t.prototype.focusTextArea=function(){this._textAreaInput.focusTextArea()},t.prototype.prepareRender=function(e){if(2===this._accessibilitySupport)this._primaryCursorVisibleRange=null;else{var t=new Dn(this._selections[0].positionLineNumber,this._selections[0].positionColumn);this._primaryCursorVisibleRange=e.visibleRangeForPosition(t)}},t.prototype.render=function(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()},t.prototype._render=function(){if(this._visibleTextArea)this._renderInsideEditor(this._visibleTextArea.top-this._scrollTop,this._contentLeft+this._visibleTextArea.left-this._scrollLeft,this._visibleTextArea.width,this._lineHeight,!0);else if(this._primaryCursorVisibleRange){var e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(ethis._contentLeft+this._contentWidth)this._renderAtTopLeft();else{var t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;t<0||t>this._contentHeight?this._renderAtTopLeft():this._renderInsideEditor(t,e,Pv?0:1,Pv?0:1,!1)}}else this._renderAtTopLeft()},t.prototype._renderInsideEditor=function(e,t,n,i,o){var r=this.textArea,s=this.textAreaCover;o?Xd.applyFontInfo(r,this._fontInfo):(r.setFontSize(1),r.setLineHeight(this._fontInfo.lineHeight)),r.setTop(e),r.setLeft(t),r.setWidth(n),r.setHeight(i),s.setTop(0),s.setLeft(0),s.setWidth(0),s.setHeight(0)},t.prototype._renderAtTopLeft=function(){var e=this.textArea,t=this.textAreaCover;if(Xd.applyFontInfo(e,this._fontInfo),e.setTop(0),e.setLeft(0),t.setTop(0),t.setLeft(0),Pv)return e.setWidth(0),e.setHeight(0),t.setWidth(0),void t.setHeight(0);e.setWidth(1),e.setHeight(1),t.setWidth(1),t.setHeight(1),this._context.configuration.editor.viewInfo.glyphMargin?t.setClassName("monaco-editor-background textAreaCover "+av.OUTER_CLASS_NAME):0!==this._context.configuration.editor.viewInfo.renderLineNumbers?t.setClassName("monaco-editor-background textAreaCover "+rv.CLASS_NAME):t.setClassName("monaco-editor-background textAreaCover")},t}(Tf);function Fv(e,t){var n=document.createElement("canvas"),i=n.getContext("2d");i.font=Wv(t);var o=i.measureText(e);return ni?o.width+2:o.width}function Wv(e){return Vv("normal",e.fontWeight,e.fontSize,e.lineHeight,e.fontFamily)}function Vv(e,t,n,i,o){return e+" normal "+t+" "+n+"px / "+i+"px "+o}var Bv=o["b"].performance&&"function"===typeof o["b"].performance.now,Hv=function(){function e(e){this._highResolution=Bv&&e,this._startTime=this._now(),this._stopTime=-1}return e.create=function(t){return void 0===t&&(t=!0),new e(t)},e.prototype.elapsed=function(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime},e.prototype._now=function(){return this._highResolution?o["b"].performance.now():(new Date).getTime()},e}(),jv=function(){function e(e,t){this.beforeVersionId=e,this.beforeCursorState=t,this.afterCursorState=null,this.afterVersionId=-1,this.editOperations=[]}return e.prototype.undo=function(e){for(var t=this.editOperations.length-1;t>=0;t--)this.editOperations[t]={operations:e.applyEdits(this.editOperations[t].operations)}},e.prototype.redo=function(e){for(var t=0;t0){var e=this.past.pop();try{e.undo(this.model)}catch(t){return l(t),this.clear(),null}return this.future.push(e),{selections:e.beforeCursorState,recordedVersionId:e.beforeVersionId}}return null},e.prototype.canUndo=function(){return this.past.length>0},e.prototype.redo=function(){if(this.future.length>0){var e=this.future.pop();try{e.redo(this.model)}catch(t){return l(t),this.clear(),null}return this.past.push(e),{selections:e.afterCursorState,recordedVersionId:e.afterVersionId}}return null},e.prototype.canRedo=function(){return this.future.length>0},e}(),Kv=function(){function e(){}return e}();function qv(e,t,n,i,o){var r;for(o.spacesDiff=0,o.looksLikeAlignment=!1,r=0;r0&&l>0)&&!(h>0&&d>0)){var f=Math.abs(l-d),p=Math.abs(u-h);if(0===f)return o.spacesDiff=p,void(p>0&&0<=h-1&&h-10?o++:_>1&&r++,qv(s,a,p,v,h),!h.looksLikeAlignment)){var S=h.spacesDiff;S<=l&&c[S]++,s=p,a=v}}var x=n;o!==r&&(x=ok&&(k=t,L=e)})),{insertSpaces:x,tabSize:L}}function Yv(e){return(1&e.metadata)>>>0}function Zv(e,t){e.metadata=254&e.metadata|t<<0}function Xv(e){return(2&e.metadata)>>>1===1}function Jv(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function Qv(e){return(4&e.metadata)>>>2===1}function e_(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function t_(e){return(8&e.metadata)>>>3===1}function n_(e,t){e.metadata=247&e.metadata|(t?1:0)<<3}function i_(e){return(48&e.metadata)>>>4}function o_(e,t){e.metadata=207&e.metadata|t<<4}function r_(e){return(64&e.metadata)>>>6===1}function s_(e,t){e.metadata=191&e.metadata|(t?1:0)<<6}var a_=function(){function e(e,t,n){this.metadata=0,this.parent=this,this.left=this,this.right=this,Zv(this,1),this.start=t,this.end=n,this.delta=0,this.maxEnd=n,this.id=e,this.ownerId=0,this.options=null,e_(this,!1),o_(this,1),n_(this,!1),s_(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=null,Jv(this,!1)}return e.prototype.reset=function(e,t,n,i){this.start=t,this.end=n,this.maxEnd=n,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=i},e.prototype.setOptions=function(e){this.options=e;var t=this.options.className;e_(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),o_(this,this.options.stickiness),n_(this,!(!this.options.overviewRuler||!this.options.overviewRuler.color)),s_(this,this.options.collapseOnReplaceEdit)},e.prototype.setCachedOffsets=function(e,t,n){this.cachedVersionId!==n&&(this.range=null),this.cachedVersionId=n,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t},e.prototype.detach=function(){this.parent=null,this.left=null,this.right=null},e}(),u_=new a_(null,0,0);u_.parent=u_,u_.left=u_,u_.right=u_,Zv(u_,0);var l_=function(){function e(){this.root=u_,this.requestNormalizeDelta=!1}return e.prototype.intervalSearch=function(e,t,n,i,o){return this.root===u_?[]:__(this,e,t,n,i,o)},e.prototype.search=function(e,t,n){return this.root===u_?[]:v_(this,e,t,n)},e.prototype.collectNodesFromOwner=function(e){return g_(this,e)},e.prototype.collectNodesPostOrder=function(){return m_(this)},e.prototype.insert=function(e){y_(this,e),this._normalizeDeltaIfNecessary()},e.prototype.delete=function(e){w_(this,e),this._normalizeDeltaIfNecessary()},e.prototype.resolveNode=function(e,t){var n=e,i=0;while(e!==this.root)e===e.parent.right&&(i+=e.parent.delta),e=e.parent;var o=n.start+i,r=n.end+i;n.setCachedOffsets(o,r,t)},e.prototype.acceptReplace=function(e,t,n,i){for(var o=f_(this,e,e+t),r=0,s=o.length;rn)&&(1!==i&&(2===i||t))}function d_(e,t,n,i,o){var r=i_(e),s=0===r||2===r,a=1===r||2===r,u=n-t,l=i,c=Math.min(u,l),h=e.start,d=!1,f=e.end,p=!1;t<=h&&f<=n&&r_(e)&&(e.start=t,d=!0,e.end=t,p=!0);var g=o?1:u>0?2:0;if(!d&&h_(h,s,t,g)&&(d=!0),!p&&h_(f,a,t,g)&&(p=!0),c>0&&!o){g=u>l?2:0;!d&&h_(h,s,t+c,g)&&(d=!0),!p&&h_(f,a,t+c,g)&&(p=!0)}g=o?1:0;!d&&h_(h,s,n,g)&&(e.start=t+l,d=!0),!p&&h_(f,a,n,g)&&(e.end=t+l,p=!0);var m=l-u;d||(e.start=Math.max(0,h+m),d=!0),p||(e.end=Math.max(0,f+m),p=!0),e.start>e.end&&(e.end=e.start)}function f_(e,t,n){var i=e.root,o=0,r=0,s=0,a=0,u=[],l=0;while(i!==u_)if(Xv(i))Jv(i.left,!1),Jv(i.right,!1),i===i.parent.right&&(o-=i.parent.delta),i=i.parent;else{if(!Xv(i.left)){if(r=o+i.maxEnd,rn?Jv(i,!0):(a=o+i.end,a>=t&&(i.setCachedOffsets(s,a,0),u[l++]=i),Jv(i,!0),i.right===u_||Xv(i.right)||(o+=i.delta,i=i.right))}return Jv(e.root,!1),u}function p_(e,t,n,i){var o=e.root,r=0,s=0,a=0,u=i-(n-t);while(o!==u_)if(Xv(o))Jv(o.left,!1),Jv(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),N_(o),o=o.parent;else{if(!Xv(o.left)){if(s=r+o.maxEnd,sn?(o.start+=u,o.end+=u,o.delta+=u,(o.delta<-1073741824||o.delta>1073741824)&&(e.requestNormalizeDelta=!0),Jv(o,!0)):(Jv(o,!0),o.right===u_||Xv(o.right)||(r+=o.delta,o=o.right))}Jv(e.root,!1)}function g_(e,t){var n=e.root,i=[],o=0;while(n!==u_)Xv(n)?(Jv(n.left,!1),Jv(n.right,!1),n=n.parent):n.left===u_||Xv(n.left)?(n.ownerId===t&&(i[o++]=n),Jv(n,!0),n.right===u_||Xv(n.right)||(n=n.right)):n=n.left;return Jv(e.root,!1),i}function m_(e){var t=e.root,n=[],i=0;while(t!==u_)Xv(t)?(Jv(t.left,!1),Jv(t.right,!1),t=t.parent):t.left===u_||Xv(t.left)?t.right===u_||Xv(t.right)?(n[i++]=t,Jv(t,!0)):t=t.right:t=t.left;return Jv(e.root,!1),n}function v_(e,t,n,i){var o=e.root,r=0,s=0,a=0,u=[],l=0;while(o!==u_)if(Xv(o))Jv(o.left,!1),Jv(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;else if(o.left===u_||Xv(o.left)){s=r+o.start,a=r+o.end,o.setCachedOffsets(s,a,i);var c=!0;t&&o.ownerId&&o.ownerId!==t&&(c=!1),n&&Qv(o)&&(c=!1),c&&(u[l++]=o),Jv(o,!0),o.right===u_||Xv(o.right)||(r+=o.delta,o=o.right)}else o=o.left;return Jv(e.root,!1),u}function __(e,t,n,i,o,r){var s=e.root,a=0,u=0,l=0,c=0,h=[],d=0;while(s!==u_)if(Xv(s))Jv(s.left,!1),Jv(s.right,!1),s===s.parent.right&&(a-=s.parent.delta),s=s.parent;else{if(!Xv(s.left)){if(u=a+s.maxEnd,un)Jv(s,!0);else{if(c=a+s.end,c>=t){s.setCachedOffsets(l,c,r);var f=!0;i&&s.ownerId&&s.ownerId!==i&&(f=!1),o&&Qv(s)&&(f=!1),f&&(h[d++]=s)}Jv(s,!0),s.right===u_||Xv(s.right)||(a+=s.delta,s=s.right)}}return Jv(e.root,!1),h}function y_(e,t){if(e.root===u_)return t.parent=u_,t.left=u_,t.right=u_,Zv(t,0),e.root=t,e.root;b_(e,t),E_(t.parent);var n=t;while(n!==e.root&&1===Yv(n.parent))if(n.parent===n.parent.parent.left){var i=n.parent.parent.right;1===Yv(i)?(Zv(n.parent,0),Zv(i,0),Zv(n.parent.parent,1),n=n.parent.parent):(n===n.parent.right&&(n=n.parent,x_(e,n)),Zv(n.parent,0),Zv(n.parent.parent,1),L_(e,n.parent.parent))}else{i=n.parent.parent.left;1===Yv(i)?(Zv(n.parent,0),Zv(i,0),Zv(n.parent.parent,1),n=n.parent.parent):(n===n.parent.left&&(n=n.parent,L_(e,n)),Zv(n.parent,0),Zv(n.parent.parent,1),x_(e,n.parent.parent))}return Zv(e.root,0),t}function b_(e,t){var n=0,i=e.root,o=t.start,r=t.end;while(1){var s=O_(o,r,i.start+n,i.end+n);if(s<0){if(i.left===u_){t.start-=n,t.end-=n,t.maxEnd-=n,i.left=t;break}i=i.left}else{if(i.right===u_){t.start-=n+i.delta,t.end-=n+i.delta,t.maxEnd-=n+i.delta,i.right=t;break}n+=i.delta,i=i.right}}t.parent=i,t.left=u_,t.right=u_,Zv(t,1)}function w_(e,t){var n,i;if(t.left===u_?(n=t.right,i=t,n.delta+=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta):t.right===u_?(n=t.left,i=t):(i=C_(t.right),n=i.right,n.start+=i.delta,n.end+=i.delta,n.delta+=i.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta,i.delta=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0)),i===e.root)return e.root=n,Zv(n,0),t.detach(),S_(),N_(n),void(e.root.parent=u_);var o,r=1===Yv(i);if(i===i.parent.left?i.parent.left=n:i.parent.right=n,i===t?n.parent=i.parent:(i.parent===t?n.parent=i:n.parent=i.parent,i.left=t.left,i.right=t.right,i.parent=t.parent,Zv(i,Yv(t)),t===e.root?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left!==u_&&(i.left.parent=i),i.right!==u_&&(i.right.parent=i)),t.detach(),r)return E_(n.parent),i!==t&&(E_(i),E_(i.parent)),void S_();E_(n),E_(n.parent),i!==t&&(E_(i),E_(i.parent));while(n!==e.root&&0===Yv(n))n===n.parent.left?(o=n.parent.right,1===Yv(o)&&(Zv(o,0),Zv(n.parent,1),x_(e,n.parent),o=n.parent.right),0===Yv(o.left)&&0===Yv(o.right)?(Zv(o,1),n=n.parent):(0===Yv(o.right)&&(Zv(o.left,0),Zv(o,1),L_(e,o),o=n.parent.right),Zv(o,Yv(n.parent)),Zv(n.parent,0),Zv(o.right,0),x_(e,n.parent),n=e.root)):(o=n.parent.left,1===Yv(o)&&(Zv(o,0),Zv(n.parent,1),L_(e,n.parent),o=n.parent.left),0===Yv(o.left)&&0===Yv(o.right)?(Zv(o,1),n=n.parent):(0===Yv(o.left)&&(Zv(o.right,0),Zv(o,1),x_(e,o),o=n.parent.left),Zv(o,Yv(n.parent)),Zv(n.parent,0),Zv(o.left,0),L_(e,n.parent),n=e.root));Zv(n,0),S_()}function C_(e){while(e.left!==u_)e=e.left;return e}function S_(){u_.parent=u_,u_.delta=0,u_.start=0,u_.end=0}function x_(e,t){var n=t.right;n.delta+=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,t.right=n.left,n.left!==u_&&(n.left.parent=t),n.parent=t.parent,t.parent===u_?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n,N_(t),N_(n)}function L_(e,t){var n=t.left;t.delta-=n.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=n.delta,t.end-=n.delta,t.left=n.right,n.right!==u_&&(n.right.parent=t),n.parent=t.parent,t.parent===u_?e.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n,N_(t),N_(n)}function k_(e){var t=e.end;if(e.left!==u_){var n=e.left.maxEnd;n>t&&(t=n)}if(e.right!==u_){var i=e.right.maxEnd+e.delta;i>t&&(t=i)}return t}function N_(e){e.maxEnd=k_(e)}function E_(e){while(e!==u_){var t=k_(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}function O_(e,t,n,i){return e===n?t-i:e-n}var D_=function(){function e(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}return e.prototype.next=function(){if(this.right!==I_)return M_(this.right);var e=this;while(e.parent!==I_){if(e.parent.left===e)break;e=e.parent}return e.parent===I_?I_:e.parent},e.prototype.prev=function(){if(this.left!==I_)return T_(this.left);var e=this;while(e.parent!==I_){if(e.parent.right===e)break;e=e.parent}return e.parent===I_?I_:e.parent},e.prototype.detach=function(){this.parent=null,this.left=null,this.right=null},e}(),I_=new D_(null,0);function M_(e){while(e.left!==I_)e=e.left;return e}function T_(e){while(e.right!==I_)e=e.right;return e}function P_(e){return e===I_?0:e.size_left+e.piece.length+P_(e.right)}function A_(e){return e===I_?0:e.lf_left+e.piece.lineFeedCnt+A_(e.right)}function R_(){I_.parent=I_}function F_(e,t){var n=t.right;n.size_left+=t.size_left+(t.piece?t.piece.length:0),n.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=n.left,n.left!==I_&&(n.left.parent=t),n.parent=t.parent,t.parent===I_?e.root=n:t.parent.left===t?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n}function W_(e,t){var n=t.left;t.left=n.right,n.right!==I_&&(n.right.parent=t),n.parent=t.parent,t.size_left-=n.size_left+(n.piece?n.piece.length:0),t.lf_left-=n.lf_left+(n.piece?n.piece.lineFeedCnt:0),t.parent===I_?e.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n}function V_(e,t){var n,i;if(t.left===I_?(i=t,n=i.right):t.right===I_?(i=t,n=i.left):(i=M_(t.right),n=i.right),i===e.root)return e.root=n,n.color=0,t.detach(),R_(),void(e.root.parent=I_);var o=1===i.color;if(i===i.parent.left?i.parent.left=n:i.parent.right=n,i===t?(n.parent=i.parent,j_(e,n)):(i.parent===t?n.parent=i:n.parent=i.parent,j_(e,n),i.left=t.left,i.right=t.right,i.parent=t.parent,i.color=t.color,t===e.root?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left!==I_&&(i.left.parent=i),i.right!==I_&&(i.right.parent=i),i.size_left=t.size_left,i.lf_left=t.lf_left,j_(e,i)),t.detach(),n.parent.left===n){var r=P_(n),s=A_(n);if(r!==n.parent.size_left||s!==n.parent.lf_left){var a=r-n.parent.size_left,u=s-n.parent.lf_left;n.parent.size_left=r,n.parent.lf_left=s,H_(e,n.parent,a,u)}}if(j_(e,n.parent),o)R_();else{var l;while(n!==e.root&&0===n.color)n===n.parent.left?(l=n.parent.right,1===l.color&&(l.color=0,n.parent.color=1,F_(e,n.parent),l=n.parent.right),0===l.left.color&&0===l.right.color?(l.color=1,n=n.parent):(0===l.right.color&&(l.left.color=0,l.color=1,W_(e,l),l=n.parent.right),l.color=n.parent.color,n.parent.color=0,l.right.color=0,F_(e,n.parent),n=e.root)):(l=n.parent.left,1===l.color&&(l.color=0,n.parent.color=1,W_(e,n.parent),l=n.parent.left),0===l.left.color&&0===l.right.color?(l.color=1,n=n.parent):(0===l.left.color&&(l.right.color=0,l.color=1,F_(e,l),l=n.parent.left),l.color=n.parent.color,n.parent.color=0,l.left.color=0,W_(e,n.parent),n=e.root));n.color=0,R_()}}function B_(e,t){j_(e,t);while(t!==e.root&&1===t.parent.color)if(t.parent===t.parent.parent.left){var n=t.parent.parent.right;1===n.color?(t.parent.color=0,n.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&(t=t.parent,F_(e,t)),t.parent.color=0,t.parent.parent.color=1,W_(e,t.parent.parent))}else{n=t.parent.parent.left;1===n.color?(t.parent.color=0,n.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&(t=t.parent,W_(e,t)),t.parent.color=0,t.parent.parent.color=1,F_(e,t.parent.parent))}e.root.color=0}function H_(e,t,n,i){while(t!==e.root&&t!==I_)t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=i),t=t.parent}function j_(e,t){var n=0,i=0;if(t!==e.root){if(0===n){while(t!==e.root&&t===t.parent.right)t=t.parent;if(t===e.root)return;t=t.parent,n=P_(t.left)-t.size_left,i=A_(t.left)-t.lf_left,t.size_left+=n,t.lf_left+=i}while(t!==e.root&&(0!==n||0!==i))t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=i),t=t.parent}}I_.parent=I_,I_.left=I_,I_.right=I_,I_.color=0;var z_=999,U_=function(){function e(e,t,n,i){this.searchString=e,this.isRegex=t,this.matchCase=n,this.wordSeparators=i}return e.prototype.parseSearchRequest=function(){if(""===this.searchString)return null;var e;e=this.isRegex?$_(this.searchString):this.searchString.indexOf("\n")>=0;var t=null;try{t=ir(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0})}catch(i){return null}if(!t)return null;var n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new K_(t,this.wordSeparators?hv(this.wordSeparators):null,n?this.searchString:null)},e}();function $_(e){if(!e||0===e.length)return!1;for(var t=0,n=e.length;t=n)break;var o=e.charCodeAt(t);if(110===o||114===o||87===o)return!0}}return!1}var K_=function(){function e(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n}return e}();function q_(e,t,n){if(!n)return new Os(e,null);for(var i=[],o=0,r=t.length;o>0);t[o]>=e?i=o-1:t[o+1]>=e?(n=o,i=o):n=o+1}return n+1},e}(),Y_=function(){function e(){}return e.findMatches=function(e,t,n,i,o){var r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,n,new Q_(r.wordSeparators,r.regex),i,o):this._doFindMatchesLineByLine(e,n,r,i,o):[]},e._getMultilineMatchRange=function(e,t,n,i,o,r){var s,a,u=0;if(i?(u=i.findLineFeedCountBeforeOffset(o),s=t+o+u):s=t+o,i){var l=i.findLineFeedCountBeforeOffset(o+r.length),c=l-u;a=s+r.length+c}else a=s+r.length;var h=e.getPositionAt(s),d=e.getPositionAt(a);return new In(h.lineNumber,h.column,d.lineNumber,d.column)},e._doFindMatchesMultiline=function(e,t,n,i,o){var r,s=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),u="\r\n"===e.getEOL()?new G_(a):null,l=[],c=0;n.reset(0);while(r=n.next(a))if(l[c++]=q_(this._getMultilineMatchRange(e,s,a,u,r.index,r[0]),r,i),c>=o)return l;return l},e._doFindMatchesLineByLine=function(e,t,n,i,o){var r=[],s=0;if(t.startLineNumber===t.endLineNumber){var a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return s=this._findMatchesInLine(n,a,t.startLineNumber,t.startColumn-1,s,r,i,o),r}var u=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);s=this._findMatchesInLine(n,u,t.startLineNumber,t.startColumn-1,s,r,i,o);for(var l=t.startLineNumber+1;l=a))return o;return o}var f,p=new Q_(e.wordSeparators,e.regex);p.reset(0);do{if(f=p.next(t),f&&(r[o++]=q_(new In(n,f.index+1+i,n,f.index+1+f[0].length+i),f,s),o>=a))return o}while(f);return o},e.findNextMatch=function(e,t,n,i){var o=t.parseSearchRequest();if(!o)return null;var r=new Q_(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,n,r,i):this._doFindNextMatchLineByLine(e,n,r,i)},e._doFindNextMatchMultiline=function(e,t,n,i){var o=new Dn(t.lineNumber,1),r=e.getOffsetAt(o),s=e.getLineCount(),a=e.getValueInRange(new In(o.lineNumber,o.column,s,e.getLineMaxColumn(s)),1),u="\r\n"===e.getEOL()?new G_(a):null;n.reset(t.column-1);var l=n.next(a);return l?q_(this._getMultilineMatchRange(e,r,a,u,l.index,l[0]),l,i):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new Dn(1,1),n,i):null},e._doFindNextMatchLineByLine=function(e,t,n,i){var o=e.getLineCount(),r=t.lineNumber,s=e.getLineContent(r),a=this._findFirstMatchInLine(n,s,r,t.column,i);if(a)return a;for(var u=1;u<=o;u++){var l=(r+u-1)%o,c=e.getLineContent(l+1),h=this._findFirstMatchInLine(n,c,l+1,1,i);if(h)return h}return null},e._findFirstMatchInLine=function(e,t,n,i,o){e.reset(i-1);var r=e.next(t);return r?q_(new In(n,r.index+1,n,r.index+1+r[0].length),r,o):null},e.findPreviousMatch=function(e,t,n,i){var o=t.parseSearchRequest();if(!o)return null;var r=new Q_(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,n,r,i):this._doFindPreviousMatchLineByLine(e,n,r,i)},e._doFindPreviousMatchMultiline=function(e,t,n,i){var o=this._doFindMatchesMultiline(e,new In(1,1,t.lineNumber,t.column),n,i,10*z_);if(o.length>0)return o[o.length-1];var r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new Dn(r,e.getLineMaxColumn(r)),n,i):null},e._doFindPreviousMatchLineByLine=function(e,t,n,i){var o=e.getLineCount(),r=t.lineNumber,s=e.getLineContent(r).substring(0,t.column-1),a=this._findLastMatchInLine(n,s,r,i);if(a)return a;for(var u=1;u<=o;u++){var l=(o+r-u-1)%o,c=e.getLineContent(l+1),h=this._findLastMatchInLine(n,c,l+1,i);if(h)return h}return null},e._findLastMatchInLine=function(e,t,n,i){var o,r=null;e.reset(0);while(o=e.next(t))r=q_(new In(n,o.index+1,n,o.index+1+o[0].length),o,i);return r},e}();function Z_(e,t,n,i,o){if(0===i)return!0;var r=t.charCodeAt(i-1);if(0!==e.get(r))return!0;if(13===r||10===r)return!0;if(o>0){var s=t.charCodeAt(i);if(0!==e.get(s))return!0}return!1}function X_(e,t,n,i,o){if(i+o===n)return!0;var r=t.charCodeAt(i+o);if(0!==e.get(r))return!0;if(13===r||10===r)return!0;if(o>0){var s=t.charCodeAt(i+o-1);if(0!==e.get(s))return!0}return!1}function J_(e,t,n,i,o){return Z_(e,t,n,i,o)&&X_(e,t,n,i,o)}var Q_=function(){function e(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}return e.prototype.reset=function(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0},e.prototype.next=function(e){var t,n=e.length;do{if(this._prevMatchStartIndex+this._prevMatchLength===n)return null;if(t=this._searchRegex.exec(e),!t)return null;var i=t.index,o=t[0].length;if(i===this._prevMatchStartIndex&&o===this._prevMatchLength)return null;if(this._prevMatchStartIndex=i,this._prevMatchLength=o,!this._wordSeparators||J_(this._wordSeparators,e,n,i,o))return t}while(t);return null},e}(),ey=65535;function ty(e){var t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}var ny=function(){function e(e,t,n,i,o){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=i,this.isBasicASCII=o}return e}();function iy(e,t){void 0===t&&(t=!0);for(var n=[0],i=1,o=0,r=e.length;o126)&&(s=!1)}var c=new ny(ty(e),i,o,r,s);return e.length=0,c}var ry=function(){function e(e,t,n,i,o){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=i,this.length=o}return e}(),sy=function(){function e(e,t){this.buffer=e,this.lineStarts=t}return e}(),ay=function(){function e(e){this._limit=e,this._cache=[]}return e.prototype.get=function(e){for(var t=this._cache.length-1;t>=0;t--){var n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null},e.prototype.get2=function(e){for(var t=this._cache.length-1;t>=0;t--){var n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber=e)return n}return null},e.prototype.set=function(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)},e.prototype.valdiate=function(e){for(var t=!1,n=this._cache,i=0;i=e)&&(n[i]=null,t=!0)}if(t){var r=[];for(i=0;i0){e[o].lineStarts||(e[o].lineStarts=iy(e[o].buffer));var s=new ry(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),i=this.rbInsertRight(i,s)}this._searchCache=new ay(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()},e.prototype.normalizeEOL=function(e){var t=this,n=ey,i=n-Math.floor(n/3),o=2*i,r="",s=0,a=[];if(this.iterate(this.root,(function(n){var u=t.getNodeContent(n),l=u.length;if(s<=i||s+l0){var u=r.replace(/\r\n|\r|\n/g,e);a.push(new sy(u,iy(u)))}this.create(a,e,!0)},e.prototype.getEOL=function(){return this._EOL},e.prototype.setEOL=function(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)},e.prototype.getOffsetAt=function(e,t){var n=0,i=this.root;while(i!==I_)if(i.left!==I_&&i.lf_left+1>=e)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt+1>=e){n+=i.size_left;var o=this.getAccumulatedValue(i,e-i.lf_left-2);return n+(o+t-1)}e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right}return n},e.prototype.getPositionAt=function(e){e=Math.floor(e),e=Math.max(0,e);var t=this.root,n=0,i=e;while(t!==I_)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){var o=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+o.index,0===o.index){var r=this.getOffsetAt(n+1,1),s=i-r;return new Dn(n+1,s+1)}return new Dn(n+1,o.remainder+1)}if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===I_){r=this.getOffsetAt(n+1,1),s=i-e-r;return new Dn(n+1,s+1)}t=t.right}return new Dn(1,1)},e.prototype.getValueInRange=function(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";var n=this.nodeAt2(e.startLineNumber,e.startColumn),i=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(n,i);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o},e.prototype.getValueInRange2=function(e,t){if(e.node===t.node){var n=e.node,i=this._buffers[n.piece.bufferIndex].buffer,o=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return i.substring(o+e.remainder,o+t.remainder)}var r=e.node,s=this._buffers[r.piece.bufferIndex].buffer,a=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start),u=s.substring(a+e.remainder,a+r.piece.length);r=r.next();while(r!==I_){var l=this._buffers[r.piece.bufferIndex].buffer,c=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);if(r===t.node){u+=l.substring(c,c+t.remainder);break}u+=l.substr(c,r.piece.length),r=r.next()}return u},e.prototype.getLinesContent=function(){return this.getContentOfSubTree(this.root).split(/\r\n|\r|\n/)},e.prototype.getLength=function(){return this._length},e.prototype.getLineCount=function(){return this._lineCnt},e.prototype.getLineContent=function(e){return this._lastVisitedLine.lineNumber===e||(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,"")),this._lastVisitedLine.value},e.prototype.getLineCharCode=function(e,t){var n=this.nodeAt2(e,t+1);if(n.remainder===n.node.piece.length){var i=n.node.next();if(!i)return 0;var o=this._buffers[i.piece.bufferIndex],r=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return o.buffer.charCodeAt(r)}o=this._buffers[n.node.piece.bufferIndex],r=this.offsetInBuffer(n.node.piece.bufferIndex,n.node.piece.start);var s=r+n.remainder;return o.buffer.charCodeAt(s)},e.prototype.getLineLength=function(e){if(e===this.getLineCount()){var t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength},e.prototype.findMatchesInNode=function(e,t,n,i,o,r,s,a,u,l,c){var h,d=this._buffers[e.piece.bufferIndex],f=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),p=this.offsetInBuffer(e.piece.bufferIndex,o),g=this.offsetInBuffer(e.piece.bufferIndex,r);t.reset(p);var m={line:0,column:0};do{if(h=t.next(d.buffer),h){if(h.index>=g)return l;this.positionInBuffer(e,h.index-f,m);var v=this.getLineFeedCnt(e.piece.bufferIndex,o,m),_=m.line===o.line?m.column-o.column+i:m.column+1,y=_+h[0].length;if(c[l++]=q_(new In(n+v,_,n+v,y),h,a),h.index+h[0].length>=g)return l;if(l>=u)return l}}while(h);return l},e.prototype.findMatchesLineByLine=function(e,t,n,i){var o=[],r=0,s=new Q_(t.wordSeparators,t.regex),a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];var u=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===u)return[];var l=this.positionInBuffer(a.node,a.remainder),c=this.positionInBuffer(u.node,u.remainder);if(a.node===u.node)return this.findMatchesInNode(a.node,s,e.startLineNumber,e.startColumn,l,c,t,n,i,r,o),o;var h=e.startLineNumber,d=a.node;while(d!==u.node){var f=this.getLineFeedCnt(d.piece.bufferIndex,l,d.piece.end);if(f>=1){var p=this._buffers[d.piece.bufferIndex].lineStarts,g=this.offsetInBuffer(d.piece.bufferIndex,d.piece.start),m=p[l.line+f],v=h===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(d,s,h,v,l,this.positionInBuffer(d,m-g),t,n,i,r,o),r>=i)return o;h+=f}var _=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){var y=this.getLineContent(h).substring(_,e.endColumn-1);return r=this._findMatchesInLine(t,s,y,e.endLineNumber,_,r,o,n,i),o}if(r=this._findMatchesInLine(t,s,this.getLineContent(h).substr(_),h,_,r,o,n,i),r>=i)return o;h++,a=this.nodeAt2(h,1),d=a.node,l=this.positionInBuffer(a.node,a.remainder)}if(h===e.endLineNumber){var b=h===e.startLineNumber?e.startColumn-1:0;y=this.getLineContent(h).substring(b,e.endColumn-1);return r=this._findMatchesInLine(t,s,y,e.endLineNumber,b,r,o,n,i),o}var w=h===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(u.node,s,h,w,l,c,t,n,i,r,o),o},e.prototype._findMatchesInLine=function(e,t,n,i,o,r,s,a,u){var l,c=e.wordSeparators;if(!a&&e.simpleSearch){var h=e.simpleSearch,d=h.length,f=n.length,p=-d;while(-1!==(p=n.indexOf(h,p+d)))if((!c||J_(c,n,f,p,d))&&(s[r++]=new Os(new In(i,p+1+o,i,p+1+d+o),null),r>=u))return r;return r}t.reset(0);do{if(l=t.next(n),l&&(s[r++]=q_(new In(i,l.index+1+o,i,l.index+1+l[0].length+o),l,a),r>=u))return r}while(l);return r},e.prototype.insert=function(e,t,n){if(void 0===n&&(n=!1),this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==I_){var i=this.nodeAt(e),o=i.node,r=i.remainder,s=i.nodeStartOffset,a=o.piece,u=a.bufferIndex,l=this.positionInBuffer(o,r);if(0===o.piece.bufferIndex&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&s+a.length===e&&t.lengthe){var c=[],h=new ry(a.bufferIndex,l,a.end,this.getLineFeedCnt(a.bufferIndex,l,a.end),this.offsetInBuffer(u,a.end)-this.offsetInBuffer(u,l));if(this.shouldCheckCRLF()&&this.endWithCR(t)){var d=this.nodeCharCodeAt(o,r);if(10===d){var f={line:h.start.line+1,column:0};h=new ry(h.bufferIndex,f,h.end,this.getLineFeedCnt(h.bufferIndex,f,h.end),h.length-1),t+="\n"}}if(this.shouldCheckCRLF()&&this.startWithLF(t)){var p=this.nodeCharCodeAt(o,r-1);if(13===p){var g=this.positionInBuffer(o,r-1);this.deleteNodeTail(o,g),t="\r"+t,0===o.piece.length&&c.push(o)}else this.deleteNodeTail(o,l)}else this.deleteNodeTail(o,l);var m=this.createNewPieces(t);h.length>0&&this.rbInsertRight(o,h);for(var v=o,_=0;_=0;u--)a=this.rbInsertLeft(a,s[u]);this.validateCRLFWithPrevNode(a),this.deleteNodes(n)},e.prototype.insertContentToNodeRight=function(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");for(var n=this.createNewPieces(e),i=this.rbInsertRight(t,n[0]),o=i,r=1;r=h))break;u=c+1}}return n?(n.line=c,n.column=a-d,null):{line:c,column:a-d}},e.prototype.getLineFeedCnt=function(e,t,n){if(0===n.column)return n.line-t.line;var i=this._buffers[e].lineStarts;if(n.line===i.length-1)return n.line-t.line;var o=i[n.line+1],r=i[n.line]+n.column;if(o>r+1)return n.line-t.line;var s=r-1,a=this._buffers[e].buffer;return 13===a.charCodeAt(s)?n.line-t.line+1:n.line-t.line},e.prototype.offsetInBuffer=function(e,t){var n=this._buffers[e].lineStarts;return n[t.line]+t.column},e.prototype.deleteNodes=function(e){for(var t=0;tey){var t=[];while(e.length>ey){var n=e.charCodeAt(ey-1),i=void 0;13===n||n>=55296&&n<=56319?(i=e.substring(0,ey-1),e=e.substring(ey-1)):(i=e.substring(0,ey),e=e.substring(ey));var o=iy(i);t.push(new ry(this._buffers.length,{line:0,column:0},{line:o.length-1,column:i.length-o[o.length-1]},o.length-1,i.length)),this._buffers.push(new sy(i,o))}var r=iy(e);return t.push(new ry(this._buffers.length,{line:0,column:0},{line:r.length-1,column:e.length-r[r.length-1]},r.length-1,e.length)),this._buffers.push(new sy(e,r)),t}var s=this._buffers[0].buffer.length,a=iy(e,!1),u=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===s&&0!==s&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},u=this._lastChangeBufferPos;for(var l=0;l=e-1)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt>e-1){r=this.getAccumulatedValue(n,e-n.lf_left-2),u=this.getAccumulatedValue(n,e-n.lf_left-1),s=this._buffers[n.piece.bufferIndex].buffer,a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return l+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:l,nodeStartLineNumber:c-(e-1-n.lf_left)}),s.substring(a+r,a+u-t)}if(n.lf_left+n.piece.lineFeedCnt===e-1){r=this.getAccumulatedValue(n,e-n.lf_left-2),s=this._buffers[n.piece.bufferIndex].buffer,a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);i=s.substring(a+r,a+n.piece.length);break}e-=n.lf_left+n.piece.lineFeedCnt,l+=n.size_left+n.piece.length,n=n.right}}n=n.next();while(n!==I_){s=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){u=this.getAccumulatedValue(n,0),a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return i+=s.substring(a,a+u-t),i}a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);i+=s.substr(a,n.piece.length),n=n.next()}return i},e.prototype.computeBufferMetadata=function(){var e=this.root,t=1,n=0;while(e!==I_)t+=e.lf_left+e.piece.lineFeedCnt,n+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=n,this._searchCache.valdiate(this._length)},e.prototype.getIndexOf=function(e,t){var n=e.piece,i=this.positionInBuffer(e,t),o=i.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){var r=this.getLineFeedCnt(e.piece.bufferIndex,n.start,i);if(r!==o)return{index:r,remainder:0}}return{index:o,remainder:i.column}},e.prototype.getAccumulatedValue=function(e,t){if(t<0)return 0;var n=e.piece,i=this._buffers[n.bufferIndex].lineStarts,o=n.start.line+t+1;return o>n.end.line?i[n.end.line]+n.end.column-i[n.start.line]-n.start.column:i[o]-i[n.start.line]-n.start.column},e.prototype.deleteNodeTail=function(e,t){var n=e.piece,i=n.lineFeedCnt,o=this.offsetInBuffer(n.bufferIndex,n.end),r=t,s=this.offsetInBuffer(n.bufferIndex,r),a=this.getLineFeedCnt(n.bufferIndex,n.start,r),u=a-i,l=s-o,c=n.length+l;e.piece=new ry(n.bufferIndex,n.start,r,a,c),H_(this,e,l,u)},e.prototype.deleteNodeHead=function(e,t){var n=e.piece,i=n.lineFeedCnt,o=this.offsetInBuffer(n.bufferIndex,n.start),r=t,s=this.getLineFeedCnt(n.bufferIndex,r,n.end),a=this.offsetInBuffer(n.bufferIndex,r),u=s-i,l=o-a,c=n.length+l;e.piece=new ry(n.bufferIndex,r,n.end,s,c),H_(this,e,l,u)},e.prototype.shrinkNode=function(e,t,n){var i=e.piece,o=i.start,r=i.end,s=i.length,a=i.lineFeedCnt,u=t,l=this.getLineFeedCnt(i.bufferIndex,i.start,u),c=this.offsetInBuffer(i.bufferIndex,t)-this.offsetInBuffer(i.bufferIndex,o);e.piece=new ry(i.bufferIndex,i.start,u,l,c),H_(this,e,c-s,l-a);var h=new ry(i.bufferIndex,n,r,this.getLineFeedCnt(i.bufferIndex,n,r),this.offsetInBuffer(i.bufferIndex,r)-this.offsetInBuffer(i.bufferIndex,n)),d=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(d)},e.prototype.appendToNode=function(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");var n=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),i=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;for(var o=iy(t,!1),r=0;re)t=t.left;else{if(t.size_left+t.piece.length>=e){i+=t.size_left;var o={node:t,remainder:e-t.size_left,nodeStartOffset:i};return this._searchCache.set(o),o}e-=t.size_left+t.piece.length,i+=t.size_left+t.piece.length,t=t.right}return null},e.prototype.nodeAt2=function(e,t){var n=this.root,i=0;while(n!==I_)if(n.left!==I_&&n.lf_left>=e-1)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt>e-1){var o=this.getAccumulatedValue(n,e-n.lf_left-2),r=this.getAccumulatedValue(n,e-n.lf_left-1);return i+=n.size_left,{node:n,remainder:Math.min(o+t-1,r),nodeStartOffset:i}}if(n.lf_left+n.piece.lineFeedCnt===e-1){o=this.getAccumulatedValue(n,e-n.lf_left-2);if(o+t-1<=n.piece.length)return{node:n,remainder:o+t-1,nodeStartOffset:i};t-=n.piece.length-o;break}e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}n=n.next();while(n!==I_){if(n.piece.lineFeedCnt>0){r=this.getAccumulatedValue(n,0);var s=this.offsetOfNode(n);return{node:n,remainder:Math.min(t-1,r),nodeStartOffset:s}}if(n.piece.length>=t-1){var a=this.offsetOfNode(n);return{node:n,remainder:t-1,nodeStartOffset:a}}t-=n.piece.length,n=n.next()}return null},e.prototype.nodeCharCodeAt=function(e,t){if(e.piece.lineFeedCnt<1)return-1;var n=this._buffers[e.piece.bufferIndex],i=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return n.buffer.charCodeAt(i)},e.prototype.offsetOfNode=function(e){if(!e)return 0;var t=e.size_left;while(e!==this.root)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t},e.prototype.shouldCheckCRLF=function(){return!(this._EOLNormalized&&"\n"===this._EOL)},e.prototype.startWithLF=function(e){if("string"===typeof e)return 10===e.charCodeAt(0);if(e===I_||0===e.piece.lineFeedCnt)return!1;var t=e.piece,n=this._buffers[t.bufferIndex].lineStarts,i=t.start.line,o=n[i]+t.start.column;if(i===n.length-1)return!1;var r=n[i+1];return!(r>o+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(o)},e.prototype.endWithCR=function(e){return"string"===typeof e?13===e.charCodeAt(e.length-1):e!==I_&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)},e.prototype.validateCRLFWithPrevNode=function(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){var t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}},e.prototype.validateCRLFWithNextNode=function(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){var t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}},e.prototype.fixCRLF=function(e,t){var n,i=[],o=this._buffers[e.piece.bufferIndex].lineStarts;n=0===e.piece.end.column?{line:e.piece.end.line-1,column:o[e.piece.end.line]-o[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};var r=e.piece.length-1,s=e.piece.lineFeedCnt-1;e.piece=new ry(e.piece.bufferIndex,e.piece.start,n,s,r),H_(this,e,-1,-1),0===e.piece.length&&i.push(e);var a={line:t.piece.start.line+1,column:0},u=t.piece.length-1,l=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new ry(t.piece.bufferIndex,a,t.piece.end,l,u),H_(this,t,-1,-1),0===t.piece.length&&i.push(t);var c=this.createNewPieces("\r\n");this.rbInsertRight(e,c[0]);for(var h=0;h0){g.sort((function(e,t){return t.lineNumber-e.lineNumber})),w=[];a=0;for(var C=g.length;a0&&g[a-1].lineNumber===v)){var S=g[a].oldContent,x=this.getLineContent(v);0!==x.length&&x!==S&&-1===rr(x)&&w.push(v)}}}return new Ds(y,b,w)},e.prototype._reduceOperations=function(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]},e.prototype._toSingleEditOperation=function(e){for(var t=!1,n=e[0].range,i=e[e.length-1].range,o=new In(n.startLineNumber,n.startColumn,i.endLineNumber,i.endColumn),r=n.startLineNumber,s=n.startColumn,a=[],u=0,l=e.length;u0){var h=a.lines.length,d=a.lines[0],f=a.lines[h-1];c=1===h?new In(u,l,u,l+d.length):new In(u,l,u+h-1,f.length+1)}else c=new In(u,l,u,l);n=c.endLineNumber,i=c.endColumn,t.push(c),o=a}return t},e._sortOpsAscending=function(e,t){var n=In.compareRangesUsingEnds(e.range,t.range);return 0===n?e.sortIndex-t.sortIndex:n},e._sortOpsDescending=function(e,t){var n=In.compareRangesUsingEnds(e.range,t.range);return 0===n?t.sortIndex-e.sortIndex:-n},e}(),cy=function(){function e(e,t,n,i,o,r,s,a){this._chunks=e,this._bom=t,this._cr=n,this._lf=i,this._crlf=o,this._containsRTL=r,this._isBasicASCII=s,this._normalizeEOL=a}return e.prototype._getEOL=function(e){var t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":n>t/2?"\r\n":"\n"},e.prototype.create=function(e){var t=this._getEOL(e),n=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(var i=0,o=n.length;i=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}},e.prototype._acceptChunk1=function(e,t){(t||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))},e.prototype._acceptChunk2=function(e){var t=oy(this._tmpLineStarts,e);this.chunks.push(new sy(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),this.isBasicASCII||this.containsRTL||(this.containsRTL=br(e))},e.prototype.finish=function(e){return void 0===e&&(e=!0),this._finish(),new cy(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.isBasicASCII,e)},e.prototype._finish=function(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;var e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);var t=iy(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}},e}(),dy=function(){function e(){this.changeType=1}return e}(),fy=function(){function e(e,t){this.changeType=2,this.lineNumber=e,this.detail=t}return e}(),py=function(){function e(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}return e}(),gy=function(){function e(e,t,n){this.changeType=4,this.fromLineNumber=e,this.toLineNumber=t,this.detail=n}return e}(),my=function(){function e(){this.changeType=5}return e}(),vy=function(){function e(e,t,n,i){this.changes=e,this.versionId=t,this.isUndoing=n,this.isRedoing=i}return e.prototype.containsEvent=function(e){for(var t=0,n=this.changes.length;t>>0}var by=new Uint32Array(0).buffer,wy=function(){function e(e){this._state=e,this._lineTokens=null,this._invalid=!0}return e.prototype.deleteBeginning=function(e){null!==this._lineTokens&&this._lineTokens!==by&&this.delete(0,e)},e.prototype.deleteEnding=function(e){if(null!==this._lineTokens&&this._lineTokens!==by){var t=new Uint32Array(this._lineTokens),n=t[t.length-2];this.delete(e,n)}},e.prototype.delete=function(e,t){if(null!==this._lineTokens&&this._lineTokens!==by&&e!==t){var n=new Uint32Array(this._lineTokens),i=n.length>>>1;if(0!==e||n[n.length-2]!==t){var o=jl.findIndexInTokensArray(n,e),r=o>0?n[o-1<<1]:0,s=n[o<<1];if(tc&&(n[l++]=f,n[l++]=n[1+(d<<1)],c=f)}if(l!==n.length){var p=new Uint32Array(l);p.set(n.subarray(0,l),0),this._lineTokens=p.buffer}}}else this._lineTokens=by}},e.prototype.append=function(e){if(e!==by)if(this._lineTokens!==by){if(null!==this._lineTokens)if(null!==e){var t=new Uint32Array(this._lineTokens),n=new Uint32Array(e),i=n.length>>>1,o=new Uint32Array(t.length+n.length);o.set(t,0);for(var r=t.length,s=t[t.length-2],a=0;a>>1,o=jl.findIndexInTokensArray(n,e);if(o>0){var r=o>0?n[o-1<<1]:0;r===e&&o--}for(var s=o;s=e},e.prototype.hasLinesToTokenize=function(e){return this._invalidLineStartIndex=0;s--)this.invalidateLine(e.startLineNumber+s-1);this._acceptDeleteRange(e),this._acceptInsertText(new Dn(e.startLineNumber,e.startColumn),t,n)},e.prototype._acceptDeleteRange=function(e){var t=e.startLineNumber-1;if(!(t>=this._tokens.length))if(e.startLineNumber!==e.endLineNumber){var n=this._tokens[t];n.deleteEnding(e.startColumn-1);var i=e.endLineNumber-1,o=null;if(i=this._tokens.length))if(0!==t){var o=this._tokens[i];o.deleteEnding(e.column-1),o.insert(e.column-1,n);for(var r=new Array(t),s=t-1;s>=0;s--)r[s]=new wy(null);this._tokens=Le(this._tokens,e.lineNumber,r)}else this._tokens[i].insert(e.column-1,n)}},e.prototype._tokenizeOneLine=function(e,t){if(!this.hasLinesToTokenize(e))return e.getLineCount()+1;var n=this._invalidLineStartIndex+1;return this._updateTokensUntilLine(e,t,n),n},e.prototype._tokenizeText=function(e,t,n){var i=null;if(this.tokenizationSupport)try{i=this.tokenizationSupport.tokenize2(t,n,0)}catch(o){l(o)}return i||(i=nu(this.languageIdentifier.id,t,n,0)),i},e.prototype._updateTokensUntilLine=function(e,t,n){if(this.tokenizationSupport){for(var i=e.getLineCount(),o=n-1,r=this._invalidLineStartIndex;r<=o;r++){var s=r+1,a=e.getLineContent(r+1),u=this._getState(r),c=null;try{var h=u.clone();c=this.tokenizationSupport.tokenize2(a,h,0)}catch(p){l(p)}if(c||(c=nu(this.languageIdentifier.id,a,u,0)),this._setTokens(this.languageIdentifier.id,r,a.length,c.tokens),t.registerChangedTokens(r+1),this._setIsInvalid(r,!1),s0?t[n-1]:null;i&&i.toLineNumber===e-1?i.toLineNumber++:t[n]={fromLineNumber:e,toLineNumber:e}},e.prototype.build=function(){return 0===this._ranges.length?null:{ranges:this._ranges}},e}(),xy=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ly=2048;function ky(){return new hy}function Ny(e){var t=ky();return t.acceptChunk(e),t.finish()}function Ey(e,t){var n="string"===typeof e?Ny(e):e;return n.create(t)}var Oy=0;function Dy(e){var t=26;return e%=2*t,et.LARGE_FILE_SIZE_THRESHOLD||a>t.LARGE_FILE_LINE_COUNT_THRESHOLD:s._isTooLargeForTokenization=!1,s._isTooLargeForSyncing=u>t.MODEL_SYNC_LIMIT,s._setVersionId(1),s._isDisposed=!1,s._isDisposing=!1,s._languageIdentifier=o||eu,s._tokenizationListener=Za.onDidChange((function(e){-1!==e.changedLanguages.indexOf(s._languageIdentifier.language)&&(s._resetTokenizationState(),s.emitModelTokensChangedEvent({ranges:[{fromLineNumber:1,toLineNumber:s.getLineCount()}]}),s._shouldAutoTokenize()&&s._warmUpTokens())})),s._revalidateTokensTimeout=-1,s._languageRegistryListener=Wu.onDidChange((function(e){e.languageIdentifier.id===s._languageIdentifier.id&&s._onDidChangeLanguageConfiguration.fire({})})),s._resetTokenizationState(),s._instanceId=Dy(Oy),s._lastDecorationId=0,s._decorations=Object.create(null),s._decorationsTree=new Ay,s._commandManager=new $v(s),s._isUndoing=!1,s._isRedoing=!1,s._trimAutoWhitespaceLines=null,s}return xy(t,e),t.createFromString=function(e,n,i,o){return void 0===n&&(n=t.DEFAULT_CREATION_OPTIONS),void 0===i&&(i=null),void 0===o&&(o=null),new t(e,n,i,o)},t.resolveOptions=function(e,t){if(t.detectIndentation){var n=Gv(e,t.tabSize,t.insertSpaces);return new Es({tabSize:n.tabSize,insertSpaces:n.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})}return new Es({tabSize:t.tabSize,insertSpaces:t.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})},t.prototype.onDidChangeRawContentFast=function(e){return this._eventEmitter.fastEvent((function(t){return e(t.rawContentChangedEvent)}))},t.prototype.onDidChangeRawContent=function(e){return this._eventEmitter.slowEvent((function(t){return e(t.rawContentChangedEvent)}))},t.prototype.onDidChangeContent=function(e){return this._eventEmitter.slowEvent((function(t){return e(t.contentChangedEvent)}))},t.prototype.dispose=function(){this._isDisposing=!0,this._onWillDispose.fire(),this._tokenizationListener.dispose(),this._languageRegistryListener.dispose(),this._clearTimers(),this._isDisposed=!0,e.prototype.dispose.call(this),this._isDisposing=!1},t.prototype._assertNotDisposed=function(){if(this._isDisposed)throw new Error("Model is disposed!")},t.prototype._emitContentChangedEvent=function(e,t){this._isDisposing||this._eventEmitter.fire(new _y(e,t))},t.prototype.setValue=function(e){if(this._assertNotDisposed(),null!==e){var t=Ey(e,this._options.defaultEOL);this.setValueFromTextBuffer(t)}},t.prototype._createContentChanged2=function(e,t,n,i,o,r,s){return{changes:[{range:e,rangeOffset:t,rangeLength:n,text:i}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:s}},t.prototype.setValueFromTextBuffer=function(e){if(this._assertNotDisposed(),null!==e){var t=this.getFullModelRange(),n=this.getValueLengthInRange(t),i=this.getLineCount(),o=this.getLineMaxColumn(i);this._buffer=e,this._increaseVersionId(),this._resetTokenizationState(),this._decorations=Object.create(null),this._decorationsTree=new Ay,this._commandManager=new $v(this),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new vy([new dy],this._versionId,!1,!1),this._createContentChanged2(new In(1,1,i,o),0,n,this.getValue(),!1,!1,!0))}},t.prototype.setEOL=function(e){this._assertNotDisposed();var t=1===e?"\r\n":"\n";if(this._buffer.getEOL()!==t){var n=this.getFullModelRange(),i=this.getValueLengthInRange(n),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new vy([new my],this._versionId,!1,!1),this._createContentChanged2(new In(1,1,o,r),0,i,this.getValue(),!1,!1,!1))}},t.prototype._onBeforeEOLChange=function(){var e=this.getVersionId(),t=this._decorationsTree.search(0,!1,!1,e);this._ensureNodesHaveRanges(t)},t.prototype._onAfterEOLChange=function(){for(var e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder(),n=0,i=t.length;n0},t.prototype.getAttachedEditorCount=function(){return this._attachedEditorCount},t.prototype.isTooLargeForSyncing=function(){return this._isTooLargeForSyncing},t.prototype.isTooLargeForTokenization=function(){return this._isTooLargeForTokenization},t.prototype.isDisposed=function(){return this._isDisposed},t.prototype.isDominatedByLongLines=function(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;for(var e=0,t=0,n=this._buffer.getLineCount(),i=1;i<=n;i++){var o=this._buffer.getLineLength(i);o>=My?t+=o:e+=o}return t>e},Object.defineProperty(t.prototype,"uri",{get:function(){return this._associatedResource},enumerable:!0,configurable:!0}),t.prototype.getOptions=function(){return this._assertNotDisposed(),this._options},t.prototype.updateOptions=function(e){this._assertNotDisposed();var t="undefined"!==typeof e.tabSize?e.tabSize:this._options.tabSize,n="undefined"!==typeof e.insertSpaces?e.insertSpaces:this._options.insertSpaces,i="undefined"!==typeof e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,o=new Es({tabSize:t,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:i});if(!this._options.equals(o)){var r=this._options.createChangeEvent(o);this._options=o,this._onDidChangeOptions.fire(r)}},t.prototype.detectIndentation=function(e,t){this._assertNotDisposed();var n=Gv(this._buffer,t,e);this.updateOptions({insertSpaces:n.insertSpaces,tabSize:n.tabSize})},t._normalizeIndentationFromWhitespace=function(e,t,n){for(var i=0,o=0;othis.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineContent(e)},t.prototype.getLineLength=function(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)},t.prototype.getLinesContent=function(){return this._assertNotDisposed(),this._buffer.getLinesContent()},t.prototype.getEOL=function(){return this._assertNotDisposed(),this._buffer.getEOL()},t.prototype.getLineMinColumn=function(e){return this._assertNotDisposed(),1},t.prototype.getLineMaxColumn=function(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1},t.prototype.getLineFirstNonWhitespaceColumn=function(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)},t.prototype.getLineLastNonWhitespaceColumn=function(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)},t.prototype._validateRangeRelaxedNoAllocations=function(e){var t,n,i=this._buffer.getLineCount(),o=e.startLineNumber,r=e.startColumn;if(o<1)t=1,n=1;else if(o>i)t=i,n=this.getLineMaxColumn(t);else if(t=0|o,r<=1)n=1;else{var s=this.getLineMaxColumn(t);n=r>=s?s:0|r}var a,u,l=e.endLineNumber,c=e.endColumn;if(l<1)a=1,u=1;else if(l>i)a=i,u=this.getLineMaxColumn(a);else if(a=0|l,c<=1)u=1;else{s=this.getLineMaxColumn(a);u=c>=s?s:0|c}return o===t&&r===n&&l===a&&c===u&&e instanceof In&&!(e instanceof Tn)?e:new In(t,n,a,u)},t.prototype._isValidPosition=function(e,t,n){if(isNaN(e))return!1;if(e<1)return!1;var i=this._buffer.getLineCount();if(e>i)return!1;if(isNaN(t))return!1;if(t<1)return!1;var o=this.getLineMaxColumn(e);if(t>o)return!1;if(n&&t>1){var r=this._buffer.getLineCharCode(e,t-2);if(vr(r))return!1}return!0},t.prototype._validatePosition=function(e,t,n){var i=Math.floor("number"!==typeof e||isNaN(e)?1:e),o=Math.floor("number"!==typeof t||isNaN(t)?1:t),r=this._buffer.getLineCount();if(i<1)return new Dn(1,1);if(i>r)return new Dn(r,this.getLineMaxColumn(r));if(o<=1)return new Dn(i,1);var s=this.getLineMaxColumn(i);if(o>=s)return new Dn(i,s);if(n){var a=this._buffer.getLineCharCode(i,o-2);if(vr(a))return new Dn(i,o-1)}return new Dn(i,o)},t.prototype.validatePosition=function(e){return this._assertNotDisposed(),e instanceof Dn&&this._isValidPosition(e.lineNumber,e.column,!0)?e:this._validatePosition(e.lineNumber,e.column,!0)},t.prototype._isValidRange=function(e,t){var n=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(n,i,!1))return!1;if(!this._isValidPosition(o,r,!1))return!1;if(t){var s=i>1?this._buffer.getLineCharCode(n,i-2):0,a=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,u=vr(s),l=vr(a);return!u&&!l}return!0},t.prototype.validateRange=function(e){if(this._assertNotDisposed(),e instanceof In&&!(e instanceof Tn)&&this._isValidRange(e,!0))return e;var t=this._validatePosition(e.startLineNumber,e.startColumn,!1),n=this._validatePosition(e.endLineNumber,e.endColumn,!1),i=t.lineNumber,o=t.column,r=n.lineNumber,s=n.column,a=o>1?this._buffer.getLineCharCode(i,o-2):0,u=s>1&&s<=this._buffer.getLineLength(r)?this._buffer.getLineCharCode(r,s-2):0,l=vr(a),c=vr(u);return l||c?i===r&&o===s?new In(i,o-1,r,s-1):l&&c?new In(i,o-1,r,s+1):l?new In(i,o-1,r,s):new In(i,o,r,s+1):new In(i,o,r,s)},t.prototype.modifyPosition=function(e,t){this._assertNotDisposed();var n=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,n)))},t.prototype.getFullModelRange=function(){this._assertNotDisposed();var e=this.getLineCount();return new In(1,1,e,this.getLineMaxColumn(e))},t.prototype.findMatchesLineByLine=function(e,t,n,i){return this._buffer.findMatchesLineByLine(e,t,n,i)},t.prototype.findMatches=function(e,t,n,i,o,r,s){var a;if(void 0===s&&(s=Iy),this._assertNotDisposed(),a=In.isIRange(t)?this.validateRange(t):this.getFullModelRange(),!n&&e.indexOf("\n")<0){var u=new U_(e,n,i,o),l=u.parseSearchRequest();return l?this.findMatchesLineByLine(a,l,r,s):[]}return Y_.findMatches(this,new U_(e,n,i,o),a,r,s)},t.prototype.findNextMatch=function(e,t,n,i,o,r){this._assertNotDisposed();var s=this.validatePosition(t);if(!n&&e.indexOf("\n")<0){var a=new U_(e,n,i,o),u=a.parseSearchRequest();if(!u)return null;var l=this.getLineCount(),c=new In(s.lineNumber,s.column,l,this.getLineMaxColumn(l)),h=this.findMatchesLineByLine(c,u,r,1);return Y_.findNextMatch(this,new U_(e,n,i,o),s,r),h.length>0?h[0]:(c=new In(1,1,s.lineNumber,this.getLineMaxColumn(s.lineNumber)),h=this.findMatchesLineByLine(c,u,r,1),h.length>0?h[0]:null)}return Y_.findNextMatch(this,new U_(e,n,i,o),s,r)},t.prototype.findPreviousMatch=function(e,t,n,i,o,r){this._assertNotDisposed();var s=this.validatePosition(t);return Y_.findPreviousMatch(this,new U_(e,n,i,o),s,r)},t.prototype.pushStackElement=function(){this._commandManager.pushStackElement()},t.prototype.pushEOL=function(e){var t="\n"===this.getEOL()?0:1;if(t!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}},t.prototype.pushEditOperations=function(e,t,n){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,t,n)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}},t.prototype._pushEditOperations=function(e,t,n){var i=this;if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){for(var o=t.map((function(e){return{range:i.validateRange(e.range),text:e.text}})),r=!0,s=0,a=e.length;su.endLineNumber,p=u.startLineNumber>d.endLineNumber;if(!f&&!p){l=!0;break}}if(!l){r=!1;break}}if(r)for(s=0,a=this._trimAutoWhitespaceLines.length;sd.endLineNumber)&&(!(g===d.startLineNumber&&d.startColumn===m&&d.isEmpty()&&_&&_.length>0&&"\n"===_.charAt(0))&&!(g===d.startLineNumber&&1===d.startColumn&&d.isEmpty()&&_&&_.length>0&&"\n"===_.charAt(_.length-1)))){v=!1;break}}v&&t.push({range:new In(g,1,g,m),text:null})}this._trimAutoWhitespaceLines=null}return this._commandManager.pushEditOperation(e,t,n)},t.prototype.applyEdits=function(e){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._applyEdits(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}},t._eolCount=function(e){for(var t=0,n=0,i=0,o=e.length;i=0;b--){var w=p+b,C=s-l-y+w;u.push(new fy(w,this.getLineContent(C)))}if(_this.getLineCount()?[]:this.getLinesDecorations(e,e,t,n)},t.prototype.getLinesDecorations=function(e,t,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=this.getLineCount(),r=Math.min(o,Math.max(1,e)),s=Math.min(o,Math.max(1,t)),a=this.getLineMaxColumn(s);return this._getDecorationsInRange(new In(r,1,s,a),n,i)},t.prototype.getDecorationsInRange=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=!1);var i=this.validateRange(e);return this._getDecorationsInRange(i,t,n)},t.prototype.getOverviewRulerDecorations=function(e,t){void 0===e&&(e=0),void 0===t&&(t=!1);var n=this.getVersionId(),i=this._decorationsTree.search(e,t,!0,n);return this._ensureNodesHaveRanges(i)},t.prototype.getAllDecorations=function(e,t){void 0===e&&(e=0),void 0===t&&(t=!1);var n=this.getVersionId(),i=this._decorationsTree.search(e,t,!1,n);return this._ensureNodesHaveRanges(i)},t.prototype._getDecorationsInRange=function(e,t,n){var i=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn),r=this.getVersionId(),s=this._decorationsTree.intervalSearch(i,o,t,n,r);return this._ensureNodesHaveRanges(s)},t.prototype._ensureNodesHaveRanges=function(e){for(var t=0,n=e.length;t0)while(o>0&&s>=1){var u=this.getLineFirstNonWhitespaceColumn(s);if(0!==u){if(u=0;c--){var h=this._tokens._tokenizeText(this._buffer,r[c],l);l=h?h.endState.clone():a.clone()}var d=Math.floor(.4*this._tokens.inValidLineStartIndex);t=Math.min(this.getLineCount(),t+d);for(var f=e;f<=t;f++){var p=this.getLineContent(f);h=this._tokens._tokenizeText(this._buffer,p,l);h?(this._tokens._setTokens(this._tokens.languageIdentifier.id,f-1,p.length,h.tokens),this._tokens._setIsInvalid(f-1,!1),this._tokens._setState(f-1,l),l=h.endState.clone(),i.registerChangedTokens(f)):l=a.clone()}var g=i.build();g&&this._onDidChangeTokens.fire(g)}}},t.prototype.forceTokenization=function(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");var t=new Sy;this._tokens._updateTokensUntilLine(this._buffer,t,e);var n=t.build();n&&this._onDidChangeTokens.fire(n)},t.prototype.isCheapToTokenize=function(e){return!!this._tokens.isCheapToTokenize(e)&&(ethis.getLineCount())throw new Error("Illegal value for lineNumber");return this._getLineTokens(e)},t.prototype._getLineTokens=function(e){var t=this._buffer.getLineContent(e);return this._tokens.getTokens(this._languageIdentifier.id,e-1,t)},t.prototype.getLanguageIdentifier=function(){return this._languageIdentifier},t.prototype.getModeId=function(){return this._languageIdentifier.language},t.prototype.setMode=function(e){if(this._languageIdentifier.id!==e.id){var t={oldLanguage:this._languageIdentifier.language,newLanguage:e.language};this._languageIdentifier=e,this._resetTokenizationState(),this.emitModelTokensChangedEvent({ranges:[{fromLineNumber:1,toLineNumber:this.getLineCount()}]}),this._onDidChangeLanguage.fire(t),this._onDidChangeLanguageConfiguration.fire({})}},t.prototype.getLanguageIdAtPosition=function(e,t){if(!this._tokens.tokenizationSupport)return this._languageIdentifier.id;var n=this.validatePosition({lineNumber:e,column:t}),i=n.lineNumber,o=n.column,r=this._getLineTokens(i);return r.getLanguageId(r.findTokenIndexAtOffset(o-1))},t.prototype._beginBackgroundTokenization=function(){var e=this;this._shouldAutoTokenize()&&-1===this._revalidateTokensTimeout&&(this._revalidateTokensTimeout=setTimeout((function(){e._revalidateTokensTimeout=-1,e._revalidateTokensNow()}),0))},t.prototype._warmUpTokens=function(){var e=Math.min(100,this.getLineCount());this._revalidateTokensNow(e),this._tokens.hasLinesToTokenize(this._buffer)&&this._beginBackgroundTokenization()},t.prototype._revalidateTokensNow=function(e){void 0===e&&(e=this._buffer.getLineCount());var t=20,n=new Sy,i=Hv.create(!1);while(this._tokens.hasLinesToTokenize(this._buffer)){if(i.elapsed()>t)break;var o=this._tokens._tokenizeOneLine(this._buffer,n);if(o>=e)break}this._tokens.hasLinesToTokenize(this._buffer)&&this._beginBackgroundTokenization();var r=n.build();r&&this._onDidChangeTokens.fire(r)},t.prototype.emitModelTokensChangedEvent=function(e){this._isDisposing||this._onDidChangeTokens.fire(e)},t.prototype.getWordAtPosition=function(e){this._assertNotDisposed();var n=this.validatePosition(e),i=this.getLineContent(n.lineNumber),o=this._getLineTokens(n.lineNumber),r=o.findTokenIndexAtOffset(n.column-1),s=t._findLanguageBoundaries(o,r),a=s[0],u=s[1],l=tt(n.column,Wu.getWordDefinition(o.getLanguageId(r)),i.substring(a,u),a);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(r>0&&a===n.column-1){var c=t._findLanguageBoundaries(o,r-1),h=c[0],d=c[1],f=tt(n.column,Wu.getWordDefinition(o.getLanguageId(r-1)),i.substring(h,d),h);if(f&&f.startColumn<=e.column&&e.column<=f.endColumn)return f}return null},t._findLanguageBoundaries=function(e,t){for(var n=e.getLanguageId(t),i=0,o=t;o>=0&&e.getLanguageId(o)===n;o--)i=e.getStartOffset(o);for(var r=e.getLineContent().length,s=(o=t,e.getCount());o0&&n.getStartOffset(o)===e.column-1){a=n.getStartOffset(o);o--;var d=Wu.getBracketsSupport(n.getLanguageId(o));if(d&&!bu(n.getStandardTokenType(o))){s=Math.max(n.getStartOffset(o),e.column-1-d.maxBracketLength),l=Mu.findPrevBracketInToken(d.reversedRegex,t,i,s,a);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn){c=i.substring(l.startColumn-1,l.endColumn-1);c=c.toLowerCase();h=this._matchFoundBracket(l,d.textIsBracket[c],d.textIsOpenBracket[c]);if(h)return h}}}return null},t.prototype._matchFoundBracket=function(e,t,n){if(!t)return null;if(n){var i=this._findMatchingBracketDown(t,e.getEndPosition());if(i)return[e,i]}else{i=this._findMatchingBracketUp(t,e.getStartPosition());if(i)return[e,i]}return null},t.prototype._findMatchingBracketUp=function(e,t){for(var n=e.languageIdentifier.id,i=e.reversedRegex,o=-1,r=t.lineNumber;r>=1;r--){var s=this._getLineTokens(r),a=s.getCount(),u=this._buffer.getLineContent(r),l=a-1,c=-1;for(r===t.lineNumber&&(l=s.findTokenIndexAtOffset(t.column-1),c=t.column-1);l>=0;l--){var h=s.getLanguageId(l),d=s.getStandardTokenType(l),f=s.getStartOffset(l),p=s.getEndOffset(l);if(-1===c&&(c=p),h===n&&!bu(d))while(1){var g=Mu.findPrevBracketInToken(i,r,u,f,c);if(!g)break;var m=u.substring(g.startColumn-1,g.endColumn-1);if(m=m.toLowerCase(),m===e.open?o++:m===e.close&&o--,0===o)return g;c=g.startColumn-1}c=-1}}return null},t.prototype._findMatchingBracketDown=function(e,t){for(var n=e.languageIdentifier.id,i=e.forwardRegex,o=1,r=t.lineNumber,s=this.getLineCount();r<=s;r++){var a=this._getLineTokens(r),u=a.getCount(),l=this._buffer.getLineContent(r),c=0,h=0;for(r===t.lineNumber&&(c=a.findTokenIndexAtOffset(t.column-1),h=t.column-1);co)throw new Error("Illegal value for lineNumber");for(var r=Wu.getFoldingRules(this._languageIdentifier.id),s=Boolean(r&&r.offSide),a=-2,u=-1,l=-2,c=-1,h=function(e){if(-1!==a&&(-2===a||a>e-1)){a=-1,u=-1;for(var t=e-2;t>=0;t--){var n=i._computeIndentLevel(t);if(n>=0){a=t,u=n;break}}}if(-2===l){l=-1,c=-1;for(t=e;t=0){l=t,c=r;break}}}},d=-2,f=-1,p=-2,g=-1,m=function(e){if(-2===d){d=-1,f=-1;for(var t=e-2;t>=0;t--){var n=i._computeIndentLevel(t);if(n>=0){d=t,f=n;break}}}if(-1!==p&&(-2===p||p=0){p=t,g=r;break}}}},v=0,_=!0,y=0,b=!0,w=0,C=0;_||b;C++){var S=e-C,x=e+C;if(0!==C&&(S<1||So||x>n)&&(b=!1),C>5e4&&(_=!1,b=!1),_){var L=void 0,k=this._computeIndentLevel(S-1);if(k>=0?(l=S-1,c=k,L=Math.ceil(k/this._options.tabSize)):(h(S),L=this._getIndentLevelForWhitespaceLine(s,u,c)),0===C){if(v=S,y=x,w=L,0===w)return{startLineNumber:v,endLineNumber:y,indent:w};continue}L>=w?v=S:_=!1}if(b){var N=void 0;k=this._computeIndentLevel(x-1);k>=0?(d=x-1,f=k,N=Math.ceil(k/this._options.tabSize)):(m(x),N=this._getIndentLevelForWhitespaceLine(s,f,g)),N>=w?y=x:b=!1}}return{startLineNumber:v,endLineNumber:y,indent:w}},t.prototype.getLinesIndentGuides=function(e,t){this._assertNotDisposed();var n=this.getLineCount();if(e<1||e>n)throw new Error("Illegal value for startLineNumber");if(t<1||t>n)throw new Error("Illegal value for endLineNumber");for(var i=Wu.getFoldingRules(this._languageIdentifier.id),o=Boolean(i&&i.offSide),r=new Array(t-e+1),s=-2,a=-1,u=-2,l=-1,c=e;c<=t;c++){var h=c-e,d=this._computeIndentLevel(c-1);if(d>=0)s=c-1,a=d,r[h]=Math.ceil(d/this._options.tabSize);else{if(-2===s){s=-1,a=-1;for(var f=c-2;f>=0;f--){var p=this._computeIndentLevel(f);if(p>=0){s=f,a=p;break}}}if(-1!==u&&(-2===u||u=0){u=f,l=p;break}}}r[h]=this._getIndentLevelForWhitespaceLine(o,a,l)}}return r},t.prototype._getIndentLevelForWhitespaceLine=function(e,t,n){return-1===t||-1===n?0:t0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))},t}(S),zy=function(e){return!0},Uy=function(e){return!1},$y=function(e){return" "===e||"\t"===e},Ky=function(){function e(t,n,i,o){this._languageIdentifier=t;var r=o.editor;this.readOnly=r.readOnly,this.tabSize=i.tabSize,this.insertSpaces=i.insertSpaces,this.oneIndent=n,this.pageSize=Math.max(1,Math.floor(r.layoutInfo.height/r.fontInfo.lineHeight)-2),this.lineHeight=r.lineHeight,this.useTabStops=r.useTabStops,this.wordSeparators=r.wordSeparators,this.emptySelectionClipboard=r.emptySelectionClipboard,this.copyWithSyntaxHighlighting=r.copyWithSyntaxHighlighting,this.multiCursorMergeOverlapping=r.multiCursorMergeOverlapping,this.autoClosingBrackets=r.autoClosingBrackets,this.autoClosingQuotes=r.autoClosingQuotes,this.autoSurround=r.autoSurround,this.autoIndent=r.autoIndent,this.autoClosingPairsOpen={},this.autoClosingPairsClose={},this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:e._getShouldAutoClose(t,this.autoClosingQuotes),bracket:e._getShouldAutoClose(t,this.autoClosingBrackets)};var s=e._getAutoClosingPairs(t);if(s)for(var a=0;a=i.length)&&_r(i.charCodeAt(n))},e.isHighSurrogate=function(e,t,n){var i=e.getLineContent(t);return!(n<0||n>=i.length)&&vr(i.charCodeAt(n))},e.isInsideSurrogatePair=function(e,t,n){return this.isHighSurrogate(e,t,n-2)},e.visibleColumnFromColumn=function(e,t,n){var i=e.length;i>t-1&&(i=t-1);for(var o=0,r=0;r=t){var u=t-o,l=a-t;return ls?s:o},e.nextTabStop=function(e,t){return e+t-e%t},e.prevTabStop=function(e,t){return e-1-(e-1)%t},e}();function eb(e){return"'"===e||'"'===e||"`"===e}var tb=function(){function e(){}return e._columnSelect=function(e,t,n,i,o,r){for(var s=Math.abs(o-n)+1,a=n>o,u=i>r,l=ir)continue;if(mi)continue;if(g1&&o--,this.columnSelect(e,t,n.selection,i,o)},e.columnSelectRight=function(e,t,n,i,o){for(var r=0,s=Math.min(n.position.lineNumber,i),a=Math.max(n.position.lineNumber,i),u=s;u<=a;u++){var l=t.getLineMaxColumn(u),c=Qy.visibleColumnFromColumn2(e,t,new Dn(u,l));r=Math.max(r,c)}return ot.getLineCount()&&(o=t.getLineCount()),this.columnSelect(e,t,n.selection,o,r)},e}(),nb=function(){function e(e,t,n){void 0===n&&(n=!1),this._range=e,this._text=t,this.insertsAutoWhitespace=n}return e.prototype.getEditOperations=function(e,t){t.addTrackedEditOperation(this._range,this._text)},e.prototype.computeCursorState=function(e,t){var n=t.getInverseEditOperations(),i=n[0].range;return new Tn(i.endLineNumber,i.endColumn,i.endLineNumber,i.endColumn)},e}(),ib=function(){function e(e,t,n){void 0===n&&(n=!1),this._range=e,this._text=t,this.insertsAutoWhitespace=n}return e.prototype.getEditOperations=function(e,t){t.addTrackedEditOperation(this._range,this._text)},e.prototype.computeCursorState=function(e,t){var n=t.getInverseEditOperations(),i=n[0].range;return new Tn(i.startLineNumber,i.startColumn,i.startLineNumber,i.startColumn)},e}(),ob=function(){function e(e,t,n,i,o){void 0===o&&(o=!1),this._range=e,this._text=t,this._columnDeltaOffset=i,this._lineNumberDeltaOffset=n,this.insertsAutoWhitespace=o}return e.prototype.getEditOperations=function(e,t){t.addTrackedEditOperation(this._range,this._text)},e.prototype.computeCursorState=function(e,t){var n=t.getInverseEditOperations(),i=n[0].range;return new Tn(i.endLineNumber+this._lineNumberDeltaOffset,i.endColumn+this._columnDeltaOffset,i.endLineNumber+this._lineNumberDeltaOffset,i.endColumn+this._columnDeltaOffset)},e}(),rb=function(){function e(e,t,n){this._range=e,this._text=t,this._initialSelection=n}return e.prototype.getEditOperations=function(e,t){t.addEditOperation(this._range,this._text),this._selectionId=t.trackSelection(this._initialSelection)},e.prototype.computeCursorState=function(e,t){return t.getTrackedSelection(this._selectionId)},e}(),sb=function(){function e(e,t,n){this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=n}return e}(),ab=function(){function e(){}return e.left=function(e,t,n,i){return i>t.getLineMinColumn(n)?Qy.isLowSurrogate(t,n,i-2)?i-=2:i-=1:n>1&&(n-=1,i=t.getLineMaxColumn(n)),new sb(n,i,0)},e.moveLeft=function(t,n,i,o,r){var s,a;if(i.hasSelection()&&!o)s=i.selection.startLineNumber,a=i.selection.startColumn;else{var u=e.left(t,n,i.position.lineNumber,i.position.column-(r-1));s=u.lineNumber,a=u.column}return i.move(o,s,a,0)},e.right=function(e,t,n,i){return iu?(n=u,s?i=t.getLineMaxColumn(n):(i=Math.min(t.getLineMaxColumn(n),i),Qy.isInsideSurrogatePair(t,n,i)&&(i-=1))):(i=Qy.columnFromVisibleColumn2(e,t,n,a),Qy.isInsideSurrogatePair(t,n,i)&&(i-=1)),o=a-Qy.visibleColumnFromColumn(t.getLineContent(n),i,e.tabSize),new sb(n,i,o)},e.moveDown=function(t,n,i,o,r){var s,a;i.hasSelection()&&!o?(s=i.selection.endLineNumber,a=i.selection.endColumn):(s=i.position.lineNumber,a=i.position.column);var u=e.down(t,n,s,a,i.leftoverVisibleColumns,r,!0);return i.move(o,u.lineNumber,u.column,u.leftoverVisibleColumns)},e.translateDown=function(t,n,i){var o=i.selection,r=e.down(t,n,o.selectionStartLineNumber,o.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=e.down(t,n,o.positionLineNumber,o.positionColumn,i.leftoverVisibleColumns,1,!1);return new qy(new In(r.lineNumber,r.column,r.lineNumber,r.column),r.leftoverVisibleColumns,new Dn(s.lineNumber,s.column),s.leftoverVisibleColumns)},e.up=function(e,t,n,i,o,r,s){var a=Qy.visibleColumnFromColumn(t.getLineContent(n),i,e.tabSize)+o;return n-=r,n<1?(n=1,s?i=t.getLineMinColumn(n):(i=Math.min(t.getLineMaxColumn(n),i),Qy.isInsideSurrogatePair(t,n,i)&&(i-=1))):(i=Qy.columnFromVisibleColumn2(e,t,n,a),Qy.isInsideSurrogatePair(t,n,i)&&(i-=1)),o=a-Qy.visibleColumnFromColumn(t.getLineContent(n),i,e.tabSize),new sb(n,i,o)},e.moveUp=function(t,n,i,o,r){var s,a;i.hasSelection()&&!o?(s=i.selection.startLineNumber,a=i.selection.startColumn):(s=i.position.lineNumber,a=i.position.column);var u=e.up(t,n,s,a,i.leftoverVisibleColumns,r,!0);return i.move(o,u.lineNumber,u.column,u.leftoverVisibleColumns)},e.translateUp=function(t,n,i){var o=i.selection,r=e.up(t,n,o.selectionStartLineNumber,o.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=e.up(t,n,o.positionLineNumber,o.positionColumn,i.leftoverVisibleColumns,1,!1);return new qy(new In(r.lineNumber,r.column,r.lineNumber,r.column),r.leftoverVisibleColumns,new Dn(s.lineNumber,s.column),s.leftoverVisibleColumns)},e.moveToBeginningOfLine=function(e,t,n,i){var o,r=n.position.lineNumber,s=t.getLineMinColumn(r),a=t.getLineFirstNonWhitespaceColumn(r)||s,u=n.position.column;return o=u===a?s:a,n.move(i,r,o,0)},e.moveToEndOfLine=function(e,t,n,i){var o=n.position.lineNumber,r=t.getLineMaxColumn(o);return n.move(i,o,r,0)},e.moveToBeginningOfBuffer=function(e,t,n,i){return n.move(i,1,1,0)},e.moveToEndOfBuffer=function(e,t,n,i){var o=t.getLineCount(),r=t.getLineMaxColumn(o);return n.move(i,o,r,0)},e}(),ub=function(){function e(){}return e.deleteRight=function(e,t,n,i){for(var o=[],r=3!==e,s=0,a=i.length;s1){var h=n.getLineContent(c.lineNumber),d=rr(h),f=-1===d?h.length+1:d+1;if(c.column<=f){var p=Qy.visibleColumnFromColumn2(t,n,c),g=Qy.prevTabStop(p,t.tabSize),m=Qy.columnFromVisibleColumn2(t,n,c.lineNumber,g);l=new In(c.lineNumber,m,c.lineNumber,c.column)}else l=new In(c.lineNumber,c.column-1,c.lineNumber,c.column)}else{var v=ab.left(t,n,c.lineNumber,c.column);l=new In(v.lineNumber,v.column,c.lineNumber,c.column)}}l.isEmpty()?o[s]=null:(l.startLineNumber!==l.endLineNumber&&(r=!0),o[s]=new nb(l,""))}return[r,o]},e.cut=function(e,t,n){for(var i=[],o=0,r=n.length;o1?(u=a.lineNumber-1,l=t.getLineMaxColumn(a.lineNumber-1),c=a.lineNumber,h=t.getLineMaxColumn(a.lineNumber)):(u=a.lineNumber,l=1,c=a.lineNumber,h=t.getLineMaxColumn(a.lineNumber));var d=new In(u,l,c,h);d.isEmpty()?i[o]=null:i[o]=new nb(d,"")}else i[o]=null;else i[o]=new nb(s,"")}return new Jy(0,i,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})},e}(),lb=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cb=function(){function e(){}return e._createWord=function(e,t,n,i,o){return{start:i,end:o,wordType:t,nextCharClass:n}},e._findPreviousWordOnLine=function(e,t,n){var i=t.getLineContent(n.lineNumber);return this._doFindPreviousWordOnLine(i,e,n)},e._doFindPreviousWordOnLine=function(e,t,n){for(var i=0,o=n.column-2;o>=0;o--){var r=e.charCodeAt(o),s=t.get(r);if(0===s){if(2===i)return this._createWord(e,i,s,o+1,this._findEndOfWord(e,t,i,o+1));i=1}else if(2===s){if(1===i)return this._createWord(e,i,s,o+1,this._findEndOfWord(e,t,i,o+1));i=2}else if(1===s&&0!==i)return this._createWord(e,i,s,o+1,this._findEndOfWord(e,t,i,o+1))}return 0!==i?this._createWord(e,i,1,0,this._findEndOfWord(e,t,i,0)):null},e._findEndOfWord=function(e,t,n,i){for(var o=e.length,r=i;r=0;o--){var r=e.charCodeAt(o),s=t.get(r);if(1===s)return o+1;if(1===n&&2===s)return o+1;if(2===n&&0===s)return o+1}return 0},e.moveWordLeft=function(t,n,i,o){var r=i.lineNumber,s=i.column,a=!1;1===s&&r>1&&(a=!0,r-=1,s=n.getLineMaxColumn(r));var u=e._findPreviousWordOnLine(t,n,new Dn(r,s));if(0===o){if(u&&!a){var l=n.getLineLastNonWhitespaceColumn(r);if(l1?new Dn(n-1,e.getLineMaxColumn(n-1)):t;for(var o=e.getLineContent(n),r=t.column-1;r>1;r--){var s=o.charCodeAt(r-2),a=o.charCodeAt(r-1);if(95!==s&&95===a)return new Dn(n,r);if(lr(s)&&cr(a))return new Dn(n,r);if(cr(s)&&cr(a)&&r+1=a.start+1&&(a=e._findNextWordOnLine(t,n,new Dn(r,a.end+1))),s=a?a.start+1:n.getLineMaxColumn(r)),new Dn(r,s)},e._moveWordPartRight=function(e,t){var n=t.lineNumber,i=e.getLineMaxColumn(n);if(t.column===i)return n1?u=1:(a--,u=n.getLineMaxColumn(a)):(c&&u<=c.end+1&&(c=e._findPreviousWordOnLine(t,n,new Dn(a,c.start+1))),c?u=c.end+1:u>1?u=1:(a--,u=n.getLineMaxColumn(a))),new In(a,u,s.lineNumber,s.column)},e._deleteWordPartLeft=function(t,n){if(!n.isEmpty())return n;var i=n.getPosition(),o=e._moveWordPartLeft(t,i);return new In(i.lineNumber,i.column,o.lineNumber,o.column)},e._findFirstNonWhitespaceChar=function(e,t){for(var n=e.length,i=t;i=d.start+1&&(d=e._findNextWordOnLine(t,n,new Dn(a,d.end+1))),d?u=d.start+1:ua&&(u=a,l=e.model.getLineMaxColumn(u)),Xy.fromModelState(new qy(new In(r.lineNumber,1,u,l),0,new Dn(u,l),0))}var c=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumberc){a=e.viewModel.getLineCount();var h=s.lineNumber+1,d=1;return h>a&&(h=a,d=e.viewModel.getLineMaxColumn(h)),Xy.fromViewState(t.viewState.move(t.modelState.hasSelection(),h,d,0))}var f=t.modelState.selectionStart.getEndPosition();return Xy.fromModelState(t.modelState.move(t.modelState.hasSelection(),f.lineNumber,f.column,0))},e.word=function(e,t,n,i){var o=e.model.validatePosition(i);return Xy.fromModelState(cb.word(e.config,e.model,t.modelState,n,o))},e.cancelSelection=function(e,t){if(!t.modelState.hasSelection())return new Xy(t.modelState,t.viewState);var n=t.viewState.position.lineNumber,i=t.viewState.position.column;return Xy.fromViewState(new qy(new In(n,i,n,i),0,new Dn(n,i),0))},e.moveTo=function(e,t,n,i,o){var r=e.model.validatePosition(i),s=o?e.validateViewPosition(new Dn(o.lineNumber,o.column),r):e.convertModelPositionToViewPosition(r);return Xy.fromViewState(t.viewState.move(n,s.lineNumber,s.column,0))},e.move=function(e,t,n){var i=n.select,o=n.value;switch(n.direction){case 0:return 4===n.unit?this._moveHalfLineLeft(e,t,i):this._moveLeft(e,t,i,o);case 1:return 4===n.unit?this._moveHalfLineRight(e,t,i):this._moveRight(e,t,i,o);case 2:return 2===n.unit?this._moveUpByViewLines(e,t,i,o):this._moveUpByModelLines(e,t,i,o);case 3:return 2===n.unit?this._moveDownByViewLines(e,t,i,o):this._moveDownByModelLines(e,t,i,o);case 4:return this._moveToViewMinColumn(e,t,i);case 5:return this._moveToViewFirstNonWhitespaceColumn(e,t,i);case 6:return this._moveToViewCenterColumn(e,t,i);case 7:return this._moveToViewMaxColumn(e,t,i);case 8:return this._moveToViewLastNonWhitespaceColumn(e,t,i);case 9:var r=t[0],s=e.getCompletelyVisibleModelRange(),a=this._firstLineNumberInRange(e.model,s,o),u=e.model.getLineFirstNonWhitespaceColumn(a);return[this._moveToModelPosition(e,r,i,a,u)];case 11:r=t[0],s=e.getCompletelyVisibleModelRange(),a=this._lastLineNumberInRange(e.model,s,o),u=e.model.getLineFirstNonWhitespaceColumn(a);return[this._moveToModelPosition(e,r,i,a,u)];case 10:r=t[0],s=e.getCompletelyVisibleModelRange(),a=Math.round((s.startLineNumber+s.endLineNumber)/2),u=e.model.getLineFirstNonWhitespaceColumn(a);return[this._moveToModelPosition(e,r,i,a,u)];case 12:for(var l=e.getCompletelyVisibleViewRange(),c=[],h=0,d=t.length;hn.endLineNumber-1&&(o=n.endLineNumber-1),o1){var p=Qy.visibleColumnFromColumn(d,f+1,r);if(p%r!==0&&t.isCheapToTokenize(h-1)){var g=Wu.getRawEnterActionAtPosition(t,h-1,t.getLineMaxColumn(h-1));if(g){if(c=l,g.appendText)for(var m=0,v=g.appendText.length;m1){var a=i-1;for(a=i-1;a>=1;a--){var u=n.getLineContent(a),l=ar(u);if(l>=0)break}if(a<1)return null;var c=n.getLineMaxColumn(a),h=Wu.getEnterAction(n,new In(a,c,a,c));h&&(r=h.indentation,o=h.enterAction,o&&(r+=o.appendText))}return o&&(o===pu.Indent&&(r=e.shiftIndent(t,r)),o===pu.Outdent&&(r=e.unshiftIndent(t,r)),r=t.normalizeIndentation(r)),r||null},e._replaceJumpToNextIndent=function(e,t,n,i){var o="",r=n.getStartPosition();if(e.insertSpaces)for(var s=Qy.visibleColumnFromColumn2(e,t,r),a=e.tabSize,u=a-s%a,l=0;l=0?o.setEndPosition(o.endLineNumber,Math.max(o.endColumn,S+1)):o.setEndPosition(o.endLineNumber,n.getLineMaxColumn(o.endLineNumber)),i)return new ib(o,w+t.normalizeIndentation(m.afterEnter),!0);var x=0;return b<=S+1&&(t.insertSpaces||(y=Math.ceil(y/t.tabSize)),x=Math.min(y+1-t.normalizeIndentation(m.afterEnter).length-1,0)),new ob(o,w+t.normalizeIndentation(m.afterEnter),0,x,!0)}return e._typeCommand(o,"\n"+t.normalizeIndentation(_),i)},e._isAutoIndentType=function(e,t,n){if(!e.autoIndent)return!1;for(var i=0,o=n.length;i1){var p=hv(t.wordSeparators),g=f.charCodeAt(d.column-2),m=p.get(g);if(0===m)return!1}var v=f.charAt(d.column-1);if(v){var _=e._isBeforeClosingBrace(t,o,v);if(!_&&!a(v))return!1}if(!n.isCheapToTokenize(d.lineNumber))return!1;n.forceTokenization(d.lineNumber);var y=n.getLineTokens(d.lineNumber),b=!1;try{b=Wu.shouldAutoClosePair(o,y,d.column)}catch(w){l(w)}if(!b)return!1}return!0},e._runAutoClosingOpenCharType=function(e,t,n,i,o){for(var r=[],s=0,a=i.length;s2){var f=hv(n.wordSeparators),p=u.charCodeAt(a.column-3),g=f.get(p);if(0===g)continue}var m=u.charAt(a.column-1);if(m){var v=e._isBeforeClosingBrace(n,c,m),_=eb(c)?n.shouldAutoCloseBefore.quote:n.shouldAutoCloseBefore.bracket;if(v)continue;if(!_(m))continue}if(!i.isCheapToTokenize(a.lineNumber))continue;i.forceTokenization(a.lineNumber);var y=i.getLineTokens(a.lineNumber),b=!1;try{b=Wu.shouldAutoClosePair(c,y,a.column-1)}catch(C){l(C)}if(b){var w=n.autoClosingPairsOpen[c];r[s]=new ob(o[s],w,0,-w.length)}}}return new Jy(1,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})},e.typeWithInterceptors=function(t,n,i,o,r){if("\n"===r){for(var s=[],a=0,u=o.length;a1)for(var r=n.modelState?n.modelState.position:null,s=n.viewState?n.viewState.position:null,a=0,u=o.length;ao&&(i=o);var r=new In(i,1,i,e.context.model.getLineMaxColumn(i)),s=0;if(n.at)switch(n.at){case bb.RawAtArgument.Top:s=3;break;case bb.RawAtArgument.Center:s=1;break;case bb.RawAtArgument.Bottom:s=4;break;default:break}var a=e.context.convertModelRangeToViewRange(r);e.revealRange(!1,a,s,0)},t}(Lb))),e.SelectAll=sf(new(function(e){function t(){return e.call(this,{id:"selectAll",precondition:null})||this}return Sb(t,e),t.prototype.runCoreEditorCommand=function(e,t){e.context.model.pushStackElement(),e.setStates(t.source,3,[pb.selectAll(e.context,e.getPrimaryCursor())])},t}(Lb))),e.SetSelection=sf(new(function(e){function t(){return e.call(this,{id:"setSelection",precondition:null})||this}return Sb(t,e),t.prototype.runCoreEditorCommand=function(e,t){e.context.model.pushStackElement(),e.setStates(t.source,3,[Xy.fromModelSelection(t.selection)])},t}(Lb)))}(wb||(wb={})),function(e){var t=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Sb(t,e),t.prototype.runEditorCommand=function(e,t,n){var i=t._getCursors();i&&this.runCoreEditingCommand(t,i,n||{})},t}(tf);e.CoreEditingCommand=t,e.LineBreakInsert=sf(new(function(e){function t(){return e.call(this,{id:"lineBreakInsert",precondition:gb.writable,kbOpts:{weight:xb,kbExpr:gb.textInputFocus,primary:0,mac:{primary:301}}})||this}return Sb(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,_b.lineBreakInsert(t.context.config,t.context.model,t.getAll().map((function(e){return e.modelState.selection}))))},t}(t))),e.Outdent=sf(new(function(e){function t(){return e.call(this,{id:"outdent",precondition:gb.writable,kbOpts:{weight:xb,kbExpr:rh.and(gb.editorTextFocus,gb.tabDoesNotMoveFocus),primary:1026}})||this}return Sb(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,_b.outdent(t.context.config,t.context.model,t.getAll().map((function(e){return e.modelState.selection})))),e.pushUndoStop()},t}(t))),e.Tab=sf(new(function(e){function t(){return e.call(this,{id:"tab",precondition:gb.writable,kbOpts:{weight:xb,kbExpr:rh.and(gb.editorTextFocus,gb.tabDoesNotMoveFocus),primary:2}})||this}return Sb(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,_b.tab(t.context.config,t.context.model,t.getAll().map((function(e){return e.modelState.selection})))),e.pushUndoStop()},t}(t))),e.DeleteLeft=sf(new(function(e){function t(){return e.call(this,{id:"deleteLeft",precondition:gb.writable,kbOpts:{weight:xb,kbExpr:gb.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})||this}return Sb(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){var i=ub.deleteLeft(t.getPrevEditOperationType(),t.context.config,t.context.model,t.getAll().map((function(e){return e.modelState.selection}))),o=i[0],r=i[1];o&&e.pushUndoStop(),e.executeCommands(this.id,r),t.setPrevEditOperationType(2)},t}(t))),e.DeleteRight=sf(new(function(e){function t(){return e.call(this,{id:"deleteRight",precondition:gb.writable,kbOpts:{weight:xb,kbExpr:gb.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})||this}return Sb(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){var i=ub.deleteRight(t.getPrevEditOperationType(),t.context.config,t.context.model,t.getAll().map((function(e){return e.modelState.selection}))),o=i[0],r=i[1];o&&e.pushUndoStop(),e.executeCommands(this.id,r),t.setPrevEditOperationType(3)},t}(t)))}(Cb||(Cb={}));var Nb=function(e){function t(t){var n=e.call(this,t)||this;return n._editorHandler=t.editorHandler,n._inputHandler=t.inputHandler,n}return Sb(t,e),t.prototype.runCommand=function(e,t){var n=e.get(Un).getFocusedCodeEditor();if(n&&n.hasTextFocus())return this._runEditorHandler(e,n,t);var i=document.activeElement;if(!(i&&["input","textarea"].indexOf(i.tagName.toLowerCase())>=0)){var o=e.get(Un).getActiveCodeEditor();return o?(o.focus(),this._runEditorHandler(e,o,t)):void 0}document.execCommand(this._inputHandler)},t.prototype._runEditorHandler=function(e,t,n){var i=this._editorHandler;"string"===typeof i?t.trigger("keyboard",i,n):(n=n||{},n.source="keyboard",i.runEditorCommand(e,t,n))},t}(ef),Eb=function(e){function t(t,n){var i=e.call(this,{id:t,precondition:null})||this;return i._handlerId=n,i}return Sb(t,e),t.prototype.runCommand=function(e,t){var n=e.get(Un).getFocusedCodeEditor();n&&n.trigger("keyboard",this._handlerId,t)},t}(ef);function Ob(e){kb(new Eb("default:"+e,e)),kb(new Eb(e,e))}kb(new Nb({editorHandler:wb.SelectAll,inputHandler:"selectAll",id:"editor.action.selectAll",precondition:gb.textInputFocus,kbOpts:{weight:xb,kbExpr:null,primary:2079},menubarOpts:{menuId:Sh.MenubarSelectionMenu,group:"1_basic",title:le({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1}})),kb(new Nb({editorHandler:Ns.Undo,inputHandler:"undo",id:Ns.Undo,precondition:gb.writable,kbOpts:{weight:xb,kbExpr:gb.textInputFocus,primary:2104},menubarOpts:{menuId:Sh.MenubarEditMenu,group:"1_do",title:le({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1}})),kb(new Eb("default:"+Ns.Undo,Ns.Undo)),kb(new Nb({editorHandler:Ns.Redo,inputHandler:"redo",id:Ns.Redo,precondition:gb.writable,kbOpts:{weight:xb,kbExpr:gb.textInputFocus,primary:2103,secondary:[3128],mac:{primary:3128}},menubarOpts:{menuId:Sh.MenubarEditMenu,group:"1_do",title:le({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2}})),kb(new Eb("default:"+Ns.Redo,Ns.Redo)),Ob(Ns.Type),Ob(Ns.ReplacePreviousChar),Ob(Ns.CompositionStart),Ob(Ns.CompositionEnd),Ob(Ns.Paste),Ob(Ns.Cut);var Db=function(){function e(e,t,n,i){this.configuration=e,this.viewModel=t,this.outgoingEvents=n,this.commandDelegate=i}return e.prototype._execMouseCommand=function(e,t){t.source="mouse",this.commandDelegate.executeEditorCommand(e,t)},e.prototype.paste=function(e,t,n,i){this.commandDelegate.paste(e,t,n,i)},e.prototype.type=function(e,t){this.commandDelegate.type(e,t)},e.prototype.replacePreviousChar=function(e,t,n){this.commandDelegate.replacePreviousChar(e,t,n)},e.prototype.compositionStart=function(e){this.commandDelegate.compositionStart(e)},e.prototype.compositionEnd=function(e){this.commandDelegate.compositionEnd(e)},e.prototype.cut=function(e){this.commandDelegate.cut(e)},e.prototype.setSelection=function(e,t){this.commandDelegate.executeEditorCommand(wb.SetSelection,{source:e,selection:t})},e.prototype._validateViewColumn=function(e){var t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this.selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this.lastCursorLineSelectDrag(e.position):this.lastCursorLineSelect(e.position):e.inSelectionMode?this.lineSelectDrag(e.position):this.lineSelect(e.position):2===e.mouseDownCount?this._hasMulticursorModifier(e)?this.lastCursorWordSelect(e.position):e.inSelectionMode?this.wordSelectDrag(e.position):this.wordSelect(e.position):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this.columnSelect(e.position,e.mouseColumn):e.inSelectionMode?this.lastCursorMoveToSelect(e.position):this.createCursor(e.position,!1)):e.inSelectionMode?this.moveToSelect(e.position):this.moveTo(e.position)},e.prototype._usualArgs=function(e){return e=this._validateViewColumn(e),{position:this.convertViewToModelPosition(e),viewPosition:e}},e.prototype.moveTo=function(e){this._execMouseCommand(wb.MoveTo,this._usualArgs(e))},e.prototype.moveToSelect=function(e){this._execMouseCommand(wb.MoveToSelect,this._usualArgs(e))},e.prototype.columnSelect=function(e,t){e=this._validateViewColumn(e),this._execMouseCommand(wb.ColumnSelect,{position:this.convertViewToModelPosition(e),viewPosition:e,mouseColumn:t})},e.prototype.createCursor=function(e,t){e=this._validateViewColumn(e),this._execMouseCommand(wb.CreateCursor,{position:this.convertViewToModelPosition(e),viewPosition:e,wholeLine:t})},e.prototype.lastCursorMoveToSelect=function(e){this._execMouseCommand(wb.LastCursorMoveToSelect,this._usualArgs(e))},e.prototype.wordSelect=function(e){this._execMouseCommand(wb.WordSelect,this._usualArgs(e))},e.prototype.wordSelectDrag=function(e){this._execMouseCommand(wb.WordSelectDrag,this._usualArgs(e))},e.prototype.lastCursorWordSelect=function(e){this._execMouseCommand(wb.LastCursorWordSelect,this._usualArgs(e))},e.prototype.lineSelect=function(e){this._execMouseCommand(wb.LineSelect,this._usualArgs(e))},e.prototype.lineSelectDrag=function(e){this._execMouseCommand(wb.LineSelectDrag,this._usualArgs(e))},e.prototype.lastCursorLineSelect=function(e){this._execMouseCommand(wb.LastCursorLineSelect,this._usualArgs(e))},e.prototype.lastCursorLineSelectDrag=function(e){this._execMouseCommand(wb.LastCursorLineSelectDrag,this._usualArgs(e))},e.prototype.selectAll=function(){this._execMouseCommand(wb.SelectAll,{})},e.prototype.convertViewToModelPosition=function(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)},e.prototype.emitKeyDown=function(e){this.outgoingEvents.emitKeyDown(e)},e.prototype.emitKeyUp=function(e){this.outgoingEvents.emitKeyUp(e)},e.prototype.emitContextMenu=function(e){this.outgoingEvents.emitContextMenu(e)},e.prototype.emitMouseMove=function(e){this.outgoingEvents.emitMouseMove(e)},e.prototype.emitMouseLeave=function(e){this.outgoingEvents.emitMouseLeave(e)},e.prototype.emitMouseUp=function(e){this.outgoingEvents.emitMouseUp(e)},e.prototype.emitMouseDown=function(e){this.outgoingEvents.emitMouseDown(e)},e.prototype.emitMouseDrag=function(e){this.outgoingEvents.emitMouseDrag(e)},e.prototype.emitMouseDrop=function(e){this.outgoingEvents.emitMouseDrop(e)},e}(),Ib=function(){function e(e){this._createLine=e,this._set(1,[])}return e.prototype.flush=function(){this._set(1,[])},e.prototype._set=function(e,t){this._lines=t,this._rendLineNumberStart=e},e.prototype._get=function(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}},e.prototype.getStartLineNumber=function(){return this._rendLineNumberStart},e.prototype.getEndLineNumber=function(){return this._rendLineNumberStart+this._lines.length-1},e.prototype.getCount=function(){return this._lines.length},e.prototype.getLine=function(e){var t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Error("Illegal value for lineNumber");return this._lines[t]},e.prototype.onLinesDeleted=function(e,t){if(0===this.getCount())return null;var n=this.getStartLineNumber(),i=this.getEndLineNumber();if(ti)return null;for(var r=0,s=0,a=n;a<=i;a++){var u=a-this._rendLineNumberStart;e<=a&&a<=t&&(0===s?(r=u,s=1):s++)}if(e=n&&r<=i&&(this._lines[r-this._rendLineNumberStart].onContentChanged(),o=!0);return o},e.prototype.onLinesInserted=function(e,t){if(0===this.getCount())return null;var n=t-e+1,i=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=i)return this._rendLineNumberStart+=n,null;if(e>o)return null;if(n+e>o){var r=this._lines.splice(e-this._rendLineNumberStart,o-e+1);return r}for(var s=[],a=0;an))for(var a=Math.max(t,s.fromLineNumber),u=Math.min(n,s.toLineNumber),l=a;l<=u;l++){var c=l-this._rendLineNumberStart;this._lines[c].onTokensChanged(),i=!0}}return i},e}(),Mb=function(){function e(e){var t=this;this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new Ib((function(){return t._host.createVisibleLine()}))}return e.prototype._createDomNode=function(){var e=ff(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e},e.prototype.onConfigurationChanged=function(e){return e.layoutInfo},e.prototype.onFlushed=function(e){return this._linesCollection.flush(),!0},e.prototype.onLinesChanged=function(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.toLineNumber)},e.prototype.onLinesDeleted=function(e){var t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(var n=0,i=t.length;nt){var s=t,a=Math.min(n,o.rendLineNumberStart-1);s<=a&&(this._insertLinesBefore(o,s,a,i,t),o.linesLength+=a-s+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,u),o.linesLength-=u)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1n){s=Math.max(0,n-o.rendLineNumberStart+1),a=o.linesLength-1,u=a-s+1;u>0&&(this._removeLinesAfter(o,u),o.linesLength-=u)}return this._finishRendering(o,!1,i),o},e.prototype._renderUntouchedLines=function(e,t,n,i,o){for(var r=e.rendLineNumberStart,s=e.lines,a=t;a<=n;a++){var u=r+a;s[a].layoutLine(u,i[u-o])}},e.prototype._insertLinesBefore=function(e,t,n,i,o){for(var r=[],s=0,a=t;a<=n;a++)r[s++]=this.host.createVisibleLine();e.lines=r.concat(e.lines)},e.prototype._removeLinesBefore=function(e,t){for(var n=0;n=0;s--){var a=e.lines[s];i[s]&&(a.setDomNode(r),r=r.previousSibling)}},e.prototype._finishRenderingInvalidLines=function(e,t,n){var i=document.createElement("div");i.innerHTML=t;for(var o=0;o'),i.appendASCIIString(o),i.appendASCIIString(""),!0)},e.prototype.layoutLine=function(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))},e}(),Fb=function(e){function t(t){var n=e.call(this,t)||this;return n._contentWidth=n._context.configuration.editor.layoutInfo.contentWidth,n.domNode.setHeight(0),n}return Pb(t,e),t.prototype.onConfigurationChanged=function(t){return t.layoutInfo&&(this._contentWidth=this._context.configuration.editor.layoutInfo.contentWidth),e.prototype.onConfigurationChanged.call(this,t)},t.prototype.onScrollChanged=function(t){return e.prototype.onScrollChanged.call(this,t)||t.scrollWidthChanged},t.prototype._viewOverlaysRender=function(t){e.prototype._viewOverlaysRender.call(this,t),this.domNode.setWidth(Math.max(t.scrollWidth,this._contentWidth))},t}(Ab),Wb=function(e){function t(t){var n=e.call(this,t)||this;return n._contentLeft=n._context.configuration.editor.layoutInfo.contentLeft,n.domNode.setClassName("margin-view-overlays"),n.domNode.setWidth(1),Xd.applyFontInfo(n.domNode,n._context.configuration.editor.fontInfo),n}return Pb(t,e),t.prototype.onConfigurationChanged=function(t){var n=!1;return t.fontInfo&&(Xd.applyFontInfo(this.domNode,this._context.configuration.editor.fontInfo),n=!0),t.layoutInfo&&(this._contentLeft=this._context.configuration.editor.layoutInfo.contentLeft,n=!0),e.prototype.onConfigurationChanged.call(this,t)||n},t.prototype.onScrollChanged=function(t){return e.prototype.onScrollChanged.call(this,t)||t.scrollHeightChanged},t.prototype._viewOverlaysRender=function(t){e.prototype._viewOverlaysRender.call(this,t);var n=Math.min(t.scrollHeight,1e6);this.domNode.setHeight(n),this.domNode.setWidth(this._contentLeft)},t}(Ab),Vb=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Bb=function(){function e(e,t){this.top=e,this.left=t}return e}(),Hb=function(e){function t(t,n){var i=e.call(this,t)||this;return i._viewDomNode=n,i._widgets={},i.domNode=ff(document.createElement("div")),Pf.write(i.domNode,1),i.domNode.setClassName("contentWidgets"),i.domNode.setPosition("absolute"),i.domNode.setTop(0),i.overflowingContentWidgetsDomNode=ff(document.createElement("div")),Pf.write(i.overflowingContentWidgetsDomNode,2),i.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets"),i}return Vb(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._widgets={}},t.prototype.onConfigurationChanged=function(e){for(var t=Object.keys(this._widgets),n=0,i=t.length;n=i,h=a,d=u>=i,f=e.left,p=t.left;return f+n>o.scrollLeft+o.viewportWidth&&(f=o.scrollLeft+o.viewportWidth-n),p+n>o.scrollLeft+o.viewportWidth&&(p=o.scrollLeft+o.viewportWidth-n),fthis._contentWidth)return null;var a=e.top-i,u=t.top+this._lineHeight,l=r+this._contentLeft,c=s+this._contentLeft,h=lo(this._viewDomNode.domNode),d=h.top+a-co.scrollY,f=h.top+u-co.scrollY,p=h.left+l-co.scrollX,g=h.left+c-co.scrollX,m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,v=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,_=22,y=22,b=d>=_,w=f+i<=v-y;if(p+n+20>m){var C=p-(m-n-20);p-=C,l-=C}if(g+n+20>m){C=g-(m-n-20);g-=C,c-=C}if(p<0){C=p;p-=C,l-=C}if(g<0){C=g;g-=C,c-=C}return this._fixedOverflowWidgets&&(a=d,u=f,l=p,c=g),{fitsAbove:b,aboveTop:a,aboveLeft:l,fitsBelow:w,belowTop:u,belowLeft:c}},e.prototype._prepareRenderWidgetAtExactPositionOverflowing=function(e){return new Bb(e.top,e.left+this._contentLeft)},e.prototype._getTopAndBottomLeft=function(e){if(!this._viewPosition)return[null,null];var t=e.visibleRangeForPosition(this._viewPosition);if(!t)return[null,null];var n=e.getVerticalOffsetForLineNumber(this._viewPosition.lineNumber)-e.scrollTop,i=new Bb(n,t.left),o=this._viewPosition.lineNumber,r=t.left;if(this._viewRange){var s=e.linesVisibleRangesForRange(this._viewRange,!1);if(s&&s.length>0)for(var a=s.length-1;a>=0;a--){var u=s[a];if(u.lineNumber>=o){u.lineNumber>o&&(o=u.lineNumber,r=1073741824);for(var l=0,c=u.ranges.length;le.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))},e.prototype.prepareRender=function(e){this._renderData=this._prepareRenderWidget(e)},e.prototype.render=function(e){this._renderData?(this.allowEditorOverflow?(this.domNode.setTop(this._renderData.top),this.domNode.setLeft(this._renderData.left)):(this.domNode.setTop(this._renderData.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0)):this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden"))},e}(),zb=(n("930f"),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),Ub=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._lineHeight=n._context.configuration.editor.lineHeight,n._renderLineHighlight=n._context.configuration.editor.viewInfo.renderLineHighlight,n._selectionIsEmpty=!0,n._primaryCursorLineNumber=1,n._scrollWidth=0,n._contentWidth=n._context.configuration.editor.layoutInfo.contentWidth,n._context.addEventHandler(n),n}return zb(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.viewInfo&&(this._renderLineHighlight=this._context.configuration.editor.viewInfo.renderLineHighlight),e.layoutInfo&&(this._contentWidth=this._context.configuration.editor.layoutInfo.contentWidth),!0},t.prototype.onCursorStateChanged=function(e){var t=!1,n=e.selections[0].positionLineNumber;this._primaryCursorLineNumber!==n&&(this._primaryCursorLineNumber=n,t=!0);var i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i?(this._selectionIsEmpty=i,t=!0,!0):t},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollWidthChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype.prepareRender=function(e){this._scrollWidth=e.scrollWidth},t.prototype.render=function(e,t){if(t===this._primaryCursorLineNumber){if(this._shouldShowCurrentLine()){var n=this._willRenderMarginCurrentLine(),i="current-line"+(n?" current-line-both":"");return'
'}return""}return""},t.prototype._shouldShowCurrentLine=function(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty},t.prototype._willRenderMarginCurrentLine=function(){return"gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight},t}(Fp);Zf((function(e,t){var n=e.getColor(Nm);if(n&&t.addRule(".monaco-editor .view-overlays .current-line { background-color: "+n+"; }"),!n||n.isTransparent()||e.defines(Em)){var i=e.getColor(Em);i&&(t.addRule(".monaco-editor .view-overlays .current-line { border: 2px solid "+i+"; }"),"hc"===e.type&&t.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"))}}));n("4e7d");var $b=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Kb=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._lineHeight=n._context.configuration.editor.lineHeight,n._renderLineHighlight=n._context.configuration.editor.viewInfo.renderLineHighlight,n._selectionIsEmpty=!0,n._primaryCursorLineNumber=1,n._contentLeft=n._context.configuration.editor.layoutInfo.contentLeft,n._context.addEventHandler(n),n}return $b(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.viewInfo&&(this._renderLineHighlight=this._context.configuration.editor.viewInfo.renderLineHighlight),e.layoutInfo&&(this._contentLeft=this._context.configuration.editor.layoutInfo.contentLeft),!0},t.prototype.onCursorStateChanged=function(e){var t=!1,n=e.selections[0].positionLineNumber;this._primaryCursorLineNumber!==n&&(this._primaryCursorLineNumber=n,t=!0);var i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i?(this._selectionIsEmpty=i,t=!0,!0):t},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onZonesChanged=function(e){return!0},t.prototype.prepareRender=function(e){},t.prototype.render=function(e,t){if(t===this._primaryCursorLineNumber){var n="current-line";if(this._shouldShowCurrentLine()){var i=this._willRenderContentCurrentLine();n="current-line current-line-margin"+(i?" current-line-margin-both":"")}return'
'}return""},t.prototype._shouldShowCurrentLine=function(){return"gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight},t.prototype._willRenderContentCurrentLine=function(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty},t}(Fp);Zf((function(e,t){var n=e.getColor(Nm);if(n)t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { background-color: "+n+"; border: none; }");else{var i=e.getColor(Em);i&&t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid "+i+"; }"),"hc"===e.type&&t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")}}));n("56dc");var qb=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Gb=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._lineHeight=n._context.configuration.editor.lineHeight,n._typicalHalfwidthCharacterWidth=n._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,n._renderResult=null,n._context.addEventHandler(n),n}return qb(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.fontInfo&&(this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth),!0},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged||e.scrollWidthChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype.prepareRender=function(e){for(var t=e.getDecorationsInViewport(),n=[],i=0,o=0,r=t.length;ot.options.zIndex)return 1;var n=e.options.className,i=t.options.className;return ni?1:In.compareRangesUsingStarts(e.range,t.range)}));for(var a=e.visibleRange.startLineNumber,u=e.visibleRange.endLineNumber,l=[],c=a;c<=u;c++){var h=c-a;l[h]=""}this._renderWholeLineDecorations(e,n,l),this._renderNormalDecorations(e,n,l),this._renderResult=l},t.prototype._renderWholeLineDecorations=function(e,t,n){for(var i=String(this._lineHeight),o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,s=0,a=t.length;s',c=Math.max(u.range.startLineNumber,o),h=Math.min(u.range.endLineNumber,r),d=c;d<=h;d++){var f=d-o;n[f]+=l}}},t.prototype._renderNormalDecorations=function(e,t,n){for(var i=String(this._lineHeight),o=e.visibleRange.startLineNumber,r=null,s=!1,a=null,u=0,l=t.length;u';s[h]+=m}}},t.prototype.render=function(e,t){if(!this._renderResult)return"";var n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]},t}(Fp),Yb=(n("7aad"),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),Zb=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Yb(t,e),t.prototype.onclick=function(e,t){this._register(ji(e,Lo.CLICK,(function(e){return t(new Li(e))})))},t.prototype.onmousedown=function(e,t){this._register(ji(e,Lo.MOUSE_DOWN,(function(e){return t(new Li(e))})))},t.prototype.onmouseover=function(e,t){this._register(ji(e,Lo.MOUSE_OVER,(function(e){return t(new Li(e))})))},t.prototype.onnonbubblingmouseout=function(e,t){this._register(Ki(e,(function(e){return t(new Li(e))})))},t.prototype.onkeydown=function(e,t){this._register(ji(e,Lo.KEY_DOWN,(function(e){return t(new _i(e))})))},t.prototype.onkeyup=function(e,t){this._register(ji(e,Lo.KEY_UP,(function(e){return t(new _i(e))})))},t.prototype.oninput=function(e,t){this._register(ji(e,Lo.INPUT,t))},t.prototype.onblur=function(e,t){this._register(ji(e,Lo.BLUR,t))},t.prototype.onfocus=function(e,t){this._register(ji(e,Lo.FOCUS,t))},t.prototype.onchange=function(e,t){this._register(ji(e,Lo.CHANGE,t))},t}(S),Xb=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Jb=11,Qb=function(e){function t(t){var n=e.call(this)||this;return n._onActivate=t.onActivate,n.bgDomNode=document.createElement("div"),n.bgDomNode.className="arrow-background",n.bgDomNode.style.position="absolute",n.bgDomNode.style.width=t.bgWidth+"px",n.bgDomNode.style.height=t.bgHeight+"px","undefined"!==typeof t.top&&(n.bgDomNode.style.top="0px"),"undefined"!==typeof t.left&&(n.bgDomNode.style.left="0px"),"undefined"!==typeof t.bottom&&(n.bgDomNode.style.bottom="0px"),"undefined"!==typeof t.right&&(n.bgDomNode.style.right="0px"),n.domNode=document.createElement("div"),n.domNode.className=t.className,n.domNode.style.position="absolute",n.domNode.style.width=Jb+"px",n.domNode.style.height=Jb+"px","undefined"!==typeof t.top&&(n.domNode.style.top=t.top+"px"),"undefined"!==typeof t.left&&(n.domNode.style.left=t.left+"px"),"undefined"!==typeof t.bottom&&(n.domNode.style.bottom=t.bottom+"px"),"undefined"!==typeof t.right&&(n.domNode.style.right=t.right+"px"),n._mouseMoveMonitor=n._register(new wf),n.onmousedown(n.bgDomNode,(function(e){return n._arrowMouseDown(e)})),n.onmousedown(n.domNode,(function(e){return n._arrowMouseDown(e)})),n._mousedownRepeatTimer=n._register(new ie),n._mousedownScheduleRepeatTimer=n._register(new ne),n}return Xb(t,e),t.prototype._arrowMouseDown=function(e){var t=this,n=function(){t._mousedownRepeatTimer.cancelAndSet((function(){return t._onActivate()}),1e3/24)};this._onActivate(),this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancelAndSet(n,200),this._mouseMoveMonitor.startMonitoring(bf,(function(e){}),(function(){t._mousedownRepeatTimer.cancel(),t._mousedownScheduleRepeatTimer.cancel()})),e.preventDefault()},t}(Zb),ew=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),tw=function(e){function t(t,n,i){var o=e.call(this)||this;return o._visibility=t,o._visibleClassName=n,o._invisibleClassName=i,o._domNode=null,o._isVisible=!1,o._isNeeded=!1,o._shouldBeVisible=!1,o._revealTimer=o._register(new ne),o}return ew(t,e),t.prototype.applyVisibilitySetting=function(e){return 2!==this._visibility&&(3===this._visibility||e)},t.prototype.setShouldBeVisible=function(e){var t=this.applyVisibilitySetting(e);this._shouldBeVisible!==t&&(this._shouldBeVisible=t,this.ensureVisibility())},t.prototype.setIsNeeded=function(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())},t.prototype.setDomNode=function(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)},t.prototype.ensureVisibility=function(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)},t.prototype._reveal=function(){var e=this;this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet((function(){e._domNode&&e._domNode.setClassName(e._visibleClassName)}),0))},t.prototype._hide=function(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode&&this._domNode.setClassName(this._invisibleClassName+(e?" fade":"")))},t}(S),nw=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),iw=140,ow=function(e){function t(t){var n=e.call(this)||this;return n._lazyRender=t.lazyRender,n._host=t.host,n._scrollable=t.scrollable,n._scrollbarState=t.scrollbarState,n._visibilityController=n._register(new tw(t.visibility,"visible scrollbar "+t.extraScrollbarClassName,"invisible scrollbar "+t.extraScrollbarClassName)),n._mouseMoveMonitor=n._register(new wf),n._shouldRender=!0,n.domNode=ff(document.createElement("div")),n.domNode.setAttribute("role","presentation"),n.domNode.setAttribute("aria-hidden","true"),n._visibilityController.setDomNode(n.domNode),n.domNode.setPosition("absolute"),n.onmousedown(n.domNode.domNode,(function(e){return n._domNodeMouseDown(e)})),n}return nw(t,e),t.prototype._createArrow=function(e){var t=this._register(new Qb(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)},t.prototype._createSlider=function(e,t,n,i){var o=this;this.slider=ff(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),"number"===typeof n&&this.slider.setWidth(n),"number"===typeof i&&this.slider.setHeight(i),this.slider.setLayerHinting(!0),this.domNode.domNode.appendChild(this.slider.domNode),this.onmousedown(this.slider.domNode,(function(e){e.leftButton&&(e.preventDefault(),o._sliderMouseDown(e,(function(){})))}))},t.prototype._onElementSize=function(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender},t.prototype._onElementScrollSize=function(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender},t.prototype._onElementScrollPosition=function(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender},t.prototype.beginReveal=function(){this._visibilityController.setShouldBeVisible(!0)},t.prototype.beginHide=function(){this._visibilityController.setShouldBeVisible(!1)},t.prototype.render=function(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))},t.prototype._domNodeMouseDown=function(e){e.target===this.domNode.domNode&&this._onMouseDown(e)},t.prototype.delegateMouseDown=function(e){var t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),i=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderMousePosition(e);n<=o&&o<=i?e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,(function(){}))):this._onMouseDown(e)},t.prototype._onMouseDown=function(e){var t,n;if(e.target===this.domNode.domNode&&"number"===typeof e.browserEvent.offsetX&&"number"===typeof e.browserEvent.offsetY)t=e.browserEvent.offsetX,n=e.browserEvent.offsetY;else{var i=lo(this.domNode.domNode);t=e.posx-i.left,n=e.posy-i.top}this._setDesiredScrollPositionNow(this._scrollbarState.getDesiredScrollPositionFromOffset(this._mouseDownRelativePosition(t,n))),e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,(function(){})))},t.prototype._sliderMouseDown=function(e,t){var n=this,i=this._sliderMousePosition(e),r=this._sliderOrthogonalMousePosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._mouseMoveMonitor.startMonitoring(bf,(function(e){var t=n._sliderOrthogonalMousePosition(e),a=Math.abs(t-r);if(o["g"]&&a>iw)n._setDesiredScrollPositionNow(s.getScrollPosition());else{var u=n._sliderMousePosition(e),l=u-i;n._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(l))}}),(function(){n.slider.toggleClassName("active",!1),n._host.onDragEnd(),t()})),this._host.onDragStart()},t.prototype._setDesiredScrollPositionNow=function(e){var t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)},t}(Zb),rw=20,sw=function(){function e(e,t,n){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=0,this._scrollSize=0,this._scrollPosition=0,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}return e.prototype.clone=function(){var t=new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize);return t.setVisibleSize(this._visibleSize),t.setScrollSize(this._scrollSize),t.setScrollPosition(this._scrollPosition),t},e.prototype.setVisibleSize=function(e){var t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)},e.prototype.setScrollSize=function(e){var t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)},e.prototype.setScrollPosition=function(e){var t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)},e._computeValues=function(e,t,n,i,o){var r=Math.max(0,n-e),s=Math.max(0,r-2*t),a=i>0&&i>n;if(!a)return{computedAvailableSize:Math.round(r),computedIsNeeded:a,computedSliderSize:Math.round(s),computedSliderRatio:0,computedSliderPosition:0};var u=Math.round(Math.max(rw,Math.floor(n*s/i))),l=(s-u)/(i-n),c=o*l;return{computedAvailableSize:Math.round(r),computedIsNeeded:a,computedSliderSize:Math.round(u),computedSliderRatio:l,computedSliderPosition:Math.round(c)}},e.prototype._refreshComputedValues=function(){var t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition},e.prototype.getArrowSize=function(){return this._arrowSize},e.prototype.getScrollPosition=function(){return this._scrollPosition},e.prototype.getRectangleLargeSize=function(){return this._computedAvailableSize},e.prototype.getRectangleSmallSize=function(){return this._scrollbarSize},e.prototype.isNeeded=function(){return this._computedIsNeeded},e.prototype.getSliderSize=function(){return this._computedSliderSize},e.prototype.getSliderPosition=function(){return this._computedSliderPosition},e.prototype.getDesiredScrollPositionFromOffset=function(e){if(!this._computedIsNeeded)return 0;var t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)},e.prototype.getDesiredScrollPositionFromDelta=function(e){if(!this._computedIsNeeded)return 0;var t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)},e}(),aw=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),uw=function(e){function t(t,n,i){var o=e.call(this,{lazyRender:n.lazyRender,host:i,scrollbarState:new sw(n.horizontalHasArrows?n.arrowSize:0,2===n.horizontal?0:n.horizontalScrollbarSize,2===n.vertical?0:n.verticalScrollbarSize),visibility:n.horizontal,extraScrollbarClassName:"horizontal",scrollable:t})||this;if(n.horizontalHasArrows){var r=(n.arrowSize-Jb)/2,s=(n.horizontalScrollbarSize-Jb)/2;o._createArrow({className:"left-arrow",top:s,left:r,bottom:void 0,right:void 0,bgWidth:n.arrowSize,bgHeight:n.horizontalScrollbarSize,onActivate:function(){return o._host.onMouseWheel(new Ni(null,1,0))}}),o._createArrow({className:"right-arrow",top:s,left:void 0,bottom:void 0,right:r,bgWidth:n.arrowSize,bgHeight:n.horizontalScrollbarSize,onActivate:function(){return o._host.onMouseWheel(new Ni(null,-1,0))}})}return o._createSlider(Math.floor((n.horizontalScrollbarSize-n.horizontalSliderSize)/2),0,void 0,n.horizontalSliderSize),o}return aw(t,e),t.prototype._updateSlider=function(e,t){this.slider.setWidth(e),this.slider.setLeft(t)},t.prototype._renderDomNode=function(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)},t.prototype.onDidScroll=function(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender},t.prototype._mouseDownRelativePosition=function(e,t){return e},t.prototype._sliderMousePosition=function(e){return e.posx},t.prototype._sliderOrthogonalMousePosition=function(e){return e.posy},t.prototype.writeScrollPosition=function(e,t){e.scrollLeft=t},t}(ow),lw=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cw=function(e){function t(t,n,i){var o=e.call(this,{lazyRender:n.lazyRender,host:i,scrollbarState:new sw(n.verticalHasArrows?n.arrowSize:0,2===n.vertical?0:n.verticalScrollbarSize,0),visibility:n.vertical,extraScrollbarClassName:"vertical",scrollable:t})||this;if(n.verticalHasArrows){var r=(n.arrowSize-Jb)/2,s=(n.verticalScrollbarSize-Jb)/2;o._createArrow({className:"up-arrow",top:r,left:s,bottom:void 0,right:void 0,bgWidth:n.verticalScrollbarSize,bgHeight:n.arrowSize,onActivate:function(){return o._host.onMouseWheel(new Ni(null,0,1))}}),o._createArrow({className:"down-arrow",top:void 0,left:s,bottom:r,right:void 0,bgWidth:n.verticalScrollbarSize,bgHeight:n.arrowSize,onActivate:function(){return o._host.onMouseWheel(new Ni(null,0,-1))}})}return o._createSlider(0,Math.floor((n.verticalScrollbarSize-n.verticalSliderSize)/2),n.verticalSliderSize,void 0),o}return lw(t,e),t.prototype._updateSlider=function(e,t){this.slider.setHeight(e),this.slider.setTop(t)},t.prototype._renderDomNode=function(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)},t.prototype.onDidScroll=function(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender},t.prototype._mouseDownRelativePosition=function(e,t){return t},t.prototype._sliderMousePosition=function(e){return e.posy},t.prototype._sliderOrthogonalMousePosition=function(e){return e.posx},t.prototype.writeScrollPosition=function(e,t){e.scrollTop=t},t}(ow),hw=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),dw=function(){function e(e,t,n,i,o,r){e|=0,t|=0,n|=0,i|=0,o|=0,r|=0,e<0&&(e=0),n+e>t&&(n=t-e),n<0&&(n=0),i<0&&(i=0),r+i>o&&(r=o-i),r<0&&(r=0),this.width=e,this.scrollWidth=t,this.scrollLeft=n,this.height=i,this.scrollHeight=o,this.scrollTop=r}return e.prototype.equals=function(e){return this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop},e.prototype.withScrollDimensions=function(t){return new e("undefined"!==typeof t.width?t.width:this.width,"undefined"!==typeof t.scrollWidth?t.scrollWidth:this.scrollWidth,this.scrollLeft,"undefined"!==typeof t.height?t.height:this.height,"undefined"!==typeof t.scrollHeight?t.scrollHeight:this.scrollHeight,this.scrollTop)},e.prototype.withScrollPosition=function(t){return new e(this.width,this.scrollWidth,"undefined"!==typeof t.scrollLeft?t.scrollLeft:this.scrollLeft,this.height,this.scrollHeight,"undefined"!==typeof t.scrollTop?t.scrollTop:this.scrollTop)},e.prototype.createScrollEvent=function(e){var t=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,i=this.scrollLeft!==e.scrollLeft,o=this.height!==e.height,r=this.scrollHeight!==e.scrollHeight,s=this.scrollTop!==e.scrollTop;return{width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:t,scrollWidthChanged:n,scrollLeftChanged:i,heightChanged:o,scrollHeightChanged:r,scrollTopChanged:s}},e}(),fw=function(e){function t(t,n){var i=e.call(this)||this;return i._onScroll=i._register(new T),i.onScroll=i._onScroll.event,i._smoothScrollDuration=t,i._scheduleAtNextAnimationFrame=n,i._state=new dw(0,0,0,0,0,0),i._smoothScrolling=null,i}return hw(t,e),t.prototype.dispose=function(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),e.prototype.dispose.call(this)},t.prototype.setSmoothScrollDuration=function(e){this._smoothScrollDuration=e},t.prototype.validateScrollPosition=function(e){return this._state.withScrollPosition(e)},t.prototype.getScrollDimensions=function(){return this._state},t.prototype.setScrollDimensions=function(e){var t=this._state.withScrollDimensions(e);this._setState(t),this._smoothScrolling&&this._smoothScrolling.acceptScrollDimensions(this._state)},t.prototype.getFutureScrollPosition=function(){return this._smoothScrolling?this._smoothScrolling.to:this._state},t.prototype.getCurrentScrollPosition=function(){return this._state},t.prototype.setScrollPositionNow=function(e){var t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t)},t.prototype.setScrollPositionSmooth=function(e){var t=this;if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:"undefined"===typeof e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:"undefined"===typeof e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};var n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;var i=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration);this._smoothScrolling.dispose(),this._smoothScrolling=i}else{n=this._state.withScrollPosition(e);this._smoothScrolling=vw.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((function(){t._smoothScrolling&&(t._smoothScrolling.animationFrameDisposable=null,t._performSmoothScrolling())}))},t.prototype._performSmoothScrolling=function(){var e=this;if(this._smoothScrolling){var t=this._smoothScrolling.tick(),n=this._state.withScrollPosition(t);if(this._setState(n),t.isDone)return this._smoothScrolling.dispose(),void(this._smoothScrolling=null);this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((function(){e._smoothScrolling&&(e._smoothScrolling.animationFrameDisposable=null,e._performSmoothScrolling())}))}},t.prototype._setState=function(e){var t=this._state;t.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(t)))},t}(S),pw=function(){function e(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}return e}();function gw(e,t){var n=t-e;return function(t){return e+n*yw(t)}}function mw(e,t,n){return function(i){return i2.5*n){var o=void 0,r=void 0;return e0&&Math.abs(e.deltaY)>0)return 1;var t=.5;-1===this._front&&-1===this._rear||this._memory[this._rear];return(Math.abs(e.deltaX-Math.round(e.deltaX))>0||Math.abs(e.deltaY-Math.round(e.deltaY))>0)&&(t+=.25),Math.min(Math.max(t,0),1)},e.INSTANCE=new e,e}(),kw=function(e){function t(t,n,i){var o=e.call(this)||this;o._onScroll=o._register(new T),o.onScroll=o._onScroll.event,t.style.overflow="hidden",o._options=Dw(n),o._scrollable=i,o._register(o._scrollable.onScroll((function(e){o._onDidScroll(e),o._onScroll.fire(e)})));var r={onMouseWheel:function(e){return o._onMouseWheel(e)},onDragStart:function(){return o._onDragStart()},onDragEnd:function(){return o._onDragEnd()}};return o._verticalScrollbar=o._register(new cw(o._scrollable,o._options,r)),o._horizontalScrollbar=o._register(new uw(o._scrollable,o._options,r)),o._domNode=document.createElement("div"),o._domNode.className="monaco-scrollable-element "+o._options.className,o._domNode.setAttribute("role","presentation"),o._domNode.style.position="relative",o._domNode.style.overflow="hidden",o._domNode.appendChild(t),o._domNode.appendChild(o._horizontalScrollbar.domNode.domNode),o._domNode.appendChild(o._verticalScrollbar.domNode.domNode),o._options.useShadows&&(o._leftShadowDomNode=ff(document.createElement("div")),o._leftShadowDomNode.setClassName("shadow"),o._domNode.appendChild(o._leftShadowDomNode.domNode),o._topShadowDomNode=ff(document.createElement("div")),o._topShadowDomNode.setClassName("shadow"),o._domNode.appendChild(o._topShadowDomNode.domNode),o._topLeftShadowDomNode=ff(document.createElement("div")),o._topLeftShadowDomNode.setClassName("shadow top-left-corner"),o._domNode.appendChild(o._topLeftShadowDomNode.domNode)),o._listenOnDomNode=o._options.listenOnDomNode||o._domNode,o._mouseWheelToDispose=[],o._setListeningToMouseWheel(o._options.handleMouseWheel),o.onmouseover(o._listenOnDomNode,(function(e){return o._onMouseOver(e)})),o.onnonbubblingmouseout(o._listenOnDomNode,(function(e){return o._onMouseOut(e)})),o._hideTimeout=o._register(new ne),o._isDragging=!1,o._mouseIsOver=!1,o._shouldRender=!0,o._revealOnScroll=!0,o}return bw(t,e),t.prototype.dispose=function(){this._mouseWheelToDispose=y(this._mouseWheelToDispose),e.prototype.dispose.call(this)},t.prototype.getDomNode=function(){return this._domNode},t.prototype.getOverviewRulerLayoutInfo=function(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}},t.prototype.delegateVerticalScrollbarMouseDown=function(e){this._verticalScrollbar.delegateMouseDown(e)},t.prototype.getScrollDimensions=function(){return this._scrollable.getScrollDimensions()},t.prototype.setScrollDimensions=function(e){this._scrollable.setScrollDimensions(e)},t.prototype.updateClassName=function(e){this._options.className=e,o["d"]&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className},t.prototype.updateOptions=function(e){var t=Dw(e);this._options.handleMouseWheel=t.handleMouseWheel,this._options.mouseWheelScrollSensitivity=t.mouseWheelScrollSensitivity,this._setListeningToMouseWheel(this._options.handleMouseWheel),this._options.lazyRender||this._render()},t.prototype._setListeningToMouseWheel=function(e){var t=this,n=this._mouseWheelToDispose.length>0;if(n!==e&&(this._mouseWheelToDispose=y(this._mouseWheelToDispose),e)){var i=function(e){var n=new Ni(e);t._onMouseWheel(n)};this._mouseWheelToDispose.push(ji(this._listenOnDomNode,"mousewheel",i)),this._mouseWheelToDispose.push(ji(this._listenOnDomNode,"DOMMouseScroll",i))}},t.prototype._onMouseWheel=function(e){var t,n=Lw.INSTANCE;if(Sw&&n.accept(Date.now(),e.deltaX,e.deltaY),e.deltaY||e.deltaX){var i=e.deltaY*this._options.mouseWheelScrollSensitivity,r=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.flipAxes&&(t=[r,i],i=t[0],r=t[1]);var s=!o["d"]&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!s||r||(r=i,i=0);var a=this._scrollable.getFutureScrollPosition(),u={};if(i){var l=a.scrollTop-Cw*i;this._verticalScrollbar.writeScrollPosition(u,l)}if(r){var c=a.scrollLeft-Cw*r;this._horizontalScrollbar.writeScrollPosition(u,c)}if(u=this._scrollable.validateScrollPosition(u),a.scrollLeft!==u.scrollLeft||a.scrollTop!==u.scrollTop){var h=Sw&&this._options.mouseWheelSmoothScroll&&n.isPhysicalMouseWheel();h?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),this._shouldRender=!0}}(this._options.alwaysConsumeMouseWheel||this._shouldRender)&&(e.preventDefault(),e.stopPropagation())},t.prototype._onDidScroll=function(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()},t.prototype.renderNow=function(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()},t.prototype._render=function(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){var e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0;this._leftShadowDomNode.setClassName("shadow"+(n?" left":"")),this._topShadowDomNode.setClassName("shadow"+(t?" top":"")),this._topLeftShadowDomNode.setClassName("shadow top-left-corner"+(t?" top":"")+(n?" left":""))}},t.prototype._onDragStart=function(){this._isDragging=!0,this._reveal()},t.prototype._onDragEnd=function(){this._isDragging=!1,this._hide()},t.prototype._onMouseOut=function(e){this._mouseIsOver=!1,this._hide()},t.prototype._onMouseOver=function(e){this._mouseIsOver=!0,this._reveal()},t.prototype._reveal=function(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()},t.prototype._hide=function(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())},t.prototype._scheduleHide=function(){var e=this;this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet((function(){return e._hide()}),ww)},t}(Zb),Nw=function(e){function t(t,n){var i=this;n=n||{},n.mouseWheelSmoothScroll=!1;var o=new fw(0,(function(e){return Gi(e)}));return i=e.call(this,t,n,o)||this,i._register(o),i}return bw(t,e),t.prototype.setScrollPosition=function(e){this._scrollable.setScrollPositionNow(e)},t.prototype.getScrollPosition=function(){return this._scrollable.getCurrentScrollPosition()},t}(kw),Ew=function(e){function t(t,n,i){return e.call(this,t,n,i)||this}return bw(t,e),t}(kw),Ow=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i._element=t,i.onScroll((function(e){e.scrollTopChanged&&(i._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(i._element.scrollLeft=e.scrollLeft)})),i.scanDomNode(),i}return bw(t,e),t.prototype.scanDomNode=function(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})},t}(Nw);function Dw(e){var t={lazyRender:"undefined"!==typeof e.lazyRender&&e.lazyRender,className:"undefined"!==typeof e.className?e.className:"",useShadows:"undefined"===typeof e.useShadows||e.useShadows,handleMouseWheel:"undefined"===typeof e.handleMouseWheel||e.handleMouseWheel,flipAxes:"undefined"!==typeof e.flipAxes&&e.flipAxes,alwaysConsumeMouseWheel:"undefined"!==typeof e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:"undefined"!==typeof e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:"undefined"!==typeof e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,mouseWheelSmoothScroll:"undefined"===typeof e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:"undefined"!==typeof e.arrowSize?e.arrowSize:11,listenOnDomNode:"undefined"!==typeof e.listenOnDomNode?e.listenOnDomNode:null,horizontal:"undefined"!==typeof e.horizontal?e.horizontal:1,horizontalScrollbarSize:"undefined"!==typeof e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:"undefined"!==typeof e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:"undefined"!==typeof e.horizontalHasArrows&&e.horizontalHasArrows,vertical:"undefined"!==typeof e.vertical?e.vertical:1,verticalScrollbarSize:"undefined"!==typeof e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:"undefined"!==typeof e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:"undefined"!==typeof e.verticalSliderSize?e.verticalSliderSize:0};return t.horizontalSliderSize="undefined"!==typeof e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize="undefined"!==typeof e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,o["d"]&&(t.className+=" mac"),t}var Iw=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Mw=function(e){function t(t,n,i,o){var r=e.call(this,t)||this,s=r._context.configuration.editor,a=s.viewInfo.scrollbar,u={listenOnDomNode:i.domNode,className:"editor-scrollable "+Kf(t.theme.type),useShadows:!1,lazyRender:!0,vertical:a.vertical,horizontal:a.horizontal,verticalHasArrows:a.verticalHasArrows,horizontalHasArrows:a.horizontalHasArrows,verticalScrollbarSize:a.verticalScrollbarSize,verticalSliderSize:a.verticalSliderSize,horizontalScrollbarSize:a.horizontalScrollbarSize,horizontalSliderSize:a.horizontalSliderSize,handleMouseWheel:a.handleMouseWheel,arrowSize:a.arrowSize,mouseWheelScrollSensitivity:a.mouseWheelScrollSensitivity};r.scrollbar=r._register(new Ew(n.domNode,u,r._context.viewLayout.scrollable)),Pf.write(r.scrollbar.getDomNode(),5),r.scrollbarDomNode=ff(r.scrollbar.getDomNode()),r.scrollbarDomNode.setPosition("absolute"),r._setLayout();var l=function(e,t,n){var i={};if(t){var o=e.scrollTop;o&&(i.scrollTop=r._context.viewLayout.getCurrentScrollTop()+o,e.scrollTop=0)}if(n){var s=e.scrollLeft;s&&(i.scrollLeft=r._context.viewLayout.getCurrentScrollLeft()+s,e.scrollLeft=0)}r._context.viewLayout.setScrollPositionNow(i)};return r._register(ji(i.domNode,"scroll",(function(e){return l(i.domNode,!0,!0)}))),r._register(ji(n.domNode,"scroll",(function(e){return l(n.domNode,!0,!1)}))),r._register(ji(o.domNode,"scroll",(function(e){return l(o.domNode,!0,!1)}))),r._register(ji(r.scrollbarDomNode.domNode,"scroll",(function(e){return l(r.scrollbarDomNode.domNode,!0,!1)}))),r}return Iw(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype._setLayout=function(){var e=this._context.configuration.editor.layoutInfo;this.scrollbarDomNode.setLeft(e.contentLeft);var t=this._context.configuration.editor.viewInfo.minimap.side;"right"===t?this.scrollbarDomNode.setWidth(e.contentWidth+e.minimapWidth):this.scrollbarDomNode.setWidth(e.contentWidth),this.scrollbarDomNode.setHeight(e.contentHeight)},t.prototype.getOverviewRulerLayoutInfo=function(){return this.scrollbar.getOverviewRulerLayoutInfo()},t.prototype.getDomNode=function(){return this.scrollbarDomNode},t.prototype.delegateVerticalScrollbarMouseDown=function(e){this.scrollbar.delegateVerticalScrollbarMouseDown(e)},t.prototype.onConfigurationChanged=function(e){if(e.viewInfo){var t=this._context.configuration.editor,n={handleMouseWheel:t.viewInfo.scrollbar.handleMouseWheel,mouseWheelScrollSensitivity:t.viewInfo.scrollbar.mouseWheelScrollSensitivity};this.scrollbar.updateOptions(n)}return e.layoutInfo&&this._setLayout(),!0},t.prototype.onScrollChanged=function(e){return!0},t.prototype.onThemeChanged=function(e){return this.scrollbar.updateClassName("editor-scrollable "+Kf(this._context.theme.type)),!0},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){this.scrollbar.renderNow()},t}(Tf),Tw=(n("8478"),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),Pw=function(){function e(e,t,n){this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(n)}return e}(),Aw=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Tw(t,e),t.prototype._render=function(e,t,n){for(var i=[],o=e;o<=t;o++){var r=o-e;i[r]=[]}if(0===n.length)return i;n.sort((function(e,t){return e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className',u=[],l=t;l<=n;l++){var c=l-t,h=i[c];0===h.length?u[c]="":u[c]='
=this._renderResult.length?"":this._renderResult[n]},t}(Aw),Fw=(n("0baa"),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),Ww=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._primaryLineNumber=0,n._lineHeight=n._context.configuration.editor.lineHeight,n._spaceWidth=n._context.configuration.editor.fontInfo.spaceWidth,n._enabled=n._context.configuration.editor.viewInfo.renderIndentGuides,n._activeIndentEnabled=n._context.configuration.editor.viewInfo.highlightActiveIndentGuide,n._renderResult=null,n._context.addEventHandler(n),n}return Fw(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.fontInfo&&(this._spaceWidth=this._context.configuration.editor.fontInfo.spaceWidth),e.viewInfo&&(this._enabled=this._context.configuration.editor.viewInfo.renderIndentGuides,this._activeIndentEnabled=this._context.configuration.editor.viewInfo.highlightActiveIndentGuide),!0},t.prototype.onCursorStateChanged=function(e){var t=e.selections[0],n=t.isEmpty()?t.positionLineNumber:0;return this._primaryLineNumber!==n&&(this._primaryLineNumber=n,!0)},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype.onLanguageConfigurationChanged=function(e){return!0},t.prototype.prepareRender=function(e){if(this._enabled){var t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,i=this._context.model.getTabSize(),o=i*this._spaceWidth,r=e.scrollWidth,s=this._lineHeight,a=o,u=this._context.model.getLinesIndentGuides(t,n),l=0,c=0,h=0;if(this._activeIndentEnabled&&this._primaryLineNumber){var d=this._context.model.getActiveIndentGuide(this._primaryLineNumber,t,n);l=d.startLineNumber,c=d.endLineNumber,h=d.indent}for(var f=[],p=t;p<=n;p++){for(var g=l<=p&&p<=c,m=p-t,v=u[m],_="",y=e.visibleRangeForPosition(new Dn(p,1)),b=y?y.left:0,w=1;w<=v;w++){var C=g&&w===h?"cigra":"cigr";if(_+='
',b+=o,b>r)break}f[m]=_}this._renderResult=f}else this._renderResult=null},t.prototype.render=function(e,t){if(!this._renderResult)return"";var n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]},t}(Fp);Zf((function(e,t){var n=e.getColor(Pm);n&&t.addRule(".monaco-editor .lines-content .cigr { box-shadow: 1px 0 0 0 "+n+" inset; }");var i=e.getColor(Am)||n;i&&t.addRule(".monaco-editor .lines-content .cigra { box-shadow: 1px 0 0 0 "+i+" inset; }")}));n("38a2");var Vw=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Bw=function(){function e(){this._currentVisibleRange=new In(1,1,1,1)}return e.prototype.getCurrentVisibleRange=function(){return this._currentVisibleRange},e.prototype.setCurrentVisibleRange=function(e){this._currentVisibleRange=e},e}(),Hw=function(){function e(e,t,n,i,o,r){this.lineNumber=e,this.startColumn=t,this.endColumn=n,this.startScrollTop=i,this.stopScrollTop=o,this.scrollType=r}return e}(),jw=function(e){function t(t,n){var i=e.call(this,t)||this;i._linesContent=n,i._textRangeRestingSpot=document.createElement("div"),i._visibleLines=new Mb(i),i.domNode=i._visibleLines.domNode;var o=i._context.configuration;return i._lineHeight=o.editor.lineHeight,i._typicalHalfwidthCharacterWidth=o.editor.fontInfo.typicalHalfwidthCharacterWidth,i._isViewportWrapping=o.editor.wrappingInfo.isViewportWrapping,i._revealHorizontalRightPadding=o.editor.viewInfo.revealHorizontalRightPadding,i._canUseLayerHinting=o.editor.canUseLayerHinting,i._viewLineOptions=new tp(o,i._context.theme.type),Pf.write(i.domNode,7),i.domNode.setClassName("view-lines"),Xd.applyFontInfo(i.domNode,o.editor.fontInfo),i._maxLineWidth=0,i._asyncUpdateLineWidths=new oe((function(){i._updateLineWidthsSlow()}),200),i._lastRenderedData=new Bw,i._horizontalRevealRequest=null,i}return Vw(t,e),t.prototype.dispose=function(){this._asyncUpdateLineWidths.dispose(),e.prototype.dispose.call(this)},t.prototype.getDomNode=function(){return this.domNode},t.prototype.createVisibleLine=function(){return new np(this._viewLineOptions)},t.prototype.onConfigurationChanged=function(e){this._visibleLines.onConfigurationChanged(e),e.wrappingInfo&&(this._maxLineWidth=0);var t=this._context.configuration;return e.lineHeight&&(this._lineHeight=t.editor.lineHeight),e.fontInfo&&(this._typicalHalfwidthCharacterWidth=t.editor.fontInfo.typicalHalfwidthCharacterWidth),e.wrappingInfo&&(this._isViewportWrapping=t.editor.wrappingInfo.isViewportWrapping),e.viewInfo&&(this._revealHorizontalRightPadding=t.editor.viewInfo.revealHorizontalRightPadding),e.canUseLayerHinting&&(this._canUseLayerHinting=t.editor.canUseLayerHinting),e.fontInfo&&Xd.applyFontInfo(this.domNode,t.editor.fontInfo),this._onOptionsMaybeChanged(),e.layoutInfo&&(this._maxLineWidth=0),!0},t.prototype._onOptionsMaybeChanged=function(){var e=this._context.configuration,t=new tp(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;for(var n=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber(),o=n;o<=i;o++){var r=this._visibleLines.getVisibleLine(o);r.onOptionsChanged(this._viewLineOptions)}return!0}return!1},t.prototype.onCursorStateChanged=function(e){for(var t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),i=!1,o=t;o<=n;o++)i=this._visibleLines.getVisibleLine(o).onSelectionChanged()||i;return i},t.prototype.onDecorationsChanged=function(e){for(var t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),i=t;i<=n;i++)this._visibleLines.getVisibleLine(i).onDecorationsChanged();return!0},t.prototype.onFlushed=function(e){var t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t},t.prototype.onLinesChanged=function(e){return this._visibleLines.onLinesChanged(e)},t.prototype.onLinesDeleted=function(e){return this._visibleLines.onLinesDeleted(e)},t.prototype.onLinesInserted=function(e){return this._visibleLines.onLinesInserted(e)},t.prototype.onRevealRangeRequest=function(e){var t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.range,e.verticalType),n=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range.startLineNumber!==e.range.endLineNumber?n={scrollTop:n.scrollTop,scrollLeft:0}:this._horizontalRevealRequest=new Hw(e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType):this._horizontalRevealRequest=null;var i=Math.abs(this._context.viewLayout.getCurrentScrollTop()-n.scrollTop);return 0===e.scrollType&&i>this._lineHeight?this._context.viewLayout.setScrollPositionSmooth(n):this._context.viewLayout.setScrollPositionNow(n),!0},t.prototype.onScrollChanged=function(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){var t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),n=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopn)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0},t.prototype.onTokensChanged=function(e){return this._visibleLines.onTokensChanged(e)},t.prototype.onZonesChanged=function(e){return this._context.viewLayout.onMaxLineWidthChanged(this._maxLineWidth),this._visibleLines.onZonesChanged(e)},t.prototype.onThemeChanged=function(e){return this._onOptionsMaybeChanged()},t.prototype.getPositionFromDOMInfo=function(e,t){var n=this._getViewLineDomNode(e);if(null===n)return null;var i=this._getLineNumberFor(n);if(-1===i)return null;if(i<1||i>this._context.model.getLineCount())return null;if(1===this._context.model.getLineMaxColumn(i))return new Dn(i,1);var o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(ir)return null;var s=this._visibleLines.getVisibleLine(i).getColumnOfNodeOffset(i,e,t),a=this._context.model.getLineMinColumn(i);return sn?-1:this._visibleLines.getVisibleLine(e).getWidth()},t.prototype.linesVisibleRangesForRange=function(e,t){if(this.shouldRender())return null;var n=e.endLineNumber,i=In.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!i)return null;var o=[],r=0,s=new ep(this.domNode.domNode,this._textRangeRestingSpot),a=0;t&&(a=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new Dn(i.startLineNumber,1)).lineNumber);for(var u=this._visibleLines.getStartLineNumber(),l=this._visibleLines.getEndLineNumber(),c=i.startLineNumber;c<=i.endLineNumber;c++)if(!(cl)){var h=c===i.startLineNumber?i.startColumn:1,d=c===i.endLineNumber?i.endColumn:this._context.model.getLineMaxColumn(c),f=this._visibleLines.getVisibleLine(c).getVisibleRangesForRange(h,d,s);if(f&&0!==f.length){if(t&&cr)){var a=s===t.startLineNumber?t.startColumn:1,u=s===t.endLineNumber?t.endColumn:this._context.model.getLineMaxColumn(s),l=this._visibleLines.getVisibleLine(s).getVisibleRangesForRange(a,u,i);l&&0!==l.length&&(n=n.concat(l))}return 0===n.length?null:n},t.prototype.visibleRangeForPosition=function(e){var t=this.visibleRangesForRange2(new In(e.lineNumber,e.column,e.lineNumber,e.column));return t?t[0]:null},t.prototype.updateLineWidths=function(){this._updateLineWidths(!1)},t.prototype._updateLineWidthsFast=function(){return this._updateLineWidths(!0)},t.prototype._updateLineWidthsSlow=function(){this._updateLineWidths(!1)},t.prototype._updateLineWidths=function(e){for(var t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),i=1,o=!0,r=t;r<=n;r++){var s=this._visibleLines.getVisibleLine(r);!e||s.getWidthIsFast()?i=Math.max(i,s.getWidth()):o=!1}return o&&1===t&&n===this._context.model.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(i),o},t.prototype.prepareRender=function(){throw new Error("Not supported")},t.prototype.render=function(){throw new Error("Not supported")},t.prototype.renderText=function(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){var t=this._horizontalRevealRequest.lineNumber,n=this._horizontalRevealRequest.startColumn,i=this._horizontalRevealRequest.endColumn,o=this._horizontalRevealRequest.scrollType;if(e.startLineNumber<=t&&t<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();var r=this._computeScrollLeftToRevealRange(t,n,i),s=this._isViewportWrapping;s||this._ensureMaxLineWidth(r.maxHorizontalOffset),0===o?this._context.viewLayout.setScrollPositionSmooth({scrollLeft:r.scrollLeft}):this._context.viewLayout.setScrollPositionNow({scrollLeft:r.scrollLeft})}}this._updateLineWidthsFast()||this._asyncUpdateLineWidths.schedule(),this._linesContent.setLayerHinting(this._canUseLayerHinting);var a=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-a),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())},t.prototype._ensureMaxLineWidth=function(e){var t=Math.ceil(e);this._maxLineWidthc&&(c=d.left+d.width)}o=c,l=Math.max(0,l-t.HORIZONTAL_EXTRA_PX),c+=this._revealHorizontalRightPadding;var f=this._computeMinimumScrolling(s,a,l,c);return{scrollLeft:f,maxHorizontalOffset:o}},t.prototype._computeMinimumScrolling=function(e,t,n,i,o,r){e|=0,t|=0,n|=0,i|=0,o=!!o,r=!!r;var s=t-e,a=i-n;return at?Math.max(0,i-s):e:n},t.HORIZONTAL_EXTRA_PX=30,t}(Tf),zw=(n("27e6"),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),Uw=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._decorationsLeft=n._context.configuration.editor.layoutInfo.decorationsLeft,n._decorationsWidth=n._context.configuration.editor.layoutInfo.decorationsWidth,n._renderResult=null,n._context.addEventHandler(n),n}return zw(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.layoutInfo&&(this._decorationsLeft=this._context.configuration.editor.layoutInfo.decorationsLeft,this._decorationsWidth=this._context.configuration.editor.layoutInfo.decorationsWidth),!0},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype._getDecorations=function(e){for(var t=e.getDecorationsInViewport(),n=[],i=0,o=0,r=t.length;o
',a=[],u=t;u<=n;u++){for(var l=u-t,c=i[l],h="",d=0,f=c.length;d';o[s]=u}this._renderResult=o},t.prototype.render=function(e,t){return this._renderResult?this._renderResult[t-e]:""},t}(Aw),qw=(n("f20b"),function(){function e(t,n,i,o){this.r=e._clamp(t),this.g=e._clamp(n),this.b=e._clamp(i),this.a=e._clamp(o)}return e._clamp=function(e){return e<0?0:e>255?255:0|e},e.Empty=new e(0,0,0,0),e}()),Gw=function(){function e(){var e=this;this._onDidChange=new T,this.onDidChange=this._onDidChange.event,this._updateColorMap(),Za.onDidChange((function(t){t.changedColorMap&&e._updateColorMap()}))}return e.getInstance=function(){return this._INSTANCE||(this._INSTANCE=new e),this._INSTANCE},e.prototype._updateColorMap=function(){var e=Za.getColorMap();if(!e)return this._colors=[qw.Empty],void(this._backgroundIsLight=!0);this._colors=[qw.Empty];for(var t=1;t=.5,this._onDidChange.fire(void 0)},e.prototype.getColor=function(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]},e.prototype.backgroundIsLight=function(){return this._backgroundIsLight},e._INSTANCE=null,e}(),Yw=function(){function e(t,n){var i=760;if(t.length!==i)throw new Error("Invalid x2CharData");var o=190;if(n.length!==o)throw new Error("Invalid x1CharData");this.x2charData=t,this.x1charData=n,this.x2charDataLight=e.soften(t,.8),this.x1charDataLight=e.soften(n,50/60)}return e.soften=function(e,t){for(var n=new Uint8ClampedArray(e.length),i=0,o=e.length;it.width||i+4>t.height)console.warn("bad render request outside image data");else{var u=a?this.x2charDataLight:this.x2charData,l=e._getChIndex(o),c=4*t.width,h=s.r,d=s.g,f=s.b,p=r.r-h,g=r.g-d,m=r.b-f,v=t.data,_=4*l*2,y=i*c+4*n,b=u[_]/255;v[y+0]=h+p*b,v[y+1]=d+g*b,v[y+2]=f+m*b;b=u[_+1]/255;v[y+4]=h+p*b,v[y+5]=d+g*b,v[y+6]=f+m*b,y+=c;b=u[_+2]/255;v[y+0]=h+p*b,v[y+1]=d+g*b,v[y+2]=f+m*b;b=u[_+3]/255;v[y+4]=h+p*b,v[y+5]=d+g*b,v[y+6]=f+m*b,y+=c;b=u[_+4]/255;v[y+0]=h+p*b,v[y+1]=d+g*b,v[y+2]=f+m*b;b=u[_+5]/255;v[y+4]=h+p*b,v[y+5]=d+g*b,v[y+6]=f+m*b,y+=c;b=u[_+6]/255;v[y+0]=h+p*b,v[y+1]=d+g*b,v[y+2]=f+m*b;b=u[_+7]/255;v[y+4]=h+p*b,v[y+5]=d+g*b,v[y+6]=f+m*b}},e.prototype.x1RenderChar=function(t,n,i,o,r,s,a){if(n+1>t.width||i+2>t.height)console.warn("bad render request outside image data");else{var u=a?this.x1charDataLight:this.x1charData,l=e._getChIndex(o),c=4*t.width,h=s.r,d=s.g,f=s.b,p=r.r-h,g=r.g-d,m=r.b-f,v=t.data,_=2*l*1,y=i*c+4*n,b=u[_]/255;v[y+0]=h+p*b,v[y+1]=d+g*b,v[y+2]=f+m*b,y+=c;b=u[_+1]/255;v[y+0]=h+p*b,v[y+1]=d+g*b,v[y+2]=f+m*b}},e.prototype.x2BlockRenderChar=function(e,t,n,i,o,r){if(t+2>e.width||n+4>e.height)console.warn("bad render request outside image data");else{var s=4*e.width,a=.5,u=o.r,l=o.g,c=o.b,h=i.r-u,d=i.g-l,f=i.b-c,p=u+h*a,g=l+d*a,m=c+f*a,v=e.data,_=n*s+4*t;v[_+0]=p,v[_+1]=g,v[_+2]=m,v[_+4]=p,v[_+5]=g,v[_+6]=m,_+=s,v[_+0]=p,v[_+1]=g,v[_+2]=m,v[_+4]=p,v[_+5]=g,v[_+6]=m,_+=s,v[_+0]=p,v[_+1]=g,v[_+2]=m,v[_+4]=p,v[_+5]=g,v[_+6]=m,_+=s,v[_+0]=p,v[_+1]=g,v[_+2]=m,v[_+4]=p,v[_+5]=g,v[_+6]=m}},e.prototype.x1BlockRenderChar=function(e,t,n,i,o,r){if(t+1>e.width||n+2>e.height)console.warn("bad render request outside image data");else{var s=4*e.width,a=.5,u=o.r,l=o.g,c=o.b,h=i.r-u,d=i.g-l,f=i.b-c,p=u+h*a,g=l+d*a,m=c+f*a,v=e.data,_=n*s+4*t;v[_+0]=p,v[_+1]=g,v[_+2]=m,_+=s,v[_+0]=p,v[_+1]=g,v[_+2]=m}},e}();function Zw(e){for(var t=new Uint8ClampedArray(e.length),n=0,i=e.length;n=s){var b=1,w=s;return new e(a,u,_,y,c,b,w)}b=Math.max(1,Math.floor(n-y*d/f));l&&l.scrollHeight===u&&(l.scrollTop>a&&(b=Math.min(b,l.startLineNumber)),l.scrollTopoC)n._context.viewLayout.setScrollPositionNow({scrollTop:r.scrollTop});else{var a=e.posy-t;n._context.viewLayout.setScrollPositionNow({scrollTop:r.getDesiredScrollTopFromDelta(a)})}}),(function(){n._slider.toggleClassName("active",!1)}))}})),n}return tC(t,e),t.prototype.dispose=function(){this._mouseDownListener.dispose(),this._sliderMouseMoveMonitor.dispose(),this._sliderMouseDownListener.dispose(),e.prototype.dispose.call(this)},t.prototype._getMinimapDomNodeClassName=function(){return"always"===this._options.showSlider?"minimap slider-always":"minimap slider-mouseover"},t.prototype.getDomNode=function(){return this._domNode},t.prototype._applyLayout=function(){this._domNode.setLeft(this._options.minimapLeft),this._domNode.setWidth(this._options.minimapWidth),this._domNode.setHeight(this._options.minimapHeight),this._shadow.setHeight(this._options.minimapHeight),this._canvas.setWidth(this._options.canvasOuterWidth),this._canvas.setHeight(this._options.canvasOuterHeight),this._canvas.domNode.width=this._options.canvasInnerWidth,this._canvas.domNode.height=this._options.canvasInnerHeight,this._slider.setWidth(this._options.minimapWidth)},t.prototype._getBuffer=function(){return this._buffers||(this._buffers=new lC(this._canvas.domNode.getContext("2d"),this._options.canvasInnerWidth,this._options.canvasInnerHeight,this._tokensColorTracker.getColor(2))),this._buffers.getBuffer()},t.prototype._onOptionsMaybeChanged=function(){var e=new rC(this._context.configuration);return!this._options.equals(e)&&(this._options=e,this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName()),!0)},t.prototype.onConfigurationChanged=function(e){return this._onOptionsMaybeChanged()},t.prototype.onFlushed=function(e){return this._lastRenderData=null,!0},t.prototype.onLinesChanged=function(e){return!!this._lastRenderData&&this._lastRenderData.onLinesChanged(e)},t.prototype.onLinesDeleted=function(e){return this._lastRenderData&&this._lastRenderData.onLinesDeleted(e),!0},t.prototype.onLinesInserted=function(e){return this._lastRenderData&&this._lastRenderData.onLinesInserted(e),!0},t.prototype.onScrollChanged=function(e){return!0},t.prototype.onTokensChanged=function(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)},t.prototype.onTokensColorsChanged=function(e){return this._lastRenderData=null,this._buffers=null,!0},t.prototype.onZonesChanged=function(e){return this._lastRenderData=null,!0},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){var t=this._options.renderMinimap;if(0===t)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");var n=sC.create(this._options,e.visibleRange.startLineNumber,e.visibleRange.endLineNumber,e.viewportHeight,e.viewportData.whitespaceViewportData.length>0,this._context.model.getLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setTop(n.sliderTop),this._slider.setHeight(n.sliderHeight);var i=e.scrollLeft/this._options.typicalHalfwidthCharacterWidth,o=Math.min(this._options.minimapWidth,Math.round(i*iC(this._options.renderMinimap)/this._options.pixelRatio));this._sliderHorizontal.setLeft(o),this._sliderHorizontal.setWidth(this._options.minimapWidth-o),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(n.sliderHeight),this._lastRenderData=this.renderLines(n)},t.prototype.renderLines=function(e){var n=this._options.renderMinimap,i=e.startLineNumber,o=e.endLineNumber,r=nC(n);if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){var s=this._lastRenderData._get();return new uC(e,s.imageData,s.lines)}for(var a=this._getBuffer(),u=t._renderUntouchedLines(a,i,o,r,this._lastRenderData),l=u[0],c=u[1],h=u[2],d=this._context.model.getMinimapLinesRenderingData(i,o,h),f=d.tabSize,p=this._tokensColorTracker.getColor(2),g=this._tokensColorTracker.backgroundIsLight(),m=0,v=[],_=0,y=o-i+1;_=0&&Ld)return;var w=l.charCodeAt(p);if(9===w){var C=a-(p+g)%a;g+=C-1,f+=C*h}else if(32===w)f+=h;else for(var S=kr(w)?2:1,x=0;xd)return}},t}(Tf);Zf((function(e,t){var n=e.getColor(Mg);if(n){var i=n.transparent(.5);t.addRule(".monaco-editor .minimap-slider, .monaco-editor .minimap-slider .minimap-slider-horizontal { background: "+i+"; }")}var o=e.getColor(Tg);if(o){var r=o.transparent(.5);t.addRule(".monaco-editor .minimap-slider:hover, .monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: "+r+"; }")}var s=e.getColor(Pg);if(s){var a=s.transparent(.5);t.addRule(".monaco-editor .minimap-slider.active, .monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: "+a+"; }")}var u=e.getColor(Ig);u&&t.addRule(".monaco-editor .minimap-shadow-visible { box-shadow: "+u+" -6px 0 6px -6px inset; }")}));n("725e");var hC=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),dC=function(e){function t(t){var n=e.call(this,t)||this;return n._widgets={},n._verticalScrollbarWidth=n._context.configuration.editor.layoutInfo.verticalScrollbarWidth,n._minimapWidth=n._context.configuration.editor.layoutInfo.minimapWidth,n._horizontalScrollbarHeight=n._context.configuration.editor.layoutInfo.horizontalScrollbarHeight,n._editorHeight=n._context.configuration.editor.layoutInfo.height,n._editorWidth=n._context.configuration.editor.layoutInfo.width,n._domNode=ff(document.createElement("div")),Pf.write(n._domNode,4),n._domNode.setClassName("overlayWidgets"),n}return hC(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._widgets={}},t.prototype.getDomNode=function(){return this._domNode},t.prototype.onConfigurationChanged=function(e){return!!e.layoutInfo&&(this._verticalScrollbarWidth=this._context.configuration.editor.layoutInfo.verticalScrollbarWidth,this._minimapWidth=this._context.configuration.editor.layoutInfo.minimapWidth,this._horizontalScrollbarHeight=this._context.configuration.editor.layoutInfo.horizontalScrollbarHeight,this._editorHeight=this._context.configuration.editor.layoutInfo.height,this._editorWidth=this._context.configuration.editor.layoutInfo.width,!0)},t.prototype.addWidget=function(e){var t=ff(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender()},t.prototype.setWidgetPosition=function(e,t){var n=this._widgets[e.getId()];return n.preference!==t&&(n.preference=t,this.setShouldRender(),!0)},t.prototype.removeWidget=function(e){var t=e.getId();if(this._widgets.hasOwnProperty(t)){var n=this._widgets[t],i=n.domNode.domNode;delete this._widgets[t],i.parentNode.removeChild(i),this.setShouldRender()}},t.prototype._renderWidget=function(e){var t=e.domNode;if(null!==e.preference)if(0===e.preference)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(1===e.preference){var n=t.domNode.clientHeight;t.setTop(this._editorHeight-n-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else 2===e.preference&&(t.setTop(0),t.domNode.style.right="50%");else t.unsetTop()},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){this._domNode.setWidth(this._editorWidth);for(var t=Object.keys(this._widgets),n=0,i=t.length;n=3){var o=Math.floor(i/3),r=Math.floor(i/3),s=i-o-r,a=e,u=a+o,l=a+o+s;return[[0,a,u,a,l,a,u,a],[0,o,s,o+s,r,o+s+r,s+r,o+s+r]]}if(2===n){o=Math.floor(i/2),r=i-o,a=e,l=a+o;return[[0,a,a,a,l,a,a,a],[0,o,o,o,r,o+r,o+r,o+r]]}var c=e,h=i;return[[0,c,c,c,c,c,c,c],[0,h,h,h,h,h,h,h]]},e.prototype.equals=function(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&this.backgroundColor===e.backgroundColor&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight},e}(),gC=function(e){function t(t){var n=e.call(this,t)||this;return n._domNode=ff(document.createElement("canvas")),n._domNode.setClassName("decorationsOverviewRuler"),n._domNode.setPosition("absolute"),n._domNode.setLayerHinting(!0),n._domNode.setAttribute("aria-hidden","true"),n._updateSettings(!1),n._tokensColorTrackerListener=Za.onDidChange((function(e){e.changedColorMap&&n._updateSettings(!0)})),n._cursorPositions=[],n}return fC(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._tokensColorTrackerListener.dispose()},t.prototype._updateSettings=function(e){var t=new pC(this._context.configuration,this._context.theme);return(!this._settings||!this._settings.equals(t))&&(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)},t.prototype.onConfigurationChanged=function(e){return this._updateSettings(!1)},t.prototype.onCursorStateChanged=function(e){this._cursorPositions=[];for(var t=0,n=e.selections.length;tt&&(E=t-u),L=E-u,k=E+u}L>y+1||C!==v?(0!==b&&l.fillRect(c[v],_,h[v],y-_),v=C,_=L,y=k):k>y&&(y=k)}l.fillRect(c[v],_,h[v],y-_)}if(!this._settings.hideCursor&&this._settings.cursorColor){var O=2*this._settings.pixelRatio|0,D=O/2|0,I=this._settings.x[7],M=this._settings.w[7];l.fillStyle=this._settings.cursorColor;for(_=-100,y=-100,b=0,w=this._cursorPositions.length;bt&&(E=t-D);L=E-D,k=L+O;L>y+1?(0!==b&&l.fillRect(I,_,M,y-_),_=L,y=k):k>y&&(y=k)}l.fillRect(I,_,M,y-_)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(l.beginPath(),l.lineWidth=1,l.strokeStyle=this._settings.borderColor,l.moveTo(0,0),l.lineTo(0,t),l.stroke(),l.moveTo(0,0),l.lineTo(e,0),l.stroke())},t}(Tf),mC=function(){function e(e,t,n){this.from=0|e,this.to=0|t,this.colorId=0|n}return e.compare=function(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId},e}(),vC=function(){function e(e,t,n){this.startLineNumber=e,this.endLineNumber=t,this.color=n,this._colorZone=null}return e.compare=function(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.colorn&&(f=n-p);var g=l.color,m=this._color2Id[g];m||(m=++this._lastAssignedId,this._color2Id[g]=m,this._id2Color[m]=g);var v=new mC(f-p,f+p,m);l.setColorZone(v),s.push(v)}return this._colorZonesInvalid=!1,s.sort(mC.compare),s},e}(),yC=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),bC=function(e){function t(t,n){var i=e.call(this)||this;return i._context=t,i._domNode=ff(document.createElement("canvas")),i._domNode.setClassName(n),i._domNode.setPosition("absolute"),i._domNode.setLayerHinting(!0),i._zoneManager=new _C((function(e){return i._context.viewLayout.getVerticalOffsetForLineNumber(e)})),i._zoneManager.setDOMWidth(0),i._zoneManager.setDOMHeight(0),i._zoneManager.setOuterHeight(i._context.viewLayout.getScrollHeight()),i._zoneManager.setLineHeight(i._context.configuration.editor.lineHeight),i._zoneManager.setPixelRatio(i._context.configuration.editor.pixelRatio),i._context.addEventHandler(i),i}return yC(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._zoneManager.setLineHeight(this._context.configuration.editor.lineHeight),this._render()),e.pixelRatio&&(this._zoneManager.setPixelRatio(this._context.configuration.editor.pixelRatio),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0},t.prototype.onFlushed=function(e){return this._render(),!0},t.prototype.onScrollChanged=function(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0},t.prototype.onZonesChanged=function(e){return this._render(),!0},t.prototype.getDomNode=function(){return this._domNode.domNode},t.prototype.setLayout=function(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);var t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())},t.prototype.setZones=function(e){this._zoneManager.setZones(e),this._render()},t.prototype._render=function(){if(0===this._zoneManager.getOuterHeight())return!1;var e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),n=this._zoneManager.resolveColorZones(),i=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),n.length>0&&this._renderOneLane(o,n,i,e),!0},t.prototype._renderOneLane=function(e,t,n,i){for(var o=0,r=0,s=0,a=0,u=t.length;a=h?s=Math.max(s,d):(e.fillRect(0,r,i,s-r),r=h,s=d)}e.fillRect(0,r,i,s-r)},t}(If),wC=(n("ef37"),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),CC=function(e){function t(t){var n=e.call(this,t)||this;return n.domNode=ff(document.createElement("div")),n.domNode.setAttribute("role","presentation"),n.domNode.setAttribute("aria-hidden","true"),n.domNode.setClassName("view-rulers"),n._renderedRulers=[],n._rulers=n._context.configuration.editor.viewInfo.rulers,n._typicalHalfwidthCharacterWidth=n._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,n}return wC(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return!!(e.viewInfo||e.layoutInfo||e.fontInfo)&&(this._rulers=this._context.configuration.editor.viewInfo.rulers,this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,!0)},t.prototype.onScrollChanged=function(e){return e.scrollHeightChanged},t.prototype.prepareRender=function(e){},t.prototype._ensureRulersCount=function(){var e=this._renderedRulers.length,t=this._rulers.length;if(e!==t)if(e0){var o=ff(document.createElement("div"));o.setClassName("view-ruler"),o.setWidth(n),this.domNode.appendChild(o),this._renderedRulers.push(o),i--}}else{var r=e-t;while(r>0){o=this._renderedRulers.pop();this.domNode.removeChild(o),r--}}},t.prototype.render=function(e){this._ensureRulersCount();for(var t=0,n=this._rulers.length;t0;return this._shouldShow!==e&&(this._shouldShow=e,!0)},t.prototype.getDomNode=function(){return this._domNode},t.prototype._updateWidth=function(){var e=this._context.configuration.editor.layoutInfo,t=0;return t=0===e.renderMinimap||e.minimapWidth>0&&0===e.minimapLeft?e.width:e.width-e.minimapWidth-e.verticalScrollbarWidth,this._width!==t&&(this._width=t,!0)},t.prototype.onConfigurationChanged=function(e){var t=!1;return e.viewInfo&&(this._useShadows=this._context.configuration.editor.viewInfo.scrollbar.useShadows),e.layoutInfo&&(t=this._updateWidth()),this._updateShouldShow()||t},t.prototype.onScrollChanged=function(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")},t}(Tf);Zf((function(e,t){var n=e.getColor(Ig);n&&t.addRule(".monaco-editor .scroll-decoration { box-shadow: "+n+" 0 6px 6px -6px inset; }")}));n("782d");var LC=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),kC=function(){function e(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}return e}(),NC=function(){function e(e,t){this.lineNumber=e,this.ranges=t}return e}();function EC(e){return new kC(e)}function OC(e){return new NC(e.lineNumber,e.ranges.map(EC))}var DC=ti,IC=function(e){function t(t){var n=e.call(this)||this;return n._previousFrameVisibleRangesWithStyle=[],n._context=t,n._lineHeight=n._context.configuration.editor.lineHeight,n._roundedSelection=n._context.configuration.editor.viewInfo.roundedSelection,n._typicalHalfwidthCharacterWidth=n._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,n._selections=[],n._renderResult=null,n._context.addEventHandler(n),n}return LC(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.viewInfo&&(this._roundedSelection=this._context.configuration.editor.viewInfo.roundedSelection),e.fontInfo&&(this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth),!0},t.prototype.onCursorStateChanged=function(e){return this._selections=e.selections.slice(0),!0},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype._visibleRangesHaveGaps=function(e){for(var t=0,n=e.length;t1)return!0}return!1},t.prototype._enrichVisibleRangesWithStyle=function(e,t,n){var i=this._typicalHalfwidthCharacterWidth/4,o=null,r=null;if(n&&n.length>0&&t.length>0){var s=t[0].lineNumber;if(s===e.startLineNumber)for(var a=0;!o&&a=0;a--)n[a].lineNumber===u&&(r=n[a].ranges[0]);o&&!o.startStyle&&(o=null),r&&!r.startStyle&&(r=null)}a=0;for(var l=t.length;a0){var g=t[a-1].ranges[0].left,m=t[a-1].ranges[0].left+t[a-1].ranges[0].width;MC(h-g)g&&(f.top=1),MC(d-m)'},t.prototype._actualRenderOneSelection=function(e,n,i,o){for(var r=o.length>0&&o[0].ranges[0].startStyle,s=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),u=o.length>0?o[0].lineNumber:0,l=o.length>0?o[o.length-1].lineNumber:0,c=0,h=o.length;c1,c)}}this._previousFrameVisibleRangesWithStyle=s,this._renderResult=t},t.prototype.render=function(e,t){if(!this._renderResult)return"";var n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]},t.SELECTION_CLASS_NAME="selected-text",t.SELECTION_TOP_LEFT="top-left-radius",t.SELECTION_BOTTOM_LEFT="bottom-left-radius",t.SELECTION_TOP_RIGHT="top-right-radius",t.SELECTION_BOTTOM_RIGHT="bottom-right-radius",t.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",t.ROUNDED_PIECE_WIDTH=10,t}(Fp);function MC(e){return e<0?-e:e}Zf((function(e,t){var n=e.getColor(Gg);n&&t.addRule(".monaco-editor .focused .selected-text { background-color: "+n+"; }");var i=e.getColor(Zg);i&&t.addRule(".monaco-editor .selected-text { background-color: "+i+"; }");var o=e.getColor(Yg);o&&t.addRule(".monaco-editor .view-line span.inline-selected-text { color: "+o+"; }")}));n("d93b");var TC=function(){function e(e,t,n,i,o,r){this.top=e,this.left=t,this.width=n,this.height=i,this.textContent=o,this.textContentClassName=r}return e}(),PC=function(){function e(e){this._context=e,this._cursorStyle=this._context.configuration.editor.viewInfo.cursorStyle,this._lineHeight=this._context.configuration.editor.lineHeight,this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(this._context.configuration.editor.viewInfo.cursorWidth,this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=ff(document.createElement("div")),this._domNode.setClassName("cursor"),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Xd.applyFontInfo(this._domNode,this._context.configuration.editor.fontInfo),this._domNode.setDisplay("none"),this.updatePosition(new Dn(1,1)),this._lastRenderedContent="",this._renderData=null}return e.prototype.getDomNode=function(){return this._domNode},e.prototype.getPosition=function(){return this._position},e.prototype.show=function(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)},e.prototype.hide=function(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)},e.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.fontInfo&&(Xd.applyFontInfo(this._domNode,this._context.configuration.editor.fontInfo),this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth),e.viewInfo&&(this._cursorStyle=this._context.configuration.editor.viewInfo.cursorStyle,this._lineCursorWidth=Math.min(this._context.configuration.editor.viewInfo.cursorWidth,this._typicalHalfwidthCharacterWidth)),!0},e.prototype.onCursorPositionChanged=function(e){return this.updatePosition(e),!0},e.prototype._prepareRender=function(e){var t="",n="";if(this._cursorStyle===nt.Line||this._cursorStyle===nt.LineThin){var i,o=e.visibleRangeForPosition(this._position);if(!o)return null;if(this._cursorStyle===nt.Line){if(i=Bo(this._lineCursorWidth>0?this._lineCursorWidth:2),i>2){var r=this._context.model.getLineContent(this._position.lineNumber);t=r.charAt(this._position.column-1)}}else i=Bo(1);var s=o.left;i>=2&&s>=1&&(s-=1);var a=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta;return new TC(a,s,i,this._lineHeight,t,n)}var u=e.linesVisibleRangesForRange(new In(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column+1),!1);if(!u||0===u.length||0===u[0].ranges.length)return null;var l=u[0].ranges[0],c=l.width<1?this._typicalHalfwidthCharacterWidth:l.width;if(this._cursorStyle===nt.Block){var h=this._context.model.getViewLineData(this._position.lineNumber);t=h.content.charAt(this._position.column-1),vr(h.content.charCodeAt(this._position.column-1))&&(t+=h.content.charAt(this._position.column));var d=h.tokens.findTokenIndexAtOffset(this._position.column-1);n=h.tokens.getClassName(d)}var f=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta,p=this._lineHeight;return this._cursorStyle!==nt.Underline&&this._cursorStyle!==nt.UnderlineThin||(f+=this._lineHeight-2,p=2),new TC(f,l.left,c,p,t,n)},e.prototype.prepareRender=function(e){this._renderData=this._prepareRender(e)},e.prototype.render=function(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName("cursor "+this._renderData.textContentClassName),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)},e.prototype.updatePosition=function(e){this._position=e},e}(),AC=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),RC=function(e){function t(t){var n=e.call(this,t)||this;return n._readOnly=n._context.configuration.editor.readOnly,n._cursorBlinking=n._context.configuration.editor.viewInfo.cursorBlinking,n._cursorStyle=n._context.configuration.editor.viewInfo.cursorStyle,n._selectionIsEmpty=!0,n._primaryCursor=new PC(n._context),n._secondaryCursors=[],n._renderData=[],n._domNode=ff(document.createElement("div")),n._domNode.setAttribute("role","presentation"),n._domNode.setAttribute("aria-hidden","true"),n._updateDomClassName(),n._domNode.appendChild(n._primaryCursor.getDomNode()),n._startCursorBlinkAnimation=new ne,n._cursorFlatBlinkInterval=new ie,n._blinkingEnabled=!1,n._editorHasFocus=!1,n._updateBlinking(),n}return AC(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()},t.prototype.getDomNode=function(){return this._domNode},t.prototype.onConfigurationChanged=function(e){e.readOnly&&(this._readOnly=this._context.configuration.editor.readOnly),e.viewInfo&&(this._cursorBlinking=this._context.configuration.editor.viewInfo.cursorBlinking,this._cursorStyle=this._context.configuration.editor.viewInfo.cursorStyle),this._primaryCursor.onConfigurationChanged(e),this._updateBlinking(),e.viewInfo&&this._updateDomClassName();for(var t=0,n=this._secondaryCursors.length;tt.length){var r=this._secondaryCursors.length-t.length;for(i=0;in){var r=t-n;for(o=0;o=e+1&&this.lastAddedCursorIndex--,this.secondaryCursors[e].dispose(this.context),this.secondaryCursors.splice(e,1)},e.prototype._getAll=function(){var e=[];e[0]=this.primaryCursor;for(var t=0,n=this.secondaryCursors.length;td&&t[C].index--;e.splice(d,1),t.splice(h,1),this._removeSecondaryCursor(d-1),o--}}}}},e}(),JC=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function QC(e){for(var t=0,n=e.length;tt.MAX_CURSOR_COUNT&&(i=i.slice(0,t.MAX_CURSOR_COUNT),this._onDidReachMaxCursorCount.fire(void 0));var o=new tS(this._model,this);this._cursors.setStates(i),this._cursors.normalize(),this._columnSelectData=null,this._emitStateChangedIfNecessary(e,n,o)},t.prototype.setColumnSelectData=function(e){this._columnSelectData=e},t.prototype.reveal=function(e,t,n){this._revealRange(t,0,e,n)},t.prototype.revealRange=function(e,t,n,i){this.emitCursorRevealRange(t,n,e,i)},t.prototype.scrollTo=function(e){this._viewModel.viewLayout.setScrollPositionSmooth({scrollTop:e})},t.prototype.saveState=function(){for(var e=[],t=this._cursors.getSelections(),n=0,i=t.length;n1)return;var a=new In(r.lineNumber,r.column,r.lineNumber,r.column);this.emitCursorRevealRange(a,t,n,i)},t.prototype.emitCursorRevealRange=function(e,t,n,i){try{var o=this._beginEmit();o.emit(new Cv(e,t,n,i))}finally{this._endEmit()}},t.prototype.trigger=function(e,t,n){var i=Ns;if(t!==i.CompositionStart)if(t===i.CompositionEnd&&(this._isDoingComposition=!1),this._configuration.editor.readOnly)this._onDidAttemptReadOnlyEdit.fire(void 0);else{var o=new tS(this._model,this),r=0;t!==i.Undo&&t!==i.Redo&&this._cursors.stopTrackingSelections(),this._cursors.ensureValidState(),this._isHandling=!0;try{switch(t){case i.Type:this._type(e,n.text);break;case i.ReplacePreviousChar:this._replacePreviousChar(n.text,n.replaceCharCnt);break;case i.Paste:r=4,this._paste(n.text,n.pasteOnNewLine,n.multicursorText);break;case i.Cut:this._cut();break;case i.Undo:r=5,this._interpretCommandResult(this._model.undo());break;case i.Redo:r=6,this._interpretCommandResult(this._model.redo());break;case i.ExecuteCommand:this._externalExecuteCommand(n);break;case i.ExecuteCommands:this._externalExecuteCommands(n);break;case i.CompositionEnd:this._interpretCompositionEnd(e);break}}catch(s){l(s)}this._isHandling=!1,t!==i.Undo&&t!==i.Redo&&this._cursors.startTrackingSelections(),this._emitStateChangedIfNecessary(e,r,o)&&this._revealRange(0,0,!0,0)}else this._isDoingComposition=!0},t.prototype._interpretCompositionEnd=function(e){this._isDoingComposition||"keyboard"!==e||this._executeEditOperation(_b.compositionEndWithInterceptors(this._prevEditOperationType,this.context.config,this.context.model,this.getSelections()))},t.prototype._type=function(e,t){if(this._isDoingComposition||"keyboard"!==e)this._executeEditOperation(_b.typeWithoutInterceptors(this._prevEditOperationType,this.context.config,this.context.model,this.getSelections(),t));else for(var n=0,i=t.length;n0&&(r[0]._isTracked=!0);var u=e.model.pushEditOperations(e.selectionsBefore,r,(function(n){for(var i=[],o=0;o0?(i[n].sort(s),a[n]=t[n].computeCursorState(e.model,{getInverseEditOperations:function(){return i[n]},getTrackedSelection:function(t){var n=parseInt(t,10),i=e.model._getTrackedRange(e.trackedRanges[n]);return 0===e.trackedRangesDirection[n]?new Tn(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn):new Tn(i.endLineNumber,i.endColumn,i.startLineNumber,i.startColumn)}})):a[n]=e.selectionsBefore[n]};for(o=0;oo.identifier.major?i.identifier.major:o.identifier.major,t[r.toString()]=!0;for(var s=0;s0&&n--}}return t},e}(),oS=function(){function e(e,t,n,i,o,r){this.id=e,this.label=t,this.alias=n,this._precondition=i,this._run=o,this._contextKeyService=r}return e.prototype.isSupported=function(){return this._contextKeyService.contextMatchesRules(this._precondition)},e.prototype.run=function(){if(!this.isSupported())return Promise.resolve(void 0);var e=this._run();return e||Promise.resolve(void 0)},e}(),rS={getInitialState:function(){return Ja},tokenize2:function(e,t,n){return nu(0,e,t,n)}};function sS(e,t){return void 0===t&&(t=rS),uS(e,t||rS)}function aS(e,t,n,i,o,r){for(var s="
",a=i,u=0,l=0,c=t.getCount();l0)d+=" ",p--;break;case 60:d+="<";break;case 62:d+=">";break;case 38:d+="&";break;case 0:d+="�";break;case 65279:case 8232:d+="�";break;case 13:d+="​";break;default:d+=String.fromCharCode(f)}}if(s+=''+d+"",h>o||a>=o)break}}return s+="
",s}function uS(e,t){for(var n='
',i=e.split(/\r\n|\r|\n/),o=t.getInitialState(),r=0,s=i.length;r0&&(n+="
");var u=t.tokenize2(a,o,0);jl.convertToEndOffset(u.tokens,a.length);for(var l=new jl(u.tokens,a),c=l.inflate(),h=0,d=0,f=c.getCount();d'+Yo(a.substring(h,g))+"",h=g}o=u.endState}return n+="
",n}var lS=function(){function e(){this._heights=[],this._minWidths=[],this._ids=[],this._afterLineNumbers=[],this._ordinals=[],this._prefixSum=[],this._prefixSumValidIndex=-1,this._whitespaceId2Index={},this._lastWhitespaceId=0,this._minWidth=-1}return e.findInsertionIndex=function(e,t,n,i){var o=0,r=e.length;while(o>>1;t===e[s]?i=t&&(this._whitespaceId2Index[l]=c+1)}this._whitespaceId2Index[e.toString()]=t,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)},e.prototype.changeWhitespace=function(e,t,n){e|=0,t|=0,n|=0;var i=!1;return i=this.changeWhitespaceHeight(e,n)||i,i=this.changeWhitespaceAfterLineNumber(e,t)||i,i},e.prototype.changeWhitespaceHeight=function(e,t){e|=0,t|=0;var n=e.toString();if(this._whitespaceId2Index.hasOwnProperty(n)){var i=this._whitespaceId2Index[n];if(this._heights[i]!==t)return this._heights[i]=t,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,i-1),!0}return!1},e.prototype.changeWhitespaceAfterLineNumber=function(t,n){t|=0,n|=0;var i=t.toString();if(this._whitespaceId2Index.hasOwnProperty(i)){var o=this._whitespaceId2Index[i];if(this._afterLineNumbers[o]!==n){var r=this._ordinals[o],s=this._heights[o],a=this._minWidths[o];this.removeWhitespace(t);var u=e.findInsertionIndex(this._afterLineNumbers,n,this._ordinals,r);return this._insertWhitespaceAtIndex(t,u,n,r,s,a),!0}}return!1},e.prototype.removeWhitespace=function(e){e|=0;var t=e.toString();if(this._whitespaceId2Index.hasOwnProperty(t)){var n=this._whitespaceId2Index[t];return delete this._whitespaceId2Index[t],this._removeWhitespaceAtIndex(n),this._minWidth=-1,!0}return!1},e.prototype._removeWhitespaceAtIndex=function(e){e|=0,this._heights.splice(e,1),this._minWidths.splice(e,1),this._ids.splice(e,1),this._afterLineNumbers.splice(e,1),this._ordinals.splice(e,1),this._prefixSum.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1);for(var t=Object.keys(this._whitespaceId2Index),n=0,i=t.length;n=e&&(this._whitespaceId2Index[o]=r-1)}},e.prototype.onLinesDeleted=function(e,t){e|=0,t|=0;for(var n=0,i=this._afterLineNumbers.length;nt&&(this._afterLineNumbers[n]-=t-e+1)}},e.prototype.onLinesInserted=function(e,t){e|=0,t|=0;for(var n=0,i=this._afterLineNumbers.length;n=t.length||t[s+1]>=e)return s;n=s+1|0}else i=s-1|0}return-1},e.prototype._findFirstWhitespaceAfterLineNumber=function(e){e|=0;var t=this._findLastWhitespaceBeforeLineNumber(e),n=t+1;return n1?this._lineHeight*(e-1):0;var n=this._whitespaces.getAccumulatedHeightBeforeLineNumber(e);return t+n},e.prototype.getWhitespaceAccumulatedHeightBeforeLineNumber=function(e){return this._whitespaces.getAccumulatedHeightBeforeLineNumber(e)},e.prototype.getWhitespaceMinWidth=function(){return this._whitespaces.getMinWidth()},e.prototype.isAfterLines=function(e){var t=this.getLinesTotalHeight();return e>t},e.prototype.getLineNumberAtOrAfterVerticalOffset=function(e){if(e|=0,e<0)return 1;var t=0|this._lineCount,n=this._lineHeight,i=1,o=t;while(i=s+n)i=r+1;else{if(e>=s)return r;o=r}}return i>t?t:i},e.prototype.getLinesViewportData=function(e,t){e|=0,t|=0;var n,i,o=this._lineHeight,r=0|this.getLineNumberAtOrAfterVerticalOffset(e),s=0|this.getVerticalOffsetForLineNumber(r),a=0|this._lineCount,u=0|this._whitespaces.getFirstWhitespaceIndexAfterLineNumber(r),l=0|this._whitespaces.getCount();-1===u?(u=l,i=a+1,n=0):(i=0|this._whitespaces.getAfterLineNumberForWhitespaceIndex(u),n=0|this._whitespaces.getHeightForWhitespaceIndex(u));var c=s,h=c,d=5e5,f=0;s>=d&&(f=Math.floor(s/d)*d,f=Math.floor(f/o)*o,h-=f);for(var p=[],g=e+(t-e)/2,m=-1,v=r;v<=a;v++){if(-1===m){var _=c,y=c+o;(_<=g&&gg)&&(m=v)}c+=o,p[v-r]=h,h+=o;while(i===v)h+=n,c+=n,u++,u>=l?i=a+1:(i=0|this._whitespaces.getAfterLineNumberForWhitespaceIndex(u),n=0|this._whitespaces.getHeightForWhitespaceIndex(u));if(c>=t){a=v;break}}-1===m&&(m=a);var b=0|this.getVerticalOffsetForLineNumber(a),w=r,C=a;return wt&&C--,{bigNumbersDelta:f,startLineNumber:r,endLineNumber:a,relativeVerticalOffset:p,centeredLineNumber:m,completelyVisibleStartLineNumber:w,completelyVisibleEndLineNumber:C}},e.prototype.getVerticalOffsetForWhitespaceIndex=function(e){e|=0;var t,n,i=this._whitespaces.getAfterLineNumberForWhitespaceIndex(e);return t=i>=1?this._lineHeight*i:0,n=e>0?this._whitespaces.getAccumulatedHeight(e-1):0,t+n},e.prototype.getWhitespaceIndexAtOrAfterVerticallOffset=function(e){e|=0;var t,n,i,o=0,r=this._whitespaces.getCount()-1;if(r<0)return-1;var s=this.getVerticalOffsetForWhitespaceIndex(r),a=this._whitespaces.getHeightForWhitespaceIndex(r);if(e>=s+a)return-1;while(o=n+i)o=t+1;else{if(e>=n)return t;r=t}return o},e.prototype.getWhitespaceAtVerticalOffset=function(e){e|=0;var t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0)return null;if(t>=this._whitespaces.getCount())return null;var n=this.getVerticalOffsetForWhitespaceIndex(t);if(n>e)return null;var i=this._whitespaces.getHeightForWhitespaceIndex(t),o=this._whitespaces.getIdForWhitespaceIndex(t),r=this._whitespaces.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:r,verticalOffset:n,height:i}},e.prototype.getWhitespaceViewportData=function(e,t){e|=0,t|=0;var n=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),i=this._whitespaces.getCount()-1;if(n<0)return[];for(var o=[],r=n;r<=i;r++){var s=this.getVerticalOffsetForWhitespaceIndex(r),a=this._whitespaces.getHeightForWhitespaceIndex(r);if(s>=t)break;o.push({id:this._whitespaces.getIdForWhitespaceIndex(r),afterLineNumber:this._whitespaces.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:s,height:a})}return o},e.prototype.getWhitespaces=function(){return this._whitespaces.getWhitespaces(this._lineHeight)},e}(),hS=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),dS=125,fS=function(e){function t(t,n,i){var o=e.call(this)||this;return o._configuration=t,o._linesLayout=new cS(n,o._configuration.editor.lineHeight),o.scrollable=o._register(new fw(0,i)),o._configureSmoothScrollDuration(),o.scrollable.setScrollDimensions({width:t.editor.layoutInfo.contentWidth,height:t.editor.layoutInfo.contentHeight}),o.onDidScroll=o.scrollable.onScroll,o._updateHeight(),o}return hS(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.onHeightMaybeChanged=function(){this._updateHeight()},t.prototype._configureSmoothScrollDuration=function(){this.scrollable.setSmoothScrollDuration(this._configuration.editor.viewInfo.smoothScrolling?dS:0)},t.prototype.onConfigurationChanged=function(e){e.lineHeight&&this._linesLayout.setLineHeight(this._configuration.editor.lineHeight),e.layoutInfo&&this.scrollable.setScrollDimensions({width:this._configuration.editor.layoutInfo.contentWidth,height:this._configuration.editor.layoutInfo.contentHeight}),e.viewInfo&&this._configureSmoothScrollDuration(),this._updateHeight()},t.prototype.onFlushed=function(e){this._linesLayout.onFlushed(e)},t.prototype.onLinesDeleted=function(e,t){this._linesLayout.onLinesDeleted(e,t)},t.prototype.onLinesInserted=function(e,t){this._linesLayout.onLinesInserted(e,t)},t.prototype._getHorizontalScrollbarHeight=function(e){return 2===this._configuration.editor.viewInfo.scrollbar.horizontal||e.width>=e.scrollWidth?0:this._configuration.editor.viewInfo.scrollbar.horizontalScrollbarSize},t.prototype._getTotalHeight=function(){var e=this.scrollable.getScrollDimensions(),t=this._linesLayout.getLinesTotalHeight();return this._configuration.editor.viewInfo.scrollBeyondLastLine?t+=e.height-this._configuration.editor.lineHeight:t+=this._getHorizontalScrollbarHeight(e),Math.max(e.height,t)},t.prototype._updateHeight=function(){this.scrollable.setScrollDimensions({scrollHeight:this._getTotalHeight()})},t.prototype.getCurrentViewport=function(){var e=this.scrollable.getScrollDimensions(),t=this.scrollable.getCurrentScrollPosition();return new hc(t.scrollTop,t.scrollLeft,e.width,e.height)},t.prototype.getFutureViewport=function(){var e=this.scrollable.getScrollDimensions(),t=this.scrollable.getFutureScrollPosition();return new hc(t.scrollTop,t.scrollLeft,e.width,e.height)},t.prototype._computeScrollWidth=function(e,t){var n=this._configuration.editor.wrappingInfo.isViewportWrapping;if(!n){var i=this._configuration.editor.viewInfo.scrollBeyondLastColumn*this._configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,o=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+i,t,o)}return Math.max(e,t)},t.prototype.onMaxLineWidthChanged=function(e){var t=this._computeScrollWidth(e,this.getCurrentViewport().width);this.scrollable.setScrollDimensions({scrollWidth:t}),this._updateHeight()},t.prototype.saveState=function(){var e=this.scrollable.getFutureScrollPosition(),t=e.scrollTop,n=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),i=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n);return{scrollTop:t,scrollTopWithoutViewZones:t-i,scrollLeft:e.scrollLeft}},t.prototype.addWhitespace=function(e,t,n,i){return this._linesLayout.insertWhitespace(e,t,n,i)},t.prototype.changeWhitespace=function(e,t,n){return this._linesLayout.changeWhitespace(e,t,n)},t.prototype.removeWhitespace=function(e){return this._linesLayout.removeWhitespace(e)},t.prototype.getVerticalOffsetForLineNumber=function(e){return this._linesLayout.getVerticalOffsetForLineNumber(e)},t.prototype.isAfterLines=function(e){return this._linesLayout.isAfterLines(e)},t.prototype.getLineNumberAtVerticalOffset=function(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)},t.prototype.getWhitespaceAtVerticalOffset=function(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)},t.prototype.getLinesViewportData=function(){var e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)},t.prototype.getLinesViewportDataAtScrollTop=function(e){var t=this.scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)},t.prototype.getWhitespaceViewportData=function(){var e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)},t.prototype.getWhitespaces=function(){return this._linesLayout.getWhitespaces()},t.prototype.getScrollWidth=function(){var e=this.scrollable.getScrollDimensions();return e.scrollWidth},t.prototype.getScrollHeight=function(){var e=this.scrollable.getScrollDimensions();return e.scrollHeight},t.prototype.getCurrentScrollLeft=function(){var e=this.scrollable.getCurrentScrollPosition();return e.scrollLeft},t.prototype.getCurrentScrollTop=function(){var e=this.scrollable.getCurrentScrollPosition();return e.scrollTop},t.prototype.validateScrollPosition=function(e){return this.scrollable.validateScrollPosition(e)},t.prototype.setScrollPositionNow=function(e){this.scrollable.setScrollPositionNow(e)},t.prototype.setScrollPositionSmooth=function(e){this.scrollable.setScrollPositionSmooth(e)},t.prototype.deltaScrollNow=function(e,t){var n=this.scrollable.getCurrentScrollPosition();this.scrollable.setScrollPositionNow({scrollLeft:n.scrollLeft+e,scrollTop:n.scrollTop+t})},t}(S),pS=function(){function e(e,t){this.outputLineIndex=e,this.outputOffset=t}return e}(),gS=function(){function e(e){this._lines=e}return e.prototype.convertViewPositionToModelPosition=function(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)},e.prototype.convertViewRangeToModelRange=function(e){var t=this._lines.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),n=this._lines.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new In(t.lineNumber,t.column,n.lineNumber,n.column)},e.prototype.validateViewPosition=function(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)},e.prototype.validateViewRange=function(e,t){var n=this._lines.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),i=this._lines.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new In(n.lineNumber,n.column,i.lineNumber,i.column)},e.prototype.convertModelPositionToViewPosition=function(e){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column)},e.prototype.convertModelRangeToViewRange=function(e){var t=this._lines.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn),n=this._lines.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn);return new In(t.lineNumber,t.column,n.lineNumber,n.column)},e.prototype.modelPositionIsVisible=function(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)},e}(),mS=function(){function e(e,t,n,i,o,r){this.model=e,this._validModelVersionId=-1,this.tabSize=n,this.wrappingColumn=i,this.columnsForFullWidthChar=o,this.wrappingIndent=r,this.linePositionMapperFactory=t,this._constructLines(!0)}return e.prototype.dispose=function(){this.hiddenAreasIds=this.model.deltaDecorations(this.hiddenAreasIds,[])},e.prototype.createCoordinatesConverter=function(){return new gS(this)},e.prototype._ensureValidState=function(){var e=this.model.getVersionId();if(e!==this._validModelVersionId)throw new Error("ViewModel is out of sync with Model!");this.lines.length!==this.model.getLineCount()&&this._constructLines(!1)},e.prototype._constructLines=function(e){var t=this;this.lines=[],e&&(this.hiddenAreasIds=[]);for(var n=this.model.getLinesContent(),i=n.length,o=new Uint32Array(i),r=this.hiddenAreasIds.map((function(e){return t.model.getDecorationRange(e)})).sort(In.compareRangesUsingStarts),s=1,a=0,u=-1,l=u+1=s&&h<=a,f=bS(this.linePositionMapperFactory,n[c],this.tabSize,this.wrappingColumn,this.columnsForFullWidthChar,this.wrappingIndent,!d);o[c]=f.getViewLineCount(),this.lines[c]=f}this._validModelVersionId=this.model.getVersionId(),this.prefixSumComputer=new ul(o)},e.prototype.getHiddenAreas=function(){var e=this;return this.hiddenAreasIds.map((function(t){return e.model.getDecorationRange(t)}))},e.prototype._reduceRanges=function(e){var t=this;if(0===e.length)return[];for(var n=e.map((function(e){return t.model.validateRange(e)})).sort(In.compareRangesUsingStarts),i=[],o=n[0].startLineNumber,r=n[0].endLineNumber,s=1,a=n.length;sr+1?(i.push(new In(o,1,r,1)),o=u.startLineNumber,r=u.endLineNumber):u.endLineNumber>r&&(r=u.endLineNumber)}return i.push(new In(o,1,r,1)),i},e.prototype.setHiddenAreas=function(e){var t=this,n=this._reduceRanges(e),i=this.hiddenAreasIds.map((function(e){return t.model.getDecorationRange(e)})).sort(In.compareRangesUsingStarts);if(n.length===i.length){for(var o=!1,r=0;r=u&&f<=l?this.lines[r].isVisible()&&(this.lines[r]=this.lines[r].setVisible(!1),p=!0):(d=!0,this.lines[r].isVisible()||(this.lines[r]=this.lines[r].setVisible(!0),p=!0)),p){var g=this.lines[r].getViewLineCount();this.prefixSumComputer.changeValue(r,g)}}return d||this.setHiddenAreas([]),!0},e.prototype.modelPositionIsVisible=function(e,t){return!(e<1||e>this.lines.length)&&this.lines[e-1].isVisible()},e.prototype.setTabSize=function(e){return this.tabSize!==e&&(this.tabSize=e,this._constructLines(!1),!0)},e.prototype.setWrappingSettings=function(e,t,n){return(this.wrappingIndent!==e||this.wrappingColumn!==t||this.columnsForFullWidthChar!==n)&&(this.wrappingIndent=e,this.wrappingColumn=t,this.columnsForFullWidthChar=n,this._constructLines(!1),!0)},e.prototype.onModelFlushed=function(){this._constructLines(!0)},e.prototype.onModelLinesDeleted=function(e,t,n){if(e<=this._validModelVersionId)return null;var i=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,o=this.prefixSumComputer.getAccumulatedValue(n-1);return this.lines.splice(t-1,n-t+1),this.prefixSumComputer.removeValues(t-1,n-t+1),new bv(i,o)},e.prototype.onModelLinesInserted=function(e,t,n,i){if(e<=this._validModelVersionId)return null;for(var o=this.getHiddenAreas(),r=!1,s=new Dn(t,1),a=0;aa?(l=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,c=l+a-1,f=c+1,p=f+(o-a)-1,u=!0):ot?t:e},e.prototype.warmUpLookupCache=function(e,t){this.prefixSumComputer.warmUpCache(e-1,t-1)},e.prototype.getActiveIndentGuide=function(e,t,n){this._ensureValidState(),e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),n=this._toValidViewLineNumber(n);var i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(n,this.getViewLineMinColumn(n)),s=this.model.getActiveIndentGuide(i.lineNumber,o.lineNumber,r.lineNumber),a=this.convertModelPositionToViewPosition(s.startLineNumber,1),u=this.convertModelPositionToViewPosition(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:u.lineNumber,indent:s.indent}},e.prototype.getViewLinesIndentGuides=function(e,t){this._ensureValidState(),e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);for(var n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),i=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t)),o=[],r=[],s=[],a=n.lineNumber-1,u=i.lineNumber-1,l=null,c=a;c<=u;c++){var h=this.lines[c];if(h.isVisible()){var d=h.getViewLineNumberOfModelPosition(0,c===a?n.column:1),f=h.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(c+1)),p=f-d+1,g=0;p>1&&1===h.getViewLineMinColumn(this.model,c+1,f)&&(g=0===d?1:2),r.push(p),s.push(g),null===l&&(l=new Dn(c+1,0))}else null!==l&&(o=o.concat(this.model.getLinesIndentGuides(l.lineNumber,c)),l=null)}null!==l&&(o=o.concat(this.model.getLinesIndentGuides(l.lineNumber,i.lineNumber)),l=null);for(var m=t-e+1,v=new Array(m),_=0,y=0,b=o.length;yt&&(f=!0,d=t-o+1);var p=h+d;if(c.getViewLinesData(this.model,u+1,h,p,o-e,n,a),o+=d,f)break}}return a},e.prototype.validateViewPosition=function(e,t,n){this._ensureValidState(),e=this._toValidViewLineNumber(e);var i=this.prefixSumComputer.getIndexOf(e-1),o=i.index,r=i.remainder,s=this.lines[o],a=s.getViewLineMinColumn(this.model,o+1,r),u=s.getViewLineMaxColumn(this.model,o+1,r);tu&&(t=u);var l=s.getModelColumnOfViewPosition(r,t),c=this.model.validatePosition(new Dn(o+1,l));return c.equals(n)?new Dn(e,t):this.convertModelPositionToViewPosition(n.lineNumber,n.column)},e.prototype.convertViewPositionToModelPosition=function(e,t){this._ensureValidState(),e=this._toValidViewLineNumber(e);var n=this.prefixSumComputer.getIndexOf(e-1),i=n.index,o=n.remainder,r=this.lines[i].getModelColumnOfViewPosition(o,t);return this.model.validatePosition(new Dn(i+1,r))},e.prototype.convertModelPositionToViewPosition=function(e,t){this._ensureValidState();var n=this.model.validatePosition(new Dn(e,t)),i=n.lineNumber,o=n.column,r=i-1,s=!1;while(r>0&&!this.lines[r].isVisible())r--,s=!0;if(0===r&&!this.lines[r].isVisible())return new Dn(1,1);var a,u=1+(0===r?0:this.prefixSumComputer.getAccumulatedValue(r-1));return a=s?this.lines[r].getViewPositionOfModelPosition(u,this.model.getLineMaxColumn(r+1)):this.lines[i-1].getViewPositionOfModelPosition(u,o),a},e.prototype._getViewLineNumberForModelPosition=function(e,t){var n=e-1;if(this.lines[n].isVisible()){var i=1+(0===n?0:this.prefixSumComputer.getAccumulatedValue(n-1));return this.lines[n].getViewLineNumberOfModelPosition(i,t)}while(n>0&&!this.lines[n].isVisible())n--;if(0===n&&!this.lines[n].isVisible())return 1;var o=1+(0===n?0:this.prefixSumComputer.getAccumulatedValue(n-1));return this.lines[n].getViewLineNumberOfModelPosition(o,this.model.getLineMaxColumn(n+1))},e.prototype.getAllOverviewRulerDecorations=function(e,t,n){for(var i=this.model.getOverviewRulerDecorations(e,t),o=new SS,r=0,s=i.length;rt.id?1:0:n}));for(var d=[],f=0,p=null,g=0,m=r.length;g0&&(r=this.wrappedIndent+r),r},e.prototype.getViewLineLength=function(e,t,n){if(!this._isVisible)throw new Error("Not supported");var i=this.getInputStartOffsetOfOutputLineIndex(n),o=this.getInputEndOffsetOfOutputLineIndex(e,t,n),r=o-i;return n>0&&(r=this.wrappedIndent.length+r),r},e.prototype.getViewLineMinColumn=function(e,t,n){if(!this._isVisible)throw new Error("Not supported");return n>0?this.wrappedIndentLength+1:1},e.prototype.getViewLineMaxColumn=function(e,t,n){if(!this._isVisible)throw new Error("Not supported");return this.getViewLineContent(e,t,n).length+1},e.prototype.getViewLineData=function(e,t,n){if(!this._isVisible)throw new Error("Not supported");var i=this.getInputStartOffsetOfOutputLineIndex(n),o=this.getInputEndOffsetOfOutputLineIndex(e,t,n),r=e.getValueInRange({startLineNumber:t,startColumn:i+1,endLineNumber:t,endColumn:o+1});n>0&&(r=this.wrappedIndent+r);var s=n>0?this.wrappedIndentLength+1:1,a=r.length+1,u=n+10&&(l=this.wrappedIndentLength);var c=e.getLineTokens(t);return new fc(r,u,s,a,c.sliceAndInflate(i,o,l))},e.prototype.getViewLinesData=function(e,t,n,i,o,r,s){if(!this._isVisible)throw new Error("Not supported");for(var a=n;a0&&(n0&&(o+=this.wrappedIndentLength),new Dn(e+i,o)},e.prototype.getViewLineNumberOfModelPosition=function(e,t){if(!this._isVisible)throw new Error("Not supported");var n=this.positionMapper.getOutputPositionOfInputOffset(t-1);return e+n.outputLineIndex},e}();function bS(e,t,n,i,o,r,s){var a=e.createLineMapping(t,n,i,o,r);return null===a?s?vS.INSTANCE:_S.INSTANCE:new yS(a,s)}var wS=function(){function e(e){this._lines=e}return e.prototype._validPosition=function(e){return this._lines.model.validatePosition(e)},e.prototype._validRange=function(e){return this._lines.model.validateRange(e)},e.prototype.convertViewPositionToModelPosition=function(e){return this._validPosition(e)},e.prototype.convertViewRangeToModelRange=function(e){return this._validRange(e)},e.prototype.validateViewPosition=function(e,t){return this._validPosition(t)},e.prototype.validateViewRange=function(e,t){return this._validRange(t)},e.prototype.convertModelPositionToViewPosition=function(e){return this._validPosition(e)},e.prototype.convertModelRangeToViewRange=function(e){return this._validRange(e)},e.prototype.modelPositionIsVisible=function(e){var t=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)},e}(),CS=function(){function e(e){this.model=e}return e.prototype.dispose=function(){},e.prototype.createCoordinatesConverter=function(){return new wS(this)},e.prototype.getHiddenAreas=function(){return[]},e.prototype.setHiddenAreas=function(e){return!1},e.prototype.setTabSize=function(e){return!1},e.prototype.setWrappingSettings=function(e,t,n){return!1},e.prototype.onModelFlushed=function(){},e.prototype.onModelLinesDeleted=function(e,t,n){return new bv(t,n)},e.prototype.onModelLinesInserted=function(e,t,n,i){return new wv(t,n)},e.prototype.onModelLineChanged=function(e,t,n){return[!1,new yv(t,t),null,null]},e.prototype.acceptVersionId=function(e){},e.prototype.getViewLineCount=function(){return this.model.getLineCount()},e.prototype.warmUpLookupCache=function(e,t){},e.prototype.getActiveIndentGuide=function(e,t,n){return{startLineNumber:e,endLineNumber:e,indent:0}},e.prototype.getViewLinesIndentGuides=function(e,t){for(var n=t-e+1,i=new Array(n),o=0;o=t)return void(n>s&&(o[o.length-1]=n));o.push(i,t,n)}else this.result[e]=[i,t,n]},e}(),xS=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),LS=function(e){function t(t,n,i){for(var o=e.call(this,0)||this,r=0;r=12352&&t<=12543||t>=13312&&t<=19903||t>=19968&&t<=40959?4:e.prototype.get.call(this,t)},t}(cl),kS=function(){function e(e,t,n){this.classifier=new LS(e,t,n)}return e.nextVisibleColumn=function(e,t,n,i){return e=+e,t=+t,i=+i,n?e+(t-e%t):e+i},e.prototype.createLineMapping=function(t,n,i,o,r){if(-1===i)return null;n=+n,i=+i,o=+o,r=+r;var s=0,a="",u=-1;if(0!==r&&(u=rr(t),-1!==u)){a=t.substring(0,u);for(var l=0;li&&(a="",s=0)}var h=this.classifier,d=0,f=[],p=0,g=0,m=-1,v=0,_=-1,y=0,b=t.length;for(l=0;l0){var x=t.charCodeAt(l-1),L=h.get(x);1!==L&&(m=l,v=s)}var k=1;if(kr(w)&&(k=o),g=e.nextVisibleColumn(g,n,C,k),g>i&&0!==l){var N=void 0,E=void 0;-1!==m&&v<=i?(N=m,E=v):-1!==_&&y<=i?(N=_,E=y):(N=l,E=s),f[p++]=N-d,d=N,g=e.nextVisibleColumn(E,n,C,k),m=-1,v=0,_=-1,y=0}if(-1!==m&&(v=e.nextVisibleColumn(v,n,C,k)),-1!==_&&(y=e.nextVisibleColumn(y,n,C,k)),2===S&&(0===r||l>=u)&&(m=l+1,v=s),4===S&&l=2&&e.viewportStartLineTrackedRange){var g=e.model._getTrackedRange(e.viewportStartLineTrackedRange);if(g){var m=e.coordinatesConverter.convertModelPositionToViewPosition(g.getStartPosition()),v=e.viewLayout.getVerticalOffsetForLineNumber(m.lineNumber);e.viewLayout.setScrollPositionNow({scrollTop:v+e.viewportStartLineDelta})}}}))),this._register(this.model.onDidChangeTokens((function(t){for(var n=[],i=0,o=t.ranges.length;ia||(r0&&s[u-1]===s[u]||(a+=this.model.getLineContent(s[u])+o);return a}var l=[];for(u=0;u'+this._getHTMLToCopy(n,r)+""},t.prototype._getHTMLToCopy=function(e,t){for(var n=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,r=e.endColumn,s=this.getTabSize(),a="",u=n;u<=o;u++){var l=this.model.getLineTokens(u),c=l.getLineContent(),h=u===n?i-1:0,d=u===o?r-1:c.length;a+=""===c?"
":aS(c,l.inflate(),t,h,d,s)}return a},t.prototype._getColorMap=function(){var e=Za.getColorMap(),t=["#000000"];if(e)for(var n=1,i=e.length;n=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},AS=function(e,t){return function(n,i){t(n,i,e)}},RS=0,FS="showUnused",WS=function(){function e(e,t,n,i,o,r){this.model=e,this.viewModel=t,this.cursor=n,this.view=i,this.hasRealView=o,this.listenersToRemove=r}return e.prototype.dispose=function(){y(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.cursor.dispose(),this.viewModel.dispose()},e}(),VS=function(e){function t(t,n,i,o,r,s,a,u,c){var h,d=e.call(this)||this;d._onDidDispose=d._register(new T),d.onDidDispose=d._onDidDispose.event,d._onDidChangeModelContent=d._register(new T),d.onDidChangeModelContent=d._onDidChangeModelContent.event,d._onDidChangeModelLanguage=d._register(new T),d.onDidChangeModelLanguage=d._onDidChangeModelLanguage.event,d._onDidChangeModelLanguageConfiguration=d._register(new T),d.onDidChangeModelLanguageConfiguration=d._onDidChangeModelLanguageConfiguration.event,d._onDidChangeModelOptions=d._register(new T),d.onDidChangeModelOptions=d._onDidChangeModelOptions.event,d._onDidChangeModelDecorations=d._register(new T),d.onDidChangeModelDecorations=d._onDidChangeModelDecorations.event,d._onDidChangeConfiguration=d._register(new T),d.onDidChangeConfiguration=d._onDidChangeConfiguration.event,d._onDidChangeModel=d._register(new T),d.onDidChangeModel=d._onDidChangeModel.event,d._onDidChangeCursorPosition=d._register(new T),d.onDidChangeCursorPosition=d._onDidChangeCursorPosition.event,d._onDidChangeCursorSelection=d._register(new T),d.onDidChangeCursorSelection=d._onDidChangeCursorSelection.event,d._onDidAttemptReadOnlyEdit=d._register(new T),d.onDidAttemptReadOnlyEdit=d._onDidAttemptReadOnlyEdit.event,d._onDidLayoutChange=d._register(new T),d.onDidLayoutChange=d._onDidLayoutChange.event,d._editorTextFocus=d._register(new BS),d.onDidFocusEditorText=d._editorTextFocus.onDidChangeToTrue,d.onDidBlurEditorText=d._editorTextFocus.onDidChangeToFalse,d._editorWidgetFocus=d._register(new BS),d.onDidFocusEditorWidget=d._editorWidgetFocus.onDidChangeToTrue,d.onDidBlurEditorWidget=d._editorWidgetFocus.onDidChangeToFalse,d._onWillType=d._register(new T),d.onWillType=d._onWillType.event,d._onDidType=d._register(new T),d.onDidType=d._onDidType.event,d._onCompositionStart=d._register(new T),d.onCompositionStart=d._onCompositionStart.event,d._onCompositionEnd=d._register(new T),d.onCompositionEnd=d._onCompositionEnd.event,d._onDidPaste=d._register(new T),d.onDidPaste=d._onDidPaste.event,d._onMouseUp=d._register(new T),d.onMouseUp=d._onMouseUp.event,d._onMouseDown=d._register(new T),d.onMouseDown=d._onMouseDown.event,d._onMouseDrag=d._register(new T),d.onMouseDrag=d._onMouseDrag.event,d._onMouseDrop=d._register(new T),d.onMouseDrop=d._onMouseDrop.event,d._onContextMenu=d._register(new T),d.onContextMenu=d._onContextMenu.event,d._onMouseMove=d._register(new T),d.onMouseMove=d._onMouseMove.event,d._onMouseLeave=d._register(new T),d.onMouseLeave=d._onMouseLeave.event,d._onKeyUp=d._register(new T),d.onKeyUp=d._onKeyUp.event,d._onKeyDown=d._register(new T),d.onKeyDown=d._onKeyDown.event,d._onDidScrollChange=d._register(new T),d.onDidScrollChange=d._onDidScrollChange.event,d._onDidChangeViewZones=d._register(new T),d.onDidChangeViewZones=d._onDidChangeViewZones.event,d._domElement=t,d._id=++RS,d._decorationTypeKeysToIds={},d._decorationTypeSubtypes={},d.isSimpleWidget=i.isSimpleWidget||!1,d._telemetryData=i.telemetryData||null,n=n||{},d._configuration=d._register(d._createConfiguration(n)),d._register(d._configuration.onDidChange((function(e){d._onDidChangeConfiguration.fire(e),e.layoutInfo&&d._onDidLayoutChange.fire(d._configuration.editor.layoutInfo),d._configuration.editor.showUnused?d._domElement.classList.add(FS):d._domElement.classList.remove(FS)}))),d._contextKeyService=d._register(a.createScoped(d._domElement)),d._notificationService=c,d._codeEditorService=r,d._commandService=s,d._themeService=u,d._register(new HS(d,d._contextKeyService)),d._register(new jS(d,d._contextKeyService)),d._instantiationService=o.createChild(new MS([ph,d._contextKeyService])),d._attachModel(null),d._contributions={},d._actions={},d._focusTracker=new zS(t),d._focusTracker.onChange((function(){d._editorWidgetFocus.setValue(d._focusTracker.hasFocus())})),d._contentWidgets={},d._overlayWidgets={},h=Array.isArray(i.contributions)?i.contributions:$d.getEditorContributions();for(var f=0,p=h.length;f1),this._hasNonEmptySelection.set(e.some((function(e){return!e.isEmpty()})))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())},t.prototype._updateFromFocus=function(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())},t.prototype._updateFromModel=function(){var e=this._editor.getModel();this._canUndo.set(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))},t}(S),jS=function(e){function t(t,n){var i=e.call(this)||this;i._editor=t,i._langId=gb.languageId.bindTo(n),i._hasCompletionItemProvider=gb.hasCompletionItemProvider.bindTo(n),i._hasCodeActionsProvider=gb.hasCodeActionsProvider.bindTo(n),i._hasCodeLensProvider=gb.hasCodeLensProvider.bindTo(n),i._hasDefinitionProvider=gb.hasDefinitionProvider.bindTo(n),i._hasImplementationProvider=gb.hasImplementationProvider.bindTo(n),i._hasTypeDefinitionProvider=gb.hasTypeDefinitionProvider.bindTo(n),i._hasHoverProvider=gb.hasHoverProvider.bindTo(n),i._hasDocumentHighlightProvider=gb.hasDocumentHighlightProvider.bindTo(n),i._hasDocumentSymbolProvider=gb.hasDocumentSymbolProvider.bindTo(n),i._hasReferenceProvider=gb.hasReferenceProvider.bindTo(n),i._hasRenameProvider=gb.hasRenameProvider.bindTo(n),i._hasDocumentFormattingProvider=gb.hasDocumentFormattingProvider.bindTo(n),i._hasDocumentSelectionFormattingProvider=gb.hasDocumentSelectionFormattingProvider.bindTo(n),i._hasSignatureHelpProvider=gb.hasSignatureHelpProvider.bindTo(n),i._isInWalkThrough=gb.isInEmbeddedEditor.bindTo(n);var o=function(){return i._update()};return i._register(t.onDidChangeModel(o)),i._register(t.onDidChangeModelLanguage(o)),i._register(Pa.onDidChange(o)),i._register(za.onDidChange(o)),i._register(ja.onDidChange(o)),i._register(Va.onDidChange(o)),i._register(Ba.onDidChange(o)),i._register(Ha.onDidChange(o)),i._register(Ra.onDidChange(o)),i._register(Wa.onDidChange(o)),i._register(Fa.onDidChange(o)),i._register(Ma.onDidChange(o)),i._register(Ta.onDidChange(o)),i._register(Ua.onDidChange(o)),i._register($a.onDidChange(o)),i._register(Aa.onDidChange(o)),o(),i}return TS(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.reset=function(){this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()},t.prototype._update=function(){var e=this._editor.getModel();e?(this._langId.set(e.getLanguageIdentifier().language),this._hasCompletionItemProvider.set(Pa.has(e)),this._hasCodeActionsProvider.set(za.has(e)),this._hasCodeLensProvider.set(ja.has(e)),this._hasDefinitionProvider.set(Va.has(e)),this._hasImplementationProvider.set(Ba.has(e)),this._hasTypeDefinitionProvider.set(Ha.has(e)),this._hasHoverProvider.set(Ra.has(e)),this._hasDocumentHighlightProvider.set(Wa.has(e)),this._hasDocumentSymbolProvider.set(Fa.has(e)),this._hasReferenceProvider.set(Ma.has(e)),this._hasRenameProvider.set(Ta.has(e)),this._hasSignatureHelpProvider.set(Aa.has(e)),this._hasDocumentFormattingProvider.set(Ua.has(e)||$a.has(e)),this._hasDocumentSelectionFormattingProvider.set($a.has(e)),this._isInWalkThrough.set(e.uri.scheme===Mo.walkThroughSnippet)):this.reset()},t}(S),zS=function(e){function t(t){var n=e.call(this)||this;return n._onChange=n._register(new T),n.onChange=n._onChange.event,n._hasFocus=!1,n._domFocusTracker=n._register(Do(t)),n._register(n._domFocusTracker.onDidFocus((function(){n._hasFocus=!0,n._onChange.fire(void 0)}))),n._register(n._domFocusTracker.onDidBlur((function(){n._hasFocus=!1,n._onChange.fire(void 0)}))),n}return TS(t,e),t.prototype.hasFocus=function(){return this._hasFocus},t}(S),US=encodeURIComponent("");function KS(e){return US+encodeURIComponent(e.toString())+$S}var qS=encodeURIComponent('');function YS(e){return qS+encodeURIComponent(e.toString())+GS}Zf((function(e,t){var n=e.getColor(Km);n&&t.addRule(".monaco-editor .squiggly-error { border-bottom: 4px double "+n+"; }");var i=e.getColor($m);i&&t.addRule('.monaco-editor .squiggly-error { background: url("data:image/svg+xml,'+KS(i)+'") repeat-x bottom left; }');var o=e.getColor(Gm);o&&t.addRule(".monaco-editor .squiggly-warning { border-bottom: 4px double "+o+"; }");var r=e.getColor(qm);r&&t.addRule('.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,'+KS(r)+'") repeat-x bottom left; }');var s=e.getColor(Zm);s&&t.addRule(".monaco-editor .squiggly-info { border-bottom: 4px double "+s+"; }");var a=e.getColor(Ym);a&&t.addRule('.monaco-editor .squiggly-info { background: url("data:image/svg+xml,'+KS(a)+'") repeat-x bottom left; }');var u=e.getColor(Jm);u&&t.addRule(".monaco-editor .squiggly-hint { border-bottom: 2px dotted "+u+"; }");var l=e.getColor(Xm);l&&t.addRule('.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,'+YS(l)+'") no-repeat bottom left; }');var c=e.getColor(ev);c&&t.addRule("."+FS+" .monaco-editor .squiggly-inline-unnecessary { opacity: "+c.rgba.a+"; will-change: opacity; }");var h=e.getColor(Qm);h&&t.addRule("."+FS+" .monaco-editor .squiggly-unnecessary { border-bottom: 2px dashed "+h+"; }")}));n("94a7"),n("ba77");var ZS=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),XS=!1,JS=function(e){function t(t,n,i){void 0===i&&(i={});var r=e.call(this)||this;return r._state=3,r._onDidEnablementChange=r._register(new T),r.onDidEnablementChange=r._onDidEnablementChange.event,r._onDidStart=r._register(new T),r.onDidStart=r._onDidStart.event,r._onDidChange=r._register(new T),r.onDidChange=r._onDidChange.event,r._onDidReset=r._register(new T),r.onDidReset=r._onDidReset.event,r._onDidEnd=r._register(new T),r.onDidEnd=r._onDidEnd.event,r.linkedSash=void 0,r.orthogonalStartSashDisposables=[],r.orthogonalEndSashDisposables=[],r.el=Io(t,Po(".monaco-sash")),o["d"]&&Ri(r.el,"mac"),r._register(li(r.el,"mousedown")(r.onMouseDown,r)),r._register(li(r.el,"dblclick")(r.onMouseDoubleClick,r)),_f.addTarget(r.el),r._register(li(r.el,gf.Start)(r.onTouchStart,r)),si&&Ri(r.el,"touch"),r.setOrientation(i.orientation||0),r.hidden=!1,r.layoutProvider=n,r.orthogonalStartSash=i.orthogonalStartSash,r.orthogonalEndSash=i.orthogonalEndSash,Bi(r.el,"debug",XS),r}return ZS(t,e),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){this._state!==e&&(Bi(this.el,"disabled",0===e),Bi(this.el,"minimum",1===e),Bi(this.el,"maximum",2===e),this._state=e,this._onDidEnablementChange.fire(e))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"orthogonalStartSash",{get:function(){return this._orthogonalStartSash},set:function(e){this.orthogonalStartSashDisposables=y(this.orthogonalStartSashDisposables),e?(e.onDidEnablementChange(this.onOrthogonalStartSashEnablementChange,this,this.orthogonalStartSashDisposables),this.onOrthogonalStartSashEnablementChange(e.state)):this.onOrthogonalStartSashEnablementChange(0),this._orthogonalStartSash=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"orthogonalEndSash",{get:function(){return this._orthogonalEndSash},set:function(e){this.orthogonalEndSashDisposables=y(this.orthogonalEndSashDisposables),e?(e.onDidEnablementChange(this.onOrthogonalEndSashEnablementChange,this,this.orthogonalEndSashDisposables),this.onOrthogonalEndSashEnablementChange(e.state)):this.onOrthogonalEndSashEnablementChange(0),this._orthogonalEndSash=e},enumerable:!0,configurable:!0}),t.prototype.setOrientation=function(e){this.orientation=e,1===this.orientation?(Ri(this.el,"horizontal"),Wi(this.el,"vertical")):(Wi(this.el,"horizontal"),Ri(this.el,"vertical")),this.layoutProvider&&this.layout()},t.prototype.onMouseDown=function(e){var t=this;ko.stop(e,!1);var n=!1;if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onMouseDown(e)),!e.__orthogonalSashEvent){var i=void 0;0===this.orientation?e.offsetY<=4?i=this.orthogonalStartSash:e.offsetY>=this.el.clientHeight-4&&(i=this.orthogonalEndSash):e.offsetX<=4?i=this.orthogonalStartSash:e.offsetX>=this.el.clientWidth-4&&(i=this.orthogonalEndSash),i&&(n=!0,e.__orthogonalSashEvent=!0,i.onMouseDown(e))}if(this.state){for(var r=Vo("iframe"),s=0,a=r;s0){n=o[0].getStartPosition();var r=t.getTopForPosition(n.lineNumber,n.column);i=t.getScrollTop()-r}}return new e(n,i)},e.prototype.restore=function(e){if(this._visiblePosition){var t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}},e}(),tx=(n("0d30e"),n("c84a"),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),nx=function(e){function t(t,n,i){var o=e.call(this)||this;return o.options=i,o._context=t||o,o._action=n,n instanceof vh&&o._register(n.onDidChange((function(e){o.element&&o.handleActionChangeEvent(e)}))),o}return tx(t,e),t.prototype.handleActionChangeEvent=function(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()},Object.defineProperty(t.prototype,"actionRunner",{get:function(){return this._actionRunner},set:function(e){this._actionRunner=e},enumerable:!0,configurable:!0}),t.prototype.getAction=function(){return this._action},t.prototype.isEnabled=function(){return this._action.enabled},t.prototype.setActionContext=function(e){this._context=e},t.prototype.render=function(e){var t=this;this.element=e,_f.addTarget(e);var n=this.options&&this.options.draggable;n&&(e.draggable=!0),this._register(ji(this.element,gf.Tap,(function(e){return t.onClick(e)}))),this._register(ji(this.element,Lo.MOUSE_DOWN,(function(e){n||ko.stop(e,!0);var i=e;t._action.enabled&&0===i.button&&Ri(t.element,"active")}))),this._register(ji(this.element,Lo.CLICK,(function(e){ko.stop(e,!0),t.options&&t.options.isMenu?t.onClick(e):o["h"]((function(){return t.onClick(e)}))}))),this._register(ji(this.element,Lo.DBLCLICK,(function(e){ko.stop(e,!0)}))),[Lo.MOUSE_UP,Lo.MOUSE_OUT].forEach((function(e){t._register(ji(t.element,e,(function(e){ko.stop(e),Wi(t.element,"active")})))}))},t.prototype.onClick=function(e){var t;ko.stop(e,!0),Te(this._context)?t=e:(t=this._context,Oe(t)&&(t.event=e)),this._actionRunner.run(this._action,t)},t.prototype.focus=function(){this.element&&(this.element.focus(),Ri(this.element,"focused"))},t.prototype.blur=function(){this.element&&(this.element.blur(),Wi(this.element,"focused"))},t.prototype.updateEnabled=function(){},t.prototype.updateLabel=function(){},t.prototype.updateTooltip=function(){},t.prototype.updateClass=function(){},t.prototype.updateChecked=function(){},t.prototype.dispose=function(){this.element&&(Di(this.element),this.element=null),e.prototype.dispose.call(this)},t}(S),ix=function(e){function t(n){var i=e.call(this,t.ID,n,n?"separator text":"separator")||this;return i.checked=!1,i.radio=!1,i.enabled=!1,i}return tx(t,e),t.ID="vs.actions.separator",t}(vh),ox=function(e){function t(t,n,i){void 0===i&&(i={});var o=e.call(this,t,n,i)||this;return o.options=i,o.options.icon=void 0!==i.icon&&i.icon,o.options.label=void 0===i.label||i.label,o.cssClass="",o}return tx(t,e),t.prototype.render=function(t){e.prototype.render.call(this,t),this.label=Io(this.element,Po("a.action-label")),this._action.id===ix.ID?this.label.setAttribute("role","presentation"):this.options.isMenu?this.label.setAttribute("role","menuitem"):this.label.setAttribute("role","button"),this.options.label&&this.options.keybinding&&(Io(this.element,Po("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()},t.prototype.focus=function(){e.prototype.focus.call(this),this.label.focus()},t.prototype.updateLabel=function(){this.options.label&&(this.label.textContent=this.getAction().label)},t.prototype.updateTooltip=function(){var e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=le({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e&&(this.label.title=e)},t.prototype.updateClass=function(){this.cssClass&&Vi(this.label,this.cssClass),this.options.icon?(this.cssClass=this.getAction().class,Ri(this.label,"icon"),this.cssClass&&Fi(this.label,this.cssClass),this.updateEnabled()):Wi(this.label,"icon")},t.prototype.updateEnabled=function(){this.getAction().enabled?(this.label.removeAttribute("aria-disabled"),Wi(this.element,"disabled"),Wi(this.label,"disabled"),this.label.tabIndex=0):(this.label.setAttribute("aria-disabled","true"),Ri(this.element,"disabled"),Ri(this.label,"disabled"),Wo(this.label))},t.prototype.updateChecked=function(){this.getAction().checked?Ri(this.label,"checked"):Wi(this.label,"checked")},t}(nx),rx={orientation:0,context:null,triggerKeys:{keys:[3,10],keyDown:!1}},sx=function(e){function t(t,n){void 0===n&&(n=rx);var i,o,r=e.call(this)||this;switch(r._onDidBlur=r._register(new T),r._onDidCancel=r._register(new T),r._onDidRun=r._register(new T),r._onDidBeforeRun=r._register(new T),r.options=n,r._context=n.context,r._actionRunner=r.options.actionRunner,r.options.triggerKeys||(r.options.triggerKeys=rx.triggerKeys),r._actionRunner||(r._actionRunner=new _h,r._register(r._actionRunner)),r._register(r._actionRunner.onDidRun((function(e){return r._onDidRun.fire(e)}))),r._register(r._actionRunner.onDidBeforeRun((function(e){return r._onDidBeforeRun.fire(e)}))),r.items=[],r.focusedItem=void 0,r.domNode=document.createElement("div"),r.domNode.className="monaco-action-bar",!1!==n.animated&&Ri(r.domNode,"animated"),r.options.orientation){case 0:i=15,o=17;break;case 1:i=17,o=15,r.domNode.className+=" reverse";break;case 2:i=16,o=18,r.domNode.className+=" vertical";break;case 3:i=18,o=16,r.domNode.className+=" vertical reverse";break}return r._register(ji(r.domNode,Lo.KEY_DOWN,(function(e){var t=new _i(e),n=!0;t.equals(i)?r.focusPrevious():t.equals(o)?r.focusNext():t.equals(9)?r.cancel():r.isTriggerKeyEvent(t)?r.options.triggerKeys&&r.options.triggerKeys.keyDown&&r.doTrigger(t):n=!1,n&&(t.preventDefault(),t.stopPropagation())}))),r._register(ji(r.domNode,Lo.KEY_UP,(function(e){var t=new _i(e);r.isTriggerKeyEvent(t)?(r.options.triggerKeys.keyDown||r.doTrigger(t),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026))&&r.updateFocusedItem()}))),r.focusTracker=r._register(Do(r.domNode)),r._register(r.focusTracker.onDidBlur((function(){document.activeElement!==r.domNode&&mo(document.activeElement,r.domNode)||(r._onDidBlur.fire(),r.focusedItem=void 0)}))),r._register(r.focusTracker.onDidFocus((function(){return r.updateFocusedItem()}))),r.actionsList=document.createElement("ul"),r.actionsList.className="actions-container",r.actionsList.setAttribute("role","toolbar"),r.options.ariaLabel&&r.actionsList.setAttribute("aria-label",r.options.ariaLabel),r.domNode.appendChild(r.actionsList),t.appendChild(r.domNode),r}return tx(t,e),Object.defineProperty(t.prototype,"onDidBlur",{get:function(){return this._onDidBlur.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onDidCancel",{get:function(){return this._onDidCancel.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onDidRun",{get:function(){return this._onDidRun.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onDidBeforeRun",{get:function(){return this._onDidBeforeRun.event},enumerable:!0,configurable:!0}),t.prototype.isTriggerKeyEvent=function(e){var t=!1;return this.options.triggerKeys&&this.options.triggerKeys.keys.forEach((function(n){t=t||e.equals(n)})),t},t.prototype.updateFocusedItem=function(){for(var e=0;e=n.actionsList.children.length?(n.actionsList.appendChild(i),n.items.push(r)):(n.actionsList.insertBefore(i,n.actionsList.children[o]),n.items.splice(o,0,r),o++)}))},t.prototype.clear=function(){this.items=y(this.items),Oi(this.actionsList)},t.prototype.isEmpty=function(){return 0===this.items.length},t.prototype.focus=function(e){e&&"undefined"===typeof this.focusedItem?(this.focusedItem=this.items.length-1,this.focusNext()):this.updateFocus()},t.prototype.focusNext=function(){"undefined"===typeof this.focusedItem&&(this.focusedItem=this.items.length-1);var e,t=this.focusedItem;do{this.focusedItem=(this.focusedItem+1)%this.items.length,e=this.items[this.focusedItem]}while(this.focusedItem!==t&&!e.isEnabled());this.focusedItem!==t||e.isEnabled()||(this.focusedItem=void 0),this.updateFocus()},t.prototype.focusPrevious=function(){"undefined"===typeof this.focusedItem&&(this.focusedItem=0);var e,t=this.focusedItem;do{this.focusedItem=this.focusedItem-1,this.focusedItem<0&&(this.focusedItem=this.items.length-1),e=this.items[this.focusedItem]}while(this.focusedItem!==t&&!e.isEnabled());this.focusedItem!==t||e.isEnabled()||(this.focusedItem=void 0),this.updateFocus(!0)},t.prototype.updateFocus=function(e){"undefined"===typeof this.focusedItem&&this.actionsList.focus();for(var t=0;t0){var _=e[r-1];m=0===_.originalEndLineNumber?_.originalStartLineNumber+1:_.originalEndLineNumber+1,v=0===_.modifiedEndLineNumber?_.modifiedStartLineNumber+1:_.modifiedEndLineNumber+1}var y=p-ux+1,b=g-ux+1;if(yx){w=x-N;N+=w,E+=w}if(E>L){w=L-E;N+=w,E+=w}d[f++]=new lx(C,N,S,E),i[o++]=new cx(d)}var O=i[0].entries,D=[],I=0;for(r=1,s=i.length;rd)&&(d=y),0!==b&&(0===f||bp)&&(p=w)}var C=document.createElement("div");C.className="diff-review-row";var S=document.createElement("div");S.className="diff-review-cell diff-review-summary";var x=d-h+1,L=p-f+1;S.appendChild(document.createTextNode(u+1+"/"+this._diffs.length+": @@ -"+h+","+x+" +"+f+","+L+" @@")),C.setAttribute("data-line",String(f));var k=function(e){return 0===e?le("no_lines","no lines"):1===e?le("one_line","1 line"):le("more_lines","{0} lines",e)},N=k(x),E=k(L);C.setAttribute("aria-label",le({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines", "1 line" or "X lines", localized separately.']},"Difference {0} of {1}: original {2}, {3}, modified {4}, {5}",u+1,this._diffs.length,h,N,f,E)),C.appendChild(S),C.setAttribute("role","listitem"),c.appendChild(C);var O=f;for(g=0,m=l.length;g=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},vx=function(e,t){return function(n,i){t(n,i,e)}},_x=function(){function e(){this._zones=[],this._zonesMap={},this._decorations=[]}return e.prototype.getForeignViewZones=function(e){var t=this;return e.filter((function(e){return!t._zonesMap[String(e.id)]}))},e.prototype.clean=function(e){var t=this;this._zones.length>0&&e.changeViewZones((function(e){for(var n=0,i=t._zones.length;n0?o/n:0,s=Math.max(0,Math.floor(e.contentHeight*r)),a=Math.floor(t*r);return{height:s,top:a}},t.prototype._createDataSource=function(){var e=this;return{getWidth:function(){return e._width},getHeight:function(){return e._height-e._reviewHeight},getContainerDomNode:function(){return e._containerDomElement},relayoutEditors:function(){e._doLayout()},getOriginalEditor:function(){return e.originalEditor},getModifiedEditor:function(){return e.modifiedEditor}}},t.prototype._setStrategy=function(e){this._strategy&&this._strategy.dispose(),this._strategy=e,e.applyColors(this._themeService.getTheme()),this._diffComputationResult&&this._updateDecorations(),this._measureDomElement(!0)},t.prototype._getLineChangeAtOrBeforeLineNumber=function(e,t){var n=this._diffComputationResult?this._diffComputationResult.changes:[];if(0===n.length||e=a?i=r+1:(i=r,o=r)}return n[i]},t.prototype._getEquivalentLineForOriginalLineNumber=function(e){var t=this._getLineChangeAtOrBeforeLineNumber(e,(function(e){return e.originalStartLineNumber}));if(!t)return e;var n=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),i=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,r=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,s=e-n;return s<=o?i+Math.min(s,r):i+r-o+s},t.prototype._getEquivalentLineForModifiedLineNumber=function(e){var t=this._getLineChangeAtOrBeforeLineNumber(e,(function(e){return e.modifiedStartLineNumber}));if(!t)return e;var n=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),i=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,r=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,s=e-i;return s<=r?n+Math.min(s,o):n+o-r+s},t.prototype.getDiffLineInformationForOriginal=function(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForOriginalLineNumber(e)}:null},t.prototype.getDiffLineInformationForModified=function(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForModifiedLineNumber(e)}:null},t.ONE_OVERVIEW_WIDTH=15,t.ENTIRE_DIFF_OVERVIEW_WIDTH=30,t.UPDATE_DIFF_DECORATIONS_DELAY=200,t=mx([vx(2,ou),vx(3,ph),vx(4,Bn),vx(5,Un),vx(6,jf),vx(7,ud)],t),t}(S),wx=function(e){function t(t){var n=e.call(this)||this;return n._dataSource=t,n}return gx(t,e),t.prototype.applyColors=function(e){var t=(e.getColor(hm)||lm).transparent(2),n=(e.getColor(dm)||cm).transparent(2),i=!t.equals(this._insertColor)||!n.equals(this._removeColor);return this._insertColor=t,this._removeColor=n,i},t.prototype.getEditorsDiffDecorations=function(e,t,n,i,o,r,s){o=o.sort((function(e,t){return e.afterLineNumber-t.afterLineNumber})),i=i.sort((function(e,t){return e.afterLineNumber-t.afterLineNumber}));var a=this._getViewZones(e,i,o,r,s,n),u=this._getOriginalEditorDecorations(e,t,n,r,s),l=this._getModifiedEditorDecorations(e,t,n,r,s);return{original:{decorations:u.decorations,overviewZones:u.overviewZones,zones:a.original},modified:{decorations:l.decorations,overviewZones:l.overviewZones,zones:a.modified}}},t}(S),Cx=function(){function e(e){this._source=e,this._index=-1,this.advance()}return e.prototype.advance=function(){this._index++,this._index0){var n=e[e.length-1];if(n.afterLineNumber===t.afterLineNumber&&null===n.domNode)return void(n.heightInLines+=t.heightInLines)}e.push(t)},l=new Cx(this.modifiedForeignVZ),c=new Cx(this.originalForeignVZ),h=0,d=this.lineChanges.length;h<=d;h++){var f=h0?-1:0),o=f.modifiedStartLineNumber+(f.modifiedEndLineNumber>0?-1:0),n=f.originalEndLineNumber>0?f.originalEndLineNumber-f.originalStartLineNumber+1:0,t=f.modifiedEndLineNumber>0?f.modifiedEndLineNumber-f.modifiedStartLineNumber+1:0,r=Math.max(f.originalStartLineNumber,f.originalEndLineNumber),s=Math.max(f.modifiedStartLineNumber,f.modifiedEndLineNumber)):(i+=1e7+n,o+=1e7+t,r=i,s=o);var p=[],g=[];while(l.current&&l.current.afterLineNumber<=s){var m=void 0;m=l.current.afterLineNumber<=o?i-o+l.current.afterLineNumber:r;var v=null;f&&f.modifiedStartLineNumber<=l.current.afterLineNumber&&l.current.afterLineNumber<=f.modifiedEndLineNumber&&(v=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),p.push({afterLineNumber:m,heightInLines:l.current.heightInLines,domNode:null,marginDomNode:v}),l.advance()}while(c.current&&c.current.afterLineNumber<=r){m=void 0;m=c.current.afterLineNumber<=i?o-i+c.current.afterLineNumber:s,g.push({afterLineNumber:m,heightInLines:c.current.heightInLines,domNode:null}),c.advance()}if(null!==f&&Dx(f)){var _=this._produceOriginalFromDiff(f,n,t);_&&p.push(_)}if(null!==f&&Ix(f)){_=this._produceModifiedFromDiff(f,n,t);_&&g.push(_)}var y=0,b=0;p=p.sort(a),g=g.sort(a);while(y=C.heightInLines?(w.heightInLines-=C.heightInLines,b++):(C.heightInLines-=w.heightInLines,y++)}while(y2*t.MINIMUM_EDITOR_WIDTH?(oi-t.MINIMUM_EDITOR_WIDTH&&(o=i-t.MINIMUM_EDITOR_WIDTH)):o=r,this._sashPosition!==o&&(this._sashPosition=o,this._sash.layout()),this._sashPosition},t.prototype.onSashDragStart=function(){this._startSashPosition=this._sashPosition},t.prototype.onSashDrag=function(e){var t=this._dataSource.getWidth(),n=t-bx.ENTIRE_DIFF_OVERVIEW_WIDTH,i=this.layout((this._startSashPosition+(e.currentX-e.startX))/n);this._sashRatio=i/n,this._dataSource.relayoutEditors()},t.prototype.onSashDragEnd=function(){this._sash.layout()},t.prototype.onSashReset=function(){this._sashRatio=.5,this._dataSource.relayoutEditors(),this._sash.layout()},t.prototype.getVerticalSashTop=function(e){return 0},t.prototype.getVerticalSashLeft=function(e){return this._sashPosition},t.prototype.getVerticalSashHeight=function(e){return this._dataSource.getHeight()},t.prototype._getViewZones=function(e,t,n,i,o){var r=new Nx(e,t,n);return r.getViewZones()},t.prototype._getOriginalEditorDecorations=function(e,t,n,i,o){for(var r=this._removeColor.toString(),s={decorations:[],overviewZones:[]},a=i.getModel(),u=0,l=e.length;ut?{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:n-t,domNode:null}:null},t.prototype._produceModifiedFromDiff=function(e,t,n){return t>n?{afterLineNumber:Math.max(e.modifiedStartLineNumber,e.modifiedEndLineNumber),heightInLines:t-n,domNode:null}:null},t}(Sx),Ex=function(e){function t(t,n){var i=e.call(this,t)||this;return i.decorationsLeft=t.getOriginalEditor().getLayoutInfo().decorationsLeft,i._register(t.getOriginalEditor().onDidLayoutChange((function(e){i.decorationsLeft!==e.decorationsLeft&&(i.decorationsLeft=e.decorationsLeft,t.relayoutEditors())}))),i}return gx(t,e),t.prototype.setEnableSplitViewResizing=function(e){},t.prototype._getViewZones=function(e,t,n,i,o,r){var s=new Ox(e,t,n,i,o,r);return s.getViewZones()},t.prototype._getOriginalEditorDecorations=function(e,t,n,i,o){for(var r=this._removeColor.toString(),s={decorations:[],overviewZones:[]},a=0,u=e.length;a'])}d+=this.modifiedEditorConfiguration.viewInfo.scrollBeyondLastColumn;var g=document.createElement("div");g.className="view-lines line-delete",g.innerHTML=a.build(),Xd.applyFontInfoSlow(g,this.modifiedEditorConfiguration.fontInfo);var m=document.createElement("div");return m.className="inline-deleted-margin-view-zone",m.innerHTML=u.join(""),Xd.applyFontInfoSlow(m,this.modifiedEditorConfiguration.fontInfo),{shouldNotShrink:!0,afterLineNumber:0===e.modifiedEndLineNumber?e.modifiedStartLineNumber:e.modifiedStartLineNumber-1,heightInLines:t,minWidthInPx:d*h,domNode:g,marginDomNode:m}},t.prototype._renderOriginalLine=function(e,t,n,i,o,r,s){var a=t.getLineTokens(o),u=a.getLineContent(),l=Kl.filter(r,o,1,u.length+1);s.appendASCIIString('
');var c=pc.isBasicASCII(u,t.mightContainNonBasicASCII()),h=pc.containsRTL(u,c,t.mightContainRTL()),d=ec(new Xl(n.fontInfo.isMonospace&&!n.viewInfo.disableMonospaceOptimizations,n.fontInfo.canUseHalfwidthRightwardsArrow,u,!1,c,h,0,a,l,i,n.fontInfo.spaceWidth,n.viewInfo.stopRenderingLineAfter,n.viewInfo.renderWhitespace,n.viewInfo.renderControlCharacters,n.viewInfo.fontLigatures),s);s.appendASCIIString("
");var f=d.characterMapping.getAbsoluteOffsets();return f.length>0?f[f.length-1]:0},t}(Sx);function Dx(e){return e.modifiedEndLineNumber>0}function Ix(e){return e.originalEndLineNumber>0}function Mx(){var e=document.createElement("div");return e.className="diagonal-fill",e}Zf((function(e,t){var n=e.getColor(hm);n&&(t.addRule(".monaco-editor .line-insert, .monaco-editor .char-insert { background-color: "+n+"; }"),t.addRule(".monaco-diff-editor .line-insert, .monaco-diff-editor .char-insert { background-color: "+n+"; }"),t.addRule(".monaco-editor .inline-added-margin-view-zone { background-color: "+n+"; }"));var i=e.getColor(dm);i&&(t.addRule(".monaco-editor .line-delete, .monaco-editor .char-delete { background-color: "+i+"; }"),t.addRule(".monaco-diff-editor .line-delete, .monaco-diff-editor .char-delete { background-color: "+i+"; }"),t.addRule(".monaco-editor .inline-deleted-margin-view-zone { background-color: "+i+"; }"));var o=e.getColor(fm);o&&t.addRule(".monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px "+("hc"===e.type?"dashed":"solid")+" "+o+"; }");var r=e.getColor(pm);r&&t.addRule(".monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px "+("hc"===e.type?"dashed":"solid")+" "+r+"; }");var s=e.getColor(Ig);s&&t.addRule(".monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px "+s+"; }");var a=e.getColor(gm);a&&t.addRule(".monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid "+a+"; }")}));var Tx=jn("themeService"),Px=jn("contextViewService"),Ax=jn("contextMenuService"),Rx=jn("keybindingService"),Fx=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Wx=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},Vx=function(e,t){return function(n,i){t(n,i,e)}},Bx=0,Hx=!1;function jx(){Hx||(Hx=!0,Rd(document.body))}var zx=function(e){function t(t,n,i,o,r,s,a,u,l){var c=this;return n=n||{},n.ariaLabel=n.ariaLabel||le("editorViewAccessibleLabel","Editor content"),n.ariaLabel=n.ariaLabel+";"+(Qn?le("accessibilityHelpMessageIE","Press Ctrl+F1 for Accessibility Options."):le("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")),c=e.call(this,t,n,{},i,o,r,s,u,l)||this,a instanceof Cd&&(c._standaloneKeybindingService=a),jx(),c}return Fx(t,e),t.prototype.addCommand=function(e,t,n){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;var i="DYNAMIC_"+ ++Bx,o=rh.deserialize(n);return this._standaloneKeybindingService.addDynamicKeybinding(i,e,t,o),i},t.prototype.createContextKey=function(e,t){return this._contextKeyService.createKey(e,t)},t.prototype.addAction=function(e){var t=this;if("string"!==typeof e.id||"string"!==typeof e.label||"function"!==typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),S.None;var n=e.id,i=e.label,o=rh.and(rh.equals("editorId",this.getId()),rh.deserialize(e.precondition)),r=e.keybindings,s=rh.and(o,rh.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,u=e.contextMenuOrder||0,l=function(){return Promise.resolve(e.run(t))},c=[],h=this.getId()+":"+n;if(c.push(es.registerCommand(h,l)),a){var d={command:{id:h,title:i},when:o,group:a,order:u};c.push(Lh.appendMenuItem(Sh.EditorContext,d))}Array.isArray(r)&&(c=c.concat(r.map((function(e){return t._standaloneKeybindingService.addDynamicKeybinding(h,e,l,s)}))));var f=new oS(h,i,i,o,l,this._contextKeyService);return this._actions[n]=f,c.push(w((function(){delete t._actions[n]}))),b(c)},t=Wx([Vx(2,Bn),Vx(3,Un),Vx(4,Qr),Vx(5,ph),Vx(6,Rx),Vx(7,jf),Vx(8,ud)],t),t}(VS),Ux=function(e){function t(t,n,i,o,r,s,a,u,l,c,h,d){var f=this;Dd(d,n,!1),n=n||{},"string"===typeof n.theme&&c.setTheme(n.theme);var p,g=n.model;if(delete n.model,f=e.call(this,t,n,o,r,s,a,u,c,h)||this,f._contextViewService=l,f._configurationService=d,f._register(i),"undefined"===typeof g?(p=self.monaco.editor.createModel(n.value||"",n.language||"text/plain"),f._ownsModel=!0):(p=g,f._ownsModel=!1),f._attachModel(p),p){var m={oldModelUrl:null,newModelUrl:p.uri};f._onDidChangeModel.fire(m)}return f}return Fx(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.updateOptions=function(t){Dd(this._configurationService,t,!1),e.prototype.updateOptions.call(this,t)},t.prototype._attachModel=function(t){e.prototype._attachModel.call(this,t),this._modelData&&this._contextViewService.setContainer(this._modelData.view.domNode.domNode)},t.prototype._postDetachModelCleanup=function(t){e.prototype._postDetachModelCleanup.call(this,t),t&&this._ownsModel&&(t.dispose(),this._ownsModel=!1)},t=Wx([Vx(3,Bn),Vx(4,Un),Vx(5,Qr),Vx(6,ph),Vx(7,Rx),Vx(8,Px),Vx(9,Tx),Vx(10,ud),Vx(11,Mh)],t),t}(zx),$x=function(e){function t(t,n,i,o,r,s,a,u,l,c,h,d){var f=this;return Dd(d,n,!0),n=n||{},"string"===typeof n.theme&&(n.theme=c.setTheme(n.theme)),f=e.call(this,t,n,u,r,o,l,c,h)||this,f._contextViewService=a,f._configurationService=d,f._register(i),f._contextViewService.setContainer(f._containerDomElement),f}return Fx(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.updateOptions=function(t){Dd(this._configurationService,t,!0),e.prototype.updateOptions.call(this,t)},t.prototype._createInnerEditor=function(e,t,n){return e.createInstance(zx,t,n)},t.prototype.getOriginalEditor=function(){return e.prototype.getOriginalEditor.call(this)},t.prototype.getModifiedEditor=function(){return e.prototype.getModifiedEditor.call(this)},t.prototype.addCommand=function(e,t,n){return this.getModifiedEditor().addCommand(e,t,n)},t.prototype.createContextKey=function(e,t){return this.getModifiedEditor().createContextKey(e,t)},t.prototype.addAction=function(e){return this.getModifiedEditor().addAction(e)},t=Wx([Vx(3,Bn),Vx(4,ph),Vx(5,Rx),Vx(6,Px),Vx(7,ou),Vx(8,Un),Vx(9,Tx),Vx(10,ud),Vx(11,Mh)],t),t}(bx),Kx=jn("IWorkspaceEditService"),qx=jn("modeService"),Gx=function(){function e(e){this._languageIdentifier=e}return e.prototype.getId=function(){return this._languageIdentifier.language},e}(),Yx="text/plain",Zx="application/unknown",Xx=[],Jx=[],Qx=[];function eL(e,t){void 0===t&&(t=!1);var n=tL(e);Xx.push(n),n.userConfigured?Qx.push(n):Jx.push(n),t&&!n.userConfigured&&Xx.forEach((function(e){e.mime===n.mime||e.userConfigured||(n.extension&&e.extension===n.extension&&console.warn("Overwriting extension <<"+n.extension+">> to now point to mime <<"+n.mime+">>"),n.filename&&e.filename===n.filename&&console.warn("Overwriting filename <<"+n.filename+">> to now point to mime <<"+n.mime+">>"),n.filepattern&&e.filepattern===n.filepattern&&console.warn("Overwriting filepattern <<"+n.filepattern+">> to now point to mime <<"+n.mime+">>"),n.firstline&&e.firstline===n.firstline&&console.warn("Overwriting firstline <<"+n.firstline+">> to now point to mime <<"+n.mime+">>"))}))}function tL(e){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:e.userConfigured,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?e.filepattern.toLowerCase():void 0,filepatternOnPath:!!e.filepattern&&e.filepattern.indexOf(Ir)>=0}}function nL(e,t){if(!e)return[Zx];e=e.toLowerCase();var n=Pr(e),i=iL(e,n,Qx);if(i)return[i,Yx];var o=iL(e,n,Jx);if(o)return[o,Yx];if(t){var r=oL(t);if(r)return[r,Yx]}return[Zx]}function iL(e,t,n){for(var i=null,o=null,r=null,s=n.length-1;s>=0;s--){var a=n[s];if(t===a.filenameLowercase){i=a;break}if(a.filepattern&&(!o||a.filepattern.length>o.filepattern.length)){var u=a.filepatternOnPath?e:t;ha(a.filepatternLowercase,u)&&(o=a)}a.extension&&(!r||a.extension.length>r.extension.length)&&nr(t,a.extensionLowercase)&&(r=a)}return i?i.mime:o?o.mime:r?r.mime:null}function oL(e){if(Er(e)&&(e=e.substr(1)),e.length>0)for(var t=0;t0)return n.mime}}return null}var rL={ModesRegistry:"editor.modesRegistry"},sL=function(){function e(){this._onDidAddLanguages=new T,this.onDidAddLanguages=this._onDidAddLanguages.event,this._languages=[]}return e.prototype.registerLanguage=function(e){this._languages.push(e),this._onDidAddLanguages.fire([e])},e.prototype.getLanguages=function(){return this._languages.slice(0)},e}(),aL=new sL;xc.add(rL.ModesRegistry,aL);var uL="plaintext",lL=new La(uL,1);aL.registerLanguage({id:uL,extensions:[".txt",".gitignore"],aliases:[le("plainText.alias","Plain Text"),"text"],mimetypes:["text/plain"]}),Wu.register(lL,{brackets:[["(",")"],["[","]"],["{","}"]]});var cL,hL,dL=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),fL=Object.prototype.hasOwnProperty,pL=function(e){function t(t,n){void 0===t&&(t=!0),void 0===n&&(n=!1);var i=e.call(this)||this;return i._onDidChange=i._register(new T),i.onDidChange=i._onDidChange.event,i._nextLanguageId=1,i._languages={},i._mimeTypesMap={},i._nameMap={},i._lowercaseNameMap={},i._languageIds=[],i._warnOnOverwrite=n,t&&(i._registerLanguages(aL.getLanguages()),i._register(aL.onDidAddLanguages((function(e){return i._registerLanguages(e)})))),i}return dL(t,e),t.prototype._registerLanguages=function(e){var t=this;if(0!==e.length){for(var n=0;n0&&((n=e.mimetypes).push.apply(n,t.mimetypes),o=t.mimetypes[0]),o||(o="text/x-"+i,e.mimetypes.push(o)),Array.isArray(t.extensions))for(var r=0,s=t.extensions;r0){var g=t.firstLine;"^"!==g.charAt(0)&&(g="^"+g);try{var m=new RegExp(g);or(m)||eL({id:i,mime:o,firstline:m},this._warnOnOverwrite)}catch(C){l(C)}}e.aliases.push(i);var v=null;if("undefined"!==typeof t.aliases&&Array.isArray(t.aliases)&&(v=0===t.aliases.length?[null]:t.aliases),null!==v)for(var _=0;_0;if(b&&null===v[0]);else{var w=(b?v[0]:null)||i;!b&&e.name||(e.name=w)}t.configuration&&e.configurationFiles.push(t.configuration)},t.prototype.isRegisteredMode=function(e){return!!fL.call(this._mimeTypesMap,e)||fL.call(this._languages,e)},t.prototype.getModeIdForLanguageNameLowercase=function(e){return fL.call(this._lowercaseNameMap,e)?this._lowercaseNameMap[e].language:null},t.prototype.extractModeIds=function(e){var t=this;return e?e.split(",").map((function(e){return e.trim()})).map((function(e){return fL.call(t._mimeTypesMap,e)?t._mimeTypesMap[e].language:e})).filter((function(e){return fL.call(t._languages,e)})):[]},t.prototype.getLanguageIdentifier=function(e){if(e===Qa||0===e)return eu;var t;if("string"===typeof e)t=e;else if(t=this._languageIds[e],!t)return null;return fL.call(this._languages,t)?this._languages[t].identifier:null},t.prototype.getModeIdsFromFilepathOrFirstLine=function(e,t){if(!e&&!t)return[];var n=nL(e,t);return this.extractModeIds(n.join(","))},t}(S),gL=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),mL=function(e){function t(t,n){var i=e.call(this)||this;return i._onDidChange=i._register(new T),i.onDidChange=i._onDidChange.event,i._selector=n,i.languageIdentifier=i._selector(),i._register(t((function(){return i._evaluate()}))),i}return gL(t,e),t.prototype._evaluate=function(){var e=this._selector();e.id!==this.languageIdentifier.id&&(this.languageIdentifier=e,this._onDidChange.fire(this.languageIdentifier))},t}(S),vL=function(){function e(e){void 0===e&&(e=!1);var t=this;this._onDidCreateMode=new T,this.onDidCreateMode=this._onDidCreateMode.event,this._onLanguagesMaybeChanged=new T,this.onLanguagesMaybeChanged=this._onLanguagesMaybeChanged.event,this._instantiatedModes={},this._registry=new pL(!0,e),this._registry.onDidChange((function(){return t._onLanguagesMaybeChanged.fire()}))}return e.prototype.isRegisteredMode=function(e){return this._registry.isRegisteredMode(e)},e.prototype.getModeIdForLanguageName=function(e){return this._registry.getModeIdForLanguageNameLowercase(e)},e.prototype.getModeIdByFilepathOrFirstLine=function(e,t){var n=this._registry.getModeIdsFromFilepathOrFirstLine(e,t);return n.length>0?n[0]:null},e.prototype.getModeId=function(e){var t=this._registry.extractModeIds(e);return t.length>0?t[0]:null},e.prototype.getLanguageIdentifier=function(e){return this._registry.getLanguageIdentifier(e)},e.prototype.create=function(e){var t=this;return new mL(this.onLanguagesMaybeChanged,(function(){var n=t.getModeId(e);return t._createModeAndGetLanguageIdentifier(n)}))},e.prototype.createByFilepathOrFirstLine=function(e,t){var n=this;return new mL(this.onLanguagesMaybeChanged,(function(){var i=n.getModeIdByFilepathOrFirstLine(e,t);return n._createModeAndGetLanguageIdentifier(i)}))},e.prototype._createModeAndGetLanguageIdentifier=function(e){var t=this.getLanguageIdentifier(e||"plaintext")||eu;return this._getOrCreateMode(t.language),t},e.prototype.triggerMode=function(e){var t=this.getModeId(e);this._getOrCreateMode(t||"plaintext")},e.prototype._getOrCreateMode=function(e){if(!this._instantiatedModes.hasOwnProperty(e)){var t=this.getLanguageIdentifier(e)||eu;this._instantiatedModes[e]=new Gx(t),this._onDidCreateMode.fire(this._instantiatedModes[e])}return this._instantiatedModes[e]},e}(),_L=function(){function e(e){void 0===e&&(e=""),this.value=e}return e.prototype.appendText=function(e){return this.value+=e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&"),this},e.prototype.appendMarkdown=function(e){return this.value+=e,this},e.prototype.appendCodeblock=function(e,t){return this.value+="\n```",this.value+=e,this.value+="\n",this.value+=t,this.value+="\n```\n",this},e}();function yL(e){return bL(e)?!e.value:!Array.isArray(e)||e.every(yL)}function bL(e){return e instanceof _L||!(!e||"object"!==typeof e)&&("string"===typeof e.value&&("boolean"===typeof e.isTrusted||void 0===e.isTrusted))}function wL(e,t){return!e&&!t||!(!e||!t)&&(Array.isArray(e)&&Array.isArray(t)?he(e,t,CL):!(!bL(e)||!bL(t))&&CL(e,t))}function CL(e,t){return e===t||!(!e||!t)&&(e.value===t.value&&e.isTrusted===t.isTrusted)}function SL(e){return e?e.replace(/\\([\\`*_{}[\]()#+\-.!])/g,"$1"):e}(function(e){e[e["Hint"]=1]="Hint",e[e["Info"]=2]="Info",e[e["Warning"]=4]="Warning",e[e["Error"]=8]="Error"})(cL||(cL={})),function(e){function t(e,t){return t-e}e.compare=t;var n=Object.create(null);function i(e){return n[e]||""}function o(t){switch(t){case wc.Error:return e.Error;case wc.Warning:return e.Warning;case wc.Info:return e.Info;case wc.Ignore:return e.Hint}}n[e.Error]=le("sev.error","Error"),n[e.Warning]=le("sev.warning","Warning"),n[e.Info]=le("sev.info","Info"),e.toString=i,e.fromSeverity=o}(cL||(cL={})),function(e){var t="";function n(e){var n=[t];return e.source?n.push(e.source.replace("¦","¦")):n.push(t),e.code?n.push(e.code.replace("¦","¦")):n.push(t),void 0!==e.severity&&null!==e.severity?n.push(cL.toString(e.severity)):n.push(t),e.message?n.push(e.message.replace("¦","¦")):n.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?n.push(e.startLineNumber.toString()):n.push(t),void 0!==e.startColumn&&null!==e.startColumn?n.push(e.startColumn.toString()):n.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?n.push(e.endLineNumber.toString()):n.push(t),void 0!==e.endColumn&&null!==e.endColumn?n.push(e.endColumn.toString()):n.push(t),n.push(t),n.join("¦")}e.makeKey=n}(hL||(hL={}));var xL=jn("markerService"),LL=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),kL=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},NL=function(e,t){return function(n,i){t(n,i,e)}};function EL(e){return e.toString()}var OL=function(){function e(e,t,n){this.model=e,this._languageSelection=null,this._languageSelectionListener=null,this._markerDecorations=[],this._modelEventListeners=[],this._modelEventListeners.push(e.onWillDispose((function(){return t(e)}))),this._modelEventListeners.push(e.onDidChangeLanguage((function(t){return n(e,t)})))}return e.prototype._disposeLanguageSelection=function(){this._languageSelectionListener&&(this._languageSelectionListener.dispose(),this._languageSelectionListener=null),this._languageSelection&&(this._languageSelection.dispose(),this._languageSelection=null)},e.prototype.dispose=function(){this._markerDecorations=this.model.deltaDecorations(this._markerDecorations,[]),this._modelEventListeners=y(this._modelEventListeners),this._disposeLanguageSelection()},e.prototype.acceptMarkerDecorations=function(e){this._markerDecorations=this.model.deltaDecorations(this._markerDecorations,e)},e.prototype.setLanguage=function(e){var t=this;this._disposeLanguageSelection(),this._languageSelection=e,this._languageSelectionListener=this._languageSelection.onDidChange((function(){return t.model.setMode(e.languageIdentifier)})),this.model.setMode(e.languageIdentifier)},e}(),DL=function(){function e(){}return e.setMarkers=function(t,n){var i=n.read({resource:t.model.uri,take:500}),o=i.map((function(n){return{range:e._createDecorationRange(t.model,n),options:e._createDecorationOption(n)}}));t.acceptMarkerDecorations(o)},e._createDecorationRange=function(e,t){var n=In.lift(t);if(t.severity===cL.Hint&&(t.tags&&-1!==t.tags.indexOf(1)||(n=n.setEndPosition(n.startLineNumber,n.startColumn+2))),n=e.validateRange(n),n.isEmpty()){var i=e.getWordAtPosition(n.getStartPosition());if(i)n=new In(n.startLineNumber,i.startColumn,n.endLineNumber,i.endColumn);else{var o=e.getLineLastNonWhitespaceColumn(n.startLineNumber)||e.getLineMaxColumn(n.startLineNumber);1===o||(n=n.endColumn>=o?new In(n.startLineNumber,o-1,n.endLineNumber,o):new In(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn+1))}}else if(t.endColumn===Number.MAX_VALUE&&1===t.startColumn&&n.startLineNumber===n.endLineNumber){var r=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);r=0?"squiggly-unnecessary":"squiggly-hint",n=0;break;case cL.Warning:t="squiggly-warning",i=zf(nv),n=20;break;case cL.Info:t="squiggly-info",i=zf(iv),n=10;break;case cL.Error:default:t="squiggly-error",i=zf(tv),n=30;break}e.tags&&-1!==e.tags.indexOf(1)&&(o="squiggly-inline-unnecessary");var r=null,s=e.message,a=e.source,u=e.relatedInformation,l=e.code;if("string"===typeof s&&(s=s.trim(),a&&(s=/\n/g.test(s)?l?le("diagAndSourceAndCodeMultiline","[{0}]\n{1} [{2}]",a,s,l):le("diagAndSourceMultiline","[{0}]\n{1}",a,s):l?le("diagAndSourceAndCode","[{0}] {1} [{2}]",a,s,l):le("diagAndSource","[{0}] {1}",a,s)),r=(new _L).appendCodeblock("_",s),!ye(u))){r.appendMarkdown("\n");for(var c=0,h=u;c=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},FL=function(e,t){return function(n,i){t(n,i,e)}},WL=function(e){function t(t,n){void 0===n&&(n=_o());var i=e.call(this)||this;return i._styleSheet=n,i._decorationOptionProviders=Object.create(null),i._themeService=t,i}return AL(t,e),t.prototype.registerDecorationType=function(e,t,n){var i=this._decorationOptionProviders[e];if(!i){var o={styleSheet:this._styleSheet,key:e,parentTypeKey:n,options:t||Object.create(null)};i=n?new VL(this._themeService,o):new BL(this._themeService,o),this._decorationOptionProviders[e]=i}i.refCount++},t.prototype.removeDecorationType=function(e){var t=this._decorationOptionProviders[e];t&&(t.refCount--,t.refCount<=0&&(delete this._decorationOptionProviders[e],t.dispose(),this.listCodeEditors().forEach((function(t){return t.removeDecorations(e)}))))},t.prototype.resolveDecorationOptions=function(e,t){var n=this._decorationOptionProviders[e];if(!n)throw new Error("Unknown decoration type key: "+e);return n.getOptions(this,t)},t=RL([FL(0,jf)],t),t}(PL),VL=function(){function e(e,t){this._parentTypeKey=t.parentTypeKey,this.refCount=0,this._beforeContentRules=new jL(3,t,e),this._afterContentRules=new jL(4,t,e)}return e.prototype.getOptions=function(e,t){var n=e.resolveDecorationOptions(this._parentTypeKey,!0);return this._beforeContentRules&&(n.beforeContentClassName=this._beforeContentRules.className),this._afterContentRules&&(n.afterContentClassName=this._afterContentRules.className),n},e.prototype.dispose=function(){this._beforeContentRules&&(this._beforeContentRules.dispose(),this._beforeContentRules=null),this._afterContentRules&&(this._afterContentRules.dispose(),this._afterContentRules=null)},e}(),BL=function(){function e(e,t){var n=this;this.refCount=0,this._disposables=[];var i=function(i){var o=new jL(i,t,e);if(o.hasContent)return n._disposables.push(o),o.className},o=function(i){var o=new jL(i,t,e);return o.hasContent?(n._disposables.push(o),{className:o.className,hasLetterSpacing:o.hasLetterSpacing}):null};this.className=i(0);var r=o(1);r&&(this.inlineClassName=r.className,this.inlineClassNameAffectsLetterSpacing=r.hasLetterSpacing),this.beforeContentClassName=i(3),this.afterContentClassName=i(4),this.glyphMarginClassName=i(2);var s=t.options;this.isWholeLine=Boolean(s.isWholeLine),this.stickiness=s.rangeBehavior;var a=s.light&&s.light.overviewRulerColor||s.overviewRulerColor,u=s.dark&&s.dark.overviewRulerColor||s.overviewRulerColor;"undefined"===typeof a&&"undefined"===typeof u||(this.overviewRuler={color:a||u,darkColor:u||a,position:s.overviewRulerLane||Ls.Center})}return e.prototype.getOptions=function(e,t){return t?{inlineClassName:this.inlineClassName,beforeContentClassName:this.beforeContentClassName,afterContentClassName:this.afterContentClassName,className:this.className,glyphMarginClassName:this.glyphMarginClassName,isWholeLine:this.isWholeLine,overviewRuler:this.overviewRuler,stickiness:this.stickiness}:this},e.prototype.dispose=function(){this._disposables=y(this._disposables)},e}(),HL={color:"color:{0} !important;",opacity:"opacity:{0}; will-change: opacity;",backgroundColor:"background-color:{0};",outline:"outline:{0};",outlineColor:"outline-color:{0};",outlineStyle:"outline-style:{0};",outlineWidth:"outline-width:{0};",border:"border:{0};",borderColor:"border-color:{0};",borderRadius:"border-radius:{0};",borderSpacing:"border-spacing:{0};",borderStyle:"border-style:{0};",borderWidth:"border-width:{0};",fontStyle:"font-style:{0};",fontWeight:"font-weight:{0};",textDecoration:"text-decoration:{0};",cursor:"cursor:{0};",letterSpacing:"letter-spacing:{0};",gutterIconPath:"background:url('{0}') center center no-repeat;",gutterIconSize:"background-size:{0};",contentText:"content:'{0}';",contentIconPath:"content:url('{0}');",margin:"margin:{0};",width:"width:{0};",height:"height:{0};"},jL=function(){function e(e,t,n){var i=this;this._theme=n.getTheme(),this._ruleType=e,this._providerArgs=t,this._usesThemeColors=!1,this._hasContent=!1,this._hasLetterSpacing=!1;var o=zL.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(o=o+" "+zL.getClassName(this._providerArgs.parentTypeKey,e)),this._className=o,this._unThemedSelector=zL.getSelector(this._providerArgs.key,this._providerArgs.parentTypeKey,e),this._buildCSS(),this._usesThemeColors?this._themeListener=n.onThemeChange((function(e){i._theme=n.getTheme(),i._removeCSS(),i._buildCSS()})):this._themeListener=null}return e.prototype.dispose=function(){this._hasContent&&(this._removeCSS(),this._hasContent=!1),this._themeListener&&(this._themeListener.dispose(),this._themeListener=null)},Object.defineProperty(e.prototype,"hasContent",{get:function(){return this._hasContent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasLetterSpacing",{get:function(){return this._hasLetterSpacing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"className",{get:function(){return this._className},enumerable:!0,configurable:!0}),e.prototype._buildCSS=function(){var e,t,n,i=this._providerArgs.options;switch(this._ruleType){case 0:e=this.getCSSTextForModelDecorationClassName(i),t=this.getCSSTextForModelDecorationClassName(i.light),n=this.getCSSTextForModelDecorationClassName(i.dark);break;case 1:e=this.getCSSTextForModelDecorationInlineClassName(i),t=this.getCSSTextForModelDecorationInlineClassName(i.light),n=this.getCSSTextForModelDecorationInlineClassName(i.dark);break;case 2:e=this.getCSSTextForModelDecorationGlyphMarginClassName(i),t=this.getCSSTextForModelDecorationGlyphMarginClassName(i.light),n=this.getCSSTextForModelDecorationGlyphMarginClassName(i.dark);break;case 3:e=this.getCSSTextForModelDecorationContentClassName(i.before),t=this.getCSSTextForModelDecorationContentClassName(i.light&&i.light.before),n=this.getCSSTextForModelDecorationContentClassName(i.dark&&i.dark.before);break;case 4:e=this.getCSSTextForModelDecorationContentClassName(i.after),t=this.getCSSTextForModelDecorationContentClassName(i.light&&i.light.after),n=this.getCSSTextForModelDecorationContentClassName(i.dark&&i.dark.after);break;default:throw new Error("Unknown rule type: "+this._ruleType)}var o=this._providerArgs.styleSheet.sheet,r=!1;e.length>0&&(o.insertRule(this._unThemedSelector+" {"+e+"}",0),r=!0),t.length>0&&(o.insertRule(".vs"+this._unThemedSelector+" {"+t+"}",0),r=!0),n.length>0&&(o.insertRule(".vs-dark"+this._unThemedSelector+", .hc-black"+this._unThemedSelector+" {"+n+"}",0),r=!0),this._hasContent=r},e.prototype._removeCSS=function(){So(this._unThemedSelector,this._providerArgs.styleSheet)},e.prototype.getCSSTextForModelDecorationClassName=function(e){if(!e)return"";var t=[];return this.collectCSSText(e,["backgroundColor"],t),this.collectCSSText(e,["outline","outlineColor","outlineStyle","outlineWidth"],t),this.collectBorderSettingsCSSText(e,t),t.join("")},e.prototype.getCSSTextForModelDecorationInlineClassName=function(e){if(!e)return"";var t=[];return this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","cursor","color","opacity","letterSpacing"],t),e.letterSpacing&&(this._hasLetterSpacing=!0),t.join("")},e.prototype.getCSSTextForModelDecorationContentClassName=function(e){if(!e)return"";var t=[];if("undefined"!==typeof e){if(this.collectBorderSettingsCSSText(e,t),"undefined"!==typeof e.contentIconPath&&("string"===typeof e.contentIconPath?t.push(Go(HL.contentIconPath,Yt.file(e.contentIconPath).toString().replace(/'/g,"%27"))):t.push(Go(HL.contentIconPath,Yt.revive(e.contentIconPath).toString(!0).replace(/'/g,"%27")))),"string"===typeof e.contentText){var n=e.contentText.match(/^.*$/m)[0],i=n.replace(/['\\]/g,"\\$&");t.push(Go(HL.contentText,i))}this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","color","opacity","backgroundColor","margin"],t),this.collectCSSText(e,["width","height"],t)&&t.push("display:inline-block;")}return t.join("")},e.prototype.getCSSTextForModelDecorationGlyphMarginClassName=function(e){if(!e)return"";var t=[];return"undefined"!==typeof e.gutterIconPath&&("string"===typeof e.gutterIconPath?t.push(Go(HL.gutterIconPath,Yt.file(e.gutterIconPath).toString())):t.push(Go(HL.gutterIconPath,Yt.revive(e.gutterIconPath).toString(!0).replace(/'/g,"%27"))),"undefined"!==typeof e.gutterIconSize&&t.push(Go(HL.gutterIconSize,e.gutterIconSize))),t.join("")},e.prototype.collectBorderSettingsCSSText=function(e,t){return!!this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)&&(t.push(Go("box-sizing: border-box;")),!0)},e.prototype.collectCSSText=function(e,t,n){for(var i=n.length,o=0,r=t;o=1&&""===e[0].token){var r=e.shift();-1!==r.fontStyle&&(n=r.fontStyle),null!==r.foreground&&(i=r.foreground),null!==r.background&&(o=r.background)}for(var s=new ZL,a=0,u=t;a>>0,this._cache.set(t,n)}return(n|e<<0)>>>0},e}(),JL=/\b(comment|string|regex)\b/;function QL(e){var t=e.match(JL);if(!t)return 0;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":return 4}throw new Error("Unexpected match for standard token type!")}function ek(e,t){return et?1:0}var tk,nk,ik,ok=function(){function e(e,t,n){this._fontStyle=e,this._foreground=t,this._background=n,this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0}return e.prototype.clone=function(){return new e(this._fontStyle,this._foreground,this._background)},e.prototype.acceptOverwrite=function(e,t,n){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==n&&(this._background=n),this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0},e}(),rk=function(){function e(e){this._mainRule=e,this._children=new Map}return e.prototype.match=function(e){if(""===e)return this._mainRule;var t,n,i=e.indexOf(".");-1===i?(t=e,n=""):(t=e.substring(0,i),n=e.substring(i+1));var o=this._children.get(t);return"undefined"!==typeof o?o.match(n):this._mainRule},e.prototype.insert=function(t,n,i,o){if(""!==t){var r,s,a=t.indexOf(".");-1===a?(r=t,s=""):(r=t.substring(0,a),s=t.substring(a+1));var u=this._children.get(r);"undefined"===typeof u&&(u=new e(this._mainRule.clone()),this._children.set(r,u)),u.insert(s,n,i,o)}else this._mainRule.acceptOverwrite(n,i,o)},e}();function sk(e){for(var t=[],n=1,i=e.length;n0?(this.id=n+" "+e,this.themeName=e):(this.id=n,this.themeName=n),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}return Object.defineProperty(e.prototype,"base",{get:function(){return this.themeData.base},enumerable:!0,configurable:!0}),e.prototype.notifyBaseUpdated=function(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)},e.prototype.getColors=function(){if(!this.colors){var e=Object.create(null);for(var t in this.themeData.colors)e[t]=jp.fromHex(this.themeData.colors[t]);if(this.themeData.inherit){var n=vk(this.themeData.base);for(var t in n.colors)e[t]||(e[t]=jp.fromHex(n.colors[t]))}this.colors=e}return this.colors},e.prototype.getColor=function(e,t){var n=this.getColors()[e];return n||(!1!==t?this.getDefault(e):null)},e.prototype.getDefault=function(e){var t=this.defaultColors[e];return t||(t=fk.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)},e.prototype.defines=function(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)},Object.defineProperty(e.prototype,"type",{get:function(){switch(this.base){case ck:return"light";case dk:return"hc";default:return"dark"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tokenTheme",{get:function(){if(!this._tokenTheme){var e=[],t=[];if(this.themeData.inherit){var n=vk(this.themeData.base);e=n.rules,n.encodedTokensColors&&(t=n.encodedTokensColors)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=XL.createFromRawTokenTheme(e,t)}return this._tokenTheme},enumerable:!0,configurable:!0}),e}();function mk(e){return e===ck||e===hk||e===dk}function vk(e){switch(e){case ck:return ak;case hk:return uk;case dk:return lk}}function _k(e){var t=vk(e);return new gk(e,t)}var yk=function(){function e(){this.environment=Object.create(null),this._onThemeChange=new T,this._onIconThemeChange=new T,this._knownThemes=new Map,this._knownThemes.set(ck,_k(ck)),this._knownThemes.set(hk,_k(hk)),this._knownThemes.set(dk,_k(dk)),this._styleElement=_o(),this._styleElement.className="monaco-colors",this.setTheme(ck)}return Object.defineProperty(e.prototype,"onThemeChange",{get:function(){return this._onThemeChange.event},enumerable:!0,configurable:!0}),e.prototype.defineTheme=function(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!mk(t.base)&&!mk(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new gk(e,t)),mk(e)&&this._knownThemes.forEach((function(t){t.base===e&&t.notifyBaseUpdated()})),this._theme&&this._theme.themeName===e&&this.setTheme(e)},e.prototype.getTheme=function(){return this._theme},e.prototype.setTheme=function(e){var t,n=this;if(t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get(ck),this._theme===t)return t.id;this._theme=t;var i=[],o={},r={addRule:function(e){o[e]||(i.push(e),o[e]=!0)}};pk.getThemingParticipants().forEach((function(e){return e(t,r,n.environment)}));var s=t.tokenTheme,a=s.getColorMap();return r.addRule(sk(a)),this._styleElement.innerHTML=i.join("\n"),Za.setColorMap(a),this._onThemeChange.fire(t),t.id},e.prototype.getIconTheme=function(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}},e}(),bk=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),wk=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},Ck=function(e,t){return function(n,i){t(n,i,e)}},Sk="data-keybinding-context",xk=function(){function e(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value["_contextId"]=e}return e.prototype.setValue=function(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)},e.prototype.removeValue=function(e){return e in this._value&&(delete this._value[e],!0)},e.prototype.getValue=function(e){var t=this._value[e];return"undefined"===typeof t&&this._parent?this._parent.getValue(e):t},e}(),Lk=function(e){function t(){return e.call(this,-1,null)||this}return bk(t,e),t.prototype.setValue=function(e,t){return!1},t.prototype.removeValue=function(e){return!1},t.prototype.getValue=function(e){},t.INSTANCE=new t,t}(xk),kk=function(e){function t(t,n,i){var o=e.call(this,t,null)||this;return o._configurationService=n,o._values=new Map,o._listener=o._configurationService.onDidChangeConfiguration((function(e){if(4===e.source){var t=Ts(o._values);o._values.clear(),i.fire(t)}else{for(var n=[],r=0,s=e.affectedKeys;r1){var i=n.shift();o.focusItemByElement(i.container),n.push(i),o.mnemonics.set(t,n)}}}))),o._register(ji(o.domNode,Lo.MOUSE_OUT,(function(e){var t=e.relatedTarget;mo(t,o.domNode)||(o.focusedItem=void 0,o.updateFocus(),e.stopPropagation())}))),o._register(ji(o.actionsList,Lo.MOUSE_OVER,(function(e){var t=e.target;if(t&&mo(t,o.actionsList)&&t!==o.actionsList){while(t.parentElement!==o.actionsList)t=t.parentElement;if(Ai(t,"action-item")){var n=o.focusedItem;o.setFocusedItem(t),n!==o.focusedItem&&o.updateFocus()}}})));var s={parent:o};return o.mnemonics=new Map,o.push(n,{icon:!0,label:!0,isMenu:!0}),o}return Tk(t,e),t.prototype.style=function(e){var t=this.getContainer(),n=e.foregroundColor?""+e.foregroundColor:null,i=e.backgroundColor?""+e.backgroundColor:null,o=e.borderColor?"2px solid "+e.borderColor:null,r=e.shadowColor?"0 2px 4px "+e.shadowColor:null;t.style.border=o,this.domNode.style.color=n,this.domNode.style.backgroundColor=i,t.style.boxShadow=r,this.items&&this.items.forEach((function(t){(t instanceof Wk||t instanceof Bk)&&t.style(e)}))},t.prototype.focusItemByElement=function(e){var t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()},t.prototype.setFocusedItem=function(e){for(var t=0;t