public class GridRedisProtocolParser extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
ERROR_INT
Error while reading int.
|
| Constructor and Description |
|---|
GridRedisProtocolParser() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
ensureArrayStart(ByteBuffer buf)
Checks first byte is
ARRAY. |
static ByteBuffer |
nil()
Creates Nil response.
|
static ByteBuffer |
oKString() |
static String |
readBulkStr(ByteBuffer buf)
Reads a bulk string.
|
static int |
readInt(ByteBuffer buf)
Counts elements in buffer.
|
static ByteBuffer |
toArray(Collection<Object> vals)
Converts a resultant collection response to an array.
|
static ByteBuffer |
toArray(Map<Object,Object> vals)
Converts a resultant map response to an array.
|
static ByteBuffer |
toBulkString(Object val)
Converts a resultant object to a bulk string.
|
static ByteBuffer |
toGenericError(String errMsg)
Creates a generic error response.
|
static ByteBuffer |
toInteger(int integer)
Converts an integer result to a RESP integer.
|
static ByteBuffer |
toInteger(String integer)
Converts an integer result to a RESP integer.
|
static ByteBuffer |
toOrderedArray(Map<Object,Object> vals,
List<?> origin)
Converts a resultant map response to an array,
the order of elements in the resulting array is defined by the order of elements in the
origin collection. |
static ByteBuffer |
toSimpleString(byte[] b)
Creates a simple string data as a
ByteBuffer. |
static ByteBuffer |
toSimpleString(String val)
Converts a simple string data to a
ByteBuffer. |
static ByteBuffer |
toTypeError(String errMsg)
Creates an error response on operation against the wrong data type.
|
public static final int ERROR_INT
-1 used to mark null array.NIL,
Constant Field Valuespublic static boolean ensureArrayStart(ByteBuffer buf) throws IgniteCheckedException
ARRAY.buf - Buffer.False if no data available in buffer.IgniteCheckedException - If failed.public static String readBulkStr(ByteBuffer buf) throws IgniteCheckedException
buf - Buffer.IgniteCheckedException - If failed.public static int readInt(ByteBuffer buf) throws IgniteCheckedException
buf - Buffer.IgniteCheckedExceptionpublic static ByteBuffer toSimpleString(String val)
ByteBuffer.val - String to be converted to a simple string.public static ByteBuffer toSimpleString(byte[] b)
ByteBuffer.b - Bytes for a simple string.public static ByteBuffer oKString()
public static ByteBuffer toGenericError(String errMsg)
errMsg - Error message.public static ByteBuffer toTypeError(String errMsg)
errMsg - Error message.public static ByteBuffer toInteger(String integer)
integer - Integer result.public static ByteBuffer toInteger(int integer)
integer - Integer result.public static ByteBuffer nil()
public static ByteBuffer toBulkString(Object val)
val - Object.public static ByteBuffer toArray(Map<Object,Object> vals)
vals - Map.public static ByteBuffer toOrderedArray(Map<Object,Object> vals, List<?> origin)
origin collection.vals - Map.origin - List that defines the order of the resulting array.public static ByteBuffer toArray(Collection<Object> vals)
vals - Array elements.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.15.0 Release Date : April 25 2023