Skip to content

optimize compressUtil  #4071

Open
Open
@caohdgege

Description

@caohdgege

Why you need it?

Is your feature request related to a problem? Please describe in details

  1. io.seata.common.util.CompressUtil 和 io.seata.compressor.gzip.GzipCompressor 重合了,CompressUtil可以直接去掉
  2. CompressUtil比GzipCompressor多了个isCompressData的方法,有两种方案,a. 为Compressor的每个实现都添加isCompress的方法,然后直接把使用了isCompressData的地方迁移过去;b. 把用到了isCompressData的地方优化掉,可以把根据isCompressData判断数据是否被加密,改成加一个字节直接保存数据是否已加密会更好。

针对第2点的还有个问题,当前的支持的Compressor的对于是否被加密了,都是只能通过判断前2-4位的magic number来判断,不排除有一定的误判的可能性,虽然在当前的使用场景中不会出现问题,但是在客观上依然属于一个小问题,个人建议采用b方案。

如果有兴趣优化的,可以在下方留言please assign it to me

How it could be?

A clear and concise description of what you want to happen. You can explain more about input of the feature, and output of it.

Other related information

Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions