Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
plasma Namespace Reference

Namespaces

 flatbuf
 

Classes

struct  Client
 Contains all information that is associated with a Plasma store client. More...
 
class  EventLoop
 
class  EvictionPolicy
 The eviction policy. More...
 
class  LRUCache
 
struct  NotificationQueue
 
struct  ObjectBuffer
 Object buffer data structure. More...
 
struct  ObjectRequest
 Object request data structure. Used for Wait. More...
 
struct  ObjectTableEntry
 This type is used by the Plasma store. More...
 
class  PlasmaClient
 
struct  PlasmaObject
 
class  PlasmaStore
 
struct  PlasmaStoreInfo
 The plasma store information that is exposed to the eviction policy. More...
 
class  UniqueID
 

Typedefs

typedef UniqueID ObjectID
 
typedef std::unordered_map< ObjectID, std::unique_ptr< ObjectTableEntry > > ObjectTable
 Mapping from ObjectIDs to information about the object. More...
 
typedef long long TimerID
 
typedef std::unordered_map< ObjectID, ObjectRequestObjectRequestMap
 Mapping from object IDs to type and status of the request. More...
 

Enumerations

enum  ObjectLocation : int32_t { ObjectLocation::Local, ObjectLocation::Remote, ObjectLocation::Nonexistent }
 
enum  ObjectRequestType : int { ObjectRequestType::PLASMA_QUERY_LOCAL = 1, ObjectRequestType::PLASMA_QUERY_ANYWHERE }
 
enum  ObjectState : int { ObjectState::PLASMA_CREATED = 1, ObjectState::PLASMA_SEALED }
 
enum  ObjectStatus : int { ObjectStatus::OBJECT_NOT_FOUND = 0, ObjectStatus::OBJECT_FOUND = 1 }
 

Functions

Status WriteBytes (int fd, uint8_t *cursor, size_t length)
 
Status WriteMessage (int fd, flatbuf::MessageType type, int64_t length, uint8_t *bytes)
 
Status ReadBytes (int fd, uint8_t *cursor, size_t length)
 
Status ReadMessage (int fd, flatbuf::MessageType *type, std::vector< uint8_t > *buffer)
 
int BindIpcSock (const std::string &pathname, bool shall_listen)
 
int ConnectIpcSock (const std::string &pathname)
 
Status ConnectIpcSocketRetry (const std::string &pathname, int num_retries, int64_t timeout, int *fd)
 
int AcceptClient (int socket_fd)
 
std::unique_ptr< uint8_t[]> ReadMessageAsync (int sock)
 
ObjectTableEntryGetObjectTableEntry (PlasmaStoreInfo *store_info, const ObjectID &object_id)
 Get an entry from the object table and return NULL if the object_id is not present. More...
 
int WarnIfSigpipe (int status, int client_sock)
 Print a warning if the status is less than zero. More...
 
std::unique_ptr< uint8_t[]> CreateObjectInfoBuffer (flatbuf::ObjectInfoT *object_info)
 
template<class T >
bool VerifyFlatbuffer (T *object, uint8_t *data, size_t size)
 
Status PlasmaReceive (int sock, MessageType message_type, std::vector< uint8_t > *buffer)
 
Status SendCreateRequest (int sock, ObjectID object_id, int64_t data_size, int64_t metadata_size, int device_num)
 
Status ReadCreateRequest (uint8_t *data, size_t size, ObjectID *object_id, int64_t *data_size, int64_t *metadata_size, int *device_num)
 
Status SendCreateReply (int sock, ObjectID object_id, PlasmaObject *object, PlasmaError error, int64_t mmap_size)
 
Status ReadCreateReply (uint8_t *data, size_t size, ObjectID *object_id, PlasmaObject *object, int *store_fd, int64_t *mmap_size)
 
Status SendAbortRequest (int sock, ObjectID object_id)
 
Status ReadAbortRequest (uint8_t *data, size_t size, ObjectID *object_id)
 
Status SendAbortReply (int sock, ObjectID object_id)
 
Status ReadAbortReply (uint8_t *data, size_t size, ObjectID *object_id)
 
