You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by ja...@apache.org on 2014/11/20 17:44:46 UTC

[10/12] incubator-drill git commit: DRILL-1591, DRILL-1676: Move javascript resources to local serving and update dagre-d3 to older version (2.9). Update profile page. Remove references to invalid servlet api.

DRILL-1591, DRILL-1676: Move javascript resources to local serving and update dagre-d3 to older version (2.9). Update profile page.  Remove references to invalid servlet api.


Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/f2180b8f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/f2180b8f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/f2180b8f

Branch: refs/heads/master
Commit: f2180b8fc1edddc77ad7f6d9c615a4141cdc51ae
Parents: 2eb72a7
Author: Jacques Nadeau <ja...@apache.org>
Authored: Sun Nov 9 15:17:21 2014 -0800
Committer: Jacques Nadeau <ja...@apache.org>
Committed: Thu Nov 20 08:40:20 2014 -0800

----------------------------------------------------------------------
 contrib/storage-hbase/pom.xml                   |   12 +
 exec/java-exec/pom.xml                          |    6 +
 .../org/apache/drill/exec/server/Drillbit.java  |    9 +-
 .../drill/exec/server/rest/DrillRestServer.java |    1 -
 .../exec/server/rest/ProfileResources.java      |  162 +-
 .../exec/server/rest/WebResourceServer.java     |   71 -
 .../src/main/resources/rest/generic.ftl         |   12 +-
 .../src/main/resources/rest/profile/list.ftl    |   34 +-
 .../src/main/resources/rest/profile/profile.ftl |    6 +-
 .../resources/rest/static/css/bootstrap.min.css |    7 +
 .../main/resources/rest/static/img/drill.ico    |  Bin 0 -> 580 bytes
 .../resources/rest/static/js/bootstrap.min.js   |    6 +
 .../src/main/resources/rest/static/js/d3.v3.js  | 9215 ++++++++++++++++++
 .../resources/rest/static/js/dagre-d3.min.js    |    2 +
 .../src/main/resources/rest/static/js/graph.js  |  313 +
 .../main/resources/rest/static/js/html5shiv.js  |    8 +
 .../resources/rest/static/js/jquery.form.js     | 1277 +++
 .../main/resources/rest/static/js/jquery.min.js |    4 +
 .../resources/rest/static/js/respond.min.js     |    5 +
 .../src/main/resources/rest/storage/update.ftl  |    2 +-
 .../src/main/resources/rest/www/drill.ico       |  Bin 580 -> 0 bytes
 .../src/main/resources/rest/www/graph.js        |  313 -
 exec/jdbc/pom.xml                               |   10 +-
 pom.xml                                         |   39 +-
 24 files changed, 11028 insertions(+), 486 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/f2180b8f/contrib/storage-hbase/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/storage-hbase/pom.xml b/contrib/storage-hbase/pom.xml
index b91a177..69ca04a 100644
--- a/contrib/storage-hbase/pom.xml
+++ b/contrib/storage-hbase/pom.xml
@@ -181,6 +181,10 @@
           <version>1.2.1</version>
           <exclusions>
             <exclusion>
+              <groupId>org.mortbay.jetty</groupId>
+              <artifactId>servlet-api-2.5</artifactId>
+            </exclusion>
+            <exclusion>
               <artifactId>commons-logging</artifactId>
               <groupId>commons-logging</groupId>
             </exclusion>
@@ -267,6 +271,10 @@
           <version>0.94.17-mapr-1405-m7-4.0.0-FCS</version>
           <exclusions>
             <exclusion>
+              <groupId>org.mortbay.jetty</groupId>
+              <artifactId>servlet-api-2.5</artifactId>
+            </exclusion>
+            <exclusion>
               <artifactId>commons-logging</artifactId>
               <groupId>commons-logging</groupId>
             </exclusion>
@@ -326,6 +334,10 @@
           <scope>test</scope>
           <exclusions>
             <exclusion>
