mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-05 04:50:55 +08:00
heartbeat表的数据更新时间从MySQL自动生成调整为Logi-KM的时间
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<insert id="replace" parameterType="com.xiaojukeji.kafka.manager.common.entity.pojo.HeartbeatDO">
|
<insert id="replace" parameterType="com.xiaojukeji.kafka.manager.common.entity.pojo.HeartbeatDO">
|
||||||
REPLACE heartbeat (ip, hostname) VALUES (#{ip}, #{hostname})
|
REPLACE heartbeat (ip, hostname, modify_time) VALUES (#{ip}, #{hostname}, #{modifyTime})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<select id="selectActiveHosts" parameterType="java.util.Date" resultMap="HeartbeatMap">
|
<select id="selectActiveHosts" parameterType="java.util.Date" resultMap="HeartbeatMap">
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author limeng
|
* @author limeng
|
||||||
* @date 20/8/10
|
* @date 20/8/10
|
||||||
@@ -30,6 +32,7 @@ public class Heartbeat {
|
|||||||
HeartbeatDO heartbeatDO = new HeartbeatDO();
|
HeartbeatDO heartbeatDO = new HeartbeatDO();
|
||||||
heartbeatDO.setIp(NetUtils.localIp());
|
heartbeatDO.setIp(NetUtils.localIp());
|
||||||
heartbeatDO.setHostname(NetUtils.localHostname());
|
heartbeatDO.setHostname(NetUtils.localHostname());
|
||||||
|
heartbeatDO.setModifyTime(new Date());
|
||||||
heartbeatDao.replace(heartbeatDO);
|
heartbeatDao.replace(heartbeatDO);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("flush heartbeat failed.", e);
|
LOGGER.error("flush heartbeat failed.", e);
|
||||||
|
|||||||
Reference in New Issue
Block a user