public void When_I_Scan_with_a_MultipleColumnPrefixFilter_I_get_the_expected_results() { List<FilterTestRecord> expectedRecords = (from r in _allExpectedRecords select r.WithLineNumberValue(0)).ToList(); var client = new HBaseClient(_credentials); var scanner = new Scanner(); // set this large enough so that we get all records back var prefixes = new List<byte[]> { Encoding.UTF8.GetBytes(ColumnNameA), Encoding.UTF8.GetBytes(ColumnNameB) }; var filter = new MultipleColumnPrefixFilter(prefixes); scanner.filter = filter.ToEncodedString(); RequestOptions scanOptions = RequestOptions.GetDefaultOptions(); scanOptions.AlternativeEndpoint = Constants.RestEndpointBaseZero; ScannerInformation scanInfo = null; try { scanInfo = client.CreateScannerAsync(_tableName, scanner, scanOptions).Result; List<FilterTestRecord> actualRecords = RetrieveResults(scanInfo, scanOptions).ToList(); actualRecords.ShouldContainOnly(expectedRecords); } finally { if (scanInfo != null) { client.DeleteScannerAsync(_tableName, scanInfo, scanOptions).Wait(); } } }
public void When_I_Scan_with_a_MultipleColumnPrefixFilter_I_get_the_expected_results() { List<FilterTestRecord> expectedRecords = (from r in _allExpectedRecords select r.WithLineNumberValue(0)).ToList(); var client = new HBaseClient(_credentials); var scanner = new Scanner(); // set this large enough so that we get all records back var prefixes = new List<byte[]> { Encoding.UTF8.GetBytes(ColumnNameA), Encoding.UTF8.GetBytes(ColumnNameB) }; var filter = new MultipleColumnPrefixFilter(prefixes); scanner.filter = filter.ToEncodedString(); ScannerInformation scanInfo = client.CreateScanner(_tableName, scanner); List<FilterTestRecord> actualRecords = RetrieveResults(scanInfo).ToList(); actualRecords.ShouldContainOnly(expectedRecords); }