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  /**
25   * Used to communicate with a single HBase table.
26   * Obtain an instance from an {@link HConnection}.
27   *
28   * @since 0.21.0
29   * @deprecated use {@link org.apache.hadoop.hbase.client.Table} instead
30   */
31  @Deprecated
32  public interface HTableInterface extends Table {
33  
34    /**
35     * Gets the name of this table.
36     *
37     * @return the table name.
38     * @deprecated Use {@link #getName()} instead
39     */
40    @Deprecated
41    byte[] getTableName();
42  
43    /**
44     * @deprecated Use {@link #incrementColumnValue(byte[], byte[], byte[], long, Durability)}
45     */
46    @Deprecated
47    long incrementColumnValue(final byte [] row, final byte [] family,
48        final byte [] qualifier, final long amount, final boolean writeToWAL)
49    throws IOException;
50  
51    /**
52     * @deprecated Use {@link #existsAll(java.util.List)}  instead.
53     */
54    @Deprecated
55    Boolean[] exists(List<Get> gets) throws IOException;
56  
57  
58    /**
59     * See {@link #setAutoFlush(boolean, boolean)}
60     *
61     * @param autoFlush
62     *          Whether or not to enable 'auto-flush'.
63     * @deprecated in 0.96. When called with setAutoFlush(false), this function also
64     *  set clearBufferOnFail to true, which is unexpected but kept for historical reasons.
65     *  Replace it with setAutoFlush(false, false) if this is exactly what you want, or by
66     *  {@link #setAutoFlushTo(boolean)} for all other cases.
67     */
68    @Deprecated
69    void setAutoFlush(boolean autoFlush);
70  
71    /**
72     * Turns 'auto-flush' on or off.
73     * <p>
74     * When enabled (default), {@link Put} operations don't get buffered/delayed
75     * and are immediately executed. Failed operations are not retried. This is
76     * slower but safer.
77     * <p>
78     * Turning off {@code #autoFlush} means that multiple {@link Put}s will be
79     * accepted before any RPC is actually sent to do the write operations. If the
80     * application dies before pending writes get flushed to HBase, data will be
81     * lost.
82     * <p>
83     * When you turn {@code #autoFlush} off, you should also consider the
84     * {@code #clearBufferOnFail} option. By default, asynchronous {@link Put}
85     * requests will be retried on failure until successful. However, this can
86     * pollute the writeBuffer and slow down batching performance. Additionally,
87     * you may want to issue a number of Put requests and call
88     * {@link #flushCommits()} as a barrier. In both use cases, consider setting
89     * clearBufferOnFail to true to erase the buffer after {@link #flushCommits()}
90     * has been called, regardless of success.
91     * <p>
92     * In other words, if you call {@code #setAutoFlush(false)}; HBase will retry N time for each
93     *  flushCommit, including the last one when closing the table. This is NOT recommended,
94     *  most of the time you want to call {@code #setAutoFlush(false, true)}.
95     *
96     * @param autoFlush
97     *          Whether or not to enable 'auto-flush'.
98     * @param clearBufferOnFail
99     *          Whether to keep Put failures in the writeBuffer. If autoFlush is true, then
100    *          the value of this parameter is ignored and clearBufferOnFail is set to true.
101    *          Setting clearBufferOnFail to false is deprecated since 0.96.
102    * @deprecated in 0.99 since setting clearBufferOnFail is deprecated. Use
103    *  {@link #setAutoFlushTo(boolean)}} instead.
104    * @see #flushCommits
105    */
106   @Deprecated
107   void setAutoFlush(boolean autoFlush, boolean clearBufferOnFail);
108 
109   /**
110    * Return the row that matches <i>row</i> exactly,
111    * or the one that immediately precedes it.
112    *
113    * @param row A row key.
114    * @param family Column family to include in the {@link Result}.
115    * @throws IOException if a remote or network exception occurs.
116    * @since 0.20.0
117    *
118    * @deprecated As of version 0.92 this method is deprecated without
119    * replacement. Since version 0.96+, you can use reversed scan.
120    * getRowOrBefore is used internally to find entries in hbase:meta and makes
121    * various assumptions about the table (which are true for hbase:meta but not
122    * in general) to be efficient.
123    */
124   @Deprecated
125   Result getRowOrBefore(byte[] row, byte[] family) throws IOException;
126 }