Package org.apache.solr.client.solrj.io.stream.metrics

## Class CountDistinctMetric

- java.lang.Object
- - org.apache.solr.client.solrj.io.stream.metrics.Metric
  - - org.apache.solr.client.solrj.io.stream.metrics.CountDistinctMetric

All Implemented Interfaces:
  `Expressible`

    public class CountDistinctMetric
    extends Metric

### Field Summary

Fields
`static String` `APPROX_COUNT_DISTINCT`
`static String` `COUNT_DISTINCT`

### Fields inherited from class org.apache.solr.client.solrj.io.stream.metrics.Metric

`outputLong`

### Constructor Summary

Constructors
`CountDistinctMetric​(String columnName)`
`CountDistinctMetric​(String columnName, boolean isApproximate)`
`CountDistinctMetric​(StreamExpression expression, StreamFactory factory)`

### Method Summary

All Methods Instance Methods Concrete Methods
`String[]` `getColumns()`
`Number` `getValue()`
`Metric` `newInstance()`
`StreamExpressionParameter` `toExpression​(StreamFactory factory)`
`void` `update​(Tuple tuple)`

### Methods inherited from class org.apache.solr.client.solrj.io.stream.metrics.Metric

`getFunctionName, getIdentifier, getMetricNodeId, setFunctionName, setIdentifier, setIdentifier, toExplanation`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### COUNT_DISTINCT

    public static final String COUNT_DISTINCT

See Also:
  Constant Field Values

#### APPROX_COUNT_DISTINCT

    public static final String APPROX_COUNT_DISTINCT

See Also:
  Constant Field Values

### Constructor Detail

#### CountDistinctMetric

    public CountDistinctMetric​(String columnName)

#### CountDistinctMetric

    public CountDistinctMetric​(String columnName,
                               boolean isApproximate)

#### CountDistinctMetric

    public CountDistinctMetric​(StreamExpression expression,
                               StreamFactory factory)
                        throws IOException

Throws:
  `IOException`

### Method Detail

#### update

    public void update​(Tuple tuple)

Specified by:
  `update` in class `Metric`

#### newInstance

    public Metric newInstance()

Specified by:
  `newInstance` in class `Metric`

#### getColumns

    public String[] getColumns()

Specified by:
  `getColumns` in class `Metric`

#### getValue

    public Number getValue()

Specified by:
  `getValue` in class `Metric`

#### toExpression

    public StreamExpressionParameter toExpression​(StreamFactory factory)
                                           throws IOException

Throws:
  `IOException`