accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [5/5] git commit: Merge branch '1.5.1-SNAPSHOT' into 1.6.0-SNAPSHOT
Date Fri, 15 Nov 2013 19:48:30 GMT
Merge branch '1.5.1-SNAPSHOT' into 1.6.0-SNAPSHOT

Conflicts:
	minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/0b8cca09
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/0b8cca09
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/0b8cca09

Branch: refs/heads/1.6.0-SNAPSHOT
Commit: 0b8cca09ca6de47225762c28f8d77b7a76563947
Parents: 28bbb56 1261625
Author: Josh Elser <elserj@apache.org>
Authored: Fri Nov 15 11:48:14 2013 -0800
Committer: Josh Elser <elserj@apache.org>
Committed: Fri Nov 15 11:48:14 2013 -0800

----------------------------------------------------------------------
 .../simple/client/RandomBatchWriter.java        |  1 +
 .../minicluster/MiniAccumuloClusterGCTest.java  | 35 +++++++++++++++++---
 2 files changed, 31 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/0b8cca09/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java
----------------------------------------------------------------------
diff --cc minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java
index 6470ce1,a1f58f6..281e805
--- a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java
@@@ -33,54 -32,77 +33,79 @@@ import org.apache.commons.io.filefilter
  import org.apache.commons.io.filefilter.TrueFileFilter;
  import org.apache.log4j.Level;
  import org.apache.log4j.Logger;
 +import org.junit.AfterClass;
  import org.junit.Assert;
 +import org.junit.BeforeClass;
+ import org.junit.Ignore;
  import org.junit.Test;
 -import org.junit.rules.TemporaryFolder;
  
  import com.google.common.collect.ImmutableMap;
+ import com.google.common.io.Files;
  
  /**
   * 
   */
  public class MiniAccumuloClusterGCTest {
 +  private static final Logger log = Logger.getLogger(MiniAccumuloClusterGCTest.class);
    
+   @Test
+   public void testGcConfig() throws Exception {
+     File f = Files.createTempDir();
+     f.deleteOnExit();
+     try {
+       MiniAccumuloConfig macConfig = new MiniAccumuloConfig(f, passwd);
+       macConfig.setNumTservers(1);
+   
+       Assert.assertEquals(false, macConfig.shouldRunGC());
+       
+       // Turn on the garbage collector
+       macConfig.runGC(true);
+   
+       Assert.assertEquals(true, macConfig.shouldRunGC());
+     } finally {
+       if (null != f && f.exists()) {
+         f.delete();
+       }
+     }
+   }
+ 
+   
 -  private static TemporaryFolder tmpDir = new TemporaryFolder();
 +  private static File testDir = new File(System.getProperty("user.dir") + "/target/" + MiniAccumuloClusterGCTest.class.getName());
    private static MiniAccumuloConfig macConfig;
    private static MiniAccumuloCluster accumulo;
    private static final String passwd = "password";
- 
+   
 +  @BeforeClass
    public static void setupMiniCluster() throws Exception {
 -    tmpDir.create();
 +    FileUtils.deleteQuietly(testDir);
 +    testDir.mkdir();
      Logger.getLogger("org.apache.zookeeper").setLevel(Level.ERROR);
 -    
 -    macConfig = new MiniAccumuloConfig(tmpDir.getRoot(), passwd);
 +
 +    macConfig = new MiniAccumuloConfig(testDir, passwd);
      macConfig.setNumTservers(1);
 -    
 +
      // Turn on the garbage collector
      macConfig.runGC(true);
 -    
 -    String gcPort = Integer.toString(PortUtils.getRandomFreePort());
 -    
 +
      // And tweak the settings to make it run often
 -    Map<String,String> config = ImmutableMap.of(Property.GC_CYCLE_DELAY.getKey(),
"1s", Property.GC_CYCLE_START.getKey(), "0s", Property.GC_PORT.getKey(), gcPort);
 +    Map<String,String> config = ImmutableMap.of(Property.GC_CYCLE_DELAY.getKey(),
"1s", Property.GC_CYCLE_START.getKey(), "0s");
      macConfig.setSiteConfig(config);
 -    
 +
      accumulo = new MiniAccumuloCluster(macConfig);
      accumulo.start();
    }
- 
+   
 +  @AfterClass
    public static void tearDownMiniCluster() throws Exception {
      accumulo.stop();
 -    tmpDir.delete();
    }
- 
-   @Test(timeout = 40 * 1000)
-   public void testFilesAreGarbageCollected() throws Exception {
+   
+   // This test seems to be a little too unstable for a unit test
+   @Ignore
+   public void test() throws Exception {
      ZooKeeperInstance inst = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers());
      Connector c = inst.getConnector("root", new PasswordToken(passwd));
 -    
 +
      final String table = "foobar";
      c.tableOperations().create(table);
      


Mime
View raw message