Giter Club home page Giter Club logo

rdf-file's Introduction

Introduction

Rdf-File is a tool for processing structured text files. It can read, write, split, merge, sort, validate, and it can operate different distributed file systems (nas/oss ...). Standards or non-standard files can be handled efficiently in a single or distributed environment.

Features

  • Personalization file parameter configuration
  • File read
  • File write
  • File split
  • File merge
  • File multi storage operate
  • File validate
  • File sort
  • File multi protocol (format) define
  • Automatic type conversion

Documentation

https://github.com/alipay/rdf-file/wiki

Contact

斩秋 [email protected]
重扬 [email protected]

招聘

蚂蚁集团大安全技术部门,AI工程异常检测平台团队,欢迎各位加入!!!

我们是蚂蚁集团大安全技术部门,AI工程异常检测平台团队。我们致力于应用前沿的人工智能、工程技术、前端交互技术,与互联网黑产做斗争,第一时间发现黑产新手法。你知道,如何在亿级大规模数据平台上,分布式运行最前沿的异常检测算法吗?你想知道大规模图计算如何应用到业务安全领域的吗?你想知道,如何构建大规模分布式在线应用,抵挡住逐年增长的双十一压力吗?你想知道,如何使用最新的前端交互技术,打造体验极强的安全异常分析产品平台吗。欢迎加入我们,加入技术人的天堂。

蚂蚁集团,是移动支付平台「支付宝」的母公司,也是领先的金融科技开放平台,致力于以科技推动包括金融服务业在内的全球现代服务业的数字化升级,携手合作伙伴,为消费者和小微企业提供普惠、绿色、可持续的服务,为世界带来微小而美好的改变。

简历投递到[email protected]

rdf-file's People

Contributors

ad19900913 avatar dependabot[bot] avatar quhongwei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rdf-file's Issues

发现一个导致会打开过太多文件的问题

RT,FileValidator 的validate方法实现中,貌似打开的reader没有关闭,在处理大批量文件的时候,会导致文件句柄打开过多导致系统异常 ProtocolFileValidator类中的方法,可以看下是不是有相关的问题

使用 ScheduledExecutorService 来替代 Timer

多线程并行处理定时任务时, Timer 运行多个 TimeTask 时,只要其中之一没有捕获抛出的异常,其它任务便会自动终止运行,使用 ScheduledExecutorService 则没有这个问题。 是否可以使用 ScheduledExecutorService 来替代?

com.alipay.rdf.file.preheat.OssPreheatProtocolReaderWrapper 类的 Timer 属性

Sftp 远程文件路径问题

Windows 环境下载 Linux 环境的文件时,测试发现 com.alipay.rdf.file.storage.FileSftpStorage#listAllFiles(java.lang.String, com.alipay.rdf.file.interfaces.FileStorage.FilePathFilter...) 功能存在问题,该方法中会处理系统文件分隔符, com.alipay.rdf.file.util.RdfFileUtil#combinePath 组装文件路径时会把远程 Linux 的文件系统分隔符替换成Windows的文件系统分隔符,导致远程文件不存在,比如 /root 目录下存在 test 文件夹,但通过上面的方法,显示组装成 /root/test ,然后将分隔符替换成 \,变成 \root\test ,之后就会报文件不存在。

方法调用过程为 com.alipay.rdf.file.util.RdfFileUtil#combinePath => com.alipay.rdf.file.util.FileNameUtils#join(java.lang.Object[], java.lang.String) => com.alipay.rdf.file.util.FileNameUtils#normalize
本人经测试是有问题的,请核实

自定义定长模板问题

您好,有个问题想问下,我现在按照国标fund模板,自己定义了一个新的不需要头部垂直数据的定长文件模板json,但是导出的时候定长解析不生效,都是一行所有数据写入,如果换成fund模板倒是可以,但是fund被其他文件已经使用了,不能修改,想问下如果要自定义一个定长模板,除了protocol文件还有哪些需要添加注意的地方呢,谢谢~

oss request id

跟oss交互打印 oss request id,便于问题排查

需求:移除文件末尾换行符