Status SendSealRequest (int sock, ObjectID object_id, unsigned char *digest)
 
Status ReadSealRequest (uint8_t *data, size_t size, ObjectID *object_id, unsigned char *digest)
 
Status SendSealReply (int sock, ObjectID object_id, PlasmaError error)
 
Status ReadSealReply (uint8_t *data, size_t size, ObjectID *object_id)
 
Status SendGetRequest (int sock, const ObjectID *object_ids, int64_t num_objects, int64_t timeout_ms)
 
Status ReadGetRequest (uint8_t *data, size_t size, std::vector< ObjectID > &object_ids, int64_t *timeout_ms)
 
Status SendGetReply (int sock, ObjectID object_ids[], std::unordered_map< ObjectID, PlasmaObject > &plasma_objects, int64_t num_objects, const std::vector< int > &store_fds, const std::vector< int64_t > &mmap_sizes)
 
Status ReadGetReply (uint8_t *data, size_t size, ObjectID object_ids[], PlasmaObject plasma_objects[], int64_t num_objects, std::vector< int > &store_fds, std::vector< int64_t > &mmap_sizes)
 
Status SendReleaseRequest (int sock, ObjectID object_id)
 
Status ReadReleaseRequest (uint8_t *data, size_t size, ObjectID *object_id)
 
Status SendReleaseReply (int sock, ObjectID object_id, PlasmaError error)
 
Status ReadReleaseReply (uint8_t *data, size_t size, ObjectID *object_id)
 
Status SendDeleteRequest (int sock, const std::vector< ObjectID > &object_ids)
 
Status ReadDeleteRequest (uint8_t *data, size_t size, std::vector< ObjectID > *object_ids)
 
Status SendDeleteReply (int sock, const std::vector< ObjectID > &object_ids, const std::vector< PlasmaError > &errors)
 
Status ReadDeleteReply (uint8_t *data, size_t size, std::vector< ObjectID > *object_ids, std::vector< PlasmaError > *errors)
 
Status SendStatusRequest (int sock, const ObjectID *object_ids, int64_t num_objects)
 
Status ReadStatusRequest (uint8_t *data, size_t size, ObjectID object_ids[], int64_t num_objects)
 
Status SendStatusReply (int sock, ObjectID object_ids[], int object_status[], int64_t num_objects)
 
int64_t ReadStatusReply_num_objects (uint8_t *data, size_t size)
 
Status ReadStatusReply (uint8_t *data, size_t size, ObjectID object_ids[], int object_status[], int64_t num_objects)
 
Status SendContainsRequest (int sock, ObjectID object_id)
 
Status ReadContainsRequest (uint8_t *data, size_t size, ObjectID *object_id)
 
Status SendContainsReply (int sock, ObjectID object_id, bool has_object)
 
Status ReadContainsReply (uint8_t *data, size_t size, ObjectID *object_id, bool *has_object)
 
Status SendListRequest (int sock)
 
Status ReadListRequest (uint8_t *data, size_t size)
 
Status SendListReply (int sock, const ObjectTable &objects)
 
Status ReadListReply (uint8_t *data, size_t size, ObjectTable *objects)
 
Status SendConnectRequest (int sock)
 
Status ReadConnectRequest (uint8_t *data, size_t size)
 
Status SendConnectReply (int sock, int64_t memory_capacity)
 
Status ReadConnectReply (uint8_t *data, size_t size, int64_t *memory_capacity)
 
Status SendEvictRequest (int sock, int64_t num_bytes)
 
Status ReadEvictRequest (uint8_t *data, size_t size, int64_t *num_bytes)
 
Status SendEvictReply (int sock, int64_t num_bytes)
 
Status ReadEvictReply (uint8_t *data, size_t size, int64_t &num_bytes)
 
Status SendFetchRequest (int sock, const ObjectID *object_ids, int64_t num_objects)
 
Status ReadFetchRequest (uint8_t *data, size_t size, std::vector< ObjectID > &object_ids)
 
Status SendWaitRequest (int sock, ObjectRequest object_requests[], int64_t num_requests, int num_ready_objects, int64_t timeout_ms)
 
