public void setRow ( final KeyValue column ) { //This api will be called only with the KeyValues from rollup table, as per //the scan logic if ( key != null ) { throw new IllegalStateException ( "setRow was already called on " + this ) ; } key = column . key ( ) ; //Check whether the cell is generated by same rollup aggregator if ( need_count ) { System . out . println ( "AGG ID: " + agg_id + " COUNT ID: " + count_id + " MASK: " + ( column . qualifier ( ) [ 0 ] & RollupUtils . AGGREGATOR_MASK ) ) ; if ( ( column . qualifier ( ) [ 0 ] & RollupUtils . AGGREGATOR_MASK ) == agg_id ) { append ( column , false , false ) ; } else if ( ( column . qualifier ( ) [ 0 ] & RollupUtils . AGGREGATOR_MASK ) == count_id ) { append ( column , true , false ) ; // OLD style for Yahoo! } else if ( Bytes . memcmp ( RollupQuery . SUM , column . qualifier ( ) , 0 , RollupQuery . SUM . length ) == 0 ) { append ( column , false , true ) ; } else if ( Bytes . memcmp ( RollupQuery . COUNT , column . qualifier ( ) , 0 , RollupQuery . COUNT . length ) == 0 ) { append ( column , true , true ) ; } else { throw new IllegalDataException ( "Attempt to add a different aggrregate cell =" + column + ", expected aggregator either SUM or COUNT" ) ; } } else { if ( ( column . qualifier ( ) [ 0 ] & RollupUtils . AGGREGATOR_MASK ) == agg_id ) { append ( column , false , false ) ; } else if ( Bytes . memcmp ( column . qualifier ( ) , rollup_query . getRollupAggPrefix ( ) , 0 , rollup_query . getRollupAggPrefix ( ) . length ) == 0 ) { append ( column , false , true ) ; } else { throw new IllegalDataException ( "Attempt to add a different aggrregate cell =" + column + ", expected aggregator " + Bytes . pretty ( rollup_query . getRollupAggPrefix ( ) ) ) ; } } }
Sets the row this instance holds in RAM using a row from a scanner .