You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chukwa.apache.org by ji...@apache.org on 2012/09/11 07:14:42 UTC

svn commit: r1383245 - in /incubator/chukwa/trunk/src/main: java/org/apache/hadoop/chukwa/util/XssFilter.java web/hicc/jsp/event2_viewer.jsp web/hicc/jsp/event_wrapper.jsp

Author: jiehuang
Date: Tue Sep 11 05:14:41 2012
New Revision: 1383245

URL: http://svn.apache.org/viewvc?rev=1383245&view=rev
Log:
CHUKWA-662. Compling errors in event_wrapper.jsp, event2_viewer.jsp files (Jie Huang)

Modified:
    incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/util/XssFilter.java
    incubator/chukwa/trunk/src/main/web/hicc/jsp/event2_viewer.jsp
    incubator/chukwa/trunk/src/main/web/hicc/jsp/event_wrapper.jsp

Modified: incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/util/XssFilter.java
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/util/XssFilter.java?rev=1383245&r1=1383244&r2=1383245&view=diff
==============================================================================
--- incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/util/XssFilter.java (original)
+++ incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/util/XssFilter.java Tue Sep 11 05:14:41 2012
@@ -82,7 +82,7 @@ public class XssFilter {
       return values;
     }
     
-    public String filter( String input ) {
+    public static String filter( String input ) {
         if(input==null) {
             return null;
         }

Modified: incubator/chukwa/trunk/src/main/web/hicc/jsp/event2_viewer.jsp
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/src/main/web/hicc/jsp/event2_viewer.jsp?rev=1383245&r1=1383244&r2=1383245&view=diff
==============================================================================
--- incubator/chukwa/trunk/src/main/web/hicc/jsp/event2_viewer.jsp (original)
+++ incubator/chukwa/trunk/src/main/web/hicc/jsp/event2_viewer.jsp Tue Sep 11 05:14:41 2012
@@ -1,73 +1,75 @@
+<%/*
+       * Licensed to the Apache Software Foundation (ASF) under one
+       * or more contributor license agreements.  See the NOTICE file 
+       * distributed with this work for additional information
+       * regarding copyright ownership.  The ASF licenses this file
+       * to you under the Apache License, Version 2.0 (the
+       * "License"); you may not use this file except in compliance
+       * with the License.  You may obtain a copy of the License at
+       *
+       *     http://www.apache.org/licenses/LICENSE-2.0
+       *
+       * Unless required by applicable law or agreed to in writing, software
+       * distributed under the License is distributed on an "AS IS" BASIS,
+       * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       * See the License for the specific language governing permissions and
+       * limitations under the License.
+       */%>
+<%@ page import = "java.util.Calendar,java.util.Date,java.text.SimpleDateFormat,java.util.*,java.sql.*,java.io.*,java.util.Calendar, java.util.Date,org.apache.hadoop.chukwa.hicc.ClusterConfig,org.apache.hadoop.chukwa.dao.*,org.apache.hadoop.chukwa.dao.database.*,org.apache.hadoop.chukwa.dao.hdfs.*,org.apache.hadoop.chukwa.util.XssFilter" %>
+<%@ page import = "org.apache.hadoop.chukwa.hicc.*,org.apache.hadoop.chukwa.extraction.engine.*" %>
 <%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file 
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+  XssFilter xf = new XssFilter(request);
+  response.setHeader("boxId", xf.getParameter("boxId"));
 %>
-<%@ page import = "java.util.Calendar, java.util.Date, java.text.SimpleDateFormat, java.util.*, java.sql.*,java.io.*, java.util.Calendar, java.util.Date, org.apache.hadoop.chukwa.hicc.ClusterConfig, org.apache.hadoop.chukwa.dao.*, org.apache.hadoop.chukwa.dao.database.*, org.apache.hadoop.chukwa.dao.hdfs.*, org.apache.hadoop.chukwa.util.XssFilter" %>
 <%
-   XssFilter xf = new XssFilter(request);
-   response.setHeader("boxId", xf.getParameter("boxId"));
+  String filter = (String) session.getAttribute("filter");
+  if (filter == null) {
+    filter = "";
+  }
 %>
-<% String filter=(String)session.getAttribute("filter");
-   if(filter==null) {
-       filter="";
-   } %>
 <div style="height:300px;overflow:auto;">
-Filter: <input type="text" id="<%= XssFilter.filter(request.getParameter("boxId")) %>filter" name="<%= XssFilter.filter(request.getParameter("boxId")) %>filter" value="<%= filter %>" class="formInput">
-<input type="button" name="apply_filter" value="Filter" onClick="filter_event_viewer('<%= XssFilter.filter(request.getParameter("boxId")) %>');" class="formButton">
+Filter: <input type="text" id="<%=XssFilter.filter(request.getParameter("boxId"))%>filter" name="<%=XssFilter.filter(request.getParameter("boxId"))%>filter" value="<%=filter%>" class="formInput">
+<input type="button" name="apply_filter" value="Filter" onClick="filter_event_viewer('<%=XssFilter.filter(request.getParameter("boxId"))%>');" class="formButton">
 <table class="simple" width="100%">
 <tr>
 <th>Time</th>
 <th>Event</th>
 </tr>
 <%
-        String cluster = (String) session.getAttribute("cluster");
-        ClusterConfig cc = new ClusterConfig();
-        String boxId=XssFilter.filter(request.getParameter("boxId"));
-        TimeHandler time = new TimeHandler(request);
-        String startdate = time.getStartTimeText();
-        String enddate = time.getEndTimeText();
-	String[] timefield = new String[3];
-	String[] database = new String[3];
-	database[0]="MRJob";
-	database[1]="HodJob";
-	database[2]="QueueInfo";
-	timefield[0]="LAUNCH_TIME";
-	timefield[1]="StartTime";
-	timefield[2]="timestamp";
-	long startDate = time.getStartTime();
-	long endDate = time.getEndTime();
+  String cluster = (String) session.getAttribute("cluster");
+  ClusterConfig cc = new ClusterConfig();
+  String boxId = XssFilter.filter(request.getParameter("boxId"));
+  TimeHandler time = new TimeHandler(request);
+  String startdate = time.getStartTimeText();
+  String enddate = time.getEndTimeText();
+  String[] timefield = new String[3];
+  String[] database = new String[3];
+  database[0] = "MRJob";
+  database[1] = "HodJob";
+  database[2] = "QueueInfo";
+  timefield[0] = "LAUNCH_TIME";
+  timefield[1] = "StartTime";
+  timefield[2] = "timestamp";
+  long startDate = time.getStartTime();
+  long endDate = time.getEndTime();
 
-	ChukwaSearchService se = new ChukwaSearchService();
-        String cluster = (String) session.getAttribute("cluster");
-        DataSourceResult result = se.search(cluster,database,startDate,endDate,filter);
-	TreeMap events = result.getEvents();
-	
-        Iterator ei = (events.keySet()).iterator();
-        while(ei.hasNext()) {
-	        long time = (Long) ei.next();
-                List<Event> tEvents = (List) events.get(time);
-	        SimpleDateFormat sdf=  new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-			for(Event event : tEvents)
-			{       
-            String cell = event.toString();
-                out.println("<tr><td>"+ sdf.format(event.getTime())+"</td><td>"+cell+"</td></tr>");
-			}
-		 }
+  ChukwaSearchService se = new ChukwaSearchService();
+  SearchResult result = se.search(cluster, database, startDate, endDate,
+      filter, (Token) null);
+  TreeMap events = result.getRecords();
+
+  Iterator ei = ( events.keySet() ).iterator();
+  while (ei.hasNext()) {
+    long timestamp = (Long) ei.next();
+    List<Record> tEvents = (List) events.get(timestamp);
+    SimpleDateFormat sdf = new java.text.SimpleDateFormat(
+        "yyyy-MM-dd HH:mm:ss");
+    for (Record event : tEvents) {
+      String cell = event.toString();
+      out.println("<tr><td>" + sdf.format(event.getTime()) + "</td><td>"
+          + cell + "</td></tr>");
+    }
+  }
 %>
 </table>
 </div>

Modified: incubator/chukwa/trunk/src/main/web/hicc/jsp/event_wrapper.jsp
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/src/main/web/hicc/jsp/event_wrapper.jsp?rev=1383245&r1=1383244&r2=1383245&view=diff
==============================================================================
--- incubator/chukwa/trunk/src/main/web/hicc/jsp/event_wrapper.jsp (original)
+++ incubator/chukwa/trunk/src/main/web/hicc/jsp/event_wrapper.jsp Tue Sep 11 05:14:41 2012
@@ -19,6 +19,7 @@
 %>
 <%@page import = "org.apache.hadoop.chukwa.util.XssFilter" %>
 <%
+   XssFilter xf = new XssFilter(request);
    response.setHeader("boxId", xf.getParameter("boxId"));
 %>
 <IFRAME id="<%= xf.getParameter("boxId") %>iframe" src="/hicc/jsp/event.jsp" width="100%" frameborder="0" height="600"></IFRAME>