Skip to content

Commit

Permalink
v0.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
leonchen83 committed Feb 17, 2022
1 parent 8ff1013 commit 3a62ab8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class RedisConstants {
public static final byte[] RESTORE = "restore".getBytes();
public static final byte[] FUNCTION = "function".getBytes();
public static final byte[] EXPIREAT = "expireat".getBytes();
public static final byte[] PEXPIREAT = "pexpireat".getBytes();
public static final byte[] DESCRIPTION = "description".getBytes();
public static final byte[] RESTORE_ASKING = "restore-asking".getBytes();

Expand All @@ -66,6 +67,7 @@ public class RedisConstants {
public static final ByteBuffer RESTORE_BUF = ByteBuffer.wrap(RESTORE);
public static final ByteBuffer FUNCTION_BUF = ByteBuffer.wrap(FUNCTION);
public static final ByteBuffer EXPIREAT_BUF = ByteBuffer.wrap(EXPIREAT);
public static final ByteBuffer PEXPIREAT_BUF = ByteBuffer.wrap(PEXPIREAT);
public static final ByteBuffer DESCRIPTION_BUF = ByteBuffer.wrap(DESCRIPTION);
public static final ByteBuffer RESTORE_ASKING_BUF = ByteBuffer.wrap(RESTORE_ASKING);

Expand All @@ -88,6 +90,7 @@ public class RedisConstants {
public static final ByteBuffers RESTORE_BUFS = ByteBuffers.wrap(RESTORE);
public static final ByteBuffers FUNCTION_BUFS = ByteBuffers.wrap(FUNCTION);
public static final ByteBuffers EXPIREAT_BUFS = ByteBuffers.wrap(EXPIREAT);
public static final ByteBuffers PEXPIREAT_BUFS = ByteBuffers.wrap(PEXPIREAT);
public static final ByteBuffers DESCRIPTION_BUFS = ByteBuffers.wrap(DESCRIPTION);
public static final ByteBuffers RESTORE_ASKING_BUFS = ByteBuffers.wrap(RESTORE_ASKING);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import static com.moilioncircle.redis.rdb.cli.ext.datatype.RedisConstants.FUNCTION_BUF;
import static com.moilioncircle.redis.rdb.cli.ext.datatype.RedisConstants.HMSET;
import static com.moilioncircle.redis.rdb.cli.ext.datatype.RedisConstants.LOAD_BUF;
import static com.moilioncircle.redis.rdb.cli.ext.datatype.RedisConstants.PEXPIREAT;
import static com.moilioncircle.redis.rdb.cli.ext.datatype.RedisConstants.REPLACE_BUF;
import static com.moilioncircle.redis.rdb.cli.ext.datatype.RedisConstants.RESTORE_BUF;
import static com.moilioncircle.redis.rdb.cli.ext.datatype.RedisConstants.RPUSH;
Expand Down Expand Up @@ -104,7 +105,7 @@ public Event applyExpireTime(RedisInputStream in, int version, ContextKeyValuePa
public Event applyExpireTimeMs(RedisInputStream in, int version, ContextKeyValuePair context) throws IOException {
DummyKeyValuePair kv = (DummyKeyValuePair) super.applyExpireTimeMs(in, version, context);
if (!kv.isContains() || kv.getKey() == null) return context.valueOf(kv);
emit(this.out, EXPIREAT, kv.getKey(), String.valueOf(kv.getExpiredMs() / 1000).getBytes());
emit(this.out, PEXPIREAT, kv.getKey(), String.valueOf(kv.getExpiredMs()).getBytes());
return context.valueOf(kv);
}

Expand Down

0 comments on commit 3a62ab8

Please sign in to comment.