示例#1
0
        private async Task ScanWithStartTest(string start, int expectCount)
        {
            var table = _hbaseHelper.GetTableName <Student>();

            start = start.Reverse2String();

            var cancel = new CancellationToken();

            var id = await _client.scannerOpenAsync(
                table.ToBytes(),
                start.ToBytes(),
                null,
                null,
                cancel);

            var            students    = new List <Student>();
            List <Student> perStudents = null;

            do
            {
                var tRows = await _client.scannerGetListAsync(id, 500, cancel);

                perStudents = _HbaseParser.ToReals <Student>(tRows);
                students.AddRange(perStudents);
            } while (perStudents?.Count > 0);

            Assert.Equal(start, students.First().RowKey);
            Assert.Equal(expectCount, students.Count);
        }