incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cr...@apache.org
Subject [3/4] Standardized the tabs and spaces usage (2 spaces per tab)
Date Tue, 08 Jul 2014 20:57:03 GMT
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/79786aca/blur-console/src/main/java/org/apache/blur/console/util/TableUtil.java
----------------------------------------------------------------------
diff --git a/blur-console/src/main/java/org/apache/blur/console/util/TableUtil.java b/blur-console/src/main/java/org/apache/blur/console/util/TableUtil.java
index cec47aa..8146407 100644
--- a/blur-console/src/main/java/org/apache/blur/console/util/TableUtil.java
+++ b/blur-console/src/main/java/org/apache/blur/console/util/TableUtil.java
@@ -34,89 +34,89 @@ import org.apache.blur.thrift.generated.TableStats;
 
 public class TableUtil {
 
-	@SuppressWarnings("rawtypes")
-	public static Map<String, List> getTableSummaries() throws IOException, TException {
-		Iface client = BlurClient.getClient(Config.getConnectionString());
-
-		List<Map<String, Object>> summaries = new ArrayList<Map<String, Object>>();
-
-		List<String> clusters = client.shardClusterList();
-
-		for (String cluster : clusters) {
-			List<String> tables = client.tableListByCluster(cluster);
-			for (String table : tables) {
-				Map<String, Object> tableInfo = new HashMap<String, Object>();
-				TableDescriptor descriptor = client.describe(table);
-
-				tableInfo.put("cluster", cluster);
-				tableInfo.put("name", table);
-				tableInfo.put("enabled", descriptor.isEnabled());
-
-				if (descriptor.isEnabled()) {
-					TableStats stats = client.tableStats(table);
-					tableInfo.put("rows", stats.getRowCount());
-					tableInfo.put("records", stats.getRecordCount());
-
-					Schema schema = client.schema(table);
-					tableInfo.put("families", new ArrayList<String>(schema.getFamilies().keySet()));
-				} else {
-					tableInfo.put("rows", "?");
-					tableInfo.put("records", "?");
-					tableInfo.put("families", new ArrayList<String>());
-				}
-
-				summaries.add(tableInfo);
-			}
-		}
-
-		Map<String, List> data = new HashMap<String, List>();
-		data.put("tables", summaries);
-		data.put("clusters", clusters);
-
-		return data;
-	}
-
-	public static Map<String, Map<String, Map<String, Object>>> getSchema(String table) throws IOException, TException {
-		Iface client = BlurClient.getClient(Config.getConnectionString());
-
-		Schema schema = client.schema(table);
-
-		Map<String, Map<String, Map<String, Object>>> schemaInfo = new TreeMap<String, Map<String, Map<String, Object>>>();
-		for (Map.Entry<String, Map<String, ColumnDefinition>> famEntry : schema.getFamilies().entrySet()) {
-			Map<String, Map<String, Object>> columns = new TreeMap<String, Map<String, Object>>();
-			for (Map.Entry<String, ColumnDefinition> colEntry : famEntry.getValue().entrySet()) {
-				Map<String, Object> info = new HashMap<String, Object>();
-				ColumnDefinition def = colEntry.getValue();
-				info.put("fieldLess", def.isFieldLessIndexed());
-				info.put("type", def.getFieldType());
-				info.put("extra", def.getProperties());
-				columns.put(colEntry.getKey(), info);
-			}
-			schemaInfo.put(famEntry.getKey(), columns);
-		}
-
-		return schemaInfo;
-	}
-
-	public static List<String> getTerms(String table, String family, String column, String startWith) throws IOException, TException {
-		Iface client = BlurClient.getClient(Config.getConnectionString());
-
-		return client.terms(table, family, column, startWith, (short) 10);
-	}
-
-	public static void disableTable(String table) throws TException, IOException {
-		Iface client = BlurClient.getClient(Config.getConnectionString());
-
-		client.disableTable(table);
-	}
-	public static void enableTable(String table) throws TException, IOException {
-		Iface client = BlurClient.getClient(Config.getConnectionString());
-
-		client.enableTable(table);
-	}
-	public static void deleteTable(String table, boolean includeFiles) throws TException, IOException {
-		Iface client = BlurClient.getClient(Config.getConnectionString());
-
-		client.removeTable(table, includeFiles);
-	}
+  @SuppressWarnings("rawtypes")
+  public static Map<String, List> getTableSummaries() throws IOException, TException {
+    Iface client = BlurClient.getClient(Config.getConnectionString());
+
+    List<Map<String, Object>> summaries = new ArrayList<Map<String, Object>>();
+
+    List<String> clusters = client.shardClusterList();
+
+    for (String cluster : clusters) {
+      List<String> tables = client.tableListByCluster(cluster);
+      for (String table : tables) {
+        Map<String, Object> tableInfo = new HashMap<String, Object>();
+        TableDescriptor descriptor = client.describe(table);
+
+        tableInfo.put("cluster", cluster);
+        tableInfo.put("name", table);
+        tableInfo.put("enabled", descriptor.isEnabled());
+
+        if (descriptor.isEnabled()) {
+          TableStats stats = client.tableStats(table);
+          tableInfo.put("rows", stats.getRowCount());
+          tableInfo.put("records", stats.getRecordCount());
+
+          Schema schema = client.schema(table);
+          tableInfo.put("families", new ArrayList<String>(schema.getFamilies().keySet()));
+        } else {
+          tableInfo.put("rows", "?");
+          tableInfo.put("records", "?");
+          tableInfo.put("families", new ArrayList<String>());
+        }
+
+        summaries.add(tableInfo);
+      }
+    }
+
+    Map<String, List> data = new HashMap<String, List>();
+    data.put("tables", summaries);
+    data.put("clusters", clusters);
+
+    return data;
+  }
+
+  public static Map<String, Map<String, Map<String, Object>>> getSchema(String table) throws IOException, TException {
+    Iface client = BlurClient.getClient(Config.getConnectionString());
+
+    Schema schema = client.schema(table);
+
+    Map<String, Map<String, Map<String, Object>>> schemaInfo = new TreeMap<String, Map<String, Map<String, Object>>>();
+    for (Map.Entry<String, Map<String, ColumnDefinition>> famEntry : schema.getFamilies().entrySet()) {
+      Map<String, Map<String, Object>> columns = new TreeMap<String, Map<String, Object>>();
+      for (Map.Entry<String, ColumnDefinition> colEntry : famEntry.getValue().entrySet()) {
+        Map<String, Object> info = new HashMap<String, Object>();
+        ColumnDefinition def = colEntry.getValue();
+        info.put("fieldLess", def.isFieldLessIndexed());
+        info.put("type", def.getFieldType());
+        info.put("extra", def.getProperties());
+        columns.put(colEntry.getKey(), info);
+      }
+      schemaInfo.put(famEntry.getKey(), columns);
+    }
+
+    return schemaInfo;
+  }
+
+  public static List<String> getTerms(String table, String family, String column, String startWith) throws IOException, TException {
+    Iface client = BlurClient.getClient(Config.getConnectionString());
+
+    return client.terms(table, family, column, startWith, (short) 10);
+  }
+
+  public static void disableTable(String table) throws TException, IOException {
+    Iface client = BlurClient.getClient(Config.getConnectionString());
+
+    client.disableTable(table);
+  }
+  public static void enableTable(String table) throws TException, IOException {
+    Iface client = BlurClient.getClient(Config.getConnectionString());
+
+    client.enableTable(table);
+  }
+  public static void deleteTable(String table, boolean includeFiles) throws TException, IOException {
+    Iface client = BlurClient.getClient(Config.getConnectionString());
+
+    client.removeTable(table, includeFiles);
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/79786aca/blur-console/src/main/webapp/js/blurconsole.b_utils.js
----------------------------------------------------------------------
diff --git a/blur-console/src/main/webapp/js/blurconsole.b_utils.js b/blur-console/src/main/webapp/js/blurconsole.b_utils.js
index 8ffd146..554df7b 100644
--- a/blur-console/src/main/webapp/js/blurconsole.b_utils.js
+++ b/blur-console/src/main/webapp/js/blurconsole.b_utils.js
@@ -19,103 +19,103 @@ under the License.
 */
 /*global blurconsole:false */
 blurconsole.browserUtils = (function(){
-	'use strict';
-
-	function table(def, data) {
-		var tableMarkup;
-
-		tableMarkup = '<table class="table table-bordered table-condensed table-hover table-striped"><thead><tr>';
-
-		// Add headers
-		$.each(def, function(idx, colDef){
-			tableMarkup += '<th>' + colDef.label + '</th>';
-		});
-
-		tableMarkup += '</tr></thead><tbody>';
-
-		// Add content
-		if (data && data.length > 0) {
-			$.each(data, function(ir, row){
-				tableMarkup += '<tr>';
-				$.each(def, function(ic, col) {
-					tableMarkup += '<td>';
-					if ($.isFunction(col.key)) {
-						tableMarkup += col.key(row);
-					} else {
-						tableMarkup += row[col.key];
-					}
-					tableMarkup += '</td>';
-				});
-				tableMarkup += '</tr>';
-			});
-		} else {
-			tableMarkup += '<tr><td colspan="' + def.length + '">There are no items here</td></tr>';
-		}
-
-		tableMarkup += '</tbody></table>';
-		return tableMarkup;
-	}
-
-	function modal(id, title, content, buttons, size) {
-		var mSize, markup, mButtons = buttons;
-
-		switch(size) {
-		case 'large':
-			mSize = 'modal-lg';
-			break;
-		case 'medium':
-			mSize = 'modal-md';
-			break;
-		default:
-			mSize = 'modal-sm';
-		}
-
-		markup = '<div class="modal fade" id="' + id + '">';
-		markup += '<div class="modal-dialog ' + mSize + '">';
-		markup += '<div class="modal-content">';
-		markup += '<div class="modal-header"><button type="button" class="close" data-dismiss="modal">&times;</button><h4 class="modal-title">' + title + '</h4></div>';
-		markup += '<div class="modal-body">' + ($.type(content) === 'string' ? content : $(content).html()) + '</div>';
-
-		if (mButtons) {
-			if (!$.isArray(mButtons)) {
-				mButtons = [mButtons];
-			}
-
-			markup += '<div class="modal-footer">';
-			$.each(mButtons, function(i, button) {
-				markup += '<button type="button" class="btn ' + button.classes + '" id="' + button.id + '" ';
-
-				if (button.data) {
-					$.each(button.data, function(key, dataAttr) {
-						markup += 'data-' + key + '="' + dataAttr + '" ';
-					});
-				}
-
-				markup += '>' + button.label + '</button> ';
-			});
-			markup += '</div>';
-		}
-
-		markup += '</div></div></div>';
-
-		return markup;
-	}
-
-	function cleanId(str) {
-		return str.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '_');
-	}
-
-	function booleanImg(val) {
-		if (val && (val === true || val === 'yes' || val === 'true')) {
-			return '<div class="label label-success"><i class="glyphicon glyphicon-ok-sign"></i></div>';
-		}
-		return '<div class="label label-danger"><i class="glyphicon glyphicon-minus-sign"></i></div>';
-	}
-
-	return {
-		table: table,
-		modal : modal,
-		cleanId : cleanId,
-		booleanImg : booleanImg
-	};
+  'use strict';
+
+  function table(def, data) {
+    var tableMarkup;
+
+    tableMarkup = '<table class="table table-bordered table-condensed table-hover table-striped"><thead><tr>';
+
+    // Add headers
+    $.each(def, function(idx, colDef){
+      tableMarkup += '<th>' + colDef.label + '</th>';
+    });
+
+    tableMarkup += '</tr></thead><tbody>';
+
+    // Add content
+    if (data && data.length > 0) {
+      $.each(data, function(ir, row){
+        tableMarkup += '<tr>';
+        $.each(def, function(ic, col) {
+          tableMarkup += '<td>';
+          if ($.isFunction(col.key)) {
+            tableMarkup += col.key(row);
+          } else {
+            tableMarkup += row[col.key];
+          }
+          tableMarkup += '</td>';
+        });
+        tableMarkup += '</tr>';
+      });
+    } else {
+      tableMarkup += '<tr><td colspan="' + def.length + '">There are no items here</td></tr>';
+    }
+
+    tableMarkup += '</tbody></table>';
+    return tableMarkup;
+  }
+
+  function modal(id, title, content, buttons, size) {
+    var mSize, markup, mButtons = buttons;
+
+    switch(size) {
+    case 'large':
+      mSize = 'modal-lg';
+      break;
+    case 'medium':
+      mSize = 'modal-md';
+      break;
+    default:
+      mSize = 'modal-sm';
+    }
+
+    markup = '<div class="modal fade" id="' + id + '">';
+    markup += '<div class="modal-dialog ' + mSize + '">';
+    markup += '<div class="modal-content">';
+    markup += '<div class="modal-header"><button type="button" class="close" data-dismiss="modal">&times;</button><h4 class="modal-title">' + title + '</h4></div>';
+    markup += '<div class="modal-body">' + ($.type(content) === 'string' ? content : $(content).html()) + '</div>';
+
+    if (mButtons) {
+      if (!$.isArray(mButtons)) {
+        mButtons = [mButtons];
+      }
+
+      markup += '<div class="modal-footer">';
+      $.each(mButtons, function(i, button) {
+        markup += '<button type="button" class="btn ' + button.classes + '" id="' + button.id + '" ';
+
+        if (button.data) {
+          $.each(button.data, function(key, dataAttr) {
+            markup += 'data-' + key + '="' + dataAttr + '" ';
+          });
+        }
+
+        markup += '>' + button.label + '</button> ';
+      });
+      markup += '</div>';
+    }
+
+    markup += '</div></div></div>';
+
+    return markup;
+  }
+
+  function cleanId(str) {
+    return str.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '_');
+  }
+
+  function booleanImg(val) {
+    if (val && (val === true || val === 'yes' || val === 'true')) {
+      return '<div class="label label-success"><i class="glyphicon glyphicon-ok-sign"></i></div>';
+    }
+    return '<div class="label label-danger"><i class="glyphicon glyphicon-minus-sign"></i></div>';
+  }
+
+  return {
+    table: table,
+    modal : modal,
+    cleanId : cleanId,
+    booleanImg : booleanImg
+  };
 }());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/79786aca/blur-console/src/main/webapp/js/blurconsole.dashboard.js
