From cfb19f627e671fb86cfc2ea6ff991995e214b7e6 Mon Sep 17 00:00:00 2001 From: stack Date: Mon, 13 Oct 2014 09:31:09 -0700 Subject: [PATCH] javadoc cleanup and test debug --- .../java/org/apache/hadoop/hbase/client/Admin.java | 2 +- .../org/apache/hadoop/hbase/client/HBaseAdmin.java | 7 +++---- .../apache/hadoop/hbase/protobuf/ProtobufUtil.java | 2 +- .../hadoop/hbase/master/TestSplitLogManager.java | 24 +++++++++++----------- .../replication/TestReplicationSmallTests.java | 15 ++++++++------ 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java index 7bf1357..3e36d96 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java @@ -55,7 +55,7 @@ import java.util.Map; import java.util.regex.Pattern; /** - * The administrative API for HBase. Obtain an instance from an {@link HConnection}. + * The administrative API for HBase. Obtain an instance from a {@link Connection}. * * @since 0.99.0 */ diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index 79c2eb1..c6d5e2e 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -36,8 +36,6 @@ import java.util.regex.Pattern; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hbase.classification.InterfaceAudience; -import org.apache.hadoop.hbase.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.ClusterStatus; @@ -62,6 +60,8 @@ import org.apache.hadoop.hbase.TableNotEnabledException; import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.UnknownRegionException; import org.apache.hadoop.hbase.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.classification.InterfaceStability; import org.apache.hadoop.hbase.client.MetaScanner.MetaScannerVisitor; import org.apache.hadoop.hbase.client.MetaScanner.MetaScannerVisitorBase; import org.apache.hadoop.hbase.exceptions.DeserializationException; @@ -128,7 +128,6 @@ import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.MoveRegionRequest import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.RestoreSnapshotRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.RestoreSnapshotResponse; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetBalancerRunningRequest; -import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ShutdownRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SnapshotRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SnapshotResponse; @@ -3710,7 +3709,7 @@ public class HBaseAdmin implements Admin { * MyCallResponse response = service.myCall(null, request); * * - * @param the server name to which the endpoint call is made + * @param sn the server name to which the endpoint call is made * @return A RegionServerCoprocessorRpcChannel instance */ @Override diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java index ed3ce67..fd9d1ab 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java @@ -1625,7 +1625,7 @@ public final class ProtobufUtil { * Make a region server endpoint call * @param client * @param call - * @return + * @return CoprocessorServiceResponse * @throws IOException */ public static CoprocessorServiceResponse execRegionServerService( diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java index 8a9c64d..5847b93 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java @@ -273,7 +273,7 @@ public class TestSplitLogManager { * Test whether the splitlog correctly creates a task in zookeeper * @throws Exception */ - @Test + @Test (timeout=180000) public void testTaskCreation() throws Exception { LOG.info("TestTaskCreation - test the creation of a task in zk"); @@ -288,7 +288,7 @@ public class TestSplitLogManager { assertTrue(slt.isUnassigned(DUMMY_MASTER)); } - @Test + @Test (timeout=180000) public void testOrphanTaskAcquisition() throws Exception { LOG.info("TestOrphanTaskAcquisition"); @@ -312,7 +312,7 @@ public class TestSplitLogManager { waitForCounter(tot_mgr_rescan, 0, 1, to + to/2); } - @Test + @Test (timeout=180000) public void testUnassignedOrphan() throws Exception { LOG.info("TestUnassignedOrphan - an unassigned task is resubmitted at" + " startup"); @@ -341,7 +341,7 @@ public class TestSplitLogManager { assertTrue(ZKUtil.checkExists(zkw, tasknode) > version); } - @Test + @Test (timeout=180000) public void testMultipleResubmits() throws Exception { LOG.info("TestMultipleResbmits - no indefinite resubmissions"); conf.setInt("hbase.splitlog.max.resubmit", 2); @@ -373,7 +373,7 @@ public class TestSplitLogManager { assertEquals(2L, tot_mgr_resubmit.get() - tot_mgr_resubmit_force.get()); } - @Test + @Test (timeout=180000) public void testRescanCleanup() throws Exception { LOG.info("TestRescanCleanup - ensure RESCAN nodes are cleaned up"); @@ -402,7 +402,7 @@ public class TestSplitLogManager { waitForCounter(tot_mgr_rescan_deleted, 0, 1, to/2); } - @Test + @Test (timeout=180000) public void testTaskDone() throws Exception { LOG.info("TestTaskDone - cleanup task node once in DONE state"); @@ -421,7 +421,7 @@ public class TestSplitLogManager { assertTrue(ZKUtil.checkExists(zkw, tasknode) == -1); } - @Test + @Test (timeout=180000) public void testTaskErr() throws Exception { LOG.info("TestTaskErr - cleanup task node once in ERR state"); @@ -444,7 +444,7 @@ public class TestSplitLogManager { conf.setInt("hbase.splitlog.max.resubmit", ZKSplitLogManagerCoordination.DEFAULT_MAX_RESUBMIT); } - @Test + @Test (timeout=180000) public void testTaskResigned() throws Exception { LOG.info("TestTaskResigned - resubmit task node once in RESIGNED state"); assertEquals(tot_mgr_resubmit.get(), 0); @@ -470,7 +470,7 @@ public class TestSplitLogManager { assertTrue(slt.isUnassigned(DUMMY_MASTER)); } - @Test + @Test (timeout=180000) public void testUnassignedTimeout() throws Exception { LOG.info("TestUnassignedTimeout - iff all tasks are unassigned then" + " resubmit"); @@ -506,7 +506,7 @@ public class TestSplitLogManager { waitForCounter(tot_mgr_resubmit_unassigned, 0, 1, 2 * to + to/2); } - @Test + @Test (timeout=180000) public void testDeadWorker() throws Exception { LOG.info("testDeadWorker"); @@ -534,7 +534,7 @@ public class TestSplitLogManager { return; } - @Test + @Test (timeout=180000) public void testWorkerCrash() throws Exception { slm = new SplitLogManager(ds, conf, stopper, master, DUMMY_MASTER); TaskBatch batch = new TaskBatch(); @@ -558,7 +558,7 @@ public class TestSplitLogManager { Assert.assertEquals(1, tot_mgr_resubmit.get()); } - @Test + @Test (timeout=180000) public void testEmptyLogDir() throws Exception { LOG.info("testEmptyLogDir"); slm = new SplitLogManager(ds, conf, stopper, master, DUMMY_MASTER); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java index d698255..b61b19a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java @@ -384,7 +384,8 @@ public class TestReplicationSmallTests extends TestReplicationBase { * @throws Exception */ @Test(timeout=300000) - public void loadTesting() throws Exception { + public void testLoading() throws Exception { + LOG.info("Writing out rows to table1 in testLoading"); htable1.setWriteBufferSize(1024); htable1.setAutoFlush(false, true); for (int i = 0; i < NB_ROWS_IN_BIG_BATCH; i++) { @@ -402,16 +403,18 @@ public class TestReplicationSmallTests extends TestReplicationBase { assertEquals(NB_ROWS_IN_BIG_BATCH, res.length); - + LOG.info("Looking in table2 for replicated rows in testLoading"); long start = System.currentTimeMillis(); - for (int i = 0; i < NB_RETRIES; i++) { + // Retry more than NB_RETRIES. As it was, retries were done in 5 seconds and we'd fail + // sometimes. + final long retries = NB_RETRIES * 10; + for (int i = 0; i < retries; i++) { scan = new Scan(); - scanner = htable2.getScanner(scan); res = scanner.next(NB_ROWS_IN_BIG_BATCH); scanner.close(); if (res.length != NB_ROWS_IN_BIG_BATCH) { - if (i == NB_RETRIES - 1) { + if (i == retries - 1) { int lastRow = -1; for (Result result : res) { int currentRow = Bytes.toInt(result.getRow()); @@ -425,7 +428,7 @@ public class TestReplicationSmallTests extends TestReplicationBase { res.length + " instead of " + NB_ROWS_IN_BIG_BATCH + "; waited=" + (System.currentTimeMillis() - start) + "ms"); } else { - LOG.info("Only got " + res.length + " rows"); + LOG.info("Only got " + res.length + " rows... retrying"); Thread.sleep(SLEEP_TIME); } } else { -- 1.8.5.2 (Apple Git-48)