hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [1/6] hbase git commit: Amend HBASE-13005 TestDeleteTableHandler failing in 0.98 hadoop 1 builds
Date Fri, 13 Feb 2015 20:38:02 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.94 0dcb39828 -> 71be2f036
  refs/heads/0.98 6507ddecb -> b8d45562e
  refs/heads/branch-1 3c068c11f -> 911432a7c
  refs/heads/branch-1.0 9b8f4805d -> 285729cc9
  refs/heads/master a98898cf4 -> 76a3b50f1


Amend HBASE-13005 TestDeleteTableHandler failing in 0.98 hadoop 1 builds

Remove the unit test to clean up build issues with the Hadoop 1 jobs
while retaining the functionality. Few if any users are still on
Hadoop 1, the test does pass on the Hadoop 2 build, the functionality
reads correct after code review, and it fixes a real problem.


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

Branch: refs/heads/0.98
Commit: a6e4b3ba33b5dba4096ac29b2fddb13e208cee31
Parents: 6507dde
Author: Andrew Purtell <apurtell@apache.org>
Authored: Fri Feb 13 12:27:56 2015 -0800
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Fri Feb 13 12:27:59 2015 -0800

----------------------------------------------------------------------
 .../master/handler/TestDeleteTableHandler.java  | 120 -------------------
 1 file changed, 120 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/a6e4b3ba/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestDeleteTableHandler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestDeleteTableHandler.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestDeleteTableHandler.java
deleted file mode 100644
index 60ad2f2..0000000
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestDeleteTableHandler.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.hbase.master.handler;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-
-import org.apache.hadoop.hbase.HBaseTestingUtility;
-import org.apache.hadoop.hbase.HColumnDescriptor;
-import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HTableDescriptor;
-import org.apache.hadoop.hbase.testclassification.MediumTests;
-import org.apache.hadoop.hbase.TableName;
-import org.apache.hadoop.hbase.catalog.MetaReader;
-import org.apache.hadoop.hbase.client.Delete;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
-import org.apache.hadoop.hbase.client.HTable;
-import org.apache.hadoop.hbase.client.Result;
-import org.apache.hadoop.hbase.client.ResultScanner;
-import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.util.Bytes;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(MediumTests.class)
-public class TestDeleteTableHandler {
-  private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
-  private static final byte[] FAMILYNAME = Bytes.toBytes("fam");
-
-  @Before
-  public void setUp() throws Exception {
-    TEST_UTIL.startMiniCluster(1);
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    TEST_UTIL.shutdownMiniCluster();
-  }
-
-  /**
-   * We were only clearing rows that had a hregioninfo column in hbase:meta.  Mangled rows
that
-   * were missing the hregioninfo because of error were being left behind messing up any
-   * subsequent table made with the same name. HBASE-12980
-   * @throws IOException
-   * @throws InterruptedException
-   */
-  @Test(timeout=60000)
-  public void testDeleteForSureClearsAllTableRowsFromMeta()
-  throws IOException, InterruptedException {
-    // Create a test table
-    final TableName tableName = TableName.valueOf("testDeleteForSureClearsAllTableRowsFromMeta");
-    final HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
-    final HTableDescriptor desc = new HTableDescriptor(tableName);
-    desc.addFamily(new HColumnDescriptor(FAMILYNAME));
-    admin.createTable(desc, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE);
-
-    // Now I have a nice table, mangle it by removing the HConstants.REGIONINFO_QUALIFIER_STR
-    // content from a few of the rows.
-    Scan metaScannerForMyTable = MetaReader.getScanForTableName(tableName);
-    HTable metaTable = new HTable(TEST_UTIL.getConfiguration(), TableName.META_TABLE_NAME);
-    try {
-      ResultScanner scanner = metaTable.getScanner(metaScannerForMyTable);
-      try {
-        for (Result result : scanner) {
-          // Just delete one row.
-          Delete d = new Delete(result.getRow());
-          d.deleteColumn(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER);
-          metaTable.delete(d);
-          break;
-        }
-      } finally {
-        scanner.close();
-      }
-    } finally {
-      metaTable.close();
-    }
-
-    // Now delete the table
-    admin.disableTable(tableName);
-    TEST_UTIL.waitTableDisabled(tableName.getName());
-    admin.deleteTable(tableName);
-
-    // Check that all META rows for the deleted table have really been removed
-    metaTable = new HTable(TEST_UTIL.getConfiguration(), TableName.META_TABLE_NAME);
-    int rowCount = 0;
-    try {
-      ResultScanner scanner = metaTable.getScanner(metaScannerForMyTable);
-      try {
-        for (Result result : scanner) {
-          rowCount++;
-        }
-      } finally {
-        scanner.close();
-      }
-    } finally {
-      metaTable.close();
-    }
-    assertEquals(0, rowCount);
-  }
-}
-


Mime
View raw message