SteveYurongSu commented on a change in pull request #4172:
URL: https://github.com/apache/iotdb/pull/4172#discussion_r733286925
##########
File path:
influxdb-protocol/src/main/java/org/apache/iotdb/influxdb/IoTDBInfluxDB.java
##########
@@ -85,57 +88,50 @@ private void openSession() {
@Override
public void write(final Point point) {
- throw new UnsupportedOperationException(METHOD_NOT_SUPPORTED);
+ write(null, null, point);
}
@Override
- public QueryResult query(final Query query) {
- throw new UnsupportedOperationException(METHOD_NOT_SUPPORTED);
+ public void write(final String database, final String retentionPolicy, final
Point point) {
+ BatchPoints batchPoints =
+
BatchPoints.database(database).retentionPolicy(retentionPolicy).build();
+ batchPoints.point(point);
+ write(batchPoints);
}
@Override
- public void createDatabase(final String name) {
- throw new UnsupportedOperationException(METHOD_NOT_SUPPORTED);
+ public void write(final int udpPort, final Point point) {
+ write(null, null, point);
}
@Override
- public void deleteDatabase(final String name) {
- throw new UnsupportedOperationException(METHOD_NOT_SUPPORTED);
+ public void write(final BatchPoints batchPoints) {
+ influxDBService.writePoints(
+ batchPoints.getDatabase(),
+ batchPoints.getRetentionPolicy(),
+ TimeUtil.toTimePrecision(batchPoints.getPrecision()),
+ batchPoints.getConsistency().value(),
+ batchPoints);
}
@Override
- public InfluxDB setDatabase(final String database) {
- throw new UnsupportedOperationException(METHOD_NOT_SUPPORTED);
+ public void writeWithRetry(final BatchPoints batchPoints) {
+ influxDBService.writePoints(
+ batchPoints.getDatabase(),
+ batchPoints.getRetentionPolicy(),
+ TimeUtil.toTimePrecision(batchPoints.getPrecision()),
+ batchPoints.getConsistency().value(),
+ batchPoints);
Review comment:
```suggestion
throw new
UnsupportedOperationException(InfluxDBConstant.METHOD_NOT_SUPPORTED);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]