incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [04/19] Moving blur console to the root of the project.
Date Tue, 17 Jun 2014 20:24:12 GMT
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/blur-console/src/main/webapp/views/search.tpl.html
----------------------------------------------------------------------
diff --git a/blur-console/src/main/webapp/views/search.tpl.html b/blur-console/src/main/webapp/views/search.tpl.html
new file mode 100644
index 0000000..82495cc
--- /dev/null
+++ b/blur-console/src/main/webapp/views/search.tpl.html
@@ -0,0 +1,51 @@
+<!--
+
+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.
+ -->
+
+<div id="tableGoneWarning" class="alert alert-warning" style="display:none"><strong>Heads Up!</strong> The table that is currently being used for search is no longer enabled!</div>
+<div class="well">
+	<div class="container-fluid">
+		<div class="row">
+			<div class="col-xs-6">
+				<div class="input-group">
+					<input type="text" class="form-control" placeholder="Query" id="queryField">
+					<span class="input-group-btn">
+	        			<button class="btn btn-default" type="button" id="searchTrigger">Go!</button>
+	      			</span>
+				</div>
+			</div>
+			<div class="col-xs-2">
+				<select class="form-control" id="tableChooser">
+					<option value="" id="statusOption">Loading Tables....</option>
+				</select>
+			</div>
+			<button class="btn btn-default" type="button" id="searchOptionsTrigger">
+				<i class="glyphicon glyphicon-cog"></i>
+			</button>
+			<span id="searchOptionsDisplay"></span>
+		</div>
+		<div id="resultInfo" class="row">
+			<div id="resultCount" class="col-xs-2"></div>
+			<div class="col-xs-2"><button type="button" id="facetTrigger" class="btn btn-default btn-xs" style="display:none">Run Facets</button></div>
+		</div>
+	</div>
+</div>
+<div id="results">
+
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/blur-console/src/main/webapp/views/tables.tpl.html
----------------------------------------------------------------------
diff --git a/blur-console/src/main/webapp/views/tables.tpl.html b/blur-console/src/main/webapp/views/tables.tpl.html
new file mode 100644
index 0000000..e950dd3
--- /dev/null
+++ b/blur-console/src/main/webapp/views/tables.tpl.html
@@ -0,0 +1,20 @@
+<!--
+
+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.
+ -->
+<div id="tableInfoHolder"><img src="img/ajax-loader.gif"></div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/blur-console/src/test/java/org/apache/blur/console/ConsoleTestBase.java
----------------------------------------------------------------------
diff --git a/blur-console/src/test/java/org/apache/blur/console/ConsoleTestBase.java b/blur-console/src/test/java/org/apache/blur/console/ConsoleTestBase.java
new file mode 100644
index 0000000..0aeebaf
--- /dev/null
+++ b/blur-console/src/test/java/org/apache/blur/console/ConsoleTestBase.java
@@ -0,0 +1,45 @@
+/**
+ * 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.blur.console;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.blur.console.util.Config;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+public class ConsoleTestBase {
+	protected static String TABLE_PATH = new File("./test-data/test-tables").getAbsolutePath();
+
+	@BeforeClass
+	public static void startup() throws IOException {
+		Config.setupMiniCluster();
+	}
+
+	@AfterClass
+	public static void shutdown() throws IOException {
+		Config.shutdownMiniCluster();
+	}
+
+	protected void setupConfigIfNeeded() throws IOException {
+		if (Config.getBlurConfig() == null) {
+			Config.setupConfig();
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/blur-console/src/test/java/org/apache/blur/console/RunMiniCluster.java
----------------------------------------------------------------------
diff --git a/blur-console/src/test/java/org/apache/blur/console/RunMiniCluster.java b/blur-console/src/test/java/org/apache/blur/console/RunMiniCluster.java
new file mode 100644
index 0000000..172dffd
--- /dev/null
+++ b/blur-console/src/test/java/org/apache/blur/console/RunMiniCluster.java
@@ -0,0 +1,63 @@
+/**
+ * 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.blur.console;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.blur.MiniCluster;
+import org.apache.blur.utils.GCWatcher;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.LocalFileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.permission.FsAction;
+import org.apache.hadoop.fs.permission.FsPermission;
+
+public class RunMiniCluster {
+
+  private static final File TMPDIR = new File(System.getProperty("blur.tmp.dir", "./target/mini-cluster"));
+
+  public static void main(String[] args) throws IOException {
+    GCWatcher.init(0.60);
+    LocalFileSystem localFS = FileSystem.getLocal(new Configuration());
+    File testDirectory = new File(TMPDIR, "blur-cluster-test").getAbsoluteFile();
+    testDirectory.mkdirs();
+
+    Path directory = new Path(testDirectory.getPath());
+    FsPermission dirPermissions = localFS.getFileStatus(directory).getPermission();
+    FsAction userAction = dirPermissions.getUserAction();
+    FsAction groupAction = dirPermissions.getGroupAction();
+    FsAction otherAction = dirPermissions.getOtherAction();
+
+    StringBuilder builder = new StringBuilder();
+    builder.append(userAction.ordinal());
+    builder.append(groupAction.ordinal());
+    builder.append(otherAction.ordinal());
+    String dirPermissionNum = builder.toString();
+    System.setProperty("dfs.datanode.data.dir.perm", dirPermissionNum);
+    testDirectory.delete();
+    MiniCluster miniCluster = new MiniCluster();
+    miniCluster.startBlurCluster(new File(testDirectory, "cluster").getAbsolutePath(), 2, 3, true);
+
+    System.out.println("ZK Connection String = [" + miniCluster.getZkConnectionString() + "]");
+    System.out.println("Controller Connection String = [" + miniCluster.getControllerConnectionStr() + "]");
+    System.out.println("HDFS URI = [" + miniCluster.getFileSystemUri() + "]");
+
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/blur-console/src/test/java/org/apache/blur/console/util/ConfigTest.java
----------------------------------------------------------------------
diff --git a/blur-console/src/test/java/org/apache/blur/console/util/ConfigTest.java b/blur-console/src/test/java/org/apache/blur/console/util/ConfigTest.java
new file mode 100644
index 0000000..3d2c922
--- /dev/null
+++ b/blur-console/src/test/java/org/apache/blur/console/util/ConfigTest.java
@@ -0,0 +1,59 @@
+/**
+ * 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.blur.console.util;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.net.InetAddress;
+
+import org.apache.blur.BlurConfiguration;
+import org.apache.blur.console.ConsoleTestBase;
+import org.apache.commons.lang.StringUtils;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ConfigTest extends ConsoleTestBase {
+	
+	@Before
+	public void setup() throws IOException {
+		Config.setupConfig();
+	}
+
+	@Test
+	public void testGetConsolePort() {
+		assertEquals(8080, Config.getConsolePort());
+	}
+
+	@Test
+	public void testGetBlurConfig() {
+		BlurConfiguration blurConfig = Config.getBlurConfig();
+		assertNotNull(blurConfig);
+	}
+
+	@Test
+	public void testGetConnectionString() throws IOException {
+		assertTrue(StringUtils.contains(Config.getConnectionString(), InetAddress.getLocalHost().getHostName()));
+	}
+	
+	@Test
+	public void testGetZookeeper() {
+		assertNotNull(Config.getZookeeper());
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/blur-console/src/test/java/org/apache/blur/console/util/NodeUtilTest.java
----------------------------------------------------------------------
diff --git a/blur-console/src/test/java/org/apache/blur/console/util/NodeUtilTest.java b/blur-console/src/test/java/org/apache/blur/console/util/NodeUtilTest.java
new file mode 100644
index 0000000..1d56b92
--- /dev/null
+++ b/blur-console/src/test/java/org/apache/blur/console/util/NodeUtilTest.java
@@ -0,0 +1,64 @@
+/**
+ * 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.blur.console.util;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.blur.console.ConsoleTestBase;
+import org.apache.blur.thirdparty.thrift_0_9_0.TException;
+import org.apache.blur.thrift.generated.BlurException;
+import org.junit.Before;
+import org.junit.Test;
+
+public class NodeUtilTest extends ConsoleTestBase {
+	@Before
+	public void setup() throws BlurException, TException, IOException {
+		setupConfigIfNeeded();
+	}
+	
+	@SuppressWarnings("unchecked")
+	@Test
+	public void testGetControllerStatus() throws BlurException, IOException, TException {
+		Map<String, Object> nodeStatus = NodeUtil.getControllerStatus();
+		
+		assertEquals(2, ((List<String>) nodeStatus.get("online")).size());
+		assertEquals(0, ((List<String>) nodeStatus.get("offline")).size());
+	}
+	
+	@SuppressWarnings("unchecked")
+	@Test
+	public void testGetZookeeperStatus() throws BlurException, IOException, TException {
+		Map<String, Object> nodeStatus = NodeUtil.getZookeeperStatus();
+		
+		assertEquals(0, ((HashSet<String>) nodeStatus.get("online")).size());
+		assertEquals(1, ((HashSet<String>) nodeStatus.get("offline")).size());
+	}
+	
+	@SuppressWarnings("unchecked")
+	@Test
+	public void testGetClusterStatus() throws BlurException, IOException, TException {
+		List<Map<String, Object>> nodeStatus = NodeUtil.getClusterStatus();
+		
+		assertEquals(3, ((List<String>) nodeStatus.get(0).get("online")).size());
+		assertEquals(0, ((List<String>) nodeStatus.get(0).get("offline")).size());
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/blur-console/src/test/java/org/apache/blur/console/util/QueryUtilTest.java
----------------------------------------------------------------------
diff --git a/blur-console/src/test/java/org/apache/blur/console/util/QueryUtilTest.java b/blur-console/src/test/java/org/apache/blur/console/util/QueryUtilTest.java
new file mode 100644
index 0000000..0077cc8
--- /dev/null
+++ b/blur-console/src/test/java/org/apache/blur/console/util/QueryUtilTest.java
@@ -0,0 +1,99 @@
+/**
+ * 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.blur.console.util;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.blur.console.ConsoleTestBase;
+import org.apache.blur.thirdparty.thrift_0_9_0.TException;
+import org.apache.blur.thrift.BlurClient;
+import org.apache.blur.thrift.generated.Blur.Iface;
+import org.apache.blur.thrift.generated.BlurException;
+import org.apache.blur.thrift.generated.BlurQuery;
+import org.apache.blur.thrift.generated.Column;
+import org.apache.blur.thrift.generated.Query;
+import org.apache.blur.thrift.generated.Record;
+import org.apache.blur.thrift.generated.RecordMutation;
+import org.apache.blur.thrift.generated.RecordMutationType;
+import org.apache.blur.thrift.generated.RowMutation;
+import org.apache.blur.thrift.generated.RowMutationType;
+import org.apache.blur.thrift.generated.ScoreType;
+import org.apache.blur.thrift.generated.TableDescriptor;
+import org.junit.Before;
+import org.junit.Test;
+
+public class QueryUtilTest extends ConsoleTestBase {
+	@Before
+	public void setup() throws IOException, BlurException, TException {
+		setupConfigIfNeeded();
+		
+		Iface client = BlurClient.getClient(Config.getConnectionString());
+		
+		if (!client.tableList().contains("queryUnitTable")) {
+			TableDescriptor td = new TableDescriptor();
+			td.setShardCount(11);
+			td.setTableUri("file://" + TABLE_PATH + "/queryUnitTable");
+			td.setCluster("default");
+			td.setName("queryUnitTable");
+			td.setEnabled(true);
+			client.createTable(td);
+			
+			Record record = new Record("abcd", "fam0", Arrays.asList(new Column[]{ new Column("col0", "testvalue")}));
+			RecordMutation recordMutation = new RecordMutation(RecordMutationType.REPLACE_ENTIRE_RECORD, record);
+			RowMutation rowMutation = new RowMutation("queryUnitTable", "12345", RowMutationType.REPLACE_ROW, Arrays.asList(new RecordMutation[]{ recordMutation }));
+			client.mutate(rowMutation);
+		}
+	}
+	
+	@Test
+	public void testGetCurrentQueryCount() throws BlurException, IOException, TException {
+		Iface client = BlurClient.getClient(Config.getConnectionString());
+		BlurQuery query = new BlurQuery(
+				new Query("fam0.col0:*", true, ScoreType.SUPER, null, null), 
+				null, 
+				null, //new Selector(false, null, null, null, null, null, 0, 10, null), 
+				false, 0, 10, 1, 2000, UUID.randomUUID().toString(), "testUser", false, System.currentTimeMillis(),null,null);
+		client.query("queryUnitTable", query);
+		
+		assertEquals(1, QueryUtil.getCurrentQueryCount());
+	}
+	
+	@SuppressWarnings("unchecked")
+	@Test
+	public void testGetQueries() throws IOException, BlurException, TException {
+		Iface client = BlurClient.getClient(Config.getConnectionString());
+		BlurQuery query = new BlurQuery(
+				new Query("fam0.col0:*", true, ScoreType.SUPER, null, null), 
+				null, 
+				null, //new Selector(false, null, null, null, null, null, 0, 10, null), 
+				false, 0, 10, 1, 2000, UUID.randomUUID().toString(), "testUser", false, System.currentTimeMillis(),null,null);
+		client.query("queryUnitTable", query);
+		
+		Map<String, Object> queries = QueryUtil.getQueries();
+		
+		assertEquals(0, queries.get("slowQueries"));
+		assertEquals(2, ((List<Map<String, Object>>) queries.get("queries")).size());
+		assertEquals("testUser", ((List<Map<String, Object>>)queries.get("queries")).get(0).get("user"));
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/blur-console/src/test/java/org/apache/blur/console/util/TableUtilTest.java
----------------------------------------------------------------------
diff --git a/blur-console/src/test/java/org/apache/blur/console/util/TableUtilTest.java b/blur-console/src/test/java/org/apache/blur/console/util/TableUtilTest.java
new file mode 100644
index 0000000..e3d580c
--- /dev/null
+++ b/blur-console/src/test/java/org/apache/blur/console/util/TableUtilTest.java
@@ -0,0 +1,80 @@
+/**
+ * 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.blur.console.util;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.blur.console.ConsoleTestBase;
+import org.apache.blur.thirdparty.thrift_0_9_0.TException;
+import org.apache.blur.thrift.BlurClient;
+import org.apache.blur.thrift.generated.Blur.Iface;
+import org.apache.blur.thrift.generated.BlurException;
+import org.apache.blur.thrift.generated.TableDescriptor;
+import org.junit.Before;
+import org.junit.Test;
+
+public class TableUtilTest extends ConsoleTestBase {
+	
+	@Before
+	public void ensureCleanTables() throws BlurException, TException, IOException {
+		setupConfigIfNeeded();
+		
+		Iface client = BlurClient.getClient(Config.getConnectionString());
+		List<String> tableList = client.tableList();
+		if (!tableList.isEmpty()) {
+			for (String table : tableList) {
+				client.disableTable(table);
+				client.removeTable(table, true);
+			}
+		}
+	}
+	
+	@SuppressWarnings("rawtypes")
+	@Test
+	public void testGetTableSummariesNoTables() throws BlurException, IOException, TException {
+		Map<String, List> data = TableUtil.getTableSummaries();
+		
+		assertEquals(0, data.get("tables").size());
+	}
+	
+	@SuppressWarnings({ "unchecked", "rawtypes" })
+	@Test
+	public void testGetTableSummaries() throws BlurException, TException, IOException {
+		Iface client = BlurClient.getClient(Config.getConnectionString());
+		
+		TableDescriptor td = new TableDescriptor();
+		td.setShardCount(11);
+		td.setTableUri("file://" + TABLE_PATH + "/tableUnitTable");
+		td.setCluster("default");
+		td.setName("tableUnitTable");
+		td.setEnabled(true);
+		client.createTable(td);
+		
+		Map<String, List> data = TableUtil.getTableSummaries();
+		
+		assertEquals(1, data.get("tables").size());
+		assertEquals(0l, ((Map<String, Object>) data.get("tables").get(0)).get("rows"));
+		assertEquals(0l, ((Map<String,Object>) data.get("tables").get(0)).get("records"));
+		assertEquals("default", ((Map<String,Object>) data.get("tables").get(0)).get("cluster"));
+		assertEquals("tableUnitTable", ((Map<String,Object>) data.get("tables").get(0)).get("name"));
+		assertEquals(0, ((List<String>) ((Map<String,Object>) data.get("tables").get(0)).get("families")).size());
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/.gitignore
----------------------------------------------------------------------
diff --git a/contrib/blur-console/.gitignore b/contrib/blur-console/.gitignore
deleted file mode 100644
index 5e40c1f..0000000
--- a/contrib/blur-console/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-test-data
-src/main/webapp/libs/*
-src/main/webapp/node_modules/*
-src/main/webapp/css/*
-src/main/webapp/test/bower_components/*

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/README.md
----------------------------------------------------------------------
diff --git a/contrib/blur-console/README.md b/contrib/blur-console/README.md
deleted file mode 100644
index 6b6d39e..0000000
--- a/contrib/blur-console/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-# Blur Console
-
-Blur Console is a tool built to help visualize that status of an Apache Blur (Incubator) cluster.  The tool contains information about node status, table status, and query status.  The tool also has a built in search page to quickly search and retrieve records and rows from Apache Blur.
-
-## Development Setup
-
-The development for this tool is done in two pieces the UI (Javascript) and the services (Java).  The services piece contains and encapsulates all of the connections and requests into Apache Blur.  The services piece is also responsible for starting a webserver and serving the static UI resources.  The structure of this component allows for the UI and services to be worked on independently and then both can be packaged together for one distribution.
-
-In order to contribute to the development of this component the following tools/languages will need to be available:
-
-* Java
-* Ruby (1.9.x or higher)
-* Node (0.10.x or higher) - This will come with npm
-
-### UI Development
-
-The UI code lives in the ui directory.  This directory has been setup like a standard javascript based application would be.  The goal of this is to allow for rapid development of the UI components while flushing out the service API.  The UI portion has been built so that the system can be run with fake data to mock out the actual Apache Blur integration.
-
-To get up and running to work on the UI component you can follow these steps:
-
-1. Install bower (js package manager)
-
-		npm install -g bower
-
-2. Install grunt-cli (node build manager)
-
-		npm install -g grunt-cli
-
-3. Install compass (this will install sass a stylesheet compiler)
-
-		gem install compass
-
-4. Install project build/test dependencies (from the ui directory)
-		
-		npm install
-
-5. Install js dependencies (from the ui directory)
-		
-		bower install
-
-Once the dependencies and build tools are installed the following commands can be used (from the ui directory):
-
-* Run tests
-		
-		grunt test
-
-* Start development server (server will be available on port 9000)
-		
-		grunt serve
-
-### Services Development
-
-The services code lives at the root of the console directory and is a basic maven project.
-
-## Packing for distribution
-
-TODO: Need to still figure this out
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/blur-console/pom.xml b/contrib/blur-console/pom.xml
deleted file mode 100644
index ce92f9f..0000000
--- a/contrib/blur-console/pom.xml
+++ /dev/null
@@ -1,240 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!-- 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. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-	<modelVersion>4.0.0</modelVersion>
-
-	<parent>
-		<groupId>org.apache.blur</groupId>
-		<artifactId>blur</artifactId>
-		<version>0.2.2-incubating</version>
-		<relativePath>../../pom.xml</relativePath>
-	</parent>
-
-	<groupId>org.apache.blur</groupId>
-	<artifactId>blur-console</artifactId>
-	<version>${projectVersion}</version>
-	<packaging>jar</packaging>
-	<name>Blur Console</name>
-
-    <properties>
-        <!-- Grunt Execution Target. Valid values are [ development | production ] -->
-        <grunt.target>development</grunt.target>
-
-        <!-- Maven Plugin Versions -->
-        <plugin.maven.exec.version>1.2.1</plugin.maven.exec.version>
-    </properties>
-
-	<dependencies>
-        <!-- Blur Dependencies -->
-		<dependency>
-			<groupId>org.apache.blur</groupId>
-			<artifactId>blur-thrift</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.blur</groupId>
-			<artifactId>blur-core</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-
-        <!-- Development and Runtime Libraries -->
-		<dependency>
-			<groupId>org.codehaus.jackson</groupId>
-			<artifactId>jackson-mapper-asl</artifactId>
-			<version>1.8.1</version>
-		</dependency>
-		<dependency>
-			<groupId>org.codehaus.jackson</groupId>
-			<artifactId>jackson-core-asl</artifactId>
-			<version>1.8.1</version>
-		</dependency>
-
-		<!-- Test Dependancies -->
-		<dependency>
-			<groupId>org.apache.blur</groupId>
-			<artifactId>blur-core</artifactId>
-			<version>${project.version}</version>
-			<type>test-jar</type>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.blur</groupId>
-			<artifactId>blur-util</artifactId>
-			<version>${project.version}</version>
-			<type>test-jar</type>
-			<scope>test</scope>
-		</dependency>
-	</dependencies>
-
-	<build>
-        <resources>
-            <resource>
-                <directory>src/main/resources</directory>
-                <filtering>true</filtering>
-                <includes>
-                    <include>**/blur-console-build.properties</include>
-                </includes>
-            </resource>
-            <resource>
-                <directory>src/main/resources</directory>
-                <filtering>false</filtering>
-                <excludes>
-                    <exclude>**/blur-console-build.properties</exclude>
-                </excludes>
-            </resource>
-        </resources>
-
-		<plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-clean-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-source-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-resources-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-            </plugin>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-compiler-plugin</artifactId>
-				<version>2.5.1</version>
-				<inherited>true</inherited>
-				<configuration>
-					<source>1.6</source>
-					<target>1.6</target>
-				</configuration>
-			</plugin>
-            <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <configuration>
-                    <archive>
-                        <manifest>
-                            <mainClass>org.apache.blur.console.Main</mainClass>
-                        </manifest>
-                    </archive>
-                    <descriptors>
-                        <descriptor>src/assemble/bin.xml</descriptor>
-                    </descriptors>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>make-assembly</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>single</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-		        <groupId>org.apache.maven.plugins</groupId>
-		        <artifactId>maven-checkstyle-plugin</artifactId>
-		        <version>2.12.1</version>
-		        <configuration>
-		          <configLocation>checkstyle.xml</configLocation>
-		        </configuration>
-		      </plugin>
-		</plugins>
-	</build>
-
-    <profiles>
-        <profile>
-            <id>hadoop-1x</id>
-            <activation>
-                <property>
-                    <name>hadoop1</name>
-                </property>
-            </activation>
-            <properties>
-                <projectVersion>${project.parent.version}-hadoop1</projectVersion>
-            </properties>
-			<dependencies>
-				<dependency>
-					<groupId>org.apache.hadoop</groupId>
-					<artifactId>hadoop-test</artifactId>
-					<version>${hadoop.version}</version>
-					<scope>test</scope>
-				</dependency>
-			</dependencies>
-        </profile>
-        <profile>
-            <id>hadoop-2.2</id>
-            <activation>
-                <property>
-                    <name>hadoop2</name>
-                </property>
-            </activation>
-            <properties>
-                <projectVersion>${project.parent.version}-hadoop2</projectVersion>
-            </properties>
-			<dependencies>
-				<dependency>
-					<groupId>org.apache.hadoop</groupId>
-					<artifactId>hadoop-client</artifactId>
-					<version>${hadoop.version}</version>
-				</dependency>
-				<dependency>
-					<groupId>org.apache.hadoop</groupId>
-					<artifactId>hadoop-minicluster</artifactId>
-					<version>${hadoop.version}</version>
-					<scope>test</scope>
-				</dependency>
-			</dependencies>
-        </profile>
-        <profile>
-            <id>web-war</id>
-            <properties>
-                <grunt.target>production</grunt.target>
-            </properties>
-        </profile>
-        <profile>
-            <id>grunt</id>
-            <activation><os><family>!windows</family></os></activation>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.codehaus.mojo</groupId>
-                        <artifactId>exec-maven-plugin</artifactId>
-                        <version>${plugin.maven.exec.version}</version>
-                        <executions>
-                            <!-- Install all webapp dependencies -->
-                            <execution>
-                                <id>WebApp Dependencies and Minification</id>
-                                <phase>generate-resources</phase>
-                                <goals>
-                                    <goal>exec</goal>
-                                </goals>
-                                <configuration>
-                                    <executable>${basedir}/src/main/scripts/grunt.sh</executable>
-                                    <commandlineArgs>${grunt.target}</commandlineArgs>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-    </profiles>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/assemble/bin.xml
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/assemble/bin.xml b/contrib/blur-console/src/assemble/bin.xml
deleted file mode 100644
index d5aadc5..0000000
--- a/contrib/blur-console/src/assemble/bin.xml
+++ /dev/null
@@ -1,65 +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.
--->
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
-  <id>bin</id>
-  <formats>
-    <format>jar</format>
-  </formats>
-  <includeBaseDirectory>false</includeBaseDirectory>
-  <dependencySets>
-    <!-- <dependencySet>
-      <unpack>true</unpack>
-      <scope>provided</scope>
-      <useTransitiveDependencies>true</useTransitiveDependencies>
-      <includes>
-        <include>org.apache.blur:blur-thrift</include>
-        <include>org.apache.blur:blur-core</include>
-        <include>org.codehaus.jackson:*</include>
-      </includes>
-    </dependencySet> -->
-    <dependencySet>
-        <unpack>true</unpack>
-        <scope>runtime</scope>
-        <excludes>
-          <exclude>org.apache.blur:blur-core:test-jar</exclude>
-          <exclude>org.apache.blur:blur-util:test-jar</exclude>
-          <exclude>org.apache.hadoop:hadoop-test</exclude>
-          <exclude>org.apache.hadoop:hadoop-client</exclude>
-          <exclude>org.apache.hadoop:hadoop-minicluster</exclude>
-      </excludes>
-      <unpackOptions>
-        <excludes>
-            <exclude>**/blur-site.properties</exclude>
-        </excludes>
-      </unpackOptions>
-    </dependencySet>
-  </dependencySets>
-  <fileSets>
-    <fileSet>
-      <directory>target/classes</directory>
-      <outputDirectory></outputDirectory>
-    </fileSet>
-    <fileSet>
-      <directory>src/main/webapp/public</directory>
-      <outputDirectory>webapp</outputDirectory>
-    </fileSet>
-  </fileSets>
-</assembly>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/java/org/apache/blur/console/JettyServer.java
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/java/org/apache/blur/console/JettyServer.java b/contrib/blur-console/src/main/java/org/apache/blur/console/JettyServer.java
deleted file mode 100644
index 07fccff..0000000
--- a/contrib/blur-console/src/main/java/org/apache/blur/console/JettyServer.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package org.apache.blur.console;
-
-/**
- * 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.
- */
-
-import org.apache.blur.console.servlets.NodesServlet;
-import org.apache.blur.console.servlets.QueriesServlet;
-import org.apache.blur.console.servlets.SearchServlet;
-import org.apache.blur.console.servlets.TablesServlet;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.servlet.Context;
-import org.mortbay.jetty.servlet.ServletHolder;
-import org.mortbay.jetty.webapp.WebAppContext;
-
-import java.net.URL;
-
-public class JettyServer {
-	private final static String DEV_WEBAPPDIR = "../classes/";
-	private final static String PROD_WEBAPPDIR = "webapp/";
-	private final static String CONTEXTPATH = "/console";
-	private final Log log = LogFactory.getLog(JettyServer.class);
-		
-	private int port;
-	private Server server;
-	private boolean devMode;
-	
-	public JettyServer(int port, boolean devMode) {
-		this.port = port;
-		this.devMode = devMode;
-	}
-	
-	public JettyServer start() {
-		createServer();
-		return this;
-	}
-	
-	public void join() {
-		try {
-			server.join();
-		} catch (InterruptedException e) {
-			log.info("Server shutting down");
-		}
-	}
-	
-	private void createServer() {
-		server = new Server(port);
-		
-		// for localhost:port/console/index.html and whatever else is in the webapp directory
-	    final URL warUrl = devMode ? this.getClass().getClassLoader().getResource(DEV_WEBAPPDIR) : this.getClass().getClassLoader().getResource(PROD_WEBAPPDIR);
-	    final String warUrlString = warUrl.toExternalForm();
-	    server.setHandler(new WebAppContext(warUrlString, CONTEXTPATH));
-
-	    // for localhost:port/service/dashboard, etc.
-	    final Context context = new Context(server, "/service", Context.SESSIONS);
-	    context.addServlet(new ServletHolder(new NodesServlet()), "/nodes/*");
-	    context.addServlet(new ServletHolder(new TablesServlet()), "/tables/*");
-	    context.addServlet(new ServletHolder(new QueriesServlet()), "/queries/*");
-	    context.addServlet(new ServletHolder(new SearchServlet()), "/search/*");
-
-	    try {
-			server.start();
-		} catch (Exception e) {
-			log.error("Error starting Blur Console Jetty Server.  Exiting", e);
-			System.exit(1);
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/java/org/apache/blur/console/Main.java
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/java/org/apache/blur/console/Main.java b/contrib/blur-console/src/main/java/org/apache/blur/console/Main.java
deleted file mode 100644
index 2df9783..0000000
--- a/contrib/blur-console/src/main/java/org/apache/blur/console/Main.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.apache.blur.console;
-
-/**
- * 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.
- */
-
-import org.apache.blur.console.util.Config;
-import org.apache.commons.lang.ArrayUtils;
-
-public class Main {
-	public static void main(String[] args) throws Exception {
-		boolean devMode = ArrayUtils.contains(args, "--dev");
-		if (devMode) {
-			Config.setupMiniCluster();
-		}
-		Config.setupConfig();
-		JettyServer server = new JettyServer(Config.getConsolePort(), devMode).start();
-		server.join();
-		if (devMode) {
-			Config.shutdownMiniCluster();
-		}
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/java/org/apache/blur/console/model/ResultRow.java
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/java/org/apache/blur/console/model/ResultRow.java b/contrib/blur-console/src/main/java/org/apache/blur/console/model/ResultRow.java
deleted file mode 100644
index d92597c..0000000
--- a/contrib/blur-console/src/main/java/org/apache/blur/console/model/ResultRow.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.apache.blur.console.model;
-
-/**
- * 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.
- */
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-public class ResultRow {
-	private String rowid;
-	private List<Map<String, String>> records = new ArrayList<Map<String, String>>();
-	
-	public ResultRow() {
-		
-	}
-	
-	public ResultRow(String rowid) {
-		this.rowid = rowid;
-	}
-	
-	public String getRowid() {
-		return rowid;
-	}
-	public void setRowid(String rowid) {
-		this.rowid = rowid;
-	}
-	public List<Map<String, String>> getRecords() {
-		return records;
-	}
-	public void setRecords(List<Map<String, String>> records) {
-		this.records = records;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/BaseConsoleServlet.java
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/BaseConsoleServlet.java b/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/BaseConsoleServlet.java
deleted file mode 100644
index 4f74966..0000000
--- a/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/BaseConsoleServlet.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.apache.blur.console.servlets;
-
-/**
- * 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.
- */
-
-import java.io.IOException;
-
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.io.IOUtils;
-
-public abstract class BaseConsoleServlet extends HttpServlet {
-	private static final long serialVersionUID = -5156028303476799953L;
-
-	protected void sendError(HttpServletResponse response, Exception e) throws IOException {
-		e.printStackTrace();
-		String body = e.getMessage();
-		response.setContentType("application/json");
-		response.setContentLength(body.getBytes().length);
-		response.setStatus(500);
-		IOUtils.write(body, response.getOutputStream());
-	}
-	
-	protected void sendGenericOk(HttpServletResponse response) throws IOException {
-		response.setContentType("text/plain");
-		response.setContentLength(6);
-		response.setStatus(200);
-		IOUtils.write("success", response.getOutputStream());
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/NodesServlet.java
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/NodesServlet.java b/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/NodesServlet.java
deleted file mode 100644
index 31b77f2..0000000
--- a/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/NodesServlet.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.apache.blur.console.servlets;
-
-/**
- * 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.
- */
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.blur.console.util.HttpUtil;
-import org.apache.blur.console.util.NodeUtil;
-import org.apache.commons.io.IOUtils;
-import org.codehaus.jackson.map.ObjectMapper;
-
-public class NodesServlet extends BaseConsoleServlet {
-	private static final long serialVersionUID = 6522056391102413432L;
-
-	@Override
-	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-		String path = request.getPathInfo();
-		if (path == null) {
-			sendNodeStatus(response);
-		} else {
-			response.setStatus(404);
-			IOUtils.write("Route [" + path + "] doesn't exist", response.getOutputStream());
-		}
-	}
-
-	private void sendNodeStatus(HttpServletResponse response) throws IOException {
-		Map<String, Object> nodeData = new HashMap<String, Object>();
-
-		try {
-			nodeData.put("zookeepers", NodeUtil.getZookeeperStatus());
-			nodeData.put("controllers", NodeUtil.getControllerStatus());
-			nodeData.put("clusters", NodeUtil.getClusterStatus());
-		} catch (IOException e) {
-			throw new IOException(e);
-		} catch (Exception e) {
-			sendError(response, e);
-			return;
-		}
-
-		HttpUtil.sendResponse(response, new ObjectMapper().writeValueAsString(nodeData), HttpUtil.JSON);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/QueriesServlet.java
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/QueriesServlet.java b/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/QueriesServlet.java
deleted file mode 100644
index 8a9a30c..0000000
--- a/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/QueriesServlet.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package org.apache.blur.console.servlets;
-
-/**
- * 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.
- */
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.blur.console.util.HttpUtil;
-import org.apache.blur.console.util.QueryUtil;
-import org.apache.commons.io.IOUtils;
-import org.codehaus.jackson.map.ObjectMapper;
-
-public class QueriesServlet extends BaseConsoleServlet {
-	private static final long serialVersionUID = -5725846390100596115L;
-	private static Pattern queryCancelPattern = Pattern.compile("/(.*)/cancel");
-
-	@Override
-	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-		String path = request.getPathInfo();
-		Matcher m;
-		if (path == null) {
-			sendQueries(response);
-		} else if ("/performance".equalsIgnoreCase(path)) {
-			sendCurrentQueryCount(response);
-		} else if ((m = queryCancelPattern.matcher(path)).matches()) {
-			cancelQuery(response, m.group(1), request.getParameter("table"));
-		} else {
-			response.setStatus(404);
-			IOUtils.write("Route [" + path + "] doesn't exist", response.getOutputStream());
-		}
-	}
-	
-	private void sendCurrentQueryCount(HttpServletResponse response) throws IOException {
-		int count;
-		try {
-			count = QueryUtil.getCurrentQueryCount();
-		} catch (IOException e) {
-			throw new IOException(e);
-		} catch (Exception e) {
-			sendError(response, e);
-			return;
-		}
-		
-		HttpUtil.sendResponse(response, new ObjectMapper().writeValueAsString(count), HttpUtil.JSON);
-	}
-	
-	private void sendQueries(HttpServletResponse response) throws IOException {
-		Map<String, Object> queries = new HashMap<String, Object>();
-		try {
-			queries = QueryUtil.getQueries();
-		} catch (IOException e) {
-			throw new IOException(e);
-		} catch (Exception e) {
-			sendError(response, e);
-			return;
-		}
-		
-		HttpUtil.sendResponse(response, new ObjectMapper().writeValueAsString(queries), HttpUtil.JSON);
-	}
-	
-	private void cancelQuery(HttpServletResponse response, String uuid, String table) throws IOException {
-		try {
-			QueryUtil.cancelQuery(table, uuid);
-		} catch (IOException e) {
-			throw new IOException(e);
-		} catch (Exception e) {
-			sendError(response, e);
-			return;
-		}
-		
-		sendGenericOk(response);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/SearchServlet.java
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/SearchServlet.java b/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/SearchServlet.java
deleted file mode 100644
index c7abcef..0000000
--- a/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/SearchServlet.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package org.apache.blur.console.servlets;
-
-/**
- * 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.
- */
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.blur.console.util.HttpUtil;
-import org.apache.blur.console.util.SearchUtil;
-import org.apache.commons.io.IOUtils;
-import org.codehaus.jackson.map.ObjectMapper;
-
-
-public class SearchServlet extends BaseConsoleServlet {
-	private static final long serialVersionUID = 8236015799570635548L;
-
-	@Override
-	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-		String path = request.getPathInfo();
-		if (path == null) {
-			String remoteHost = request.getRemoteHost();
-			sendSearch(response, request.getParameterMap(), remoteHost);
-		} else {
-			response.setStatus(404);
-			IOUtils.write("Route [" + path + "] doesn't exist", response.getOutputStream());
-		}
-	}
-	
-	private void sendSearch(HttpServletResponse response, Map<String, String[]> params, String remoteHost) throws IOException {
-		Map<String, Object> results = new HashMap<String, Object>();
-		try {
-			results = SearchUtil.search(params, remoteHost);
-		} catch (IOException e) {
-			throw new IOException(e);
-		} catch (Exception e) {
-			sendError(response, e);
-			return;
-		}
-		
-		HttpUtil.sendResponse(response, new ObjectMapper().writeValueAsString(results), HttpUtil.JSON);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/TablesServlet.java
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/TablesServlet.java b/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/TablesServlet.java
deleted file mode 100644
index 13d8280..0000000
--- a/contrib/blur-console/src/main/java/org/apache/blur/console/servlets/TablesServlet.java
+++ /dev/null
@@ -1,145 +0,0 @@
-package org.apache.blur.console.servlets;
-
-/**
- * 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.
- */
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.blur.console.util.HttpUtil;
-import org.apache.blur.console.util.TableUtil;
-import org.apache.commons.io.IOUtils;
-import org.codehaus.jackson.map.ObjectMapper;
-
-public class TablesServlet extends BaseConsoleServlet {
-	private static final long serialVersionUID = -5725846390100596115L;
-	private static Pattern tableSchemaPattern = Pattern.compile("/(.*)/schema");
-	private static Pattern tableEnablePattern = Pattern.compile("/(.*)/enable");
-	private static Pattern tableDisablePattern = Pattern.compile("/(.*)/disable");
-	private static Pattern tableDeletePattern = Pattern.compile("/(.*)/delete");
-	private static Pattern tableTermsPattern = Pattern.compile("/(.*)/(.*)/(.*)/terms");
-
-	@Override
-	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-		String path = request.getPathInfo();
-		Matcher m;
-		if (path == null) {
-			sendSummaries(response);
-		} else if ((m = tableSchemaPattern.matcher(path)).matches()) {
-			sendSchema(response, m.group(1));
-		} else if ((m = tableTermsPattern.matcher(path)).matches()) {
-			sendTerms(response, m.group(1), m.group(2), m.group(3), request.getParameter("startsWith"));
-		} else if ((m = tableEnablePattern.matcher(path)).matches()) {
-			enableTable(response, m.group(1));
-		} else if ((m = tableDisablePattern.matcher(path)).matches()) {
-			disableTable(response, m.group(1));
-		} else if ((m = tableDeletePattern.matcher(path)).matches()) {
-			deleteTable(response, m.group(1), request.getParameter("includeFiles"));
-		} else {
-			response.setStatus(404);
-			IOUtils.write("Route [" + path + "] doesn't exist", response.getOutputStream());
-		}
-	}
-	
-	@SuppressWarnings("rawtypes")
-	private void sendSummaries(HttpServletResponse response) throws IOException {
-		Map<String, List> tableSummaries = new HashMap<String, List>();
-		try {
-			tableSummaries = TableUtil.getTableSummaries();
-		} catch (IOException e) {
-			throw new IOException(e);
-		} catch (Exception e) {
-			sendError(response, e);
-			return;
-		}
-		
-		HttpUtil.sendResponse(response, new ObjectMapper().writeValueAsString(tableSummaries), HttpUtil.JSON);
-	}
-	
-	private void sendSchema(HttpServletResponse response, String table) throws IOException{
-		Object schema;
-		try {
-			schema = TableUtil.getSchema(table);
-		} catch (IOException e) {
-			throw new IOException(e);
-		} catch (Exception e) {
-			sendError(response, e);
-			return;
-		}
-		
-		HttpUtil.sendResponse(response, new ObjectMapper().writeValueAsString(schema), HttpUtil.JSON);
-	}
-	
-	private void sendTerms(HttpServletResponse response, String table, String family, String column, String startsWith) throws IOException {
-		List<String> terms = new ArrayList<String>();
-		try {
-			terms = TableUtil.getTerms(table, family, column, startsWith);
-		} catch (IOException e) {
-			throw new IOException(e);
-		} catch (Exception e) {
-			sendError(response, e);
-			return;
-		}
-		
-		HttpUtil.sendResponse(response, new ObjectMapper().writeValueAsString(terms), HttpUtil.JSON);
-	}
-	
-	private void enableTable(HttpServletResponse response, String table) throws IOException {
-		try {
-			TableUtil.enableTable(table);
-		} catch (IOException e) {
-			throw new IOException(e);
-		} catch (Exception e) {
-			sendError(response, e);
-			return;
-		}
-		sendGenericOk(response);
-	}
-	
-	private void disableTable(HttpServletResponse response, String table) throws IOException {
-		try {
-			TableUtil.disableTable(table);
-		} catch (IOException e) {
-			throw new IOException(e);
-		} catch (Exception e) {
-			sendError(response, e);
-			return;
-		}
-		sendGenericOk(response);
-	}
-	
-	private void deleteTable(HttpServletResponse response, String table, String includeFiles) throws IOException {
-		try {
-			TableUtil.deleteTable(table, Boolean.parseBoolean(includeFiles));
-		} catch (IOException e) {
-			throw new IOException(e);
-		} catch (Exception e) {
-			sendError(response, e);
-			return;
-		}
-		sendGenericOk(response);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/java/org/apache/blur/console/util/Config.java
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/java/org/apache/blur/console/util/Config.java b/contrib/blur-console/src/main/java/org/apache/blur/console/util/Config.java
deleted file mode 100644
index 784440b..0000000
--- a/contrib/blur-console/src/main/java/org/apache/blur/console/util/Config.java
+++ /dev/null
@@ -1,159 +0,0 @@
-package org.apache.blur.console.util;
-
-/**
- * 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.
- */
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.blur.BlurConfiguration;
-import org.apache.blur.manager.clusterstatus.ZookeeperClusterStatus;
-import org.apache.blur.thrift.BlurClient;
-import org.apache.blur.thrift.generated.Blur.Iface;
-import org.apache.blur.user.User;
-import org.apache.blur.user.UserContext;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codehaus.jackson.JsonFactory;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.type.TypeReference;
-
-public class Config {
-	private static final File TMPDIR = new File(System.getProperty("blur.tmp.dir", "./target/mini-cluster"));
-	private static final Log log = LogFactory.getLog(Config.class);
-	
-	private static int port;
-	private static BlurConfiguration blurConfig;
-	private static ZookeeperClusterStatus zk;
-	private static String blurConnection;
-	private static Object cluster;
-	private static Map<String, String> globalUserProperties;
-
-	public static int getConsolePort() {
-		return port;
-	}
-	public static BlurConfiguration getBlurConfig() {
-		return blurConfig;
-	}
-	
-	public static void setupConfig() throws IOException {
-		if (cluster == null) {
-			blurConfig = new BlurConfiguration();
-		} else {
-			blurConfig = new BlurConfiguration(false);
-			
-			String zkConnection = "";
-			try {
-				Method zkMethod = cluster.getClass().getMethod("getZkConnectionString");
-				zkConnection = (String) zkMethod.invoke(cluster);
-			} catch (Exception e) {
-				log.fatal("Unable get zookeeper connection string", e);
-			}
-			
-			blurConfig.set("blur.zookeeper.connection", zkConnection);
-		}
-		zk = new ZookeeperClusterStatus(blurConfig.get("blur.zookeeper.connection"), blurConfig);
-		blurConnection = buildConnectionString();
-		port = blurConfig.getInt("blur.console.port", 8080);
-		parseSecurity();
-	}
-	
-	private static void parseSecurity() {
-		String securityFile = blurConfig.get("blur.console.security.file");
-		
-		if (securityFile != null) {
-			JsonFactory factory = new JsonFactory(); 
-		    ObjectMapper mapper = new ObjectMapper(factory); 
-		    File from = new File(securityFile); 
-		    TypeReference<Map<String,String>> typeRef 
-		            = new TypeReference<Map<String,String>>() {};
-
-		    try {
-				globalUserProperties = mapper.readValue(from, typeRef);
-			} catch (Exception e) {
-				log.error("Unable to parse security file.  Search may not work right.", e);
-				globalUserProperties = null;
-			} 
-		}
-	}
-	
-	public static String getConnectionString() throws IOException {
-		return blurConnection;
-	}
-	
-	public static ZookeeperClusterStatus getZookeeper() {
-		return zk;
-	}
-	
-	private static String buildConnectionString() {
-		List<String> allControllers = new ArrayList<String>();
-		allControllers = zk.getControllerServerList();
-		return StringUtils.join(allControllers, ",");
-	}
-	
-	public static void shutdownMiniCluster() throws IOException {
-		if (cluster != null) {
-			try {
-				Method method = cluster.getClass().getMethod("shutdownBlurCluster");
-				method.invoke(cluster);
-			} catch (Exception e) {
-				log.fatal("Unable to stop mini cluster through reflection.", e);
-			}
-			File file = new File(TMPDIR, "blur-cluster-test");
-			if (file.exists()) {
-				FileUtils.deleteDirectory(file);
-			}
-		}
-	}
-	
-	
-	@SuppressWarnings({ "unchecked", "rawtypes" })
-	public static void setupMiniCluster() throws IOException {
-	    File testDirectory = new File(TMPDIR, "blur-cluster-test").getAbsoluteFile();
-	    testDirectory.mkdirs();
-
-	    testDirectory.delete();
-	    try {
-	    	Class clusterClass = Class.forName("org.apache.blur.MiniCluster", false, Config.class.getClassLoader());
-	    
-		    if (clusterClass != null) {
-		    	cluster = clusterClass.newInstance();
-		    	Method startBlurCluster = clusterClass.getDeclaredMethod("startBlurCluster", String.class, int.class, int.class, boolean.class);
-		    	startBlurCluster.invoke(cluster, new File(testDirectory, "cluster").getAbsolutePath(), 2, 3, true);
-		    }
-	    } catch (Exception e) {
-	    	log.fatal("Unable to start in dev mode because MiniCluster isn't in classpath", e);
-	    	cluster = null;
-	    }
-	}
-	
-	public static Iface getClient(String username) throws IOException {
-		Iface client = BlurClient.getClient(getConnectionString());
-		
-		if (globalUserProperties != null) {
-			UserContext.setUser(new User(username, globalUserProperties));
-		}
-		
-		return client;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/java/org/apache/blur/console/util/HttpUtil.java
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/java/org/apache/blur/console/util/HttpUtil.java b/contrib/blur-console/src/main/java/org/apache/blur/console/util/HttpUtil.java
deleted file mode 100644
index cdc8c41..0000000
--- a/contrib/blur-console/src/main/java/org/apache/blur/console/util/HttpUtil.java
+++ /dev/null
@@ -1,36 +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.blur.console.util;
-
-import java.io.IOException;
-
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.io.IOUtils;
-
-public class HttpUtil {
-	public static String JSON = "application/json";
-	public static String TEXT = "plain/text";
-	
-	public static void sendResponse(HttpServletResponse response, String body, String contentType) throws IOException {
-		response.setContentType(contentType);
-		response.setContentLength(body.getBytes().length);
-		response.setStatus(200);
-		IOUtils.write(body, response.getOutputStream());
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/java/org/apache/blur/console/util/NodeUtil.java
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/java/org/apache/blur/console/util/NodeUtil.java b/contrib/blur-console/src/main/java/org/apache/blur/console/util/NodeUtil.java
deleted file mode 100644
index 8c20d42..0000000
--- a/contrib/blur-console/src/main/java/org/apache/blur/console/util/NodeUtil.java
+++ /dev/null
@@ -1,143 +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.blur.console.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.net.URI;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.blur.manager.clusterstatus.ZookeeperClusterStatus;
-import org.apache.commons.collections.CollectionUtils;
-
-public class NodeUtil {
-	
-	@SuppressWarnings("unchecked")
-	public static Map<String, Object> getControllerStatus() throws IOException {
-		ZookeeperClusterStatus zk = Config.getZookeeper();
-		
-		List<String> allControllers = new ArrayList<String>();
-		List<String> oControllers = new ArrayList<String>();
-		allControllers = zk.getOnlineControllerList();
-		oControllers = zk.getControllerServerList();
-		
-		Collection<String> onlineControllers = CollectionUtils.intersection(allControllers, oControllers);
-		Collection<String> offlineControllers = CollectionUtils.subtract(allControllers, oControllers);
-
-		Map<String, Object> data = new HashMap<String, Object>();
-
-		data.put("online", onlineControllers);
-		data.put("offline", offlineControllers);
-		
-		return data;
-	}
-
-	public static List<Map<String, Object>> getClusterStatus() throws IOException {
-		ZookeeperClusterStatus zk = Config.getZookeeper();
-
-		List<Map<String, Object>> data = new ArrayList<Map<String,Object>>();
-		List<String> clusters = zk.getClusterList(false);
-
-		for (String cluster : clusters) {
-			Map<String, Object> clusterObj = new HashMap<String, Object>();
-			clusterObj.put("name", cluster);
-
-			List<String> offlineShardServers = zk.getOfflineShardServers(false, cluster);
-			List<String> onlineShardServers = zk.getOnlineShardServers(false, cluster);
-
-			clusterObj.put("online", onlineShardServers);
-			clusterObj.put("offline", offlineShardServers);
-
-			data.add(clusterObj);
-		}
-
-		return data;
-	}
-
-	public static Map<String, Object> getZookeeperStatus() throws IOException {
-		String[] connections = Config.getBlurConfig().get("blur.zookeeper.connection").split(",");
-		Set<String> onlineZookeepers = new HashSet<String>();
-		Set<String> offlineZookeepers = new HashSet<String>();
-		
-		for (String connection : connections) {
-			Socket socket = null;
-			InputStream response = null;
-			OutputStream question = null;
-			try {
-				URI parsedConnection = new URI("my://" + connection);
-				String host = parsedConnection.getHost();
-				int port = parsedConnection.getPort() >= 0 ? parsedConnection.getPort() : 2181;
-				byte[] reqBytes = new byte[4];
-				ByteBuffer req = ByteBuffer.wrap(reqBytes);
-				req.putInt(ByteBuffer.wrap("ruok".getBytes()).getInt());
-				socket = new Socket();
-				socket.setSoLinger(false, 10);
-				socket.setSoTimeout(20000);
-				parsedConnection.getPort();
-				socket.connect(new InetSocketAddress(host, port));
-
-				response = socket.getInputStream();
-				question = socket.getOutputStream();
-
-				question.write(reqBytes);
-
-				byte[] resBytes = new byte[4];
-
-				response.read(resBytes);
-				String status = new String(resBytes);
-				if (status.equals("imok")) {
-					onlineZookeepers.add(connection);
-				} else {
-					offlineZookeepers.add(connection);
-				}
-				socket.close();
-				response.close();
-				question.close();
-			} catch (Exception e) {
-				offlineZookeepers.add(connection);
-			} finally {
-				if (socket != null) {
-					socket.close();
-				}
-				if (response != null) {
-					response.close();
-				}
-				if (question != null) {
-					question.close();
-				}
-			}
-		}
-		
-		Map<String, Object> data = new HashMap<String, Object>();
-		
-		data.put("online", onlineZookeepers);
-		data.put("offline", offlineZookeepers);
-		
-		return data;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/java/org/apache/blur/console/util/QueryUtil.java
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/java/org/apache/blur/console/util/QueryUtil.java b/contrib/blur-console/src/main/java/org/apache/blur/console/util/QueryUtil.java
deleted file mode 100644
index a6c2041..0000000
--- a/contrib/blur-console/src/main/java/org/apache/blur/console/util/QueryUtil.java
+++ /dev/null
@@ -1,95 +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.blur.console.util;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.blur.thirdparty.thrift_0_9_0.TException;
-import org.apache.blur.thrift.BlurClient;
-import org.apache.blur.thrift.generated.Blur.Iface;
-import org.apache.blur.thrift.generated.BlurException;
-import org.apache.blur.thrift.generated.BlurQueryStatus;
-import org.apache.blur.thrift.generated.Status;
-
-public class QueryUtil {
-	
-	public static int getCurrentQueryCount() throws IOException, BlurException, TException {
-		Iface client = BlurClient.getClient(Config.getConnectionString());
-		
-		int count = 0;
-		List<String> tableList = client.tableList();
-		for (String table : tableList) {
-			List<String> queries = client.queryStatusIdList(table);
-			count += queries.size();
-		}
-		
-		return count;
-	}
-	
-	public static Map<String, Object> getQueries() throws BlurException, TException, IOException {
-		Map<String, Object> queriesInfo = new HashMap<String, Object>();
-		
-		int slow = 0;
-		
-		List<Map<String, Object>> queries = new ArrayList<Map<String,Object>>();
-		
-		Iface client = BlurClient.getClient(Config.getConnectionString());
-		List<String> tableList = client.tableList();
-		
-		for (String table : tableList) {
-			List<String> queriesForTable = client.queryStatusIdList(table);
-			for (String id : queriesForTable) {
-				BlurQueryStatus status = client.queryStatusById(table, id);
-				
-				if (Status.FOUND.equals(status.getStatus())) {
-					Map<String, Object> info = new HashMap<String, Object>();
-					info.put("uuid", id);
-					info.put("user", status.getQuery().getUserContext());
-					info.put("query", status.getQuery().getQuery().getQuery());
-					info.put("table", table);
-					info.put("state", status.getState().getValue());
-					info.put("percent", ((double)status.getCompleteShards())/((double)status.getTotalShards())*100);
-					
-					
-					long startTime = status.getQuery().getStartTime();
-					info.put("startTime", startTime);
-					queries.add(info);
-					
-					if (System.currentTimeMillis() - startTime > 60000) {
-						slow++;
-					}
-				}
-			}
-		}
-		
-		queriesInfo.put("slowQueries", slow);
-		queriesInfo.put("queries", queries);
-		
-		return queriesInfo;
-	}
-	
-	public static void cancelQuery(String table, String uuid) throws IOException, BlurException, TException {
-		Iface client = BlurClient.getClient(Config.getConnectionString());
-		
-		client.cancelQuery(table, uuid);
-	}
-}


Mime
View raw message