boolean incrNumberRuns ( List < Cell > column , Table aggTable , AppAggregationKey appAggKey ) throws IOException { /* * check if this is the very first insert for numbers for this app in that * case, there will no existing column/value for number of run in info col * family null signifies non existence of the column for {@link * Table.checkAndPut} */ long expectedValueBeforePut = 0L ; if ( column . size ( ) > 0 ) { try { expectedValueBeforePut = Bytes . toLong ( column . get ( 0 ) . getValue ( ) ) ; } catch ( NumberFormatException e ) { LOG . error ( "Could not read existing value for number of runs during aggregation" + appAggKey . toString ( ) ) ; return false ; } } byte [ ] rowKey = aggConv . toBytes ( appAggKey ) ; long insertValue = 1L ; byte [ ] expectedValueBeforePutBytes = null ; if ( expectedValueBeforePut != 0L ) { insertValue = 1 + expectedValueBeforePut ; expectedValueBeforePutBytes = Bytes . toBytes ( expectedValueBeforePut ) ; } byte [ ] insertValueBytes = Bytes . toBytes ( insertValue ) ; if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( " before statusCheckAndPut " + insertValue + " " + expectedValueBeforePut ) ; } return executeCheckAndPut ( aggTable , rowKey , expectedValueBeforePutBytes , insertValueBytes , AggregationConstants . INFO_FAM_BYTES , AggregationConstants . NUMBER_RUNS_BYTES ) ; }
checks and increments the number of runs for this app aggregation . no need to retry since another map task may have updated it in the mean time