Returns the last data point from a data row in the TSDB table. @param row The row from HBase @return null if no data was found, a data point if one was
(final ArrayList<KeyValue> row)
| 474 | * @return null if no data was found, a data point if one was |
| 475 | */ |
| 476 | public IncomingDataPoint call(final ArrayList<KeyValue> row) |
| 477 | throws Exception { |
| 478 | if (row == null || row.size() < 1) { |
| 479 | return null; |
| 480 | } |
| 481 | |
| 482 | // check to see if the cells array is empty as it will flush out all |
| 483 | // non-data points. |
| 484 | final ArrayList<Cell> cells = extractDataPoints(row, row.size()); |
| 485 | if (cells.isEmpty()) { |
| 486 | return null; |
| 487 | } |
| 488 | final Cell cell = cells.get(cells.size() - 1); |
| 489 | final IncomingDataPoint dp = new IncomingDataPoint(); |
| 490 | final long base_time = baseTime(tsdb, row.get(0).key()); |
| 491 | dp.setTimestamp(getTimestampFromQualifier(cell.qualifier(), base_time)); |
| 492 | dp.setValue(cell.parseValue().toString()); |
| 493 | return dp; |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | /** |
nothing calls this directly
no test coverage detected