diff --git a/hraven-core/src/main/java/com/twitter/hraven/AggregationConstants.java b/hraven-core/src/main/java/com/twitter/hraven/AggregationConstants.java index 408b2f4..349e20c 100644 --- a/hraven-core/src/main/java/com/twitter/hraven/AggregationConstants.java +++ b/hraven-core/src/main/java/com/twitter/hraven/AggregationConstants.java @@ -52,7 +52,7 @@ public class AggregationConstants { * name of the flag that determines whether or not re-aggregate * (overrides aggregation status in raw table for that job) */ - public static String RE_AGGREGATION_FLAG_NAME = "reaggregate"; + public static final String RE_AGGREGATION_FLAG_NAME = "reaggregate"; /** column name for app id in aggregation table */ public static final String APP_ID_COL = "app_id"; diff --git a/hraven-core/src/main/java/com/twitter/hraven/datasource/AppSummaryService.java b/hraven-core/src/main/java/com/twitter/hraven/datasource/AppSummaryService.java index bdeed3e..fa0617f 100644 --- a/hraven-core/src/main/java/com/twitter/hraven/datasource/AppSummaryService.java +++ b/hraven-core/src/main/java/com/twitter/hraven/datasource/AppSummaryService.java @@ -412,8 +412,9 @@ private boolean updateCost(AppAggregationKey appAggKey, HTable aggTable, } double newCost = existingCost + jobDetails.getCost(); - LOG.trace(" total app aggregated cost " + newCost); - + if (LOG.isTraceEnabled()) { + LOG.trace(" total app aggregated cost " + newCost); + } // now insert cost return executeCheckAndPut(aggTable, rowKey, existingCostBytes, Bytes.toBytes(newCost), @@ -451,8 +452,10 @@ boolean updateQueue(AppAggregationKey appAggKey, HTable aggTable, JobDetails job // if existing and to be inserted queue lists are different, then // execute check and put if (insertQueues.equalsIgnoreCase(existingQueues)) { - LOG.trace("Queue already present in aggregation for this app " - + existingQueues + " " + insertQueues); + if (LOG.isTraceEnabled()) { + LOG.trace("Queue already present in aggregation for this app " + + existingQueues + " " + insertQueues); + } return true; } else { return executeCheckAndPut(aggTable, rowKey, existingQueuesBytes, @@ -502,8 +505,10 @@ private boolean updateNumberRuns(AppAggregationKey appAggKey, HTable aggTable, g.addColumn(AggregationConstants.SCRATCH_FAM_BYTES, numberRowsCol); Result r = aggTable.get(g); - LOG.trace(" jobkey " + jobDetails.getJobKey().toString() - + " runid in updateNumberRuns " + jobDetails.getJobKey().getRunId()); + if (LOG.isTraceEnabled()) { + LOG.trace(" jobkey " + jobDetails.getJobKey().toString() + + " runid in updateNumberRuns " + jobDetails.getJobKey().getRunId()); + } long numberRuns = getNumberRunsScratch(r.getFamilyMap (AggregationConstants.SCRATCH_FAM_BYTES)); if (numberRuns == 1L) { @@ -558,8 +563,10 @@ boolean incrNumberRuns(List column, HTable aggTable, AppAggregationKey } byte[] insertValueBytes = Bytes.toBytes(insertValue); - LOG.trace(" before statusCheckAndPut " + insertValue - + " " + expectedValueBeforePut); + if (LOG.isTraceEnabled()) { + LOG.trace(" before statusCheckAndPut " + insertValue + " " + + expectedValueBeforePut); + } return executeCheckAndPut(aggTable, rowKey, expectedValueBeforePutBytes,