Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-11 08:41:04

0001 #!/usr/bin/env python
0002 # Licensed under the Apache License, Version 2.0 (the "License");
0003 # you may not use this file except in compliance with the License.
0004 # You may obtain a copy of the License at
0005 # http://www.apache.org/licenses/LICENSE-2.0
0006 #
0007 # Authors:
0008 # - Wen Guan, wen.guan@cern.ch, 2017
0009 
0010 """
0011 Hooks for EventService.
0012 """
0013 
0014 
0015 class ESHook:
0016     def get_payload(self):
0017         """
0018         Get payload to execute.
0019 
0020         :returns: dict {'payload': <cmd string>, 'output_file': <filename or without it>, 'error_file': <filename or without it>}
0021         """
0022         raise Exception("Not Implemented")
0023 
0024     def get_event_ranges(self, num_ranges=1):
0025         """
0026         Get event ranges.
0027 
0028         :param num_ranges: Number of event ranges to download, default is 1.
0029         :returns: dict of event ranges.
0030                  None if no available events.
0031         """
0032         raise Exception("Not Implemented")
0033 
0034     def handle_out_message(self, message):
0035         """
0036         Handle ES output or error message.
0037 
0038         :param message: a dict of parsed message.
0039                         For 'finished' event ranges, it's {'id': <id>, 'status': 'finished', 'output': <output>, 'cpu': <cpu>,
0040                                                            'wall': <wall>, 'message': <full message>}.
0041                         Fro 'failed' event ranges, it's {'id': <id>, 'status': 'finished', 'message': <full message>}.
0042         """
0043         raise Exception("Not Implemented")