Class BlobStoreStorageHandler

java.lang.Object
com.gigaspaces.server.blobstore.BlobStoreStorageHandler
Direct Known Subclasses:
BlobStoreHashMock, BlobStoreNoSerializationHashMock, OffHeapBlobStoreHandler, PmemBlobStoreHandler, RocksDBBlobStoreHandler

public abstract class BlobStoreStorageHandler extends Object
basic methods for handling blob-stored objects specific implementations (SSD, off-heap buffers) should extend this class
Since:
10.0
Author:
yechielf
  • Constructor Details

    • BlobStoreStorageHandler

      public BlobStoreStorageHandler()
  • Method Details

    • initialize

      public void initialize(BlobStoreConfig blobStoreConfig)
      initialize a blob-store implementation.
      Parameters:
      blobStoreConfig - - Configuration for blobstore implementation.
    • cleanup

      public void cleanup()
    • add

      public abstract Object add(Serializable id, Serializable data, BlobStoreObjectType objectType)
      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 associated
      data - data to be associated with the specified id
      objectType - 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

      public abstract Serializable get(Serializable id, Object position, BlobStoreObjectType objectType)
      Returns the data to which the specified id is mapped,
      Parameters:
      id - id with which the specified data is to be associated
      position - optional position object which will be used as a pointer of locating the id, or null if irrelevant
      objectType - 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 associated
      data - 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 irrelevant
      objectType - 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 removed
      position - optional position object which will be used as a pointer of locating the id, or null if irrelevant
      objectType - 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 perform
      objectType - the object type - one of BlobStoreObjectType values
      transactional - - 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

      public Properties getProperties()
      . returns the properties passed (and also optionally set) by the blobstore handler.
      Returns:
      properties.
    • getStatistics

      public BlobStoreStorageStatistics getStatistics()
    • close

      public void close()
      . close the blobstore handler. note- a non-abstract method
    • isPersistent

      public Boolean isPersistent()