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 */
018
019package org.apache.hadoop.hbase;
020
021import java.io.IOException;
022
023import org.apache.hadoop.conf.Configuration;
024import org.apache.hadoop.hbase.regionserver.HStore;
025import org.apache.hadoop.hbase.regionserver.StoreEngine;
026import org.apache.hadoop.hbase.regionserver.StripeStoreEngine;
027import org.apache.hadoop.hbase.testclassification.IntegrationTests;
028import org.apache.hadoop.hbase.util.HFileTestUtil;
029import org.apache.hadoop.util.ToolRunner;
030import org.junit.experimental.categories.Category;
031
032/**
033 * A test class that does the same things as IntegrationTestIngest but with stripe
034 * compactions. Can be used with ChaosMonkey in the same manner.
035 */
036@Category(IntegrationTests.class)
037public class IntegrationTestIngestStripeCompactions extends IntegrationTestIngest {
038  @Override
039  protected void initTable() throws IOException {
040    // Do the same as the LoadTestTool does, but with different table configuration.
041    HTableDescriptor htd = new HTableDescriptor(getTablename());
042    htd.setConfiguration(StoreEngine.STORE_ENGINE_CLASS_KEY, StripeStoreEngine.class.getName());
043    htd.setConfiguration(HStore.BLOCKING_STOREFILES_KEY, "100");
044    HColumnDescriptor hcd = new HColumnDescriptor(HFileTestUtil.DEFAULT_COLUMN_FAMILY);
045    HBaseTestingUtility.createPreSplitLoadTestTable(util.getConfiguration(), htd, hcd);
046  }
047
048  public static void main(String[] args) throws Exception {
049    Configuration conf = HBaseConfiguration.create();
050    IntegrationTestingUtility.setUseDistributedCluster(conf);
051    int ret = ToolRunner.run(conf, new IntegrationTestIngestStripeCompactions(), args);
052    System.exit(ret);
053  }
054}