| 38 | namespace impala { |
| 39 | |
| 40 | DataSink* PlanRootSinkConfig::CreateSink(RuntimeState* state) const { |
| 41 | TDataSinkId sink_id = state->fragment().idx; |
| 42 | ObjectPool* pool = state->obj_pool(); |
| 43 | if (state->query_options().spool_query_results) { |
| 44 | return pool->Add(new BufferedPlanRootSink( |
| 45 | sink_id, *this, state, state->instance_ctx().debug_options)); |
| 46 | } else { |
| 47 | return pool->Add(new BlockingPlanRootSink(sink_id, *this, state)); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | PlanRootSink::PlanRootSink( |
| 52 | TDataSinkId sink_id, const DataSinkConfig& sink_config, RuntimeState* state) |