Package com.gigaspaces.server.blobstore
Class BlobStoreStorageHandler
java.lang.Object
com.gigaspaces.server.blobstore.BlobStoreStorageHandler
- Direct Known Subclasses:
BlobStoreHashMock,BlobStoreNoSerializationHashMock,OffHeapBlobStoreHandler,PmemBlobStoreHandler,RocksDBBlobStoreHandler
basic methods for handling blob-stored objects specific implementations (SSD, off-heap buffers)
should extend this class
- Since:
- 10.0
- Author:
- yechielf
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Objectadd(Serializable id, Serializable data, BlobStoreObjectType objectType) Add the specified id with the specified data .voidcleanup()voidclose().executeBulk(List<BlobStoreBulkOperationRequest> operations, BlobStoreObjectType objectType, boolean transactional) .abstract Serializableget(Serializable id, Object position, BlobStoreObjectType objectType) Returns the data to which the specified id is mapped,.voidinitialize(BlobStoreConfig blobStoreConfig) initialize a blob-store implementation.iterator(BlobStoreObjectType objectType) .abstract Serializableremove(Serializable id, Object position, BlobStoreObjectType objectType) Removes the id (and its corresponding data) from this FDF.abstract Objectreplace(Serializable id, Serializable data, Object position, BlobStoreObjectType objectType) Replace the data to which the specified id is mapped with new data,
-
Constructor Details
-
BlobStoreStorageHandler
public BlobStoreStorageHandler()
-
-
Method Details
-
initialize
initialize a blob-store implementation.- Parameters:
blobStoreConfig- - Configuration for blobstore implementation.
-
cleanup
public void cleanup() -
add
Add the specified id with the specified data . Neither the id nor the data can be null.- Parameters:
id- id with which the specified value is to be associateddata- data to be associated with the specified idobjectType- the object type - one of BlobStoreObjectType values- Returns:
- an optional position object which will be used as a pointer of locating the id, if the operation succeeded, or null if irrelevant
- Throws:
BlobStoreException- if the specified id already exist or container does not exist or other failure.
-
get
Returns the data to which the specified id is mapped,- Parameters:
id- id with which the specified data is to be associatedposition- optional position object which will be used as a pointer of locating the id, or null if irrelevantobjectType- the object type - one of BlobStoreObjectType values- Returns:
- the data to which the specified id is mapped,
- Throws:
BlobStoreException- if the specified id does not exist.
-
replace
public abstract Object replace(Serializable id, Serializable data, Object position, BlobStoreObjectType objectType) Replace the data to which the specified id is mapped with new data,- Parameters:
id- id with which the specified data is to be associateddata- the new data to replace the existing one.position- optional position object which will be used as a pointer of locating the id, or null if irrelevantobjectType- the object type - one of BlobStoreObjectType values- Returns:
- the new postion - an optional position object which will be used as a pointer of locating the id, or null if irrelevant
- Throws:
BlobStoreException- if the specified id does not exist.
-
remove
public abstract Serializable remove(Serializable id, Object position, BlobStoreObjectType objectType) Removes the id (and its corresponding data) from this FDF.- Parameters:
id- the key that needs to be removedposition- optional position object which will be used as a pointer of locating the id, or null if irrelevantobjectType- the object type - one of BlobStoreObjectType values- Returns:
- the data to which the specified id is mapped,
- Throws:
BlobStoreException- if the id does not exist.
-
executeBulk
public List<BlobStoreBulkOperationResult> executeBulk(List<BlobStoreBulkOperationRequest> operations, BlobStoreObjectType objectType, boolean transactional) . execute a bulk of operations on the blobstore. return a corresoping list of results note- a non-abstract method, if not implemented the individual operations will be executed one by one- Parameters:
operations- - a list of operations to performobjectType- the object type - one of BlobStoreObjectType valuestransactional- - true if the bulk is to be performed in the blobstore as one logical transaction if the blobstore supports transactions, false otherwise- Returns:
- a list of results which corresponds to the input list of operations. if one or more operations fail the returned result element will contain exception . if transactional parameter is true a general exception should be thrown instead of a returned result element with exception data
-
iterator
. creates an iterator over the blobstore objeccts. note- a non-abstract method, if not implemented null will be returned- Parameters:
objectType- the object type - one of BlobStoreObjectType values- Returns:
- an iterator over the blobstore objects which belong to the requested objectType.
- Throws:
BlobStoreException- in case of a problenm.
-
getProperties
. returns the properties passed (and also optionally set) by the blobstore handler.- Returns:
- properties.
-
getStatistics
-
close
public void close(). close the blobstore handler. note- a non-abstract method -
isPersistent
-