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.stream.Stream;
021import org.apache.hadoop.hbase.HConstants;
022import org.apache.hadoop.hbase.testclassification.MediumTests;
023import org.apache.hadoop.hbase.testclassification.RegionServerTests;
024import org.junit.jupiter.api.AfterEach;
025import org.junit.jupiter.api.BeforeEach;
026import org.junit.jupiter.api.Tag;
027import org.junit.jupiter.params.ParameterizedClass;
028import org.junit.jupiter.params.provider.Arguments;
029import org.junit.jupiter.params.provider.MethodSource;
030
031@Tag(RegionServerTests.TAG)
032@Tag(MediumTests.TAG)
033@ParameterizedClass(name = "{index}: provider={0}")
034@MethodSource("parameters")
035public class TestCompressedWAL extends CompressedWALTestBase {
036
037  public String walProvider;
038
039  public TestCompressedWAL(String walProvider) {
040    this.walProvider = walProvider;
041  }
042
043  public static Stream<Arguments> parameters() {
044    return Stream.of(Arguments.of("defaultProvider"), Arguments.of("asyncfs"));
045  }
046
047  @BeforeEach
048  public void setUp() throws Exception {
049    TEST_UTIL.getConfiguration().set(WALFactory.WAL_PROVIDER, walProvider);
050    TEST_UTIL.getConfiguration().setBoolean(HConstants.ENABLE_WAL_COMPRESSION, true);
051    TEST_UTIL.startMiniDFSCluster(3);
052  }
053
054  @AfterEach
055  public void tearDown() throws Exception {
056    TEST_UTIL.shutdownMiniCluster();
057  }
058
059}