Class MultiKeyResponseWrapper<K>
- java.lang.Object
-
- com.linkedin.venice.listener.response.AbstractReadResponse
-
- com.linkedin.venice.listener.response.MultiKeyResponseWrapper<K>
-
- All Implemented Interfaces:
ReadResponse
- Direct Known Subclasses:
ComputeResponseWrapper
,MultiGetResponseWrapper
public abstract class MultiKeyResponseWrapper<K> extends AbstractReadResponse
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addRecord(K record)
io.netty.buffer.ByteBuf
getResponseBody()
N.B.: This function is backed by aLazy
property.abstract int
getResponseSchemaIdHeader()
ReadResponseStats
getStats()
ReadResponseStatsRecorder
getStatsRecorder()
java.lang.String
toString()
-
Methods inherited from class com.linkedin.venice.listener.response.AbstractReadResponse
getCompressionStrategy, getRCU, isFound, isStreamingResponse, setCompressionStrategy, setRCU, setStreamingResponse
-
-
-
-
Method Detail
-
addRecord
public void addRecord(K record)
- Parameters:
record
- to be added into the container.- Throws:
java.lang.IllegalStateException
- if called aftergetResponseBody()
-
getResponseSchemaIdHeader
public abstract int getResponseSchemaIdHeader()
- Specified by:
getResponseSchemaIdHeader
in interfaceReadResponse
- Specified by:
getResponseSchemaIdHeader
in classAbstractReadResponse
-
getStats
public ReadResponseStats getStats()
-
getStatsRecorder
public ReadResponseStatsRecorder getStatsRecorder()
- Specified by:
getStatsRecorder
in classAbstractReadResponse
-
getResponseBody
public io.netty.buffer.ByteBuf getResponseBody()
N.B.: This function is backed by aLazy
property. The first time it is called, the response is recorded and will therefore not be regenerated even if the more records are added. To make this behavior unambiguous, it is no longer possible to add records after calling this function, as therecords
property then becomes an empty list.- Specified by:
getResponseBody
in interfaceReadResponse
- Specified by:
getResponseBody
in classAbstractReadResponse
- Returns:
- the serialized response as a
ByteBuf
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-