----------------------------------------------------------------------
diff --git a/blur-console/src/main/webapp/js/blurconsole.dashboard.js b/blur-console/src/main/webapp/js/blurconsole.dashboard.js
index 005645f..70e302b 100644
--- a/blur-console/src/main/webapp/js/blurconsole.dashboard.js
+++ b/blur-console/src/main/webapp/js/blurconsole.dashboard.js
@@ -24,248 +24,248 @@ under the License.
  */
 /*global blurconsole:false */
 blurconsole.dashboard = (function () {
-	'use strict';
-	//------------------- Configuration and State -------------------------
-	var
-		configMap = {
-			view: 'views/dashboard.tpl.html',
-			pieOptions : {
-				series : {
-					pie : {
-						show : true,
-						radius : 1,
-						label : {
-							show : true,
-							radius : 2/3,
-							formatter : function(label, series) {
-								return '<div style="font-size:10pt;font-weight:bold;text-align:center;padding:2px;color:white">' + label + '<br/>' + Math.round(series.percent) + '% (' + series.data[0][1] + ')</div>';
-							},
-							threshold : 0.1
-						}
-					}
-				},
-				legend : {
-					show : false
-				},
-				title: 'Test title'
-			}
-		},
-		stateMap = {
-			$container : null,
-			zookeeperNodes: 'chart',
-			controllerNodes: 'chart'
-		},
-		jqueryMap = {};
+  'use strict';
+  //------------------- Configuration and State -------------------------
+  var
+    configMap = {
+      view: 'views/dashboard.tpl.html',
+      pieOptions : {
+        series : {
+          pie : {
+            show : true,
+            radius : 1,
+            label : {
+              show : true,
+              radius : 2/3,
+              formatter : function(label, series) {
+                return '<div style="font-size:10pt;font-weight:bold;text-align:center;padding:2px;color:white">' + label + '<br/>' + Math.round(series.percent) + '% (' + series.data[0][1] + ')</div>';
+              },
+              threshold : 0.1
+            }
+          }
+        },
+        legend : {
+          show : false
+        },
+        title: 'Test title'
+      }
+    },
+    stateMap = {
+      $container : null,
+      zookeeperNodes: 'chart',
+      controllerNodes: 'chart'
+    },
+    jqueryMap = {};
 
-	//--------------------- Utilities ---------------------
-	function _setJqueryMap() {
-		var $container = stateMap.$container;
-		jqueryMap = {
-			$container : $container,
-			$zkChartHolder : $('#zookeeperNodes'),
-			$zkInfoHolder : $('#zookeeperInfo'),
-			$controllerChartHolder : $('#controllerNodes'),
-			$controllerInfoHolder : $('#controllerInfo'),
-			$shardChartHolder : $('#shardNodes'),
-			$tableChartHolder : $('#tableCounts'),
-			$queryLoadChartHolder : $('#queryLoad')
-		};
-	}
+  //--------------------- Utilities ---------------------
+  function _setJqueryMap() {
+    var $container = stateMap.$container;
+    jqueryMap = {
+      $container : $container,
+      $zkChartHolder : $('#zookeeperNodes'),
+      $zkInfoHolder : $('#zookeeperInfo'),
+      $controllerChartHolder : $('#controllerNodes'),
+      $controllerInfoHolder : $('#controllerInfo'),
+      $shardChartHolder : $('#shardNodes'),
+      $tableChartHolder : $('#tableCounts'),
+      $queryLoadChartHolder : $('#queryLoad')
+    };
+  }
 
-	function _registerPageEvents() {
-		$(document).on('click', '.swapper-trigger', _swapNodeChartAndData);
-		$(window).on('resize', _adjustChartsSizes);
-	}
+  function _registerPageEvents() {
+    $(document).on('click', '.swapper-trigger', _swapNodeChartAndData);
+    $(window).on('resize', _adjustChartsSizes);
+  }
 
-	function _unregisterPageEvents() {
-		$(document).off('click', '.swapper-trigger');
-		$(window).off('resize');
-	}
+  function _unregisterPageEvents() {
+    $(document).off('click', '.swapper-trigger');
+    $(window).off('resize');
+  }
 
-	//----------------------- Event Handlers and DOM Modifiers ------------------
-	function _updateAllCharts() {
-		_updateNodeCharts();
-		_loadTableColumnChart();
-		_loadQueryPerfLineChart();
-	}
+  //----------------------- Event Handlers and DOM Modifiers ------------------
+  function _updateAllCharts() {
+    _updateNodeCharts();
+    _loadTableColumnChart();
+    _loadQueryPerfLineChart();
+  }
 
-	function _updateNodeCharts() {
-		if (blurconsole.model.nodes.isDataLoaded()) {
-			_loadZkPieChart();
-			_loadControllerPieChart();
-			_loadShardsPieChart();
-		}
-	}
+  function _updateNodeCharts() {
+    if (blurconsole.model.nodes.isDataLoaded()) {
+      _loadZkPieChart();
+      _loadControllerPieChart();
+      _loadShardsPieChart();
+    }
+  }
 
-	function _swapNodeChartAndData(evt) {
-		var parent = $(evt.currentTarget).closest('div.swapper-parent');
-		var chart = parent.find('.swapper-chart');
-		var info = parent.find('.swapper-info');
+  function _swapNodeChartAndData(evt) {
+    var parent = $(evt.currentTarget).closest('div.swapper-parent');
+    var chart = parent.find('.swapper-chart');
+    var info = parent.find('.swapper-info');
 
-		chart.toggleClass('hidden');
-		info.toggleClass('hidden');
-	}
+    chart.toggleClass('hidden');
+    info.toggleClass('hidden');
+  }
 
-	function _loadZkPieChart() {
-		$.plot(jqueryMap.$zkChartHolder, blurconsole.model.metrics.getZookeeperChartData(), configMap.pieOptions);
-		jqueryMap.$zkInfoHolder.html(_buildNodeTable(blurconsole.model.nodes.getOnlineZookeeperNodes(), blurconsole.model.nodes.getOfflineZookeeperNodes()));
-	}
+  function _loadZkPieChart() {
+    $.plot(jqueryMap.$zkChartHolder, blurconsole.model.metrics.getZookeeperChartData(), configMap.pieOptions);
+    jqueryMap.$zkInfoHolder.html(_buildNodeTable(blurconsole.model.nodes.getOnlineZookeeperNodes(), blurconsole.model.nodes.getOfflineZookeeperNodes()));
+  }
 
-	function _loadControllerPieChart() {
-		$.plot(jqueryMap.$controllerChartHolder, blurconsole.model.metrics.getControllerChartData(), configMap.pieOptions);
-		jqueryMap.$controllerInfoHolder.html(_buildNodeTable(blurconsole.model.nodes.getOnlineControllerNodes(), blurconsole.model.nodes.getOfflineControllerNodes()));
-	}
+  function _loadControllerPieChart() {
+    $.plot(jqueryMap.$controllerChartHolder, blurconsole.model.metrics.getControllerChartData(), configMap.pieOptions);
+    jqueryMap.$controllerInfoHolder.html(_buildNodeTable(blurconsole.model.nodes.getOnlineControllerNodes(), blurconsole.model.nodes.getOfflineControllerNodes()));
+  }
 
-	function _loadShardsPieChart() {
-		if (jqueryMap.$shardChartHolder.find('img').length > 0) {
-			jqueryMap.$shardChartHolder.html('');
-		}
+  function _loadShardsPieChart() {
+    if (jqueryMap.$shardChartHolder.find('img').length > 0) {
+      jqueryMap.$shardChartHolder.html('');
+    }
 
-		$.each(blurconsole.model.metrics.getClusters(), function(idx, cluster) {
-			var clusterData = blurconsole.model.metrics.getShardChartData(cluster);
+    $.each(blurconsole.model.metrics.getClusters(), function(idx, cluster) {
+      var clusterData = blurconsole.model.metrics.getShardChartData(cluster);
 
-			if (clusterData) {
-				var clusterHolder = jqueryMap.$shardChartHolder.find('#cluster_' + cluster + '_chart_holder');
-				var clusterInfo = jqueryMap.$shardChartHolder.find('#cluster_' + cluster + '_info');
+      if (clusterData) {
+        var clusterHolder = jqueryMap.$shardChartHolder.find('#cluster_' + cluster + '_chart_holder');
+        var clusterInfo = jqueryMap.$shardChartHolder.find('#cluster_' + cluster + '_info');
 
-				if (clusterHolder.length === 0) {
-					var wrapper = $('<div class="swapper-parent"></div>');
-					wrapper.append($('<div class="text-center"><strong>' + cluster + '</strong> <small class="text-muted"><i class="glyphicon glyphicon-retweet swapper-trigger" title="Swap Chart/Info"></i></small></div>'));
-					clusterHolder = $('<div id="cluster_'+ cluster + '_chart_holder" class="shardClusterChartHolder simple-chart swapper-chart"></div>');
-					wrapper.append(clusterHolder);
-					var parentSize = jqueryMap.$shardChartHolder.parent()[0].clientWidth - 150;
-					clusterHolder.css({
-						'height' : parentSize,
-						'width' : parentSize
-					});
-					clusterInfo = $('<div id="cluster_' + cluster + '_info" class="swapper-info hidden"></div>');
-					wrapper.append(clusterInfo);
+        if (clusterHolder.length === 0) {
+          var wrapper = $('<div class="swapper-parent"></div>');
+          wrapper.append($('<div class="text-center"><strong>' + cluster + '</strong> <small class="text-muted"><i class="glyphicon glyphicon-retweet swapper-trigger" title="Swap Chart/Info"></i></small></div>'));
+          clusterHolder = $('<div id="cluster_'+ cluster + '_chart_holder" class="shardClusterChartHolder simple-chart swapper-chart"></div>');
+          wrapper.append(clusterHolder);
+          var parentSize = jqueryMap.$shardChartHolder.parent()[0].clientWidth - 150;
+          clusterHolder.css({
+            'height' : parentSize,
+            'width' : parentSize
+          });
+          clusterInfo = $('<div id="cluster_' + cluster + '_info" class="swapper-info hidden"></div>');
+          wrapper.append(clusterInfo);
 
-					jqueryMap.$shardChartHolder.append(wrapper);
-				}
+          jqueryMap.$shardChartHolder.append(wrapper);
+        }
 
-				$.plot(clusterHolder, clusterData, configMap.pieOptions);
-				clusterInfo.html(_buildNodeTable([], blurconsole.model.nodes.getOfflineShardNodes(cluster)));
-			}
-		});
-	}
+        $.plot(clusterHolder, clusterData, configMap.pieOptions);
+        clusterInfo.html(_buildNodeTable([], blurconsole.model.nodes.getOfflineShardNodes(cluster)));
+      }
+    });
+  }
 
-	function _loadTableColumnChart() {
-		if (blurconsole.model.tables.isDataLoaded()) {
-			$.plot(jqueryMap.$tableChartHolder, blurconsole.model.metrics.getTableChartData(), {
-				bars : {
-					show : true,
-					barWidth : 0.6,
-					align : 'center'
-				},
-				yaxis : {
-					min : 0,
-					tickDecimals : 0
-				},
-				xaxis : {
-					mode : 'categories'
-				}
-			});
-		}
-	}
+  function _loadTableColumnChart() {
+    if (blurconsole.model.tables.isDataLoaded()) {
+      $.plot(jqueryMap.$tableChartHolder, blurconsole.model.metrics.getTableChartData(), {
+        bars : {
+          show : true,
+          barWidth : 0.6,
+          align : 'center'
+        },
+        yaxis : {
+          min : 0,
+          tickDecimals : 0
+        },
+        xaxis : {
+          mode : 'categories'
+        }
+      });
+    }
+  }
 
-	function _loadQueryPerfLineChart() {
-		$.plot(jqueryMap.$queryLoadChartHolder, blurconsole.model.metrics.getQueryLoadChartData(), {
-			series : {
-				shadowSize : 0
-			},
-			yaxis : {
-				min : 0
-			},
-			xaxis : {
-				show : false
-			}
-		});
-	}
+  function _loadQueryPerfLineChart() {
+    $.plot(jqueryMap.$queryLoadChartHolder, blurconsole.model.metrics.getQueryLoadChartData(), {
+      series : {
+        shadowSize : 0
+      },
+      yaxis : {
+        min : 0
+      },
+      xaxis : {
+        show : false
+      }
+    });
+  }
 
-	function _buildNodeTable(online, offline) {
-		var table = '<table class="table table-condensed"><thead><tr><th>Offline Node</th></tr></thead><tbody>';
-		if (offline.length === 0) {
-			table += '<tr><td>Everything is Online!</td></tr>';
-		} else {
-			$.each(offline, function(idx, node) {
-				table += '<tr><td>' + node + '</td></tr>';
-			});
-		}
-		table += '</tbody></table>';
+  function _buildNodeTable(online, offline) {
+    var table = '<table class="table table-condensed"><thead><tr><th>Offline Node</th></tr></thead><tbody>';
+    if (offline.length === 0) {
+      table += '<tr><td>Everything is Online!</td></tr>';
+    } else {
+      $.each(offline, function(idx, node) {
+        table += '<tr><td>' + node + '</td></tr>';
+      });
+    }
+    table += '</tbody></table>';
 
-		if (online.length > 0) {
-			table += '<table class="table table-condensed"><thead><tr><th>Online Node</th></tr></thead><tbody>';
-			$.each(online, function(idx, node) {
-				table += '<tr><td>' + node + '</td></tr>';
-			});
-			table += '</tbody></table>';
-		}
-		return $(table);
-	}
+    if (online.length > 0) {
+      table += '<table class="table table-condensed"><thead><tr><th>Online Node</th></tr></thead><tbody>';
+      $.each(online, function(idx, node) {
+        table += '<tr><td>' + node + '</td></tr>';
+      });
+      table += '</tbody></table>';
+    }
+    return $(table);
+  }
 
-	function _adjustChartSize(holder) {
-		var size;
-		size = jqueryMap[holder].parent()[0].clientWidth - 150;
-		jqueryMap[holder].css({
-			'height' : size,
-			'width' : size
-		});
-	}
+  function _adjustChartSize(holder) {
+    var size;
+    size = jqueryMap[holder].parent()[0].clientWidth - 150;
+    jqueryMap[holder].css({
+      'height' : size,
+      'width' : size
+    });
+  }
 
-	function _adjustChartsSizes() {
-		_adjustChartSize('$zkChartHolder');
-		_adjustChartSize('$controllerChartHolder');
-		_adjustChartSize('$tableChartHolder');
-		_adjustChartSize('$queryLoadChartHolder');
+  function _adjustChartsSizes() {
+    _adjustChartSize('$zkChartHolder');
+    _adjustChartSize('$controllerChartHolder');
+    _adjustChartSize('$tableChartHolder');
+    _adjustChartSize('$queryLoadChartHolder');
 
-		var size = jqueryMap.$shardChartHolder.parent()[0].clientWidth - 150;
-		var shardCharts = jqueryMap.$shardChartHolder.find('.shardClusterChartHolder');
-		shardCharts.each(function(){
-			$(this).css({
-				'height' : size,
-				'width' : size
-			});
-		});
-		_updateAllCharts();
-	}
+    var size = jqueryMap.$shardChartHolder.parent()[0].clientWidth - 150;
+    var shardCharts = jqueryMap.$shardChartHolder.find('.shardClusterChartHolder');
+    shardCharts.each(function(){
+      $(this).css({
+        'height' : size,
+        'width' : size
+      });
+    });
+    _updateAllCharts();
+  }
 
-	function _checkForSlowQueries() {
-		if (blurconsole.model.metrics.getSlowQueryWarnings()) {
-			$('#slow-query-warnings').slideDown();
-		} else {
-			$('#slow-query-warnings').slideUp();
-		}
-	}
+  function _checkForSlowQueries() {
+    if (blurconsole.model.metrics.getSlowQueryWarnings()) {
+      $('#slow-query-warnings').slideDown();
+    } else {
+      $('#slow-query-warnings').slideUp();
+    }
+  }
 
-	//----------------------- Public API ----------------------------
+  //----------------------- Public API ----------------------------
 
-	function initModule( $container ) {
-		$container.load ( configMap.view, function() {
-			stateMap.$container = $container;
-			_setJqueryMap();
-			_updateAllCharts();
-			_checkForSlowQueries();
-			$.gevent.subscribe(jqueryMap.$container, 'node-status-updated', _updateNodeCharts);
-			$.gevent.subscribe(jqueryMap.$container, 'tables-updated', _loadTableColumnChart);
-			$.gevent.subscribe(jqueryMap.$container, 'query-perf-updated', _loadQueryPerfLineChart);
-			$.gevent.subscribe(jqueryMap.$container, 'queries-updated', _checkForSlowQueries);
-			_adjustChartsSizes();
-			_registerPageEvents();
-		});
-		return true;
-	}
+  function initModule( $container ) {
+    $container.load ( configMap.view, function() {
+      stateMap.$container = $container;
+      _setJqueryMap();
+      _updateAllCharts();
+      _checkForSlowQueries();
+      $.gevent.subscribe(jqueryMap.$container, 'node-status-updated', _updateNodeCharts);
+      $.gevent.subscribe(jqueryMap.$container, 'tables-updated', _loadTableColumnChart);
+      $.gevent.subscribe(jqueryMap.$container, 'query-perf-updated', _loadQueryPerfLineChart);
+      $.gevent.subscribe(jqueryMap.$container, 'queries-updated', _checkForSlowQueries);
+      _adjustChartsSizes();
+      _registerPageEvents();
+    });
+    return true;
+  }
 
-	function unloadModule() {
-		$.gevent.unsubscribe(jqueryMap.$container, 'node-status-updated');
-		$.gevent.unsubscribe(jqueryMap.$container, 'tables-updated');
-		$.gevent.unsubscribe(jqueryMap.$container, 'query-perf-updated');
-		$.gevent.unsubscribe(jqueryMap.$container, 'queries-updated');
-		_unregisterPageEvents();
-	}
+  function unloadModule() {
+    $.gevent.unsubscribe(jqueryMap.$container, 'node-status-updated');
+    $.gevent.unsubscribe(jqueryMap.$container, 'tables-updated');
+    $.gevent.unsubscribe(jqueryMap.$container, 'query-perf-updated');
+    $.gevent.unsubscribe(jqueryMap.$container, 'queries-updated');
+    _unregisterPageEvents();
+  }
 
-	return {
-		initModule   : initModule,
-		unloadModule : unloadModule
-	};
+  return {
+    initModule   : initModule,
+    unloadModule : unloadModule
+  };
 }());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/79786aca/blur-console/src/main/webapp/js/blurconsole.data.js
