如何在块处理中实现文件更新逻辑(Java Batch

编程入门 行业动态 更新时间:2024-10-26 23:25:11
本文介绍了如何在块处理中实现文件更新逻辑(Java Batch-JSR352)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用IBM的JSR352实现开发Java批处理程序.由于批处理作业涉及迭代处理大量记录,因此我选择将其实现为块处理"作业.

I am trying to develop a Java batch program using the IBM's JSR352 Implementation. Since the batch job involves iteratively processing huge number of records, I chose to implement it as Chunk Processing job.

此工作涉及3个步骤,对文件1中的每个记录重复进行

This job involves of 3 steps which keeps repeated for each records in File 1

  • 阅读器类:从文件1读取内容以形成关键文本
  • 处理器类:在文件2中查找键文本
  • 作家类:使用自定义文本更新文件2中找到关键文本的文本
  • 从处理器到编写器,我可以返回所有行号,其中 找到了关键文本匹配项.但是,如果没有对文件的RandomAccess,如何 我可以从Writer中更新文件2中的那些特定行号吗?

    From the processor to writer, I can return all line numbers where the key text matches were found. But, without RandomAccess to file, how can i update those specific line numbers in File 2 from my Writer?

    由于我只能使用这些输入/输出流 文件处理我无法拆分Lookup&之间的更新逻辑 处理器和作家班.我该如何实现?

    Since I am restricted to use only these Input/Outputstreams for file handling I am unable to split the Lookup & Update logic between processor & writer classes. How can i achieve this ?

    这是因为代码将在Windows计算机中开发,但最终在大型机(z/os)服务器中执行.

    This is because the code will be developed in a windows machine but, finally executed in a mainframe (z/os) server.

    推荐答案

    处理器在技术上是可选的,因此您可以仅在writer类中合并查找/更新逻辑.这可能会有所帮助.

    The processor is technically optional, so you could merge the lookup/update logic in just the writer class. That might help.

    在z/OS上,使用VSAM数据集(也可以通过JZOS ZFile API进行访问)更容易做到这一点.但这将很难在Windows上进行开发/测试.我想您可以分开ZFile调用,并在Windows上用一些经过装配的仿真代替它们,这些仿真可以很好地用于测试目的.

    On z/OS this is easier to do with a VSAM dataset (also accessible via the JZOS ZFile APIs). But that's going to be hard to develop/test on Windows. I suppose you could keep the ZFile calls separate and on Windows replace them with some rigged up emulation that would work well enough for testing purposes.

    更多推荐

    如何在块处理中实现文件更新逻辑(Java Batch

    本文发布于:2023-10-07 17:08:35,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1469978.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:逻辑   文件   如何在   Batch   Java

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!