Status ReadWaitRequest (uint8_t *data, size_t size, ObjectRequestMap &object_requests, int64_t *timeout_ms, int *num_ready_objects)
 
Status SendWaitReply (int sock, const ObjectRequestMap &object_requests, int num_ready_objects)
 
Status ReadWaitReply (uint8_t *data, size_t size, ObjectRequest object_requests[], int *num_ready_objects)
 
Status SendSubscribeRequest (int sock)
 
Status SendDataRequest (int sock, ObjectID object_id, const char *address, int port)
 
Status ReadDataRequest (uint8_t *data, size_t size, ObjectID *object_id, char **address, int *port)
 
Status SendDataReply (int sock, ObjectID object_id, int64_t object_size, int64_t metadata_size)
 
Status ReadDataReply (uint8_t *data, size_t size, ObjectID *object_id, int64_t *object_size, int64_t *metadata_size)
 

Variables

constexpr int64_t kPlasmaDefaultReleaseDelay = 64
 We keep a queue of unreleased objects cached in the client until we start sending release requests to the store. More...
 
constexpr int64_t kUniqueIDSize = 20
 
constexpr int64_t kDigestSize = sizeof(uint64_t)
 Size of object hash digests. More...
 
const PlasmaStoreInfoplasma_config
 
constexpr int kEventLoopTimerDone = AE_NOMORE
 Constant specifying that the timer is done and it will be removed. More...
 
constexpr int kEventLoopRead = AE_READABLE
 Read event on the file descriptor. More...
 
constexpr int kEventLoopWrite = AE_WRITABLE
 Write event on the file descriptor. More...
 
constexpr int64_t kPlasmaProtocolVersion = 0x0000000000000000
 
constexpr int64_t kBlockSize = 64
 Allocation granularity used in plasma for object allocation. More...
 

Typedef Documentation

◆ ObjectID

◆ ObjectRequestMap

typedef std::unordered_map<ObjectID, ObjectRequest> plasma::ObjectRequestMap

Mapping from object IDs to type and status of the request.

◆ ObjectTable

typedef std::unordered_map<ObjectID, std::unique_ptr<ObjectTableEntry> > plasma::ObjectTable

Mapping from ObjectIDs to information about the object.

◆ TimerID

typedef long long plasma::TimerID

Enumeration Type Documentation

◆ ObjectLocation

enum plasma::ObjectLocation : int32_t
strong
Enumerator
Local 
Remote 
Nonexistent 

◆ ObjectRequestType

enum plasma::ObjectRequestType : int
strong
Enumerator
PLASMA_QUERY_LOCAL 

Query for object in the local plasma store.

PLASMA_QUERY_ANYWHERE 

Query for object in the local plasma store or in a remote plasma store.

◆ ObjectState

enum plasma::ObjectState : int
strong
Enumerator
PLASMA_CREATED 

Object was created but not sealed in the local Plasma Store.

PLASMA_SEALED 

Object is sealed and stored in the local Plasma Store.

◆ ObjectStatus

enum plasma::ObjectStatus : int
strong
Enumerator
OBJECT_NOT_FOUND 

The object was not found.

OBJECT_FOUND 

The object was found.

Function Documentation

◆ AcceptClient()

int plasma::AcceptClient ( int  socket_fd)

◆ BindIpcSock()

int plasma::BindIpcSock ( const std::string &  pathname,
bool  shall_listen 
)

◆ ConnectIpcSock()

int plasma::ConnectIpcSock ( const std::string &  pathname)

◆ ConnectIpcSocketRetry()

Status plasma::ConnectIpcSocketRetry ( const std::string &  pathname,
int  num_retries,
int64_t  timeout,
int *  fd 
)

◆ CreateObjectInfoBuffer()

std::unique_ptr<uint8_t[]> plasma::CreateObjectInfoBuffer ( flatbuf::ObjectInfoT *  object_info)

◆ GetObjectTableEntry()

ObjectTableEntry* plasma::GetObjectTableEntry ( PlasmaStoreInfo store_info,
const ObjectID object_id 
)

Get an entry from the object table and return NULL if the object_id is not present.

