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 Harvester EventService.
0012 """
0013 
0014 from pilot.eventservice.eshook import ESHook
0015 
0016 
0017 class HarvesterESHook(ESHook):
0018     def get_payload(self):
0019         """
0020         Get payload to execute.
0021 
0022         :returns: dict {'payload': <cmd string>, 'output_file': <filename or without it>, 'error_file': <filename or without it>}
0023         """
0024         raise Exception("Not Implemented")
0025 
0026     def get_event_ranges(self, num_ranges=1):
0027         """
0028         Get event ranges.
0029 
0030         :param num_ranges: Number of event ranges to download, default is 1.
0031 
0032         :returns: dict of event ranges.
0033                  None if no available events.
0034         """
0035         raise Exception("Not Implemented")
0036 
0037     def handle_out_message(self, message):
0038         """
0039         Handle ES output or error messages.
0040 
0041         :param message: a dict of parsed message.
0042                         For 'finished' event ranges, it's {'id': <id>, 'status': 'finished', 'output': <output>, 'cpu': <cpu>,
0043                                                            'wall': <wall>, 'message': <full message>}.
0044                         Fro 'failed' event ranges, it's {'id': <id>, 'status': 'finished', 'message': <full message>}.
0045         """
0046         raise Exception("Not Implemented")