org.apache.hadoop.hbase.mapred
Class RowCounter

java.lang.Object
  extended by org.apache.hadoop.mapred.MapReduceBase
      extended by org.apache.hadoop.hbase.mapred.TableMap<ImmutableBytesWritable,RowResult>
          extended by org.apache.hadoop.hbase.mapred.RowCounter
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, org.apache.hadoop.io.Closeable, org.apache.hadoop.mapred.JobConfigurable, org.apache.hadoop.mapred.Mapper<ImmutableBytesWritable,RowResult,ImmutableBytesWritable,RowResult>, org.apache.hadoop.util.Tool

public class RowCounter
extends TableMap<ImmutableBytesWritable,RowResult>
implements org.apache.hadoop.util.Tool

A job with a map to count rows. Map outputs table rows IF the input row has columns that have content. Uses an IdentityReducer


Constructor Summary
RowCounter()
           
 
Method Summary
 org.apache.hadoop.mapred.JobConf createSubmittableJob(String[] args)
           
 org.apache.hadoop.conf.Configuration getConf()
           
static void main(String[] args)
           
 void map(ImmutableBytesWritable row, RowResult value, org.apache.hadoop.mapred.OutputCollector<ImmutableBytesWritable,RowResult> output, org.apache.hadoop.mapred.Reporter reporter)
          Call a user defined function on a single HBase record, represented by a key and its associated record value.
 int run(String[] args)
           
 void setConf(org.apache.hadoop.conf.Configuration c)
           
 
Methods inherited from class org.apache.hadoop.hbase.mapred.TableMap
initJob
 
Methods inherited from class org.apache.hadoop.mapred.MapReduceBase
close, configure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.mapred.JobConfigurable
configure
 
Methods inherited from interface org.apache.hadoop.io.Closeable
close
 

Constructor Detail

RowCounter

public RowCounter()
Method Detail

map

public void map(ImmutableBytesWritable row,
                RowResult value,
                org.apache.hadoop.mapred.OutputCollector<ImmutableBytesWritable,RowResult> output,
                org.apache.hadoop.mapred.Reporter reporter)
         throws IOException
Description copied from class: TableMap
Call a user defined function on a single HBase record, represented by a key and its associated record value.

Specified by:
map in interface org.apache.hadoop.mapred.Mapper<ImmutableBytesWritable,RowResult,ImmutableBytesWritable,RowResult>
Specified by:
map in class TableMap<ImmutableBytesWritable,RowResult>
Throws:
IOException

createSubmittableJob

public org.apache.hadoop.mapred.JobConf createSubmittableJob(String[] args)
                                                      throws IOException
Throws:
IOException

run

public int run(String[] args)
        throws Exception
Specified by:
run in interface org.apache.hadoop.util.Tool
Throws:
Exception

getConf

public org.apache.hadoop.conf.Configuration getConf()
Specified by:
getConf in interface org.apache.hadoop.conf.Configurable

setConf

public void setConf(org.apache.hadoop.conf.Configuration c)
Specified by:
setConf in interface org.apache.hadoop.conf.Configurable

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2008 The Apache Software Foundation