----------------------------------------------------------------------
diff --git a/blur-console/src/main/webapp/js/blurconsole.data.js b/blur-console/src/main/webapp/js/blurconsole.data.js
index b89ff80..056a8c1 100644
--- a/blur-console/src/main/webapp/js/blurconsole.data.js
+++ b/blur-console/src/main/webapp/js/blurconsole.data.js
@@ -19,113 +19,113 @@ under the License.
 */
 /*global blurconsole:false */
 blurconsole.data = (function() {
-	'use strict';
+  'use strict';
 
-	//------------------- Private methods --------------------------
-	function _logError (errorMsg, status, module, callback) {
-		blurconsole.model.logs.logError(status + ' - ' + errorMsg, module);
-		if (callback) {
-			callback('error');
-		}
-	}
+  //------------------- Private methods --------------------------
+  function _logError (errorMsg, status, module, callback) {
+    blurconsole.model.logs.logError(status + ' - ' + errorMsg, module);
+    if (callback) {
+      callback('error');
+    }
+  }
 
-	//------------------- Public API -------------------------------
-	function getTableList(callback) {
-		$.getJSON('/service/tables', callback).fail(function(xhr) {
-			_logError(xhr.responseText, xhr.status, 'tables', callback);
-		});
-	}
+  //------------------- Public API -------------------------------
+  function getTableList(callback) {
+    $.getJSON('/service/tables', callback).fail(function(xhr) {
+      _logError(xhr.responseText, xhr.status, 'tables', callback);
+    });
+  }
 
-	function getNodeList(callback) {
-		$.getJSON('/service/nodes', callback).fail(function(xhr) {
-			_logError(xhr.responseText, xhr.status, 'tables', callback);
-		});
-	}
-	function getQueryPerformance(callback) {
-		$.getJSON('/service/queries/performance', callback).fail(function(xhr) {
-			_logError(xhr.responseText, xhr.status, 'tables', callback);
-		});
-	}
+  function getNodeList(callback) {
+    $.getJSON('/service/nodes', callback).fail(function(xhr) {
+      _logError(xhr.responseText, xhr.status, 'tables', callback);
+    });
+  }
+  function getQueryPerformance(callback) {
+    $.getJSON('/service/queries/performance', callback).fail(function(xhr) {
+      _logError(xhr.responseText, xhr.status, 'tables', callback);
+    });
+  }
 
-	function getQueries(callback) {
-		$.getJSON('/service/queries', callback).fail(function(xhr) {
-			_logError(xhr.responseText, xhr.status, 'tables', callback);
-		});
-	}
+  function getQueries(callback) {
+    $.getJSON('/service/queries', callback).fail(function(xhr) {
+      _logError(xhr.responseText, xhr.status, 'tables', callback);
+    });
+  }
 
-	function cancelQuery(table, uuid) {
-		$.ajax('/service/queries/' + uuid + '/cancel', {
-			data: {
-				table: table
-			},
-			error: function(xhr) {
-				_logError(xhr.responseText, xhr.status, 'tables');
-			}
-		});
-	}
+  function cancelQuery(table, uuid) {
+    $.ajax('/service/queries/' + uuid + '/cancel', {
+      data: {
+        table: table
+      },
+      error: function(xhr) {
+        _logError(xhr.responseText, xhr.status, 'tables');
+      }
+    });
+  }
 
-	function disableTable(table) {
-		$.ajax('/service/tables/' + table + '/disable', {
-			error: function(xhr) {
-				_logError(xhr.responseText, xhr.status, 'tables');
-			}
-		});
-	}
+  function disableTable(table) {
+    $.ajax('/service/tables/' + table + '/disable', {
+      error: function(xhr) {
+        _logError(xhr.responseText, xhr.status, 'tables');
+      }
+    });
+  }
 
-	function enableTable (table){
-		$.ajax('/service/tables/' + table + '/enable', {
-			error: function(xhr) {
-				_logError(xhr.responseText, xhr.status, 'tables');
-			}
-		});
-	}
+  function enableTable (table){
+    $.ajax('/service/tables/' + table + '/enable', {
+      error: function(xhr) {
+        _logError(xhr.responseText, xhr.status, 'tables');
+      }
+    });
+  }
 
-	function deleteTable (table, includeFiles) {
-		$.ajax('/service/tables/' + table + '/delete', {
-			data: {
-				includeFiles: includeFiles
-			},
-			error: function(xhr) {
-				_logError(xhr.responseText, xhr.status, 'tables');
-			}
-		});
-	}
+  function deleteTable (table, includeFiles) {
+    $.ajax('/service/tables/' + table + '/delete', {
+      data: {
+        includeFiles: includeFiles
+      },
+      error: function(xhr) {
+        _logError(xhr.responseText, xhr.status, 'tables');
+      }
+    });
+  }
 
-	function getSchema(table, callback) {
-		$.getJSON('/service/tables/' + table + '/schema', callback).fail(function(xhr) {
-			_logError(xhr.responseText, xhr.status, 'tables');
-		});
-	}
+  function getSchema(table, callback) {
+    $.getJSON('/service/tables/' + table + '/schema', callback).fail(function(xhr) {
+      _logError(xhr.responseText, xhr.status, 'tables');
+    });
+  }
 
-	function findTerms (table, family, column, startsWith, callback) {
-		$.getJSON('/service/tables/' + table + '/' + family + '/' + column + '/terms', {startsWith: startsWith}, callback).fail(function(xhr) {
-			_logError(xhr.responseText, xhr.status, 'tables');
-		});
-	}
+  function findTerms (table, family, column, startsWith, callback) {
+    $.getJSON('/service/tables/' + table + '/' + family + '/' + column + '/terms', {startsWith: startsWith}, callback).fail(function(xhr) {
+      _logError(xhr.responseText, xhr.status, 'tables');
+    });
+  }
 
-	function sendSearch(query, table, args, callback) {
-		var params = $.extend({table:table, query:query}, args);
-		$.ajax('/service/search', {
-			'type': 'POST',
-			'data': params,
-			'success': callback,
-			'error': function(xhr) {
-				_logError(xhr.responseText, xhr.status, 'tables');
-			}
-		});
-	}
+  function sendSearch(query, table, args, callback) {
+    var params = $.extend({table:table, query:query}, args);
+    $.ajax('/service/search', {
+      'type': 'POST',
+      'data': params,
+      'success': callback,
+      'error': function(xhr) {
+        _logError(xhr.responseText, xhr.status, 'tables');
+      }
+    });
+  }
 
-	return {
-		getTableList : getTableList,
-		getNodeList : getNodeList,
-		getQueryPerformance : getQueryPerformance,
-		getQueries : getQueries,
-		cancelQuery : cancelQuery,
-		disableTable : disableTable,
-		enableTable : enableTable,
-		deleteTable : deleteTable,
-		getSchema : getSchema,
-		findTerms : findTerms,
-		sendSearch : sendSearch
-	};
+  return {
+    getTableList : getTableList,
+    getNodeList : getNodeList,
+    getQueryPerformance : getQueryPerformance,
+    getQueries : getQueries,
+    cancelQuery : cancelQuery,
+    disableTable : disableTable,
+    enableTable : enableTable,
+    deleteTable : deleteTable,
+    getSchema : getSchema,
+    findTerms : findTerms,
+    sendSearch : sendSearch
+  };
 }());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/79786aca/blur-console/src/main/webapp/js/blurconsole.fake.js
