Create batch_, but don't fill it with data yet. Assumes we created row_desc_.
| 415 | |
| 416 | // Create batch_, but don't fill it with data yet. Assumes we created row_desc_. |
| 417 | RowBatch* CreateRowBatch() { |
| 418 | RowBatch* batch = new RowBatch(row_desc_, BATCH_CAPACITY, &tracker_); |
| 419 | int64_t* tuple_mem = reinterpret_cast<int64_t*>( |
| 420 | batch->tuple_data_pool()->Allocate(BATCH_CAPACITY * PER_ROW_DATA)); |
| 421 | bzero(tuple_mem, BATCH_CAPACITY * PER_ROW_DATA); |
| 422 | for (int i = 0; i < BATCH_CAPACITY; ++i) { |
| 423 | int idx = batch->AddRow(); |
| 424 | TupleRow* row = batch->GetRow(idx); |
| 425 | row->SetTuple(0, reinterpret_cast<Tuple*>(&tuple_mem[i])); |
| 426 | batch->CommitLastRow(); |
| 427 | } |
| 428 | return batch; |
| 429 | } |
| 430 | |
| 431 | void GetNextBatch(RowBatch* batch, int* next_val) { |
| 432 | for (int i = 0; i < BATCH_CAPACITY; ++i) { |
nothing calls this directly
no test coverage detected