Class RPCRequest
-
- 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 RPCRequest extends SpecificRecordBase implements SpecificRecord
Request envelope for RPC message pattern
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
RPCRequest.Builder
RecordBuilder for RPCRequest instances.
-
Field Summary
Fields Modifier and Type Field Description public final static Schema
SCHEMA$
public String
sender
public String
correlationKey
public Instant
sendTime
public String
replyTopic
public int
replyPartition
public ByteBuffer
payload
-
Constructor Summary
Constructors Constructor Description RPCRequest()
Default constructor. RPCRequest(String sender, String correlationKey, Instant sendTime, String replyTopic, Integer replyPartition, 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. String
getReplyTopic()
Gets the value of the 'replyTopic' field. void
setReplyTopic(String value)
Sets the value of the 'replyTopic' field. int
getReplyPartition()
Gets the value of the 'replyPartition' field. void
setReplyPartition(int value)
Sets the value of the 'replyPartition' 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<RPCRequest>
getEncoder()
Return the BinaryMessageEncoder instance used by this class. static BinaryMessageDecoder<RPCRequest>
getDecoder()
Return the BinaryMessageDecoder instance used by this class. static BinaryMessageDecoder<RPCRequest>
createDecoder(SchemaStore resolver)
Create a new BinaryMessageDecoder instance for this class that uses the specified SchemaStore. ByteBuffer
toByteBuffer()
Serializes this RPCRequest to a ByteBuffer. static RPCRequest
fromByteBuffer(ByteBuffer b)
Deserializes a RPCRequest from a ByteBuffer. SpecificData
getSpecificData()
Schema
getSchema()
Object
get(int field$)
Conversion<out Object>
getConversion(int field)
void
put(int field$, Object value$)
static RPCRequest.Builder
newBuilder()
Creates a new RPCRequest RecordBuilder. static RPCRequest.Builder
newBuilder(RPCRequest.Builder other)
Creates a new RPCRequest RecordBuilder by copying an existing Builder. static RPCRequest.Builder
newBuilder(RPCRequest other)
Creates a new RPCRequest RecordBuilder by copying an existing RPCRequest 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
-
RPCRequest
RPCRequest()
Default constructor.
-
RPCRequest
RPCRequest(String sender, String correlationKey, Instant sendTime, String replyTopic, Integer replyPartition, ByteBuffer payload)
All-args constructor.- Parameters:
sender
- The sender identifiercorrelationKey
- Unique identifiersendTime
- Time ([Instant]) in milliseconds of the requestreplyTopic
- The topic the response needs to be posted onreplyPartition
- The partition we expect the response to be onpayload
- 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.
- Returns:
Unique identifier
-
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.
- Returns:
Time ([Instant]) in milliseconds of the request
-
setSendTime
void setSendTime(Instant value)
Sets the value of the 'sendTime' field. Time ([Instant]) in milliseconds of the request
- Parameters:
value
- the value to set.
-
getReplyTopic
String getReplyTopic()
Gets the value of the 'replyTopic' field.
- Returns:
The topic the response needs to be posted on
-
setReplyTopic
void setReplyTopic(String value)
Sets the value of the 'replyTopic' field. The topic the response needs to be posted on
- Parameters:
value
- the value to set.
-
getReplyPartition
int getReplyPartition()
Gets the value of the 'replyPartition' field.
- Returns:
The partition we expect the response to be on
-
setReplyPartition
void setReplyPartition(int value)
Sets the value of the 'replyPartition' field. The partition we expect the response to be on
- Parameters:
value
- the value to set.
-
getPayload
ByteBuffer getPayload()
Gets the value of the 'payload' field.
- Returns:
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<RPCRequest> getEncoder()
Return the BinaryMessageEncoder instance used by this class.
- Returns:
the message encoder used by this class
-
getDecoder
static BinaryMessageDecoder<RPCRequest> getDecoder()
Return the BinaryMessageDecoder instance used by this class.
- Returns:
the message decoder used by this class
-
createDecoder
static BinaryMessageDecoder<RPCRequest> 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- Returns:
a BinaryMessageDecoder instance for this class backed by the given SchemaStore
-
toByteBuffer
ByteBuffer toByteBuffer()
Serializes this RPCRequest to a ByteBuffer.
- Returns:
a buffer holding the serialized data for this instance
-
fromByteBuffer
static RPCRequest fromByteBuffer(ByteBuffer b)
Deserializes a RPCRequest from a ByteBuffer.
- Parameters:
b
- a byte buffer holding serialized data for an instance of this class- Returns:
a RPCRequest instance decoded from the given buffer
-
getSpecificData
SpecificData getSpecificData()
-
getSchema
Schema getSchema()
-
getConversion
Conversion<out Object> getConversion(int field)
-
newBuilder
static RPCRequest.Builder newBuilder()
Creates a new RPCRequest RecordBuilder.
- Returns:
A new RPCRequest RecordBuilder
-
newBuilder
static RPCRequest.Builder newBuilder(RPCRequest.Builder other)
Creates a new RPCRequest RecordBuilder by copying an existing Builder.
- Parameters:
other
- The existing builder to copy.- Returns:
A new RPCRequest RecordBuilder
-
newBuilder
static RPCRequest.Builder newBuilder(RPCRequest other)
Creates a new RPCRequest RecordBuilder by copying an existing RPCRequest instance.
- Parameters:
other
- The existing instance to copy.- Returns:
A new RPCRequest RecordBuilder
-
writeExternal
void writeExternal(ObjectOutput out)
-
readExternal
void readExternal(ObjectInput in)
-
-
-
-