Code Monkey home page Code Monkey logo

shardingsphere-elasticjob-lite's Introduction

Official website: http://shardingsphere.apache.org/elasticjob/

Stargazers over time

ElasticJob is a distributed scheduling solution consisting of two separate projects, Lite and Cloud.

ElasticJob Lite is a lightweight, decentralized solution that provides distributed task sharding services; ElasticJob Cloud is a Mesos framework which use Mesos + Docker(todo) to manage and isolate resources and processes.

Elasticjob uses a unified job API for each product. Developers only need code one time and can deploy at will.

ElasticJob became an Apache ShardingSphere Sub-project on May 28 2020.

Welcome communicate with community via mail list.

License

GitHub release

Maven Status Build Status Coverage Status

Architecture

ElasticJob Lite

ElasticJob Lite Architecture

Features

  • Elastic Schedule

    • Support job sharding and high availability in distributed system
    • Scale out for throughput and efficiency improvement
    • Job processing capacity is flexible and scalable with the allocation of resources
  • Resource Assign

    • Execute job on suitable time and assigned resources
    • Aggregation same job to same job executor
    • Append resources to newly assigned jobs dynamically
  • Job Governance

    • Failover
    • Misfired
    • Self diagnose and recover when distribute environment unstable
  • Job Dependency(TODO)

    • DAG based job dependency
    • DAG based job item dependency
  • Job Open Ecosystem

    • Unify job api for extension
    • Support rich job type lib, such as dataflow, script, HTTP, file, big data
    • Focus business SDK, can work with Spring IOC
  • Admin Console

    • Job administration
    • Job event trace query
    • Registry center management

Quick Start

Add maven dependency

<!-- import elastic-job lite core -->
<dependency>
    <groupId>org.apache.shardingsphere.elasticjob</groupId>
    <artifactId>elasticjob-lite-core</artifactId>
    <version>${lasted.release.version}</version>
</dependency>

<!-- import other module if need -->
<dependency>
    <groupId>org.apache.shardingsphere.elasticjob</groupId>
    <artifactId>elasticjob-lite-spring</artifactId>
    <version>${lasted.release.version}</version>
</dependency>

Job development

public class MyElasticJob implements SimpleJob {
    
    @Override
    public void execute(ShardingContext context) {
        switch (context.getShardingItem()) {
            case 0: 
                // do something by sharding item 0
                break;
            case 1: 
                // do something by sharding item 1
                break;
            case 2: 
                // do something by sharding item 2
                break;
            // case n: ...
        }
    }
}

Job configuration

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:elasticjob="http://elasticjob.shardingsphere.apache.org/schema/elasticjob"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                           http://www.springframework.org/schema/beans/spring-beans.xsd
                           http://elasticjob.shardingsphere.apache.org/schema/elasticjob
                           http://elasticjob.shardingsphere.apache.org/schema/elasticjob/elasticjob.xsd
                           ">
    <!--configure registry center -->
    <elasticjob:zookeeper id="regCenter" server-lists="yourhost:2181" namespace="elastic-job" base-sleep-time-milliseconds="1000" max-sleep-time-milliseconds="3000" max-retries="3" />

    <!--configure job snapshot service -->
    <elasticjob:snapshot id="jobSnapshot" registry-center-ref="regCenter" dump-port="9999"/>
    
    <!--configure job class -->
    <bean id="simpleJob" class="xxx.MyElasticJob" />
    
    <!--configure job -->
    <elasticjob:simple id="oneOffElasticJob" job-ref="simpleJob" registry-center-ref="regCenter" cron="0/10 * * * * ?"   sharding-total-count="3" sharding-item-parameters="0=A,1=B,2=C" />
</beans>

shardingsphere-elasticjob-lite's People

Contributors

terrymanu avatar haocao avatar zhangxinguo avatar tuohai666 avatar technoboy- avatar guangyun1013 avatar hanahmily avatar kekerzzz avatar seanwan1989 avatar fushun620 avatar teslacn avatar luky116 avatar dependabot[bot] avatar nmyphp avatar doolinma avatar taojintianxia avatar zhaojinchao95 avatar mmx1960 avatar wubingting avatar viviel avatar jiang2015 avatar dhc575757 avatar ordtesters avatar leonidasz avatar jackycser avatar wangweiufofly avatar liubo-tech avatar cherrylzhao avatar ran222 avatar yu199195 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.