Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 27E2D200BD2 for ; Fri, 18 Nov 2016 19:56:08 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 26A0A160B04; Fri, 18 Nov 2016 18:56:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 371DC160B19 for ; Fri, 18 Nov 2016 19:56:06 +0100 (CET) Received: (qmail 39929 invoked by uid 500); 18 Nov 2016 18:55:59 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 37059 invoked by uid 99); 18 Nov 2016 18:55:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Nov 2016 18:55:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7206EF1596; Fri, 18 Nov 2016 18:55:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: stack@apache.org To: commits@hbase.apache.org Date: Fri, 18 Nov 2016 18:56:30 -0000 Message-Id: In-Reply-To: <71d1e1d206dc41a7b8b041b4ba6d5329@git.apache.org> References: <71d1e1d206dc41a7b8b041b4ba6d5329@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [35/51] [partial] hbase-site git commit: HBASE-17121 Undo the building of xref as part of site build; remove xref dirs archived-at: Fri, 18 Nov 2016 18:56:08 -0000 http://git-wip-us.apache.org/repos/asf/hbase-site/blob/7b604147/xref-test/org/apache/hadoop/hbase/IntegrationTestingUtility.html ---------------------------------------------------------------------- diff --git a/xref-test/org/apache/hadoop/hbase/IntegrationTestingUtility.html b/xref-test/org/apache/hadoop/hbase/IntegrationTestingUtility.html deleted file mode 100644 index b97b80a..0000000 --- a/xref-test/org/apache/hadoop/hbase/IntegrationTestingUtility.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - -IntegrationTestingUtility xref - - - -
-
-1   /**
-2    * Licensed to the Apache Software Foundation (ASF) under one
-3    * or more contributor license agreements.  See the NOTICE file
-4    * distributed with this work for additional information
-5    * regarding copyright ownership.  The ASF licenses this file
-6    * to you under the Apache License, Version 2.0 (the
-7    * "License"); you may not use this file except in compliance
-8    * with the License.  You may obtain a copy of the License at
-9    *
-10   *     http://www.apache.org/licenses/LICENSE-2.0
-11   *
-12   * Unless required by applicable law or agreed to in writing, software
-13   * distributed under the License is distributed on an "AS IS" BASIS,
-14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-15   * See the License for the specific language governing permissions and
-16   * limitations under the License.
-17   */
-18  
-19  package org.apache.hadoop.hbase;
-20  
-21  import java.io.IOException;
-22  
-23  import org.apache.hadoop.conf.Configuration;
-24  import org.apache.hadoop.util.ReflectionUtils;
-25  
-26  /**
-27   * Facility for <strong>integration/system</strong> tests. This extends {@link HBaseTestingUtility}
-28   * and adds-in the functionality needed by integration and system tests. This class understands
-29   * distributed and pseudo-distributed/local cluster deployments, and abstracts those from the tests
-30   * in this module.
-31   * <p>
-32   * IntegrationTestingUtility is constructed and used by the integration tests, but the tests
-33   * themselves should not assume a particular deployment. They can rely on the methods in this
-34   * class and HBaseCluster. Before the testing begins, the test should initialize the cluster by
-35   * calling {@link #initializeCluster(int)}.
-36   * <p>
-37   * The cluster that is used defaults to a mini cluster, but it can be forced to use a distributed
-38   * cluster by calling {@link #setUseDistributedCluster(Configuration)}. This method is invoked by
-39   * test drivers (maven, IntegrationTestsDriver, etc) before initializing the cluster
-40   * via {@link #initializeCluster(int)}. Individual tests should not directly call
-41   * {@link #setUseDistributedCluster(Configuration)}.
-42   */
-43  public class IntegrationTestingUtility extends HBaseTestingUtility {
-44  
-45    public IntegrationTestingUtility() {
-46      this(HBaseConfiguration.create());
-47    }
-48  
-49    public IntegrationTestingUtility(Configuration conf) {
-50      super(conf);
-51    }
-52  
-53    /**
-54     * Configuration that controls whether this utility assumes a running/deployed cluster.
-55     * This is different than "hbase.cluster.distributed" since that parameter indicates whether the
-56     * cluster is in an actual distributed environment, while this shows that there is a
-57     * deployed (distributed or pseudo-distributed) cluster running, and we do not need to
-58     * start a mini-cluster for tests.
-59     */
-60    public static final String IS_DISTRIBUTED_CLUSTER = "hbase.test.cluster.distributed";
-61  
-62    /** Config for pluggable hbase cluster manager */
-63    private static final String HBASE_CLUSTER_MANAGER_CLASS = "hbase.it.clustermanager.class";
-64    private static final Class<? extends ClusterManager> DEFAULT_HBASE_CLUSTER_MANAGER_CLASS = 
-65      HBaseClusterManager.class;
-66    
-67    /**
-68     * Initializes the state of the cluster. It starts a new in-process mini cluster, OR
-69     * if we are given an already deployed distributed cluster it initializes the state.
-70     * @param numSlaves Number of slaves to start up if we are booting a mini cluster. Otherwise
-71     * we check whether this many nodes are available and throw an exception if not.
-72     */
-73    public void initializeCluster(int numSlaves) throws Exception {
-74      if (isDistributedCluster()) {
-75        createDistributedHBaseCluster();
-76        checkNodeCount(numSlaves);
-77      } else {
-78        startMiniCluster(numSlaves);
-79      }
-80    }
-81  
-82    /**
-83     * Checks whether we have more than numSlaves nodes. Throws an
-84     * exception otherwise.
-85     */
-86    public void checkNodeCount(int numSlaves) throws Exception {
-87      HBaseCluster cluster = getHBaseClusterInterface();
-88      if (cluster.getClusterStatus().getServers().size() < numSlaves) {
-89        throw new Exception("Cluster does not have enough nodes:" + numSlaves);
-90      }
-91    }
-92  
-93    /**
-94     * Restores the cluster to the initial state if it is a distributed cluster, otherwise, shutdowns the
-95     * mini cluster.
-96     */
-97    public void restoreCluster() throws IOException {
-98      if (isDistributedCluster()) {
-99        getHBaseClusterInterface().restoreInitialStatus();
-100     } else {
-101       try {
-102         shutdownMiniCluster();
-103       } catch (Exception e) {
-104         // re-wrap into IOException
-105         throw new IOException(e);
-106       }
-107     }
-108   }
-109 
-110   /**
-111    * Sets the configuration property to use a distributed cluster for the integration tests. Test drivers
-112    * should use this to enforce cluster deployment.
-113    */
-114   public static void setUseDistributedCluster(Configuration conf) {
-115     conf.setBoolean(IS_DISTRIBUTED_CLUSTER, true);
-116     System.setProperty(IS_DISTRIBUTED_CLUSTER, "true");
-117   }
-118 
-119   /**
-120    * @return whether we are interacting with a distributed cluster as opposed to and in-process mini
-121    * cluster or a local cluster.
-122    * @see IntegrationTestingUtility#setUseDistributedCluster(Configuration)
-123    */
-124   public boolean isDistributedCluster() {
-125     Configuration conf = getConfiguration();
-126     boolean isDistributedCluster = false;
-127     isDistributedCluster = Boolean.parseBoolean(System.getProperty(IS_DISTRIBUTED_CLUSTER, "false"));
-128     if (!isDistributedCluster) {
-129       isDistributedCluster = conf.getBoolean(IS_DISTRIBUTED_CLUSTER, false);
-130     }
-131     return isDistributedCluster;
-132   }
-133 
-134   public void createDistributedHBaseCluster() throws IOException {
-135     Configuration conf = getConfiguration();
-136     Class<? extends ClusterManager> clusterManagerClass = conf.getClass(HBASE_CLUSTER_MANAGER_CLASS,
-137       DEFAULT_HBASE_CLUSTER_MANAGER_CLASS, ClusterManager.class);
-138     ClusterManager clusterManager = ReflectionUtils.newInstance(
-139       clusterManagerClass, conf);
-140     setHBaseCluster(new DistributedHBaseCluster(conf, clusterManager));
-141     getHBaseAdmin();
-142   }
-143 
-144 }
-
-
- - http://git-wip-us.apache.org/repos/asf/hbase-site/blob/7b604147/xref-test/org/apache/hadoop/hbase/IntegrationTestsDriver.html ---------------------------------------------------------------------- diff --git a/xref-test/org/apache/hadoop/hbase/IntegrationTestsDriver.html b/xref-test/org/apache/hadoop/hbase/IntegrationTestsDriver.html deleted file mode 100644 index 410b914..0000000 --- a/xref-test/org/apache/hadoop/hbase/IntegrationTestsDriver.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - -IntegrationTestsDriver xref - - - -
-
-1   /**
-2    * Licensed to the Apache Software Foundation (ASF) under one
-3    * or more contributor license agreements.  See the NOTICE file
-4    * distributed with this work for additional information
-5    * regarding copyright ownership.  The ASF licenses this file
-6    * to you under the Apache License, Version 2.0 (the
-7    * "License"); you may not use this file except in compliance
-8    * with the License.  You may obtain a copy of the License at
-9    *
-10   *     http://www.apache.org/licenses/LICENSE-2.0
-11   *
-12   * Unless required by applicable law or agreed to in writing, software
-13   * distributed under the License is distributed on an "AS IS" BASIS,
-14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-15   * See the License for the specific language governing permissions and
-16   * limitations under the License.
-17   */
-18  
-19  package org.apache.hadoop.hbase;
-20  
-21  import java.io.IOException;
-22  import java.util.Set;
-23  import java.util.regex.Pattern;
-24  
-25  import org.apache.commons.cli.CommandLine;
-26  import org.apache.commons.logging.Log;
-27  import org.apache.commons.logging.LogFactory;
-28  import org.apache.hadoop.hbase.testclassification.IntegrationTests;
-29  import org.apache.hadoop.hbase.util.AbstractHBaseTool;
-30  import org.apache.hadoop.util.ToolRunner;
-31  import org.junit.internal.TextListener;
-32  import org.junit.runner.JUnitCore;
-33  import org.junit.runner.Result;
-34  
-35  /**
-36   * This class drives the Integration test suite execution. Executes all
-37   * tests having @Category(IntegrationTests.class) annotation against an
-38   * already deployed distributed cluster.
-39   */
-40  public class IntegrationTestsDriver extends AbstractHBaseTool {
-41    private static final String SHORT_REGEX_ARG = "r";
-42    private static final String LONG_REGEX_ARG = "regex";
-43    private static final Log LOG = LogFactory.getLog(IntegrationTestsDriver.class);
-44    private IntegrationTestFilter intTestFilter = new IntegrationTestFilter();
-45  
-46    public static void main(String[] args) throws Exception {
-47      int ret = ToolRunner.run(new IntegrationTestsDriver(), args);
-48      System.exit(ret);
-49    }
-50  
-51    private class IntegrationTestFilter extends ClassTestFinder.TestClassFilter {
-52      private Pattern testFilterRe = Pattern.compile(".*\\.IntegrationTest.*");
-53      public IntegrationTestFilter() {
-54        super(IntegrationTests.class);
-55      }
-56  
-57      public void setPattern(String pattern) {
-58        testFilterRe = Pattern.compile(pattern);
-59      }
-60  
-61      @Override
-62      public boolean isCandidateClass(Class<?> c) {
-63        return testFilterRe.matcher(c.getName()).find() &&
-64          // Our pattern will match the below NON-IntegrationTest. Rather than
-65          // do exotic regex, just filter it out here
-66          !c.getName().contains("IntegrationTestingUtility") &&
-67          super.isCandidateClass(c);
-68      }
-69    }
-70  
-71    @Override
-72    protected void addOptions() {
-73      addOptWithArg(SHORT_REGEX_ARG, LONG_REGEX_ARG,
-74        "Java regex to use selecting tests to run: e.g. .*TestBig.*" +
-75        " will select all tests that include TestBig in their name.  Default: " +
-76        ".*IntegrationTest.*");
-77    }
-78  
-79    @Override
-80    protected void processOptions(CommandLine cmd) {
-81      String testFilterString = cmd.getOptionValue(SHORT_REGEX_ARG, null);
-82      if (testFilterString != null) {
-83        intTestFilter.setPattern(testFilterString);
-84      }
-85    }
-86  
-87    /**
-88     * Returns test classes annotated with @Category(IntegrationTests.class),
-89     * according to the filter specific on the command line (if any).
-90     */
-91    private Class<?>[] findIntegrationTestClasses()
-92      throws ClassNotFoundException, LinkageError, IOException {
-93      ClassTestFinder.TestFileNameFilter nameFilter = new ClassTestFinder.TestFileNameFilter();
-94      ClassFinder classFinder = new ClassFinder(nameFilter, nameFilter, intTestFilter);
-95      Set<Class<?>> classes = classFinder.findClasses(true);
-96      return classes.toArray(new Class<?>[classes.size()]);
-97    }
-98  
-99  
-100   @Override
-101   protected int doWork() throws Exception {
-102     //this is called from the command line, so we should set to use the distributed cluster
-103     IntegrationTestingUtility.setUseDistributedCluster(conf);
-104     Class<?>[] classes = findIntegrationTestClasses();
-105     LOG.info("Found " + classes.length + " integration tests to run:");
-106     for (Class<?> aClass : classes) {
-107       LOG.info("  " + aClass);
-108     }
-109     JUnitCore junit = new JUnitCore();
-110     junit.addListener(new TextListener(System.out));
-111     Result result = junit.run(classes);
-112 
-113     return result.wasSuccessful() ? 0 : 1;
-114   }
-115 }
-
-
- - http://git-wip-us.apache.org/repos/asf/hbase-site/blob/7b604147/xref-test/org/apache/hadoop/hbase/MetaMockingUtil.html ---------------------------------------------------------------------- diff --git a/xref-test/org/apache/hadoop/hbase/MetaMockingUtil.html b/xref-test/org/apache/hadoop/hbase/MetaMockingUtil.html deleted file mode 100644 index 8aabc0d..0000000 --- a/xref-test/org/apache/hadoop/hbase/MetaMockingUtil.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - -MetaMockingUtil xref - - - -
-
-1   /**
-2    * Licensed to the Apache Software Foundation (ASF) under one
-3    * or more contributor license agreements.  See the NOTICE file
-4    * distributed with this work for additional information
-5    * regarding copyright ownership.  The ASF licenses this file
-6    * to you under the Apache License, Version 2.0 (the
-7    * "License"); you may not use this file except in compliance
-8    * with the License.  You may obtain a copy of the License at
-9    *
-10   *     http://www.apache.org/licenses/LICENSE-2.0
-11   *
-12   * Unless required by applicable law or agreed to in writing, software
-13   * distributed under the License is distributed on an "AS IS" BASIS,
-14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-15   * See the License for the specific language governing permissions and
-16   * limitations under the License.
-17   */
-18  
-19  package org.apache.hadoop.hbase;
-20  
-21  import java.io.IOException;
-22  import java.util.ArrayList;
-23  import java.util.Collections;
-24  import java.util.List;
-25  
-26  import org.apache.hadoop.hbase.client.Result;
-27  import org.apache.hadoop.hbase.util.Bytes;
-28  
-29  /**
-30   * Mocking utility for common hbase:meta functionality
-31   */
-32  public class MetaMockingUtil {
-33  
-34    /**
-35     * Returns a Result object constructed from the given region information simulating
-36     * a catalog table result.
-37     * @param region the HRegionInfo object or null
-38     * @return A mocked up Result that fakes a Get on a row in the <code>hbase:meta</code> table.
-39     * @throws IOException
-40     */
-41    public static Result getMetaTableRowResult(final HRegionInfo region)
-42        throws IOException {
-43      return getMetaTableRowResult(region, null, null, null);
-44    }
-45  
-46    /**
-47     * Returns a Result object constructed from the given region information simulating
-48     * a catalog table result.
-49     * @param region the HRegionInfo object or null
-50     * @param sn to use making startcode and server hostname:port in meta or null
-51     * @return A mocked up Result that fakes a Get on a row in the <code>hbase:meta</code> table.
-52     * @throws IOException
-53     */
-54    public static Result getMetaTableRowResult(final HRegionInfo region, final ServerName sn)
-55        throws IOException {
-56      return getMetaTableRowResult(region, sn, null, null);
-57    }
-58  
-59    /**
-60     * Returns a Result object constructed from the given region information simulating
-61     * a catalog table result.
-62     * @param region the HRegionInfo object or null
-63     * @param sn to use making startcode and server hostname:port in meta or null
-64     * @param splita daughter region or null
-65     * @param splitb  daughter region or null
-66     * @return A mocked up Result that fakes a Get on a row in the <code>hbase:meta</code> table.
-67     * @throws IOException
-68     */
-69    public static Result getMetaTableRowResult(HRegionInfo region, final ServerName sn,
-70        HRegionInfo splita, HRegionInfo splitb) throws IOException {
-71      List<Cell> kvs = new ArrayList<Cell>();
-72      if (region != null) {
-73        kvs.add(new KeyValue(
-74          region.getRegionName(),
-75          HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER,
-76          region.toByteArray()));
-77      }
-78  
-79      if (sn != null) {
-80        kvs.add(new KeyValue(region.getRegionName(),
-81          HConstants.CATALOG_FAMILY, HConstants.SERVER_QUALIFIER,
-82          Bytes.toBytes(sn.getHostAndPort())));
-83        kvs.add(new KeyValue(region.getRegionName(),
-84          HConstants.CATALOG_FAMILY, HConstants.STARTCODE_QUALIFIER,
-85          Bytes.toBytes(sn.getStartcode())));
-86      }
-87  
-88      if (splita != null) {
-89        kvs.add(new KeyValue(
-90            region.getRegionName(),
-91            HConstants.CATALOG_FAMILY, HConstants.SPLITA_QUALIFIER,
-92            splita.toByteArray()));
-93      }
-94  
-95      if (splitb != null) {
-96        kvs.add(new KeyValue(
-97            region.getRegionName(),
-98            HConstants.CATALOG_FAMILY, HConstants.SPLITB_QUALIFIER,
-99            splitb.toByteArray()));
-100     }
-101 
-102     //important: sort the kvs so that binary search work
-103     Collections.sort(kvs, CellComparator.META_COMPARATOR);
-104 
-105     return Result.create(kvs);
-106   }
-107 
-108   /**
-109    * @param sn  ServerName to use making startcode and server in meta
-110    * @param hri Region to serialize into HRegionInfo
-111    * @return A mocked up Result that fakes a Get on a row in the <code>hbase:meta</code> table.
-112    * @throws IOException
-113    */
-114   public static Result getMetaTableRowResultAsSplitRegion(final HRegionInfo hri,
-115       final ServerName sn) throws IOException {
-116     hri.setOffline(true);
-117     hri.setSplit(true);
-118     return getMetaTableRowResult(hri, sn);
-119   }
-120 
-121 }
-
-
- -