Parameters
store_infoThe PlasmaStoreInfo that contains the object table.
object_idThe object_id of the entry we are looking for.
Returns
The entry associated with the object_id or NULL if the object_id is not present.

◆ PlasmaReceive()

Status plasma::PlasmaReceive ( int  sock,
MessageType  message_type,
std::vector< uint8_t > *  buffer 
)

◆ ReadAbortReply()

Status plasma::ReadAbortReply ( uint8_t *  data,
size_t  size,
ObjectID object_id 
)

◆ ReadAbortRequest()

Status plasma::ReadAbortRequest ( uint8_t *  data,
size_t  size,
ObjectID object_id 
)

◆ ReadBytes()

Status plasma::ReadBytes ( int  fd,
uint8_t *  cursor,
size_t  length 
)

◆ ReadConnectReply()

Status plasma::ReadConnectReply ( uint8_t *  data,
size_t  size,
int64_t *  memory_capacity 
)

◆ ReadConnectRequest()

Status plasma::ReadConnectRequest ( uint8_t *  data,
size_t  size 
)

◆ ReadContainsReply()

Status plasma::ReadContainsReply ( uint8_t *  data,
size_t  size,
ObjectID object_id,
bool *  has_object 
)

◆ ReadContainsRequest()

Status plasma::ReadContainsRequest ( uint8_t *  data,
size_t  size,
ObjectID object_id 
)

◆ ReadCreateReply()

Status plasma::ReadCreateReply ( uint8_t *  data,
size_t  size,
ObjectID object_id,
PlasmaObject object,
int *  store_fd,
int64_t *  mmap_size 
)

◆ ReadCreateRequest()

Status plasma::ReadCreateRequest ( uint8_t *  data,
size_t  size,
ObjectID object_id,
int64_t *  data_size,
int64_t *  metadata_size,
int *  device_num 
)

◆ ReadDataReply()

Status plasma::ReadDataReply ( uint8_t *  data,
size_t  size,
ObjectID object_id,
int64_t *  object_size,
int64_t *  metadata_size 
)

◆ ReadDataRequest()

Status plasma::ReadDataRequest ( uint8_t *  data,
size_t  size,
ObjectID object_id,
char **  address,
int *  port 
)

◆ ReadDeleteReply()

Status plasma::ReadDeleteReply ( uint8_t *  data,
size_t  size,
std::vector< ObjectID > *  object_ids,
std::vector< PlasmaError > *  errors 
)

◆ ReadDeleteRequest()

Status plasma::ReadDeleteRequest ( uint8_t *  data,
size_t  size,
std::vector< ObjectID > *  object_ids 
)

◆ ReadEvictReply()

Status plasma::ReadEvictReply ( uint8_t *  data,
size_t  size,
int64_t &  num_bytes 
)

◆ ReadEvictRequest()

Status plasma::ReadEvictRequest ( uint8_t *  data,
size_t  size,
int64_t *  num_bytes 
)

◆ ReadFetchRequest()

Status plasma::ReadFetchRequest ( uint8_t *  data,
size_t  size,
std::vector< ObjectID > &  object_ids 
)

◆ ReadGetReply()

Status plasma::ReadGetReply ( uint8_t *  data,
size_t  size,
ObjectID  object_ids[],
PlasmaObject  plasma_objects[],
int64_t  num_objects,
std::vector< int > &  store_fds,
std::vector< int64_t > &  mmap_sizes 
)

◆ ReadGetRequest()

Status plasma::ReadGetRequest ( uint8_t *  data,
size_t  size,
std::vector< ObjectID > &  object_ids,
int64_t *  timeout_ms 
)

◆ ReadListReply()

Status plasma::ReadListReply ( uint8_t *  data,
size_t  size,
ObjectTable objects 
)

◆ ReadListRequest()

Status plasma::ReadListRequest ( uint8_t *  data,
size_t  size 
)

◆ ReadMessage()

Status plasma::ReadMessage ( int  fd,
flatbuf::MessageType *  type,
std::vector< uint8_t > *  buffer 
)

◆ ReadMessageAsync()

std::unique_ptr<uint8_t[]> plasma::ReadMessageAsync ( int  sock)

