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)); } }
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)); } }
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); }
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); }