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.client;
019
020import org.apache.yetus.audience.InterfaceAudience;
021
022/**
023 * For creating {@link Table} instance.
024 * <p>
025 * The implementation should have default configurations set before returning the builder to user.
026 * So users are free to only set the configurations they care about to create a new
027 * Table instance.
028 */
029@InterfaceAudience.Public
030public interface TableBuilder {
031
032  /**
033   * Set timeout for a whole operation such as get, put or delete. Notice that scan will not be
034   * effected by this value, see scanTimeoutNs.
035   * <p>
036   * Operation timeout and max attempt times(or max retry times) are both limitations for retrying,
037   * we will stop retrying when we reach any of the limitations.
038   */
039  TableBuilder setOperationTimeout(int timeout);
040
041  /**
042   * Set timeout for each rpc request.
043   * <p>
044   * Notice that this will <strong>NOT</strong> change the rpc timeout for read(get, scan) request
045   * and write request(put, delete).
046   */
047  TableBuilder setRpcTimeout(int timeout);
048
049  /**
050   * Set timeout for each read(get, scan) rpc request.
051   */
052  TableBuilder setReadRpcTimeout(int timeout);
053
054  /**
055   * Set timeout for each write(put, delete) rpc request.
056   */
057  TableBuilder setWriteRpcTimeout(int timeout);
058
059  /**
060   * Create the {@link Table} instance.
061   */
062  Table build();
063}