コード例 #1
0
 public async Task ExecPut(int count)
 {
     for (var i = 0; i < count; i++)
     {
         var rowKey = Program.GenerateRandomKey();
         var rs     = await _client.Put(new MutateCall(Program.Table, rowKey, Program.Values));
     }
 }
コード例 #2
0
        public async Task ExecPut(int count)
        {
            var convertCache = new ConvertCache().BuildCache <Student>(EndianBitConverter.BigEndian);

            for (var i = 0; i < count; i++)
            {
                var rowKey  = Program.GenerateRandomKey();
                var student = Program.StudentFaker.Generate();
                var values  = HBaseConvert.Instance.ConvertToDictionary(student, convertCache);
                var rs      = await _client.Put(new MutateCall(Program.Table, rowKey, values));
            }
        }
コード例 #3
0
        public async Task ExecPut(int count)
        {
            var tasks = new List <Task <MutateResponse> >();

            for (var i = 0; i < count; i++)
            {
                var rowKey = Program.GenerateRandomKey();
                var rs     = _client.Put(new MutateCall(Program.Table, rowKey, Program.Values)
                {
                    Timestamp = new DateTime(2019, 1, 1, 1, 1, 1),
                });
                tasks.Add(rs);
            }

            await Task.WhenAll(tasks);
        }
コード例 #4
0
        public async Task ExecPut(int count)
        {
            var tasks        = new List <Task <MutateResponse> >();
            var convertCache = new ConvertCache().BuildCache <Student>(EndianBitConverter.BigEndian);

            for (var i = 0; i < count; i++)
            {
                var student = Program.StudentFaker.Generate();
                var values  = HBaseConvert.Instance.ConvertToDictionary(student, convertCache);
                var rowKey  = Program.GenerateRandomKey();
                var rs      = _client.Put(new MutateCall(Program.Table, rowKey, values)
                {
                    Timestamp = new DateTime(2019, 1, 1, 1, 1, 1),
                });
                tasks.Add(rs);
            }

            await Task.WhenAll(tasks);
        }