Spring Batch 远程分区和远程分块的区别
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 远程分区和远程分块的区别的更多相关文章
- 大量数据也不在话下,Spring Batch并行处理四种模式初探
1 前言 欢迎访问南瓜慢说 www.pkslow.com获取更多精彩文章! Spring相关文章:Springboot-Cloud 前面写了一篇文章<通过例子讲解Spring Batch入门,优 ...
- Spring Batch远程分区的本地Jar包模式
1 前言 欢迎访问南瓜慢说 www.pkslow.com获取更多精彩文章! Spring相关文章:Springboot-Cloud Spring Batch远程分区对于大量数据的处理非常擅长,它的实现 ...
- 为Spring Cloud Config Server配置远程git仓库
简介 虽然在开发过程,在本地创建git仓库操作起来非常方便,但是在实际项目应用中,多个项目组需要通过一个中心服务器来共享配置,所以Spring Cloud配置中心支持远程git仓库,以使分散的项目组更 ...
- Spring Batch 专题
如今微服务架构讨论的如火如荼.但在企业架构里除了大量的OLTP交易外,还存在海量的批处理交易.在诸如银行的金融机构中,每天有3-4万笔的批处理作业需要处理.针对OLTP,业界有大量的开源框架.优秀的架 ...
- spring batch批量处理框架
spring batch精选,一文吃透spring batch批量处理框架 前言碎语 批处理是企业级业务系统不可或缺的一部分,spring batch是一个轻量级的综合性批处理框架,可用于开发企业信息 ...
- Spring Batch @EnableBatchIntegration 注解
设置一个远程分块任务需要定义一系列的 beans: 一个连接工程来从消息中间件中获得连接,消息中间件包括有(JMS,AMQP 和其他) 一个 MessagingTemplate 来从主向从发送消息, ...
- 【转】大数据批处理框架 Spring Batch全面解析
如今微服务架构讨论的如火如荼.但在企业架构里除了大量的OLTP交易外,还存在海量的批处理交易.在诸如银行的金融机构中,每天有3-4万笔的批处理作业需要处理.针对OLTP,业界有大量的开源框架.优秀的架 ...
- Spring Batch学习笔记二
此系列博客皆为学习Spring Batch时的一些笔记: Spring Batch的架构 一个Batch Job是指一系列有序的Step的集合,它们作为预定义流程的一部分而被执行: Step代表一个自 ...
- Spring Batch 批处理框架
<Spring Batch 批处理框架>基本信息作者: 刘相 出版社:电子工业出版社ISBN:9787121252419上架时间:2015-1-24出版日期:2015 年2月开本:16开页 ...
随机推荐
- python实现图片隐藏信息技术
隐秘通信的3种典型方式: ①将秘密信息隐于网络通信协议中. ②将秘密信息隐于数字签名等密码协议中 . ③将秘密信息隐于数字图像中. 第三种是利用图像或音频数据对人类感官系统的冗余. 隐藏域数字图像中的 ...
- git push error:error: insufficient permission for adding an object to repository database ./object解决
在服务器代码库xxx.git文件夹中:1.sudo chmod -R g+ws *2.sudo chgrp -R mygroup * //mygroup是该文件夹的所有组3.git repo-conf ...
- RN animated帧动画
效果图: 代码: export default class AnimationFrameScene extends Component { constructor () { super() this. ...
- metasploit的安装
//直接安装 apt-get update apt-get install metasploit-framework //连接和安装postgresql apt-get install postgre ...
- centos mysql 实战 第一节课 安全加固 mysql安装
centos mysql 实战 第一节课 安全加固 mysql安装 percona名字的由来=consultation 顾问+performance 性能=per con a mysql ...
- 【LDA】周志华
一.书籍
- python认知及六大标准数据类型
--- typora-root-url: assets --- ### -python的认知 ``` 89年开发的语言,创始人范罗苏姆(Guido van Rossum),别称:龟叔(Guido). ...
- Openvpn配置文件详解
一.vars配置文件 vars配置文件的主要内容如下: cat vars |grep -vE "^#|^$" KEY_DIR定义key生成的目录. KEY_SIZE定义生成私钥的大 ...
- java中Long的比较
Long的比较要用equals而不要用== 当Long为常量且常量值小于一个字节(<=127)时,两个Long指向同一个常量内容: Long userId=127L; Long authorId ...
- Ngx_Lua使用分享
2017年04月22日 20:05:21 阅读数:430 Nginx_Lua 1.1. 介绍 1.2. 安装 1.2.1. 安装JIT平台 1.2.2. NDK与Lua_module 1.2.3. 编 ...