Partitioning is a master/slave step configuration that allows for partitions of data to be processed in parallel. Each partition is described via some metadata. For example, if you were processing a database table, partition 1 may be ids 0-100, partition 2 being 101-200, etc. For Spring Batch, a master step uses a Partitioner to generate ExecutionContexts that contain the metadata for each partition. These ExecutionContexts are distributed to slave step for processing by a PartitionHandler (for remote partitioning, the MessageChannelPartitionHandler is typically used). The slaves execute their step and return the resulting statuses for aggregation by the master.

Things to note about remote partitioning:

Input and output are local to the slaves. For example, if the input is a file, the slaves need access to the file.
Slaves need access to the JobRepository. Slaves are fully defined Spring Batch steps and so they need JobRepository access.
Remote Chunking

Remote chunking is similar to remote partitioning in that it is a master/slave configuration. However with remote chunking, the data is read at by the master and sent over the wire to the slave for processing. Once the processing is done, the result of the ItemProcessor is returned to the master for writing.

Things to note about remote chunking:

All I/O is done by the master.
The slaves handle processing only and therefore do not need JobRepository access.
Remote chunking is more I/O intensive than remote partitioning since the actual data is sent over the wire instead of metadata describing it.
I did a talk on scaling Spring Batch and do a demonstration of remote partitioning that you can watch here: http://www.youtube.com/watch?v=CYTj5YT7CZU

翻译:

分区是主/从步骤配置,允许并行处理数据分区。每个分区都通过一些元数据来描述。例如,如果您正在处理数据库表,那么分区1可能是ids 0-100,分区2是101-200等。对于Spring Batch,主步骤使用分区程序生成包含每个分区的元数据的ExecutionContext。这些ExecutionContexts被分配给从属步骤以供PartitionHandler处理(对于远程分区,通常使用MessageChannelPartitionHandler)。从站执行它们的步骤并返回由主站汇总的结果状态。

关于远程分区的注意事项:

输入和输出对于从站是本地的。例如,如果输入是文件,则从站需要访问该文件。
从站需要访问JobRepository。从属是完全定义的Spring批处理步骤,因此它们需要JobRepository访问。
远程分块

远程分块与远程分区类似,因为它是主/从配置。但是,使用远程组块时,数据由主站读取并通过线路发送给从站进行处理。处理完成后,ItemProcessor的结果将返回给主设备进行写入。

关于远程分块的注意事项:

所有I / O都由主人完成。
从站仅处理处理,因此不需要JobRepository访问。
远程分块比远程分区的I / O密集程度更高,因为实际数据是通过线路发送的,而不是描述它的元数据。
我做了一次关于缩放Spring Batch的演讲,并演示了可以在此观看的远程分区:http://www.youtube.com/watch?v = CYTj5YT7CZU

Spring Batch 远程分区和远程分块的区别的更多相关文章

  1. 大量数据也不在话下,Spring Batch并行处理四种模式初探

    1 前言 欢迎访问南瓜慢说 www.pkslow.com获取更多精彩文章! Spring相关文章:Springboot-Cloud 前面写了一篇文章<通过例子讲解Spring Batch入门,优 ...

  2. Spring Batch远程分区的本地Jar包模式

    1 前言 欢迎访问南瓜慢说 www.pkslow.com获取更多精彩文章! Spring相关文章:Springboot-Cloud Spring Batch远程分区对于大量数据的处理非常擅长,它的实现 ...

  3. 为Spring Cloud Config Server配置远程git仓库

    简介 虽然在开发过程,在本地创建git仓库操作起来非常方便,但是在实际项目应用中,多个项目组需要通过一个中心服务器来共享配置,所以Spring Cloud配置中心支持远程git仓库,以使分散的项目组更 ...

  4. Spring Batch 专题

    如今微服务架构讨论的如火如荼.但在企业架构里除了大量的OLTP交易外,还存在海量的批处理交易.在诸如银行的金融机构中,每天有3-4万笔的批处理作业需要处理.针对OLTP,业界有大量的开源框架.优秀的架 ...

  5. spring batch批量处理框架

    spring batch精选,一文吃透spring batch批量处理框架 前言碎语 批处理是企业级业务系统不可或缺的一部分,spring batch是一个轻量级的综合性批处理框架,可用于开发企业信息 ...

  6. Spring Batch @EnableBatchIntegration 注解

    设置一个远程分块任务需要定义一系列的 beans: 一个连接工程来从消息中间件中获得连接,消息中间件包括有(JMS,AMQP 和其他) 一个 MessagingTemplate  来从主向从发送消息, ...

  7. 【转】大数据批处理框架 Spring Batch全面解析

    如今微服务架构讨论的如火如荼.但在企业架构里除了大量的OLTP交易外,还存在海量的批处理交易.在诸如银行的金融机构中,每天有3-4万笔的批处理作业需要处理.针对OLTP,业界有大量的开源框架.优秀的架 ...

  8. Spring Batch学习笔记二

    此系列博客皆为学习Spring Batch时的一些笔记: Spring Batch的架构 一个Batch Job是指一系列有序的Step的集合,它们作为预定义流程的一部分而被执行: Step代表一个自 ...

  9. Spring Batch 批处理框架

    <Spring Batch 批处理框架>基本信息作者: 刘相 出版社:电子工业出版社ISBN:9787121252419上架时间:2015-1-24出版日期:2015 年2月开本:16开页 ...

随机推荐

  1. InnoDB log file 设置多大合适?

    简介: 数据库的东西,往往一个参数就牵涉N多知识点.所以简单的说一下.大家都知道innodb是支持事务的存储引擎.事务的四个特性ACID即原子性(atomicity),一致性(consistency) ...

  2. 前端 HTML 常用标签 head标签相关内容 style标签 定义内部样式表

    styple标签 <!-- 定义内部样式表 --> <style type="text/css"></style>

  3. Python3学习之路~5.4 os模块

    用于提供系统级别的操作 os.getcwd() 获取当前工作目录,即当前python脚本工作的目录路径 os.chdir("dirname") 改变当前脚本工作目录:相当于shel ...

  4. vue在页面嵌入别的页面或者是视频2

    vue在页面嵌入别的页面或者是视频 以下是嵌入页面 <iframe name="myiframe" id="myrame" src="http: ...

  5. protocol error, got 'n' as reply type byte + redis如何后台启动

    其它机子的PHP访问redis爆“protocol error, got 'n' as reply type byte ”错误 解决办法: 在redis配置文件redis.conf中注释掉bind配置 ...

  6. HTTP协议(TCP/IP)

    HTTP协议(TCP/IP): 服务器套接字(TCP用主机的IP地址加上主机上的端口号作为TCP连接的端点,这种端点就叫做套接字(socket)或插口)   数据包(请求包.报文)http 请求格式: ...

  7. Pytorch快速入门及在线体验

    本文搭配了Pytorch在线环境,可以直接在线体验. Pytorch是Facebook 的 AI 研究团队发布了一个基于 Python的科学计算包,旨在服务两类场合: 1.替代numpy发挥GPU潜能 ...

  8. golang 获取get参数

    package main import ( "log" "net/http" ) func main() { http.HandleFunc("/&q ...

  9. [Java in NetBeans] Lesson 06. Custom classes

    这个课程的参考视频和图片来自youtube. 主要学到的知识点有: Constructors: A special method called when an object of the class ...

  10. js模拟栈

    栈:先入后出,后入先出 链表:先入先出,后入后出 下面使用js实现栈 var Stack = (function(){ var items = new WeakMap(); //先入后出,后入先出 c ...