hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r571350 - in /lucene/hadoop/trunk/src/contrib/hbase: ./ src/java/org/apache/hadoop/hbase/ src/java/org/apache/hadoop/hbase/io/ src/java/org/apache/hadoop/hbase/mapred/ src/test/org/apache/hadoop/hbase/
Date Fri, 31 Aug 2007 00:37:48 GMT
Author: jimk
Date: Thu Aug 30 17:37:46 2007
New Revision: 571350

URL: http://svn.apache.org/viewvc?rev=571350&view=rev
Log:
HADOOP-1760 Use new MapWritable and SortedMapWritable classes from org.apache.hadoop.io

Removed:
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/io/MapWritable.java
Modified:
    lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HBaseAdmin.java
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HConnectionManager.java
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMaster.java
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionInterface.java
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionServer.java
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HTable.java
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/GroupingTableMap.java
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/IdentityTableMap.java
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/IdentityTableReduce.java
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableInputFormat.java
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableMap.java
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableOutputCollector.java
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableOutputFormat.java
    lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestScanner2.java
    lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestTableMapReduce.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=571350&r1=571349&r2=571350&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt Thu Aug 30 17:37:46 2007
@@ -34,6 +34,8 @@
     HADOOP-1746 Clean up findbugs warnings
     HADOOP-1757 Bloomfilters: single argument constructor, use enum for bloom
                 filter types
+    HADOOP-1760 Use new MapWritable and SortedMapWritable classes from
+                org.apache.hadoop.io
     HADOOP-1802 Startup scripts should wait until hdfs as cleared 'safe mode'
 
 

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HBaseAdmin.java?rev=571350&r1=571349&r2=571350&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HBaseAdmin.java
(original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HBaseAdmin.java
Thu Aug 30 17:37:46 2007
@@ -26,12 +26,11 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.hbase.io.MapWritable;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.io.MapWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.ipc.RemoteException;
 
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
@@ -187,7 +186,7 @@
           break;
         }
         boolean found = false;
