Issue 11829

Create a project listening for messages and updating the metrics

11829
Reporter: lfrancke
Assignee: lfrancke
Type: NewFeature
Summary: Create a project listening for messages and updating the metrics
Priority: Major
Resolution: Fixed
Status: Closed
Created: 2012-09-12 13:52:26.38
Updated: 2013-12-05 11:05:09.659
Resolved: 2012-10-25 14:46:27.674


Author: trobertson@gbif.org
Comment: As discussed over beer, reassigning to Lars
Created: 2012-10-17 12:16:59.593
Updated: 2012-10-17 12:16:59.593


Author: lfrancke@gbif.org
Created: 2012-10-18 17:09:18.056
Updated: 2012-10-18 17:09:18.056
        
I have to listen for {{OccurrencePersistedMessage}}s and Tim provided this code to run:

{code}
int writeBatchSize=10;  // I do much higher in backfill, but you will want low

// instanciate cube
Configuration conf = context.getConfiguration(); // standard Hadoop config
HBaseCubes cube = HBaseCubes.newIncrementingBatchAsync(OccurrenceCube.INSTANCE, LongOp.DESERIALIZER, "CUBE_TABLE", "LOOKUP_TABLE", "COUNTER_TABLE", "CF", conf, writeBatchSize); // CF is column family
Batch update = OccurrenceAddressUtil.cubeMutation(occurrence, new LongOp(1));  // -1 for a deletion
cube.write(update);
{code}
    


Author: lfrancke@gbif.org
Comment: Under review at http://dev.gbif.org/code/cru/CR-MET-7
Created: 2012-10-22 13:21:06.916
Updated: 2012-10-22 13:21:06.916