因为 RDF 会给每一行都添加换行符,但有些文件需求是希望不要存在空行,也就是需要能够给支持文件最后一行无换行符。

某些类在 toString 方法中使用 StringBuffer

在以下类中的方法中使用 java.lang.StringBuffer :

  • com/alipay/rdf/file/meta/FileColumnTypeMeta.java:65
  • com/alipay/rdf/file/model/FileConfig.java:361
  • com/alipay/rdf/file/protocol/RowDefinition.java:120
  • com/alipay/rdf/file/function/ColumnFunctionWrapper.java:135
  • com/alipay/rdf/file/function/ColumnFunctionWrapper.java:114
  • com/alipay/rdf/file/meta/FileColumnMeta.java:125
  • com/alipay/rdf/file/meta/FileMeta.java:391

是否可以改成 StringBuilder ?

期望兼容数据文件动态增加字段的场景

场景1:实际模板定义字段后,如果数据文件在最后增加了新的字段,但暂时不需要消费该字段,希望能够兼容,不要报模板定义列数与实际字段列数不一致的错

场景2:目前好像模板定义字段顺序必须与文件字段顺序一致,希望能够可以顺序不一致,字段名相同就行

oss write 异常情况下问题

FileWriter writer
try{

oss write 抛出异常后

} finally {
writer.close()
}
调close方法可能会把错误文件上传到oss

合并额外空文件时错误

oss合并额外已存全文件数据为空时错误
com.alipay.rdf.file.exception.RdfFileException: rdf-file#FileOssStorage.getInputStream(filePath=rdf/rdf-file/open/PreheatMergeDeFileTest/testMergeEmpty/1, start=96, length=0获取数据长度必须大于零
at com.alipay.rdf.file.storage.FileOssStorage.getInputStream(FileOssStorage.java:109)
at com.alipay.rdf.file.common.IOFactory.createReader(IOFactory.java:37)
at com.alipay.rdf.file.common.ProtocolFileReader.ensureOpen(ProtocolFileReader.java:300)
at com.alipay.rdf.file.common.ProtocolFileReader.readBodyLine(ProtocolFileReader.java:251)
at com.alipay.rdf.file.common.ProtocolFileMerger.mergeBodyLines(ProtocolFileMerger.java:276)
at com.alipay.rdf.file.common.ProtocolFileMerger.mergeBody(ProtocolFileMerger.java:145)
at com.alipay.rdf.file.common.ProtocolFileMerger.merge(ProtocolFileMerger.java:83)

导出文件时如果需要自定义分隔符为unicode字符如何处理

RT,最近碰到一种文件,分隔符是用unicode字符\u0001来分隔的,导入的时候可以自定义分隔处理器,但是导出的时候好像没有相关的处理器能够自定义处理,经过blank判断后,trim过后的unicode字符就变为空串了,怎么解决呢,请教下,谢谢~

2.2.0版本后ProtocolFileValidator逻辑问题

RT,发现一个问题,比较源码后,发现2.1.3版本和之后版本的ProtocolFileValidator类验证的逻辑不太一样,会导致带有头部配置的xml模板实际json不配置头部信息时,仍然会进行行数和头部行数的校验导致报错,2.1.3版本头部为空时会有boolean值进行校验拦截,之后的版本去除了这部分的逻辑

大文件上传:文件大小,线程数量支持配置

com.alipay.rdf.file.interfaces.FileStorage#upload

调用这个方法,当超过阈值时,会触发多线程上传,现在代码中写死了5线程,10m大小,期望可配置

        uploadFileRequest.setUploadFile(srcPath);
        uploadFileRequest.setTaskNum(5);
        uploadFileRequest.setPartSize(10 * 1024 * 1024);
        uploadFileRequest.setEnableCheckpoint(true);

如下的文件格式协议能不能支持

id,eventId,taskId,totalAmount,status
1,Ea123,Ts123,5,A
id,eventId,taskId,amount
2,aa123,as123,5,D
......
第一行为文件头的描述,第二行为文件头的属性值,第三行为文件体的字段描述,第四行及后面都是文件体的内容,要解析的是文件头的内容(即第二行值)和文件体的内容,即第4行及后面的所有文件行。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.