Iterate through each row of the multi get results, parses out data points (and optional meta data). @return null if no rows were found, otherwise the TreeMap with spans
(final List<GetResultOrException> results)
| 348 | * @return null if no rows were found, otherwise the TreeMap with spans |
| 349 | */ |
| 350 | @Override |
| 351 | public Object call(final List<GetResultOrException> results) throws Exception { |
| 352 | mul_get_time = (DateTime.nanoTime() - mul_get_start_time); |
| 353 | |
| 354 | try { |
| 355 | for (final GetResultOrException result : results) { |
| 356 | // handle an exception |
| 357 | if (result.getException() != null) { |
| 358 | get_exception = result.getException(); |
| 359 | handleException(get_exception); |
| 360 | close(false); |
| 361 | } |
| 362 | if (null != result.getCells()) { |
| 363 | final ArrayList<KeyValue> row = result.getCells(); |
| 364 | if (row.isEmpty()) { |
| 365 | continue; |
| 366 | } |
| 367 | |
| 368 | number_pre_filter_data_point.addAndGet(row.size()); |
| 369 | ++mul_get_number_row_fetched; |
| 370 | mul_get_number_column_fetched += row.size(); |
| 371 | |
| 372 | final byte[] key = row.get(0).key(); |
| 373 | final byte[] tsuid_key = UniqueId.getTSUIDFromKey(key, |
| 374 | TSDB.metrics_width(), Const.TIMESTAMP_BYTES); |
| 375 | |
| 376 | if (!tsuids.contains(tsuid_key)) { |
| 377 | LOG.error("Multi getter fetched the wrong row " + result |
| 378 | + " when fetching metric: " + Bytes.pretty(metric)); |
| 379 | continue; |
| 380 | } |
| 381 | process(key, row); |
| 382 | } else { |
| 383 | // TODO we don't get cells for some get requests. This could be an |
| 384 | // error or the database just didn't have data. Gotta look into it. |
| 385 | } |
| 386 | } // end for |
| 387 | } catch (Exception e) { |
| 388 | get_exception = e; |
| 389 | close(false); |
| 390 | return null; |
| 391 | } |
| 392 | |
| 393 | close(true); |
| 394 | return null; |
| 395 | } |
| 396 | |
| 397 | /** |
| 398 | * Handles processing of row of data into the proper list |
nothing calls this directly
no test coverage detected