----------------------------------------------------------------------
diff --git a/blur-console/src/main/webapp/js/blurconsole.fake.js b/blur-console/src/main/webapp/js/blurconsole.fake.js
index 14abc17..b1ef6c4 100644
--- a/blur-console/src/main/webapp/js/blurconsole.fake.js
+++ b/blur-console/src/main/webapp/js/blurconsole.fake.js
@@ -19,263 +19,263 @@ under the License.
 */
 /*global blurconsole:false */
 blurconsole.fake = (function() {
-	'use strict';
-	var frozen = false;
-	var tableList, schema, nodeList, queries;
-
-	//----------------------- Private Methods ----------------------
-	function _randomNumber(max, includeZero) {
-		var random = Math.random()*max;
-
-		if (!includeZero) {
-			random++;
-		}
-
-		return Math.floor(random);
-	}
-
-	function _randomBoolean() {
-		return _randomNumber(2) % 2 === 0;
-	}
-
-	function _randomString() {
-		var text = '';
-		var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
-
-		for( var i=0; i < Math.floor(Math.random() * 30 + 1); i++ ) {
-			text += possible.charAt(Math.floor(Math.random() * possible.length));
-		}
-
-		return text;
-	}
-
-	function _buildSchema() {
-		var schema = {}, familyCount = _randomNumber(20), types = ['string', 'long', 'int', 'date', 'stored', 'customType'];
-
-		for(var f=0; f < familyCount; f++) {
-			var c, fam = {}, columnCount = _randomNumber(30);
-			for(c=0; c < columnCount; c++) {
-				var col_name = 'col' + c;
-				if(_randomNumber(10) === 1) {
-					col_name += '.sub';
-				}
-				fam[col_name] = {
-					'fieldLess' : _randomBoolean(),
-					'type' : types[_randomNumber(6, true)],
-					'extra' : null
-				};
-
-				if (_randomBoolean()) {
-					var e, extraPropCount = _randomNumber(3), props = {};
-					for (e=0; e < extraPropCount; e++) {
-						props['extra'+e] = 'val'+e;
-					}
-					fam[col_name].extra = props;
-				}
-			}
-			schema['fam'+f] = fam;
-		}
-		return schema;
-	}
-
-	function _sendCallback(callback, data) {
-		setTimeout(function() {
-			callback(data);
-		}, _randomNumber(1000));
-	}
-
-	function _toggleFreeze() {
-		var button = $('#fake_freeze');
-		if(button.html() === 'Freeze'){
-			frozen = true;
-			button.html('Unfreeze');
-			console.log('Fake data frozen');
-		} else {
-			frozen = false;
-			button.html('Freeze');
-			console.log('Fake data resumed');
-		}
-	}
-
-	//-------------------------- Public API ---------------------------
-	function getTableList(callback) {
-		//console.log('getting fake table list');
-		if(!frozen || !tableList) {
-			var clusters = ['prodA', 'prodB'], data = [];
-
-			for (var i = 0; i < 5; i++) {
-				var cluster = clusters[_randomNumber(2, true)];
-				var rows = _randomNumber(1000);
-				var records = _randomNumber(10000)+1000;
-				var enabled = _randomBoolean();
-
-				data.push({cluster:cluster, name:'testtable'+i, enabled:enabled, rows:rows, records:records, families: blurconsole.utils.keys(_buildSchema())});
-
-			}
-			tableList = {'tables':data, 'clusters':clusters};
-		}
-		_sendCallback(callback, tableList);
-	}
-
-	function getNodeList(callback) {
-		//console.log('getting fake node list');
-		if(!frozen || !nodeList) {
-			var controllers = {online:[], offline:[]},
-				clusters = [{name:'prodA', online:[], offline:[]}, {name:'prodB', online:[], offline:[]}],
-				zookeepers = {online: [], offline:[]};
-
-			for(var i = 0; i < 3; i++) {
-				var state = _randomBoolean();
-				if (state) {
-					controllers.online.push('controller' + i + '.localhost');
-					clusters[0].online.push('prodA.shard' + i + '.localhost');
-					clusters[1].online.push('prodB.shard' + i + '.localhost');
-					zookeepers.online.push('zookeeper' + i + '.localhost');
-				} else {
-					controllers.offline.push('controller' + i + '.localhost');
-					clusters[0].offline.push('prodA.shard' + i + '.localhost');
-					clusters[1].offline.push('prodB.shard' + i + '.localhost');
-					zookeepers.offline.push('zookeeper' + i + '.localhost');
-				}
-			}
-			nodeList = {controllers: controllers, clusters: clusters, zookeepers: zookeepers};
-		}
-		_sendCallback(callback, nodeList);
-	}
-
-	function getQueryPerformance(callback) {
-		//console.log('getting fake query performance');
-		_sendCallback(callback, _randomNumber(1000, true));
-	}
-
-	function getQueries(callback) {
-		//console.log('getting fake queries');
-		if(!frozen || !queries) {
-			var randomQueries = [];
-
-			for (var i=0; i < _randomNumber(50); i++) {
-				randomQueries.push({
-					uuid: _randomString(),
-					user: 'user_' + _randomNumber(10, true),
-					query: _randomString(),
-					table: 'testtable' + _randomNumber(5, true),
-					state: _randomNumber(3, true),
-					percent: _randomNumber(100, true),
-					startTime: new Date().getTime()
-				});
-			}
-			queries = { slowQueries : _randomNumber(10) === 1, queries : randomQueries };
-		}
-		_sendCallback(callback, queries);
-	}
-
-	function cancelQuery(table, uuid) {
-		console.log('Fake sending request to cancel query [' + uuid + '] on table [' + table + ']');
-	}
-
-	function disableTable(table) {
-		console.log('Fake sending request to disable table [' + table + ']');
-	}
-
-	function enableTable(table) {
-		console.log('Fake sending request to enable table [' + table + ']');
-	}
-
-	function deleteTable(table, includeFiles) {
-		console.log('Fake sending request to delete table [' + table + '] with files [' + includeFiles + ']');
-	}
-
-	function getSchema(table, callback) {
-		console.log('getting fake schema for table [' + table + ']');
-		if(!frozen || !schema){
-			schema = _buildSchema();
-		}
-		_sendCallback(callback, schema);
-	}
-
-	function findTerms(table, family, column, startsWith, callback) {
-		console.log('getting fake terms from [' + table + '] for family [' + family + '] and column [' + column + '] starting with [' + startsWith + ']');
-		var terms = [];
-
-		for (var i = 0; i < 10; i++) {
-			var randStr = _randomString();
-			if (startsWith) {
-				randStr = startsWith + randStr;
-			}
-			terms.push(randStr);
-		}
-
-		terms = terms.sort(function (a, b) {
-			return a.toLowerCase().localeCompare(b.toLowerCase());
-		});
-		_sendCallback(callback, terms);
-	}
-
-	function sendSearch(query, table, args, callback) {
-		console.log('sending fake search [' + query + '] on table [' + table + ']');
-
-		var fams = args.families, results = {}, total = (fams !== null && fams.indexOf('rowid') >= 0) ? 1 : _randomNumber(1000);
-
-		if (fams !== null) {
-			$.each(fams, function(i, fam){
-				var cols = _randomNumber(30, true), toFetch = (fams !== null && fams.indexOf('rowid') >= 0)? 1 : args.fetch;
-				if (total - args.start < toFetch) {
-					toFetch = total - args.start;
-				}
-
-				if (args.rowRecordOption === 'recordrecord') {
-					results[fam] = [];
-					for (var recordIndex = 0; recordIndex < _randomNumber(toFetch); recordIndex++) {
-						var recordRow = {};
-						recordRow.recordid = _randomNumber(1000000).toString();
-						for (var recordColIndex=0; recordColIndex < cols; recordColIndex++) {
-							recordRow['col'+recordColIndex] = _randomString();
-						}
-						results[fam].push(recordRow);
-					}
-				} else {
-					results[fam] = [];
-					for (var rowIndex = 0; rowIndex < _randomNumber(toFetch); rowIndex++) {
-						var rowid = _randomNumber(10000000).toString();
-						results[fam][rowIndex] = {rowid: rowid, records: []};
-						for (var rowRecordIndex = 0; rowRecordIndex < _randomNumber(10); rowRecordIndex++) {
-							var row = {};
-							row.recordid = _randomNumber(1000000).toString();
-							for (var rowRecordColIndex=0; rowRecordColIndex < cols; rowRecordColIndex++) {
-								row['col'+rowRecordColIndex] = _randomString();
-							}
-							results[fam][rowIndex]['records'].push(row);
-						}
-					}
-				}
-			});
-		}
-
-		if (fams.indexOf('rowid') >= 0) {
-			_sendCallback(callback, { total: total, results: results, families: fams });
-		} else if (fams === null || fams.length === 0) {
-			_sendCallback(callback, { total: total });
-		} else {
-			_sendCallback(callback, { families: fams, results: results, total: total });
-		}
-	}
-	function initModule() {
-		$('nav.navbar .pull-right').append('<button type="button" id="fake_freeze" class="btn btn-default btn-sm">Freeze</button>');
-		$('#fake_freeze').click(_toggleFreeze);
-	}
-
-	return {
-		initModule: initModule,
-		getTableList : getTableList,
-		getNodeList : getNodeList,
-		getQueryPerformance : getQueryPerformance,
-		getQueries : getQueries,
-		cancelQuery : cancelQuery,
-		disableTable : disableTable,
-		enableTable : enableTable,
-		deleteTable : deleteTable,
-		getSchema : getSchema,
-		findTerms : findTerms,
-		sendSearch : sendSearch
-	};
+  'use strict';
+  var frozen = false;
+  var tableList, schema, nodeList, queries;
+
+  //----------------------- Private Methods ----------------------
+  function _randomNumber(max, includeZero) {
+    var random = Math.random()*max;
+
+    if (!includeZero) {
+      random++;
+    }
+
+    return Math.floor(random);
+  }
+
+  function _randomBoolean() {
+    return _randomNumber(2) % 2 === 0;
+  }
+
+  function _randomString() {
+    var text = '';
+    var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
+
+    for( var i=0; i < Math.floor(Math.random() * 30 + 1); i++ ) {
+      text += possible.charAt(Math.floor(Math.random() * possible.length));
+    }
+
+    return text;
+  }
+
+  function _buildSchema() {
+    var schema = {}, familyCount = _randomNumber(20), types = ['string', 'long', 'int', 'date', 'stored', 'customType'];
+
+    for(var f=0; f < familyCount; f++) {
+      var c, fam = {}, columnCount = _randomNumber(30);
+      for(c=0; c < columnCount; c++) {
+        var col_name = 'col' + c;
+        if(_randomNumber(10) === 1) {
+          col_name += '.sub';
+        }
+        fam[col_name] = {
+          'fieldLess' : _randomBoolean(),
+          'type' : types[_randomNumber(6, true)],
+          'extra' : null
+        };
+
+        if (_randomBoolean()) {
+          var e, extraPropCount = _randomNumber(3), props = {};
+          for (e=0; e < extraPropCount; e++) {
+            props['extra'+e] = 'val'+e;
+          }
+          fam[col_name].extra = props;
+        }
+      }
+      schema['fam'+f] = fam;
+    }
+    return schema;
+  }
+
+  function _sendCallback(callback, data) {
+    setTimeout(function() {
+      callback(data);
+    }, _randomNumber(1000));
+  }
+
+  function _toggleFreeze() {
+    var button = $('#fake_freeze');
+    if(button.html() === 'Freeze'){
+      frozen = true;
+      button.html('Unfreeze');
+      console.log('Fake data frozen');
+    } else {
+      frozen = false;
+      button.html('Freeze');
+      console.log('Fake data resumed');
+    }
+  }
+
+  //-------------------------- Public API ---------------------------
+  function getTableList(callback) {
+    //console.log('getting fake table list');
+    if(!frozen || !tableList) {
+      var clusters = ['prodA', 'prodB'], data = [];
+
+      for (var i = 0; i < 5; i++) {
+        var cluster = clusters[_randomNumber(2, true)];
+        var rows = _randomNumber(1000);
+        var records = _randomNumber(10000)+1000;
+        var enabled = _randomBoolean();
+
+        data.push({cluster:cluster, name:'testtable'+i, enabled:enabled, rows:rows, records:records, families: blurconsole.utils.keys(_buildSchema())});
+
+      }
+      tableList = {'tables':data, 'clusters':clusters};
+    }
+    _sendCallback(callback, tableList);
+  }
+
+  function getNodeList(callback) {
+    //console.log('getting fake node list');
+    if(!frozen || !nodeList) {
+      var controllers = {online:[], offline:[]},
+        clusters = [{name:'prodA', online:[], offline:[]}, {name:'prodB', online:[], offline:[]}],
+        zookeepers = {online: [], offline:[]};
+
+      for(var i = 0; i < 3; i++) {
+        var state = _randomBoolean();
+        if (state) {
+          controllers.online.push('controller' + i + '.localhost');
+          clusters[0].online.push('prodA.shard' + i + '.localhost');
+          clusters[1].online.push('prodB.shard' + i + '.localhost');
+          zookeepers.online.push('zookeeper' + i + '.localhost');
+        } else {
+          controllers.offline.push('controller' + i + '.localhost');
+          clusters[0].offline.push('prodA.shard' + i + '.localhost');
+          clusters[1].offline.push('prodB.shard' + i + '.localhost');
+          zookeepers.offline.push('zookeeper' + i + '.localhost');
+        }
+      }
+      nodeList = {controllers: controllers, clusters: clusters, zookeepers: zookeepers};
+    }
+    _sendCallback(callback, nodeList);
+  }
+
+  function getQueryPerformance(callback) {
+    //console.log('getting fake query performance');
+    _sendCallback(callback, _randomNumber(1000, true));
+  }
+
+  function getQueries(callback) {
+    //console.log('getting fake queries');
+    if(!frozen || !queries) {
+      var randomQueries = [];
+
+      for (var i=0; i < _randomNumber(50); i++) {
+        randomQueries.push({
+          uuid: _randomString(),
+          user: 'user_' + _randomNumber(10, true),
+          query: _randomString(),
+          table: 'testtable' + _randomNumber(5, true),
+          state: _randomNumber(3, true),
+          percent: _randomNumber(100, true),
+          startTime: new Date().getTime()
+        });
+      }
+      queries = { slowQueries : _randomNumber(10) === 1, queries : randomQueries };
+    }
+    _sendCallback(callback, queries);
+  }
+
+  function cancelQuery(table, uuid) {
+    console.log('Fake sending request to cancel query [' + uuid + '] on table [' + table + ']');
+  }
+
+  function disableTable(table) {
+    console.log('Fake sending request to disable table [' + table + ']');
+  }
+
+  function enableTable(table) {
+    console.log('Fake sending request to enable table [' + table + ']');
+  }
+
+  function deleteTable(table, includeFiles) {
+    console.log('Fake sending request to delete table [' + table + '] with files [' + includeFiles + ']');
+  }
+
+  function getSchema(table, callback) {
+    console.log('getting fake schema for table [' + table + ']');
+    if(!frozen || !schema){
+      schema = _buildSchema();
+    }
+    _sendCallback(callback, schema);
+  }
+
+  function findTerms(table, family, column, startsWith, callback) {
+    console.log('getting fake terms from [' + table + '] for family [' + family + '] and column [' + column + '] starting with [' + startsWith + ']');
+    var terms = [];
+
+    for (var i = 0; i < 10; i++) {
+      var randStr = _randomString();
+      if (startsWith) {
+        randStr = startsWith + randStr;
+      }
+      terms.push(randStr);
+    }
+
+    terms = terms.sort(function (a, b) {
+      return a.toLowerCase().localeCompare(b.toLowerCase());
+    });
+    _sendCallback(callback, terms);
+  }
+
+  function sendSearch(query, table, args, callback) {
+    console.log('sending fake search [' + query + '] on table [' + table + ']');
+
+    var fams = args.families, results = {}, total = (fams !== null && fams.indexOf('rowid') >= 0) ? 1 : _randomNumber(1000);
+
+    if (fams !== null) {
+      $.each(fams, function(i, fam){
+        var cols = _randomNumber(30, true), toFetch = (fams !== null && fams.indexOf('rowid') >= 0)? 1 : args.fetch;
+        if (total - args.start < toFetch) {
+          toFetch = total - args.start;
+        }
+
+        if (args.rowRecordOption === 'recordrecord') {
+          results[fam] = [];
+          for (var recordIndex = 0; recordIndex < _randomNumber(toFetch); recordIndex++) {
+            var recordRow = {};
+            recordRow.recordid = _randomNumber(1000000).toString();
+            for (var recordColIndex=0; recordColIndex < cols; recordColIndex++) {
+              recordRow['col'+recordColIndex] = _randomString();
+            }
+            results[fam].push(recordRow);
+          }
+        } else {
+          results[fam] = [];
+          for (var rowIndex = 0; rowIndex < _randomNumber(toFetch); rowIndex++) {
+            var rowid = _randomNumber(10000000).toString();
+            results[fam][rowIndex] = {rowid: rowid, records: []};
+            for (var rowRecordIndex = 0; rowRecordIndex < _randomNumber(10); rowRecordIndex++) {
+              var row = {};
+              row.recordid = _randomNumber(1000000).toString();
+              for (var rowRecordColIndex=0; rowRecordColIndex < cols; rowRecordColIndex++) {
+                row['col'+rowRecordColIndex] = _randomString();
+              }
+              results[fam][rowIndex]['records'].push(row);
+            }
+          }
+        }
+      });
+    }
+
+    if (fams.indexOf('rowid') >= 0) {
+      _sendCallback(callback, { total: total, results: results, families: fams });
+    } else if (fams === null || fams.length === 0) {
+      _sendCallback(callback, { total: total });
+    } else {
+      _sendCallback(callback, { families: fams, results: results, total: total });
+    }
+  }
+  function initModule() {
+    $('nav.navbar .pull-right').append('<button type="button" id="fake_freeze" class="btn btn-default btn-sm">Freeze</button>');
+    $('#fake_freeze').click(_toggleFreeze);
+  }
+
+  return {
+    initModule: initModule,
+    getTableList : getTableList,
+    getNodeList : getNodeList,
+    getQueryPerformance : getQueryPerformance,
+    getQueries : getQueries,
+    cancelQuery : cancelQuery,
+    disableTable : disableTable,
+    enableTable : enableTable,
+    deleteTable : deleteTable,
+    getSchema : getSchema,
+    findTerms : findTerms,
+    sendSearch : sendSearch
+  };
 }());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/79786aca/blur-console/src/main/webapp/js/blurconsole.js
