Giter Site home page Giter Site logo

nealschneier / easybatch-framework Goto Github PK

View Code? Open in Web Editor NEW

This project forked from j-easy/easy-batch

0.0 2.0 0.0 15.72 MB

The simple, stupid batch processing framework for Java

Home Page: http://www.easybatch.org

License: MIT License

Java 98.54% HTML 1.46%

easybatch-framework's Introduction

What is Easy Batch?

To better understand what Easy Batch is, let's see a quick definition of batch processing in general:

"Batch processing is the execution of a series of jobs on a computer without manual intervention. All input parameters are predefined through job control language. This operating environment is termed as 'batch processing' because the input data are collected into batches or sets of records and each batch is processed as a unit." - Wikipedia

Easy Batch is a Java framework that provides abstractions for key concepts of batch processing:

  • Job: a program executed without manual intervention
  • JobParameters: set of parameters to configure a job
  • JobBuilder: main entry point to configure jobs
  • JobExecutor: main entry point to execute jobs
  • JobReport: execution report with metrics and statistics about the job run
  • Record: one item in the data source (line in a flat file, row in database table, tag in a Xml file, etc)
  • Batch: a set of records processed as a unit

Easy Batch jobs are simple processing pipelines. You can process data one record at a time:

Record processing

Or in batches where each batch is processed as a unit:

Batch processing

Easy Batch provides APIs to process data in both modes.

Why Easy Batch?

Because writing batch applications requires a lot of boilerplate code: reading, writing, filtering, parsing and validating data, logging, reporting to name a few.. The idea is to free you from these tedious tasks and let you focus on your application's logic.

Let's see a quick example. Suppose you have the following tweets.csv file:

id,user,message
1,foo,hello
2,bar,@foo hi!

and you would like to transform these tweets to XML format. Here is how you can do that with Easy Batch:

Job job = new JobBuilder()
         .reader(new FlatFileRecordReader("tweets.csv"))
         .filter(new HeaderRecordFilter())
         .mapper(new DelimitedRecordMapper(Tweet.class, "id", "user", "message"))
         .processor(new XmlRecordMarshaller(Tweet.class))
         .writer(new FileRecordWriter("tweets.xml"))
         .build();

JobReport report = JobExecutor.execute(job);

This example creates a job that:

  • reads records one by one from the input file tweets.csv
  • filter the header record
  • map each record to an instance of the Tweet bean
  • marshal the tweet to XML format
  • and finally write this XML to an output file tweets.xml

At the end of execution, you get a report with statistics and metrics about the job run (Execution time, number of errors, etc).

All the boilerplate code of resources I/O, iterating through the data source, filtering and parsing records, mapping data to the domain object Tweet, writing output and reporting is handled by Easy Batch. Your code becomes declarative, intuitive, easy to read, understand, test and maintain.

Quick links

Item Link
Project Home http://www.easybatch.org
Continuous integration Build job @ Travis CI
Agile Board Backlog items @ waffle.io
Code coverage Coverage
Dependencies Dependencies

Presentations, articles & blog posts

Current version

  • Stable: 4.0.0 Maven Central

  • Development: 4.1.0-SNAPSHOT Build Status

If you want to import the snapshot version, you need to use the following repository:

<repository>
    <id>ossrh</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>

Contribution

You are welcome to contribute to the project with pull requests on GitHub.

If you found a bug or want to request a feature, please use the issue tracker.

For any further question, you can use the forum or chat with the team on Gitter.

Awesome contributors

Thank you all for your contributions!

Acknowledgments

JetBrains YourKit Travis CI
IntelliJ IDEA YourKit Java Profiler Travis CI
Many thanks to JetBrains for providing a free license of IntelliJ IDEA to kindly support the development of Easy Batch Many thanks to YourKit, LLC for providing a free license of YourKit Java Profiler to kindly support the development of Easy Batch. Many thanks to Travis CI for providing a free continuous integration service for open source projects.

License

Easy Batch is released under the MIT license.

The MIT License (MIT)

Copyright (c) 2015 Mahmoud Ben Hassine ([email protected])

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

easybatch-framework's People

Contributors

toilal avatar nihed avatar fmbenhassine avatar xenji avatar gitter-badger avatar chellan 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.