From f1e7597df8e6d01da676d0376644b8bc98ca2b80 Mon Sep 17 00:00:00 2001
From: Ashish Singhi
NOTE: This class replaces the functionality that used to be available via - * {@link HTableInterface#setAutoFlush(boolean)} set to {@code false}. + *HTableInterface#setAutoFlush(boolean) set to {@code false}. *
* *See also the {@code BufferedMutatorExample} in the hbase-examples module.
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorImpl.java index 249edec..b492414 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorImpl.java @@ -247,7 +247,7 @@ public class BufferedMutatorImpl implements BufferedMutator { } /** - * This is used for legacy purposes in {@link HTable#getWriteBuffer()} only. This should not beÓ + * This is used for legacy purposes only. This should not beÓ * called from production uses. * @deprecated Going away when we drop public support for {@link HTableInterface}. Ó */ diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java index 686aaa8..4efe1ef 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.NavigableMap; import java.util.TreeMap; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; @@ -38,14 +37,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeyValueUtil; -import org.apache.hadoop.hbase.MetaTableAccessor; -import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.classification.InterfaceAudience; @@ -241,123 +236,6 @@ public class HTable implements HTableInterface { } /** - * Tells whether or not a table is enabled or not. This method creates a - * new HBase configuration, so it might make your unit tests fail due to - * incorrect ZK client port. - * @param tableName Name of table to check. - * @return {@code true} if table is online. - * @throws IOException if a remote or network exception occurs - * @deprecated use {@link HBaseAdmin#isTableEnabled(byte[])} - */ - @Deprecated - public static boolean isTableEnabled(String tableName) throws IOException { - return isTableEnabled(TableName.valueOf(tableName)); - } - - /** - * Tells whether or not a table is enabled or not. This method creates a - * new HBase configuration, so it might make your unit tests fail due to - * incorrect ZK client port. - * @param tableName Name of table to check. - * @return {@code true} if table is online. - * @throws IOException if a remote or network exception occurs - * @deprecated use {@link HBaseAdmin#isTableEnabled(byte[])} - */ - @Deprecated - public static boolean isTableEnabled(byte[] tableName) throws IOException { - return isTableEnabled(TableName.valueOf(tableName)); - } - - /** - * Tells whether or not a table is enabled or not. This method creates a - * new HBase configuration, so it might make your unit tests fail due to - * incorrect ZK client port. - * @param tableName Name of table to check. - * @return {@code true} if table is online. - * @throws IOException if a remote or network exception occurs - * @deprecated use {@link HBaseAdmin#isTableEnabled(byte[])} - */ - @Deprecated - public static boolean isTableEnabled(TableName tableName) throws IOException { - return isTableEnabled(HBaseConfiguration.create(), tableName); - } - - /** - * Tells whether or not a table is enabled or not. - * @param conf The Configuration object to use. - * @param tableName Name of table to check. - * @return {@code true} if table is online. - * @throws IOException if a remote or network exception occurs - * @deprecated use {@link HBaseAdmin#isTableEnabled(byte[])} - */ - @Deprecated - public static boolean isTableEnabled(Configuration conf, String tableName) - throws IOException { - return isTableEnabled(conf, TableName.valueOf(tableName)); - } - - /** - * Tells whether or not a table is enabled or not. - * @param conf The Configuration object to use. - * @param tableName Name of table to check. - * @return {@code true} if table is online. - * @throws IOException if a remote or network exception occurs - * @deprecated use {@link HBaseAdmin#isTableEnabled(byte[])} - */ - @Deprecated - public static boolean isTableEnabled(Configuration conf, byte[] tableName) - throws IOException { - return isTableEnabled(conf, TableName.valueOf(tableName)); - } - - /** - * Tells whether or not a table is enabled or not. - * @param conf The Configuration object to use. - * @param tableName Name of table to check. - * @return {@code true} if table is online. - * @throws IOException if a remote or network exception occurs - * @deprecated use {@link HBaseAdmin#isTableEnabled(org.apache.hadoop.hbase.TableName tableName)} - */ - @Deprecated - public static boolean isTableEnabled(Configuration conf, - final TableName tableName) throws IOException { - try(Connection conn = ConnectionFactory.createConnection(conf)) { - return conn.getAdmin().isTableEnabled(tableName); - } - } - - /** - * Find region location hosting passed row using cached info - * @param row Row to find. - * @return The location of the given row. - * @throws IOException if a remote or network exception occurs - * @deprecated Use {@link RegionLocator#getRegionLocation(byte[])} - */ - @Deprecated - public HRegionLocation getRegionLocation(final String row) - throws IOException { - return getRegionLocation(Bytes.toBytes(row), false); - } - - /** - * @deprecated Use {@link RegionLocator#getRegionLocation(byte[])} instead. - */ - @Deprecated - public HRegionLocation getRegionLocation(final byte [] row) - throws IOException { - return locator.getRegionLocation(row); - } - - /** - * @deprecated Use {@link RegionLocator#getRegionLocation(byte[], boolean)} instead. - */ - @Deprecated - public HRegionLocation getRegionLocation(final byte [] row, boolean reload) - throws IOException { - return locator.getRegionLocation(row, reload); - } - - /** * {@inheritDoc} */ @Override @@ -384,15 +262,6 @@ public class HTable implements HTableInterface { } /** - * Kept in 0.96 for backward compatibility - * @deprecated since 0.96. This is an internal buffer that should not be read nor write. - */ - @Deprecated - public List
- * This is mainly useful for the MapReduce integration.
- * @return A map of HRegionInfo with it's server address
- * @throws IOException if a remote or network exception occurs
- * @deprecated This is no longer a public API. Use {@link #getAllRegionLocations()} instead.
- */
- @SuppressWarnings("deprecation")
- @Deprecated
- public NavigableMap
- * This is mainly useful for the MapReduce integration.
- * @return A map of HRegionInfo with it's server address
- * @throws IOException if a remote or network exception occurs
- *
- * @deprecated Use {@link RegionLocator#getAllRegionLocations()} instead;
- */
- @Deprecated
- public List
- * @param startKey Starting row in range, inclusive
- * @param endKey Ending row in range, exclusive
- * @return A list of HRegionLocations corresponding to the regions that
- * contain the specified range
- * @throws IOException if a remote or network exception occurs
- * @deprecated This is no longer a public API
- */
- @Deprecated
- public List
- * @param startKey Starting row in range, inclusive
- * @param endKey Ending row in range, exclusive
- * @param reload true to reload information or false to use cached information
- * @return A list of HRegionLocations corresponding to the regions that
- * contain the specified range
- * @throws IOException if a remote or network exception occurs
- * @deprecated This is no longer a public API
- */
- @Deprecated
- public List
@@ -529,9 +311,7 @@ public class HTable implements HTableInterface {
* @return A pair of list of start keys and list of HRegionLocations that
* contain the specified range
* @throws IOException if a remote or network exception occurs
- * @deprecated This is no longer a public API
*/
- @Deprecated
private Pair
* When enabled (default), {@link Put} operations don't get buffered/delayed
@@ -96,8 +75,7 @@ public interface HTableInterface extends Table {
* Whether to keep Put failures in the writeBuffer. If autoFlush is true, then
* the value of this parameter is ignored and clearBufferOnFail is set to true.
* Setting clearBufferOnFail to false is deprecated since 0.96.
- * @deprecated in 0.99 since setting clearBufferOnFail is deprecated. Use
- * {@link #setAutoFlush(boolean)}} instead.
+ * @deprecated in 0.99 since setting clearBufferOnFail is deprecated.
* @see BufferedMutator#flush()
*/
@Deprecated
@@ -105,8 +83,8 @@ public interface HTableInterface extends Table {
/**
* Set the autoFlush behavior, without changing the value of {@code clearBufferOnFail}.
- * @deprecated in 0.99 since setting clearBufferOnFail is deprecated. Use
- * {@link #setAutoFlush(boolean)} instead, or better still, move on to {@link BufferedMutator}
+ * @deprecated in 0.99 since setting clearBufferOnFail is deprecated. Move on to
+ * {@link BufferedMutator}
*/
@Deprecated
void setAutoFlushTo(boolean autoFlush);
@@ -157,23 +135,4 @@ public interface HTableInterface extends Table {
*/
@Deprecated
void setWriteBufferSize(long writeBufferSize) throws IOException;
-
-
- /**
- * Return the row that matches row exactly,
- * or the one that immediately precedes it.
- *
- * @param row A row key.
- * @param family Column family to include in the {@link Result}.
- * @throws IOException if a remote or network exception occurs.
- * @since 0.20.0
- *
- * @deprecated As of version 0.92 this method is deprecated without
- * replacement. Since version 0.96+, you can use reversed scan.
- * getRowOrBefore is used internally to find entries in hbase:meta and makes
- * various assumptions about the table (which are true for hbase:meta but not
- * in general) to be efficient.
- */
- @Deprecated
- Result getRowOrBefore(byte[] row, byte[] family) throws IOException;
}
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java
index 498c587..7fc4f89 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java
@@ -120,21 +120,6 @@ public interface Table extends Closeable {
InterruptedException;
/**
- * Same as {@link #batch(List, Object[])}, but returns an array of
- * results instead of using a results parameter reference.
- *
- * @param actions list of Get, Put, Delete, Increment, Append objects
- * @return the results from the actions. A null in the return array means that
- * the call for that action failed, even after retries
- * @throws IOException
- * @since 0.90.0
- * @deprecated If any exception is thrown by one of the actions, there is no way to
- * retrieve the partially executed results. Use {@link #batch(List, Object[])} instead.
- */
- @Deprecated
- Object[] batch(final List extends Row> actions) throws IOException, InterruptedException;
-
- /**
* Same as {@link #batch(List, Object[])}, but with a callback.
* @since 0.96.0
*/
@@ -144,7 +129,6 @@ public interface Table extends Closeable {
throws IOException, InterruptedException;
/**
- * Same as {@link #batch(List)}, but with a callback.
*
* @since 0.96.0
* @deprecated If any exception is thrown by one of the actions, there is no way to retrieve the
@@ -219,7 +203,7 @@ public interface Table extends Closeable {
/**
* Puts some data in the table.
- *
+ *
* @param put The data to put.
* @throws IOException if a remote or network exception occurs.
* @since 0.20.0
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java
index 1460de4..8340f97 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java
@@ -867,7 +867,7 @@ public class TestAsyncProcess {
MyAsyncProcess ap = new MyAsyncProcess(con, conf, con.nbThreads);
ht.multiAp = ap;
- ht.batch(gets, new Object[gets.size()]);
+ ht.batch(gets, null);
Assert.assertEquals(ap.nbActions.get(), NB_REGS);
Assert.assertEquals("1 multi response per server", 2, ap.nbMultiResponse.get());
diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
index 2d122df..0dc7f39 100644
--- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
+++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
@@ -792,11 +792,6 @@ public class RemoteHTable implements Table {
}
@Override
- public Object[] batch(List extends Row> actions) throws IOException {
- throw new IOException("batch not supported");
- }
-
- @Override
public , List
, List
Table Regions
";
@@ -128,7 +131,7 @@ if ( fqtn != null ) {
} else {
tableHeader = "Name Region Server Start Key End Key Locality Requests ReplicaID Table Regions
<%} else {
Admin admin = master.getConnection().getAdmin();
+ RegionLocator r = master.getConnection().getRegionLocator(table.getName());
try { %>
";
}
- if ( !readOnly && action != null ) {
+ if ( !readOnly && action != null ) {
%>
Name Region Server Start Key End Key Locality Requests Table Attributes
@@ -256,7 +260,7 @@ if ( fqtn != null ) {
<%
Map
<%
MapProperty
- Value
+ Value
Regions by Region Server
<%
- for (Map.EntryRegion Server Region Count
@@ -399,8 +403,8 @@ Actions:
<% } %>
-<% }
-} else { // handle the case for fqtn is null with error message + redirect
+<% }
+} else { // handle the case for fqtn is null with error message + redirect
%>