----------------------------------------------------------------------
diff --git a/blur-console/src/main/webapp/js/blurconsole.js b/blur-console/src/main/webapp/js/blurconsole.js
index 310df79..dda57ac 100644
--- a/blur-console/src/main/webapp/js/blurconsole.js
+++ b/blur-console/src/main/webapp/js/blurconsole.js
@@ -23,13 +23,13 @@ under the License.
  * Root namespace module
  */
 var blurconsole = (function () {
-	'use strict';
+  'use strict';
 
-	//---------------------- Public API -------------------------
-	function initModule( $container ) {
-		blurconsole.model.initModule();
-		blurconsole.shell.initModule( $container );
-	}
+  //---------------------- Public API -------------------------
+  function initModule( $container ) {
+    blurconsole.model.initModule();
+    blurconsole.shell.initModule( $container );
+  }
 
-	return { initModule: initModule };
+  return { initModule: initModule };
 }());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/79786aca/blur-console/src/main/webapp/js/blurconsole.logging.js
----------------------------------------------------------------------
diff --git a/blur-console/src/main/webapp/js/blurconsole.logging.js b/blur-console/src/main/webapp/js/blurconsole.logging.js
index e3a35d5..72805ca 100644
--- a/blur-console/src/main/webapp/js/blurconsole.logging.js
+++ b/blur-console/src/main/webapp/js/blurconsole.logging.js
@@ -20,68 +20,68 @@ under the License.
 
 /*global blurconsole:false */
 blurconsole.logging = (function () {
-	'use strict';
+  'use strict';
 
-	//------------------------ Configuration and State -----------------------
-	var configMap = {
-		emptyLogMsg: 'No Errors! Yay!',
-		mainHtml: '<div class="log_display"></div>',
-		buttons: [
-			{ 'classes': 'btn-default', 'id': 'clear-log-button', 'label': 'Clear Logs' },
-			{ 'classes': 'btn-primary', 'id': 'close-logs', 'label': 'Close', 'data': {'dismiss':'modal'} }
-		]
-	},
-	jqueryMap = {
-		modal: null
-	};
+  //------------------------ Configuration and State -----------------------
+  var configMap = {
+    emptyLogMsg: 'No Errors! Yay!',
+    mainHtml: '<div class="log_display"></div>',
+    buttons: [
+      { 'classes': 'btn-default', 'id': 'clear-log-button', 'label': 'Clear Logs' },
+      { 'classes': 'btn-primary', 'id': 'close-logs', 'label': 'Close', 'data': {'dismiss':'modal'} }
+    ]
+  },
+  jqueryMap = {
+    modal: null
+  };
 
-	//------------------ Event Handling and DOM Methods -------------
-	function _showLogging() {
-		if (jqueryMap.modal === null) {
-			jqueryMap.modal = $(blurconsole.browserUtils.modal('error_log_modal', 'Error Logs', configMap.mainHtml, configMap.buttons, 'large'));
-			jqueryMap.modal.modal()
-			.on('shown.bs.modal', function(){
-				jqueryMap.logHolder = $('.log_display', jqueryMap.modal);
-				_drawLogs();
-			})
-			.on('click', '#clear-log-button', _clearLogging);
-		} else {
-			jqueryMap.modal.modal('show');
-		}
-	}
+  //------------------ Event Handling and DOM Methods -------------
+  function _showLogging() {
+    if (jqueryMap.modal === null) {
+      jqueryMap.modal = $(blurconsole.browserUtils.modal('error_log_modal', 'Error Logs', configMap.mainHtml, configMap.buttons, 'large'));
+      jqueryMap.modal.modal()
+      .on('shown.bs.modal', function(){
+        jqueryMap.logHolder = $('.log_display', jqueryMap.modal);
+        _drawLogs();
+      })
+      .on('click', '#clear-log-button', _clearLogging);
+    } else {
+      jqueryMap.modal.modal('show');
+    }
+  }
 
-	function _clearLogging() {
-		jqueryMap.logHolder.html(configMap.emptyLogMsg);
-		blurconsole.model.logs.clearErrors();
-	}
+  function _clearLogging() {
+    jqueryMap.logHolder.html(configMap.emptyLogMsg);
+    blurconsole.model.logs.clearErrors();
+  }
 
-	function _drawLogs() {
-		var errors = blurconsole.model.logs.getLogs();
+  function _drawLogs() {
+    var errors = blurconsole.model.logs.getLogs();
 
-		if (jqueryMap.logHolder) {
-			if (errors.length === 0) {
-				jqueryMap.logHolder.html(configMap.emptyLogMsg);
-			} else {
-				var errorList = '<ul>';
-				errors.sort(function(a, b) {
-					return a.timestamp.getTime() > b.timestamp.getTime();
-				});
-				$.each(errors, function(i, error){
-					errorList += '<li><strong>' + error.error + ' (' + error.module + ')</strong><div class="pull-right"><em>' + error.timestamp.toTimeString() + '</em></div></li>';
-				});
-				errorList += '</ul>';
-				jqueryMap.logHolder.html(errorList);
-			}
-		}
-	}
+    if (jqueryMap.logHolder) {
+      if (errors.length === 0) {
+        jqueryMap.logHolder.html(configMap.emptyLogMsg);
+      } else {
+        var errorList = '<ul>';
+        errors.sort(function(a, b) {
+          return a.timestamp.getTime() > b.timestamp.getTime();
+        });
+        $.each(errors, function(i, error){
+          errorList += '<li><strong>' + error.error + ' (' + error.module + ')</strong><div class="pull-right"><em>' + error.timestamp.toTimeString() + '</em></div></li>';
+        });
+        errorList += '</ul>';
+        jqueryMap.logHolder.html(errorList);
+      }
+    }
+  }
 
-	//------------------ Public API ---------------------------------
-	function initModule() {
-		$.gevent.subscribe($(document), 'show-logging', _showLogging);
-		$.gevent.subscribe($(document), 'logging-updated', _drawLogs);
-	}
+  //------------------ Public API ---------------------------------
+  function initModule() {
+    $.gevent.subscribe($(document), 'show-logging', _showLogging);
+    $.gevent.subscribe($(document), 'logging-updated', _drawLogs);
+  }
 
-	return {
-		initModule : initModule
-	};
+  return {
+    initModule : initModule
+  };
 }());
\ No newline at end of file


Mime
View raw message