当前位置: 首页>>代码示例>>C#>>正文


C# HBaseClient.DeleteScannerAsync方法代码示例

本文整理汇总了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();
         }
     }
 }
开发者ID:hdinsight,项目名称:hbase-sdk-for-net,代码行数:21,代码来源:FilterTests.cs

示例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();
                }
            }
        }
开发者ID:hdinsight,项目名称:hbase-sdk-for-net,代码行数:28,代码来源:FilterTests.cs

示例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();
                }
            }
        }
开发者ID:hdinsight,项目名称:hbase-sdk-for-net,代码行数:26,代码来源:FilterTests.cs

示例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();
                }
            }
        }
开发者ID:hdinsight,项目名称:hbase-sdk-for-net,代码行数:36,代码来源:FilterTests.cs

示例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();
                }
            }
        }
开发者ID:hdinsight,项目名称:hbase-sdk-for-net,代码行数:46,代码来源:FilterTests.cs

示例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();
                }
            }
        }
开发者ID:hdinsight,项目名称:hbase-sdk-for-net,代码行数:24,代码来源:FilterTests.cs

示例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();
                }
            }
        }
开发者ID:hdinsight,项目名称:hbase-sdk-for-net,代码行数:29,代码来源:FilterTests.cs

示例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();
                }
            }
        }
开发者ID:hdinsight,项目名称:hbase-sdk-for-net,代码行数:33,代码来源:FilterTests.cs

示例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();
                }
            }
        }
开发者ID:hdinsight,项目名称:hbase-sdk-for-net,代码行数:39,代码来源:FilterTests.cs

示例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();
                }
            }
        }
开发者ID:hdinsight,项目名称:hbase-sdk-for-net,代码行数:26,代码来源:FilterTests.cs

示例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();
                }
            }
        }
开发者ID:hdinsight,项目名称:hbase-sdk-for-net,代码行数:26,代码来源:FilterTests.cs

示例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();
                }
            }
        }
开发者ID:hdinsight,项目名称:hbase-sdk-for-net,代码行数:25,代码来源:FilterTests.cs

示例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();
                }
            }
        }
开发者ID:hdinsight,项目名称:hbase-sdk-for-net,代码行数:28,代码来源:FilterTests.cs

示例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();
                }
            }
        }
开发者ID:hdinsight,项目名称:hbase-sdk-for-net,代码行数:27,代码来源:FilterTests.cs

示例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();
                }
            }
        }
开发者ID:hdinsight,项目名称:hbase-sdk-for-net,代码行数:29,代码来源:FilterTests.cs


注:本文中的HBaseClient.DeleteScannerAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。