Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Commit

Permalink
updating if checks around trace level logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrushali Channapattan committed Nov 21, 2014
1 parent 71d4a5b commit 9661ad2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -558,8 +563,10 @@ boolean incrNumberRuns(List<KeyValue> 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,
Expand Down

0 comments on commit 9661ad2

Please sign in to comment.