You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Gary Gregory <ga...@gmail.com> on 2016/04/12 20:27:29 UTC

Fwd: logging-log4j2 git commit: Async Loggers: support busy-spin consumer wait strategy for testing purposes. Not documented since rarely appropriate for production use. (Although there may be some rare ultra low latency use cases.)

Seems like a candidate for a switch on String, and/or introducing an enum.

Gary

---------- Forwarded message ----------
From: <rp...@apache.org>
Date: Tue, Apr 12, 2016 at 10:40 AM
Subject: logging-log4j2 git commit: Async Loggers: support busy-spin
consumer wait strategy for testing purposes. Not documented since rarely
appropriate for production use. (Although there may be some rare ultra low
latency use cases.)
To: commits@logging.apache.org


Repository: logging-log4j2
Updated Branches:
  refs/heads/master 8547f5383 -> c55ace781


Async Loggers: support busy-spin consumer wait strategy for testing
purposes. Not documented since rarely appropriate for production use.
(Although there may be some rare ultra low latency use cases.)


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

Branch: refs/heads/master
Commit: c55ace7812738008028ebe02737ed7cb582629ce
Parents: 8547f53
Author: rpopma <rp...@apache.org>
Authored: Wed Apr 13 02:40:26 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Wed Apr 13 02:40:26 2016 +0900

----------------------------------------------------------------------
 .../java/org/apache/logging/log4j/core/async/DisruptorUtil.java    | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c55ace78/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
----------------------------------------------------------------------
diff --git
a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
index c4083a4..4faa174 100644
---
a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
+++
b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
@@ -64,6 +64,8 @@ final class DisruptorUtil {
                 return new YieldingWaitStrategy();
             } else if ("Block".equalsIgnoreCase(strategy)) {
                 return new BlockingWaitStrategy();
+            } else if ("BusySpin".equalsIgnoreCase(strategy)) {
+                return new BusySpinWaitStrategy();
             } else if ("Timeout".equalsIgnoreCase(strategy)) {
                 return new TimeoutBlockingWaitStrategy(timeoutMs,
TimeUnit.MILLISECONDS);
             }




-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: logging-log4j2 git commit: Async Loggers: support busy-spin consumer wait strategy for testing purposes. Not documented since rarely appropriate for production use. (Although there may be some rare ultra low latency use cases.)

Posted by Remko Popma <re...@gmail.com>.
Sure, as long as the comparison remains case-insensitive. 

Sent from my iPhone

> On 2016/04/13, at 3:27, Gary Gregory <ga...@gmail.com> wrote:
> 
> Seems like a candidate for a switch on String, and/or introducing an enum.
> 
> Gary
> 
> ---------- Forwarded message ----------
> From: <rp...@apache.org>
> Date: Tue, Apr 12, 2016 at 10:40 AM
> Subject: logging-log4j2 git commit: Async Loggers: support busy-spin consumer wait strategy for testing purposes. Not documented since rarely appropriate for production use. (Although there may be some rare ultra low latency use cases.)
> To: commits@logging.apache.org
> 
> 
> Repository: logging-log4j2
> Updated Branches:
>   refs/heads/master 8547f5383 -> c55ace781
> 
> 
> Async Loggers: support busy-spin consumer wait strategy for testing purposes. Not documented since rarely appropriate for production use. (Although there may be some rare ultra low latency use cases.)
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
> Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/c55ace78
> Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/c55ace78
> Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/c55ace78
> 
> Branch: refs/heads/master
> Commit: c55ace7812738008028ebe02737ed7cb582629ce
> Parents: 8547f53
> Author: rpopma <rp...@apache.org>
> Authored: Wed Apr 13 02:40:26 2016 +0900
> Committer: rpopma <rp...@apache.org>
> Committed: Wed Apr 13 02:40:26 2016 +0900
> 
> ----------------------------------------------------------------------
>  .../java/org/apache/logging/log4j/core/async/DisruptorUtil.java    | 2 ++
>  1 file changed, 2 insertions(+)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c55ace78/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
> ----------------------------------------------------------------------
> diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
> index c4083a4..4faa174 100644
> --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
> +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java
> @@ -64,6 +64,8 @@ final class DisruptorUtil {
>                  return new YieldingWaitStrategy();
>              } else if ("Block".equalsIgnoreCase(strategy)) {
>                  return new BlockingWaitStrategy();
> +            } else if ("BusySpin".equalsIgnoreCase(strategy)) {
> +                return new BusySpinWaitStrategy();
>              } else if ("Timeout".equalsIgnoreCase(strategy)) {
>                  return new TimeoutBlockingWaitStrategy(timeoutMs, TimeUnit.MILLISECONDS);
>              }
> 
> 
> 
> 
> -- 
> E-Mail: garydgregory@gmail.com | ggregory@apache.org 
> Java Persistence with Hibernate, Second Edition
> JUnit in Action, Second Edition
> Spring Batch in Action
> Blog: http://garygregory.wordpress.com 
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory