accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mjwall <...@git.apache.org>
Subject [GitHub] accumulo pull request #107: ACCUMULO-4157 Bug fix for removing WALs to quick...
Date Fri, 03 Jun 2016 13:14:57 GMT
Github user mjwall commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/107#discussion_r65704590
  
    --- Diff: server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogsTest.java
---
    @@ -234,4 +257,288 @@ public void testIsUUID() {
         assertFalse(GarbageCollectWriteAheadLogs.isUUID("0" + UUID.randomUUID().toString()));
         assertFalse(GarbageCollectWriteAheadLogs.isUUID(null));
       }
    +
    +  @Test
    +  public void testTimeToDeleteTrue() throws InterruptedException {
    +    gcwal.clearFirstSeenDead();
    +    HostAndPort address = HostAndPort.fromString("tserver1:9998");
    +    long wait = AccumuloConfiguration.getTimeInMillis("1s");
    +    gcwal.timeToDelete(address, wait); // to store first seen dead
    +    sleep(wait * 2);
    +    assertTrue(gcwal.timeToDelete(address, wait));
    +  }
    +
    +  @Test
    +  public void testTimeToDeleteFalse() {
    +    HostAndPort address = HostAndPort.fromString("tserver1:9998");
    +    long wait = AccumuloConfiguration.getTimeInMillis("1h");
    +    long t1, t2;
    +    boolean ttd;
    +    do {
    +      t1 = System.nanoTime();
    +      gcwal.clearFirstSeenDead();
    +      gcwal.timeToDelete(address, wait);
    +      ttd = gcwal.timeToDelete(address, wait);
    +      t2 = System.nanoTime();
    +    } while (t2 - t1 > (wait / 2) * 1000000); // as long as it took less than half
of the configured wait
    --- End diff --
    
    yep, will change


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message