001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.hadoop.hbase;
019
020import java.io.IOException;
021import org.apache.hadoop.conf.Configuration;
022import org.apache.hadoop.hbase.regionserver.HStore;
023import org.apache.hadoop.hbase.regionserver.StoreEngine;
024import org.apache.hadoop.hbase.regionserver.StripeStoreEngine;
025import org.apache.hadoop.hbase.testclassification.IntegrationTests;
026import org.apache.hadoop.hbase.util.HFileTestUtil;
027import org.apache.hadoop.util.ToolRunner;
028import org.junit.experimental.categories.Category;
029
030/**
031 * A test class that does the same things as IntegrationTestIngest but with stripe compactions. Can
032 * be used with ChaosMonkey in the same manner.
033 */
034@Category(IntegrationTests.class)
035public class IntegrationTestIngestStripeCompactions extends IntegrationTestIngest {
036  @Override
037  protected void initTable() throws IOException {
038    // Do the same as the LoadTestTool does, but with different table configuration.
039    HTableDescriptor htd = new HTableDescriptor(getTablename());
040    htd.setConfiguration(StoreEngine.STORE_ENGINE_CLASS_KEY, StripeStoreEngine.class.getName());
041    htd.setConfiguration(HStore.BLOCKING_STOREFILES_KEY, "100");
042    HColumnDescriptor hcd = new HColumnDescriptor(HFileTestUtil.DEFAULT_COLUMN_FAMILY);
043    HBaseTestingUtility.createPreSplitLoadTestTable(util.getConfiguration(), htd, hcd);
044  }
045
046  public static void main(String[] args) throws Exception {
047    Configuration conf = HBaseConfiguration.create();
048    IntegrationTestingUtility.setUseDistributedCluster(conf);
049    int ret = ToolRunner.run(conf, new IntegrationTestIngestStripeCompactions(), args);
050    System.exit(ret);
051  }
052}