Called each time a scanner completes with valid or empty data. @param kvs The compacted columns fetched by the scanner @param annotations The annotations fetched by the scanners
(
final List<KeyValue> kvs,
final Map<byte[], List<Annotation>> annotations,
final List<SimpleEntry<byte[], List<HistogramDataPoint>>> histograms)
| 922 | * @param annotations The annotations fetched by the scanners |
| 923 | */ |
| 924 | private void validateAndTriggerCallback( |
| 925 | final List<KeyValue> kvs, |
| 926 | final Map<byte[], List<Annotation>> annotations, |
| 927 | final List<SimpleEntry<byte[], List<HistogramDataPoint>>> histograms) { |
| 928 | |
| 929 | int scannersRunning = countdown.decrementAndGet(); |
| 930 | if (kvs.size() > 0) { |
| 931 | kv_map.put(scannersRunning, kvs); |
| 932 | } |
| 933 | |
| 934 | for (final byte[] key : annotations.keySet()) { |
| 935 | final List<Annotation> notes = annotations.get(key); |
| 936 | if (notes.size() > 0) { |
| 937 | // Optimistic write, expecting unique row keys |
| 938 | annotation_map.put(key, notes); |
| 939 | } |
| 940 | } |
| 941 | |
| 942 | if (histograms.size() > 0) { |
| 943 | histMap.put(scannersRunning, histograms); |
| 944 | } |
| 945 | |
| 946 | if (scannersRunning <= 0) { |
| 947 | try { |
| 948 | mergeAndReturnResults(); |
| 949 | } catch (final Exception ex) { |
| 950 | results.callback(ex); |
| 951 | } |
| 952 | } |
| 953 | } |
| 954 | |
| 955 | /** |
| 956 | * If one or more of the scanners throws an exception then we should close it |
no test coverage detected