internal static string ToCodeName(this CompareFilter.CompareOp value)
        {
            switch (value)
            {
            case CompareFilter.CompareOp.NoOperation:
                return("NO_OP");

            case CompareFilter.CompareOp.Equal:
                return("EQUAL");

            case CompareFilter.CompareOp.NotEqual:
                return("NOT_EQUAL");

            case CompareFilter.CompareOp.GreaterThan:
                return("GREATER");

            case CompareFilter.CompareOp.GreaterThanOrEqualTo:
                return("GREATER_OR_EQUAL");

            case CompareFilter.CompareOp.LessThan:
                return("LESS");

            case CompareFilter.CompareOp.LessThanOrEqualTo:
                return("LESS_OR_EQUAL");

            default:
                throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(CompareFilter.CompareOp));
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SingleColumnValueFilter" /> class.
        /// </summary>
        /// <param name="family">The name of the column family.</param>
        /// <param name="qualifier">The name of the column qualifier.</param>
        /// <param name="compareOp">The operator.</param>
        /// <param name="comparator">The comparator to use.</param>
        /// <param name="filterIfMissing">
        /// When <c>true</c>, the entire row will be skipped if the column is not found;
        /// when <c>false</c>, the row will pass if the column is not found.
        /// </param>
        /// <param name="latestVersion">
        /// When <c>true</c>, the row will be returned if only the latest version of the column value matches;
        /// when <c>false</c>, the row will be returned if any version of the column value matches.
        /// </param>
        /// <remarks>
        /// Constructor for binary compare of the value of a single column.
        /// </remarks>
        public SingleColumnValueFilter(
            byte[] family,
            byte[] qualifier,
            CompareFilter.CompareOp compareOp,
            ByteArrayComparable comparator,
            bool filterIfMissing = false,
            bool latestVersion   = true)
        {
            family.ArgumentNotNull("family");
            qualifier.ArgumentNotNull("qualifier");

            if (!Enum.IsDefined(typeof(CompareFilter.CompareOp), compareOp))
            {
                throw new InvalidEnumArgumentException("compareOp", (int)compareOp, typeof(CompareFilter.CompareOp));
            }

            comparator.ArgumentNotNull("comparator");

            _family          = (byte[])family.Clone();
            _qualifier       = (byte[])qualifier.Clone();
            CompareOperation = compareOp;
            Comparator       = comparator;

            FilterIfMissing = filterIfMissing;
            LatestVersion   = latestVersion;
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SingleColumnValueExcludeFilter" /> class.
 /// </summary>
 /// <param name="family">The name of the column family.</param>
 /// <param name="qualifier">The name of the column qualifier.</param>
 /// <param name="compareOp">The operator.</param>
 /// <param name="comparator">The comparator to use.</param>
 /// <param name="filterIfMissing">
 /// When <c>true</c>, the entire row will be skipped if the column is not found;
 /// when <c>false</c>, the row will pass if the column is not found.
 /// </param>
 /// <param name="latestVersion">
 /// When <c>true</c>, the row will be returned if only the latest version of the column value matches;
 /// when <c>false</c>, the row will be returned if any version of the column value matches.
 /// </param>
 /// <remarks>
 /// Constructor for binary compare of the value of a single column.
 /// </remarks>
 public SingleColumnValueExcludeFilter(
     byte[] family,
     byte[] qualifier,
     CompareFilter.CompareOp compareOp,
     ByteArrayComparable comparator,
     bool filterIfMissing = false,
     bool latestVersion   = true) : base(family, qualifier, compareOp, comparator, filterIfMissing, latestVersion)
 {
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SingleColumnValueFilter" /> class.
 /// </summary>
 /// <param name="family">The name of the column family.</param>
 /// <param name="qualifier">The name of the column qualifier.</param>
 /// <param name="compareOp">The operator.</param>
 /// <param name="value">The value to compare column values against.</param>
 /// <param name="filterIfMissing">
 /// When <c>true</c>, the entire row will be skipped if the column is not found;
 /// when <c>false</c>, the row will pass if the column is not found.
 /// </param>
 /// <param name="latestVersion">
 /// When <c>true</c>, the row will be returned if only the latest version of the column value matches;
 /// when <c>false</c>, the row will be returned if any version of the column value matches.
 /// </param>
 /// <remarks>
 /// Constructor for binary compare of the value of a single column.
 /// </remarks>
 public SingleColumnValueFilter(
     byte[] family,
     byte[] qualifier,
     CompareFilter.CompareOp compareOp,
     byte[] value,
     bool filterIfMissing = false,
     bool latestVersion   = true) : this(family, qualifier, compareOp, new BinaryComparator(value), filterIfMissing, latestVersion)
 {
 }