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. 基于fiddler实现本地代理完成脚本测试

    配置好fiddler以后,具体操作流程如下: 1.找到后在右边点击AutoResponder,查看,默认情况如下 勾选 2.ctrl+F 搜索 app. 关键字 ,找到后拖到右侧 3.替换本地文件 4 ...

  2. Nginx的基础配置管理

    Nginx的基本功能 1.静态资源的web服务器 2.http协议反向代理服务器 3.tcp/udp协议的请求转发 安装nginx yum install epel-release yum insta ...

  3. pycharm的小问题之光标

    一大早起来,突然发现pycharm的光变粗,按退格键会删除编写的内容,超级难受(如下图), 百度一下,也不知道在百度框里输什么关键字好,但最后还是找到了,哈哈.... ​ 解决方法: 1.按键盘上In ...

  4. python连接redis

    一.首先,要下载redis pip3 install redis 二.连接redis import redis #拿到一个redis的链接 conn=redis.Redis('127.0.0.1',6 ...

  5. Goland的使用

    一.安装Goland 一.Goland简介 Goland是由JetBrains公司旨在为go开发者提供的一个符合人体工程学的新的商业IDE.这个IDE整合了IntelliJ平台的有关go语言的编码辅助 ...

  6. 【LeetCode每天一题】Search in Rotated Sorted Array(在旋转数组中搜索)

    Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., ...

  7. [LeetCode] 709. To Lower Case_Easy

    Implement function ToLowerCase() that has a string parameter str, and returns the same string in low ...

  8. Golang mysql

    还是那句话,服务器嘛,每个数据库支持,那成啥子啦嘛! 好吧,今天,就让Go能连上数据库,当然是之前给你铺垫的MySql的啦,哈哈 一.安装第三方包支持访问mysql数据库 #go get github ...

  9. Entity Framework(Fluent API)

    一.概述 Fluent API 可以理解为一种从POCO到数据库的映射约定,包括字段长度,类型,主外键等等,在EF Code First进行开发时候经常用到. 1.主键 modelBuilder.En ...

  10. ROSETTA使用技巧随笔--relax使用

    Purpose: 主要说目的,relax的作用就是对一个给定的蛋白进行构象搜索,寻找与WT相似并能量低于WT的结构,既包含packer又包含minimizer.主要的应用在对一个结构构象进行取样,获得 ...