◆ ReadReleaseReply()

Status plasma::ReadReleaseReply ( uint8_t *  data,
size_t  size,
ObjectID object_id 
)

◆ ReadReleaseRequest()

Status plasma::ReadReleaseRequest ( uint8_t *  data,
size_t  size,
ObjectID object_id 
)

◆ ReadSealReply()

Status plasma::ReadSealReply ( uint8_t *  data,
size_t  size,
ObjectID object_id 
)

◆ ReadSealRequest()

Status plasma::ReadSealRequest ( uint8_t *  data,
size_t  size,
ObjectID object_id,
unsigned char *  digest 
)

◆ ReadStatusReply()

Status plasma::ReadStatusReply ( uint8_t *  data,
size_t  size,
ObjectID  object_ids[],
int  object_status[],
int64_t  num_objects 
)

◆ ReadStatusReply_num_objects()

int64_t plasma::ReadStatusReply_num_objects ( uint8_t *  data,
size_t  size 
)

◆ ReadStatusRequest()

Status plasma::ReadStatusRequest ( uint8_t *  data,
size_t  size,
ObjectID  object_ids[],
int64_t  num_objects 
)

◆ ReadWaitReply()

Status plasma::ReadWaitReply ( uint8_t *  data,
size_t  size,
ObjectRequest  object_requests[],
int *  num_ready_objects 
)

◆ ReadWaitRequest()

Status plasma::ReadWaitRequest ( uint8_t *  data,
size_t  size,
ObjectRequestMap object_requests,
int64_t *  timeout_ms,
int *  num_ready_objects 
)

◆ SendAbortReply()

Status plasma::SendAbortReply ( int  sock,
ObjectID  object_id 
)

◆ SendAbortRequest()

Status plasma::SendAbortRequest ( int  sock,
ObjectID  object_id 
)

◆ SendConnectReply()

Status plasma::SendConnectReply ( int  sock,
int64_t  memory_capacity 
)

◆ SendConnectRequest()

Status plasma::SendConnectRequest ( int  sock)

◆ SendContainsReply()

Status plasma::SendContainsReply ( int  sock,
ObjectID  object_id,
bool  has_object 
)

◆ SendContainsRequest()

Status plasma::SendContainsRequest ( int  sock,
ObjectID  object_id 
)

◆ SendCreateReply()

Status plasma::SendCreateReply ( int  sock,
ObjectID  object_id,
PlasmaObject object,
PlasmaError  error,
int64_t  mmap_size 
)

◆ SendCreateRequest()

Status plasma::SendCreateRequest ( int  sock,
ObjectID  object_id,
int64_t  data_size,
int64_t  metadata_size,
int  device_num 
)

◆ SendDataReply()

Status plasma::SendDataReply ( int  sock,
ObjectID  object_id,
int64_t  object_size,
int64_t  metadata_size 
)

◆ SendDataRequest()

Status plasma::SendDataRequest ( int  sock,
ObjectID  object_id,
const char *  address,
int  port 
)

◆ SendDeleteReply()

Status plasma::SendDeleteReply ( int  sock,
const std::vector< ObjectID > &  object_ids,
const std::vector< PlasmaError > &  errors 
)

◆ SendDeleteRequest()

Status plasma::SendDeleteRequest ( int  sock,
const std::vector< ObjectID > &  object_ids 
)

◆ SendEvictReply()

Status plasma::SendEvictReply ( int  sock,
int64_t  num_bytes 
)

◆ SendEvictRequest()

Status plasma::SendEvictRequest ( int  sock,
int64_t  num_bytes 
)

◆ SendFetchRequest()

Status plasma::SendFetchRequest ( int  sock,
const ObjectID object_ids,
int64_t  num_objects 
)

◆ SendGetReply()

Status plasma::SendGetReply ( int  sock,
ObjectID  object_ids[],
std::unordered_map< ObjectID, PlasmaObject > &  plasma_objects,
int64_t  num_objects,
const std::vector< int > &  store_fds,
const std::vector< int64_t > &  mmap_sizes 
)

◆ SendGetRequest()

