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, mattsic...@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 <boa...@gmail.com>
> Authored: Fri Jun 17 19:10:12 2016 -0500
> Committer: Matt Sicker <boa...@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-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org

Reply via email to