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.master.cleaner;
019
020import org.apache.yetus.audience.InterfaceAudience;
021
022/**
023 * Base class for the hfile cleaning function inside the master. By default, only the
024 * {@link TimeToLiveHFileCleaner} is called.
025 * <p>
026 * If other effects are needed, implement your own HFileCleanerDelegate and add it to the
027 * configuration "hbase.master.hfilecleaner.plugins", which is a comma-separated list of fully
028 * qualified class names. The <code>HFileCleaner</code> will build the cleaner chain in
029 * order the order specified by the configuration.
030 * </p>
031 * <p>
032 * For subclasses, setConf will be called exactly <i>once</i> before using the cleaner.
033 * </p>
034 * <p>
035 * Since {@link BaseHFileCleanerDelegate HFileCleanerDelegates} are created in
036 * HFileCleaner by reflection, classes that implements this interface <b>must</b>
037 * provide a default constructor.
038 * </p>
039 */
040@InterfaceAudience.Private
041public abstract class BaseHFileCleanerDelegate extends BaseFileCleanerDelegate {
042
043  private boolean stopped = false;
044
045  @Override
046  public void stop(String why) {
047    this.stopped = true;
048  }
049
050  @Override
051  public boolean isStopped() {
052    return this.stopped;
053  }
054}