分布式调度框架。
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.
 
 
 
 
 
 

517 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">
<link rel="next" href="user-manual.md" />
<link rel="prev" href="backend-deploy.html" />
</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="frontend-deploy.html">
<a href="frontend-deploy.html#前端项目环境构建及编译">
环境搭建
</a>
</li>
<li class="chapter " data-level="1.2.2" data-path="frontend-deploy.html">
<a href="frontend-deploy.html#安装及配置">
安装及配置
</a>
</li>
<li class="chapter " data-level="1.2.3" data-path="frontend-deploy.html">
<a href="frontend-deploy.html#项目生产环境配置">
项目生产环境Nginx配置
</a>
</li>
<li class="chapter " data-level="1.2.4" data-path="frontend-deploy.html">
<a href="frontend-deploy.html#前端项目发布">
前端项目发布
</a>
</li>
<li class="chapter " data-level="1.2.5" data-path="frontend-deploy.html">
<a href="frontend-deploy.html#问题">
问题
</a>
</li>
<li class="chapter " data-level="1.2.6" data-path="frontend-development.html">
<a href="frontend-development.html#项目目录结构">
项目目录结构
</a>
</li>
<li class="chapter " data-level="1.2.7" data-path="frontend-development.html">
<a href="frontend-development.html#系统功能模块">
系统功能模块
</a>
</li>
<li class="chapter " data-level="1.2.8" data-path="frontend-development.html">
<a href="frontend-development.html#路由和状态管理">
路由和状态管理
</a>
</li>
<li class="chapter " data-level="1.2.9" data-path="frontend-development.html">
<a href="frontend-development.html#规范">
规范
</a>
</li>
<li class="chapter " data-level="1.2.10" data-path="frontend-development.html">
<a href="frontend-development.html#接口">
接口
</a>
</li>
<li class="chapter " data-level="1.2.11" data-path="frontend-development.html">
<a href="frontend-development.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="architecture-design.html">
<a href="architecture-design.html#调度系统架构设计">
系统架构设计
</a>
</li>
<li class="chapter " data-level="1.3.2" data-path="backend-deploy.html">
<a href="backend-deploy.html#部署文档">
部署文档
</a>
</li>
<li class="chapter " data-level="1.3.3" data-path="task-plugin-development.html">
<a href="task-plugin-development.html#任务插件开发">
自定义任务插件文档
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" data-path="user-manual.md">
<span>
使用说明文档
</a>
</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>
<a href="backend-deploy.html#部署文档" class="navigation navigation-prev " aria-label="Previous page: 部署文档">
<i class="fa fa-angle-left"></i>
</a>
<a href="user-manual.md#使用手册" class="navigation navigation-next " aria-label="Next page: 使用说明文档">
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"自定义任务插件文档","level":"1.3.3","depth":2,"next":{"title":"使用说明文档","level":"1.4","depth":1,"anchor":"#使用手册","path":"user-manual.md","ref":"user-manual.md#使用手册","articles":[]},"previous":{"title":"部署文档","level":"1.3.2","depth":2,"anchor":"#部署文档","path":"backend-deploy.md","ref":"backend-deploy.md#部署文档","articles":[]},"dir":"ltr"},"config":{"plugins":["expandable-chapters","insert-logo-link"],"styles":{"website":"./styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"../images/logo.png","url":"/"},"expandable-chapters":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"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}},"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":"task-plugin-development.md","mtime":"2019-03-28T11:14:39.616Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-03-28T11:15:13.750Z"},"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-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>