Xiangdong Huang created IOTDB-442:
-------------------------------------
Summary: Add more APIs to native API (session api)
Key: IOTDB-442
URL: https://issues.apache.org/jira/browse/IOTDB-442
Project: Apache IoTDB
Issue Type: New Feature
Components: Client/Java
Reporter: Xiangdong Huang
Hi, when I use IoTDB to store meteorological monitoring data, I feel the
current session API is not convenient:
1.
insert() API: we have to convert each value to String, and then parse the
String to the basic data type. When writing codes, we have to write like:
{code:java}
// code placeholder
List<String> values = new ArrayList<>();
values.add(floatValue + "");
values.add(floatValue + "");
values.add(doubleValue + "");
session.insert(deviceId, time, measurements, values);{code}
If we have an interface like insert(String device, long time, List<Measurement>
schema, Object... values), we can use Java's auto-boxing (I think it is more
efficient than creating a new String and then parse it, right?), then just
write code like:
{code:java}
// code placeholder
session.insert(deviceId, time, measurements, floatValue1, floatValue2,
doubleValue, ...);{code}
2. Now we have insertBatch(), which can insert a batch of rows of a device. How
about adding a new API to support inserting a batch of rows of multiple
devices? (not sure how much performance can benefit)
e.g.
insertBatch(Map<device, RowBatch>);// if each device can have more than one row.
insertBatch(device[], timestamp[], values[][]);//if each device has only one
row.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)