Module gridftpClient :: Class PerformanceMarkerPlugin
[hide private]
[frames] | no frames]

Class PerformanceMarkerPlugin

source code

object --+
         |
        PerformanceMarkerPlugin

A wrapping of the Globus GridFTP API globus_ftp_client_plugin_t for use with the performance marker plugin.

Instance Methods [hide private]
instance
__init__(self, beginCB, markerCB, completeCB, arg)
Constructs an instance.
source code
None
__del__(self)
Destroy an instance.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, beginCB, markerCB, completeCB, arg)
(Constructor)

source code 

Constructs an instance. A wrapped pointer to the Globus C type that is created is stored as the ._plugin attribute to the instance. A wrapper pointer to the C struct used to hold pointers to the Python callback functions is also stored as the ._callback attribute.

The callbacks must have the following structure:

beginCB

def callback(arg, handle, src, dst, restart):

  • arg: the user argument passed in when plugin is created
  • handle: the wrapped pointer to the client handle
  • src: the source URL for the transfer
  • dst: the destination URL for the transfer
  • restart: an integer indicating if the transfer has been restarted or not

markerCB

def callback(arg, handle, timestamp, timestamp_tenth, stripe_index, num_stripes, nbytes):

  • arg: the user argument passed in when plugin is created
  • handle: the wrapped pointer to the client handle
  • timestamp: integer indicating at which time the nbytes argument is valid
  • timestamp_tenth: integer indicating the tenth place for the time at which nbytes argument is valid
  • stripe_index: the stripe for which the marker is valid (note that stripe is not same as parallel connection)
  • num_stripes: the number of stripes for this transfer
  • nbytes: the number of bytes transferred so far

completeCB

def callback(arg, handle, success):

  • arg: the user argument passed in when plugin is created
  • handle: the wrapped pointer to the client handle
  • success: integer indicating if the transfer completed successfully with 0 indicating failure
Parameters:
  • beginCB (callable) - the Python function to call when a transfer begins
  • markerCB (callable) - the Python function to call when a performance marker is received
  • completeCB (callable) - the Python function to call when a transfer completes
Returns: instance
an instance of the class
Raises:
Overrides: object.__init__

__del__(self)
(Destructor)

source code 

Destroy an instance. The wrapped pointer to the Globus C type is used by globus_free() to free all the memory associated with the Globus C type. The wrapped pointer to the C struct used to hold pointers to the callback functions is also freed.

Returns: None
None
Raises: