Exemplo n.º 1
0
        public void When_I_Scan_with_a_ValueFilter_and_a_RegexStringComparator_I_get_the_expected_results()
        {
            var expectedRecords = _allExpectedRecords;
            var client          = new HBaseClient(RequestOptionsFactory.GetDefaultOptions());
            var scanner         = new Scanner();
            var filter          = new ValueFilter(CompareFilter.CompareOp.Equal, new RegexStringComparator(".*"));

            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();
                }
            }
        }
Exemplo n.º 2
0
        public void When_I_Scan_with_a_ValueFilter_I_get_the_expected_results()
        {
            var expectedRecords =
                (from r in _allExpectedRecords where r.LineNumber == 3 select r.WithAValue(null).WithBValue(null)).ToList();

            var client  = new HBaseClient(RequestOptionsFactory.GetDefaultOptions());
            var scanner = new Scanner();
            var filter  = new ValueFilter(CompareFilter.CompareOp.Equal, new BinaryComparator(BitConverter.GetBytes(3)));

            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();
                }
            }
        }
Exemplo n.º 3
0
        public void When_I_Scan_with_a_ValueFilter_and_a_RegexStringComparator_I_get_the_expected_results()
        {
            List <FilterTestRecord> expectedRecords = _allExpectedRecords;
            var client  = new HBaseClient(_credentials);
            var scanner = new Scanner();
            var filter  = new ValueFilter(CompareFilter.CompareOp.Equal, new RegexStringComparator(".*"));

            scanner.filter = filter.ToEncodedString();

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

            actualRecords.ShouldContainOnly(expectedRecords);
        }
Exemplo n.º 4
0
        public void When_I_Scan_with_a_ValueFilter_I_get_the_expected_results()
        {
            List <FilterTestRecord> expectedRecords =
                (from r in _allExpectedRecords where r.LineNumber == 3 select r.WithAValue(null).WithBValue(null)).ToList();

            var client  = new HBaseClient(_credentials);
            var scanner = new Scanner();
            var filter  = new ValueFilter(CompareFilter.CompareOp.Equal, new BinaryComparator(BitConverter.GetBytes(3)));

            scanner.filter = filter.ToEncodedString();

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

            actualRecords.ShouldContainOnly(expectedRecords);
        }