Пример #1
0
        public void When_I_Scan_with_a_SingleColumnValueFilter_and_a_NullComparator_with_the_operator_not_equal_I_get_the_expected_results()
        {
            var expectedRecords = new List <FilterTestRecord>();

            var client  = new HBaseClient(RequestOptionsFactory.GetDefaultOptions());
            var scanner = new Scanner();

            var comparer = new NullComparator();

            var filter = new SingleColumnValueFilter(
                Encoding.UTF8.GetBytes(ColumnFamilyName1),
                Encoding.UTF8.GetBytes(LineNumberColumnName),
                CompareFilter.CompareOp.Equal,
                comparer);

            scanner.Filter = filter.ToEncodedString();


            ScannerInformation scanInfo = null;

            try
            {
                scanInfo = client.CreateScannerAsync(_tableName, scanner).Result;
                var actualRecords = RetrieveResults(scanInfo).ToList();

                actualRecords.ShouldContainOnly(expectedRecords);
            }
            finally
            {
                if (scanInfo != null)
                {
                    client.DeleteScannerAsync(_tableName, scanInfo).Wait();
                }
            }
        }
Пример #2
0
        public void When_I_Scan_with_a_SingleColumnValueFilter_and_a_NullComparator_with_the_operator_not_equal_I_get_the_expected_results()
        {
            var expectedRecords = new List <FilterTestRecord>();

            var client  = new HBaseClient(_credentials);
            var scanner = new Scanner();

            var comparer = new NullComparator();

            var filter = new SingleColumnValueFilter(
                Encoding.UTF8.GetBytes(ColumnFamilyName1),
                Encoding.UTF8.GetBytes(LineNumberColumnName),
                CompareFilter.CompareOp.Equal,
                comparer);

            scanner.filter = filter.ToEncodedString();

            ScannerInformation      scanInfo      = client.CreateScanner(_tableName, scanner);
            List <FilterTestRecord> actualRecords = RetrieveResults(scanInfo).ToList();

            actualRecords.ShouldContainOnly(expectedRecords);
        }