39 lines
999 B
Java
39 lines
999 B
Java
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
package org.redkalex.cache.redis;
|
|
|
|
import org.redkale.net.client.ClientConnection;
|
|
import org.redkale.util.ByteArray;
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
/**
|
|
*
|
|
* @author zhangjx
|
|
*/
|
|
public class RedisCacheReqPing extends RedisCacheRequest {
|
|
|
|
private static final byte[] BYTES = new ByteArray()
|
|
.put((byte) '*')
|
|
.put((byte) '1')
|
|
.put((byte) '\r', (byte) '\n')
|
|
.put((byte) '$')
|
|
.put((byte) '4')
|
|
.put((byte) '\r', (byte) '\n')
|
|
.put("PING".getBytes(StandardCharsets.UTF_8))
|
|
.put((byte) '\r', (byte) '\n').getBytes();
|
|
|
|
@Override
|
|
public void writeTo(ClientConnection conn, ByteArray writer) {
|
|
writer.put(BYTES);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return getClass().getSimpleName() + "{PING}";
|
|
}
|
|
}
|