hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r599534 - in /lucene/hadoop/trunk/src/contrib/hbase: CHANGES.txt src/java/org/apache/hadoop/hbase/HTable.java src/test/org/apache/hadoop/hbase/TestHTable.java
Date Thu, 29 Nov 2007 18:25:40 GMT
Author: stack
Date: Thu Nov 29 10:25:39 2007
New Revision: 599534

URL: http://svn.apache.org/viewvc?rev=599534&view=rev
Log:
HADOOP-2198 HTable should have method to return table metadata

Modified:
    lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HTable.java
    lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestHTable.java

Modified: lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt?rev=599534&r1=599533&r2=599534&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt Thu Nov 29 10:25:39 2007
@@ -41,27 +41,29 @@
                (Bryan Duxbury via Stack)
 
   IMPROVEMENTS
-    HADOOP-2401 Add convenience put method that takes writable
-                (Johan Oskarsson via Stack)
-    HADOOP-2074 Simple switch to enable DEBUG level-logging in hbase
-    HADOOP-2088 Make hbase runnable in $HADOOP_HOME/build(/contrib/hbase)
-    HADOOP-2126 Use Bob Jenkins' hash for bloom filters
-    HADOOP-2157 Make Scanners implement Iterable
-    HADOOP-2176 Htable.deleteAll documentation is ambiguous
-    HADOOP-2139 (phase 1) Increase parallelism in region servers.
-    HADOOP-2267 [Hbase Shell] Change the prompt's title from 'hbase' to 'hql'.
-                (Edward Yoon via Stack)
-    HADOOP-2139 (phase 2) Make region server more event driven
-    HADOOP-2289 Useless efforts of looking for the non-existant table in select
-                command.
-                (Edward Yoon via Stack)
-    HADOOP-2257 Show a total of all requests and regions on the web ui
-                (Paul Saab via Stack)
-    HADOOP-2261 HTable.abort no longer throws exception if there is no active update.
-    HADOOP-2287 Make hbase unit tests take less time to complete.
-    HADOOP-2262 Retry n times instead of n**2 times.
-    HADOOP-1608 Relational Algrebra Operators
-                (Edward Yoon via Stack)
+   HADOOP-2401 Add convenience put method that takes writable
+               (Johan Oskarsson via Stack)
+   HADOOP-2074 Simple switch to enable DEBUG level-logging in hbase
+   HADOOP-2088 Make hbase runnable in $HADOOP_HOME/build(/contrib/hbase)
+   HADOOP-2126 Use Bob Jenkins' hash for bloom filters
+   HADOOP-2157 Make Scanners implement Iterable
+   HADOOP-2176 Htable.deleteAll documentation is ambiguous
+   HADOOP-2139 (phase 1) Increase parallelism in region servers.
+   HADOOP-2267 [Hbase Shell] Change the prompt's title from 'hbase' to 'hql'.
+               (Edward Yoon via Stack)
+   HADOOP-2139 (phase 2) Make region server more event driven
+   HADOOP-2289 Useless efforts of looking for the non-existant table in select
+               command.
+               (Edward Yoon via Stack)
+   HADOOP-2257 Show a total of all requests and regions on the web ui
+               (Paul Saab via Stack)
+   HADOOP-2261 HTable.abort no longer throws exception if there is no active update.
+   HADOOP-2287 Make hbase unit tests take less time to complete.
+   HADOOP-2262 Retry n times instead of n**2 times.
+   HADOOP-1608 Relational Algrebra Operators
+               (Edward Yoon via Stack)
+   HADOOP-2198 HTable should have method to return table metadata
+
 
 Release 0.15.1
 Branch 0.15

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HTable.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HTable.java?rev=599534&r1=599533&r2=599534&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HTable.java (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HTable.java Thu
Nov 29 10:25:39 2007
@@ -164,6 +164,22 @@
   }
 
   /**
+   * @return table metadata 
+   * @throws IOException
+   */
+  public HTableDescriptor getMetadata() throws IOException {
+    HTableDescriptor [] metas = this.connection.listTables();
+    HTableDescriptor result = null;
+    for (int i = 0; i < metas.length; i++) {
+      if (metas[i].getName().equals(this.tableName)) {
+        result = metas[i];
+        break;
+      }
+    }
+    return result;
+  }
+
+  /**
    * Gets the starting row key for every region in the currently open table
    * @return Array of region starting row keys
    */

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestHTable.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestHTable.java?rev=599534&r1=599533&r2=599534&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestHTable.java
(original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestHTable.java
Thu Nov 29 10:25:39 2007
@@ -71,6 +71,11 @@
     // put some data into table A
     
     HTable a = new HTable(conf, tableAname);
+    
+    // Assert the metadata is good.
+    HTableDescriptor meta = a.getMetadata();
+    assertTrue(meta.equals(tableAdesc));
+    
     long lockid = a.startUpdate(row);
     a.put(lockid, COLUMN_FAMILY, value);
     a.commit(lockid);



Mime
View raw message