This is an automated email from the ASF dual-hosted git repository.
liurui pushed a commit to branch file_size_monitor
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/file_size_monitor by this push:
new 0489050 fix conflict in DataPoint
0489050 is described below
commit 04890505a8247d846b617bd2d1b2db99a033f64e
Author: liuruiyiyang <[email protected]>
AuthorDate: Fri Mar 8 09:49:01 2019 +0800
fix conflict in DataPoint
---
.../tsfile/write/record/datapoint/DataPoint.java | 51 ++++++++++++----------
1 file changed, 28 insertions(+), 23 deletions(-)
diff --git
a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/datapoint/DataPoint.java
b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/datapoint/DataPoint.java
index 2715545..8c7e633 100644
---
a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/datapoint/DataPoint.java
+++
b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/datapoint/DataPoint.java
@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+
package org.apache.iotdb.tsfile.write.record.datapoint;
import java.io.IOException;
@@ -65,29 +66,33 @@ public abstract class DataPoint {
*/
public static DataPoint getDataPoint(TSDataType dataType, String
measurementId, String value) {
DataPoint dataPoint = null;
- switch (dataType) {
- case INT32:
- dataPoint = new IntDataPoint(measurementId, Integer.valueOf(value));
- break;
- case INT64:
- dataPoint = new LongDataPoint(measurementId, Long.valueOf(value));
- break;
- case FLOAT:
- dataPoint = new FloatDataPoint(measurementId, Float.valueOf(value));
- break;
- case DOUBLE:
- dataPoint = new DoubleDataPoint(measurementId, Double.valueOf(value));
- break;
- case BOOLEAN:
- dataPoint = new BooleanDataPoint(measurementId,
Boolean.valueOf(value));
- break;
- case TEXT:
- dataPoint = new StringDataPoint(measurementId, new Binary(value));
- break;
- default:
- throw new UnSupportedDataTypeException("This data type is not
supported -" + dataType);
- } catch (Exception e){
- throw new UnSupportedDataTypeException(String.format("Data type of %s is
%s, but input value is %s", measurementId,
+ try {
+ switch (dataType) {
+ case INT32:
+ dataPoint = new IntDataPoint(measurementId, Integer.valueOf(value));
+ break;
+ case INT64:
+ dataPoint = new LongDataPoint(measurementId, Long.valueOf(value));
+ break;
+ case FLOAT:
+ dataPoint = new FloatDataPoint(measurementId, Float.valueOf(value));
+ break;
+ case DOUBLE:
+ dataPoint = new DoubleDataPoint(measurementId,
Double.valueOf(value));
+ break;
+ case BOOLEAN:
+ dataPoint = new BooleanDataPoint(measurementId,
Boolean.valueOf(value));
+ break;
+ case TEXT:
+ dataPoint = new StringDataPoint(measurementId, new Binary(value));
+ break;
+ default:
+ throw new UnSupportedDataTypeException(
+ String.format("Data type %s is not supported.", dataType));
+ }
+ } catch (Exception e) {
+ throw new UnSupportedDataTypeException(
+ String.format("Data type of %s is %s, but input value is %s",
measurementId,
dataType, value));
}