Author: manik.surtani(a)jboss.com
Date: 2009-02-24 09:03:13 -0500 (Tue, 24 Feb 2009)
New Revision: 7771
Modified:
core/trunk/src/main/java/org/jboss/cache/remoting/jgroups/ChannelMessageListener.java
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferGenerator.java
Log:
More verbose logging
Modified:
core/trunk/src/main/java/org/jboss/cache/remoting/jgroups/ChannelMessageListener.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/remoting/jgroups/ChannelMessageListener.java 2009-02-24
13:45:44 UTC (rev 7770)
+++
core/trunk/src/main/java/org/jboss/cache/remoting/jgroups/ChannelMessageListener.java 2009-02-24
14:03:13 UTC (rev 7771)
@@ -115,7 +115,7 @@
{
if (t instanceof CacheException)
{
- log.debug(t);
+ log.debug("Caught exception integrating state!", t);
}
else
{
@@ -135,7 +135,7 @@
{
if (t instanceof CacheException)
{
- log.debug(t);
+ log.debug("Caught exception generating state!", t);
}
else
{
Modified:
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferGenerator.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferGenerator.java 2009-02-24
13:45:44 UTC (rev 7770)
+++
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferGenerator.java 2009-02-24
14:03:13 UTC (rev 7771)
@@ -21,12 +21,6 @@
*/
package org.jboss.cache.statetransfer;
-import java.io.ObjectOutputStream;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.CacheException;
@@ -35,8 +29,8 @@
import org.jboss.cache.InternalNode;
import org.jboss.cache.Node;
import org.jboss.cache.RPCManager;
-import org.jboss.cache.Version;
import org.jboss.cache.RPCManagerImpl.FlushTracker;
+import org.jboss.cache.Version;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
@@ -45,12 +39,19 @@
import org.jboss.cache.marshall.NodeDataExceptionMarker;
import org.jboss.cache.transaction.TransactionLog;
+import java.io.ObjectOutputStream;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
public class DefaultStateTransferGenerator implements StateTransferGenerator
{
public static final short STATE_TRANSFER_VERSION =
Version.getVersionShort("2.0.0.GA");
- private Log log = LogFactory.getLog(getClass().getName());
+ private static final Log log =
LogFactory.getLog(DefaultStateTransferGenerator.class);
+ private static final boolean trace = log.isTraceEnabled();
private CacheSPI cache;
private RPCManager rpcManager;
@@ -98,36 +99,21 @@
if (! activated)
throw new CacheException("Busy performing state transfer for
someone else");
- if (log.isTraceEnabled())
- log.trace("Transaction log activated!");
-
+ if (trace) log.trace("Transaction log activated!");
}
//transient + marker
- if (log.isTraceEnabled())
- {
- log.trace("writing transient state for " + fqn);
- }
+ if (trace) log.trace("writing transient state for " + fqn);
marshallTransientState((InternalNode) rootNode, out);
- if (log.isTraceEnabled())
- {
- log.trace("transient state succesfully written");
- }
+ if (trace) log.trace("transient state succesfully written");
//associated + marker
- if (log.isTraceEnabled())
- {
- log.trace("writing associated state");
- }
+ if (trace) log.trace("writing associated state");
delimitStream(out);
- if (log.isTraceEnabled())
- {
- log.trace("associated state succesfully written");
- }
-
+ if (trace) log.trace("associated state succesfully written");
}
else
{
@@ -163,10 +149,7 @@
private void writePersistentData(ObjectOutputStream out, Fqn fqn, CacheLoader
cacheLoader) throws Exception
{
- if (log.isTraceEnabled())
- {
- log.trace("writing persistent state for " + fqn + ",using "
+ cache.getCacheLoaderManager().getCacheLoader().getClass());
- }
+ if (trace) log.trace("writing persistent state for " + fqn + ",
using " + cache.getCacheLoaderManager().getCacheLoader().getClass());
if (fqn.isRoot())
{
@@ -177,10 +160,7 @@
cacheLoader.loadState(fqn, out);
}
- if (log.isTraceEnabled())
- {
- log.trace("persistent state succesfully written");
- }
+ if (trace) log.trace("persistent state succesfully written");
}
private void writeTxLog(ObjectOutputStream out) throws Exception
@@ -189,10 +169,10 @@
try
{
+ if (trace) log.trace("Transaction log size is " + txLog.size());
for (int nonProgress = 0, size = txLog.size(); size > 0;)
{
- if (log.isTraceEnabled())
- log.trace("Tx Log remaining entries = " + size);
+ if (trace) log.trace("Tx Log remaining entries = " + size);
txLog.writeCommitLog(cache.getMarshaller(), out);
int newSize = txLog.size();
@@ -212,8 +192,9 @@
// of the remaining transactions.
delimitStream(out);
out.flush();
+ if (trace) log.trace("Waiting for a FLUSH");
flushTracker.waitForFlushStart(flushTimeout);
-
+ if (trace) log.trace("FLUSH received, proceeding with writing commit
log");
// Write remaining transactions
txLog.writeCommitLog(cache.getMarshaller(), out);
delimitStream(out);
Show replies by thread