public class PlasmaClient extends Object implements ObjectStoreLink
The PlasmaClient can ask the PlasmaStore to allocate a new buffer, seal a buffer, and get a buffer. Buffers are referred to by object IDs.
ObjectStoreLink.ObjectStoreData
Constructor and Description |
---|
PlasmaClient(String storeSocketName,
String managerSocketName,
int releaseDelay) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(byte[] objectId)
Check if the object is present and has been sealed in the PlasmaStore.
|
ByteBuffer |
create(byte[] objectId,
int size,
byte[] metadata)
Create an object in Plasma Store with particular size.
|
void |
delete(byte[] objectId)
Removes object with given objectId from plasma store.
|
long |
evict(long numBytes)
Evict some objects to recover given count of bytes.
|
protected void |
finalize() |
List<ObjectStoreLink.ObjectStoreData> |
get(byte[][] objectIds,
int timeoutMs)
Get buffer pairs (data & metadata) from the PlasmaStore based on objectIds.
|
List<byte[]> |
get(byte[][] objectIds,
int timeoutMs,
boolean isMetadata)
Get buffers from the PlasmaStore based on objectIds.
|
ByteBuffer |
getObjAsByteBuffer(byte[] objectId,
int timeoutMs,
boolean isMetadata)
Get an object in Plasma Store with objectId.
|
byte[] |
hash(byte[] objectId)
Compute the hash of an object in the object store.
|
List<byte[]> |
list()
List all objects in the PlasmaStore.
|
void |
put(byte[] objectId,
byte[] value,
byte[] metadata)
Put value in the local plasma store with object ID objectId.
|
void |
release(byte[] objectId)
Notify Plasma that the object is no longer needed.
|
void |
seal(byte[] objectId)
Seal the buffer in the PlasmaStore for a particular object ID.
|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get
public void put(byte[] objectId, byte[] value, byte[] metadata) throws DuplicateObjectException, PlasmaOutOfMemoryException
ObjectStoreLink
put
in interface ObjectStoreLink
objectId
- The object ID of the value to be put.value
- The value to put in the object store.metadata
- encodes whatever metadata the user wishes to encode.DuplicateObjectException
PlasmaOutOfMemoryException
public List<byte[]> get(byte[][] objectIds, int timeoutMs, boolean isMetadata)
ObjectStoreLink
get
in interface ObjectStoreLink
objectIds
- List of object IDs used to identify some objects.timeoutMs
- The number of milliseconds that the get call should block before timing out
and returning. Pass -1 if the call should block and 0 if the call should return immediately.isMetadata
- false if get data, otherwise get metadata.public byte[] hash(byte[] objectId)
ObjectStoreLink
hash
in interface ObjectStoreLink
objectId
- The object ID used to identify the object.public List<ObjectStoreLink.ObjectStoreData> get(byte[][] objectIds, int timeoutMs)
ObjectStoreLink
get
in interface ObjectStoreLink
objectIds
- List of object IDs used to identify some objects.timeoutMs
- The number of milliseconds that the get call should block before timing out
and returning. Pass -1 if the call should block and 0 if the call should return immediately.public ByteBuffer getObjAsByteBuffer(byte[] objectId, int timeoutMs, boolean isMetadata)
objectId
- used to identify an object.timeoutMs
- time in milliseconfs to wait before this request time out.isMetadata
- get this object's metadata or data.public List<byte[]> list()
ObjectStoreLink
list
in interface ObjectStoreLink
public long evict(long numBytes)
ObjectStoreLink
evict
in interface ObjectStoreLink
numBytes
- The number of bytes to attempt to recover.public ByteBuffer create(byte[] objectId, int size, byte[] metadata) throws DuplicateObjectException, PlasmaOutOfMemoryException
objectId
- used to identify an object.size
- size in bytes to be allocated for this object.metadata
- this object's metadata. It should be null if there is no metadata.DuplicateObjectException
PlasmaOutOfMemoryException
public void seal(byte[] objectId)
objectId
- used to identify an object.public void release(byte[] objectId)
release
in interface ObjectStoreLink
objectId
- used to identify an object.public void delete(byte[] objectId)
delete
in interface ObjectStoreLink
objectId
- used to identify an object.public boolean contains(byte[] objectId)
contains
in interface ObjectStoreLink
objectId
- used to identify an object.Copyright © 2022 The Apache Software Foundation. All rights reserved.