I am trying to update a record (only the field values) using influxdb java client.
Specifically, I am using InfluxDBMapper to store the queried result, I update the POJO with new field values and build the PointBuilder as below:
final Builder b = Point.measurementByPOJO(reqInProgress.getClass()).addFieldsFromPOJO(reqInProgress);
I then use the influx.write() to send it to the DB. Batching is enabled. However I get 400 error and the values are not updated in the DB.
Is this not the right way to update values?
I think I found the reason. My DBs are with precision of Milliseconds. I have set the TimeUnit correctly for the POJO too. However when I Build the Point as above, it does not take into consideration the TimeUnit set by me and defaults to Nanoseconds.
This is probably the reason it fails.
I changed to below lines but it still does not change the time unit:
final long time = reqInProgress.getTime().getLong(ChronoField.MILLI_OF_SECOND);
final Builder b = Point.measurementByPOJO(reqInProgress.getClass()).addFieldsFromPOJO(reqInProgress).time(time, TimeUnit.MILLISECONDS);