Hadoop web项目使用Ajax监控MapReduce任务运行情况
来源:互联网 发布:艾姆赫斯特学院知乎 编辑:程序博客网 时间:2024/06/10 02:57
项目代码可以在http://download.csdn.net/detail/fansy1990/5590951 下载;
Hadoop集群版本:1.0.4 ,结合myeclipse开发;
此次的hadoop web项目是前次的改进版,增加了ajax技术,主要用在了路径的检查(字符串检查和hdfs交互)以及在监控mapreduce过程时和后台交互获得job信息;
整个项目的思路大概如下:
获取job信息的jsp如下:
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%><%@ page import ="util.*" %><%@ page import ="org.apache.hadoop.conf.*" %><html> <script language='javascript'> timeId = setInterval("myrefresh()",2000); var xmlHttpShow; function createXMLHttpInRequest(){ if(window.XMLHttpRequest){ xmlHttpShow=new XMLHttpRequest(); }else{ xmlHttpShow=new ActiveXObject("Microsoft.XMLHTTP"); } } function myrefresh(){ // alert("ok"); if(document.getElementById("redProgress").innerText.indexOf("100.0%")==0){ clearInterval(timeId); } createXMLHttpInRequest();var url="validate/get_progress.jsp?time="+new Date().getTime();xmlHttpShow.open("get",url,true);// 把方法地址赋值给xmlHttp的onreadystatechange属性xmlHttpShow.onreadystatechange=showcallback;xmlHttpShow.send(null); } function showcallback(){ var progress=xmlHttpShow.responseText; var a=progress.indexOf(","); var length=progress.length; document.getElementById("mapProgress").innerText=progress.substring(0,a); document.getElementById("redProgress").innerText=progress.substring(a+1,length); } </script> <head> <title>My JSP 'bottom_print.jsp' starting page</title> </head> <% String jobName=request.getParameter("jobName"); %> <body> <h3>Map Reduce Progress</h3> <br> <table border="1"> <tr> <th>Job Name</th> <td><%=jobName %></td> </tr> <tr> <th>Map Progress</th> <td id="mapProgress">0.00%</td> </tr> <tr> <th>Reduce Progress</th> <td id="redProgress">0.00%</td> </tr> </table> </body></html>
配置Hadoop集群的文件在:src/util/Utils.java文件里面;
分享,快乐,成长
转载请注明出处:http://blog.csdn.net/fansy1990
- Hadoop web项目使用Ajax监控MapReduce任务运行情况
- Hadoop Web项目使用Ajax监控Mapreduce过程
- hadoop web项目使用ajax监控mapreduce过程
- Hadoop集群模式下运行Mapreduce任务
- Hadoop 伪分布式模式 MapReduce 任务不能继续运行 解决方案
- 使用JProfiler监控JBoss运行情况
- JVM 运行时内存使用情况监控
- JVM运行时内存使用情况监控
- Runtime监控项目内存使用情况
- 【Hadoop】MapReduce笔记(一):MapReduce作业运行过程、任务执行
- hadoop任务监控实现
- Hadoop好友推荐系统-原始数据去重操作(包含MapReduce任务监控)
- Hadoop MapReduce之任务调度
- MR-3.Hadoop使用YARN运行MapReduce工作原理
- Hadoop系列-使用Eclipse编译运行MapReduce程序 (三)
- MapReduce(九): 任务的运行
- MapReduce运行任务报错
- 解决Hadoop运行jar包时MapReduce任务启动前OutOfMemoryError:Java heap space问题
- OPPO一面
- oracle递归查询(查询条件ID下得所有子集)
- Web Service引用时出错无法加载协定为“ServiceReference1.xxxxxx”的终结点配置部分,因为找到了该协定的多个终结点配置。请按名称指示首选的终结点配置部分
- JAXP解析XML文档
- HDU 1503
- Hadoop web项目使用Ajax监控MapReduce任务运行情况
- H264 slice layer
- 工具系列(一)
- 基于VHDL的四路抢答器设计(程序)
- struts2集成sitemesh
- 编程之美-求数组的子数组之和最大值(该数组首尾相连)
- 7种形式的Android Dialog使用举例
- 算法总结
- 邮件透明过滤-map的相关操作