分布式调度框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

560 lines
18 KiB

<!DOCTYPE HTML>
<html lang="zh-hans" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>自定义任务插件文档 · 调度系统-EasyScheduler</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.3">
<meta name="author" content="YIGUAN">
<link rel="stylesheet" href="gitbook/style.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-insert-logo-link/plugin.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
<link rel="stylesheet" href="styles/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="输入并搜索" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="1.1" data-path="./">
<a href="./">
Easyscheduler简介
</a>
</li>
<li class="chapter " data-level="1.2" >
<span>
前端部署文档
</span>
<ul class="articles">
<li class="chapter " data-level="1.2.1" data-path="前端部署文档.html">
<a href="前端部署文档.html#前端项目环境构建及编译">
环境搭建
</a>
</li>
<li class="chapter " data-level="1.2.2" data-path="前端部署文档.html">
<a href="前端部署文档.html#安装及配置">
安装及配置
</a>
</li>
<li class="chapter " data-level="1.2.3" data-path="前端部署文档.html">
<a href="前端部署文档.html#项目生产环境配置">
项目生产环境Nginx配置
</a>
</li>
<li class="chapter " data-level="1.2.4" data-path="前端部署文档.html">
<a href="前端部署文档.html#前端项目发布">
前端项目发布
</a>
</li>
<li class="chapter " data-level="1.2.5" data-path="前端部署文档.html">
<a href="前端部署文档.html#问题">
问题
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3" >
<span>
后端部署文档
</span>
<ul class="articles">
<li class="chapter " data-level="1.3.1" data-path="后端部署文档.html">
<a href="后端部署文档.html#部署文档">
后端部署文档
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" data-path="系统使用手册.html">
<a href="系统使用手册.html#使用手册">
系统使用手册
</a>
</li>
<li class="chapter " data-level="1.5" data-path="系统架构设计.html">
<a href="系统架构设计.html#系统架构设计">
系统架构设计
</a>
</li>
<li class="chapter " data-level="1.6" >
<span>
前端开发文档
</span>
<ul class="articles">
<li class="chapter " data-level="1.6.1" data-path="前端部署文档.html">
<a href="前端部署文档.html">
开发环境搭建
</a>
</li>
<li class="chapter " data-level="1.6.2" data-path="前端开发文档.html">
<a href="前端开发文档.html#项目目录结构">
项目目录结构
</a>
</li>
<li class="chapter " data-level="1.6.3" data-path="前端开发文档.html">
<a href="前端开发文档.html#系统功能模块">
系统功能模块
</a>
</li>
<li class="chapter " data-level="1.6.4" data-path="前端开发文档.html">
<a href="前端开发文档.html#路由和状态管理">
路由和状态管理
</a>
</li>
<li class="chapter " data-level="1.6.5" data-path="前端开发文档.html">
<a href="前端开发文档.html#规范">
规范
</a>
</li>
<li class="chapter " data-level="1.6.6" data-path="前端开发文档.html">
<a href="前端开发文档.html#接口">
接口
</a>
</li>
<li class="chapter " data-level="1.6.7" data-path="前端开发文档.html">
<a href="前端开发文档.html#扩展开发">
扩展开发
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.7" >
<span>
后端开发文档
</span>
<ul class="articles">
<li class="chapter " data-level="1.7.1" data-path="任务插件开发.html">
<a href="任务插件开发.html#任务插件开发">
自定义任务插件文档
</a>
</li>
</ul>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
本书使用 GitBook 发布
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="." >自定义任务插件文档</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<h2 id="&#x4EFB;&#x52A1;&#x63D2;&#x4EF6;&#x5F00;&#x53D1;">&#x4EFB;&#x52A1;&#x63D2;&#x4EF6;&#x5F00;&#x53D1;</h2>
<p>&#x63D0;&#x9192;:&#x76EE;&#x524D;&#x4EFB;&#x52A1;&#x63D2;&#x4EF6;&#x5F00;&#x53D1;&#x6682;&#x4E0D;&#x652F;&#x6301;&#x70ED;&#x90E8;&#x7F72;</p>
<h3 id="&#x57FA;&#x4E8E;shell&#x7684;&#x4EFB;&#x52A1;">&#x57FA;&#x4E8E;SHELL&#x7684;&#x4EFB;&#x52A1;</h3>
<h4 id="&#x57FA;&#x4E8E;yarn&#x7684;&#x8BA1;&#x7B97;&#xFF08;&#x53C2;&#x89C1;mapreducetask&#xFF09;">&#x57FA;&#x4E8E;YARN&#x7684;&#x8BA1;&#x7B97;&#xFF08;&#x53C2;&#x89C1;MapReduceTask&#xFF09;</h4>
<ul>
<li>&#x9700;&#x8981;&#x5728; <strong>cn.escheduler.server.worker.task</strong> &#x4E0B;&#x7684; <strong>TaskManager</strong> &#x7C7B;&#x4E2D;&#x521B;&#x5EFA;&#x81EA;&#x5B9A;&#x4E49;&#x4EFB;&#x52A1;(&#x4E5F;&#x9700;&#x5728;TaskType&#x6CE8;&#x518C;&#x5BF9;&#x5E94;&#x7684;&#x4EFB;&#x52A1;&#x7C7B;&#x578B;)</li>
<li>&#x9700;&#x8981;&#x7EE7;&#x627F;<strong>cn.escheduler.server.worker.task</strong> &#x4E0B;&#x7684; <strong>AbstractYarnTask</strong></li>
<li>&#x6784;&#x9020;&#x65B9;&#x6CD5;&#x8C03;&#x5EA6; <strong>AbstractYarnTask</strong> &#x6784;&#x9020;&#x65B9;&#x6CD5;</li>
<li>&#x7EE7;&#x627F; <strong>AbstractParameters</strong> &#x81EA;&#x5B9A;&#x4E49;&#x4EFB;&#x52A1;&#x53C2;&#x6570;&#x5B9E;&#x4F53;</li>
<li>&#x91CD;&#x5199; <strong>AbstractTask</strong> &#x7684; <strong>init</strong> &#x65B9;&#x6CD5;&#x4E2D;&#x89E3;&#x6790;<strong>&#x81EA;&#x5B9A;&#x4E49;&#x4EFB;&#x52A1;&#x53C2;&#x6570;</strong></li>
<li>&#x91CD;&#x5199; <strong>buildCommand</strong> &#x5C01;&#x88C5;command</li>
</ul>
<h4 id="&#x57FA;&#x4E8E;&#x975E;yarn&#x7684;&#x8BA1;&#x7B97;&#xFF08;&#x53C2;&#x89C1;shelltask&#xFF09;">&#x57FA;&#x4E8E;&#x975E;YARN&#x7684;&#x8BA1;&#x7B97;&#xFF08;&#x53C2;&#x89C1;ShellTask&#xFF09;</h4>
<ul>
<li><p>&#x9700;&#x8981;&#x5728; <strong>cn.escheduler.server.worker.task</strong> &#x4E0B;&#x7684; <strong>TaskManager</strong> &#x4E2D;&#x521B;&#x5EFA;&#x81EA;&#x5B9A;&#x4E49;&#x4EFB;&#x52A1;</p>
</li>
<li><p>&#x9700;&#x8981;&#x7EE7;&#x627F;<strong>cn.escheduler.server.worker.task</strong> &#x4E0B;&#x7684; <strong>AbstractTask</strong></p>
</li>
<li><p>&#x6784;&#x9020;&#x65B9;&#x6CD5;&#x4E2D;&#x5B9E;&#x4F8B;&#x5316; <strong>ShellCommandExecutor</strong></p>
<pre><code>public ShellTask(TaskProps props, Logger logger) {
super(props, logger);
this.taskDir = props.getTaskDir();
this.processTask = new ShellCommandExecutor(this::logHandle,
props.getTaskDir(), props.getTaskAppId(),
props.getTenantCode(), props.getEnvFile(), props.getTaskStartTime(),
props.getTaskTimeout(), logger);
this.processDao = DaoFactory.getDaoInstance(ProcessDao.class);
}
</code></pre><p>&#x4F20;&#x5165;&#x81EA;&#x5B9A;&#x4E49;&#x4EFB;&#x52A1;&#x7684; <strong>TaskProps</strong>&#x548C;&#x81EA;&#x5B9A;&#x4E49;<strong>Logger</strong>&#xFF0C;TaskProps &#x5C01;&#x88C5;&#x4E86;&#x4EFB;&#x52A1;&#x7684;&#x4FE1;&#x606F;&#xFF0C;Logger&#x5206;&#x88C5;&#x4E86;&#x81EA;&#x5B9A;&#x4E49;&#x65E5;&#x5FD7;&#x4FE1;&#x606F;</p>
</li>
<li><p>&#x7EE7;&#x627F; <strong>AbstractParameters</strong> &#x81EA;&#x5B9A;&#x4E49;&#x4EFB;&#x52A1;&#x53C2;&#x6570;&#x5B9E;&#x4F53;</p>
</li>
<li><p>&#x91CD;&#x5199; <strong>AbstractTask</strong> &#x7684; <strong>init</strong> &#x65B9;&#x6CD5;&#x4E2D;&#x89E3;&#x6790;<strong>&#x81EA;&#x5B9A;&#x4E49;&#x4EFB;&#x52A1;&#x53C2;&#x6570;&#x5B9E;&#x4F53;</strong></p>
</li>
<li><p>&#x91CD;&#x5199; <strong>handle</strong> &#x65B9;&#x6CD5;&#xFF0C;&#x8C03;&#x7528; <strong>ShellCommandExecutor</strong> &#x7684; <strong>run</strong> &#x65B9;&#x6CD5;&#xFF0C;&#x7B2C;&#x4E00;&#x4E2A;&#x53C2;&#x6570;&#x4F20;&#x5165;&#x81EA;&#x5DF1;&#x7684;<strong>command</strong>&#xFF0C;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x4F20;&#x5165; ProcessDao&#xFF0C;&#x8BBE;&#x7F6E;&#x76F8;&#x5E94;&#x7684; <strong>exitStatusCode</strong></p>
</li>
</ul>
<h3 id="&#x57FA;&#x4E8E;&#x975E;shell&#x7684;&#x4EFB;&#x52A1;&#xFF08;&#x53C2;&#x89C1;sqltask&#xFF09;">&#x57FA;&#x4E8E;&#x975E;SHELL&#x7684;&#x4EFB;&#x52A1;&#xFF08;&#x53C2;&#x89C1;SqlTask&#xFF09;</h3>
<ul>
<li>&#x9700;&#x8981;&#x5728; <strong>cn.escheduler.server.worker.task</strong> &#x4E0B;&#x7684; <strong>TaskManager</strong> &#x4E2D;&#x521B;&#x5EFA;&#x81EA;&#x5B9A;&#x4E49;&#x4EFB;&#x52A1;</li>
<li>&#x9700;&#x8981;&#x7EE7;&#x627F;<strong>cn.escheduler.server.worker.task</strong> &#x4E0B;&#x7684; <strong>AbstractTask</strong></li>
<li>&#x7EE7;&#x627F; <strong>AbstractParameters</strong> &#x81EA;&#x5B9A;&#x4E49;&#x4EFB;&#x52A1;&#x53C2;&#x6570;&#x5B9E;&#x4F53;</li>
<li>&#x6784;&#x9020;&#x65B9;&#x6CD5;&#x6216;&#x8005;&#x91CD;&#x5199; <strong>AbstractTask</strong> &#x7684; <strong>init</strong> &#x65B9;&#x6CD5;&#x4E2D;&#xFF0C;&#x89E3;&#x6790;&#x81EA;&#x5B9A;&#x4E49;&#x4EFB;&#x52A1;&#x53C2;&#x6570;&#x5B9E;&#x4F53;</li>
<li>&#x91CD;&#x5199; <strong>handle</strong> &#x65B9;&#x6CD5;&#x5B9E;&#x73B0;&#x4E1A;&#x52A1;&#x903B;&#x8F91;&#x5E76;&#x8BBE;&#x7F6E;&#x76F8;&#x5E94;&#x7684;<strong>exitStatusCode</strong></li>
</ul>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"自定义任务插件文档","level":"1.7.1","depth":2,"previous":{"title":"后端开发文档","level":"1.7","depth":1,"ref":"","articles":[{"title":"自定义任务插件文档","level":"1.7.1","depth":2,"anchor":"#任务插件开发","path":"任务插件开发.md","ref":"任务插件开发.md#任务插件开发","articles":[]}]},"dir":"ltr"},"config":{"plugins":["expandable-chapters","insert-logo-link","livereload"],"styles":{"website":"./styles/website.css"},"pluginsConfig":{"livereload":{},"insert-logo-link":{"src":"http://geek.analysys.cn/static/upload/236/2019-03-29/379450b4-7919-4707-877c-4d33300377d4.png","url":"https://github.com/analysys/EasyScheduler"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{}},"theme":"default","author":"YIGUAN","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"调度系统-EasyScheduler","language":"zh-hans","gitbook":"3.2.3","description":"调度系统"},"file":{"path":"任务插件开发.md","mtime":"2019-04-08T02:29:27.998Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-10T07:14:01.407Z"},"basePath":".","book":{"language":""}});
});
</script>
</div>
<script src="gitbook/gitbook.js"></script>
<script src="gitbook/theme.js"></script>
<script src="gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
<script src="gitbook/gitbook-plugin-insert-logo-link/plugin.js"></script>
<script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
<script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="gitbook/gitbook-plugin-search/search.js"></script>
<script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>