Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
Public Member Functions | List of all members
plasma::PlasmaStore Class Reference

#include <plasma/store.h>

Public Member Functions

 PlasmaStore (EventLoop *loop, int64_t system_memory, std::string directory, bool hugetlbfs_enabled)
 
 ~PlasmaStore ()
 
const PlasmaStoreInfoget_plasma_store_info ()
 Get a const pointer to the internal PlasmaStoreInfo object. More...
 
int create_object (const ObjectID &object_id, int64_t data_size, int64_t metadata_size, Client *client, PlasmaObject *result)
 Create a new object. More...
 
void delete_objects (const std::vector< ObjectID > &object_ids)
 Delete objects that have been created in the hash table. More...
 
void process_get_request (Client *client, const std::vector< ObjectID > &object_ids, int64_t timeout_ms)
 Process a get request from a client. More...
 
void seal_object (const ObjectID &object_id, unsigned char digest[])
 Seal an object. More...
 
int contains_object (const ObjectID &object_id)
 Check if the plasma store contains an object: More...
 
void release_object (const ObjectID &object_id, Client *client)
 Record the fact that a particular client is no longer using an object. More...
 
void subscribe_to_updates (Client *client)
 Subscribe a file descriptor to updates about new sealed objects. More...
 
void connect_client (int listener_sock)
 Connect a new client to the PlasmaStore. More...
 
void disconnect_client (int client_fd)
 Disconnect a client from the PlasmaStore. More...
 
void send_notifications (int client_fd)
 
Status process_message (Client *client)
 

Constructor & Destructor Documentation

◆ PlasmaStore()

plasma::PlasmaStore::PlasmaStore ( EventLoop loop,
int64_t  system_memory,
std::string  directory,
bool  hugetlbfs_enabled 
)

◆ ~PlasmaStore()

plasma::PlasmaStore::~PlasmaStore ( )

Member Function Documentation

◆ connect_client()

void plasma::PlasmaStore::connect_client ( int  listener_sock)

Connect a new client to the PlasmaStore.

Parameters
listener_sockThe socket that is listening to incoming connections.

◆ contains_object()

int plasma::PlasmaStore::contains_object ( const ObjectID object_id)

Check if the plasma store contains an object:

Parameters
object_idObject ID that will be checked.
Returns
OBJECT_FOUND if the object is in the store, OBJECT_NOT_FOUND if not

◆ create_object()

int plasma::PlasmaStore::create_object ( const ObjectID object_id,
int64_t  data_size,
int64_t  metadata_size,
Client client,
PlasmaObject result 
)

Create a new object.

The client must do a call to release_object to tell the store when it is done with the object.

Parameters
object_idObject ID of the object to be created.
data_sizeSize in bytes of the object to be created.
metadata_sizeSize in bytes of the object metadata.
Returns
One of the following error codes:
  • PlasmaError_OK, if the object was created successfully.
  • PlasmaError_ObjectExists, if an object with this ID is already present in the store. In this case, the client should not call plasma_release.
  • PlasmaError_OutOfMemory, if the store is out of memory and cannot create the object. In this case, the client should not call plasma_release.

◆ delete_objects()

void plasma::PlasmaStore::delete_objects ( const std::vector< ObjectID > &  object_ids)

Delete objects that have been created in the hash table.

This should only be called on objects that are returned by the eviction policy to evict.

Parameters
object_idsObject IDs of the objects to be deleted.

◆ disconnect_client()

void plasma::PlasmaStore::disconnect_client ( int  client_fd)

Disconnect a client from the PlasmaStore.

Parameters
client_fdThe client file descriptor that is disconnected.

◆ get_plasma_store_info()

const PlasmaStoreInfo* plasma::PlasmaStore::get_plasma_store_info ( )

Get a const pointer to the internal PlasmaStoreInfo object.

◆ process_get_request()

void plasma::PlasmaStore::process_get_request ( Client client,
const std::vector< ObjectID > &  object_ids,
int64_t  timeout_ms 
)

Process a get request from a client.

This method assumes that we will eventually have these objects sealed. If one of the objects has not yet been sealed, the client that requested the object will be notified when it is sealed.

For each object, the client must do a call to release_object to tell the store when it is done with the object.

Parameters
clientThe client making this request.
object_idsObject IDs of the objects to be gotten.
timeout_msThe timeout for the get request in milliseconds.

◆ process_message()

Status plasma::PlasmaStore::process_message ( Client client)

◆ release_object()

void plasma::PlasmaStore::release_object ( const ObjectID object_id,
Client client 
)

Record the fact that a particular client is no longer using an object.

Parameters
object_idThe object ID of the object that is being released.
clientThe client making this request.

◆ seal_object()

void plasma::PlasmaStore::seal_object ( const ObjectID object_id,
unsigned char  digest[] 
)

Seal an object.

The object is now immutable and can be accessed with get.

Parameters
object_idObject ID of the object to be sealed.
digestThe digest of the object. This is used to tell if two objects with the same object ID are the same.

◆ send_notifications()

void plasma::PlasmaStore::send_notifications ( int  client_fd)

◆ subscribe_to_updates()

void plasma::PlasmaStore::subscribe_to_updates ( Client client)

Subscribe a file descriptor to updates about new sealed objects.

Parameters
clientThe client making this request.

The documentation for this class was generated from the following file: