Author: aching Date: Wed Oct 19 03:11:24 2011 New Revision: 1185953 URL: http://svn.apache.org/viewvc?rev=1185953&view=rev Log: GIRAPH-59: Missing some test if debug enabled before LOG.debug() and LOG.info(). (guzhiwei via aching).
Modified: incubator/giraph/trunk/CHANGELOG incubator/giraph/trunk/src/main/java/org/apache/giraph/comm/BasicRPCCommunications.java incubator/giraph/trunk/src/main/java/org/apache/giraph/examples/SimplePageRankVertex.java incubator/giraph/trunk/src/main/java/org/apache/giraph/examples/SimpleSuperstepVertex.java incubator/giraph/trunk/src/main/java/org/apache/giraph/examples/SuperstepBalancer.java incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BspServiceWorker.java Modified: incubator/giraph/trunk/CHANGELOG URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/CHANGELOG?rev=1185953&r1=1185952&r2=1185953&view=diff ============================================================================== --- incubator/giraph/trunk/CHANGELOG (original) +++ incubator/giraph/trunk/CHANGELOG Wed Oct 19 03:11:24 2011 @@ -2,6 +2,9 @@ Giraph Change Log Release 0.70.0 - unreleased + GIRAPH-59: Missing some test if debug enabled before LOG.debug() and + LOG.info(). (guzhiwei via aching). + GIRAPH-48: numFlushThreads is 0 when doing a single worker unittest. Changing the minimum to 1. (aching) Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/comm/BasicRPCCommunications.java URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/comm/BasicRPCCommunications.java?rev=1185953&r1=1185952&r2=1185953&view=diff ============================================================================== --- incubator/giraph/trunk/src/main/java/org/apache/giraph/comm/BasicRPCCommunications.java (original) +++ incubator/giraph/trunk/src/main/java/org/apache/giraph/comm/BasicRPCCommunications.java Wed Oct 19 03:11:24 2011 @@ -507,7 +507,9 @@ end[HADOOP_FACEBOOK]*/ @Override public final void putMsg(I vertex, M msg) throws IOException { List<M> msgs = null; - LOG.debug("putMsg: Adding msg " + msg + " on vertex " + vertex); + if (LOG.isDebugEnabled()) { + LOG.debug("putMsg: Adding msg " + msg + " on vertex " + vertex); + } if (inPrepareSuperstep) { // Called by combiner (main thread) during superstep preparation msgs = inMessages.get(vertex); @@ -535,8 +537,10 @@ end[HADOOP_FACEBOOK]*/ public final void putMsgList(I vertex, MsgList<M> msgList) throws IOException { List<M> msgs = null; - LOG.debug("putMsgList: Adding msgList " + msgList + - " on vertex " + vertex); + if (LOG.isDebugEnabled()) { + LOG.debug("putMsgList: Adding msgList " + msgList + + " on vertex " + vertex); + } synchronized(transientInMessages) { msgs = transientInMessages.get(vertex); if (msgs == null) { Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/examples/SimplePageRankVertex.java URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/examples/SimplePageRankVertex.java?rev=1185953&r1=1185952&r2=1185953&view=diff ============================================================================== --- incubator/giraph/trunk/src/main/java/org/apache/giraph/examples/SimplePageRankVertex.java (original) +++ incubator/giraph/trunk/src/main/java/org/apache/giraph/examples/SimplePageRankVertex.java Wed Oct 19 03:11:24 2011 @@ -150,9 +150,11 @@ public class SimplePageRankVertex extend vertex.addEdge(new LongWritable(destVertexId), new FloatWritable(edgeValue)); ++recordsRead; - LOG.info("next: Return vertexId=" + vertex.getVertexId().get() + - ", vertexValue=" + vertex.getVertexValue() + - ", destinationId=" + destVertexId + ", edgeValue=" + edgeValue); + if (LOG.isInfoEnabled()) { + LOG.info("next: Return vertexId=" + vertex.getVertexId().get() + + ", vertexValue=" + vertex.getVertexValue() + + ", destinationId=" + destVertexId + ", edgeValue=" + edgeValue); + } return true; } } Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/examples/SimpleSuperstepVertex.java URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/examples/SimpleSuperstepVertex.java?rev=1185953&r1=1185952&r2=1185953&view=diff ============================================================================== --- incubator/giraph/trunk/src/main/java/org/apache/giraph/examples/SimpleSuperstepVertex.java (original) +++ incubator/giraph/trunk/src/main/java/org/apache/giraph/examples/SimpleSuperstepVertex.java Wed Oct 19 03:11:24 2011 @@ -76,9 +76,12 @@ public class SimpleSuperstepVertex exten vertex.addEdge(new LongWritable(destVertexId), new FloatWritable(edgeValue)); ++recordsRead; - LOG.info("next: Return vertexId=" + vertex.getVertexId().get() + - ", vertexValue=" + vertex.getVertexValue() + - ", destinationId=" + destVertexId + ", edgeValue=" + edgeValue); + if (LOG.isInfoEnabled()) { + LOG.info("next: Return vertexId=" + vertex.getVertexId().get() + + ", vertexValue=" + vertex.getVertexValue() + + ", destinationId=" + destVertexId + + ", edgeValue=" + edgeValue); + } return true; } } Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/examples/SuperstepBalancer.java URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/examples/SuperstepBalancer.java?rev=1185953&r1=1185952&r2=1185953&view=diff ============================================================================== --- incubator/giraph/trunk/src/main/java/org/apache/giraph/examples/SuperstepBalancer.java (original) +++ incubator/giraph/trunk/src/main/java/org/apache/giraph/examples/SuperstepBalancer.java Wed Oct 19 03:11:24 2011 @@ -48,10 +48,12 @@ public class SuperstepBalancer<I extends String superstepWorker = (String) workerHostnameIdMap.keySet().toArray()[ (int) hostnameIdListIndex]; - LOG.info("rebalance: Using worker " + superstepWorker + " with index " + - hostnameIdListIndex + " out of " + - workerHostnameIdMap.size() + " workers on superstep " + - getSuperstep()); + if (LOG.isInfoEnabled()) { + LOG.info("rebalance: Using worker " + superstepWorker + + " with index " + hostnameIdListIndex + " out of " + + workerHostnameIdMap.size() + " workers on superstep " + + getSuperstep()); + } JSONArray hostnamePortArray = workerHostnameIdMap.get(superstepWorker); NavigableMap<I, VertexRange<I, V, E, M>> prevVertexRangeMap = getPrevVertexRangeMap(); Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BspServiceWorker.java URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BspServiceWorker.java?rev=1185953&r1=1185952&r2=1185953&view=diff ============================================================================== --- incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BspServiceWorker.java (original) +++ incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BspServiceWorker.java Wed Oct 19 03:11:24 2011 @@ -695,8 +695,10 @@ public class BspServiceWorker< } } - LOG.info("marshalAggregatorValues: Finished assembling " + - "aggregator values in JSONArray - " + aggregatorArray); + if (LOG.isInfoEnabled()) { + LOG.info("marshalAggregatorValues: Finished assembling " + + "aggregator values in JSONArray - " + aggregatorArray); + } aggregatorInUse.clear(); return aggregatorArray; } @@ -1222,9 +1224,11 @@ public class BspServiceWorker< @SuppressWarnings("unchecked") int compareTo = vertexRange.getMaxIndex().compareTo(maxVertexIndex); - LOG.debug("loadCheckpoint: Comparing " + - vertexRange.getMaxIndex() + " and " + - maxVertexIndex + " = " + compareTo); + if (LOG.isDebugEnabled()) { + LOG.debug("loadCheckpoint: Comparing " + + vertexRange.getMaxIndex() + " and " + + maxVertexIndex + " = " + compareTo); + } if (compareTo == 0) { loadVertexRange( vertexRange.getMaxIndex(),