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/908ae829
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/908ae829
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/908ae829

Branch: refs/heads/LOG4J-1181
Commit: 908ae829b449e7ec7e6269761249e3b69432d144
Parents: 79592d1
Author: rpopma <[email protected]>
Authored: Wed Nov 11 20:30:14 2015 +0900
Committer: rpopma <[email protected]>
Committed: Wed Nov 11 20:30:14 2015 +0900

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


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/908ae829/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