001/**
002 *
003 * Licensed to the Apache Software Foundation (ASF) under one
004 * or more contributor license agreements.  See the NOTICE file
005 * distributed with this work for additional information
006 * regarding copyright ownership.  The ASF licenses this file
007 * to you under the Apache License, Version 2.0 (the
008 * "License"); you may not use this file except in compliance
009 * with the License.  You may obtain a copy of the License at
010 *
011 *     http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 */
019package org.apache.hadoop.hbase.mob;
020
021import org.apache.hadoop.hbase.ArrayBackedTag;
022import org.apache.hadoop.hbase.HConstants;
023import org.apache.hadoop.hbase.Tag;
024import org.apache.hadoop.hbase.TagType;
025import org.apache.yetus.audience.InterfaceAudience;
026import org.apache.hadoop.hbase.util.Bytes;
027
028/**
029 * The constants used in mob.
030 */
031@InterfaceAudience.Public
032public final class MobConstants {
033
034  public static final String MOB_SCAN_RAW = "hbase.mob.scan.raw";
035  public static final String MOB_CACHE_BLOCKS = "hbase.mob.cache.blocks";
036  public static final String MOB_SCAN_REF_ONLY = "hbase.mob.scan.ref.only";
037  public static final String EMPTY_VALUE_ON_MOBCELL_MISS = "empty.value.on.mobcell.miss";
038
039  public static final String MOB_FILE_CACHE_SIZE_KEY = "hbase.mob.file.cache.size";
040  public static final int DEFAULT_MOB_FILE_CACHE_SIZE = 1000;
041
042  public static final String MOB_DIR_NAME = "mobdir";
043  public static final String MOB_REGION_NAME = ".mob";
044  public static final byte[] MOB_REGION_NAME_BYTES = Bytes.toBytes(MOB_REGION_NAME);
045
046  public static final String MOB_CLEANER_PERIOD = "hbase.master.mob.ttl.cleaner.period";
047  public static final int DEFAULT_MOB_CLEANER_PERIOD = 24 * 60 * 60; // one day
048
049  public static final String MOB_CACHE_EVICT_PERIOD = "hbase.mob.cache.evict.period";
050  public static final String MOB_CACHE_EVICT_REMAIN_RATIO = "hbase.mob.cache.evict.remain.ratio";
051  public static final Tag MOB_REF_TAG = new ArrayBackedTag(TagType.MOB_REFERENCE_TAG_TYPE,
052      HConstants.EMPTY_BYTE_ARRAY);
053
054  public static final float DEFAULT_EVICT_REMAIN_RATIO = 0.5f;
055  public static final long DEFAULT_MOB_CACHE_EVICT_PERIOD = 3600L;
056
057  public final static String TEMP_DIR_NAME = ".tmp";
058  public final static String BULKLOAD_DIR_NAME = ".bulkload";
059  public final static byte[] MOB_TABLE_LOCK_SUFFIX = Bytes.toBytes(".mobLock");
060  public final static String EMPTY_STRING = "";
061  /**
062   * If the size of a mob file is less than this value, it's regarded as a small file and needs to
063   * be merged in mob compaction. The default value is 1280MB.
064   */
065  public static final String MOB_COMPACTION_MERGEABLE_THRESHOLD =
066    "hbase.mob.compaction.mergeable.threshold";
067  public static final long DEFAULT_MOB_COMPACTION_MERGEABLE_THRESHOLD = 10 * 128 * 1024 * 1024;
068  /**
069   * The max number of del files that is allowed in the mob file compaction. In the mob
070   * compaction, when the number of existing del files is larger than this value, they are merged
071   * until number of del files is not larger this value. The default value is 3.
072   */
073  public static final String MOB_DELFILE_MAX_COUNT = "hbase.mob.delfile.max.count";
074  public static final int DEFAULT_MOB_DELFILE_MAX_COUNT = 3;
075  /**
076   * The max number of the mob files that is allowed in a batch of the mob compaction.
077   * The mob compaction merges the small mob files to bigger ones. If the number of the
078   * small files is very large, it could lead to a "too many opened file handlers" in the merge.
079   * And the merge has to be split into batches. This value limits the number of mob files
080   * that are selected in a batch of the mob compaction. The default value is 100.
081   */
082  public static final String MOB_COMPACTION_BATCH_SIZE =
083    "hbase.mob.compaction.batch.size";
084  public static final int DEFAULT_MOB_COMPACTION_BATCH_SIZE = 100;
085  /**
086   * The period that MobCompactionChore runs. The unit is second.
087   * The default value is one week.
088   */
089  public static final String MOB_COMPACTION_CHORE_PERIOD =
090    "hbase.mob.compaction.chore.period";
091  public static final int DEFAULT_MOB_COMPACTION_CHORE_PERIOD =
092    24 * 60 * 60 * 7; // a week
093  public static final String MOB_COMPACTOR_CLASS_KEY = "hbase.mob.compactor.class";
094  /**
095   * The max number of threads used in MobCompactor.
096   */
097  public static final String MOB_COMPACTION_THREADS_MAX =
098    "hbase.mob.compaction.threads.max";
099  public static final int DEFAULT_MOB_COMPACTION_THREADS_MAX = 1;
100  private MobConstants() {
101
102  }
103}