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;
019
020import org.apache.yetus.audience.InterfaceAudience;
021
022/**
023 * Enum describing all possible memory compaction policies
024 */
025@InterfaceAudience.Public
026public enum MemoryCompactionPolicy {
027  /**
028   * No memory compaction, when size threshold is exceeded data is flushed to disk
029   */
030  NONE,
031  /**
032   * Basic policy applies optimizations which modify the index to a more compacted representation.
033   * This is beneficial in all access patterns. The smaller the cells are the greater the benefit of
034   * this policy. This is the default policy.
035   */
036  BASIC,
037  /**
038   * In addition to compacting the index representation as the basic policy, eager policy eliminates
039   * duplication while the data is still in memory (much like the on-disk compaction does after the
040   * data is flushed to disk). This policy is most useful for applications with high data churn or
041   * small working sets.
042   */
043  EAGER,
044  /**
045   * Adaptive compaction adapts to the workload. It applies either index compaction or data
046   * compaction based on the ratio of duplicate cells in the data.
047   */
048  ADAPTIVE
049
050}