001 /**
002 *
003 * Copyright (c) 2005, European Commission project OneLab under contract 034819
004 * (http://www.one-lab.org)
005 *
006 * All rights reserved.
007 * Redistribution and use in source and binary forms, with or
008 * without modification, are permitted provided that the following
009 * conditions are met:
010 * - Redistributions of source code must retain the above copyright
011 * notice, this list of conditions and the following disclaimer.
012 * - Redistributions in binary form must reproduce the above copyright
013 * notice, this list of conditions and the following disclaimer in
014 * the documentation and/or other materials provided with the distribution.
015 * - Neither the name of the University Catholique de Louvain - UCL
016 * nor the names of its contributors may be used to endorse or
017 * promote products derived from this software without specific prior
018 * written permission.
019 *
020 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
021 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
022 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
023 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
024 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
025 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
026 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
027 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
028 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
029 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
030 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
031 * POSSIBILITY OF SUCH DAMAGE.
032 */
033
034 /**
035 * Licensed to the Apache Software Foundation (ASF) under one
036 * or more contributor license agreements. See the NOTICE file
037 * distributed with this work for additional information
038 * regarding copyright ownership. The ASF licenses this file
039 * to you under the Apache License, Version 2.0 (the
040 * "License"); you may not use this file except in compliance
041 * with the License. You may obtain a copy of the License at
042 *
043 * http://www.apache.org/licenses/LICENSE-2.0
044 *
045 * Unless required by applicable law or agreed to in writing, software
046 * distributed under the License is distributed on an "AS IS" BASIS,
047 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
048 * See the License for the specific language governing permissions and
049 * limitations under the License.
050 */
051 package org.apache.hadoop.util.bloom;
052
053 import org.apache.hadoop.classification.InterfaceAudience;
054 import org.apache.hadoop.classification.InterfaceStability;
055
056 /**
057 * Defines the different remove scheme for retouched Bloom filters.
058 * <p>
059 * Originally created by
060 * <a href="http://www.one-lab.org">European Commission One-Lab Project 034819</a>.
061 */
062 @InterfaceAudience.Public
063 @InterfaceStability.Stable
064 public interface RemoveScheme {
065 /**
066 * Random selection.
067 * <p>
068 * The idea is to randomly select a bit to reset.
069 */
070 public final static short RANDOM = 0;
071
072 /**
073 * MinimumFN Selection.
074 * <p>
075 * The idea is to select the bit to reset that will generate the minimum
076 * number of false negative.
077 */
078 public final static short MINIMUM_FN = 1;
079
080 /**
081 * MaximumFP Selection.
082 * <p>
083 * The idea is to select the bit to reset that will remove the maximum number
084 * of false positive.
085 */
086 public final static short MAXIMUM_FP = 2;
087
088 /**
089 * Ratio Selection.
090 * <p>
091 * The idea is to select the bit to reset that will, at the same time, remove
092 * the maximum number of false positve while minimizing the amount of false
093 * negative generated.
094 */
095 public final static short RATIO = 3;
096 }