Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

完成自定义key的序列化 #3

Open
2 tasks
zhou-hao opened this issue Sep 27, 2018 · 0 comments
Open
2 tasks

完成自定义key的序列化 #3

zhou-hao opened this issue Sep 27, 2018 · 0 comments
Assignees
Labels
需求 新需求,优化
Milestone

Comments

@zhou-hao
Copy link
Member

  • 支持设置某个key使用的key和value的序列化方式.支持通配设置如: hsweb-user:*
  • 支持自定义序列化所需要的包,以解决在使用jdk原生序列化或者fst等序列化方式时,从redis直接读取的数据时乱码的问题。可通过上传或者将jar复制到lib目录,然后指定对应的序列化方式即可.

相关代码:

  1. 序列化方式定义枚举: CodecType.java
  2. 类加载器:CodecClassLoader.java
  3. 序列化配置初始化:
    public Codec createCodec(RedisClient.CodecConfig config) {
    Codec valueCodec = config.getValueCodec().createCodec(classLoader);
    Codec keyCodec = config.getKeyCodec().createCodec(classLoader);
    return new Codec() {
@zhou-hao zhou-hao added the 需求 新需求,优化 label Sep 27, 2018
@zhou-hao zhou-hao added this to the v1.0.0 milestone Sep 27, 2018
@zhou-hao zhou-hao self-assigned this Sep 28, 2018
zhou-hao added a commit that referenced this issue Sep 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
需求 新需求,优化
Projects
None yet
Development

No branches or pull requests

1 participant