Class BrokerResponseNative
- java.lang.Object
-
- org.apache.pinot.common.response.broker.BrokerResponseNative
-
- All Implemented Interfaces:
BrokerResponse
public class BrokerResponseNative extends Object implements BrokerResponse
This class implements pinot-broker's response format for any given query. All fields either primitive data types, or native objects (as opposed to JSONObjects). Supports serialization via JSON.
-
-
Field Summary
Fields Modifier and Type Field Description static BrokerResponseNativeBROKER_ONLY_EXPLAIN_PLAN_OUTPUTstatic BrokerResponseNativeEMPTY_RESULTstatic BrokerResponseNativeNO_TABLE_RESULTstatic BrokerResponseNativeTABLE_DOES_NOT_EXIST
-
Constructor Summary
Constructors Constructor Description BrokerResponseNative()BrokerResponseNative(List<ProcessingException> exceptions)BrokerResponseNative(ProcessingException exception)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToExceptions(QueryProcessingException processingException)static BrokerResponseNativeempty()Get a new emptyBrokerResponseNative.static BrokerResponseNativefromJsonString(String jsonString)List<AggregationResult>getAggregationResults()intgetExceptionsSize()Get number of exceptions recorded in the response.longgetMinConsumingFreshnessTimeMs()Get the minimum freshness timestamp across consuming segments that were queriedlonggetNumConsumingSegmentsQueried()Get number of consuming segments that were queried.longgetNumDocsScanned()Get number of documents scanned while processing the query.longgetNumEntriesScannedInFilter()Get number of entries scanned in filter phase while processing the query.longgetNumEntriesScannedPostFilter()Get number of entries scanned post filter phase while processing the query.intgetNumRowsResultSet()Get the total number of rows in result setlonggetNumSegmentsMatched()Get number of segments that had at least one matching documentlonggetNumSegmentsProcessed()Get the number of segments processed by server after server side pruninglonggetNumSegmentsQueried()Get the number of segments queried by the broker after broker side pruningintgetNumServersQueried()Returns the number of servers queried.intgetNumServersResponded()Returns the number of servers responded.longgetOfflineResponseSerializationCpuTimeNs()Get the response serialization cpu time used against offline table in request handling, from the broker response.longgetOfflineSystemActivitiesCpuTimeNs()Get the system activities cpu time used against offline table in request handling, from the broker response.longgetOfflineThreadCpuTimeNs()Get the thread cpu time used against offline table in request handling, from the broker response.longgetOfflineTotalCpuTimeNs()Get the total cpu time(thread cpu time + system activities cpu time + response serialization cpu time) used against offline table in request handling, from the broker response.List<QueryProcessingException>getProcessingExceptions()Get the list of exceptionslonggetRealtimeResponseSerializationCpuTimeNs()Get the response serialization cpu time used against realtime table in request handling, from the broker response.longgetRealtimeSystemActivitiesCpuTimeNs()Get the system activities cpu time used against realtime table in request handling, from the broker response.longgetRealtimeThreadCpuTimeNs()Get the thread cpu time used against realtime table in request handling, from the broker response.longgetRealtimeTotalCpuTimeNs()Get the total cpu time(thread cpu time + system activities cpu time + response serialization cpu time) used against realtime table in request handling, from the broker response.ResultTablegetResultTable()List<String>getSegmentStatistics()SelectionResultsgetSelectionResults()longgetTimeUsedMs()longgetTotalDocs()Get total number of documents within the table hit.Map<String,String>getTraceInfo()booleanisNumGroupsLimitReached()Returns whether the number of groups limit has been reached.voidsetAggregationResults(List<AggregationResult> aggregationResults)voidsetExceptions(List<ProcessingException> exceptions)Set exceptions caught during request handling, into the broker response.voidsetMinConsumingFreshnessTimeMs(long minConsumingFreshnessTimeMs)voidsetNumConsumingSegmentsQueried(long numConsumingSegmentsQueried)voidsetNumDocsScanned(long numDocsScanned)voidsetNumEntriesScannedInFilter(long numEntriesScannedInFilter)voidsetNumEntriesScannedPostFilter(long numEntriesScannedPostFilter)voidsetNumGroupsLimitReached(boolean numGroupsLimitReached)voidsetNumRowsResultSet(int numRowsResultSet)Set the total number of rows in result setvoidsetNumSegmentsMatched(long numSegmentsMatched)voidsetNumSegmentsProcessed(long numSegmentsProcessed)voidsetNumSegmentsQueried(long numSegmentsQueried)voidsetNumServersQueried(int numServersQueried)Set the number of servers got queried by the broker.voidsetNumServersResponded(int numServersResponded)Set the number of servers responded to the broker.voidsetOfflineResponseSerializationCpuTimeNs(long offlineResponseSerializationCpuTimeNs)Set the response serialization cpu time used against offline table in request handling, into the broker response.voidsetOfflineSystemActivitiesCpuTimeNs(long offlineSystemActivitiesCpuTimeNs)Set the system activities cpu time used against offline table in request handling, into the broker response.voidsetOfflineThreadCpuTimeNs(long timeUsedMs)Set the total thread cpu time used against offline table in request handling, into the broker response.voidsetOfflineTotalCpuTimeNs(long offlineTotalCpuTimeNs)Set the total cpu time(thread cpu time + system activities cpu time + response serialization cpu time) used against offline table in request handling, into the broker response.voidsetProcessingExceptions(List<QueryProcessingException> processingExceptions)voidsetRealtimeResponseSerializationCpuTimeNs(long realtimeResponseSerializationCpuTimeNs)Set the response serialization cpu time used against realtime table in request handling, into the broker response.voidsetRealtimeSystemActivitiesCpuTimeNs(long realtimeSystemActivitiesCpuTimeNs)Set the system activities cpu time used against realtime table in request handling, into the broker response.voidsetRealtimeThreadCpuTimeNs(long timeUsedMs)Set the total thread cpu time used against realtime table in request handling, into the broker response.voidsetRealtimeTotalCpuTimeNs(long realtimeTotalCpuTimeNs)Set the total cpu time(thread cpu time + system activities cpu time + response serialization cpu time) used against realtime table in request handling, into the broker response.voidsetResultTable(ResultTable resultTable)voidsetSegmentStatistics(List<String> segmentStatistics)voidsetSelectionResults(SelectionResults selectionResults)voidsetTimeUsedMs(long timeUsedMs)Set the total time used in request handling, into the broker response.voidsetTotalDocs(long totalDocs)voidsetTraceInfo(Map<String,String> traceInfo)StringtoJsonString()Convert the broker response to JSON String.
-
-
-
Field Detail
-
EMPTY_RESULT
public static final BrokerResponseNative EMPTY_RESULT
-
NO_TABLE_RESULT
public static final BrokerResponseNative NO_TABLE_RESULT
-
TABLE_DOES_NOT_EXIST
public static final BrokerResponseNative TABLE_DOES_NOT_EXIST
-
BROKER_ONLY_EXPLAIN_PLAN_OUTPUT
public static final BrokerResponseNative BROKER_ONLY_EXPLAIN_PLAN_OUTPUT
-
-
Constructor Detail
-
BrokerResponseNative
public BrokerResponseNative()
-
BrokerResponseNative
public BrokerResponseNative(ProcessingException exception)
-
BrokerResponseNative
public BrokerResponseNative(List<ProcessingException> exceptions)
-
-
Method Detail
-
empty
public static BrokerResponseNative empty()
Get a new emptyBrokerResponseNative.
-
fromJsonString
public static BrokerResponseNative fromJsonString(String jsonString) throws IOException
- Throws:
IOException
-
getOfflineSystemActivitiesCpuTimeNs
public long getOfflineSystemActivitiesCpuTimeNs()
Description copied from interface:BrokerResponseGet the system activities cpu time used against offline table in request handling, from the broker response.- Specified by:
getOfflineSystemActivitiesCpuTimeNsin interfaceBrokerResponse
-
setOfflineSystemActivitiesCpuTimeNs
public void setOfflineSystemActivitiesCpuTimeNs(long offlineSystemActivitiesCpuTimeNs)
Description copied from interface:BrokerResponseSet the system activities cpu time used against offline table in request handling, into the broker response.- Specified by:
setOfflineSystemActivitiesCpuTimeNsin interfaceBrokerResponse
-
getRealtimeSystemActivitiesCpuTimeNs
public long getRealtimeSystemActivitiesCpuTimeNs()
Description copied from interface:BrokerResponseGet the system activities cpu time used against realtime table in request handling, from the broker response.- Specified by:
getRealtimeSystemActivitiesCpuTimeNsin interfaceBrokerResponse
-
setRealtimeSystemActivitiesCpuTimeNs
public void setRealtimeSystemActivitiesCpuTimeNs(long realtimeSystemActivitiesCpuTimeNs)
Description copied from interface:BrokerResponseSet the system activities cpu time used against realtime table in request handling, into the broker response.- Specified by:
setRealtimeSystemActivitiesCpuTimeNsin interfaceBrokerResponse
-
getOfflineThreadCpuTimeNs
public long getOfflineThreadCpuTimeNs()
Description copied from interface:BrokerResponseGet the thread cpu time used against offline table in request handling, from the broker response.- Specified by:
getOfflineThreadCpuTimeNsin interfaceBrokerResponse
-
setOfflineThreadCpuTimeNs
public void setOfflineThreadCpuTimeNs(long timeUsedMs)
Description copied from interface:BrokerResponseSet the total thread cpu time used against offline table in request handling, into the broker response.- Specified by:
setOfflineThreadCpuTimeNsin interfaceBrokerResponse
-
getRealtimeThreadCpuTimeNs
public long getRealtimeThreadCpuTimeNs()
Description copied from interface:BrokerResponseGet the thread cpu time used against realtime table in request handling, from the broker response.- Specified by:
getRealtimeThreadCpuTimeNsin interfaceBrokerResponse
-
setRealtimeThreadCpuTimeNs
public void setRealtimeThreadCpuTimeNs(long timeUsedMs)
Description copied from interface:BrokerResponseSet the total thread cpu time used against realtime table in request handling, into the broker response.- Specified by:
setRealtimeThreadCpuTimeNsin interfaceBrokerResponse
-
getOfflineResponseSerializationCpuTimeNs
public long getOfflineResponseSerializationCpuTimeNs()
Description copied from interface:BrokerResponseGet the response serialization cpu time used against offline table in request handling, from the broker response.- Specified by:
getOfflineResponseSerializationCpuTimeNsin interfaceBrokerResponse
-
setOfflineResponseSerializationCpuTimeNs
public void setOfflineResponseSerializationCpuTimeNs(long offlineResponseSerializationCpuTimeNs)
Description copied from interface:BrokerResponseSet the response serialization cpu time used against offline table in request handling, into the broker response.- Specified by:
setOfflineResponseSerializationCpuTimeNsin interfaceBrokerResponse
-
getRealtimeResponseSerializationCpuTimeNs
public long getRealtimeResponseSerializationCpuTimeNs()
Description copied from interface:BrokerResponseGet the response serialization cpu time used against realtime table in request handling, from the broker response.- Specified by:
getRealtimeResponseSerializationCpuTimeNsin interfaceBrokerResponse
-
setRealtimeResponseSerializationCpuTimeNs
public void setRealtimeResponseSerializationCpuTimeNs(long realtimeResponseSerializationCpuTimeNs)
Description copied from interface:BrokerResponseSet the response serialization cpu time used against realtime table in request handling, into the broker response.- Specified by:
setRealtimeResponseSerializationCpuTimeNsin interfaceBrokerResponse
-
getOfflineTotalCpuTimeNs
public long getOfflineTotalCpuTimeNs()
Description copied from interface:BrokerResponseGet the total cpu time(thread cpu time + system activities cpu time + response serialization cpu time) used against offline table in request handling, from the broker response.- Specified by:
getOfflineTotalCpuTimeNsin interfaceBrokerResponse
-
setOfflineTotalCpuTimeNs
public void setOfflineTotalCpuTimeNs(long offlineTotalCpuTimeNs)
Description copied from interface:BrokerResponseSet the total cpu time(thread cpu time + system activities cpu time + response serialization cpu time) used against offline table in request handling, into the broker response.- Specified by:
setOfflineTotalCpuTimeNsin interfaceBrokerResponse
-
getRealtimeTotalCpuTimeNs
public long getRealtimeTotalCpuTimeNs()
Description copied from interface:BrokerResponseGet the total cpu time(thread cpu time + system activities cpu time + response serialization cpu time) used against realtime table in request handling, from the broker response.- Specified by:
getRealtimeTotalCpuTimeNsin interfaceBrokerResponse
-
setRealtimeTotalCpuTimeNs
public void setRealtimeTotalCpuTimeNs(long realtimeTotalCpuTimeNs)
Description copied from interface:BrokerResponseSet the total cpu time(thread cpu time + system activities cpu time + response serialization cpu time) used against realtime table in request handling, into the broker response.- Specified by:
setRealtimeTotalCpuTimeNsin interfaceBrokerResponse
-
getSelectionResults
public SelectionResults getSelectionResults()
-
setSelectionResults
public void setSelectionResults(SelectionResults selectionResults)
-
getAggregationResults
public List<AggregationResult> getAggregationResults()
-
setAggregationResults
public void setAggregationResults(List<AggregationResult> aggregationResults)
-
getResultTable
public ResultTable getResultTable()
-
setResultTable
public void setResultTable(ResultTable resultTable)
-
getProcessingExceptions
public List<QueryProcessingException> getProcessingExceptions()
Description copied from interface:BrokerResponseGet the list of exceptions- Specified by:
getProcessingExceptionsin interfaceBrokerResponse
-
setProcessingExceptions
public void setProcessingExceptions(List<QueryProcessingException> processingExceptions)
-
getNumServersQueried
public int getNumServersQueried()
Description copied from interface:BrokerResponseReturns the number of servers queried.- Specified by:
getNumServersQueriedin interfaceBrokerResponse
-
setNumServersQueried
public void setNumServersQueried(int numServersQueried)
Description copied from interface:BrokerResponseSet the number of servers got queried by the broker.- Specified by:
setNumServersQueriedin interfaceBrokerResponse- Parameters:
numServersQueried- number of servers got queried.
-
getNumServersResponded
public int getNumServersResponded()
Description copied from interface:BrokerResponseReturns the number of servers responded.- Specified by:
getNumServersRespondedin interfaceBrokerResponse
-
setNumServersResponded
public void setNumServersResponded(int numServersResponded)
Description copied from interface:BrokerResponseSet the number of servers responded to the broker.- Specified by:
setNumServersRespondedin interfaceBrokerResponse- Parameters:
numServersResponded- number of servers responded.
-
getNumDocsScanned
public long getNumDocsScanned()
Description copied from interface:BrokerResponseGet number of documents scanned while processing the query.- Specified by:
getNumDocsScannedin interfaceBrokerResponse
-
setNumDocsScanned
public void setNumDocsScanned(long numDocsScanned)
-
getNumEntriesScannedInFilter
public long getNumEntriesScannedInFilter()
Description copied from interface:BrokerResponseGet number of entries scanned in filter phase while processing the query.- Specified by:
getNumEntriesScannedInFilterin interfaceBrokerResponse
-
setNumEntriesScannedInFilter
public void setNumEntriesScannedInFilter(long numEntriesScannedInFilter)
-
getNumEntriesScannedPostFilter
public long getNumEntriesScannedPostFilter()
Description copied from interface:BrokerResponseGet number of entries scanned post filter phase while processing the query.- Specified by:
getNumEntriesScannedPostFilterin interfaceBrokerResponse
-
setNumEntriesScannedPostFilter
public void setNumEntriesScannedPostFilter(long numEntriesScannedPostFilter)
-
getNumSegmentsQueried
public long getNumSegmentsQueried()
Description copied from interface:BrokerResponseGet the number of segments queried by the broker after broker side pruning- Specified by:
getNumSegmentsQueriedin interfaceBrokerResponse
-
setNumSegmentsQueried
public void setNumSegmentsQueried(long numSegmentsQueried)
-
getNumSegmentsProcessed
public long getNumSegmentsProcessed()
Description copied from interface:BrokerResponseGet the number of segments processed by server after server side pruning- Specified by:
getNumSegmentsProcessedin interfaceBrokerResponse
-
setNumSegmentsProcessed
public void setNumSegmentsProcessed(long numSegmentsProcessed)
-
getNumSegmentsMatched
public long getNumSegmentsMatched()
Description copied from interface:BrokerResponseGet number of segments that had at least one matching document- Specified by:
getNumSegmentsMatchedin interfaceBrokerResponse
-
setNumSegmentsMatched
public void setNumSegmentsMatched(long numSegmentsMatched)
-
getNumConsumingSegmentsQueried
public long getNumConsumingSegmentsQueried()
Description copied from interface:BrokerResponseGet number of consuming segments that were queried.- Specified by:
getNumConsumingSegmentsQueriedin interfaceBrokerResponse
-
setNumConsumingSegmentsQueried
public void setNumConsumingSegmentsQueried(long numConsumingSegmentsQueried)
-
getMinConsumingFreshnessTimeMs
public long getMinConsumingFreshnessTimeMs()
Description copied from interface:BrokerResponseGet the minimum freshness timestamp across consuming segments that were queried- Specified by:
getMinConsumingFreshnessTimeMsin interfaceBrokerResponse
-
setMinConsumingFreshnessTimeMs
public void setMinConsumingFreshnessTimeMs(long minConsumingFreshnessTimeMs)
-
getTotalDocs
public long getTotalDocs()
Description copied from interface:BrokerResponseGet total number of documents within the table hit.- Specified by:
getTotalDocsin interfaceBrokerResponse
-
setTotalDocs
public void setTotalDocs(long totalDocs)
-
isNumGroupsLimitReached
public boolean isNumGroupsLimitReached()
Description copied from interface:BrokerResponseReturns whether the number of groups limit has been reached.- Specified by:
isNumGroupsLimitReachedin interfaceBrokerResponse
-
setNumGroupsLimitReached
public void setNumGroupsLimitReached(boolean numGroupsLimitReached)
-
getTimeUsedMs
public long getTimeUsedMs()
-
setTimeUsedMs
public void setTimeUsedMs(long timeUsedMs)
Description copied from interface:BrokerResponseSet the total time used in request handling, into the broker response.- Specified by:
setTimeUsedMsin interfaceBrokerResponse
-
getNumRowsResultSet
public int getNumRowsResultSet()
Description copied from interface:BrokerResponseGet the total number of rows in result set- Specified by:
getNumRowsResultSetin interfaceBrokerResponse
-
setNumRowsResultSet
public void setNumRowsResultSet(int numRowsResultSet)
Description copied from interface:BrokerResponseSet the total number of rows in result set- Specified by:
setNumRowsResultSetin interfaceBrokerResponse
-
toJsonString
public String toJsonString() throws IOException
Description copied from interface:BrokerResponseConvert the broker response to JSON String.- Specified by:
toJsonStringin interfaceBrokerResponse- Throws:
IOException
-
setExceptions
public void setExceptions(List<ProcessingException> exceptions)
Description copied from interface:BrokerResponseSet exceptions caught during request handling, into the broker response.- Specified by:
setExceptionsin interfaceBrokerResponse
-
addToExceptions
public void addToExceptions(QueryProcessingException processingException)
-
getExceptionsSize
public int getExceptionsSize()
Description copied from interface:BrokerResponseGet number of exceptions recorded in the response.- Specified by:
getExceptionsSizein interfaceBrokerResponse
-
-