This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 8b830b9 [IoTDB-531]fix issue when grafana visualize boolean data.
(#1224)
8b830b9 is described below
commit 8b830b95193eff87acd76dfcebfabf5860c94478
Author: Xiangdong Huang <[email protected]>
AuthorDate: Tue May 19 09:43:26 2020 +0800
[IoTDB-531]fix issue when grafana visualize boolean data. (#1224)
* fix issue when grafana visualize boolean data.
* Add Grafana IoTDB Bridge Artefact to distrbution in tools/grafana folder.
* add application.properties into the binary release file
Co-authored-by: xiangdong huang <[email protected]>
Co-authored-by: julian <[email protected]>
---
distribution/pom.xml | 6 ++++++
distribution/src/assembly/distribution.xml | 12 ++++++++++++
.../org/apache/iotdb/web/grafana/dao/impl/BasicDaoImpl.java | 8 +-------
3 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/distribution/pom.xml b/distribution/pom.xml
index de48e50..be62bb0 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -109,5 +109,11 @@
<version>${project.version}</version>
<type>zip</type>
</dependency>
+ <dependency>
+ <groupId>org.apache.iotdb</groupId>
+ <artifactId>iotdb-grafana</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
</dependencies>
</project>
diff --git a/distribution/src/assembly/distribution.xml
b/distribution/src/assembly/distribution.xml
index 0677c93..3208793 100644
--- a/distribution/src/assembly/distribution.xml
+++ b/distribution/src/assembly/distribution.xml
@@ -34,6 +34,14 @@
<outputDirectory>${file.separator}</outputDirectory>
<unpack>true</unpack>
</dependencySet>
+ <dependencySet>
+ <includes>
+ <include>*:iotdb-grafana:*</include>
+ </includes>
+ <outputDirectory>tools/grafana/</outputDirectory>
+
<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
+ <unpack>false</unpack>
+ </dependencySet>
</dependencySets>
<files>
<file>
@@ -53,6 +61,10 @@
<file>
<source>${maven.multiModuleProjectDirectory}/RELEASE_NOTES.md</source>
</file>
+ <file>
+
<source>${maven.multiModuleProjectDirectory}/grafana/src/main/resources/application.properties</source>
+ <destName>tools/grafana/application.properties</destName>
+ </file>
</files>
<fileSets>
<fileSet>
diff --git
a/grafana/src/main/java/org/apache/iotdb/web/grafana/dao/impl/BasicDaoImpl.java
b/grafana/src/main/java/org/apache/iotdb/web/grafana/dao/impl/BasicDaoImpl.java
index 0cdfef5..1343628 100644
---
a/grafana/src/main/java/org/apache/iotdb/web/grafana/dao/impl/BasicDaoImpl.java
+++
b/grafana/src/main/java/org/apache/iotdb/web/grafana/dao/impl/BasicDaoImpl.java
@@ -136,7 +136,6 @@ public class BasicDaoImpl implements BasicDao {
Long from = zonedCovertToLong(timeRange.left);
Long to = zonedCovertToLong(timeRange.right);
final long hours = Duration.between(timeRange.left,
timeRange.right).toHours();
- List<TimeValues> rows = null;
String sql = String.format("SELECT %s FROM root.%s WHERE time > %d and
time < %d",
s.substring(s.lastIndexOf('.') + 1), s.substring(0,
s.lastIndexOf('.')),
from * timestampRadioX, to * timestampRadioX);
@@ -156,12 +155,7 @@ public class BasicDaoImpl implements BasicDao {
columnName = function + "(root." + s + ")";
}
logger.info(sql);
- try {
- rows = jdbcTemplate.query(sql, new TimeValuesRowMapper(columnName));
- } catch (Exception e) {
- logger.error(e.getMessage());
- }
- return rows;
+ return jdbcTemplate.query(sql, new TimeValuesRowMapper(columnName));
}
private Long zonedCovertToLong(ZonedDateTime time) {