View Javadoc

1   /**
2    *
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   *     http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  package org.apache.hadoop.hbase.client;
20  
21  import java.io.IOException;
22  import java.util.List;
23  
24  import org.apache.hadoop.hbase.classification.InterfaceAudience;
25  import org.apache.hadoop.hbase.classification.InterfaceStability;
26  
27  /**
28   * Used to communicate with a single HBase table.
29   * Obtain an instance from an {@link HConnection}.
30   *
31   * @since 0.21.0
32   * @deprecated use {@link org.apache.hadoop.hbase.client.Table} instead
33   */
34  @Deprecated
35  @InterfaceAudience.Private
36  @InterfaceStability.Stable
37  public interface HTableInterface extends Table {
38  
39    /**
40     * Gets the name of this table.
41     *
42     * @return the table name.
43     * @deprecated Use {@link #getName()} instead
44     */
45    @Deprecated
46    byte[] getTableName();
47  
48    /**
49     * @deprecated Use {@link #incrementColumnValue(byte[], byte[], byte[], long, Durability)}
50     */
51    @Deprecated
52    long incrementColumnValue(final byte [] row, final byte [] family,
53        final byte [] qualifier, final long amount, final boolean writeToWAL)
54    throws IOException;
55  
56    /**
57     * @deprecated Use {@link #existsAll(java.util.List)}  instead.
58     */
59    @Deprecated
60    Boolean[] exists(List<Get> gets) throws IOException;
61  
62  
63    /**
64     * See {@link #setAutoFlush(boolean, boolean)}
65     *
66     * @param autoFlush
67     *          Whether or not to enable 'auto-flush'.
68     * @deprecated in 0.96. When called with setAutoFlush(false), this function also
69     *  set clearBufferOnFail to true, which is unexpected but kept for historical reasons.
70     *  Replace it with setAutoFlush(false, false) if this is exactly what you want, or by
71     *  {@link #setAutoFlushTo(boolean)} for all other cases.
72     */
73    @Deprecated
74    void setAutoFlush(boolean autoFlush);
75  
76    /**
77     * Turns 'auto-flush' on or off.
78     * <p>
79     * When enabled (default), {@link Put} operations don't get buffered/delayed
80     * and are immediately executed. Failed operations are not retried. This is
81     * slower but safer.
82     * <p>
83     * Turning off {@code #autoFlush} means that multiple {@link Put}s will be
84     * accepted before any RPC is actually sent to do the write operations. If the
85     * application dies before pending writes get flushed to HBase, data will be
86     * lost.
87     * <p>
88     * When you turn {@code #autoFlush} off, you should also consider the
89     * {@code #clearBufferOnFail} option. By default, asynchronous {@link Put}
90     * requests will be retried on failure until successful. However, this can
91     * pollute the writeBuffer and slow down batching performance. Additionally,
92     * you may want to issue a number of Put requests and call
93     * {@link #flushCommits()} as a barrier. In both use cases, consider setting
94     * clearBufferOnFail to true to erase the buffer after {@link #flushCommits()}
95     * has been called, regardless of success.
96     * <p>
97     * In other words, if you call {@code #setAutoFlush(false)}; HBase will retry N time for each
98     *  flushCommit, including the last one when closing the table. This is NOT recommended,
99     *  most of the time you want to call {@code #setAutoFlush(false, true)}.
100    *
101    * @param autoFlush
102    *          Whether or not to enable 'auto-flush'.
103    * @param clearBufferOnFail
104    *          Whether to keep Put failures in the writeBuffer. If autoFlush is true, then
105    *          the value of this parameter is ignored and clearBufferOnFail is set to true.
106    *          Setting clearBufferOnFail to false is deprecated since 0.96.
107    * @deprecated in 0.99 since setting clearBufferOnFail is deprecated. Use
108    *  {@link #setAutoFlushTo(boolean)}} instead.
109    * @see #flushCommits
110    */
111   @Deprecated
112   void setAutoFlush(boolean autoFlush, boolean clearBufferOnFail);
113 
114   /**
115    * Return the row that matches <i>row</i> exactly,
116    * or the one that immediately precedes it.
117    *
118    * @param row A row key.
119    * @param family Column family to include in the {@link Result}.
120    * @throws IOException if a remote or network exception occurs.
121    * @since 0.20.0
122    *
123    * @deprecated As of version 0.92 this method is deprecated without
124    * replacement. Since version 0.96+, you can use reversed scan.
125    * getRowOrBefore is used internally to find entries in hbase:meta and makes
126    * various assumptions about the table (which are true for hbase:meta but not
127    * in general) to be efficient.
128    */
129   @Deprecated
130   Result getRowOrBefore(byte[] row, byte[] family) throws IOException;
131 }