This project has retired. For details please refer to its Attic page.
WordAggregationHBase (Apache Crunch 0.7.0 API)

org.apache.crunch.examples
Class WordAggregationHBase

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.crunch.examples.WordAggregationHBase
All Implemented Interfaces:
Serializable, org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Tool

public class WordAggregationHBase
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool, Serializable

You need to have a HBase instance running. Required dependencies : hbase /!\ The version should be your version of hbase. org.apache.hbase hbase ...

See Also:
Serialized Form

Constructor Summary
WordAggregationHBase()
           
 
Method Summary
 PCollection<org.apache.hadoop.hbase.client.Put> createPut(PTable<String,String> extractedText)
          Create puts in order to insert them in hbase.
 PTable<String,String> extractText(PTable<org.apache.hadoop.hbase.io.ImmutableBytesWritable,org.apache.hadoop.hbase.client.Result> words)
          Extract information from hbase
static void main(String[] args)
           
 int run(String[] args)
           
 
Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
 

Constructor Detail

WordAggregationHBase

public WordAggregationHBase()
Method Detail

run

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

extractText

public PTable<String,String> extractText(PTable<org.apache.hadoop.hbase.io.ImmutableBytesWritable,org.apache.hadoop.hbase.client.Result> words)
Extract information from hbase

Parameters:
words - the source from hbase
Returns:
a PTable composed of the type of the input as key and its def as value

createPut

public PCollection<org.apache.hadoop.hbase.client.Put> createPut(PTable<String,String> extractedText)
Create puts in order to insert them in hbase.

Parameters:
extractedText - a PTable which contain the data in order to create the puts: keys of the PTable are rowkeys for the puts, values are the values for hbase.
Returns:
a PCollection formed by the puts.

main

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


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.