View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements. See the NOTICE file distributed with this
4    * work for additional information regarding copyright ownership. The ASF
5    * licenses this file to you under the Apache License, Version 2.0 (the
6    * "License"); you may not use this file except in compliance with the License.
7    * You may obtain a copy of the License at
8    *
9    * http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14   * License for the specific language governing permissions and limitations
15   * under the License.
16   */
17  package org.apache.hadoop.hbase.util;
18  
19  import java.util.ArrayList;
20  import java.util.Collection;
21  import java.util.List;
22  
23  import org.apache.hadoop.hbase.LargeTests;
24  import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
25  import org.junit.experimental.categories.Category;
26  import org.junit.runners.Parameterized.Parameters;
27  
28  /**
29   * Runs a load test on a mini HBase cluster with data block encoding turned on.
30   * Compared to other load-test-style unit tests, this one writes a smaller
31   * amount of data, but goes through all available data block encoding
32   * algorithms.
33   */
34  @Category(LargeTests.class)
35  public class TestMiniClusterLoadEncoded extends TestMiniClusterLoadParallel {
36  
37    /** We do not alternate the multi-put flag in this test. */
38    private static final boolean USE_MULTI_PUT = true;
39  
40    @Parameters
41    public static Collection<Object[]> parameters() {
42      List<Object[]> parameters = new ArrayList<Object[]>();
43      for (DataBlockEncoding dataBlockEncoding : DataBlockEncoding.values() ) {
44        parameters.add(new Object[]{dataBlockEncoding});
45      }
46      return parameters;
47    }
48  
49    public TestMiniClusterLoadEncoded(DataBlockEncoding encoding) {
50      super(USE_MULTI_PUT, encoding);
51    }
52  }