Package alluxio.network.protocol
Enum RPCMessage.Type
- java.lang.Object
-
- java.lang.Enum<RPCMessage.Type>
-
- alluxio.network.protocol.RPCMessage.Type
-
- All Implemented Interfaces:
EncodedMessage
,java.io.Serializable
,java.lang.Comparable<RPCMessage.Type>
- Enclosing class:
- RPCMessage
public static enum RPCMessage.Type extends java.lang.Enum<RPCMessage.Type> implements EncodedMessage
The possible types of RPC messages.
-
-
Enum Constant Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RPCMessage.Type
decode(io.netty.buffer.ByteBuf in)
Returns the type represented by the id from the input ByteBuf.void
encode(io.netty.buffer.ByteBuf out)
Encodes the message to the outputByteBuf
.int
getEncodedLength()
Returns the number bytes for the message when it is encoded.int
getId()
Returns the int identifier of the type.static RPCMessage.Type
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static RPCMessage.Type[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
RPC_READ_REQUEST
public static final RPCMessage.Type RPC_READ_REQUEST
-
RPC_WRITE_REQUEST
public static final RPCMessage.Type RPC_WRITE_REQUEST
-
RPC_RESPONSE
public static final RPCMessage.Type RPC_RESPONSE
-
RPC_HEARTBEAT
public static final RPCMessage.Type RPC_HEARTBEAT
-
RPC_LOCAL_BLOCK_OPEN_REQUEST
public static final RPCMessage.Type RPC_LOCAL_BLOCK_OPEN_REQUEST
-
RPC_LOCAL_BLOCK_OPEN_RESPONSE
public static final RPCMessage.Type RPC_LOCAL_BLOCK_OPEN_RESPONSE
-
RPC_LOCAL_BLOCK_CLOSE_REQUEST
public static final RPCMessage.Type RPC_LOCAL_BLOCK_CLOSE_REQUEST
-
RPC_LOCAL_BLOCK_CREATE_REQUEST
public static final RPCMessage.Type RPC_LOCAL_BLOCK_CREATE_REQUEST
-
RPC_LOCAL_BLOCK_CREATE_RESPONSE
public static final RPCMessage.Type RPC_LOCAL_BLOCK_CREATE_RESPONSE
-
RPC_LOCAL_BLOCK_COMPLETE_REQUEST
public static final RPCMessage.Type RPC_LOCAL_BLOCK_COMPLETE_REQUEST
-
RPC_READ_RESPONSE
public static final RPCMessage.Type RPC_READ_RESPONSE
-
RPC_ASYNC_CACHE_REQUEST
public static final RPCMessage.Type RPC_ASYNC_CACHE_REQUEST
-
RPC_UNKNOWN
public static final RPCMessage.Type RPC_UNKNOWN
-
-
Method Detail
-
values
public static RPCMessage.Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (RPCMessage.Type c : RPCMessage.Type.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RPCMessage.Type valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getEncodedLength
public int getEncodedLength()
Description copied from interface:EncodedMessage
Returns the number bytes for the message when it is encoded.- Specified by:
getEncodedLength
in interfaceEncodedMessage
- Returns:
- the length of the encoded message, in bytes
-
encode
public void encode(io.netty.buffer.ByteBuf out)
Description copied from interface:EncodedMessage
Encodes the message to the outputByteBuf
.- Specified by:
encode
in interfaceEncodedMessage
- Parameters:
out
- the output ByteBuf where the message should be encoded
-
getId
public int getId()
Returns the int identifier of the type. Note: This is only used for getting the int representation of the type foralluxio.worker.DataServerMessage
, since that class needs to manually encode all messages.alluxio.worker.DataServerMessage
and this method should no longer be needed when the client is converted to use Netty.- Returns:
- the int id of the type
-
decode
public static RPCMessage.Type decode(io.netty.buffer.ByteBuf in)
Returns the type represented by the id from the input ByteBuf. This must be updated to add new message types.- Parameters:
in
- The inputByteBuf
to decode into a type- Returns:
- The decoded message type
-
-