@Override public void annotate(final InputRow row, final RowAnnotation annotation) { final RowAnnotationImpl annotationImpl = (RowAnnotationImpl) annotation; annotationImpl.incrementRowCount(1); }
@Override public void transferAnnotations(final RowAnnotation from, final RowAnnotation to) { final RowAnnotationImpl fromImpl = (RowAnnotationImpl) from; final RowAnnotationImpl toImpl = (RowAnnotationImpl) to; toImpl.incrementRowCount(fromImpl.getRowCount()); fromImpl.resetRowCount(); }
public void run(final InputRow row, final String value, final int distinctCount) { if (value == null) { if (_recordAnnotations) { _annotationFactory.annotate(row, distinctCount, _nullValueAnnotation); } else { ((RowAnnotationImpl) _nullValueAnnotation).incrementRowCount(distinctCount); } } else { RowAnnotation annotation; synchronized (this) { annotation = _annotationMap.get(value); if (annotation == null) { if (_recordAnnotations) { annotation = _annotationFactory.createAnnotation(); } else { annotation = new RowAnnotationImpl(); } _annotationMap.put(value, annotation); } } if (_recordAnnotations) { _annotationFactory.annotate(row, distinctCount, annotation); } else { ((RowAnnotationImpl) annotation).incrementRowCount(distinctCount); } } _totalCount.addAndGet(distinctCount); }
@Override public MarkRowsAnalyzerResult reduce(Collection<? extends MarkRowsAnalyzerResult> results) { InputColumn<?>[] highlightedColumns = null; final RowAnnotationImpl annotation = new RowAnnotationImpl(); for (MarkRowsAnalyzerResult result : results) { final int annotatedRowCount = result.getAnnotatedRowCount(); annotation.incrementRowCount(annotatedRowCount); if (highlightedColumns == null || highlightedColumns.length == 0) { highlightedColumns = result.getHighlightedColumns(); } } return new MarkRowsAnalyzerResult(annotation, null, highlightedColumns); }
@Override public MarkRowsAnalyzerResult reduce(Collection<? extends MarkRowsAnalyzerResult> results) { InputColumn<?>[] highlightedColumns = null; final RowAnnotationImpl annotation = new RowAnnotationImpl(); for (MarkRowsAnalyzerResult result : results) { final int annotatedRowCount = result.getAnnotatedRowCount(); annotation.incrementRowCount(annotatedRowCount); if (highlightedColumns == null || highlightedColumns.length == 0) { highlightedColumns = result.getHighlightedColumns(); } } return new MarkRowsAnalyzerResult(annotation, null, highlightedColumns); }