Package org.teiid.query.analysis
Class AnalysisRecord
- java.lang.Object
-
- org.teiid.query.analysis.AnalysisRecord
-
public class AnalysisRecord extends Object
The AnalysisRecord holds all debug/analysis information for a particular query as it is executed. This includes:
- Flags indicating what should be recorded
- Query plan, if requested
- Annotations indicating important decisions, if requested
- Debug trace information, if requested
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AnalysisRecord(boolean recordQueryPlan, boolean recordDebug)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAnnotation(String category, String annotation, String resolution, Annotation.Priority priority)
void
addAnnotation(Annotation annotation)
Add an annotation.static void
addLanaguageObjects(PlanNode node, String key, Collection<? extends LanguageObject> objects)
static AnalysisRecord
createNonRecordingRecord()
Collection<Annotation>
getAnnotations()
Get annotations.String
getDebugLog()
Get debug trace log recorded to writer.static List<String>
getOutputColumnProperties(List<? extends Expression> projectedSymbols)
Helper method to turn a list of projected symbols into a suitable list of output column strings with name and type.void
println(String debugLine)
Add line to debug log This can only be used ifrecordDebug
returns true.boolean
recordAnnotations()
Determine whether annotations should be recordedboolean
recordDebug()
Determine whether debug trace log should be recordedboolean
recordQueryPlan()
Determine whether query plan should be recordedvoid
stopDebugLog()
-
-
-
Field Detail
-
PROP_OUTPUT_COLS
public static final String PROP_OUTPUT_COLS
- See Also:
- Constant Field Values
-
PROP_ID
public static final String PROP_ID
- See Also:
- Constant Field Values
-
PROP_DATA_BYTES_SENT
public static final String PROP_DATA_BYTES_SENT
- See Also:
- Constant Field Values
-
PROP_CRITERIA
public static final String PROP_CRITERIA
- See Also:
- Constant Field Values
-
PROP_SELECT_COLS
public static final String PROP_SELECT_COLS
- See Also:
- Constant Field Values
-
PROP_GROUP_COLS
public static final String PROP_GROUP_COLS
- See Also:
- Constant Field Values
-
PROP_GROUP_MAPPING
public static final String PROP_GROUP_MAPPING
- See Also:
- Constant Field Values
-
PROP_SQL
public static final String PROP_SQL
- See Also:
- Constant Field Values
-
PROP_MODEL_NAME
public static final String PROP_MODEL_NAME
- See Also:
- Constant Field Values
-
PROP_SHARING_ID
public static final String PROP_SHARING_ID
- See Also:
- Constant Field Values
-
PROP_DEPENDENT
public static final String PROP_DEPENDENT
- See Also:
- Constant Field Values
-
PROP_JOIN_STRATEGY
public static final String PROP_JOIN_STRATEGY
- See Also:
- Constant Field Values
-
PROP_JOIN_TYPE
public static final String PROP_JOIN_TYPE
- See Also:
- Constant Field Values
-
PROP_JOIN_CRITERIA
public static final String PROP_JOIN_CRITERIA
- See Also:
- Constant Field Values
-
PROP_EXECUTION_PLAN
public static final String PROP_EXECUTION_PLAN
- See Also:
- Constant Field Values
-
PROP_INTO_GROUP
public static final String PROP_INTO_GROUP
- See Also:
- Constant Field Values
-
PROP_UPSERT
public static final String PROP_UPSERT
- See Also:
- Constant Field Values
-
PROP_SORT_COLS
public static final String PROP_SORT_COLS
- See Also:
- Constant Field Values
-
PROP_SORT_MODE
public static final String PROP_SORT_MODE
- See Also:
- Constant Field Values
-
PROP_ROLLUP
public static final String PROP_ROLLUP
- See Also:
- Constant Field Values
-
PROP_NODE_STATS_LIST
public static final String PROP_NODE_STATS_LIST
- See Also:
- Constant Field Values
-
PROP_NODE_COST_ESTIMATES
public static final String PROP_NODE_COST_ESTIMATES
- See Also:
- Constant Field Values
-
PROP_ROW_OFFSET
public static final String PROP_ROW_OFFSET
- See Also:
- Constant Field Values
-
PROP_ROW_LIMIT
public static final String PROP_ROW_LIMIT
- See Also:
- Constant Field Values
-
PROP_WITH
public static final String PROP_WITH
- See Also:
- Constant Field Values
-
PROP_WINDOW_FUNCTIONS
public static final String PROP_WINDOW_FUNCTIONS
- See Also:
- Constant Field Values
-
PROP_TABLE_FUNCTION
public static final String PROP_TABLE_FUNCTION
- See Also:
- Constant Field Values
-
PROP_STREAMING
public static final String PROP_STREAMING
- See Also:
- Constant Field Values
-
PROP_EXPRESSION
public static final String PROP_EXPRESSION
- See Also:
- Constant Field Values
-
PROP_RESULT_SET
public static final String PROP_RESULT_SET
- See Also:
- Constant Field Values
-
PROP_PROGRAM
public static final String PROP_PROGRAM
- See Also:
- Constant Field Values
-
PROP_VARIABLE
public static final String PROP_VARIABLE
- See Also:
- Constant Field Values
-
PROP_THEN
public static final String PROP_THEN
- See Also:
- Constant Field Values
-
PROP_ELSE
public static final String PROP_ELSE
- See Also:
- Constant Field Values
-
PROP_PLANNING_TIME
public static final String PROP_PLANNING_TIME
- See Also:
- Constant Field Values
-
-
Method Detail
-
createNonRecordingRecord
public static AnalysisRecord createNonRecordingRecord()
-
recordQueryPlan
public boolean recordQueryPlan()
Determine whether query plan should be recorded- Returns:
- True to record
-
recordAnnotations
public boolean recordAnnotations()
Determine whether annotations should be recorded- Returns:
- True to record
-
recordDebug
public boolean recordDebug()
Determine whether debug trace log should be recorded- Returns:
- True to record
-
addAnnotation
public void addAnnotation(String category, String annotation, String resolution, Annotation.Priority priority)
-
addAnnotation
public void addAnnotation(Annotation annotation)
Add an annotation. This can only be used ifrecordAnnotations()
returns true.- Parameters:
annotation
- Annotation to add
-
getAnnotations
public Collection<Annotation> getAnnotations()
Get annotations.- Returns:
-
println
public void println(String debugLine)
Add line to debug log This can only be used ifrecordDebug
returns true.- Parameters:
debugLine
- Text to add to debug writer
-
getDebugLog
public String getDebugLog()
Get debug trace log recorded to writer. Typically this is used once at the end of query execution.- Returns:
-
stopDebugLog
public void stopDebugLog()
-
getOutputColumnProperties
public static List<String> getOutputColumnProperties(List<? extends Expression> projectedSymbols)
Helper method to turn a list of projected symbols into a suitable list of output column strings with name and type.- Parameters:
projectedSymbols
- The list of SingleElementSymbol projected from a plan or node- Returns:
- List of output columns for sending to the client as part of the plan
-
addLanaguageObjects
public static void addLanaguageObjects(PlanNode node, String key, Collection<? extends LanguageObject> objects)
-
-