| 31 | import io.crate.sql.tree.DropSchema; |
| 32 | |
| 33 | public class DropSchemaPlan implements Plan { |
| 34 | |
| 35 | private final AnalyzedDropSchema dropSchema; |
| 36 | |
| 37 | public DropSchemaPlan(AnalyzedDropSchema dropSchema) { |
| 38 | this.dropSchema = dropSchema; |
| 39 | } |
| 40 | |
| 41 | @Override |
| 42 | public StatementType type() { |
| 43 | return StatementType.DDL; |
| 44 | } |
| 45 | |
| 46 | @Override |
| 47 | public void executeOrFail(DependencyCarrier dependencies, |
| 48 | PlannerContext plannerContext, |
| 49 | RowConsumer consumer, |
| 50 | Row params, |
| 51 | SubQueryResults subQueryResults) throws Exception { |
| 52 | DropSchema schema = dropSchema.dropSchema(); |
| 53 | DropSchemaRequest request = new DropSchemaRequest(schema.names(), schema.ifExists(), schema.mode()); |
| 54 | dependencies.client() |
| 55 | .execute(TransportDropSchema.ACTION, request) |
| 56 | .whenComplete(OneRowActionListener.oneIfAcknowledged(consumer)); |
| 57 | } |
| 58 | } |
nothing calls this directly
no outgoing calls
no test coverage detected