# Path: networking_odl/db/db.py
# LOG = logging.getLogger(__name__)
# def get_pending_or_processing_ops(context, object_uuid, operation=None):
# def get_pending_delete_ops_with_parent(context, object_type, parent_id):
# def get_all_db_rows(context):
# def get_all_db_rows_by_state(context, state):
# def get_oldest_pending_db_row_with_lock(context):
# def delete_dependency(context, entry):
# def update_db_row_state(context, row, state, flush=True):
# def update_pending_db_row_retry(context, row, retry_count):
# def delete_row(context, row=None, row_id=None, flush=True):
# def create_pending_row(context, object_type, object_uuid,
#                        operation, data, depending_on=None):
# def delete_pending_rows(context, operations_to_delete):
# def _update_periodic_task_state(context, expected_state, state, task):
# def was_periodic_task_executed_recently(context, task, interval):
# def lock_periodic_task(context, task):
# def unlock_periodic_task(context, task):
# def update_periodic_task(context, task, operation=None):
# def delete_rows_by_state_and_time(context, state, time_delta):
# def reset_processing_rows(context, max_timedelta):


from neutron_lib import context as neutron_context
from neutron_lib.db import api as db_api
from oslo_log import log as logging
from oslo_service import loopingcall
from networking_odl.db import db
        self.timer.stop()
        try:
            self.timer.wait()
        except AttributeError:
            # NOTE(yamahata): workaround
            # some tests call this cleanup without calling start
            pass

    @db_api.retry_if_session_inactive()
    @db_api.CONTEXT_WRITER.savepoint
    def _set_operation(self, context, operation):
        db.update_periodic_task(context, task=self.task,
                                operation=operation)

    def _execute_op(self, operation, context):
        op_details = operation.__name__
        if operation.__doc__:
            op_details += " (%s)" % operation.__doc__

        try:
            LOG.info("Starting %s phase of periodic task %s.",
                     op_details, self.task)
            self._set_operation(context, operation)
            operation(context)
            LOG.info("Finished %s phase of %s task.", op_details, self.task)
        except Exception:
            LOG.exception("Failed during periodic task operation %s.",
                          op_details)

    def task_already_executed_recently(self, context):

# Path: networking_odl/db/db.py
# LOG = logging.getLogger(__name__)
# def get_pending_or_processing_ops(context, object_uuid, operation=None):
# def get_pending_delete_ops_with_parent(context, object_type, parent_id):
# def get_all_db_rows(context):
# def get_all_db_rows_by_state(context, state):
# def get_oldest_pending_db_row_with_lock(context):
# def delete_dependency(context, entry):
# def update_db_row_state(context, row, state, flush=True):
# def update_pending_db_row_retry(context, row, retry_count):
# def delete_row(context, row=None, row_id=None, flush=True):
# def create_pending_row(context, object_type, object_uuid,
#                        operation, data, depending_on=None):
# def delete_pending_rows(context, operations_to_delete):
# def _update_periodic_task_state(context, expected_state, state, task):
# def was_periodic_task_executed_recently(context, task, interval):
# def lock_periodic_task(context, task):
# def unlock_periodic_task(context, task):
# def update_periodic_task(context, task, operation=None):
# def delete_rows_by_state_and_time(context, state, time_delta):
# def reset_processing_rows(context, max_timedelta):


# Path: networking_odl/journal/periodic_task.py
from neutron_lib import context as neutron_context
from neutron_lib.db import api as db_api
from oslo_log import log as logging
from oslo_service import loopingcall
from networking_odl.db import db

        self.timer.stop()
        try:
            self.timer.wait()
        except AttributeError:
            # NOTE(yamahata): workaround
            # some tests call this cleanup without calling start
            pass

    @db_api.retry_if_session_inactive()
    @db_api.CONTEXT_WRITER.savepoint
    def _set_operation(self, context, operation):
        db.update_periodic_task(context, task=self.task,
                                operation=operation)

    def _execute_op(self, operation, context):
        op_details = operation.__name__
        if operation.__doc__:
            op_details += " (%s)" % operation.__doc__

        try:
            LOG.info("Starting %s phase of periodic task %s.",
                     op_details, self.task)
            self._set_operation(context, operation)
            operation(context)
            LOG.info("Finished %s phase of %s task.", op_details, self.task)
        except Exception:
            LOG.exception("Failed during periodic task operation %s.",
                          op_details)

    def task_already_executed_recently(self, context):

        return db.was_periodic_task_executed_recently(