git commit: HBASE-12084 Remove deprecated APIs from Result - shell addendum

2014-09-25 Thread anoopsamjohn
Repository: hbase
Updated Branches:
  refs/heads/master 78d532e5f - 375fc1efe


HBASE-12084 Remove deprecated APIs from Result - shell addendum


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/375fc1ef
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/375fc1ef
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/375fc1ef

Branch: refs/heads/master
Commit: 375fc1efe3f542243e18a581ea0daee1d27d5d87
Parents: 78d532e
Author: anoopsjohn anoopsamj...@gmail.com
Authored: Fri Sep 26 10:04:58 2014 +0530
Committer: anoopsjohn anoopsamj...@gmail.com
Committed: Fri Sep 26 10:04:58 2014 +0530

--
 hbase-shell/src/main/ruby/hbase/table.rb  | 18 +-
 hbase-shell/src/main/ruby/shell/commands/grant.rb |  2 +-
 .../main/ruby/shell/commands/set_visibility.rb|  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/375fc1ef/hbase-shell/src/main/ruby/hbase/table.rb
--
diff --git a/hbase-shell/src/main/ruby/hbase/table.rb 
b/hbase-shell/src/main/ruby/hbase/table.rb
index cc4f2a7..da0295b 100644
--- a/hbase-shell/src/main/ruby/hbase/table.rb
+++ b/hbase-shell/src/main/ruby/hbase/table.rb
@@ -355,12 +355,12 @@ EOF
 
   # Print out results.  Result can be Cell or RowResult.
   res = {}
-  result.list.each do |kv|
-family = String.from_java_bytes(kv.getFamily)
-qualifier = 
org.apache.hadoop.hbase.util.Bytes::toStringBinary(kv.getQualifier)
+  result.listCells.each do |c|
+family = String.from_java_bytes(c.getFamily)
+qualifier = 
org.apache.hadoop.hbase.util.Bytes::toStringBinary(c.getQualifier)
 
 column = #{family}:#{qualifier}
-value = to_string(column, kv, maxlength)
+value = to_string(column, c, maxlength)
 
 if block_given?
   yield(column, value)
@@ -387,7 +387,7 @@ EOF
   return nil if result.isEmpty
 
   # Fetch cell value
-  cell = result.list[0]
+  cell = result.listCells[0]
   org.apache.hadoop.hbase.util.Bytes::toLong(cell.getValue)
 end
 
@@ -481,12 +481,12 @@ EOF
 row = iter.next
 key = org.apache.hadoop.hbase.util.Bytes::toStringBinary(row.getRow)
 
-row.list.each do |kv|
-  family = String.from_java_bytes(kv.getFamily)
-  qualifier = 
org.apache.hadoop.hbase.util.Bytes::toStringBinary(kv.getQualifier)
+row.listCells.each do |c|
+  family = String.from_java_bytes(c.getFamily)
+  qualifier = 
org.apache.hadoop.hbase.util.Bytes::toStringBinary(c.getQualifier)
 
   column = #{family}:#{qualifier}
