|
|
package com.monitor.influxdb.mapper.impl;
|
|
|
|
|
|
import com.monitor.common.contants.InfluxDBContants;
|
|
|
import com.monitor.influxdb.InfluxDBModel;
|
|
|
import com.monitor.influxdb.InfluxDBQuery;
|
|
|
import com.monitor.influxdb.InluxDBSingle;
|
|
|
import com.monitor.influxdb.mapper.IZkMapper;
|
|
|
import com.monitor.influxdb.model.ZkInfo;
|
|
|
import com.monitor.model.domain.PageBean;
|
|
|
|
|
|
import org.influxdb.InfluxDB;
|
|
|
import org.influxdb.dto.Point;
|
|
|
import org.influxdb.dto.QueryResult;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
...
|
...
|
@@ -42,19 +46,21 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper { |
|
|
|
|
|
@Override
|
|
|
public int selectCountByCodition(PageBean page) {
|
|
|
InfluxDBModel influxDBModel=inluxDBSingle.getInfluxDBByName(InfluxDBContants.ALARM);
|
|
|
String command = "SELECT COUNT(id) FROM "+InfluxDBContants.ZOOKEEPER_ALARM;
|
|
|
return query(influxDBName, command, InfluxDBContants.ZOOKEEPER_ALARM,
|
|
|
"ZkMapper", "selectCountByCodition");
|
|
|
QueryResult result= query(influxDBModel.getName(), command, InfluxDBContants.ZOOKEEPER_ALARM);
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<ZkInfo> selectZkInfosByCodition(PageBean page) {
|
|
|
InfluxDBModel influxDBModel=inluxDBSingle.getInfluxDBByName(InfluxDBContants.ALARM);
|
|
|
String command="SELECT id, hostIp, isLive from "+InfluxDBContants.ZOOKEEPER_ALARM+
|
|
|
" ORDER BY time DESC LIMIT " + page.getParams().get("pageSize") +
|
|
|
" OFFSET " + page.getParams().get("startIndex");
|
|
|
|
|
|
return query(influxDBName, command, InfluxDBContants.ZOOKEEPER_ALARM,
|
|
|
"ZkMapper", "selectZkInfosByCodition");
|
|
|
QueryResult result= query(influxDBModel.getName(), command, InfluxDBContants.ZOOKEEPER_ALARM);
|
|
|
return null;
|
|
|
}
|
|
|
} |
...
|
...
|
|