Status plasma::SendGetRequest ( int  sock,
const ObjectID object_ids,
int64_t  num_objects,
int64_t  timeout_ms 
)

◆ SendListReply()

Status plasma::SendListReply ( int  sock,
const ObjectTable objects 
)

◆ SendListRequest()

Status plasma::SendListRequest ( int  sock)

◆ SendReleaseReply()

Status plasma::SendReleaseReply ( int  sock,
ObjectID  object_id,
PlasmaError  error 
)

◆ SendReleaseRequest()

Status plasma::SendReleaseRequest ( int  sock,
ObjectID  object_id 
)

◆ SendSealReply()

Status plasma::SendSealReply ( int  sock,
ObjectID  object_id,
PlasmaError  error 
)

◆ SendSealRequest()

Status plasma::SendSealRequest ( int  sock,
ObjectID  object_id,
unsigned char *  digest 
)

◆ SendStatusReply()

Status plasma::SendStatusReply ( int  sock,
ObjectID  object_ids[],
int  object_status[],
int64_t  num_objects 
)

◆ SendStatusRequest()

Status plasma::SendStatusRequest ( int  sock,
const ObjectID object_ids,
int64_t  num_objects 
)

◆ SendSubscribeRequest()

Status plasma::SendSubscribeRequest ( int  sock)

◆ SendWaitReply()

Status plasma::SendWaitReply ( int  sock,
const ObjectRequestMap object_requests,
int  num_ready_objects 
)

◆ SendWaitRequest()

Status plasma::SendWaitRequest ( int  sock,
ObjectRequest  object_requests[],
int64_t  num_requests,
int  num_ready_objects,
int64_t  timeout_ms 
)

◆ VerifyFlatbuffer()

template<class T >
bool plasma::VerifyFlatbuffer ( T *  object,
uint8_t *  data,
size_t  size 
)

◆ WarnIfSigpipe()

int plasma::WarnIfSigpipe ( int  status,
int  client_sock 
)

Print a warning if the status is less than zero.

This should be used to check the success of messages sent to plasma clients. We print a warning instead of failing because the plasma clients are allowed to die. This is used to handle situations where the store writes to a client file descriptor, and the client may already have disconnected. If we have processed the disconnection and closed the file descriptor, we should get a BAD FILE DESCRIPTOR error. If we have not, then we should get a SIGPIPE. If we write to a TCP socket that isn't connected yet, then we should get an ECONNRESET.

Parameters
statusThe status to check. If it is less less than zero, we will print a warning.
client_sockThe client socket. This is just used to print some extra information.
Returns
The errno set.

◆ WriteBytes()

Status plasma::WriteBytes ( int  fd,
uint8_t *  cursor,
size_t  length 
)

◆ WriteMessage()

Status plasma::WriteMessage ( int  fd,
flatbuf::MessageType  type,
int64_t  length,
uint8_t *  bytes 
)

Variable Documentation

◆ kBlockSize

constexpr int64_t plasma::kBlockSize = 64

Allocation granularity used in plasma for object allocation.

◆ kDigestSize

constexpr int64_t plasma::kDigestSize = sizeof(uint64_t)

Size of object hash digests.

◆ kEventLoopRead

constexpr int plasma::kEventLoopRead = AE_READABLE

Read event on the file descriptor.

◆ kEventLoopTimerDone

constexpr int plasma::kEventLoopTimerDone = AE_NOMORE

Constant specifying that the timer is done and it will be removed.

◆ kEventLoopWrite

constexpr int plasma::kEventLoopWrite = AE_WRITABLE

Write event on the file descriptor.

◆ kPlasmaDefaultReleaseDelay

constexpr int64_t plasma::kPlasmaDefaultReleaseDelay = 64

We keep a queue of unreleased objects cached in the client until we start sending release requests to the store.

This is to avoid frequently mapping and unmapping objects and evicting data from processor caches.

◆ kPlasmaProtocolVersion

constexpr int64_t plasma::kPlasmaProtocolVersion = 0x0000000000000000

◆ kUniqueIDSize

constexpr int64_t plasma::kUniqueIDSize = 20

◆ plasma_config

const PlasmaStoreInfo* plasma::plasma_config