2016-09-05 15:34:11 -07:00
|
|
|
#ifndef PLASMA_MANAGER_H
|
|
|
|
#define PLASMA_MANAGER_H
|
|
|
|
|
|
|
|
#include <poll.h>
|
2016-09-07 20:19:37 -07:00
|
|
|
#include "utarray.h"
|
2016-09-05 15:34:11 -07:00
|
|
|
|
2016-09-07 20:19:37 -07:00
|
|
|
/* The buffer size in bytes. Data will get transfered in multiples of this */
|
|
|
|
#define BUFSIZE 4096
|
2016-09-05 15:34:11 -07:00
|
|
|
|
2016-09-08 15:28:27 -07:00
|
|
|
enum connection_type { CONNECTION_REDIS, CONNECTION_LISTENER, CONNECTION_DATA };
|
2016-09-07 20:19:37 -07:00
|
|
|
|
|
|
|
enum data_connection_type {
|
|
|
|
/* Connection to send commands and metadata to the manager. */
|
|
|
|
DATA_CONNECTION_HEADER,
|
|
|
|
/* Connection to send data to another manager. */
|
|
|
|
DATA_CONNECTION_WRITE,
|
|
|
|
/* Connection to receive data from another manager. */
|
|
|
|
DATA_CONNECTION_READ
|
2016-09-05 15:34:11 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct {
|
2016-09-07 20:19:37 -07:00
|
|
|
/* Of type data_connection_type. */
|
2016-09-05 15:34:11 -07:00
|
|
|
int type;
|
2016-09-07 20:19:37 -07:00
|
|
|
/* Local socket of the plasma store that is accessed for reading or writing
|
|
|
|
* data for this connection. */
|
2016-09-05 15:34:11 -07:00
|
|
|
int store_conn;
|
2016-09-07 20:19:37 -07:00
|
|
|
/* Buffer this connection is reading from or writing to. */
|
2016-09-05 15:34:11 -07:00
|
|
|
plasma_buffer buf;
|
2016-09-07 20:19:37 -07:00
|
|
|
/* Current position in the buffer. */
|
2016-09-05 15:34:11 -07:00
|
|
|
int64_t cursor;
|
2016-09-07 20:19:37 -07:00
|
|
|
} data_connection;
|
2016-09-05 15:34:11 -07:00
|
|
|
|
|
|
|
#endif
|