HBASE-19385 [1.3] TestReplicator failed 1.3 nightly
This commit is contained in:
parent
fb3fee3414
commit
1e00673047
|
@ -22,6 +22,7 @@ import static org.junit.Assert.assertEquals;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
@ -97,6 +98,7 @@ public class TestReplicator extends TestReplicationBase {
|
||||||
Waiter.waitFor(conf1, 60000, new Waiter.ExplainingPredicate<Exception>() {
|
Waiter.waitFor(conf1, 60000, new Waiter.ExplainingPredicate<Exception>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean evaluate() throws Exception {
|
public boolean evaluate() throws Exception {
|
||||||
|
LOG.info("Count=" + ReplicationEndpointForTest.getBatchCount());
|
||||||
return ReplicationEndpointForTest.getBatchCount() >= NUM_ROWS;
|
return ReplicationEndpointForTest.getBatchCount() >= NUM_ROWS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +180,7 @@ public class TestReplicator extends TestReplicationBase {
|
||||||
|
|
||||||
public static class ReplicationEndpointForTest extends HBaseInterClusterReplicationEndpoint {
|
public static class ReplicationEndpointForTest extends HBaseInterClusterReplicationEndpoint {
|
||||||
|
|
||||||
private static int batchCount;
|
private static AtomicInteger batchCount = new AtomicInteger(0);
|
||||||
private static int entriesCount;
|
private static int entriesCount;
|
||||||
private static final Object latch = new Object();
|
private static final Object latch = new Object();
|
||||||
private static AtomicBoolean useLatch = new AtomicBoolean(false);
|
private static AtomicBoolean useLatch = new AtomicBoolean(false);
|
||||||
|
@ -197,17 +199,20 @@ public class TestReplicator extends TestReplicationBase {
|
||||||
public static void await() throws InterruptedException {
|
public static void await() throws InterruptedException {
|
||||||
if (useLatch.get()) {
|
if (useLatch.get()) {
|
||||||
LOG.info("Waiting on latch");
|
LOG.info("Waiting on latch");
|
||||||
latch.wait();
|
synchronized(latch) {
|
||||||
|
latch.wait();
|
||||||
|
}
|
||||||
LOG.info("Waited on latch, now proceeding");
|
LOG.info("Waited on latch, now proceeding");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getBatchCount() {
|
public static int getBatchCount() {
|
||||||
return batchCount;
|
return batchCount.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setBatchCount(int i) {
|
public static void setBatchCount(int i) {
|
||||||
batchCount = i;
|
LOG.info("SetBatchCount=" + i + ", old=" + getBatchCount());
|
||||||
|
batchCount.set(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getEntriesCount() {
|
public static int getEntriesCount() {
|
||||||
|
@ -215,6 +220,7 @@ public class TestReplicator extends TestReplicationBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setEntriesCount(int i) {
|
public static void setEntriesCount(int i) {
|
||||||
|
LOG.info("SetEntriesCount=" + i);
|
||||||
entriesCount = i;
|
entriesCount = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,8 +246,9 @@ public class TestReplicator extends TestReplicationBase {
|
||||||
super.replicateEntries(rrs, entries, replicationClusterId, baseNamespaceDir,
|
super.replicateEntries(rrs, entries, replicationClusterId, baseNamespaceDir,
|
||||||
hfileArchiveDir);
|
hfileArchiveDir);
|
||||||
entriesCount += entries.size();
|
entriesCount += entries.size();
|
||||||
batchCount++;
|
int count = batchCount.incrementAndGet();
|
||||||
LOG.info("Completed replicating batch " + System.identityHashCode(entries));
|
LOG.info("Completed replicating batch " + System.identityHashCode(entries) +
|
||||||
|
" count=" + count);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.info("Failed to replicate batch " + System.identityHashCode(entries), e);
|
LOG.info("Failed to replicate batch " + System.identityHashCode(entries), e);
|
||||||
throw e;
|
throw e;
|
||||||
|
|
Loading…
Reference in New Issue