Open
Description
There is no way to write single points to a default retention policy in case it is not named "autogen". The following code will fail:
InfluxDB influxDB = influxDB.setDatabase("mydb");
influxDB.write(Point.measurement("msmt").tag("tag", "x").addField("field", 42).build());
Expected behaviour is to omit retention policy in the queries to InfluxDB if user did not explicitly specified it.
On the other hand, BatchPoints
do support default retention policy but if any other RP is to be used, it has to be set on BatchPoints
separately and the value set upon the client initialization is ignored:
InfluxDB influxDB = influxDB.setDatabase("mydb").setRetentionPolicy("non_default_rp");
influxDB.write(BatchPoints.database("mydb").tag("tag", "x").addField("field", 42).build());
- points from the batch get written to the default RP. Perhaps it makes sense to make a getter for
BatchPoints.Builder
inInfluxDB
- this way database and retention policy would be automatically populated from the client instance.