Converts the string array to an IncomingDataPoint. WARNING: This method does not perform validation. It should only be used by the Telnet style execute above within the error callback. At that point it means the array parsed correctly as per importDataPoint. @param tsdb The TSDB for
(final TSDB tsdb,
final String[] words)
| 789 | * @return An incoming data point object. |
| 790 | */ |
| 791 | protected IncomingDataPoint getDataPointFromString(final TSDB tsdb, |
| 792 | final String[] words) { |
| 793 | final IncomingDataPoint dp = new IncomingDataPoint(); |
| 794 | dp.setMetric(words[1]); |
| 795 | |
| 796 | if (words[2].contains(".")) { |
| 797 | dp.setTimestamp(Tags.parseLong(words[2].replace(".", ""))); |
| 798 | } else { |
| 799 | dp.setTimestamp(Tags.parseLong(words[2])); |
| 800 | } |
| 801 | |
| 802 | dp.setValue(words[3]); |
| 803 | |
| 804 | final HashMap<String, String> tags = new HashMap<String, String>(); |
| 805 | for (int i = 4; i < words.length; i++) { |
| 806 | if (!words[i].isEmpty()) { |
| 807 | Tags.parse(tags, words[i]); |
| 808 | } |
| 809 | } |
| 810 | dp.setTags(tags); |
| 811 | return dp; |
| 812 | } |
| 813 | |
| 814 | /** |
| 815 | * Simple helper to format an error trying to save a data point |