+              <groupId>org.mortbay.jetty</groupId>
+              <artifactId>servlet-api-2.5</artifactId>
+            </exclusion>
+            <exclusion>
               <artifactId>commons-logging</artifactId>
               <groupId>commons-logging</groupId>
             </exclusion>

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/f2180b8f/exec/java-exec/pom.xml
----------------------------------------------------------------------
diff --git a/exec/java-exec/pom.xml b/exec/java-exec/pom.xml
index 0dea38a..9fd67b1 100644
--- a/exec/java-exec/pom.xml
+++ b/exec/java-exec/pom.xml
@@ -106,6 +106,12 @@
       <groupId>org.glassfish.jersey.ext</groupId>
       <artifactId>jersey-mvc-freemarker</artifactId>
       <version>2.8</version>
+      <exclusions>
+          <exclusion>
+            <artifactId>servlet-api</artifactId>
+            <groupId>javax.servlet</groupId>
+          </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>net.hydromatic</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/f2180b8f/exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java b/exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java
index e8f175b..4b9b20d 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java
@@ -35,8 +35,10 @@ import org.apache.drill.exec.work.WorkManager;
 import org.apache.zookeeper.Environment;
 import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.server.handler.ErrorHandler;
+import org.eclipse.jetty.servlet.DefaultServlet;
 import org.eclipse.jetty.servlet.ServletContextHandler;
 import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.util.resource.Resource;
 import org.glassfish.jersey.servlet.ServletContainer;
 
 import com.codahale.metrics.servlets.MetricsServlet;
@@ -132,9 +134,14 @@ public class Drillbit implements Closeable{
     context.addServlet(new ServletHolder(new MetricsServlet(this.context.getMetrics())), "/status/metrics");
     context.addServlet(new ServletHolder(new ThreadDumpServlet()), "/status/threads");
 
+    ServletHolder staticHolder = new ServletHolder("static", DefaultServlet.class);
+    staticHolder.setInitParameter("resourceBase", Resource.newClassPathResource("/rest/static").toString());
+    staticHolder.setInitParameter("dirAllowed","false");
+    staticHolder.setInitParameter("pathInfoOnly","true");
+    context.addServlet(staticHolder,"/static/*");
+
     embeddedJetty.start();
 
-    System.out.println("");
   }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/f2180b8f/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/DrillRestServer.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/DrillRestServer.java b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/DrillRestServer.java
