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

    • 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 identifier
        correlationKey - Unique identifier
        sendTime - Time ([Instant]) in milliseconds of the request
        replyTopic - The topic the response needs to be posted on
        replyPartition - The partition we expect the response to be on
        payload - The new value for payload
    • Method Detail

      • getSender

         String getSender()

        Gets the value of the 'sender' field.

        Returns:

        The sender identifier

      • 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.
      • 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

      • 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