Class RdbParser
- java.lang.Object
-
- com.moilioncircle.redis.replicator.rdb.RdbParser
-
public class RdbParser extends Object
Redis RDB format- Since:
- 2.1.0
- Author:
- Leon Chen
- See Also:
- rdb.c, Redis rdb dump data format
-
-
Field Summary
Fields Modifier and Type Field Description protected RedisInputStream
in
protected static org.slf4j.Logger
logger
protected RdbVisitor
rdbVisitor
protected AbstractReplicator
replicator
-
Constructor Summary
Constructors Constructor Description RdbParser(RedisInputStream in, AbstractReplicator replicator)
-
-
-
Field Detail
-
in
protected final RedisInputStream in
-
rdbVisitor
protected final RdbVisitor rdbVisitor
-
replicator
protected final AbstractReplicator replicator
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Detail
-
RdbParser
public RdbParser(RedisInputStream in, AbstractReplicator replicator)
-
-
Method Detail
-
parse
public long parse() throws IOException
The RDB E-BNFRDB = 'REDIS', $version, [AUX], [MODULE_AUX], [FUNCTION], {SELECTDB, [RESIZEDB], {RECORD}}, '0xFF', [$checksum];
RECORD = [EXPIRED], [IDLE | FREQ], KEY, VALUE;
SELECTDB = '0xFE', $length;
AUX = {'0xFA', $string, $string}; (*Introduced in rdb version 7*)
MODULE_AUX = {'0xF7', $module2}; (*Introduced in rdb version 9*)
FUNCTION = {'0xF6', $function}; (*Introduced in rdb version 10*)
RESIZEDB = '0xFB', $length, $length; (*Introduced in rdb version 7*)
EXPIRED = ('0xFD', $second) | ('0xFC', $millisecond);
IDLE = {'0xF8', $value-type}; (*Introduced in rdb version 9*)
FREQ = {'0xF9', $length}; (*Introduced in rdb version 9*)
KEY = $string;
VALUE = $value-type, ( $string
| $list
| $set
| $zset
| $hash
| $zset2 (*Introduced in rdb version 8*)
| $module (*Introduced in rdb version 8*)
| $module2 (*Introduced in rdb version 8*)
| $hashzipmap
| $listziplist
| $setintset
| $zsetziplist
| $hashziplist
| $listquicklist (*Introduced in rdb version 7*)
| $streamlistpacks); (*Introduced in rdb version 9*)
| $zsetlistpack); (*Introduced in rdb version 10*)
| $hashlistpack); (*Introduced in rdb version 10*)
| $listquicklist2); (*Introduced in rdb version 10*)
| $streamlistpacks2); (*Introduced in rdb version 10*)
- Returns:
- read bytes
- Throws:
IOException
- when read timeout
-
-