index ac6a537..cdbaaaf 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/DrillRestServer.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/DrillRestServer.java
@@ -44,7 +44,6 @@ public class DrillRestServer extends ResourceConfig {
     register(QueryResources.class);
     register(MetricsResources.class);
     register(ThreadsResources.class);
-    register(WebResourceServer.class);
     register(FreemarkerMvcFeature.class);
     property(ServerProperties.METAINF_SERVICES_LOOKUP_DISABLE, true);
     register(MultiPartFeature.class);

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/f2180b8f/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/ProfileResources.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/ProfileResources.java b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/ProfileResources.java
index 666faa2..58b3d4e 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/ProfileResources.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/ProfileResources.java
@@ -24,6 +24,7 @@ import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
 
 import javax.inject.Inject;
 import javax.ws.rs.GET;
@@ -33,12 +34,17 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.xml.bind.annotation.XmlRootElement;
 
+import org.apache.drill.exec.proto.GeneralRPCProtos.Ack;
+import org.apache.drill.exec.proto.UserBitShared.QueryId;
+import org.apache.drill.exec.proto.UserBitShared.QueryInfo;
 import org.apache.drill.exec.proto.UserBitShared.QueryProfile;
 import org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState;
 import org.apache.drill.exec.proto.helper.QueryIdHelper;
 import org.apache.drill.exec.store.sys.EStore;
 import org.apache.drill.exec.store.sys.PStore;
+import org.apache.drill.exec.store.sys.PStoreProvider;
 import org.apache.drill.exec.work.WorkManager;
+import org.apache.drill.exec.work.foreman.Foreman;
 import org.apache.drill.exec.work.foreman.QueryStatus;
 import org.glassfish.jersey.server.mvc.Viewable;
 
@@ -48,8 +54,7 @@ import com.google.common.collect.Lists;
 public class ProfileResources {
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ProfileResources.class);
 
-  @Inject
-  WorkManager work;
+  @Inject WorkManager work;
 
   public static class ProfileInfo implements Comparable<ProfileInfo> {
     public static final SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
@@ -58,12 +63,20 @@ public class ProfileResources {
     private Date time;
     private String location;
     private String foreman;
+    private String query;
+    private String state;
 
-    public ProfileInfo(String queryId, long time, String foreman) {
+    public ProfileInfo(String queryId, long time, String foreman, String query, String state) {
       this.queryId = queryId;
       this.time = new Date(time);
       this.foreman = foreman;
       this.location = "http://localhost:8047/profile/" + queryId + ".json";
+      this.query = query = query.substring(0,  Math.min(query.length(), 150));
+      this.state = state;
+    }
+
+    public String getQuery(){
+      return query;
     }
 
     public String getQueryId() {
@@ -74,6 +87,11 @@ public class ProfileResources {
       return format.format(time);
     }
 
+
+    public String getState() {
+      return state;
+    }
+
     public String getLocation() {
       return location;
     }
@@ -89,6 +107,10 @@ public class ProfileResources {
 
   }
 
+  private PStoreProvider provider(){
+    return work.getContext().getPersistentStoreProvider();
+  }
+
   @XmlRootElement
   public class QProfiles {
     private List<ProfileInfo> runningQueries;
@@ -112,36 +134,32 @@ public class ProfileResources {
   @Path("/profiles.json")
   @Produces(MediaType.APPLICATION_JSON)
   public QProfiles getProfilesJSON() {
-    PStore<QueryProfile> pStore = null;
-    EStore<QueryProfile> eStore = null;
+    PStore<QueryProfile> completed = null;
+    PStore<QueryInfo> running = null;
     try {
-      pStore = work.getContext().getPersistentStoreProvider().getPStore(QueryStatus.QUERY_PROFILE);
-      eStore = work.getContext().getPersistentStoreProvider().getEStore(QueryStatus.RUNNING_QUERY_PROFILE);
+      completed = provider().getStore(QueryStatus.QUERY_PROFILE);
+      running = provider().getStore(QueryStatus.RUNNING_QUERY_INFO);
     } catch (IOException e) {
       logger.debug("Failed to get profiles from persistent or ephemeral store.");
       return new QProfiles(new ArrayList<ProfileInfo>(), new ArrayList<ProfileInfo>());
     }
 
     List<ProfileInfo> runningQueries = Lists.newArrayList();
-    List<ProfileInfo> finishedQueries = Lists.newArrayList();
 
-    for (Map.Entry<String, QueryProfile> entry : eStore) {
-      QueryProfile profile = entry.getValue();
-      if (profile.getState() == QueryState.RUNNING || profile.getState() == QueryState.PENDING) {
-        runningQueries.add(new ProfileInfo(entry.getKey(), profile.getStart(), profile.getForeman().getAddress()));
-      }
+    for (Map.Entry<String, QueryInfo> entry : running) {
+      QueryInfo profile = entry.getValue();
+      runningQueries.add(new ProfileInfo(entry.getKey(), profile.getStart(), profile.getForeman().getAddress(), profile.getQuery(), profile.getState().name()));
     }
 
-    for (Map.Entry<String, QueryProfile> entry : pStore) {
+    Collections.sort(runningQueries, Collections.reverseOrder());
+
+
+    List<ProfileInfo> finishedQueries = Lists.newArrayList();
+    for (Map.Entry<String, QueryProfile> entry : completed) {
       QueryProfile profile = entry.getValue();
-      if (profile.getState() == QueryState.COMPLETED || profile.getState() == QueryState.FAILED || profile.getState() == QueryState.CANCELED) {
-        finishedQueries.add(new ProfileInfo(entry.getKey(), profile.getStart(), profile.getForeman().getAddress()));
-      }
+      finishedQueries.add(new ProfileInfo(entry.getKey(), profile.getStart(), profile.getForeman().getAddress(), profile.getQuery(), profile.getState().name()));
     }
 
-    Collections.sort(runningQueries, Collections.reverseOrder());
-    Collections.sort(finishedQueries, Collections.reverseOrder());
-
     return new QProfiles(runningQueries, finishedQueries);
   }
 
@@ -154,57 +172,37 @@ public class ProfileResources {
   }
 
   private QueryProfile getQueryProfile(String queryId) {
-    PStore<QueryProfile> pStore = null;
-    try {
-      pStore = work.getContext().getPersistentStoreProvider().getPStore(QueryStatus.QUERY_PROFILE);
-    } catch (IOException e) {
-      logger.debug("Failed to get profile for: " + queryId);
-      return QueryProfile.getDefaultInstance();
-    }
+    QueryId id = QueryIdHelper.getQueryIdFromString(queryId);
 
-    QueryProfile profile = null;
-
-    //TODO: we should handle the error case better. In stead of just returning a default profile instance, we should let user know of the error happened.
-    try {
-      // the complete profile is now stored as blob in the PStore
-      profile = pStore.getBlob(queryId);
-    } catch (Exception ex) {
-      logger.error("Fail to get full profile from PStore for query: {}. Error:{}", queryId, ex);
-    }
-    try {
-      if (profile == null) {
-        profile = pStore.get(queryId); // this is to load profile data from older builds.
-      }
-    } catch (Exception ex) {
-      logger.error("Fail to get compact profile from PStore for query: {}. Error:{}", queryId, ex);
+    // first check local running
+    Foreman f = work.getBee().getForemanForQueryId(id);
+    if(f != null){
+      return f.getQueryStatus().getAsProfile();
     }
 
-    return profile == null ? QueryProfile.getDefaultInstance() : profile;
-
-  }
+    // then check remote running
+    try{
+      PStore<QueryInfo> runningQueries = provider().getStore(QueryStatus.RUNNING_QUERY_INFO);
+      QueryInfo info = runningQueries.get(queryId);
+      return work.getContext().getController().getTunnel(info.getForeman()).requestQueryProfile(id).checkedGet(2, TimeUnit.SECONDS);
+    }catch(Exception e){
+      logger.debug("Failure to find query as running profile.", e);
+    }
 
-  private QueryProfile getRunningQueryProfile(String queryId) {
-    EStore<QueryProfile> eStore = null;
-    try {
-      eStore = work.getContext().getPersistentStoreProvider().getEStore(QueryStatus.RUNNING_QUERY_PROFILE);
-    } catch (IOException e) {
-      logger.debug("Failed to get profile for: " + queryId);
-      return QueryProfile.getDefaultInstance();
+    // then check blob store
+    try{
+      PStore<QueryProfile> profiles = provider().getStore(QueryStatus.QUERY_PROFILE);
+      return profiles.get(queryId);
+    }catch(Exception e){
+      logger.warn("Failure to load query profile for query {}", queryId, e);
     }
 
-    QueryProfile profile = eStore.get(queryId);
+    // TODO: Improve error messaging.
+    return QueryProfile.getDefaultInstance();
 
-    if (profile != null) {
-      if (work.getBee().getForemanForQueryId(profile.getId()) != null) {
-        profile = work.getBee().getForemanForQueryId(profile.getId()).getQueryStatus().getAsProfile(true);
-        return profile;
-      }
-    } else {
-        logger.debug("profile from non-foreman");
-    }
-    return profile == null ? QueryProfile.getDefaultInstance() : profile;
   }
 
+
   @GET
   @Path("/profiles/{queryid}.json")
   @Produces(MediaType.APPLICATION_JSON)
@@ -227,30 +225,36 @@ public class ProfileResources {
 
   }
 
-  @GET
-  @Path("/running_profiles/{queryid}")
-  @Produces(MediaType.TEXT_HTML)
-  public Viewable getRunningProfile(@PathParam("queryid") String queryId) {
-    ProfileWrapper wrapper = new ProfileWrapper(getRunningQueryProfile(queryId));
-
-    return new Viewable("/rest/profile/profile.ftl", wrapper);
-
-  }
 
   @GET
   @Path("/profiles/cancel/{queryid}")
   @Produces(MediaType.TEXT_PLAIN)
   public String cancelQuery(@PathParam("queryid") String queryId) throws IOException {
-    EStore<QueryProfile> profiles = work.getContext().getPersistentStoreProvider().getEStore(QueryStatus.RUNNING_QUERY_PROFILE);
-    QueryProfile profile = profiles.get(queryId);
-    if (profile != null && (profile.getState() == QueryState.RUNNING || profile.getState() == QueryState.PENDING)) {
-      work.getUserWorker().cancelQuery(QueryIdHelper.getQueryIdFromString(queryId));
-      return "Cancelled query " + queryId;
+
+    QueryId id = QueryIdHelper.getQueryIdFromString(queryId);
+
+    // first check local running
+    Foreman f = work.getBee().getForemanForQueryId(id);
+    if(f != null){
+      f.cancel();
+      return String.format("Cancelled query %s on locally running node.", queryId);
     }
-    if (profile == null) {
-      return "No such query: " + queryId;
+
+    // then check remote running
+    try{
+      PStore<QueryInfo> runningQueries = provider().getStore(QueryStatus.RUNNING_QUERY_INFO);
+      QueryInfo info = runningQueries.get(queryId);
+      Ack a = work.getContext().getController().getTunnel(info.getForeman()).requestCancelQuery(id).checkedGet(2, TimeUnit.SECONDS);
+      if(a.getOk()){
+        return String.format("Query %s canceled on node %s.", queryId, info.getForeman().getAddress());
+      }else{
+        return String.format("Attempted to cancel query %s on %s but the query is no longer active on that node.", queryId, info.getForeman().getAddress());
+      }
+    }catch(Exception e){
+      logger.debug("Failure to find query as running profile.", e);
+      return String.format("Failure attempting to cancel query %s.  Unable to find information about where query is actively running.", queryId);
     }
-    return "Query " + queryId + " not running";
+
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/f2180b8f/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/WebResourceServer.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/WebResourceServer.java b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/WebResourceServer.java
deleted file mode 100644
index 249cb8c..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/WebResourceServer.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * 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.
- */
-package org.apache.drill.exec.server.rest;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URLConnection;
-
-import javax.inject.Inject;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.drill.exec.work.WorkManager;
-
-@Path("/www")
-public class WebResourceServer {
-  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(WebResourceServer.class);
-
-  @Inject WorkManager work;
-
-
-  @GET
-  @Path("/{path}")
-  @Produces(MediaType.TEXT_PLAIN)
-  public Response getResource(@PathParam("path") String path) throws IOException {
-    try {
-      String s = "rest/www/" + path;
-      ClassLoader cl = Thread.currentThread().getContextClassLoader();
-      InputStream is = new BufferedInputStream(cl.getResource(s).openStream());
-
-      String mime = "text/plain";
-      if (s.endsWith(".js")) {
-        mime = "text/javascript";
-      } else if (s.endsWith(".css")) {
-        mime = "text/css";
-      } else {
-        mime = URLConnection.guessContentTypeFromStream(is);
-      }
-
-      byte[] d = IOUtils.toByteArray(is);
-      return Response.ok(d).type(mime).build();
-    } catch (Exception e) {
-      e.printStackTrace();
-      e.printStackTrace(System.out);
-    }
-
-    return Response.noContent().status(Status.NOT_FOUND).build();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/f2180b8f/exec/java-exec/src/main/resources/rest/generic.ftl
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/resources/rest/generic.ftl b/exec/java-exec/src/main/resources/rest/generic.ftl
index 0543755..1c229b6 100644
--- a/exec/java-exec/src/main/resources/rest/generic.ftl
+++ b/exec/java-exec/src/main/resources/rest/generic.ftl
@@ -23,17 +23,17 @@
       <meta http-equiv="X-UA-Compatible" content="IE=edge">
 
       <title>Apache Drill</title>
-      <link rel="shortcut icon" href="/www/drill.ico">
+      <link rel="shortcut icon" href="/static/img/drill.ico">
 
-      <link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
+      <link href="/static/css/bootstrap.min.css" rel="stylesheet">
 
-      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
-      <script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
+      <script src="/static/js/jquery.min.js"></script>
+      <script src="/static/js/bootstrap.min.js"></script>
 
       <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
       <!--[if lt IE 9]>
-        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
-        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
+        <script src="/static/js/html5shiv.js"></script>
+        <script src="/static/js/1.4.2/respond.min.js"></script>
       <![endif]-->
 
       <@page_head/>

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/f2180b8f/exec/java-exec/src/main/resources/rest/profile/list.ftl
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/resources/rest/profile/list.ftl b/exec/java-exec/src/main/resources/rest/profile/list.ftl
index ef6b66d..921e52f 100644
--- a/exec/java-exec/src/main/resources/rest/profile/list.ftl
+++ b/exec/java-exec/src/main/resources/rest/profile/list.ftl
@@ -23,27 +23,37 @@
       <table class="table table-hover">
         <thead>
            <td>Time</td>
-           <td>Query Id</td>
+           <!-- <td>Query Id</td> -->
+           <td>Query</td>
+           <td>State</td>
            <td>Foreman</td>
         </thead>
         <tbody>
           <#list model.getRunningQueries() as query>
           <tr>
             <td>${query.getTime()}</td>
+            <!--
             <td>
-              <a href="/running_profiles/${query.getQueryId()}">
+              <a href="/profiles/${query.getQueryId()}">
                 <div style="height:100%;width:100%">
                   ${query.getQueryId()}
                 </div>
               </a>
             </td>
+            -->
+            <td>
+              <a href="/profiles/${query.getQueryId()}">
+              <div style="height:100%;width:100%;white-space:pre-line">${query.getQuery()}</div>
+              </a>
+            </td> 
+            <td>
+              <div style="height:100%;width:100%">${query.getState()}</div>          
             <td>
-              <a href="http://${query.getForeman()}:8047/running_profiles/${query.getQueryId()}" target="_blank">
                 <div style="height:100%;width:100%">
                   ${query.getForeman()}
                 </div>
-              </a>
             </td>
+            
           </tr>
           </#list>
         </tbody>
@@ -62,13 +72,16 @@
     <table class="table table-hover">
       <thead>
          <td>Time</td>
-         <td>Query Id</td>
+         <!-- <td>Query Id</td> -->
+         <td>Query</td>
+         <td>State</td>
          <td>Foreman</td>
       </thead>
       <tbody>
         <#list model.getFinishedQueries() as query>
         <tr>
           <td>${query.getTime()}</td>
+          <!--
           <td>
             <a href="/profiles/${query.getQueryId()}">
               <div style="height:100%;width:100%">
@@ -76,12 +89,19 @@
               </div>
             </a>
           </td>
+          -->
+          <td>
+            <a href="/profiles/${query.getQueryId()}">
+              <div style="height:100%;width:100%;white-space:pre-line">${query.getQuery()}</div>
+            </a>
+          </td>      
+          <td>
+              <div style="height:100%;width:100%">${query.getState()}</div>
+          </td>
           <td>
-            <a href="http://${query.getForeman()}:8047/profiles/${query.getQueryId()}" target="_blank">
               <div style="height:100%;width:100%">
                 ${query.getForeman()}
               </div>
-            </a>
           </td>
         </tr>
         </#list>

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/f2180b8f/exec/java-exec/src/main/resources/rest/profile/profile.ftl
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/resources/rest/profile/profile.ftl b/exec/java-exec/src/main/resources/rest/profile/profile.ftl
index 5d3e73f..bd4ea33 100644
--- a/exec/java-exec/src/main/resources/rest/profile/profile.ftl
+++ b/exec/java-exec/src/main/resources/rest/profile/profile.ftl
@@ -11,9 +11,9 @@
 
 <#include "*/generic.ftl">
 <#macro page_head>
-<script src="http://d3js.org/d3.v3.js"></script>
-<script src="http://cpettitt.github.io/project/dagre-d3/v0.2.6/dagre-d3.js"></script>
-<script src="/www/graph.js"></script>
+<script src="/static/js/d3.v3.js"></script>
+<script src="/static/js/dagre-d3.min.js"></script>
+<script src="/static/js/graph.js"></script>
 <script>
     var globalconfig = {
         "queryid" : "${model.getQueryId()}",