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 */
018
019package org.apache.hadoop.hbase.client;
020
021import org.apache.yetus.audience.InterfaceAudience;
022
023/**
024 * Enum describing the durability guarantees for tables and {@link Mutation}s
025 * Note that the items must be sorted in order of increasing durability
026 */
027@InterfaceAudience.Public
028public enum Durability {
029  /* Developer note: Do not rename the enum field names. They are serialized in HTableDescriptor */
030  /**
031   * If this is for tables durability, use HBase's global default value (SYNC_WAL).
032   * Otherwise, if this is for mutation, use the table's default setting to determine durability.
033   * This must remain the first option.
034   */
035  USE_DEFAULT,
036  /**
037   * Do not write the Mutation to the WAL
038   */
039  SKIP_WAL,
040  /**
041   * Write the Mutation to the WAL asynchronously
042   */
043  ASYNC_WAL,
044  /**
045   * Write the Mutation to the WAL synchronously.
046   * The data is flushed to the filesystem implementation, but not necessarily to disk.
047   * For HDFS this will flush the data to the designated number of DataNodes.
048   * See <a href="https://issues.apache.org/jira/browse/HADOOP-6313">HADOOP-6313</a>
049   */
050  SYNC_WAL,
051  /**
052   * Write the Mutation to the WAL synchronously and force the entries to disk.
053   * See <a href="https://issues.apache.org/jira/browse/HADOOP-6313">HADOOP-6313</a>
054   */
055  FSYNC_WAL
056}