-        for (Map.Entry<WritableComparable, Writable> e: values.entrySet()) {
+        for (Map.Entry<Writable, Writable> e: values.entrySet()) {
           HStoreKey key = (HStoreKey) e.getKey();
           if (key.getColumn().equals(COL_REGIONINFO)) {
             info = (HRegionInfo) Writables.getWritable(
@@ -275,7 +274,7 @@
             break;
           }
           valuesfound += 1;
-          for (Map.Entry<WritableComparable, Writable> e: values.entrySet()) {
+          for (Map.Entry<Writable, Writable> e: values.entrySet()) {
             HStoreKey key = (HStoreKey) e.getKey();
             if (key.getColumn().equals(COL_REGIONINFO)) {
               info = (HRegionInfo) Writables.getWritable(
@@ -375,7 +374,7 @@
             break;
           }
           valuesfound += 1;
-          for (Map.Entry<WritableComparable, Writable> e: values.entrySet()) {
+          for (Map.Entry<Writable, Writable> e: values.entrySet()) {
             HStoreKey key = (HStoreKey) e.getKey();
             if (key.getColumn().equals(COL_REGIONINFO)) {
               info = (HRegionInfo) Writables.getWritable(

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HConnectionManager.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HConnectionManager.java?rev=571350&r1=571349&r2=571350&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HConnectionManager.java
(original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HConnectionManager.java
Thu Aug 30 17:37:46 2007
@@ -33,12 +33,11 @@
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.ipc.RPC;
 import org.apache.hadoop.ipc.RemoteException;
+import org.apache.hadoop.io.MapWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
 
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
-import org.apache.hadoop.hbase.io.MapWritable;
 import org.apache.hadoop.hbase.util.Writables;
 
 /**
@@ -254,7 +253,7 @@
             if (values == null || values.size() == 0) {
               break;
             }
-            for (Map.Entry<WritableComparable, Writable> e: values.entrySet()) {
+            for (Map.Entry<Writable, Writable> e: values.entrySet()) {
               HStoreKey key = (HStoreKey) e.getKey();
               if (key.getColumn().equals(COL_REGIONINFO)) {
                 info = (HRegionInfo) Writables.getWritable(
@@ -686,7 +685,7 @@
             }
 
             SortedMap<Text, byte[]> results = new TreeMap<Text, byte[]>();
-            for (Map.Entry<WritableComparable, Writable> e: values.entrySet()) {
+            for (Map.Entry<Writable, Writable> e: values.entrySet()) {
               HStoreKey key = (HStoreKey) e.getKey();
               results.put(key.getColumn(),
                   ((ImmutableBytesWritable) e.getValue()).get());

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMaster.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMaster.java?rev=571350&r1=571349&r2=571350&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMaster.java (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMaster.java Thu
Aug 30 17:37:46 2007
@@ -47,17 +47,16 @@
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.PathFilter;
-import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
-import org.apache.hadoop.hbase.io.MapWritable;
-import org.apache.hadoop.hbase.util.Writables;
+import org.apache.hadoop.io.MapWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.ipc.RPC;
 import org.apache.hadoop.ipc.RemoteException;
 import org.apache.hadoop.ipc.Server;
 
 import org.apache.hadoop.hbase.io.BatchUpdate;
+import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
+import org.apache.hadoop.hbase.util.Writables;
 
 
 /**
@@ -209,7 +208,7 @@
             break;
           }
 
-          for (Map.Entry<WritableComparable, Writable> e: values.entrySet()) {
+          for (Map.Entry<Writable, Writable> e: values.entrySet()) {
             HStoreKey key = (HStoreKey) e.getKey();
             results.put(key.getColumn(),
                 ((ImmutableBytesWritable) e.getValue()).get());
@@ -1730,7 +1729,7 @@
 
           SortedMap<Text, byte[]> results = new TreeMap<Text, byte[]>();
           Text row = null;
-          for (Map.Entry<WritableComparable, Writable> e: values.entrySet()) {
+          for (Map.Entry<Writable, Writable> e: values.entrySet()) {
             HStoreKey key = (HStoreKey) e.getKey();
             Text thisRow = key.getRow();
             if (row == null) {
@@ -2406,7 +2405,7 @@
         // be inserted if it exists so look for exact match on table name.
             
         if (data != null && data.size() > 0) {
-          for (WritableComparable k: data.keySet()) {
+          for (Writable k: data.keySet()) {
             if (HRegionInfo.getTableNameFromRegionName(
                 ((HStoreKey) k).getRow()).equals(tableName)) {
           
@@ -2553,8 +2552,7 @@
                     break;
                   }
                   boolean haveRegionInfo = false;
-                  for (Map.Entry<WritableComparable, Writable> e:
-                    values.entrySet()) {
+                  for (Map.Entry<Writable, Writable> e: values.entrySet()) {
 
                     byte[] value = ((ImmutableBytesWritable) e.getValue()).get();
                     if (value == null || value.length == 0) {

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionInterface.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionInterface.java?rev=571350&r1=571349&r2=571350&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionInterface.java
(original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionInterface.java
Thu Aug 30 17:37:46 2007
@@ -23,7 +23,8 @@
 
 import org.apache.hadoop.hbase.filter.RowFilterInterface;
 import org.apache.hadoop.hbase.io.BatchUpdate;
-import org.apache.hadoop.hbase.io.MapWritable;
+
+import org.apache.hadoop.io.MapWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.ipc.VersionedProtocol;
 

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionServer.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionServer.java?rev=571350&r1=571349&r2=571350&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionServer.java
(original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionServer.java
Thu Aug 30 17:37:46 2007
@@ -40,9 +40,8 @@
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.MapWritable;
 import org.apache.hadoop.io.Text;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.ipc.RemoteException;
 import org.apache.hadoop.ipc.RPC;
 import org.apache.hadoop.ipc.Server;
@@ -53,7 +52,6 @@
 import org.apache.hadoop.hbase.io.BatchUpdate;
 import org.apache.hadoop.hbase.io.BatchOperation;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
-import org.apache.hadoop.hbase.io.MapWritable;
 import org.apache.hadoop.hbase.util.Writables;
 
 /*******************************************************************************
@@ -1034,10 +1032,7 @@
   throws IOException {
     requestCount.incrementAndGet();
     HRegion region = getRegion(regionName);
-    MapWritable result = new MapWritable(HStoreKey.class,
-        ImmutableBytesWritable.class,
-        new TreeMap<WritableComparable, Writable>());
-    
+    MapWritable result = new MapWritable();
     TreeMap<Text, byte[]> map = region.getFull(row);
     for (Map.Entry<Text, byte []> es: map.entrySet()) {
       result.put(new HStoreKey(row, es.getKey()),
@@ -1059,9 +1054,7 @@
     
     // Collect values to be returned here
     
-    MapWritable values = new MapWritable(HStoreKey.class,
-        ImmutableBytesWritable.class,
-        new TreeMap<WritableComparable, Writable>());
+    MapWritable values = new MapWritable();
     
     // Keep getting rows until we find one that has at least one non-deleted column value
     

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=571350&r1=571349&r2=571350&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
Aug 30 17:37:46 2007
@@ -35,10 +35,10 @@
 import org.apache.hadoop.hbase.filter.RowFilterInterface;
 import org.apache.hadoop.hbase.io.BatchUpdate;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
-import org.apache.hadoop.hbase.io.MapWritable;
+
+import org.apache.hadoop.io.MapWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.ipc.RemoteException;
 
 /**
@@ -361,7 +361,7 @@
     }
     SortedMap<Text, byte[]> results = new TreeMap<Text, byte[]>();
     if (value != null && value.size() != 0) {
-      for (Map.Entry<WritableComparable, Writable> e: value.entrySet()) {
+      for (Map.Entry<Writable, Writable> e: value.entrySet()) {
         HStoreKey key = (HStoreKey) e.getKey();
         results.put(key.getColumn(),
             ((ImmutableBytesWritable) e.getValue()).get());
@@ -764,7 +764,7 @@
       } while (values != null && values.size() == 0 && nextScanner());
 
       if (values != null && values.size() != 0) {
-        for (Map.Entry<WritableComparable, Writable> e: values.entrySet()) {
+        for (Map.Entry<Writable, Writable> e: values.entrySet()) {
           HStoreKey k = (HStoreKey) e.getKey();
           key.setRow(k.getRow());
           key.setVersion(k.getTimestamp());

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/GroupingTableMap.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/GroupingTableMap.java?rev=571350&r1=571349&r2=571350&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/GroupingTableMap.java
(original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/GroupingTableMap.java
Thu Aug 30 17:37:46 2007
@@ -25,11 +25,10 @@
 
 import org.apache.hadoop.hbase.HStoreKey;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
-import org.apache.hadoop.hbase.io.MapWritable;
 
+import org.apache.hadoop.io.MapWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.mapred.JobConf;
 import org.apache.hadoop.mapred.Reporter;
 
@@ -88,7 +87,7 @@
    * Pass the new key and value to reduce.
    * If any of the grouping columns are not found in the value, the record is skipped.
    *
-   * @see org.apache.hadoop.hbase.mapred.TableMap#map(org.apache.hadoop.hbase.HStoreKey,
org.apache.hadoop.hbase.io.MapWritable, org.apache.hadoop.hbase.mapred.TableOutputCollector,
org.apache.hadoop.mapred.Reporter)
+   * @see org.apache.hadoop.hbase.mapred.TableMap#map(org.apache.hadoop.hbase.HStoreKey,
org.apache.hadoop.io.MapWritable, org.apache.hadoop.hbase.mapred.TableOutputCollector, org.apache.hadoop.mapred.Reporter)
    */
   @Override
   public void map(@SuppressWarnings("unused") HStoreKey key,
@@ -116,7 +115,7 @@
     ArrayList<byte[]> foundList = new ArrayList<byte[]>();
     int numCols = m_columns.length;
     if(numCols > 0) {
-      for (Map.Entry<WritableComparable, Writable> e: r.entrySet()) {
+      for (Map.Entry<Writable, Writable> e: r.entrySet()) {
         Text column = (Text) e.getKey();
         for (int i = 0; i < numCols; i++) {
           if (column.equals(m_columns[i])) {

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/IdentityTableMap.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/IdentityTableMap.java?rev=571350&r1=571349&r2=571350&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/IdentityTableMap.java
(original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/IdentityTableMap.java
Thu Aug 30 17:37:46 2007
@@ -22,7 +22,7 @@
 import java.io.IOException;
 
 import org.apache.hadoop.hbase.HStoreKey;
-import org.apache.hadoop.hbase.io.MapWritable;
+import org.apache.hadoop.io.MapWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapred.Reporter;
 
@@ -40,7 +40,7 @@
   /**
    * Pass the key, value to reduce
    *
-   * @see org.apache.hadoop.hbase.mapred.TableMap#map(org.apache.hadoop.hbase.HStoreKey,
org.apache.hadoop.hbase.io.MapWritable, org.apache.hadoop.hbase.mapred.TableOutputCollector,
org.apache.hadoop.mapred.Reporter)
+   * @see org.apache.hadoop.hbase.mapred.TableMap#map(org.apache.hadoop.hbase.HStoreKey,
org.apache.hadoop.io.MapWritable, org.apache.hadoop.hbase.mapred.TableOutputCollector, org.apache.hadoop.mapred.Reporter)
    */
   @Override
   public void map(HStoreKey key, MapWritable value,

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/IdentityTableReduce.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/IdentityTableReduce.java?rev=571350&r1=571349&r2=571350&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/IdentityTableReduce.java
(original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/IdentityTableReduce.java
Thu Aug 30 17:37:46 2007
@@ -22,7 +22,7 @@
 import java.io.IOException;
 import java.util.Iterator;
 
-import org.apache.hadoop.hbase.io.MapWritable;
+import org.apache.hadoop.io.MapWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapred.Reporter;
 

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableInputFormat.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableInputFormat.java?rev=571350&r1=571349&r2=571350&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableInputFormat.java
(original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableInputFormat.java
Thu Aug 30 17:37:46 2007
@@ -26,6 +26,7 @@
 
 import org.apache.hadoop.fs.Path;
 
+import org.apache.hadoop.io.MapWritable;
 import org.apache.hadoop.io.Text;
 
 import org.apache.hadoop.mapred.InputFormat;
@@ -39,7 +40,6 @@
 import org.apache.hadoop.hbase.HScannerInterface;
 import org.apache.hadoop.hbase.HStoreKey;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
-import org.apache.hadoop.hbase.io.MapWritable;
 
 import org.apache.log4j.Logger;
 
@@ -107,9 +107,7 @@
      */
     @SuppressWarnings("unchecked")
     public MapWritable createValue() {
-      return new MapWritable((Class) Text.class,
-          (Class) ImmutableBytesWritable.class,
-          (Map) new TreeMap<Text, ImmutableBytesWritable>());
+      return new MapWritable();
     }
 
     /** {@inheritDoc} */

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableMap.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableMap.java?rev=571350&r1=571349&r2=571350&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableMap.java
(original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableMap.java
Thu Aug 30 17:37:46 2007
@@ -21,6 +21,8 @@
 
 import java.io.IOException;
 
+import org.apache.hadoop.io.MapWritable;
+import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.mapred.JobConf;
@@ -28,10 +30,8 @@
 import org.apache.hadoop.mapred.Mapper;
 import org.apache.hadoop.mapred.OutputCollector;
 import org.apache.hadoop.mapred.Reporter;
-import org.apache.hadoop.hbase.io.MapWritable;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.HStoreKey;
-import org.apache.hadoop.io.Text;
 import org.apache.log4j.Logger;
 
 /**

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableOutputCollector.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableOutputCollector.java?rev=571350&r1=571349&r2=571350&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableOutputCollector.java
(original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableOutputCollector.java
Thu Aug 30 17:37:46 2007
@@ -21,10 +21,9 @@
 
 import java.io.IOException;
 
+import org.apache.hadoop.io.MapWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapred.OutputCollector;
-
-import org.apache.hadoop.hbase.io.MapWritable;
 
 /**
  * Refine the types that can be collected from a Table Map/Reduce jobs.

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableOutputFormat.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableOutputFormat.java?rev=571350&r1=571349&r2=571350&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableOutputFormat.java
(original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/mapred/TableOutputFormat.java
Thu Aug 30 17:37:46 2007
@@ -23,9 +23,9 @@
 import java.util.Map;
 
 import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.io.MapWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.mapred.FileAlreadyExistsException;
 import org.apache.hadoop.mapred.InvalidJobConfException;
 import org.apache.hadoop.mapred.JobConf;
@@ -36,7 +36,6 @@
 
 import org.apache.hadoop.hbase.HTable;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
-import org.apache.hadoop.hbase.io.MapWritable;
 
 import org.apache.log4j.Logger;
 
@@ -82,7 +81,7 @@
       
       long xid = m_table.startUpdate(key);
 
-      for (Map.Entry<WritableComparable, Writable> e: value.entrySet()) {
+      for (Map.Entry<Writable, Writable> e: value.entrySet()) {
         m_table.put(xid, (Text)e.getKey(),
             ((ImmutableBytesWritable)e.getValue()).get());
       }

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestScanner2.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestScanner2.java?rev=571350&r1=571349&r2=571350&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestScanner2.java
(original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestScanner2.java
Thu Aug 30 17:37:46 2007
@@ -32,17 +32,16 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.MapWritable;
+import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.hbase.filter.RegExpRowFilter;
 import org.apache.hadoop.hbase.filter.RowFilterInterface;
 import org.apache.hadoop.hbase.filter.RowFilterSet;
 import org.apache.hadoop.hbase.filter.StopRowFilter;
 import org.apache.hadoop.hbase.filter.WhileMatchRowFilter;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
-import org.apache.hadoop.hbase.io.MapWritable;
 import org.apache.hadoop.hbase.util.Writables;
-import org.apache.hadoop.io.Text;
 
 /**
  * Additional scanner tests.
@@ -219,7 +218,7 @@
           break;
         }
         
-        for (Map.Entry<WritableComparable, Writable> e: values.entrySet()) {
+        for (Map.Entry<Writable, Writable> e: values.entrySet()) {
           HStoreKey k = (HStoreKey) e.getKey();
           results.put(k.getColumn(),
               ((ImmutableBytesWritable) e.getValue()).get());

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestTableMapReduce.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestTableMapReduce.java?rev=571350&r1=571349&r2=571350&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestTableMapReduce.java
(original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestTableMapReduce.java
Thu Aug 30 17:37:46 2007
@@ -29,15 +29,16 @@
 import org.apache.hadoop.dfs.MiniDFSCluster;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.MapWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapred.JobClient;
 import org.apache.hadoop.mapred.JobConf;
 import org.apache.hadoop.mapred.MiniMRCluster;
 import org.apache.hadoop.mapred.Reporter;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
-import org.apache.hadoop.hbase.io.MapWritable;
 import org.apache.hadoop.hbase.mapred.TableMap;
 import org.apache.hadoop.hbase.mapred.TableOutputCollector;
+import org.apache.hadoop.hbase.mapred.TableReduce;
 import org.apache.hadoop.hbase.mapred.IdentityTableReduce;
 
 /**
@@ -120,7 +121,7 @@
     /**
      * Pass the key, and reversed value to reduce
      *
-     * @see org.apache.hadoop.hbase.mapred.TableMap#map(org.apache.hadoop.hbase.HStoreKey,
org.apache.hadoop.hbase.io.MapWritable, org.apache.hadoop.hbase.mapred.TableOutputCollector,
org.apache.hadoop.mapred.Reporter)
+     * @see org.apache.hadoop.hbase.mapred.TableMap#map(org.apache.hadoop.hbase.HStoreKey,
org.apache.hadoop.io.MapWritable, org.apache.hadoop.hbase.mapred.TableOutputCollector, org.apache.hadoop.mapred.Reporter)
      */
     @SuppressWarnings("unchecked")
     @Override
@@ -151,9 +152,7 @@
       
       // Now set the value to be collected
 
-      MapWritable outval = new MapWritable((Class) Text.class,
-          (Class) ImmutableBytesWritable.class,
-          (Map) new TreeMap<Text, ImmutableBytesWritable>());
+      MapWritable outval = new MapWritable();
       outval.put(TEXT_OUTPUT_COLUMN,
           new ImmutableBytesWritable(newValue.toString().getBytes()));
       
@@ -163,6 +162,7 @@
   
   /**
    * Test hbase mapreduce jobs against single region and multi-region tables.
+   * @throws IOException
    */
   public void testTableMapReduce() throws IOException {
     localTestSingleRegionTable();
@@ -214,7 +214,7 @@
       TableMap.initJob(SINGLE_REGION_TABLE_NAME, INPUT_COLUMN, 
           ProcessContentsMapper.class, jobConf);
 
-      IdentityTableReduce.initJob(SINGLE_REGION_TABLE_NAME,
+      TableReduce.initJob(SINGLE_REGION_TABLE_NAME,
           IdentityTableReduce.class, jobConf);
 
       JobClient.runJob(jobConf);
@@ -264,7 +264,7 @@
       TableMap.initJob(MULTI_REGION_TABLE_NAME, INPUT_COLUMN, 
           ProcessContentsMapper.class, jobConf);
 
-      IdentityTableReduce.initJob(MULTI_REGION_TABLE_NAME,
+      TableReduce.initJob(MULTI_REGION_TABLE_NAME,
           IdentityTableReduce.class, jobConf);
 
       JobClient.runJob(jobConf);
@@ -306,6 +306,7 @@
     }
   }
 
+  @SuppressWarnings("null")
   private void verify(Configuration conf, String tableName) throws IOException {
     HTable table = new HTable(conf, new Text(tableName));
     
@@ -334,6 +335,8 @@
         }
         
         // verify second value is the reverse of the first
+        assertNotNull(firstValue);
+        assertNotNull(secondValue);
         assertEquals(firstValue.length, secondValue.length);
         for (int i=0; i<firstValue.length; i++) {
           assertEquals(firstValue[i], secondValue[firstValue.length-i-1]);



Mime
View raw message