Backend API#
- class dataclay.backend.api.BackendAPI(name, port, kv_host, kv_port)[source]#
-
- federate(session_id, object_id, external_execution_env_id, recursive)[source]#
Federate object with id provided to external execution env id specified
- Parameters:
session_id – id of the session federating objects
object_id – id of object to federate
external_execution_id – id of dest external execution environment
recursive – indicates if federation is recursive
- get_object_internal(oid, dest_replica_backend_id, update_replica_locs)[source]#
Get object internal function
- Parameters:
oid – ID of the object ot get
dest_replica_backend_id – Destination backend of objects being obtained for replica or NULL if going to client
update_replica_locs – If 1, provided replica dest backend id must be added to replica locs of obtained objects If 2, provided replica dest backend id must be removed from replica locs If 0, replicaDestBackendID field is ignored
- Returns:
Object with data
- get_object_properties(object_id, recursive)[source]#
Returns a non-persistent copy of the object with ID provided
- Parameters:
object_id – ID of the object
- Returns:
the generated non-persistent objects
- get_objects(session_id, object_ids, already_obtained_objs, recursive, dest_replica_backend_id=None, update_replica_locs=0)[source]#
Get the serialized objects with id provided
- Parameters:
session_id – ID of session
object_ids – IDs of the objects to get
recursive – Indicates if, per each object to get, also obtain its associated objects.
dest_replica_backend_id – Destination backend of objects being obtained for replica or NULL if going to client
update_replica_locs – If 1, provided replica dest backend id must be added to replica locs of obtained objects If 2, provided replica dest backend id must be removed from replica locs If 0, replicaDestBackendID field is ignored
- Returns:
List of serialized objects
- get_objects_in_other_backends(session_id, objects_in_other_backend, already_obtained_objs, recursive, dest_replica_backend_id, update_replica_locs)[source]#
Get object in another backend. This function is called from DbHandler in a recursive get.
- Parameters:
session_id – ID of session
objects_in_other_backend – List of metadata of objects to read. It is useful to avoid multiple trips.
recursive – Indicates is recursive
dest_replica_backend_id – Destination backend of objects being obtained for replica or NULL if going to client
update_replica_locs – If 1, provided replica dest backend id must be added to replica locs of obtained objects If 2, provided replica dest backend id must be removed from replica locs If 0, replicaDestBackendID field is ignored
- Returns:
List of serialized objects
- new_replica(session_id, object_id, dest_backend_id, recursive)[source]#
Creates a new replica of the object with ID provided in the backend specified.
- Parameters:
session_id – ID of session
object_id – ID of the object
dest_backend_id – destination backend id
recursive – Indicates if all sub-objects must be replicated as well.
- notify_federation(session_id, objects_to_persist)[source]#
This function will deserialize object “parameters” (i.e. object to persist and subobjects if needed) into dataClay memory heap using the same design as for volatile parameters. This function processes objects recieved from federation calls.
- Parameters:
session_id – ID of session of federation call
objects_to_persist – [num_params, imm_objs, lang_objs, vol_params, pers_params]
- notify_unfederation(session_id, object_ids)[source]#
This function is called when objects are unfederated.
- Parameters:
session_id – ID of session of federation call
object_ids – List of IDs of the objects to unfederate
- synchronize(session_id, object_id, implementation_id, serialized_value, calling_backend_id=None)[source]#
- unfederate(session_id, object_id, external_execution_env_id, recursive)[source]#
Unfederate object in external execution environment specified
- Parameters:
session_id – id of session
object_id – id of the object
external_execution_env_id – external ee
recursive – also unfederates sub-objects