Autodocs for `Grid Engine Mirror Interface'


Next: , Up: (dir)


1 Eventmirror


1.1 –Eventmirror

NAME
          Eventmirror -- mirroring of master lists through event client interface

FUNCTION
          The event mirror interface provides a means to easily implement
          Grid Engine components that need to have access to the masters
          object lists and therefore have to mirror them.
          
          Such components can be schedulers, proxies, monitoring tools etc.
          
          It is designed as a layer above the event client interface.
          
          Mirroring can be restricted to certain event types / object types.
          Callback functions can be installed to perform actions additional to
          pure mirroring.

BUGS
          Not yet operable on the usermapping related objects and lists.

SEE ALSO


1.2 -Eventmirror-Typedefs

NAME
          Eventmirror -- mirroring of master lists through event client interface

SYNOPSIS
          typedef enum {
             ...
          } sge_event_action;
          
          typedef enum {
             ...
          } sge_mirror_error;
          
          typedef int (*sge_mirror_callback)(sge_object_type type,
                                             sge_event_action action,
                                             lListElem *event, void *clientdata);
          

FUNCTION
          The following types are defined for use with the event mirroring
          interface:
          
          
          Different event actions are defined in the enumeration sge_event_action:
             SGE_EMA_LIST      - the whole master list has been sent
                                 (used at initialization)
             SGE_EMA_ADD       - a new object has been created
             SGE_EMA_MOD       - an object has been modified
             SGE_EMA_DEL       - an object has been deleted
             SGE_EMA_TRIGGER   - a certain action has been triggered,
                                 e.g. a scheduling run or a shutdown.
          
          Most functions of the event mirroring interface return error codes that
          are defined in the enumeration sge_mirror_error:
             SGE_EM_OK              - action performed successfully
             SGE_EM_NOT_INITIALIZED - the interface is not yet initialized
             SGE_EM_BAD_ARG         - some input parameter was incorrect
             SGE_EM_TIMEOUT         - a timeout occured
             SGE_EM_DUPLICATE_KEY   - an object should be added, but an object
                                      with the same unique identifier already
                                      exists.
             SGE_EM_KEY_NOT_FOUND   - an object with the given key was not found.
             SGE_EM_CALLBACK_FAILED - a callback function failed
             SGE_EM_PROCESS_ERRORS  - an error occured during event processing
          
          The event mirroring interface allows to install callback funktions for
          actions on certain event types. These callback functions have to have
          the same prototype as given by the function typedef sge_mirror_callback.


1.3 host


1.3.1 host_update_master_list

NAME
          host_update_master_list() -- update the master hostlists

SYNOPSIS
          sge_callback_result rqs_update_master_list(object_description
          *object_base, sge_object_type type, sge_event_action action, lListElem
          *event, void *clientdata)

FUNCTION
          Update the global master lists of hosts
          based on an event.
          The function is called from the event mirroring interface.
          Updates admin, submit or execution host list depending
          on the event received.

INPUTS
          object_description *object_base - base object
          sge_object_type type     - event type
          sge_event_action action - action to perform
          lListElem *event        - the raw event
          void *clientdata        - client data

RESULT
          bool - true, if update is successfull, else false

NOTES
          The function should only be called from the event mirror interface.

SEE ALSO


1.4 ja_task


1.4.1 ja_task_update_master_list

NAME
          ja_task_update_master_list() -- update array tasks of a job

SYNOPSIS
          bool
          ja_task_update_master_list(sge_object_type type, sge_event_action action,
                                     lListElem *event, void *clientdata)

FUNCTION
          Update the list of array tasks of a job
          based on an event.
          The function is called from the event mirroring interface.
          
          An array tasks list of parallel tasks and the
          scaled usage list are not updated in this function,
          as this data is maintained by separate events.

INPUTS
          sge_object_type type     - event type
          sge_event_action action - action to perform
          lListElem *event        - the raw event
          void *clientdata        - client data

RESULT
          bool - true, if update is successfull, else false

NOTES
          The function should only be called from the event mirror interface.

SEE ALSO


1.4.2 ja_task_update_master_list_usage

NAME
          ja_task_update_master_list_usage() -- update an array tasks usage

SYNOPSIS
          bool
          ja_task_update_master_list_usage(lList *job_list, lListElem *event)

FUNCTION
          Updates the scaled usage of an array task (also task data structure
          of a non array job).

INPUTS
          lListElem *event - event object containing the new usage list
          lList *job_list  - master job list

RESULT
          bool - true, if the operation succeeds, else false

SEE ALSO


1.5 job


1.5.1 job_update_master_list

NAME
          job_update_master_list() -- update the master list of jobs

SYNOPSIS
          bool job_update_master_list(sge_object_type type,
                                          sge_event_action action,
                                          lListElem *event, void *clientdata)

FUNCTION
          Update the global master list of jobs
          based on an event.
          The function is called from the event mirroring interface.
          
          A jobs array tasks are not updated by this function,
          as they are maintained by separate events.
          In addition, some scheduler specific attributes, that
          are only used in scheduler, are not updated.

INPUTS
          sge_object_type type     - event type
          sge_event_action action - action to perform
          lListElem *event        - the raw event
          void *clientdata        - client data

RESULT
          bool - true, if update is successfull, else false

NOTES
          The function should only be called from the event mirror interface.

SEE ALSO


1.5.2 job_update_master_list_usage

NAME
          job_update_master_list_usage() -- update usage for a jobs tasks

SYNOPSIS
          int job_update_master_list_usage(lListElem *event)

FUNCTION
          Events containing usage reports are sent for a jobs tasks.
          This can be array tasks (where a non array job has a single
          array task) or tasks of a parallel job.
          This function decides which type of task has to receive
          the updated usage report and passes the event
          information to the corresponding update functions.

INPUTS
          lListElem *event - event object containing the new usage list
          lList *job_list  - master job list

RESULT
          bool - true, if the operation succeeds, else false

SEE ALSO


1.6 pe_task


1.6.1 pe_task_update_master_list

NAME
          pe_task_update_master_list() -- update parallel tasks of an array task

SYNOPSIS
          bool
          pe_task_update_master_list(sge_object_type type, sge_event_action action,
                                     lListElem *event, void *clientdata)

FUNCTION
          Update the list of parallel tasks of an array task
          based on an event.
          The function is called from the event mirroring interface.
          
          The scaled usage list of a parallel task is not updated
          by this function, as this data is maintained by a
          separate event.

INPUTS
          sge_object_type type     - event type
          sge_event_action action - action to perform
          lListElem *event        - the raw event
          void *clientdata        - client data

RESULT
          bool - true, if update is successfull, else false

NOTES
          The function should only be called from the event mirror interface.

SEE ALSO


1.6.2 pe_task_update_master_list_usage

NAME
          pe_task_update_master_list_usage() -- update a parallel tasks usage

SYNOPSIS
          bool
          pe_task_update_master_list_usage(lList *job_list, lListElem *event)

FUNCTION
          Updates the scaled usage of a parallel task.

INPUTS
          lListElem *job_list - the master job list
          lListElem *event    - event object containing the new usage list

RESULT
          bool - true, if the operation succeeds, else false

SEE ALSO


1.7 schedd_conf


1.7.1 schedd_conf_update_master_list

NAME
          schedd_conf_update_master_list() -- update the scheduler configuration

SYNOPSIS
          bool
          schedd_conf_update_master_list(sge_object_type type,
                                         sge_event_action action,
                                         lListElem *event, void *clientdata)

FUNCTION
          Update the global master list of scheduler configurations
          based on an event.
          The function is called from the event mirroring interface.
          The list only contains one element that is replaced when a
          modify event arrives.

INPUTS
          sge_object_type type     - event type
          sge_event_action action - action to perform
          lListElem *event        - the raw event
          void *clientdata        - client data

RESULT
          bool - true, if update is successfull, else false

NOTES
          The function should only be called from the event mirror interface.

SEE ALSO


1.8 sge_mirror_initialize

NAME
          sge_mirror_initialize() -- initialize a process local event mirror interface

SYNOPSIS
          sge_mirror_error sge_mirror_initialize(ev_registration_id id,
                                                 const char *name)

FUNCTION
          Initializes internal data structures and registers with qmaster
          using the event client mechanisms.
          
          Events covering shutdown requests and qmaster shutdown notification
          are subscribed.

INPUTS
          ev_registration_id id - id used to register with qmaster
          const char *name      - name used to register with qmaster a
          bool use_global_date  - if that to true, the implemenation is not thread
                                  save anymore. This setting is to ensure, that
                                  old code is still working, without beeing rewritten.
                                  if false is put inhere, the mirror interface is
                                  thread save. The current implementation has a limit,
                                  which is, that only one thread can work on the mirror
                                  data at a time, since it is stored as thread global.
          event_client_update_func_t - a function which knows on how to handle new events.
                                       The events are stored by this function and not send
                                       out.

RESULT
          sge_mirror_error - SGE_EM_OK or an error code

SEE ALSO


1.9 sge_mirror_process_events

NAME
          sge_mirror_process_events() -- retrieve and process events

SYNOPSIS
          sge_mirror_error sge_mirror_process_events(void)

FUNCTION
          Retrieves new events from qmaster.
          If new events have arrived from qmaster, they are processed,
          that means, for each event
          - if installed, a "before mirroring" callback is called
          - the event is mirrored into the corresponding master list
          - if installed, a "after mirroring" callback is called
          
          If retrieving new events from qmaster fails over a time period
          of 10 times the configured event delivery interval (see event
          client interface, function ec_get_edtime), a timeout warning
          is generated and a new registration of the event client is
          prepared.

RESULT
          sge_mirror_error - SGE_EM_OK or an error code

SEE ALSO


1.10 sge_mirror_shutdown

NAME
          sge_mirror_shutdown() -- shutdown mirroring

SYNOPSIS
          sge_mirror_error sge_mirror_shutdown(void)

FUNCTION
          Shuts down the event mirroring mechanism:
          Unsubscribes all events, deletes contents of the corresponding
          object lists and deregisteres from qmaster.

RESULT
          sge_mirror_error - SGE_EM_OK or error code

SEE ALSO


1.11 sge_mirror_strerror

NAME
          sge_mirror_strerror() -- map errorcode to error message

SYNOPSIS
          const char* sge_mirror_strerror(sge_mirror_error num)

FUNCTION
          Returns a string describing a given error number.
          This function can be used to output error messages
          if a function of the event mirror interface fails.

INPUTS
          sge_mirror_error num - error number

RESULT
          const char* - corresponding error message

SEE ALSO


1.12 sge_mirror_subscribe

NAME
          sge_mirror_subscribe() -- subscribe certain event types

SYNOPSIS
          sge_mirror_error sge_mirror_subscribe(sge_object_type type,
                                                sge_mirror_callback callback_before,
                                                sge_mirror_callback callback_after,
                                                void *clientdata)

FUNCTION
          Subscribe a certain event type.
          Callback functions can be specified, that can be executed before the
          mirroring action and/or after the mirroring action.
          
          The corresponding data structures are initialized,
          the events associated with the event type are subscribed with the
          event client interface.

INPUTS
          lListElem *event client              - event client to work with
          sge_object_type type                 - event type to subscribe or
                                                SGE_TYPE_ALL
          sge_mirror_callback callback_before - callback to be executed before
                                                mirroring
          sge_mirror_callback callback_after  - callback to be executed after
                                                mirroring
          void *clientdata                    - clientdata to be passed to the
                                                callback functions

RESULT
          sge_mirror_error - SGE_EM_OK or an error code

SEE ALSO


1.13 sge_mirror_unsubscribe

NAME
          sge_mirror_unsubscribe() -- unsubscribe event types

SYNOPSIS
          sge_mirror_error sge_mirror_unsubscribe(sge_object_type type)

FUNCTION
          Unsubscribes a certain event type or all if SGE_TYPE_ALL is given as type.
          
          Unsubscribes the corresponding events in the underlying event client
          interface and frees data stored in the corresponding mirrored list(s).

INPUTS
          sge_object_type type - the event type to unsubscribe or SGE_TYPE_ALL

RESULT
          sge_mirror_error - SGE_EM_OK or an error code

SEE ALSO


1.14 sge_mirror_update_master_list

NAME
          sge_mirror_update_master_list() -- update a master list

SYNOPSIS
          sge_mirror_error sge_mirror_update_master_list(lList **list,
                                                         const lDescr *list_descr,
                                                         lListElem *ep,
                                                         const char *key,
                                                         sge_event_action action,
                                                         lListElem *event)

FUNCTION
          Updates a given master list according to the given event information.
          The following actions are performed (depending on parameter action):
          - SGE_EMA_LIST: an existing mirrored list is completely replaced
          - SGE_EMA_ADD:  a new element is added to the mirrored list
          - SGE_EMA_MOD:  a given element is modified
          - SGE_EMA_DEL:  a given element is deleted

INPUTS
          lList **list            - mirrored list to manipulate
          lDescr *list_descr      - descriptor of mirrored list
          lListElem *ep           - element to manipulate or NULL
          const char *key         - key of an element to manipulate
          sge_event_action action - action to perform
          lListElem *event        - raw event

RESULT
          sge_mirror_error - SGE_EM_OK, or an error code

SEE ALSO


1.15 sge_mirror_update_master_list_host_key

NAME
          sge_mirror_update_master_list_host_key() -- update a master list

SYNOPSIS
          sge_mirror_error sge_mirror_update_master_list_host_key(lList **list,
                                                                 const lDescr *list_descr,
                                                                 int key_nm,
                                                                 const char *key,
                                                                 sge_event_action action,
                                                                 lListElem *event)

FUNCTION
          Updates a certain element in a certain mirrored list.
          Which element to update is specified by a given hostname.

INPUTS
          lList **list            - the master list to update
          lDescr *list_descr      - descriptor of the master list
          int key_nm              - field identifier of the key
          const char *key         - value of the key (a hostname)
          sge_event_action action - action to perform on list
          lListElem *event        - raw event element

RESULT
          sge_mirror_error - SGE_EM_OK or an error code

SEE ALSO


1.16 sge_mirror_update_master_list_str_key

NAME
          sge_mirror_update_master_list_str_key() -- update a master list

SYNOPSIS
          sge_mirror_error sge_mirror_update_master_list_str_key(lList **list,
                                                                 const lDescr *list_descr,
                                                                 int key_nm,
                                                                 const char *key,
                                                                 sge_event_action action,
                                                                 lListElem *event)

FUNCTION
          Updates a certain element in a certain mirrored list.
          Which element to update is specified by a given string key.

INPUTS
          lList **list            - the master list to update
          lDescr *list_descr      - descriptor of the master list
          int key_nm              - field identifier of the key
          const char *key         - value of the key
          sge_event_action action - action to perform on list
          lListElem *event        - raw event element

RESULT
          sge_mirror_error - SGE_EM_OK or an error code

SEE ALSO


1.17 sharetree


1.17.1 sharetree_update_master_list

NAME
          sharetree_update_master_list() -- update the master sharetree list

SYNOPSIS
          bool
          sharetree_update_master_list(sge_object_type type, sge_event_action action,
                                       lListElem *event, void *clientdata)

FUNCTION
          Update the global master list for the sharetree
          based on an event.
          The function is called from the event mirroring interface.
          Sharetree events always contain the whole sharetree, that
          replaces an existing sharetree in the master list.

INPUTS
          sge_object_type type     - event type
          sge_event_action action - action to perform
          lListElem *event        - the raw event
          void *clientdata        - client data

RESULT
          bool - true, if update is successfull, else false

NOTES
          The function should only be called from the event mirror interface.

SEE ALSO


2 sge_mirror


2.1 ar_update_master_list

NAME
          ar_update_master_list() -- update the master advance reservation list

SYNOPSIS
          static sge_callback_result ar_update_master_list(sge_evc_class_t *evc,
          object_description *object_base, sge_object_type type, sge_event_action
          action, lListElem *event, void *clientdata)

FUNCTION
          Updates the global master list of advance reservations based on an event.
          The function is called from the event mirroring interface.

INPUTS
          sge_evc_class_t *evc            - event client class
          object_description *object_base - object base of master lists
          sge_object_type type            - event type
          sge_event_action action         - action to perform
          lListElem *event                - the raw event
          void *clientdata                - client data

RESULT
          static sge_callback_result - true, if update is successfull
                                       false if an error occured

NOTES
          MT-NOTE: ar_update_master_list() is not MT safe


2.2 sge_mirror_update_master_list_ar_key

NAME
          sge_mirror_update_master_list_ar_key() -- updates the advance reservation
                                                    master list

SYNOPSIS
          static sge_mirror_error sge_mirror_update_master_list_ar_key(lList
          **list, const lDescr *list_descr, int key_nm, const char *key,
          sge_event_action action, lListElem *event)

FUNCTION
          Updates a certain element in the advance reservation mirrored list. Which
          element to update is specified by the given AR_id as string value

INPUTS
          lList **list             - the master list to update
          const lDescr *list_descr - descriptor of the master list (AR_Type)
          int key_nm               - field identifies of the key (AR_name)
          const char *key          - AR_id as string value
          sge_event_action action  - action to perform on this list
          lListElem *event         - raw event element

RESULT
          static sge_mirror_error - SGE_EM_OK or an error code

NOTES
          MT-NOTE: sge_mirror_update_master_list_ar_key() is MT safe, needs GLOBAL_LOCK


Function Index

Table of Contents