-  cell = to_string(column, kv, maxlength)
+  cell = to_string(column, c, maxlength)
 
   if block_given?
 yield(key, column=#{column}, #{cell})

http://git-wip-us.apache.org/repos/asf/hbase/blob/375fc1ef/hbase-shell/src/main/ruby/shell/commands/grant.rb
--
diff --git a/hbase-shell/src/main/ruby/shell/commands/grant.rb 
b/hbase-shell/src/main/ruby/shell/commands/grant.rb
index 89fdde6..43fb720 100644
--- a/hbase-shell/src/main/ruby/shell/commands/grant.rb
+++ b/hbase-shell/src/main/ruby/shell/commands/grant.rb
@@ -92,7 +92,7 @@ EOF
   iter = scanner.iterator
   while iter.hasNext
 row = iter.next
-row.list.each do |cell|
+row.listCells.each do |cell|
   put = org.apache.hadoop.hbase.client.Put.new(row.getRow)
   put.add(cell)
   t.set_cell_permissions(put, permissions)

http://git-wip-us.apache.org/repos/asf/hbase/blob/375fc1ef/hbase-shell/src/main/ruby/shell/commands/set_visibility.rb
--
diff --git a/hbase-shell/src/main/ruby/shell/commands/set_visibility.rb 
b/hbase-shell/src/main/ruby/shell/commands/set_visibility.rb
index b2b57b1..cdb7724 100644
--- a/hbase-shell/src/main/ruby/shell/commands/set_visibility.rb
+++ b/hbase-shell/src/main/ruby/shell/commands/set_visibility.rb
@@ -57,7 +57,7 @@ EOF
 iter = scanner.iterator
 while iter.hasNext
   row = iter.next
-  row.list.each do |cell|
+  row.listCells.each do |cell|
 put = org.apache.hadoop.hbase.client.Put.new(row.getRow)
 put.add(cell)
 t.set_cell_visibility(put, visibility)



git commit: HBASE-12084 Remove deprecated APIs from Result.

2014-09-24 Thread anoopsamjohn
Repository: hbase
Updated Branches:
  refs/heads/master 011bc0441 - 1b5e6daef


HBASE-12084 Remove deprecated APIs from Result.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/1b5e6dae
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/1b5e6dae
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/1b5e6dae

Branch: refs/heads/master
Commit: 1b5e6daef20550309efaa9b165b0c8d8bb9cb4f8
Parents: 011bc04
Author: anoopsjohn anoopsamj...@gmail.com
Authored: Thu Sep 25 07:36:15 2014 +0530
Committer: anoopsjohn anoopsamj...@gmail.com
Committed: Thu Sep 25 07:36:15 2014 +0530

--
 .../org/apache/hadoop/hbase/client/Result.java  | 77 
 .../client/coprocessor/AggregationClient.java   |  4 +-
 .../hbase/master/TableNamespaceManager.java |  2 +-
 .../hadoop/hbase/client/TestFromClientSide.java | 24 +++---
 .../regionserver/TestScannerWithBulkload.java   | 49 +++--
 5 files changed, 40 insertions(+), 116 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/1b5e6dae/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java
index 9392490..a041b91 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java
@@ -107,23 +107,6 @@ public class Result implements CellScannable, CellScanner {
   }
 
   /**
-   * @deprecated Use {@link #create(List)} instead.
-   */
-  @Deprecated
-  public Result(KeyValue [] cells) {
-this.cells = cells;
-  }
-
-  /**
-   * @deprecated Use {@link #create(List)} instead.
-   */
-  @Deprecated
-  public Result(ListKeyValue kvs) {
-// TODO: Here we presume the passed in Cells are KVs.  One day this won't 
always be so.
-this(kvs.toArray(new Cell[kvs.size()]), null, false);
-  }
-
-  /**
* Instantiate a Result with the specified List of KeyValues.
* brstrongNote:/strong You must ensure that the keyvalues are already 
sorted.
* @param cells List of cells
@@ -203,25 +186,6 @@ public class Result implements CellScannable, CellScanner {
   }
 
   /**
-   * Return an cells of a Result as an array of KeyValues
-   *
-   * WARNING do not use, expensive.  This does an arraycopy of the cell[]'s 
value.
-   *
-   * Added to ease transition from  0.94 - 0.96.
-   *
-   * @deprecated as of 0.96, use {@link #rawCells()}
-   * @return array of KeyValues, empty array if nothing in result.
-   */
-  @Deprecated
-  public KeyValue[] raw() {
-KeyValue[] kvs = new KeyValue[cells.length];
-for (int i = 0 ; i  kvs.length; i++) {
-  kvs[i] = KeyValueUtil.ensureKeyValue(cells[i]);
-}
-return kvs;
-  }
-
-  /**
* Create a sorted list of the Cell's in this result.
*
* Since HBase 0.20.5 this is equivalent to raw().
@@ -233,29 +197,6 @@ public class Result implements CellScannable, CellScanner {
   }
 
   /**
-   * Return an cells of a Result as an array of KeyValues
-   *
-   * WARNING do not use, expensive.  This does  an arraycopy of the cell[]'s 
value.
-   *
-   * Added to ease transition from  0.94 - 0.96.
-   *
-   * @deprecated as of 0.96, use {@link #listCells()}
-   * @return all sorted List of KeyValues; can be null if no cells in the 
result
-   */
-  @Deprecated
-  public ListKeyValue list() {
-return isEmpty() ? null : Arrays.asList(raw());
-  }
-
-  /**
-   * @deprecated Use {@link #getColumnCells(byte[], byte[])} instead.
-   */
-  @Deprecated
-  public ListKeyValue getColumn(byte [] family, byte [] qualifier) {
-return KeyValueUtil.ensureKeyValues(getColumnCells(family, qualifier));
-  }
-
-  /**
* Return the Cells for the specific column.  The Cells are sorted in
* the {@link KeyValue#COMPARATOR} order.  That implies the first entry in
* the list is the most recent column.  If the query (Scan or Get) only
@@ -358,14 +299,6 @@ public class Result implements CellScannable, CellScanner {
   }
 
   /**
-   * @deprecated Use {@link #getColumnLatestCell(byte[], byte[])} instead.
-   */
-  @Deprecated
-  public KeyValue getColumnLatest(byte [] family, byte [] qualifier) {
-return KeyValueUtil.ensureKeyValue(getColumnLatestCell(family, qualifier));
-  }
-
-  /**
* The Cell for the most recent timestamp for a given column.
*
* @param family
@@ -390,16 +323,6 @@ public class Result implements CellScannable, CellScanner {
   }
 
   /**
-   * @deprecated Use {@link #getColumnLatestCell(byte[], int, int, byte[], 
int, int)} instead.
-   */
-  @Deprecated
-  public KeyValue getColumnLatest(byte [] family, int foffset, int flength,
-  byte