You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2016/06/18 00:10:16 UTC
logging-log4j2 git commit: Make fairness configurable in
ArrayBlockingQueueFactory
Repository: logging-log4j2
Updated Branches:
refs/heads/feature/LOG4J2-1430 68e8ecb81 -> bf997fc10
Make fairness configurable in ArrayBlockingQueueFactory
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/bf997fc1
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/bf997fc1
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/bf997fc1
Branch: refs/heads/feature/LOG4J2-1430
Commit: bf997fc1007e70a526bb20b6c90e63202c6f0886
Parents: 68e8ecb
Author: Matt Sicker <bo...@gmail.com>
Authored: Fri Jun 17 19:10:12 2016 -0500
Committer: Matt Sicker <bo...@gmail.com>
Committed: Fri Jun 17 19:10:12 2016 -0500
----------------------------------------------------------------------
.../log4j/core/async/ArrayBlockingQueueFactory.java | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bf997fc1/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
index dcad78a..ef1f05d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
@@ -5,6 +5,7 @@ import java.util.concurrent.BlockingQueue;
import org.apache.logging.log4j.core.config.Node;
import org.apache.logging.log4j.core.config.plugins.Plugin;
+import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
import org.apache.logging.log4j.core.config.plugins.PluginFactory;
/**
@@ -14,13 +15,20 @@ import org.apache.logging.log4j.core.config.plugins.PluginFactory;
*/
@Plugin(name = "ArrayBlockingQueue", category = Node.CATEGORY, elementType = BlockingQueueFactory.ELEMENT_TYPE)
public class ArrayBlockingQueueFactory<E> implements BlockingQueueFactory<E> {
+
+ private final boolean fair;
+
+ private ArrayBlockingQueueFactory(final boolean fair) {
+ this.fair = fair;
+ }
+
@Override
public BlockingQueue<E> create(int capacity) {
- return new ArrayBlockingQueue<>(capacity);
+ return new ArrayBlockingQueue<>(capacity, fair);
}
@PluginFactory
- public static <E> ArrayBlockingQueueFactory<E> createFactory() {
- return new ArrayBlockingQueueFactory<>();
+ public static <E> ArrayBlockingQueueFactory<E> createFactory(@PluginAttribute("fair") final boolean fair) {
+ return new ArrayBlockingQueueFactory<>(fair);
}
}
Re: logging-log4j2 git commit: Make fairness configurable in ArrayBlockingQueueFactory
Posted by Matt Sicker <bo...@gmail.com>.
Not at all; I think you're right. It's a confusing option.
On 17 June 2016 at 21:17, Remko Popma <re...@gmail.com> wrote:
> If you don't mind, let's remove it until a user requests it. I hope I'm
> not being too negative here. :-)
>
> Sent from my iPhone
>
> On 2016/06/18, at 11:08, Matt Sicker <bo...@gmail.com> wrote:
>
> Honestly, the only reason I added it here was because it's available. I do
> know that concurrency fairness is almost always the wrong thing to do,
> though. I can remove it.
>
> On 17 June 2016 at 20:50, Remko Popma <re...@gmail.com> wrote:
>
>> Is there any reason to expose fairness as a user configurable parameter?
>>
>> The thing is that it sounds like a good thing (so users are likely to
>> switch it on) but actually hampers performance and in our case there's no
>> real reason to require fairness...
>>
>> Sent from my iPhone
>>
>> > On 2016/06/18, at 9:10, mattsicker@apache.org wrote:
>> >
>> > Repository: logging-log4j2
>> > Updated Branches:
>> > refs/heads/feature/LOG4J2-1430 68e8ecb81 -> bf997fc10
>> >
>> >
>> > Make fairness configurable in ArrayBlockingQueueFactory
>> >
>> >
>> > Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
>> > Commit:
>> http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/bf997fc1
>> > Tree:
>> http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/bf997fc1
>> > Diff:
>> http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/bf997fc1
>> >
>> > Branch: refs/heads/feature/LOG4J2-1430
>> > Commit: bf997fc1007e70a526bb20b6c90e63202c6f0886
>> > Parents: 68e8ecb
>> > Author: Matt Sicker <bo...@gmail.com>
>> > Authored: Fri Jun 17 19:10:12 2016 -0500
>> > Committer: Matt Sicker <bo...@gmail.com>
>> > Committed: Fri Jun 17 19:10:12 2016 -0500
>> >
>> > ----------------------------------------------------------------------
>> > .../log4j/core/async/ArrayBlockingQueueFactory.java | 14
>> +++++++++++---
>> > 1 file changed, 11 insertions(+), 3 deletions(-)
>> > ----------------------------------------------------------------------
>> >
>> >
>> >
>> http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bf997fc1/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
>> > ----------------------------------------------------------------------
>> > diff --git
>> a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
>> b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
>> > index dcad78a..ef1f05d 100644
>> > ---
>> a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
>> > +++
>> b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
>> > @@ -5,6 +5,7 @@ import java.util.concurrent.BlockingQueue;
>> >
>> > import org.apache.logging.log4j.core.config.Node;
>> > import org.apache.logging.log4j.core.config.plugins.Plugin;
>> > +import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
>> > import org.apache.logging.log4j.core.config.plugins.PluginFactory;
>> >
>> > /**
>> > @@ -14,13 +15,20 @@ import
>> org.apache.logging.log4j.core.config.plugins.PluginFactory;
>> > */
>> > @Plugin(name = "ArrayBlockingQueue", category = Node.CATEGORY,
>> elementType = BlockingQueueFactory.ELEMENT_TYPE)
>> > public class ArrayBlockingQueueFactory<E> implements
>> BlockingQueueFactory<E> {
>> > +
>> > + private final boolean fair;
>> > +
>> > + private ArrayBlockingQueueFactory(final boolean fair) {
>> > + this.fair = fair;
>> > + }
>> > +
>> > @Override
>> > public BlockingQueue<E> create(int capacity) {
>> > - return new ArrayBlockingQueue<>(capacity);
>> > + return new ArrayBlockingQueue<>(capacity, fair);
>> > }
>> >
>> > @PluginFactory
>> > - public static <E> ArrayBlockingQueueFactory<E> createFactory() {
>> > - return new ArrayBlockingQueueFactory<>();
>> > + public static <E> ArrayBlockingQueueFactory<E>
>> createFactory(@PluginAttribute("fair") final boolean fair) {
>> > + return new ArrayBlockingQueueFactory<>(fair);
>> > }
>> > }
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>>
>>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>
>
--
Matt Sicker <bo...@gmail.com>
Re: logging-log4j2 git commit: Make fairness configurable in ArrayBlockingQueueFactory
Posted by Gary Gregory <ga...@gmail.com>.
On Fri, Jun 17, 2016 at 7:17 PM, Remko Popma <re...@gmail.com> wrote:
> If you don't mind, let's remove it until a user requests it. I hope I'm
> not being too negative here. :-)
>
Agreed. Thank you Matt for putting in the work but this one might fall in
the YAGNI category ;-)
Gary
> Sent from my iPhone
>
> On 2016/06/18, at 11:08, Matt Sicker <bo...@gmail.com> wrote:
>
> Honestly, the only reason I added it here was because it's available. I do
> know that concurrency fairness is almost always the wrong thing to do,
> though. I can remove it.
>
> On 17 June 2016 at 20:50, Remko Popma <re...@gmail.com> wrote:
>
>> Is there any reason to expose fairness as a user configurable parameter?
>>
>> The thing is that it sounds like a good thing (so users are likely to
>> switch it on) but actually hampers performance and in our case there's no
>> real reason to require fairness...
>>
>> Sent from my iPhone
>>
>> > On 2016/06/18, at 9:10, mattsicker@apache.org wrote:
>> >
>> > Repository: logging-log4j2
>> > Updated Branches:
>> > refs/heads/feature/LOG4J2-1430 68e8ecb81 -> bf997fc10
>> >
>> >
>> > Make fairness configurable in ArrayBlockingQueueFactory
>> >
>> >
>> > Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
>> > Commit:
>> http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/bf997fc1
>> > Tree:
>> http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/bf997fc1
>> > Diff:
>> http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/bf997fc1
>> >
>> > Branch: refs/heads/feature/LOG4J2-1430
>> > Commit: bf997fc1007e70a526bb20b6c90e63202c6f0886
>> > Parents: 68e8ecb
>> > Author: Matt Sicker <bo...@gmail.com>
>> > Authored: Fri Jun 17 19:10:12 2016 -0500
>> > Committer: Matt Sicker <bo...@gmail.com>
>> > Committed: Fri Jun 17 19:10:12 2016 -0500
>> >
>> > ----------------------------------------------------------------------
>> > .../log4j/core/async/ArrayBlockingQueueFactory.java | 14
>> +++++++++++---
>> > 1 file changed, 11 insertions(+), 3 deletions(-)
>> > ----------------------------------------------------------------------
>> >
>> >
>> >
>> http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bf997fc1/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
>> > ----------------------------------------------------------------------
>> > diff --git
>> a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
>> b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
>> > index dcad78a..ef1f05d 100644
>> > ---
>> a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
>> > +++
>> b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
>> > @@ -5,6 +5,7 @@ import java.util.concurrent.BlockingQueue;
>> >
>> > import org.apache.logging.log4j.core.config.Node;
>> > import org.apache.logging.log4j.core.config.plugins.Plugin;
>> > +import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
>> > import org.apache.logging.log4j.core.config.plugins.PluginFactory;
>> >
>> > /**
>> > @@ -14,13 +15,20 @@ import
>> org.apache.logging.log4j.core.config.plugins.PluginFactory;
>> > */
>> > @Plugin(name = "ArrayBlockingQueue", category = Node.CATEGORY,
>> elementType = BlockingQueueFactory.ELEMENT_TYPE)
>> > public class ArrayBlockingQueueFactory<E> implements
>> BlockingQueueFactory<E> {
>> > +
>> > + private final boolean fair;
>> > +
>> > + private ArrayBlockingQueueFactory(final boolean fair) {
>> > + this.fair = fair;
>> > + }
>> > +
>> > @Override
>> > public BlockingQueue<E> create(int capacity) {
>> > - return new ArrayBlockingQueue<>(capacity);
>> > + return new ArrayBlockingQueue<>(capacity, fair);
>> > }
>> >
>> > @PluginFactory
>> > - public static <E> ArrayBlockingQueueFactory<E> createFactory() {
>> > - return new ArrayBlockingQueueFactory<>();
>> > + public static <E> ArrayBlockingQueueFactory<E>
>> createFactory(@PluginAttribute("fair") final boolean fair) {
>> > + return new ArrayBlockingQueueFactory<>(fair);
>> > }
>> > }
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>>
>>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>
>
--
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: Make fairness configurable in ArrayBlockingQueueFactory
Posted by Remko Popma <re...@gmail.com>.
If you don't mind, let's remove it until a user requests it. I hope I'm not being too negative here. :-)
Sent from my iPhone
> On 2016/06/18, at 11:08, Matt Sicker <bo...@gmail.com> wrote:
>
> Honestly, the only reason I added it here was because it's available. I do know that concurrency fairness is almost always the wrong thing to do, though. I can remove it.
>
>> On 17 June 2016 at 20:50, Remko Popma <re...@gmail.com> wrote:
>> Is there any reason to expose fairness as a user configurable parameter?
>>
>> The thing is that it sounds like a good thing (so users are likely to switch it on) but actually hampers performance and in our case there's no real reason to require fairness...
>>
>> Sent from my iPhone
>>
>> > On 2016/06/18, at 9:10, mattsicker@apache.org wrote:
>> >
>> > Repository: logging-log4j2
>> > Updated Branches:
>> > refs/heads/feature/LOG4J2-1430 68e8ecb81 -> bf997fc10
>> >
>> >
>> > Make fairness configurable in ArrayBlockingQueueFactory
>> >
>> >
>> > Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
>> > Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/bf997fc1
>> > Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/bf997fc1
>> > Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/bf997fc1
>> >
>> > Branch: refs/heads/feature/LOG4J2-1430
>> > Commit: bf997fc1007e70a526bb20b6c90e63202c6f0886
>> > Parents: 68e8ecb
>> > Author: Matt Sicker <bo...@gmail.com>
>> > Authored: Fri Jun 17 19:10:12 2016 -0500
>> > Committer: Matt Sicker <bo...@gmail.com>
>> > Committed: Fri Jun 17 19:10:12 2016 -0500
>> >
>> > ----------------------------------------------------------------------
>> > .../log4j/core/async/ArrayBlockingQueueFactory.java | 14 +++++++++++---
>> > 1 file changed, 11 insertions(+), 3 deletions(-)
>> > ----------------------------------------------------------------------
>> >
>> >
>> > http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bf997fc1/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
>> > ----------------------------------------------------------------------
>> > diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
>> > index dcad78a..ef1f05d 100644
>> > --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
>> > +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
>> > @@ -5,6 +5,7 @@ import java.util.concurrent.BlockingQueue;
>> >
>> > import org.apache.logging.log4j.core.config.Node;
>> > import org.apache.logging.log4j.core.config.plugins.Plugin;
>> > +import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
>> > import org.apache.logging.log4j.core.config.plugins.PluginFactory;
>> >
>> > /**
>> > @@ -14,13 +15,20 @@ import org.apache.logging.log4j.core.config.plugins.PluginFactory;
>> > */
>> > @Plugin(name = "ArrayBlockingQueue", category = Node.CATEGORY, elementType = BlockingQueueFactory.ELEMENT_TYPE)
>> > public class ArrayBlockingQueueFactory<E> implements BlockingQueueFactory<E> {
>> > +
>> > + private final boolean fair;
>> > +
>> > + private ArrayBlockingQueueFactory(final boolean fair) {
>> > + this.fair = fair;
>> > + }
>> > +
>> > @Override
>> > public BlockingQueue<E> create(int capacity) {
>> > - return new ArrayBlockingQueue<>(capacity);
>> > + return new ArrayBlockingQueue<>(capacity, fair);
>> > }
>> >
>> > @PluginFactory
>> > - public static <E> ArrayBlockingQueueFactory<E> createFactory() {
>> > - return new ArrayBlockingQueueFactory<>();
>> > + public static <E> ArrayBlockingQueueFactory<E> createFactory(@PluginAttribute("fair") final boolean fair) {
>> > + return new ArrayBlockingQueueFactory<>(fair);
>> > }
>> > }
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
Re: logging-log4j2 git commit: Make fairness configurable in ArrayBlockingQueueFactory
Posted by Matt Sicker <bo...@gmail.com>.
Honestly, the only reason I added it here was because it's available. I do
know that concurrency fairness is almost always the wrong thing to do,
though. I can remove it.
On 17 June 2016 at 20:50, Remko Popma <re...@gmail.com> wrote:
> Is there any reason to expose fairness as a user configurable parameter?
>
> The thing is that it sounds like a good thing (so users are likely to
> switch it on) but actually hampers performance and in our case there's no
> real reason to require fairness...
>
> Sent from my iPhone
>
> > On 2016/06/18, at 9:10, mattsicker@apache.org wrote:
> >
> > Repository: logging-log4j2
> > Updated Branches:
> > refs/heads/feature/LOG4J2-1430 68e8ecb81 -> bf997fc10
> >
> >
> > Make fairness configurable in ArrayBlockingQueueFactory
> >
> >
> > Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
> > Commit:
> http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/bf997fc1
> > Tree:
> http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/bf997fc1
> > Diff:
> http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/bf997fc1
> >
> > Branch: refs/heads/feature/LOG4J2-1430
> > Commit: bf997fc1007e70a526bb20b6c90e63202c6f0886
> > Parents: 68e8ecb
> > Author: Matt Sicker <bo...@gmail.com>
> > Authored: Fri Jun 17 19:10:12 2016 -0500
> > Committer: Matt Sicker <bo...@gmail.com>
> > Committed: Fri Jun 17 19:10:12 2016 -0500
> >
> > ----------------------------------------------------------------------
> > .../log4j/core/async/ArrayBlockingQueueFactory.java | 14 +++++++++++---
> > 1 file changed, 11 insertions(+), 3 deletions(-)
> > ----------------------------------------------------------------------
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bf997fc1/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
> > ----------------------------------------------------------------------
> > diff --git
> a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
> b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
> > index dcad78a..ef1f05d 100644
> > ---
> a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
> > +++
> b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
> > @@ -5,6 +5,7 @@ import java.util.concurrent.BlockingQueue;
> >
> > import org.apache.logging.log4j.core.config.Node;
> > import org.apache.logging.log4j.core.config.plugins.Plugin;
> > +import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
> > import org.apache.logging.log4j.core.config.plugins.PluginFactory;
> >
> > /**
> > @@ -14,13 +15,20 @@ import
> org.apache.logging.log4j.core.config.plugins.PluginFactory;
> > */
> > @Plugin(name = "ArrayBlockingQueue", category = Node.CATEGORY,
> elementType = BlockingQueueFactory.ELEMENT_TYPE)
> > public class ArrayBlockingQueueFactory<E> implements
> BlockingQueueFactory<E> {
> > +
> > + private final boolean fair;
> > +
> > + private ArrayBlockingQueueFactory(final boolean fair) {
> > + this.fair = fair;
> > + }
> > +
> > @Override
> > public BlockingQueue<E> create(int capacity) {
> > - return new ArrayBlockingQueue<>(capacity);
> > + return new ArrayBlockingQueue<>(capacity, fair);
> > }
> >
> > @PluginFactory
> > - public static <E> ArrayBlockingQueueFactory<E> createFactory() {
> > - return new ArrayBlockingQueueFactory<>();
> > + public static <E> ArrayBlockingQueueFactory<E>
> createFactory(@PluginAttribute("fair") final boolean fair) {
> > + return new ArrayBlockingQueueFactory<>(fair);
> > }
> > }
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>
>
--
Matt Sicker <bo...@gmail.com>
Re: logging-log4j2 git commit: Make fairness configurable in ArrayBlockingQueueFactory
Posted by Remko Popma <re...@gmail.com>.
Is there any reason to expose fairness as a user configurable parameter?
The thing is that it sounds like a good thing (so users are likely to switch it on) but actually hampers performance and in our case there's no real reason to require fairness...
Sent from my iPhone
> On 2016/06/18, at 9:10, mattsicker@apache.org wrote:
>
> Repository: logging-log4j2
> Updated Branches:
> refs/heads/feature/LOG4J2-1430 68e8ecb81 -> bf997fc10
>
>
> Make fairness configurable in ArrayBlockingQueueFactory
>
>
> Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
> Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/bf997fc1
> Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/bf997fc1
> Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/bf997fc1
>
> Branch: refs/heads/feature/LOG4J2-1430
> Commit: bf997fc1007e70a526bb20b6c90e63202c6f0886
> Parents: 68e8ecb
> Author: Matt Sicker <bo...@gmail.com>
> Authored: Fri Jun 17 19:10:12 2016 -0500
> Committer: Matt Sicker <bo...@gmail.com>
> Committed: Fri Jun 17 19:10:12 2016 -0500
>
> ----------------------------------------------------------------------
> .../log4j/core/async/ArrayBlockingQueueFactory.java | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bf997fc1/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
> ----------------------------------------------------------------------
> diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
> index dcad78a..ef1f05d 100644
> --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
> +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/ArrayBlockingQueueFactory.java
> @@ -5,6 +5,7 @@ import java.util.concurrent.BlockingQueue;
>
> import org.apache.logging.log4j.core.config.Node;
> import org.apache.logging.log4j.core.config.plugins.Plugin;
> +import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
> import org.apache.logging.log4j.core.config.plugins.PluginFactory;
>
> /**
> @@ -14,13 +15,20 @@ import org.apache.logging.log4j.core.config.plugins.PluginFactory;
> */
> @Plugin(name = "ArrayBlockingQueue", category = Node.CATEGORY, elementType = BlockingQueueFactory.ELEMENT_TYPE)
> public class ArrayBlockingQueueFactory<E> implements BlockingQueueFactory<E> {
> +
> + private final boolean fair;
> +
> + private ArrayBlockingQueueFactory(final boolean fair) {
> + this.fair = fair;
> + }
> +
> @Override
> public BlockingQueue<E> create(int capacity) {
> - return new ArrayBlockingQueue<>(capacity);
> + return new ArrayBlockingQueue<>(capacity, fair);
> }
>
> @PluginFactory
> - public static <E> ArrayBlockingQueueFactory<E> createFactory() {
> - return new ArrayBlockingQueueFactory<>();
> + public static <E> ArrayBlockingQueueFactory<E> createFactory(@PluginAttribute("fair") final boolean fair) {
> + return new ArrayBlockingQueueFactory<>(fair);
> }
> }
>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org