File indexing completed on 2026-04-19 08:00:01
0001 """
0002 Command spec class: a panda poller will retrieve commands from panda server and store cache them internally
0003 """
0004
0005 from .spec_base import SpecBase
0006
0007
0008 class CommandSpec(SpecBase):
0009
0010 attributesWithTypes = ("command_id:integer primary key", "command:text", "receiver:text", "params:blob", "ack_requested:integer", "processed:integer")
0011
0012 COM_reportWorkerStats = "REPORT_WORKER_STATS"
0013 COM_setNWorkers = "SET_N_WORKERS_JOBTYPE"
0014 COM_killWorkers = "KILL_WORKERS"
0015 COM_syncWorkersKill = "SYNC_WORKERS_KILL"
0016
0017
0018 receiver_map = {COM_reportWorkerStats: "propagator", COM_setNWorkers: "submitter", COM_killWorkers: "sweeper", COM_syncWorkersKill: "sweeper"}
0019
0020
0021 def __init__(self):
0022 SpecBase.__init__(self)
0023
0024
0025 def convert_command_json(self, data):
0026
0027 self.command_id = data["command_id"]
0028 self.command = data["command"]
0029 self.params = data["params"]
0030 self.ack_requested = data["ack_requested"]
0031
0032
0033
0034
0035
0036 try:
0037 self.processed = data["processed"]
0038 except KeyError:
0039 self.processed = 0