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. mac上Android反编译工具apktool、dex2jar入门

    MAC上Apktool的安装 官网链接   image.png 使用步骤如图1-6 第一:下载一个shell脚本,保存的名字就是”apktool”,不要带.sh后缀.可以复制到sublimetext, ...

  2. AppState使用

    AppState使用 import React, { Component } from 'react'; import {AppRegistry,StyleSheet,Text,View,AppSta ...

  3. Z字形扫描

    #include<cstdio> #include<iostream> #include<algorithm> #include<vector> #in ...

  4. linux配置基本业务

    1.安装一些必备软件 yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel ...

  5. Spark中的partition和block的关系

    hdfs中的block是分布式存储的最小单元,类似于盛放文件的盒子,一个文件可能要占多个盒子,但一个盒子里的内容只可能来自同一份文件.假设block设置为128M,你的文件是250M,那么这份文件占3 ...

  6. [LeetCode] 408. Valid Word Abbreviation_Easy

    Given a non-empty string s and an abbreviation abbr, return whether the string matches with the give ...

  7. [LeetCode] 868. Binary Gap_Easy

    Given a positive integer N, find and return the longest distance between two consecutive 1's in the ...

  8. Centos 中 vi 和vim 的区别

    它们都是多模式编辑器,不同的是vim 是vi的升级版本,它不仅兼容vi的所有指令,而且还有一些新的特性在里面. vim的这些优势主要体现在以下几个方面:1.多级撤消我们知道在vi里,按 u只能撤消上次 ...

  9. Linux修改SSH登录端口

    Linux的默认登录端口为:22,为系统安全运维都会将端口改成其它端口. 假如我们修改的端口为:3000 1.首先要配置防火墙,允许此端口通行. /sbin/iptables -A INPUT -p ...

  10. iOS - (多图上传已封装)

      /***  上传带图片的内容,允许多张图片上传(URL)POST**  @param url                 网络请求地址*  @param images              ...