com.splout.db.examples
Class PageCountsRecordProcessor

java.lang.Object
  extended by com.splout.db.examples.PageCountsRecordProcessor
All Implemented Interfaces:
RecordProcessor, java.io.Serializable

public class PageCountsRecordProcessor
extends java.lang.Object
implements RecordProcessor

Custom record processor that filters out some records and URL-Decodes a field. Made for the Wikipedia pagecounts dataset example.

See Also:
Serialized Form

Constructor Summary
PageCountsRecordProcessor(com.datasalt.pangool.io.Schema pageCountsSchema, java.lang.String date, java.lang.String hour)
           
 
Method Summary
static java.lang.String decode(java.lang.String str)
           
 com.datasalt.pangool.io.ITuple process(com.datasalt.pangool.io.ITuple record, CounterInterface context)
          Custom Java business logic can be implemented here.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageCountsRecordProcessor

public PageCountsRecordProcessor(com.datasalt.pangool.io.Schema pageCountsSchema,
                                 java.lang.String date,
                                 java.lang.String hour)
Method Detail

process

public com.datasalt.pangool.io.ITuple process(com.datasalt.pangool.io.ITuple record,
                                              CounterInterface context)
                                       throws java.lang.Throwable
Description copied from interface: RecordProcessor
Custom Java business logic can be implemented here. The record contains the parsed fields and can be manipulated. The return can be used to filter out the record if needed (by returning null). So, this function serves as both a filter and a custom record processor.

The input Tuple will have the Schema of the file being processed. The returned Tuple must have the same Schema than the Table being created.

Specified by:
process in interface RecordProcessor
Throws:
java.lang.Throwable

decode

public static java.lang.String decode(java.lang.String str)
                               throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException


Copyright © 2012-2013 Datasalt Systems S.L.. All Rights Reserved.