Пример #1
0
static void hugoPkRead(NDBT_Thread& thr)
{
  const ThrInput* input = (const ThrInput*)thr.get_input();
  ThrOutput* output = (ThrOutput*)thr.get_output();

  HugoTransactions hugoTrans(*input->pTab);
  output->latency.reset();
  if (input->stats)
    hugoTrans.setStatsLatency(&output->latency);

  int ret;
  ret = hugoTrans.pkReadRecords(thr.get_ndb(),
                                input->records,
                                input->batch);
  if (ret != 0)
    thr.set_err(ret);
}
Пример #2
0
static void hugoPkUpdate(NDBT_Thread& thr)
{
  const ThrInput* input = (const ThrInput*)thr.get_input();
  ThrOutput* output = (ThrOutput*)thr.get_output();

  HugoTransactions hugoTrans(*input->pTab);
  output->latency.reset();
  if (input->stats)
    hugoTrans.setStatsLatency(&output->latency);

  NDBT_ThreadSet& ths = thr.get_thread_set();
  hugoTrans.setThrInfo(ths.get_count(), thr.get_thread_no());

  int ret;
  ret = hugoTrans.pkUpdateRecords(thr.get_ndb(),
                                  input->records,
                                  input->batch);
  if (ret != 0)
    thr.set_err(ret);
}