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.wal;
019
020import java.util.Arrays;
021import org.apache.hadoop.hbase.HBaseClassTestRule;
022import org.apache.hadoop.hbase.HConstants;
023import org.apache.hadoop.hbase.testclassification.MediumTests;
024import org.apache.hadoop.hbase.testclassification.RegionServerTests;
025import org.junit.After;
026import org.junit.Before;
027import org.junit.ClassRule;
028import org.junit.experimental.categories.Category;
029import org.junit.runner.RunWith;
030import org.junit.runners.Parameterized;
031import org.junit.runners.Parameterized.Parameter;
032import org.junit.runners.Parameterized.Parameters;
033
034@RunWith(Parameterized.class)
035@Category({ RegionServerTests.class, MediumTests.class })
036public class TestCompressedWAL extends CompressedWALTestBase {
037
038  @ClassRule
039  public static final HBaseClassTestRule CLASS_RULE =
040    HBaseClassTestRule.forClass(TestCompressedWAL.class);
041
042  @Parameter
043  public String walProvider;
044
045  @Parameters(name = "{index}: provider={0}")
046  public static Iterable<Object[]> data() {
047    return Arrays.asList(new Object[] { "defaultProvider" }, new Object[] { "asyncfs" });
048  }
049
050  @Before
051  public void setUp() throws Exception {
052    TEST_UTIL.getConfiguration().set(WALFactory.WAL_PROVIDER, walProvider);
053    TEST_UTIL.getConfiguration().setBoolean(HConstants.ENABLE_WAL_COMPRESSION, true);
054    TEST_UTIL.startMiniDFSCluster(3);
055  }
056
057  @After
058  public void tearDown() throws Exception {
059    TEST_UTIL.shutdownMiniCluster();
060  }
061
062}