@Override public void setStatisticsEnabled( String executionPlanName, boolean isEnabled, AxisConfiguration axisConfiguration) throws ExecutionPlanConfigurationException { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); Map<String, ExecutionPlan> executionPlans = tenantSpecificExecutionPlans.get(tenantId); if (executionPlans != null) { ExecutionPlan executionPlan = executionPlans.get(executionPlanName); executionPlan.getExecutionPlanConfiguration().setStatisticsEnabled(isEnabled); editExecutionPlanConfiguration( executionPlan.getExecutionPlanConfiguration(), executionPlanName, tenantId, axisConfiguration); } }
@Override public ExecutionPlanConfiguration getActiveExecutionPlanConfiguration(String name, int tenantId) { Map<String, ExecutionPlan> executionPlanMap = tenantSpecificExecutionPlans.get(tenantId); if (executionPlanMap != null) { ExecutionPlan executionPlan = executionPlanMap.get(name); if (executionPlan != null) { return executionPlan.getExecutionPlanConfiguration(); } } return null; }
private void removeExecutionPlanConfiguration(String name, int tenantId) { Map<String, ExecutionPlan> executionPlanMap = tenantSpecificExecutionPlans.get(tenantId); if (executionPlanMap != null && executionPlanMap.containsKey(name)) { ExecutionPlan executionPlan = executionPlanMap.remove(name); executionPlan.shutdown(); ExecutionPlanConfiguration executionPlanConfiguration = executionPlan.getExecutionPlanConfiguration(); // releasing junction listeners. for (SiddhiEventConsumer eventConsumer : executionPlan.getSiddhiEventConsumers()) { EventProcessorValueHolder.getEventStreamService().unsubscribe(eventConsumer, tenantId); } for (EventProducer eventProducer : executionPlan.getEventProducers()) { EventProcessorValueHolder.getEventStreamService().unsubscribe(eventProducer, tenantId); } } }