def on_success(self, retval, task_id, args, kwargs): super(ConfigurationRecommendation, self).on_success(retval, task_id, args, kwargs) result_id = args[0]['newest_result_id'] result = Result.objects.get(pk=result_id) # Replace result with formatted result formatted_params = Parser.format_dbms_knobs(result.dbms.pk, retval['recommendation']) task_meta = TaskMeta.objects.get(task_id=task_id) retval['recommendation'] = formatted_params task_meta.result = retval task_meta.save() # Create next configuration to try config = Parser.create_knob_configuration(result.dbms.pk, retval['recommendation']) retval['recommendation'] = config result.next_configuration = JSONUtil.dumps(retval) result.save()
def on_success(self, retval, task_id, args, kwargs): super(UpdateTask, self).on_success(retval, task_id, args, kwargs) result_id = args[0]['newest_result_id'] result = Result.objects.get(pk=result_id) # Replace result with formatted result formatted_params = Parser.format_dbms_knobs(result.dbms.pk, retval) task_meta = TaskMeta.objects.get(task_id=task_id) task_meta.result = formatted_params task_meta.save() # Create next configuration to try nondefault_params = JSONUtil.loads(result.session.nondefault_settings) config = Parser.create_knob_configuration(result.dbms.pk, formatted_params, nondefault_params) result.next_configuration = config result.save()