<commit_before>/*
 * The MIT License (MIT)
 * 
 * Copyright (c) 2013 <NAME>, Cinchapi Software Collective
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package org.cinchapi.concourse.server.concurrent;

import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import javax.annotation.Nullable;

import org.cinchapi.concourse.annotate.Experimental;
import org.cinchapi.concourse.server.model.Text;
import org.cinchapi.concourse.server.model.Value;
import org.cinchapi.concourse.server.storage.Functions;
import org.cinchapi.concourse.thrift.Operator;
import org.cinchapi.concourse.thrift.TObject;
import org.cinchapi.concourse.util.AutoHashMap;
import org.cinchapi.concourse.util.AutoMap;
import org.cinchapi.concourse.util.AutoSkipListMap;
import org.cinchapi.concourse.util.Transformers;

import com.google.common.base.Function;
import com.google.common.base.Preconditions;

/**
 * A RangeLock is a special {@link TLock} that is designed to protect concurrent
 * access to secondary indices (i.e. Reader A wants to find key between X and Z
 * and Writer B wants to write Z).
 * <p>
 * RangeLocks are governed by static logic that determine if, given an action,
 * key, operator (optional) and value(s),it is acceptable to grab a lock
 * representing the range.
 * </p>
 * 
 * @author jnelson
 */
@SuppressWarnings("serial")
@Experimental
public final class RangeLock extends TLock {
    // NOTE: This class does not define hashCode() or equals() because the
    // protocol defined in the parent class is the desired behaviour.

    /**
     * Return a {@link RangeLock} that can be used for reading {@code key}
     * {@code operator} {@code values}.
     * 
     * @param key
     * @param operator
     * @param values
     * @return the RangeLock<commit_msg>deprecated RangeLock<commit_after>/*
 * The MIT License (MIT)
 * 
 * Copyright (c) 2013 <NAME>, Cinchapi Software Collective
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package org.cinchapi.concourse.server.concurrent;

import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import javax.annotation.Nullable;

import org.cinchapi.concourse.annotate.Experimental;
import org.cinchapi.concourse.server.model.Text;
import org.cinchapi.concourse.server.model.Value;
import org.cinchapi.concourse.server.storage.Functions;
import org.cinchapi.concourse.thrift.Operator;
import org.cinchapi.concourse.thrift.TObject;
import org.cinchapi.concourse.util.AutoHashMap;
import org.cinchapi.concourse.util.AutoMap;
import org.cinchapi.concourse.util.AutoSkipListMap;
import org.cinchapi.concourse.util.Transformers;

import com.google.common.base.Function;
import com.google.common.base.Preconditions;

/**
 * A RangeLock is a special {@link TLock} that is designed to protect concurrent
 * access to secondary indices (i.e. Reader A wants to find key between X and Z
 * and Writer B wants to write Z).
 * <p>
 * RangeLocks are governed by static logic that determine if, given an action,
 * key, operator (optional) and value(s),it is acceptable to grab a lock
 * representing the range.
 * </p>
 * 
 * @author jnelson
 */
@SuppressWarnings("serial")
@Experimental
@Deprecated
public final class RangeLock extends TLock {
    // NOTE: This class does not define hashCode() or equals() because the
    // protocol defined in the parent class is the desired behaviour.

    /**
     * Return a {@link RangeLock} that can be used for reading {@code key}
     * {@code operator} {@code values}.
     * 
     * @param key
     * @param operator
     * @param values
     * @return the RangeLock
{'fraction_non_alphanumeric': 0.0820065057353193, 'fraction_numerical': 0.001369628488272556, 'mean_word_length': 4.2488769092542675, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1120461', 'n_tokens_mistral': 1617, 'n_tokens_neox': 1560, 'n_words': 659}