Interface CustomMetric
- All Known Implementing Classes:
CustomAvgMetric
,CustomSumMetric
@Evolving
public interface CustomMetric
A custom metric. Data source can define supported custom metrics using this interface.
During query execution, Spark will collect the task metrics using
CustomTaskMetric
and combine the metrics at the driver side. How to combine task metrics is defined by the
metric class with the same metric name.
When Spark needs to aggregate task metrics, it will internally construct the instance of
custom metric class defined in data source by using reflection. Spark requires the class
implementing this interface to have a 0-arg constructor.- Since:
- 3.2.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
The initial value of this metric. -
Method Summary
Modifier and TypeMethodDescriptionaggregateTaskMetrics
(long[] taskMetrics) Given an array of task metric values, returns aggregated final metric value.Returns the description of custom metric.name()
Returns the name of custom metric.
-
Field Details
-
initialValue
static final long initialValueThe initial value of this metric.- See Also:
-
-
Method Details