dataClay package documentation

Common library client API for dataClay.

Runtime. Note that importing this module has a basic semantic: it prepares the dataClay core and sets the “client” mode for the library.

dataclay.api.init(config_file=None)

Initialization made on the client-side, with file-based settings.

Note that after a successful call to this method, subsequent calls will be a no-operation.

Parameters:config_file – The configuration file that will be used. If not set, then the DATACLAYSESSIONCONFIG environment variable will be used and the fallback will be the ./cfgfiles/session.properties path.
class dataclay.api.DataClayObject

Main class for Persistent Objects.

Objects that has to be made persistent should derive this class (either directly, through the StorageObject alias, or through a derived class).

dc_clone(recursive=False)

@postcondition: Returns a non-persistent object as a copy of the current object @return: DataClayObject non-persistent instance

dc_update(from_object)

@postcondition: Updates all fields of this object with the values of the specified object @param from_object: instance from which values must be retrieved to set fields of current object

deserialize(io_file, iface_bitmaps, metadata, cur_deserialized_python_objs)

Reciprocal to serialize.

federate(ext_dataclay_id, recursive=True)

@postcondition: Federates this object with an external dataClay instance @param ext_dataclay_id: id of the external dataClay instance @param recursive: Indicates if all sub-objects must be federated as well.

getID()

Return the string representation of the persistent object for COMPSs.

dataClay specific implementation: The objects are internally represented through ObjectID, which are UUID. In addition to that, some extra fields are added to the representation. Currently, a “COMPSs ID” will be:

<objectID>:<backendID|empty>:<classID>

In which all ID are UUID and the “hint” (backendID) can be empty.

If the object is NOT persistent, then this method returns None.

get_all_locations()

Return all the locations of this object.

get_dataset_id()

@postcondition: Return dataset id of the object @return Data set id

get_external_dataclay_info(dataclay_id)

Get external dataClay information :param dataclay_id: external dataClay ID :return: DataClayInstance information :type dataclay_id: UUID :rtype: DataClayInstance

get_federation_source()

Retrieve dataClay instance id where the object comes from or NULL :return: dataClay instance ids where this object is federated :rtype: UUID

get_federation_targets()

Retrieve dataClay instances ids where the object is federated :return: dataClay instances ids where this object is federated :rtype: set of UUID

get_hint()

@postcondition: Get hint @return Hint

get_location()

Return a single (random) location of this object.

get_master_location()

Return the uuid relative to the master location of this object.

get_memory_pinned()

@postcondition: Return the memory pinned flag of the object @return Object id

get_object_id()

@postcondition: Return object id of the object @return Object id

get_owner_session_id()

@postcondition: Get owner session id @return Owner session id

initialize_object(new_object_id=None)

@postcondition: Initialize the object @param new_object_id: Object Id of the object

initialize_object_as_persistent()

@postcondition: object is initialized as a persistent object. Flags for “persistent” state might be different in EE and client.

initialize_object_as_volatile()

@postcondition: Initialize object with state ‘volatile’ with proper flags. Usually, volatile state is created by a stub, app, exec class,.. See same function in DataClayExecutionObject for a different initialization. This design is intended to be clear with object state.

is_dirty()

@postcondition: Return TRUE if object is dirty (it was modified). FALSE otherwise. @return dirty flag

is_loaded()

@postcondition: Return TRUE if object is loaded. FALSE otherwise. @return is loaded flag

is_pending_to_register()

@postcondition: Return TRUE if object is pending to register. FALSE otherwise. @return is pending to register flag

is_persistent()

@postcondition: Return TRUE if object is persistent. FALSE otherwise. @return is persistent flag

set_dataset_id(new_dataset_id)

@postcondition: Set dataset id of the object @param new_dataset_id: dataset id

set_dirty(dirty_value)

@postcondition: Set dirty flag. @param dirty_value: The flag to set

set_hint(new_hint)

@postcondition: Set hint @param new_hint: value to set

set_loaded(isloaded)

@postcondition: Set value of loaded flag in the object @param isloaded: value to set

set_master_location(eeid)

Set the master location of this object.

set_memory_pinned(new_memory_pinned)

@postcondition: Set memory pinned flag of the object @param new_memory_pinned: memory pinned flag

set_object_id(new_object_id)

@postcondition: Set object id of the object @param new_object_id: object id

set_owner_session_id(the_owner_session_id)

@postcondition: Set ID of session of the owner of the object. @param the_owner_session_id: owner session id

set_pending_to_register(pending_to_register)

@postcondition: Set pending to register flag. @param pending_to_register: The flag to set

set_persistent(ispersistent)

@postcondition: Set value of persistent flag in the object @param ispersistent: value to set

unfederate(ext_dataclay_id=None, recursive=True)

@postcondition: Unfederate this object with an external dataClay instance @param ext_dataclay_id: id of the external dataClay instance (none means to unfederate with all dcs) @param recursive: Indicates if all sub-objects must be unfederated as well.