com.moilioncircle.redis.replicator.cmd.parser.XSetIdParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redis-replicator Show documentation
Show all versions of redis-replicator Show documentation
Redis Replicator is a redis RDB and Command parser written in java.
It can parse,filter,broadcast the RDB and Command events in a real time manner.
It also can synchronize redis data to your local cache or to database.
package com.moilioncircle.redis.replicator.cmd.parser;
import com.moilioncircle.redis.replicator.cmd.CommandParser;
import com.moilioncircle.redis.replicator.cmd.impl.XSetIdCommand;
import static com.moilioncircle.redis.replicator.cmd.CommandParsers.toBytes;
import static com.moilioncircle.redis.replicator.cmd.CommandParsers.toRune;
/**
* @author Leon Chen
* @since 2.6.1
*/
public class XSetIdParser implements CommandParser {
@Override
public XSetIdCommand parse(Object[] command) {
int idx = 1;
String key = toRune(command[idx]);
byte[] rawKey = toBytes(command[idx]);
idx++;
String id = toRune(command[idx]);
byte[] rawId = toBytes(command[idx]);
idx++;
return new XSetIdCommand(key, id, rawKey, rawId);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy