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 order the 029 * 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 HFileCleaner by 036 * reflection, classes that implements this interface <b>must</b> provide a default constructor. 037 * </p> 038 */ 039@InterfaceAudience.Private 040public abstract class BaseHFileCleanerDelegate extends BaseFileCleanerDelegate { 041 042 private boolean stopped = false; 043 044 @Override 045 public void stop(String why) { 046 this.stopped = true; 047 } 048 049 @Override 050 public boolean isStopped() { 051 return this.stopped; 052 } 053}