JAVA API to save data?

67 views
Skip to first unread message

mpwar...@gmail.com

unread,
Sep 22, 2015, 11:33:52 AM9/22/15
to OpenTSDB
Hi all,

There is a sample code in this group to read data from the Java API:
https://groups.google.com/forum/#!searchin/opentsdb/read$20data/opentsdb/6MKs-FkSLoA/gifHF327CIAJ
It works fine.

But is there any similar sample to save data? How do we create DataPoints and save them?

Also, what are the pros/cons of using the Java API?
In the documentation, it states :  "There are currently three main methods to get data into OpenTSDB: Telnet API, HTTP API and batch import from a file. Alternatively you can use a tool that provides OpenTSDB support, or if you're extremely adventurous, use the Java library."
What do you mean by "Adventurous"? Does it mean it's not safe?

Thanks a lot.

spico...@gmail.com

unread,
Sep 23, 2015, 7:24:34 AM9/23/15
to OpenTSDB
Hello!
Good luck!
 Florin


mpwar...@gmail.com

unread,
Sep 23, 2015, 8:42:16 AM9/23/15
to OpenTSDB
Thanks, I've just found a great sample here:
https://github.com/OpenTSDB/opentsdb/blob/master/src/tools/TextImporter.java

It works fine and it's fast.
However I don't understand why there is a addPoint(...) method with double value for TSDB and float value only for WritableDataPoints?

ManOLamancha

unread,
Nov 10, 2015, 7:20:33 PM11/10/15
to OpenTSDB
On Wednesday, September 23, 2015 at 5:42:16 AM UTC-7, mpwar...@gmail.com wrote:

TSuna's comment about the Java API was partly poking fun and partly a warning to be careful to avoid corrupting data. The API is very stable and safe to use and we make sure to maintain backwards compatibility for folks who are using it. 
 
It works fine and it's fast.
However I don't understand why there is a addPoint(...) method with double value for TSDB and float value only for WritableDataPoints?

Regarding the WritableDataPoints, that's an oversight and we should add a double interface. Wanna raise an issue for the credit in Github? Thanks!
Reply all
Reply to author
Forward
0 new messages