| 44 | hbase_table_writer_(NULL) {} |
| 45 | |
| 46 | Status HBaseTableSink::Prepare(RuntimeState* state, MemTracker* parent_mem_tracker) { |
| 47 | RETURN_IF_ERROR(DataSink::Prepare(state, parent_mem_tracker)); |
| 48 | SCOPED_TIMER(profile()->total_time_counter()); |
| 49 | |
| 50 | // Get the hbase table descriptor. The table name will be used. |
| 51 | table_desc_ = static_cast<HBaseTableDescriptor*>( |
| 52 | state->desc_tbl().GetTableDescriptor(table_id_)); |
| 53 | // Now that expressions are ready to materialize tuples, create the writer. |
| 54 | hbase_table_writer_.reset( |
| 55 | new HBaseTableWriter(table_desc_, output_expr_evals_, profile())); |
| 56 | |
| 57 | // Try and init the table writer. This can create connections to HBase and |
| 58 | // to zookeeper. |
| 59 | RETURN_IF_ERROR(hbase_table_writer_->Init(state)); |
| 60 | |
| 61 | // Add a 'root partition' status in which to collect insert statistics |
| 62 | state->dml_exec_state()->AddPartition(ROOT_PARTITION_KEY, -1L, nullptr, nullptr); |
| 63 | return Status::OK(); |
| 64 | } |
| 65 | |
| 66 | Status HBaseTableSink::Send(RuntimeState* state, RowBatch* batch) { |
| 67 | SCOPED_TIMER(profile()->total_time_counter()); |
nothing calls this directly
no test coverage detected