incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aaven...@apache.org
Subject [02/11] BLUR-356 cache most calls to blur for a few seconds
Date Fri, 15 Aug 2014 03:25:13 GMT
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/04261d3c/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 7edff2f..c49d591 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
@@ -61,6 +61,7 @@ public class ConsoleTestBase {
 
   protected void setupConfigIfNeeded() throws Exception {
     if (Config.getBlurConfig() == null) {
+      System.setProperty("blur.console.refreshtime", "0");
       Config.setupConfig();
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/04261d3c/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 72878b9..9642ea0 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
@@ -20,8 +20,8 @@ package org.apache.blur.console.util;
 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.apache.blur.thrift.generated.Blur.Iface;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -38,7 +38,7 @@ public class QueryUtilTest extends ConsoleTestBase {
   public void setup() throws Exception {
     setupConfigIfNeeded();
 
-    Iface client = BlurClient.getClient(Config.getConnectionString());
+    Iface client = Config.getClient();
 
     if (!client.tableList().contains("queryUnitTable")) {
       TableDescriptor td = new TableDescriptor();
@@ -58,7 +58,7 @@ public class QueryUtilTest extends ConsoleTestBase {
 
   @Test
   public void testGetCurrentQueryCount() throws BlurException, IOException, TException {
-    Iface client = BlurClient.getClient(Config.getConnectionString());
+    Iface client = Config.getClient();
     BlurQuery query = new BlurQuery(
         new Query("fam0.col0:*", true, ScoreType.SUPER, null, null),
         null,
@@ -72,7 +72,7 @@ public class QueryUtilTest extends ConsoleTestBase {
   @SuppressWarnings("unchecked")
   @Test
   public void testGetQueries() throws IOException, BlurException, TException {
-    Iface client = BlurClient.getClient(Config.getConnectionString());
+    Iface client = Config.getClient();
     BlurQuery query = new BlurQuery(
         new Query("fam0.col0:*", true, ScoreType.SUPER, null, null),
         null,

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/04261d3c/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 c663870..cd52f78 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
@@ -17,15 +17,11 @@
 package org.apache.blur.console.util;
 
 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.apache.blur.thrift.generated.Blur.Iface;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
@@ -37,7 +33,7 @@ public class TableUtilTest extends ConsoleTestBase {
   public void ensureCleanTables() throws Exception {
     setupConfigIfNeeded();
 
-    Iface client = BlurClient.getClient(Config.getConnectionString());
+    Iface client = Config.getClient();
     List<String> tableList = client.tableList();
     if (!tableList.isEmpty()) {
       for (String table : tableList) {
@@ -58,7 +54,7 @@ public class TableUtilTest extends ConsoleTestBase {
   @SuppressWarnings({"unchecked", "rawtypes"})
   @Test
   public void testGetTableSummaries() throws Exception {
-    Iface client = BlurClient.getClient(Config.getConnectionString());
+    Iface client = Config.getClient();
 
     TableDescriptor td = new TableDescriptor();
     td.setShardCount(11);


Mime
View raw message