LOG4J2-1172 performance optimization: split up initialization method
into two parts to allow caller methods size reduction


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/b9adcad8
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/b9adcad8
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/b9adcad8

Branch: refs/heads/master
Commit: b9adcad86726bdcdd9f1150b0264edf1e96e2d92
Parents: f99dbf5
Author: rpopma <[email protected]>
Authored: Wed Nov 11 20:30:14 2015 +0900
Committer: Ralph Goers <[email protected]>
Committed: Fri Nov 20 17:39:22 2015 -0700

----------------------------------------------------------------------
 .../async/RingBufferLogEventTranslator.java     | 21 ++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b9adcad8/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEventTranslator.java
----------------------------------------------------------------------
diff --git 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEventTranslator.java
 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEventTranslator.java
index b9971ea..519ffb9 100644
--- 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEventTranslator.java
+++ 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEventTranslator.java
@@ -96,4 +96,25 @@ public class RingBufferLogEventTranslator implements
         this.currentTimeMillis = aCurrentTimeMillis;
         this.nanoTime = aNanoTime;
     }
+
+    public void setValuesPart1(final AsyncLogger anAsyncLogger, final String 
aLoggerName, final Marker aMarker,
+            final String theFqcn, final Level aLevel, final Message msg, final 
Throwable aThrowable) {
+        this.asyncLogger = anAsyncLogger;
+        this.loggerName = aLoggerName;
+        this.marker = aMarker;
+        this.fqcn = theFqcn;
+        this.level = aLevel;
+        this.message = msg;
+        this.thrown = aThrowable;
+    }
+
+    public void setValuesPart2(final Map<String, String> aMap, final 
ContextStack aContextStack, final String aThreadName,
+            final StackTraceElement aLocation, final long aCurrentTimeMillis, 
final long aNanoTime) {
+        this.contextMap = aMap;
+        this.contextStack = aContextStack;
+        this.threadName = aThreadName;
+        this.location = aLocation;
+        this.currentTimeMillis = aCurrentTimeMillis;
+        this.nanoTime = aNanoTime;
+    }
 }

Reply via email to