HBase
  1. HBase
  2. HBASE-5198

PerformanceEvaluation --presplit option should not recreate TestTable if it exists

    Details

    • Type: Improvement Improvement
    • Status: Patch Available
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: util
    • Labels:
    • Release Note:
      --presplit option will not re-create TestTable if it already exists

      Description

      --presplit option was added in https://issues.apache.org/jira/browse/HBASE-4440
      It drops and re-creates TestTable if the table exists.
      This behavior in-consistent with previous ones. If TestTable exists, it shouldn't be re-created

        Issue Links

          Activity

          Hide
          Nick Dimiduk added a comment -

          Hi Sujee. I think having the tool drop and recreate a table in preparation for a test is a good think. I agree, it's surprising when the drop happens before a read test. Perhaps we can make more explicit the behavior when different arguments are provided?

          Show
          Nick Dimiduk added a comment - Hi Sujee. I think having the tool drop and recreate a table in preparation for a test is a good think. I agree, it's surprising when the drop happens before a read test. Perhaps we can make more explicit the behavior when different arguments are provided?
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12518090/PerformanceEvaluation_HBASE_5198_2.patch
          against trunk revision .

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 3 new or modified tests.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          -1 findbugs. The patch appears to introduce 160 new Findbugs (version 1.3.9) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed unit tests in .

          Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/1169//testReport/
          Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/1169//artifact/trunk/patchprocess/newPatchFindbugsWarnings.html
          Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/1169//console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12518090/PerformanceEvaluation_HBASE_5198_2.patch against trunk revision . +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. -1 findbugs. The patch appears to introduce 160 new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed unit tests in . Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/1169//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/1169//artifact/trunk/patchprocess/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/1169//console This message is automatically generated.
          Hide
          Sujee Maniyam added a comment -

          regenerated using --no-prefix option for git

          Show
          Sujee Maniyam added a comment - regenerated using --no-prefix option for git
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12517806/PerformanceEvaluation_HBASE_5198.patch
          against trunk revision .

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 3 new or modified tests.

          -1 patch. The patch command could not apply the patch.

          Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/1152//console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12517806/PerformanceEvaluation_HBASE_5198.patch against trunk revision . +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. -1 patch. The patch command could not apply the patch. Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/1152//console This message is automatically generated.
          Hide
          Sujee Maniyam added a comment -

          attachment : PerformanceEvaluation_HBASE_5198.patch

          Show
          Sujee Maniyam added a comment - attachment : PerformanceEvaluation_HBASE_5198.patch
          Hide
          Sujee Maniyam added a comment -

          diff --git a/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java b/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
          index 16c7653..c6a8ffa 100644
          — a/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
          +++ b/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
          @@ -466,29 +466,26 @@ public class PerformanceEvaluation {
          */
          private boolean checkTable(HBaseAdmin admin) throws IOException {
          HTableDescriptor tableDescriptor = getTableDescriptor();

          • if (this.presplitRegions > 0) {
          • // presplit requested
          • if (admin.tableExists(tableDescriptor.getName())) { - admin.disableTable(tableDescriptor.getName()); - admin.deleteTable(tableDescriptor.getName()); - }

            -

          • byte[][] splits = getSplits();
          • for (int i=0; i < splits.length; i++) { - LOG.debug(" split " + i + ": " + Bytes.toStringBinary(splits[i])); - }
          • admin.createTable(tableDescriptor, splits);
          • LOG.info ("Table created with " + this.presplitRegions + " splits");
          • }
          • else {
          • boolean tableExists = admin.tableExists(tableDescriptor.getName());
          • if (!tableExists) {
            + boolean tableExists = admin.tableExists(tableDescriptor.getName());
            + if (!tableExists) {
            + if (this.presplitRegions > 0)
            Unknown macro: {+ // presplit requested+ byte[][] splits = getSplits();+ for (int i = 0; i < splits.length; i++) { + LOG.debug(" split " + i + ": " + Bytes.toStringBinary(splits[i])); + }+ admin.createTable(tableDescriptor, splits);+ LOG.info("Table created with " + this.presplitRegions + " splits");+ }

            else

            { admin.createTable(tableDescriptor); LOG.info("Table " + tableDescriptor + " created"); }

            + } else if (this.presplitRegions > 0)

            { + // presplit option has no effect if table already exists + LOG.warn("Table '" + tableDescriptor.getNameAsString() + + "' already exists. --presplit option did not take effect"); }
          • boolean tableExists = admin.tableExists(tableDescriptor.getName());
          • return tableExists;
            + return admin.tableExists(tableDescriptor.getName());
            }

          protected HTableDescriptor getTableDescriptor() {

          Show
          Sujee Maniyam added a comment - diff --git a/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java b/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java index 16c7653..c6a8ffa 100644 — a/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java +++ b/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java @@ -466,29 +466,26 @@ public class PerformanceEvaluation { */ private boolean checkTable(HBaseAdmin admin) throws IOException { HTableDescriptor tableDescriptor = getTableDescriptor(); if (this.presplitRegions > 0) { // presplit requested if (admin.tableExists(tableDescriptor.getName())) { - admin.disableTable(tableDescriptor.getName()); - admin.deleteTable(tableDescriptor.getName()); - } - byte[][] splits = getSplits(); for (int i=0; i < splits.length; i++) { - LOG.debug(" split " + i + ": " + Bytes.toStringBinary(splits[i])); - } admin.createTable(tableDescriptor, splits); LOG.info ("Table created with " + this.presplitRegions + " splits"); } else { boolean tableExists = admin.tableExists(tableDescriptor.getName()); if (!tableExists) { + boolean tableExists = admin.tableExists(tableDescriptor.getName()); + if (!tableExists) { + if (this.presplitRegions > 0) Unknown macro: {+ // presplit requested+ byte[][] splits = getSplits();+ for (int i = 0; i < splits.length; i++) { + LOG.debug(" split " + i + ": " + Bytes.toStringBinary(splits[i])); + }+ admin.createTable(tableDescriptor, splits);+ LOG.info("Table created with " + this.presplitRegions + " splits");+ } else { admin.createTable(tableDescriptor); LOG.info("Table " + tableDescriptor + " created"); } + } else if (this.presplitRegions > 0) { + // presplit option has no effect if table already exists + LOG.warn("Table '" + tableDescriptor.getNameAsString() + + "' already exists. --presplit option did not take effect"); } boolean tableExists = admin.tableExists(tableDescriptor.getName()); return tableExists; + return admin.tableExists(tableDescriptor.getName()); } protected HTableDescriptor getTableDescriptor() {

            People

            • Assignee:
              Sujee Maniyam
              Reporter:
              Sujee Maniyam
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Development