Use doxygen for generating documentation (#29)

* Auto-generated doxygen config file.

* Customize doxygen config file for Plasma.

* Format plasma_client.h and plasma.h for doxygen.
This commit is contained in:
Robert Nishihara
2016-09-28 18:59:00 -07:00
committed by Philipp Moritz
parent d41566a499
commit 227eab3b5a
3 changed files with 2596 additions and 33 deletions
File diff suppressed because it is too large Load Diff
+47 -24
View File
@@ -43,51 +43,58 @@ typedef struct {
int64_t construct_duration;
} plasma_object_info;
/* Represents an object id hash, can hold a full SHA1 hash */
/** Represents an object ID hash, can hold a full SHA1 hash. */
typedef struct { unsigned char id[20]; } plasma_id;
enum plasma_request_type {
/* Create a new object. */
/** Create a new object. */
PLASMA_CREATE,
/* Get an object. */
/** Get an object. */
PLASMA_GET,
/* Check if an object is present. */
/** Check if an object is present. */
PLASMA_CONTAINS,
/* Seal an object. */
/** Seal an object. */
PLASMA_SEAL,
/* Delete an object. */
/** Delete an object. */
PLASMA_DELETE,
/* Request transfer to another store. */
/** Request transfer to another store. */
PLASMA_TRANSFER,
/* Header for sending data. */
/** Header for sending data. */
PLASMA_DATA,
};
typedef struct {
/** The type of the request. */
int type;
/** The ID of the object that the request is about. */
plasma_id object_id;
/* The size of the data. */
/** The size of the object's data. */
int64_t data_size;
/* The size of the metadata. */
/** The size of the object's metadata. */
int64_t metadata_size;
/** In a transfer request, this is the IP address of the Plasma Manager to
* transfer the object to. */
uint8_t addr[4];
/** In a transfer request, this is the port of the Plasma Manager to transfer
* the object to. */
int port;
} plasma_request;
typedef struct {
/* The offset in the memory mapped file of the data. */
/** The offset in bytes in the memory mapped file of the data. */
ptrdiff_t data_offset;
/* The offset in the memory mapped file of the metadata. */
/** The offset in bytes in the memory mapped file of the metadata. */
ptrdiff_t metadata_offset;
/* The size of the memory mapped file. */
/** The size in bytes of the memory mapped file. */
int64_t map_size;
/* The size of the data. */
/** The size in bytesof the data. */
int64_t data_size;
/* The size of the metadata. */
/** The size in bytes of the metadata. */
int64_t metadata_size;
/* 1 if the object is present and 0 otherwise. Used for plasma_contains. */
/** This is used only to respond to requests of type PLASMA_CONTAINS. It is 1
* if the object is present and 0 otherwise. Used for plasma_contains. */
int has_object;
/* Numerical value of the fd of the memory mapped file in the store. */
/** The file descriptor of the memory mapped file in the store. */
int store_fd_val;
} plasma_reply;
@@ -101,25 +108,41 @@ typedef struct {
} plasma_buffer;
typedef struct {
/* Key that uniquely identifies the memory mapped file. In practice, we
* take the numerical value of the file descriptor in the object store. */
/** Key that uniquely identifies the memory mapped file. In practice, we
* take the numerical value of the file descriptor in the object store. */
int key;
/* The result of mmap for this file descriptor. */
/** The result of mmap for this file descriptor. */
uint8_t *pointer;
/* Handle for the uthash table. */
/** Handle for the uthash table. */
UT_hash_handle hh;
} client_mmap_table_entry;
/* A client connection with a plasma store */
/** Information about a connection between a Plasma Client and Plasma Store.
* This is used to avoid mapping the same files into memory multiple times. */
typedef struct {
/* File descriptor of the Unix domain socket that connects to the store. */
/** File descriptor of the Unix domain socket that connects to the store. */
int conn;
/* Table of dlmalloc buffer files that have been memory mapped so far. */
/** Table of dlmalloc buffer files that have been memory mapped so far. */
client_mmap_table_entry *mmap_table;
} plasma_store_conn;
/**
* This is used by the Plasma Client to send a request to the Plasma Store or
* the Plasma Manager.
*
* @param conn The file descriptor to use to send the request.
* @param req The address of the request to send.
* @return Void.
*/
void plasma_send_request(int conn, plasma_request *req);
/**
* This is used by the Plasma Store to send a reply to the Plasma Client.
*
* @param conn The file descriptor to use to send the reply.
* @param req The address of the reply to send.
* @return Void.
*/
void plasma_send_reply(int conn, plasma_reply *req);
#endif
+76 -9
View File
@@ -1,13 +1,40 @@
#ifndef PLASMA_CLIENT_H
#define PLASMA_CLIENT_H
/* Connect to the local plasma store UNIX domain socket with path socket_name
* and return the resulting connection. */
/**
* Connect to the local plasma store UNIX domain socket with path socket_name
* and return the resulting connection.
*
* @param socket_name The name of the socket to use to connect to the Plasma
* Store.
* @return The object containing the connection state.
*/
plasma_store_conn *plasma_store_connect(const char *socket_name);
/* Connect to a possibly remote plasma manager */
/**
* Connect to a possibly remote Plasma Manager.
*
* @param addr The IP address of the Plasma Manager to connect to.
* @param port The port of the Plasma Manager to connect to.
* @return The file descriptor to use to send messages to the Plasma Manager.
*/
int plasma_manager_connect(const char *addr, int port);
/**
* Create an object in the Plasma Store. Any metadata for this object must be
* be passed in when the object is created.
*
* @param conn The object containing the connection state.
* @param object_id The ID to use for the newly created object.
* @param size The size in bytes of the space to be allocated for this object's
data (this does not include space used for metadata).
* @param metadata The object's metadata. If there is no metadata, this pointer
should be NULL.
* @param metadata_size The size in bytes of the metadata. If there is no
metadata, this should be 0.
* @param data The address of the newly created object will be written here.
* @return Void.
*/
void plasma_create(plasma_store_conn *conn,
plasma_id object_id,
int64_t size,
@@ -15,6 +42,21 @@ void plasma_create(plasma_store_conn *conn,
int64_t metadata_size,
uint8_t **data);
/**
* Get an object from the Plasma Store. This function will block until the
* object has been created and sealed in the Plasma Store.
*
* @param conn The object containing the connection state.
* @param object_id The ID of the object to get.
* @param size The size in bytes of the retrieved object will be written at this
address.
* @param data The address of the object will be written at this address.
* @param metadata_size The size in bytes of the object's metadata will be
* written at this address.
* @param metadata The address of the object's metadata will be written at this
* address.
* @return Void.
*/
void plasma_get(plasma_store_conn *conn,
plasma_id object_id,
int64_t *size,
@@ -22,18 +64,43 @@ void plasma_get(plasma_store_conn *conn,
int64_t *metadata_size,
uint8_t **metadata);
/* Check if the object store contains a particular object and the object has
* been sealed. The result will be stored in has_object. TODO(rkn): We may want
* to indicate whether the object is currently being written. */
/**
* Check if the object store contains a particular object and the object has
* been sealed. The result will be stored in has_object.
*
* @todo: We may want to indicate if the object has been created but not sealed.
*
* @param conn The object containing the connection state.
* @param object_id The ID of the object whose presence we are checking.
* @param has_object The function will write 1 at this address if the object is
* present and 0 if it is not present.
* @return Void.
*/
void plasma_contains(plasma_store_conn *conn,
plasma_id object_id,
int *has_object);
/**
* Seal an object in the object store. The object will be immutable after this
* call.
*
* @param conn The object containing the connection state.
* @param object_id The ID of the object to seal.
* @return Void.
*/
void plasma_seal(plasma_store_conn *conn, plasma_id object_id);
/* Delete an object from the object store. This currently assumes that the
* object is present and has been sealed. TODO(rkn): We may want to allow the
* deletion of objects that are not present or haven't been sealed. */
/**
* Delete an object from the object store. This currently assumes that the
* object is present and has been sealed.
*
* @todo We may want to allow the deletion of objects that are not present or
* haven't been sealed.
*
* @param conn The object containing the connection state.
* @param object_id The ID of the object to delete.
* @return Void.
*/
void plasma_delete(plasma_store_conn *conn, plasma_id object_id);
#endif