use of com.alibaba.otter.shared.common.model.config.channel.Channel in project otter by alibaba.
the class SwitchWarmupAction method doSwitch.
public void doSwitch(@Param("pipelineId") Long pipelineId, Navigator nav) throws Exception {
Channel channel = channelService.findByPipelineId(pipelineId);
// 尝试重新启动
arbitrateManageService.channelEvent().restart(channel.getId());
arbitrateManageService.systemEvent().switchWarmup(channel.getId(), pipelineId);
nav.redirectToLocation("analysisStageStat.htm?pipelineId=" + pipelineId);
}
use of com.alibaba.otter.shared.common.model.config.channel.Channel in project otter by alibaba.
the class SwitchWarmupAction method doRestart.
public void doRestart(@Param("pipelineId") Long pipelineId, Navigator nav) throws Exception {
Channel channel = channelService.findByPipelineId(pipelineId);
// 尝试重新启动
arbitrateManageService.channelEvent().restart(channel.getId());
// 推送下配置
channelService.notifyChannel(channel.getId());
nav.redirectToLocation("analysisStageStat.htm?pipelineId=" + pipelineId);
}
use of com.alibaba.otter.shared.common.model.config.channel.Channel in project otter by alibaba.
the class DataMediaPairList method execute.
public void execute(@Param("pipelineId") Long pipelineId, Context context) throws Exception {
// Pipeline pipeline = pipelineService.findById(pipelineId);
Channel channel = channelService.findByPipelineId(pipelineId);
List<DataMediaPair> dataMediaPairs = dataMediaPairService.listByPipelineId(pipelineId);
Map<Long, TableStat> tableStatMap = new HashMap<Long, TableStat>(dataMediaPairs.size(), 1f);
List<TableStat> tableStats = tableStatService.listTableStat(pipelineId);
for (DataMediaPair dataMediaPair : dataMediaPairs) {
int flag = 0;
for (TableStat tableStat : tableStats) {
if (dataMediaPair.getId().equals(tableStat.getDataMediaPairId())) {
tableStatMap.put(dataMediaPair.getId(), tableStat);
flag = 1;
break;
}
}
if (flag == 0) {
TableStat tableStat = new TableStat();
tableStat.setFileSize(0L);
tableStat.setFileCount(0L);
tableStat.setDeleteCount(0L);
tableStat.setUpdateCount(0L);
tableStat.setInsertCount(0L);
// tableStat.setGmtModified(dataMediaPair.getGmtModified());
tableStatMap.put(dataMediaPair.getId(), tableStat);
}
}
context.put("dataMediaPairs", dataMediaPairs);
// 通过PipelineId不能获取到Channel状态,所以需要传递Channel对象
context.put("channel", channel);
context.put("pipelineId", pipelineId);
context.put("tableStatMap", tableStatMap);
}
use of com.alibaba.otter.shared.common.model.config.channel.Channel in project otter by alibaba.
the class LogRecordTab method execute.
public void execute(@Param("pageIndex") int pageIndex, @Param("searchKey") String searchKey, @Param("pipelineId") Long pipelineId, Context context) throws Exception {
@SuppressWarnings("unchecked") Map<String, Object> condition = new HashMap<String, Object>();
if ("请输入关键字(目前支持log内容关键字搜索)".equals(searchKey)) {
searchKey = "";
}
condition.put("pipelineId", pipelineId);
condition.put("searchKey", searchKey);
int count = logRecordService.getCount(condition);
Paginator paginator = new Paginator();
paginator.setItems(count);
paginator.setPage(pageIndex);
condition.put("offset", paginator.getOffset());
condition.put("length", paginator.getLength());
List<LogRecord> logRecords = logRecordService.listByCondition(condition);
for (LogRecord logRecord : logRecords) {
if (!StringUtils.isEmpty(logRecord.getMessage())) {
logRecord.setMessage(logRecord.getMessage().replaceAll("\n\t", "<br/>"));
}
}
context.put("logRecords", logRecords);
context.put("paginator", paginator);
context.put("searchKey", searchKey);
context.put("pipelineId", pipelineId);
Channel channel = channelService.findByPipelineId(pipelineId);
context.put("channel", channel);
}
use of com.alibaba.otter.shared.common.model.config.channel.Channel in project otter by alibaba.
the class NodeInfo method execute.
public void execute(@Param("nodeId") Long nodeId, Context context) throws Exception {
Node node = nodeService.findById(nodeId);
List<Channel> channels = channelService.listByNodeId(nodeId);
if (node.getStatus().isStart()) {
context.put("heapMemoryUsage", nodeRemoteService.getHeapMemoryUsage(nodeId));
context.put("versionInfo", nodeRemoteService.getNodeVersionInfo(nodeId));
context.put("systemInfo", nodeRemoteService.getNodeSystemInfo(nodeId));
context.put("threadActiveSize", nodeRemoteService.getThreadActiveSize(nodeId));
context.put("threadPoolSize", nodeRemoteService.getThreadPoolSize(nodeId));
context.put("runningPipelines", nodeRemoteService.getRunningPipelines(nodeId));
} else {
context.put("heapMemoryUsage", 0);
context.put("threadActiveSize", 0);
context.put("threadPoolSize", 0);
context.put("runningPipelines", 0);
context.put("versionInfo", "");
context.put("systemInfo", "");
}
context.put("node", node);
context.put("channels", channels);
}
Aggregations