Example usage for java.util.concurrent.locks ReentrantReadWriteLock ReentrantReadWriteLock

List of usage examples for java.util.concurrent.locks ReentrantReadWriteLock ReentrantReadWriteLock

Introduction

In this page you can find the example usage for java.util.concurrent.locks ReentrantReadWriteLock ReentrantReadWriteLock.

Prototype

public ReentrantReadWriteLock() 

Source Link

Document

Creates a new ReentrantReadWriteLock with default (nonfair) ordering properties.

Usage

From source file:org.mule.modules.loggly.async.AsyncWorkManager.java

public AsyncWorkManager(String inputsURL, String inputKey, String tags) {
    this.buffer = new CircularFifoBuffer();
    this.inputKey = inputKey;
    this.inputsURL = inputKey;
    this.tags = tags;

    lock = new ReentrantReadWriteLock();

    thread = new Thread(new MessageConsumer());
    thread.start();//w ww .jav  a  2  s.  c  om
}

From source file:com.comcast.viper.flume2storm.utility.circular.ReadWriteCircularList.java

/**
 * Constructor for a new circular list backed by the list provided
 * /*from  w  ww  .j  a  va2 s .c  o m*/
 * @param list
 *          A list of items
 */
public ReadWriteCircularList(final List<T> list) {
    this.list = list;
    lock = new ReentrantReadWriteLock();
    pointer = 0;
}

From source file:com.anhth12.lambda.app.speed.ALSSpeedModel.java

public ALSSpeedModel(int features) {
    Preconditions.checkArgument(features > 0);
    this.features = features;
    X = HashObjObjMaps.newMutableMap();/*from  w ww  .j av  a  2 s . c  o m*/
    Y = HashObjObjMaps.newMutableMap();
    recentNewUsers = new HashSet<>();
    recentNewItems = new HashSet<>();
    xLock = new ReentrantReadWriteLock();
    yLock = new ReentrantReadWriteLock();
}

From source file:com.espertech.esper.filter.FilterParamIndexEquals.java

/**
 * Constructs the index for exact matches.
 * @param propertyName is the name of the event property
 * @param eventType describes the event type and is used to obtain a getter instance for the property
 *//*  w w w .ja  v a 2s . c o m*/
public FilterParamIndexEquals(String propertyName, EventType eventType) {
    super(propertyName, FilterOperator.EQUAL, eventType);

    constantsMap = new HashMap<Object, EventEvaluator>();
    constantsMapRWLock = new ReentrantReadWriteLock();
}

From source file:com.espertech.esper.filter.FilterParamIndexIn.java

public FilterParamIndexIn(FilterSpecLookupable lookupable) {
    super(FilterOperator.IN_LIST_OF_VALUES, lookupable);

    constantsMap = new HashMap<Object, List<EventEvaluator>>();
    evaluatorsMap = new HashMap<MultiKeyUntyped, EventEvaluator>();
    constantsMapRWLock = new ReentrantReadWriteLock();
}

From source file:com.espertech.esper.filter.FilterParamIndexDoubleRangeBase.java

protected FilterParamIndexDoubleRangeBase(FilterSpecLookupable lookupable, FilterOperator filterOperator) {
    super(filterOperator, lookupable);

    ranges = new TreeMap<DoubleRange, EventEvaluator>(new DoubleRangeComparator());
    rangesNullEndpoints = new IdentityHashMap<DoubleRange, EventEvaluator>();
    rangesRWLock = new ReentrantReadWriteLock();
}

From source file:com.espertech.esper.filter.FilterParamIndexNotIn.java

public FilterParamIndexNotIn(FilterSpecLookupable lookupable) {
    super(FilterOperator.NOT_IN_LIST_OF_VALUES, lookupable);

    constantsMap = new HashMap<Object, Set<EventEvaluator>>();
    filterValueEvaluators = new HashMap<MultiKeyUntyped, EventEvaluator>();
    evaluatorsSet = new HashSet<EventEvaluator>();
    constantsMapRWLock = new ReentrantReadWriteLock();
}

From source file:com.espertech.esper.filter.FilterHandleSetNode.java

/**
 * Constructor./*from  w  ww  .  j  a  v  a2s.  co  m*/
 */
public FilterHandleSetNode() {
    callbackSet = new LinkedHashSet<FilterHandle>();
    indizes = new LinkedList<FilterParamIndexBase>();
    nodeRWLock = new ReentrantReadWriteLock();
}

From source file:com.espertech.esper.filter.EventTypeIndex.java

/**
 * Constructor./*from  www  .  j a  va  2  s  .c  o  m*/
 */
public EventTypeIndex() {
    eventTypes = new HashMap<EventType, FilterHandleSetNode>();
    eventTypesRWLock = new ReentrantReadWriteLock();
}

From source file:com.espertech.esper.filter.FilterParamIndexCompareString.java

public FilterParamIndexCompareString(FilterSpecLookupable lookupable, FilterOperator filterOperator) {
    super(filterOperator, lookupable);

    constantsMap = new TreeMap<Object, EventEvaluator>();
    constantsMapRWLock = new ReentrantReadWriteLock();

    if ((filterOperator != FilterOperator.GREATER) && (filterOperator != FilterOperator.GREATER_OR_EQUAL)
            && (filterOperator != FilterOperator.LESS) && (filterOperator != FilterOperator.LESS_OR_EQUAL)) {
        throw new IllegalArgumentException("Invalid filter operator for index of " + filterOperator);
    }//from   w  w  w .j  a  v  a2s  .co  m
}