incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cr...@apache.org
Subject [1/2] Code reformat to standardize, sorry
Date Wed, 09 Jul 2014 18:58:27 GMT
Repository: incubator-blur
Updated Branches:
  refs/heads/apache-blur-0.2 dd91c9218 -> a8c4cd018


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a8c4cd01/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
index 82495cc..7eadbbc 100644
--- a/blur-console/src/main/webapp/views/search.tpl.html
+++ b/blur-console/src/main/webapp/views/search.tpl.html
@@ -20,31 +20,33 @@ 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">
+  <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>
+      <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">
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a8c4cd01/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
index 09cbce9..e555bca 100644
--- a/blur-console/src/test/java/org/apache/blur/console/ConsoleTestBase.java
+++ b/blur-console/src/test/java/org/apache/blur/console/ConsoleTestBase.java
@@ -17,13 +17,13 @@
 
 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;
 
+import java.io.File;
+import java.io.IOException;
+
 public class ConsoleTestBase {
   protected static String TABLE_PATH = new File("./target/tmp/test-data/test-tables").getAbsolutePath();
   private static boolean _managing;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a8c4cd01/blur-console/src/test/java/org/apache/blur/console/ConsoleTestSuite.java
----------------------------------------------------------------------
diff --git a/blur-console/src/test/java/org/apache/blur/console/ConsoleTestSuite.java b/blur-console/src/test/java/org/apache/blur/console/ConsoleTestSuite.java
index 095673b..9afd1a4 100644
--- a/blur-console/src/test/java/org/apache/blur/console/ConsoleTestSuite.java
+++ b/blur-console/src/test/java/org/apache/blur/console/ConsoleTestSuite.java
@@ -1,17 +1,13 @@
 package org.apache.blur.console;
 
-import java.io.IOException;
-
-import org.apache.blur.console.util.Config;
-import org.apache.blur.console.util.ConfigTest;
-import org.apache.blur.console.util.NodeUtilTest;
-import org.apache.blur.console.util.QueryUtilTest;
-import org.apache.blur.console.util.TableUtilTest;
+import org.apache.blur.console.util.*;
 import org.junit.*;
 import org.junit.rules.ExternalResource;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
+import java.io.IOException;
+
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements. See the NOTICE file distributed with this
@@ -19,9 +15,9 @@ import org.junit.runners.Suite;
  * 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
- * 
+ * <p/>
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ * <p/>
  * 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
@@ -30,7 +26,7 @@ import org.junit.runners.Suite;
  */
 
 @RunWith(Suite.class)
-@Suite.SuiteClasses({ ConfigTest.class, NodeUtilTest.class, QueryUtilTest.class, TableUtilTest.class
})
+@Suite.SuiteClasses({ConfigTest.class, NodeUtilTest.class, QueryUtilTest.class, TableUtilTest.class})
 public class ConsoleTestSuite {
 
   @ClassRule

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a8c4cd01/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
index 172dffd..a595352 100644
--- a/blur-console/src/test/java/org/apache/blur/console/RunMiniCluster.java
+++ b/blur-console/src/test/java/org/apache/blur/console/RunMiniCluster.java
@@ -16,9 +16,6 @@
  */
 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;
@@ -28,6 +25,9 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.permission.FsAction;
 import org.apache.hadoop.fs.permission.FsPermission;
 
+import java.io.File;
+import java.io.IOException;
+
 public class RunMiniCluster {
 
   private static final File TMPDIR = new File(System.getProperty("blur.tmp.dir", "./target/mini-cluster"));

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a8c4cd01/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
index efec10a..a187f6f 100644
--- 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
@@ -16,21 +16,19 @@
  */
 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;
 
+import java.io.IOException;
+import java.net.InetAddress;
+
+import static org.junit.Assert.*;
+
 public class ConfigTest extends ConsoleTestBase {
-  
+
   @Before
   public void setup() throws IOException {
     Config.setupConfig();
@@ -51,7 +49,7 @@ public class ConfigTest extends ConsoleTestBase {
   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/a8c4cd01/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
index 6403ea6..8887684 100644
--- 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
@@ -16,48 +16,48 @@
  */
 package org.apache.blur.console.util;
 
-import static org.junit.Assert.assertEquals;
+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;
 
 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;
+import static org.junit.Assert.assertEquals;
 
 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/a8c4cd01/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
index c765a42..7320f12 100644
--- 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
@@ -17,7 +17,13 @@
 
 package org.apache.blur.console.util;
 
-import static org.junit.Assert.assertEquals;
+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.*;
+import org.junit.Before;
+import org.junit.Test;
 
 import java.io.IOException;
 import java.util.Arrays;
@@ -25,31 +31,15 @@ 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;
+import static org.junit.Assert.assertEquals;
 
 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);
@@ -58,42 +48,42 @@ public class QueryUtilTest extends ConsoleTestBase {
       td.setName("queryUnitTable");
       td.setEnabled(true);
       client.createTable(td);
-      
-      Record record = new Record("abcd", "fam0", Arrays.asList(new Column[]{ new Column("col0",
"testvalue")}));
+
+      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 }));
+      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);
+        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);
+        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"));
+    assertEquals("testUser", ((List<Map<String, Object>>) queries.get("queries")).get(0).get("user"));
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a8c4cd01/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
index c0d1969..21fff82 100644
--- 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
@@ -16,12 +16,6 @@
  */
 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;
@@ -31,12 +25,18 @@ import org.apache.blur.thrift.generated.TableDescriptor;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+
 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()) {
@@ -46,20 +46,20 @@ public class TableUtilTest extends ConsoleTestBase {
       }
     }
   }
-  
+
   @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" })
+
+  @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");
@@ -67,14 +67,14 @@ public class TableUtilTest extends ConsoleTestBase {
     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());
+    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());
   }
 }


Mime
View raw message