Browse Source

Merge remote-tracking branch 'upstream/dev' into json_split

pull/3/MERGE
baoliang 4 years ago
parent
commit
1c72a4b9d8
  1. 6
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/ExcelUtils.java
  2. 6
      dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyClientHandler.java
  3. 6
      dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyServerHandler.java

6
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/ExcelUtils.java

@ -110,7 +110,11 @@ public class ExcelUtils {
for (int j = 0; j < values.length; j++) { for (int j = 0; j < values.length; j++) {
Cell cell1 = row.createCell(j); Cell cell1 = row.createCell(j);
cell1.setCellStyle(cellStyle); cell1.setCellStyle(cellStyle);
cell1.setCellValue(String.valueOf(values[j])); if (values[j] instanceof Number) {
cell1.setCellValue(Double.parseDouble(String.valueOf(values[j])));
} else {
cell1.setCellValue(String.valueOf(values[j]));
}
} }
} }

6
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyClientHandler.java

@ -184,9 +184,11 @@ public class NettyClientHandler extends ChannelInboundHandlerAdapter {
Command heartBeat = new Command(); Command heartBeat = new Command();
heartBeat.setType(CommandType.HEART_BEAT); heartBeat.setType(CommandType.HEART_BEAT);
heartBeat.setBody(heartBeatData); heartBeat.setBody(heartBeatData);
ctx.writeAndFlush(heartBeat) ctx.channel().writeAndFlush(heartBeat)
.addListener(ChannelFutureListener.CLOSE_ON_FAILURE); .addListener(ChannelFutureListener.CLOSE_ON_FAILURE);
if (logger.isDebugEnabled()) {
logger.debug("Client send heart beat to: {}", ChannelUtils.getRemoteAddress(ctx.channel()));
}
} else { } else {
super.userEventTriggered(ctx, evt); super.userEventTriggered(ctx, evt);
} }

6
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyServerHandler.java

@ -116,6 +116,12 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
*/ */
private void processReceived(final Channel channel, final Command msg) { private void processReceived(final Channel channel, final Command msg) {
final CommandType commandType = msg.getType(); final CommandType commandType = msg.getType();
if (CommandType.HEART_BEAT.equals(commandType)) {
if (logger.isDebugEnabled()) {
logger.debug("server receive heart beat from: host: {}", ChannelUtils.getRemoteAddress(channel));
}
return;
}
final Pair<NettyRequestProcessor, ExecutorService> pair = processors.get(commandType); final Pair<NettyRequestProcessor, ExecutorService> pair = processors.get(commandType);
if (pair != null) { if (pair != null) {
Runnable r = () -> { Runnable r = () -> {

Loading…
Cancel
Save