2016-10-03 18:29:18 -07:00
|
|
|
#ifndef PLASMA_STORE_H
|
|
|
|
#define PLASMA_STORE_H
|
|
|
|
|
|
|
|
#include "plasma.h"
|
|
|
|
|
2016-10-11 17:58:14 -07:00
|
|
|
typedef struct plasma_store_state plasma_store_state;
|
|
|
|
|
2016-10-03 18:29:18 -07:00
|
|
|
/**
|
|
|
|
* Create a new object:
|
|
|
|
*
|
2016-10-11 17:58:14 -07:00
|
|
|
* @param s The plasma store state.
|
2016-10-03 18:29:18 -07:00
|
|
|
* @param object_id Object ID of the object to be created.
|
|
|
|
* @param data_size Size in bytes of the object to be created.
|
|
|
|
* @param metadata_size Size in bytes of the object metadata.
|
2016-10-12 12:58:15 -07:00
|
|
|
* @return Void.
|
2016-10-03 18:29:18 -07:00
|
|
|
*/
|
2016-10-12 12:58:15 -07:00
|
|
|
void create_object(plasma_store_state *s,
|
|
|
|
object_id object_id,
|
|
|
|
int64_t data_size,
|
|
|
|
int64_t metadata_size,
|
|
|
|
plasma_object *result);
|
2016-10-03 18:29:18 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get an object:
|
|
|
|
*
|
2016-10-11 17:58:14 -07:00
|
|
|
* @param s The plasma store state.
|
|
|
|
* @param conn The client connection that requests the object.
|
2016-10-03 18:29:18 -07:00
|
|
|
* @param object_id Object ID of the object to be gotten.
|
2016-10-11 17:58:14 -07:00
|
|
|
* @return The status of the object (object_status in plasma.h).
|
2016-10-03 18:29:18 -07:00
|
|
|
*/
|
2016-10-11 17:58:14 -07:00
|
|
|
int get_object(plasma_store_state *s,
|
|
|
|
int conn,
|
|
|
|
object_id object_id,
|
|
|
|
plasma_object *result);
|
2016-10-03 18:29:18 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Seal an object:
|
|
|
|
*
|
2016-10-11 17:58:14 -07:00
|
|
|
* @param s The plasma store state.
|
2016-10-03 18:29:18 -07:00
|
|
|
* @param object_id Object ID of the object to be sealed.
|
|
|
|
* @param conns Returns the connection that are waiting for this object.
|
|
|
|
The caller is responsible for destroying this array.
|
2016-10-11 17:58:14 -07:00
|
|
|
* @return Void.
|
2016-10-03 18:29:18 -07:00
|
|
|
*/
|
2016-10-11 17:58:14 -07:00
|
|
|
void seal_object(plasma_store_state *s,
|
|
|
|
object_id object_id,
|
|
|
|
UT_array **conns,
|
|
|
|
plasma_object *result);
|
2016-10-03 18:29:18 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Check if the plasma store contains an object:
|
|
|
|
*
|
2016-10-11 17:58:14 -07:00
|
|
|
* @param s The plasma store state.
|
2016-10-03 18:29:18 -07:00
|
|
|
* @param object_id Object ID that will be checked.
|
2016-10-11 17:58:14 -07:00
|
|
|
* @return OBJECT_FOUND if the object is in the store, OBJECT_NOT_FOUND if not
|
|
|
|
*/
|
|
|
|
int contains_object(plasma_store_state *s, object_id object_id);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Delete an object from the plasma store:
|
|
|
|
*
|
|
|
|
* @param s The plasma store state.
|
|
|
|
* @param object_id Object ID of the object to be deleted.
|
|
|
|
* @return Void.
|
2016-10-03 18:29:18 -07:00
|
|
|
*/
|
2016-10-11 17:58:14 -07:00
|
|
|
void delete_object(plasma_store_state *s, object_id object_id);
|
2016-10-03 18:29:18 -07:00
|
|
|
|
|
|
|
#endif /* PLASMA_STORE_H */
|