org.apache.hadoop.hbase.mapred
Class RowCounter

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

public class RowCounter
extends org.apache.hadoop.mapred.MapReduceBase
implements TableMap<ImmutableBytesWritable,RowResult>, 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)
           
 int run(String[] args)
           
 void setConf(org.apache.hadoop.conf.Configuration c)
           
 
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 java.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
Specified by:
map in interface org.apache.hadoop.mapred.Mapper<ImmutableBytesWritable,RowResult,ImmutableBytesWritable,RowResult>
Throws:
IOException

createSubmittableJob

public org.apache.hadoop.mapred.JobConf createSubmittableJob(String[] args)
                                                      throws IOException
Parameters:
args -
Returns:
the JobConf
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
Parameters:
args -
Throws:
Exception


Copyright © 2008 The Apache Software Foundation