Author: mircea.markus
Date: 2008-04-30 08:17:13 -0400 (Wed, 30 Apr 2008)
New Revision: 5770
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeyValueCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GravitateDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java
Log:
performance improvement - cache trace level
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeyValueCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeyValueCommand.java 2008-04-30
12:00:36 UTC (rev 5769)
+++
core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeyValueCommand.java 2008-04-30
12:17:13 UTC (rev 5770)
@@ -22,7 +22,7 @@
{
public static final int METHOD_ID = 26;
private static final Log log = LogFactory.getLog(GetKeyValueCommand.class);
- private static boolean trace;
+ private static boolean trace = log.isTraceEnabled();
private Notifier notifier;
private Object key;
@@ -30,12 +30,10 @@
public GetKeyValueCommand()
{
- trace = log.isTraceEnabled();
}
public GetKeyValueCommand(Fqn<?> fqn, Object key, boolean sendNodeEvent)
{
- this();
this.fqn = fqn;
this.key = key;
this.sendNodeEvent = sendNodeEvent;
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/read/GravitateDataCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/read/GravitateDataCommand.java 2008-04-30
12:00:36 UTC (rev 5769)
+++
core/trunk/src/main/java/org/jboss/cache/commands/read/GravitateDataCommand.java 2008-04-30
12:17:13 UTC (rev 5770)
@@ -41,16 +41,14 @@
private boolean searchSubtrees;
private static final Log log = LogFactory.getLog(GravitateDataCommand.class);
- private static boolean trace;
+ private static boolean trace = log.isTraceEnabled();
public GravitateDataCommand()
{
- trace = log.isTraceEnabled();
}
public GravitateDataCommand(Fqn fqn, boolean searchSubtrees)
{
- this();
this.fqn = fqn;
this.searchSubtrees = searchSubtrees;
}
@@ -120,8 +118,7 @@
// break out of the inner loop searching through the dead
node's various backups
if (actualNode != null) break;
}
- }
- else
+ } else
{
backupNodeFqn = Fqn.fromRelativeFqn(backupRoot, fqn);
// use a get() call into the cache to make sure cache loading
takes place.
@@ -143,8 +140,7 @@
if (actualNode == null)
{
return GravitateResult.noDataFound();
- }
- else
+ } else
{
// make sure we LOAD data for this node!!
actualNode.getData();
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java 2008-04-30
12:00:36 UTC (rev 5769)
+++
core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java 2008-04-30
12:17:13 UTC (rev 5770)
@@ -34,16 +34,14 @@
private InterceptorChain interceptorChain;
private static final Log log = LogFactory.getLog(ClusteredGetCommand.class);
- private static boolean trace;
+ private static boolean trace = log.isTraceEnabled();
public ClusteredGetCommand()
{
- trace = log.isTraceEnabled();
}
public ClusteredGetCommand(Boolean searchBackupSubtrees, DataCommand dataCommand)
{
- this();
this.searchBackupSubtrees = searchBackupSubtrees;
this.dataCommand = dataCommand;
}
@@ -88,8 +86,7 @@
{
results.add(true);
results.add(callResults);
- }
- else
+ } else
{
results.add(false);
results.add(null);
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-04-30
12:00:36 UTC (rev 5769)
+++
core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-04-30
12:17:13 UTC (rev 5770)
@@ -39,7 +39,7 @@
private DataContainer dataContainer;
private static final Log log =
LogFactory.getLog(DataGravitationCleanupCommand.class);
- private static boolean trace;
+ private static boolean trace = log.isTraceEnabled();
/* parameters */
private GlobalTransaction globalTransaction;
@@ -49,12 +49,10 @@
public DataGravitationCleanupCommand()
{
- trace = log.isTraceEnabled();
}
public DataGravitationCleanupCommand(Fqn primary, Fqn backup)
{
- this();
this.fqn = primary;
this.backup = backup;
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java 2008-04-30
12:00:36 UTC (rev 5769)
+++
core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java 2008-04-30
12:17:13 UTC (rev 5770)
@@ -31,7 +31,7 @@
private InterceptorChain invoker;
private static final Log log = LogFactory.getLog(ReplicateCommand.class);
- private static boolean trace;
+ private static boolean trace = log.isTraceEnabled();
/**
* optimisation - rather than constructing a new list each for scenarios where a
single modification needs
@@ -42,12 +42,10 @@
public ReplicateCommand()
{
- trace = log.isTraceEnabled();
}
public ReplicateCommand(List<ReplicableCommand> modifications)
{
- this();
if (modifications != null && modifications.size() == 1)
{
singleModification = modifications.get(0);
@@ -123,13 +121,11 @@
if (returnValueForRemoteCall(cacheCommand))
{
result = retVal;
- }
- else
+ } else
{
result = null;
}
- }
- else
+ } else
{
result = cacheCommand.perform(null);
}
@@ -139,8 +135,7 @@
if (!isPutForExternalRead(cacheCommand))
{
throw ex;
- }
- else
+ } else
{
if (trace)
log.trace("Caught an exception, but since this is a
putForExternalRead() call, suppressing the exception. Exception is:", ex);
@@ -191,8 +186,7 @@
if (commandId == SINGLE_METHOD_ID)
{
singleModification = (ReplicableCommand) args[0];
- }
- else
+ } else
{
modifications = (List<ReplicableCommand>) args[0];
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java 2008-04-30
12:00:36 UTC (rev 5769)
+++
core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java 2008-04-30
12:17:13 UTC (rev 5770)
@@ -36,7 +36,7 @@
{
public static final int METHOD_ID = 47;
private static final Log log = LogFactory.getLog(InvalidateCommand.class);
- private static boolean trace;
+ private static boolean trace = log.isTraceEnabled();
/* dependencies*/
private boolean isOptimisticLocking;
@@ -46,13 +46,11 @@
public InvalidateCommand()
{
super(null);
- trace = log.isTraceEnabled();
}
public InvalidateCommand(Fqn fqn)
{
super(fqn);
- trace = log.isTraceEnabled();
}
@Inject
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java 2008-04-30
12:00:36 UTC (rev 5769)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java 2008-04-30
12:17:13 UTC (rev 5770)
@@ -24,8 +24,8 @@
{
public static final int METHOD_ID = 36;
private static final Log log = LogFactory.getLog(MoveCommand.class);
- private static boolean trace;
-
+ private static boolean trace = log.isTraceEnabled();
+
/* params */
private Fqn to;
private Notifier notifier;
@@ -35,7 +35,6 @@
public void injectNotifier(Notifier notifier)
{
this.notifier = notifier;
- trace = log.isTraceEnabled();
}
public MoveCommand()
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java 2008-04-30
12:00:36 UTC (rev 5769)
+++
core/trunk/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java 2008-04-30
12:17:13 UTC (rev 5770)
@@ -28,8 +28,7 @@
public static final int ERASE_VERSIONED_METHOD_ID = 38;
private static final Log log = LogFactory.getLog(PutDataMapCommand.class);
- private static boolean trace;
-
+ private static boolean trace = log.isTraceEnabled();
/* parameters*/
private Map data;
boolean createUndoOps;
@@ -38,7 +37,6 @@
public PutDataMapCommand()
{
- trace = log.isTraceEnabled();
}
public PutDataMapCommand(GlobalTransaction globalTransaction, Fqn fqn, Map data,
boolean createUndoOps, boolean eraseContents)
@@ -121,8 +119,7 @@
if (isVersioned())
{
return eraseContents ? ERASE_VERSIONED_METHOD_ID : VERSIONED_METHOD_ID;
- }
- else
+ } else
{
return eraseContents ? ERASE_METHOD_ID : METHOD_ID;
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveDataCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveDataCommand.java 2008-04-30
12:00:36 UTC (rev 5769)
+++
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveDataCommand.java 2008-04-30
12:17:13 UTC (rev 5770)
@@ -25,7 +25,7 @@
public static final int VERSIONED_METHOD_ID = 42;
private static final Log log = LogFactory.getLog(RemoveDataCommand.class);
- private static boolean trace;
+ private static boolean trace = log.isTraceEnabled();
/* parameters*/
private boolean createUndoops;
@@ -35,12 +35,10 @@
public RemoveDataCommand()
{
- trace = log.isTraceEnabled();
}
public RemoveDataCommand(GlobalTransaction gtx, Fqn fqn, boolean createUndoops,
boolean sendNodeEvent, boolean eviction)
{
- this();
this.globalTransaction = gtx;
this.fqn = fqn;
this.createUndoops = createUndoops;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java 2008-04-30
12:00:36 UTC (rev 5769)
+++
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java 2008-04-30
12:17:13 UTC (rev 5770)
@@ -25,7 +25,7 @@
public static final int VERSIONED_METHOD_ID = 41;
private static final Log log = LogFactory.getLog(RemoveKeyCommand.class);
- private static boolean trace;
+ private static boolean trace = log.isTraceEnabled();
/* parameters */
private Object key;
@@ -34,7 +34,6 @@
public RemoveKeyCommand()
{
- trace = log.isTraceEnabled();
}
public RemoveKeyCommand(GlobalTransaction gtx, Fqn fqn, Object key, boolean
createUndoOps)
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java 2008-04-30
12:00:36 UTC (rev 5769)
+++
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java 2008-04-30
12:17:13 UTC (rev 5770)
@@ -23,7 +23,7 @@
public static final int METHOD_ID = 5;
public static final int VERSIONED_METHOD_ID = 40;
private static final Log log = LogFactory.getLog(RemoveNodeCommand.class);
- private static boolean trace;
+ private static boolean trace = log.isTraceEnabled();
/*parameters*/
private boolean createUndoOps;
@@ -35,7 +35,6 @@
public RemoveNodeCommand()
{
- trace = log.isTraceEnabled();
}
public RemoveNodeCommand(GlobalTransaction globalTransaction, Fqn fqn, boolean
createUndoOps, boolean skipSendingNodeEvents, boolean eviction)