You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2013/04/02 15:47:40 UTC

svn commit: r1463546 - in /accumulo/branches/1.5: core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java

Author: ecn
Date: Tue Apr  2 13:47:40 2013
New Revision: 1463546

URL: http://svn.apache.org/r1463546
Log:
ACCUMULO-1214 document delay between set/get properties; loosen the test to allow for the delay

Modified:
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
    accumulo/branches/1.5/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java?rev=1463546&r1=1463545&r2=1463546&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java (original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java Tue Apr  2 13:47:40 2013
@@ -353,7 +353,7 @@ public interface TableOperations {
       TableExistsException;
   
   /**
-   * Initiate a flush of a tables data that is in memory
+   * Initiate a flush of a table's data that is in memory
    * 
    * @param tableName
    *          the name of the table
@@ -368,7 +368,7 @@ public interface TableOperations {
   public void flush(String tableName) throws AccumuloException, AccumuloSecurityException;
   
   /**
-   * Flush a tables data that is currently in memory.
+   * Flush a table's data that is currently in memory.
    * 
    * @param tableName
    *          the name of the table
@@ -384,7 +384,7 @@ public interface TableOperations {
   public void flush(String tableName, Text start, Text end, boolean wait) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
   
   /**
-   * Sets a property on a table
+   * Sets a property on a table. Note that it may take a short period of time (a second) to propagate the change everywhere.
    * 
    * @param tableName
    *          the name of the table
@@ -400,7 +400,7 @@ public interface TableOperations {
   public void setProperty(String tableName, String property, String value) throws AccumuloException, AccumuloSecurityException;
   
   /**
-   * Removes a property from a table
+   * Removes a property from a table.  Note that it may take a short period of time (a second) to propagate the change everywhere.
    * 
    * @param tableName
    *          the name of the table
@@ -414,18 +414,19 @@ public interface TableOperations {
   public void removeProperty(String tableName, String property) throws AccumuloException, AccumuloSecurityException;
   
   /**
-   * Gets properties of a table
+   * Gets properties of a table.  Note that recently changed properties may not be available immediately.
    * 
    * @param tableName
    *          the name of the table
-   * @return all properties visible by this table (system and per-table properties)
+   * @return all properties visible by this table (system and per-table properties).  Note that recently changed 
+   *         properties may not be visible immediately. 
    * @throws TableNotFoundException
    *           if the table does not exist
    */
   public Iterable<Entry<String,String>> getProperties(String tableName) throws AccumuloException, TableNotFoundException;
   
   /**
-   * Sets a tables locality groups. A tables locality groups can be changed at any time.
+   * Sets a table's locality groups. A table's locality groups can be changed at any time.
    * 
    * @param tableName
    *          the name of the table

Modified: accumulo/branches/1.5/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java?rev=1463546&r1=1463545&r2=1463546&view=diff
==============================================================================
--- accumulo/branches/1.5/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java (original)
+++ accumulo/branches/1.5/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java Tue Apr  2 13:47:40 2013
@@ -162,12 +162,22 @@ public class SimpleTest {
     client.setProperty(creds, "table.split.threshold", "500M");
     
     // check that we can read it
-    cfg = client.getSystemConfiguration(creds);
+    for (int i = 0; i < 5; i++) {
+      cfg = client.getSystemConfiguration(creds);
+      if ("500M".equals(cfg.get("table.split.threshold")))
+          break;
+      UtilWaitThread.sleep(200);
+    }
     assertEquals("500M", cfg.get("table.split.threshold"));
     
     // unset the setting, check that it's not what it was
     client.removeProperty(creds, "table.split.threshold");
-    cfg = client.getSystemConfiguration(creds);
+    for (int i = 0; i < 5; i++) {
+      cfg = client.getSystemConfiguration(creds);
+      if (!"500M".equals(cfg.get("table.split.threshold")))
+          break;
+      UtilWaitThread.sleep(200);
+    }
     assertNotEquals("500M", cfg.get("table.split.threshold"));
     
     // try to load some classes via the proxy
@@ -450,6 +460,11 @@ public class SimpleTest {
     Map<String,String> orig = client.getTableProperties(creds, "test");
     client.setTableProperty(creds, "test", "table.split.threshold", "500M");
     Map<String,String> update = client.getTableProperties(creds, "test");
+    for (int i = 0; i < 5; i++) {
+      if (update.get("table.split.threshold").equals("500M"))
+          break;
+      UtilWaitThread.sleep(200);
+    }
     assertEquals(update.get("table.split.threshold"), "500M");
     client.removeTableProperty(creds, "test", "table.split.threshold");
     update = client.getTableProperties(creds, "test");