Class RPCResponse
-
- All Implemented Interfaces:
-
java.io.Externalizable
,java.io.Serializable
,java.lang.Comparable
,org.apache.avro.generic.GenericContainer
,org.apache.avro.generic.GenericRecord
,org.apache.avro.generic.IndexedRecord
,org.apache.avro.specific.SpecificRecord
public class RPCResponse extends SpecificRecordBase implements SpecificRecord
Response envelope for RPC message pattern
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
RPCResponse.Builder
RecordBuilder for RPCResponse instances.
-
Field Summary
Fields Modifier and Type Field Description public final static Schema
SCHEMA$
public String
sender
public String
correlationKey
public Instant
sendTime
public ResponseStatus
responseStatus
public ByteBuffer
payload
-
Constructor Summary
Constructors Constructor Description RPCResponse()
Default constructor. RPCResponse(String sender, String correlationKey, Instant sendTime, ResponseStatus responseStatus, ByteBuffer payload)
All-args constructor.
-
Method Summary
Modifier and Type Method Description String
getSender()
Gets the value of the 'sender' field. void
setSender(String value)
Sets the value of the 'sender' field. String
getCorrelationKey()
Gets the value of the 'correlationKey' field. void
setCorrelationKey(String value)
Sets the value of the 'correlationKey' field. Instant
getSendTime()
Gets the value of the 'sendTime' field. void
setSendTime(Instant value)
Sets the value of the 'sendTime' field. ResponseStatus
getResponseStatus()
Gets the value of the 'responseStatus' field. void
setResponseStatus(ResponseStatus value)
Sets the value of the 'responseStatus' field. ByteBuffer
getPayload()
Gets the value of the 'payload' field. void
setPayload(ByteBuffer value)
Sets the value of the 'payload' field. static Schema
getClassSchema()
static BinaryMessageEncoder<RPCResponse>
getEncoder()
Return the BinaryMessageEncoder instance used by this class. static BinaryMessageDecoder<RPCResponse>
getDecoder()
Return the BinaryMessageDecoder instance used by this class. static BinaryMessageDecoder<RPCResponse>
createDecoder(SchemaStore resolver)
Create a new BinaryMessageDecoder instance for this class that uses the specified SchemaStore. ByteBuffer
toByteBuffer()
Serializes this RPCResponse to a ByteBuffer. static RPCResponse
fromByteBuffer(ByteBuffer b)
Deserializes a RPCResponse from a ByteBuffer. SpecificData
getSpecificData()
Schema
getSchema()
Object
get(int field$)
Conversion<out Object>
getConversion(int field)
void
put(int field$, Object value$)
static RPCResponse.Builder
newBuilder()
Creates a new RPCResponse RecordBuilder. static RPCResponse.Builder
newBuilder(RPCResponse.Builder other)
Creates a new RPCResponse RecordBuilder by copying an existing Builder. static RPCResponse.Builder
newBuilder(RPCResponse other)
Creates a new RPCResponse RecordBuilder by copying an existing RPCResponse instance. void
writeExternal(ObjectOutput out)
void
readExternal(ObjectInput in)
-
Methods inherited from class org.apache.avro.specific.SpecificRecordBase
compareTo, customDecode, customEncode, equals, hashCode, toString
-
Methods inherited from class org.apache.avro.generic.GenericRecord
hasField
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
RPCResponse
RPCResponse()
Default constructor.
-
RPCResponse
RPCResponse(String sender, String correlationKey, Instant sendTime, ResponseStatus responseStatus, ByteBuffer payload)
All-args constructor.- Parameters:
sender
- The sender identifiercorrelationKey
- Unique identifiersendTime
- Time ([Instant]) in milliseconds of the responseresponseStatus
- Status enum on the response to help with response handlingpayload
- The new value for payload
-
-
Method Detail
-
setSender
void setSender(String value)
Sets the value of the 'sender' field. The sender identifier
- Parameters:
value
- the value to set.
-
getCorrelationKey
String getCorrelationKey()
Gets the value of the 'correlationKey' field.
-
setCorrelationKey
void setCorrelationKey(String value)
Sets the value of the 'correlationKey' field. Unique identifier
- Parameters:
value
- the value to set.
-
getSendTime
Instant getSendTime()
Gets the value of the 'sendTime' field.
-
setSendTime
void setSendTime(Instant value)
Sets the value of the 'sendTime' field. Time ([Instant]) in milliseconds of the response
- Parameters:
value
- the value to set.
-
getResponseStatus
ResponseStatus getResponseStatus()
Gets the value of the 'responseStatus' field.
-
setResponseStatus
void setResponseStatus(ResponseStatus value)
Sets the value of the 'responseStatus' field. Status enum on the response to help with response handling
- Parameters:
value
- the value to set.
-
getPayload
ByteBuffer getPayload()
Gets the value of the 'payload' field.
-
setPayload
void setPayload(ByteBuffer value)
Sets the value of the 'payload' field.
- Parameters:
value
- the value to set.
-
getClassSchema
static Schema getClassSchema()
-
getEncoder
static BinaryMessageEncoder<RPCResponse> getEncoder()
Return the BinaryMessageEncoder instance used by this class.
-
getDecoder
static BinaryMessageDecoder<RPCResponse> getDecoder()
Return the BinaryMessageDecoder instance used by this class.
-
createDecoder
static BinaryMessageDecoder<RPCResponse> createDecoder(SchemaStore resolver)
Create a new BinaryMessageDecoder instance for this class that uses the specified SchemaStore.
- Parameters:
resolver
- a SchemaStore used to find schemas by fingerprint
-
toByteBuffer
ByteBuffer toByteBuffer()
Serializes this RPCResponse to a ByteBuffer.
-
fromByteBuffer
static RPCResponse fromByteBuffer(ByteBuffer b)
Deserializes a RPCResponse from a ByteBuffer.
- Parameters:
b
- a byte buffer holding serialized data for an instance of this class
-
getSpecificData
SpecificData getSpecificData()
-
getSchema
Schema getSchema()
-
getConversion
Conversion<out Object> getConversion(int field)
-
newBuilder
static RPCResponse.Builder newBuilder()
Creates a new RPCResponse RecordBuilder.
-
newBuilder
static RPCResponse.Builder newBuilder(RPCResponse.Builder other)
Creates a new RPCResponse RecordBuilder by copying an existing Builder.
- Parameters:
other
- The existing builder to copy.
-
newBuilder
static RPCResponse.Builder newBuilder(RPCResponse other)
Creates a new RPCResponse RecordBuilder by copying an existing RPCResponse instance.
- Parameters:
other
- The existing instance to copy.
-
writeExternal
void writeExternal(ObjectOutput out)
-
readExternal
void readExternal(ObjectInput in)
-
-
-
-