Package org.apache.pinot.spi.trace
Interface InvocationRecording
-
- All Known Subinterfaces:
InvocationScope
- All Known Implementing Classes:
BaseRecording,NoOpRecording
public interface InvocationRecordingInterface for recording data about query execution. By default, nothing happens with this data and regular tracing is used. The user needs to register a {@see Tracer} implementation which produces recordings implementing this interface for output to be captured.
-
-
Method Summary
Modifier and Type Method Description booleanisEnabled()default voidsetBytesProcessed(int bytesScanned)Sets the number of bytes scanned by the operator if this is possible to compute.default voidsetColumnCardinality(int cardinality)If known, record the cardinality of the column within the segment this operator invoked ondefault voidsetColumnName(String columnName)default voidsetDocIdRange(int firstDocId, int lastDocId)Records the range of docIds during the operator invocation.default voidsetFilter(FilterType filterType, String predicateType)If the operator is a filter, determines the filter type (scan or index) and the predicate typedefault voidsetFunctionName(String functionName)default voidsetInputDataType(FieldSpec.DataType dataType, boolean singleValue)Records the input datatype before a stage of query executiondefault voidsetNumChildren(int numChildren)default voidsetNumDocsMatchingAfterFilter(int numDocsMatchingAfterFilter)Sets the number of documents matching after a filter has been applied.default voidsetNumDocsScanned(int numDocsScanned)Sets the number of docs scanned by the operator.default voidsetNumGroups(int numGroupsLimit, int numGroups)Sets the upper bound for the number of groups in a group by evaluation, along with the actual number of groups.default voidsetNumSegments(int numSegments)default voidsetNumTasks(int numTasks)default voidsetOutputDataType(FieldSpec.DataType dataType, boolean singleValue)Records the output datatype after a stage of query execution
-
-
-
Method Detail
-
setNumGroups
default void setNumGroups(int numGroupsLimit, int numGroups)Sets the upper bound for the number of groups in a group by evaluation, along with the actual number of groups. The ratio of these two quantities indicates how efficient the group by was, and if truncation has occurred.- Parameters:
numGroupsLimit- the upper bound for the number of groupsnumGroups- the actual number of groups
-
setNumDocsScanned
default void setNumDocsScanned(int numDocsScanned)
Sets the number of docs scanned by the operator.- Parameters:
numDocsScanned- how many docs were scanned.
-
setNumDocsMatchingAfterFilter
default void setNumDocsMatchingAfterFilter(int numDocsMatchingAfterFilter)
Sets the number of documents matching after a filter has been applied. Indicates whether the index was selective or not.- Parameters:
numDocsMatchingAfterFilter- how many docs still match after applying the filter
-
setBytesProcessed
default void setBytesProcessed(int bytesScanned)
Sets the number of bytes scanned by the operator if this is possible to compute.- Parameters:
bytesScanned- the number of bytes scanned
-
setNumTasks
default void setNumTasks(int numTasks)
- Parameters:
numTasks- the number of threads dispatched to
-
setNumChildren
default void setNumChildren(int numChildren)
- Parameters:
numChildren- the number of children operators/transforms/projections
-
setNumSegments
default void setNumSegments(int numSegments)
- Parameters:
numSegments- the number of segments
-
setFilter
default void setFilter(FilterType filterType, String predicateType)
If the operator is a filter, determines the filter type (scan or index) and the predicate type- Parameters:
filterType- SCAN or INDEXpredicateType- e.g. BETWEEN, REGEXP_LIKE
-
setInputDataType
default void setInputDataType(FieldSpec.DataType dataType, boolean singleValue)
Records the input datatype before a stage of query execution- Parameters:
dataType- the output data typesingleValue- if the output data type is single-value
-
setOutputDataType
default void setOutputDataType(FieldSpec.DataType dataType, boolean singleValue)
Records the output datatype after a stage of query execution- Parameters:
dataType- the output data typesingleValue- if the output data type is single-value
-
setDocIdRange
default void setDocIdRange(int firstDocId, int lastDocId)Records the range of docIds during the operator invocation. This is useful for implicating a range of records in a slow operator invocation.- Parameters:
firstDocId- the first docId in the blocklastDocId- the last docId in the block
-
setColumnCardinality
default void setColumnCardinality(int cardinality)
If known, record the cardinality of the column within the segment this operator invoked on- Parameters:
cardinality- the number of distinct values
-
setColumnName
default void setColumnName(String columnName)
- Parameters:
columnName- the name of the column operated on
-
setFunctionName
default void setFunctionName(String functionName)
- Parameters:
functionName- the function being evaluated
-
isEnabled
boolean isEnabled()
- Returns:
- true if the recording is enabled. If producing a value is costly, the caller should check whether the recording is enabled before producing the value to keep tracing overhead down.
-
-