本文整理汇总了C#中HBaseClient.DeleteScannerAsync方法的典型用法代码示例。如果您正苦于以下问题:C# HBaseClient.DeleteScannerAsync方法的具体用法?C# HBaseClient.DeleteScannerAsync怎么用?C# HBaseClient.DeleteScannerAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HBaseClient
的用法示例。
在下文中一共展示了HBaseClient.DeleteScannerAsync方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: When_I_Scan_all_I_get_the_expected_results
public void When_I_Scan_all_I_get_the_expected_results()
{
var client = new HBaseClient(_credentials);
var scan = new Scanner();
RequestOptions scanOptions = RequestOptions.GetDefaultOptions();
scanOptions.AlternativeEndpoint = Constants.RestEndpointBaseZero;
ScannerInformation scanInfo = null;
try
{
scanInfo = client.CreateScannerAsync(_tableName, scan, scanOptions).Result;
List<FilterTestRecord> actualRecords = RetrieveResults(scanInfo, scanOptions).ToList();
actualRecords.ShouldContainOnly(_allExpectedRecords);
}
finally
{
if (scanInfo != null)
{
client.DeleteScannerAsync(_tableName, scanInfo, scanOptions).Wait();
}
}
}
示例2: When_I_Scan_with_a_RowFilter_I_get_the_expected_results
public void When_I_Scan_with_a_RowFilter_I_get_the_expected_results()
{
FilterTestRecord example = _allExpectedRecords.First();
List<FilterTestRecord> expectedRecords = (from r in _allExpectedRecords where r.RowKey == example.RowKey select r).ToList();
var client = new HBaseClient(_credentials);
var scanner = new Scanner();
var filter = new RowFilter(CompareFilter.CompareOp.Equal, new BinaryComparator(Encoding.UTF8.GetBytes(example.RowKey)));
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();
}
}
}
示例3: When_I_Scan_with_a_RandomRowFilter_I_get_the_expected_results
public void When_I_Scan_with_a_RandomRowFilter_I_get_the_expected_results()
{
var client = new HBaseClient(_credentials);
var scanner = new Scanner();
// set this large enough so that we get all records back
var filter = new RandomRowFilter(2000.0F);
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(_allExpectedRecords);
}
finally
{
if (scanInfo != null)
{
client.DeleteScannerAsync(_tableName, scanInfo, scanOptions).Wait();
}
}
}
示例4: When_I_Scan_with_a_PrefixFilter_I_get_the_expected_results
public void When_I_Scan_with_a_PrefixFilter_I_get_the_expected_results()
{
FilterTestRecord example = _allExpectedRecords.First();
byte[] rawRowkey = Encoding.UTF8.GetBytes(example.RowKey);
const int prefixLength = 4;
var prefix = new byte[prefixLength];
Array.Copy(rawRowkey, prefix, prefixLength);
List<FilterTestRecord> expectedRecords = (from r in _allExpectedRecords
let rawKey = Encoding.UTF8.GetBytes(r.RowKey)
where rawKey[0] == prefix[0] && rawKey[1] == prefix[1] && rawKey[2] == prefix[2] && rawKey[3] == prefix[3]
select r).ToList();
var client = new HBaseClient(_credentials);
var scanner = new Scanner();
var filter = new PrefixFilter(prefix);
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();
}
}
}
示例5: When_I_Scan_with_a_TimestampsFilter_I_get_the_expected_results
public void When_I_Scan_with_a_TimestampsFilter_I_get_the_expected_results()
{
List<FilterTestRecord> expectedRecords = _allExpectedRecords;
// scan all and retrieve timestamps
var client = new HBaseClient(_credentials);
var scanner = new Scanner();
RequestOptions scanOptions = RequestOptions.GetDefaultOptions();
scanOptions.AlternativeEndpoint = Constants.RestEndpointBaseZero;
ScannerInformation scanAll = null;
List<long> timestamps = null;
try
{
scanAll = client.CreateScannerAsync(_tableName, scanner, scanOptions).Result;
timestamps = RetrieveTimestamps(scanAll, scanOptions).ToList();
}
finally
{
if (scanAll != null)
{
client.DeleteScannerAsync(_tableName, scanAll, scanOptions).Wait();
}
}
Assert.IsNotNull(timestamps);
// timestamps scan
scanner = new Scanner();
var filter = new TimestampsFilter(timestamps);
scanner.filter = filter.ToEncodedString();
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();
}
}
}
示例6: When_I_Scan_with_a_PageFilter_I_get_the_expected_results
public void When_I_Scan_with_a_PageFilter_I_get_the_expected_results()
{
var client = new HBaseClient(_credentials);
var scanner = new Scanner();
var filter = new PageFilter(2);
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.Count.ShouldBeGreaterThanOrEqualTo(2);
}
finally
{
if (scanInfo != null)
{
client.DeleteScannerAsync(_tableName, scanInfo, scanOptions).Wait();
}
}
}
示例7: When_I_Scan_with_a_InclusiveStopFilter_I_get_the_expected_results
public void When_I_Scan_with_a_InclusiveStopFilter_I_get_the_expected_results()
{
FilterTestRecord example = (from r in _allExpectedRecords where r.LineNumber == 2 select r).Single();
byte[] rawRowKey = Encoding.UTF8.GetBytes(example.RowKey);
List<FilterTestRecord> expectedRecords = (from r in _allExpectedRecords where r.LineNumber <= 2 select r).ToList();
var client = new HBaseClient(_credentials);
var scanner = new Scanner();
var filter = new InclusiveStopFilter(rawRowKey);
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();
}
}
}
示例8: HBaseClient
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();
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();
}
}
}
示例9: When_I_Scan_with_a_FilterList_with_OR_logic_I_get_the_expected_results
public void When_I_Scan_with_a_FilterList_with_OR_logic_I_get_the_expected_results()
{
List<FilterTestRecord> expectedRecords = (from r in _allExpectedRecords where r.LineNumber <= 2 select r).ToList();
var client = new HBaseClient(_credentials);
var scanner = new Scanner();
Filter f0 = new SingleColumnValueFilter(
Encoding.UTF8.GetBytes(ColumnFamilyName1),
Encoding.UTF8.GetBytes(LineNumberColumnName),
CompareFilter.CompareOp.Equal,
BitConverter.GetBytes(1));
Filter f1 = new SingleColumnValueFilter(
Encoding.UTF8.GetBytes(ColumnFamilyName1),
Encoding.UTF8.GetBytes(LineNumberColumnName),
CompareFilter.CompareOp.LessThanOrEqualTo,
BitConverter.GetBytes(2));
var filter = new FilterList(FilterList.Operator.MustPassOne, f0, f1);
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();
}
}
}
示例10: When_I_Scan_with_a_ColumnRangeFilter_I_get_the_expected_results
public void When_I_Scan_with_a_ColumnRangeFilter_I_get_the_expected_results()
{
List<FilterTestRecord> expectedRecords = (from r in _allExpectedRecords select r.WithLineNumberValue(0).WithBValue(null)).ToList();
var client = new HBaseClient(_credentials);
var scanner = new Scanner();
var filter = new ColumnRangeFilter(Encoding.UTF8.GetBytes(ColumnNameA), true, Encoding.UTF8.GetBytes(ColumnNameB), false);
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();
}
}
}
示例11: When_I_Scan_with_a_WhileMatchFilter_I_get_the_expected_results
public void When_I_Scan_with_a_WhileMatchFilter_I_get_the_expected_results()
{
List<FilterTestRecord> expectedRecords = (from r in _allExpectedRecords where r.LineNumber == 0 select r.WithBValue(null)).ToList();
var client = new HBaseClient(_credentials);
var scanner = new Scanner();
var filter = new WhileMatchFilter(new ValueFilter(CompareFilter.CompareOp.NotEqual, new BinaryComparator(BitConverter.GetBytes(0))));
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();
}
}
}
示例12: When_I_Scan_with_a_ValueFilter_and_a_RegexStringComparator_I_get_the_expected_results
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();
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();
}
}
}
示例13: When_I_Scan_with_a_KeyOnlyFilter_I_get_the_expected_results
public void When_I_Scan_with_a_KeyOnlyFilter_I_get_the_expected_results()
{
// a key only filter does not return column values
List<FilterTestRecord> expectedRecords =
(from r in _allExpectedRecords select new FilterTestRecord(r.RowKey, 0, string.Empty, string.Empty)).ToList();
var client = new HBaseClient(_credentials);
var scanner = new Scanner();
var filter = new KeyOnlyFilter();
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();
}
}
}
示例14: When_I_Scan_with_a_ColumnCountGetFilter_I_get_the_expected_results
public void When_I_Scan_with_a_ColumnCountGetFilter_I_get_the_expected_results()
{
// B column should not be returned, so set the value to null.
List<FilterTestRecord> expectedRecords = (from r in _allExpectedRecords select r.WithBValue(null)).ToList();
var client = new HBaseClient(_credentials);
var scanner = new Scanner();
var filter = new ColumnCountGetFilter(2);
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();
}
}
}
示例15: When_I_Scan_with_a_MultipleColumnPrefixFilter_I_get_the_expected_results
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();
}
}
}