Class OffHeapBlobStoreHandler

java.lang.Object
com.gigaspaces.server.blobstore.BlobStoreStorageHandler
com.gigaspaces.blobstore.offheap.OffHeapBlobStoreHandler
All Implemented Interfaces:
OffHeapStorageContainer, ServiceDetailsProvider

public class OffHeapBlobStoreHandler extends BlobStoreStorageHandler implements OffHeapStorageContainer, ServiceDetailsProvider
Since:
12.3
Author:
Yael Nahon
  • Constructor Details

    • OffHeapBlobStoreHandler

      public OffHeapBlobStoreHandler(long memoryThreshold)
  • Method Details

    • add

      public Object add(Serializable id, Serializable data, BlobStoreObjectType objectType)
      Description copied from class: BlobStoreStorageHandler
      Add the specified id with the specified data . Neither the id nor the data can be null.
      Specified by:
      add in class BlobStoreStorageHandler
      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
    • get

      public Serializable get(Serializable id, Object position, BlobStoreObjectType objectType)
      Description copied from class: BlobStoreStorageHandler
      Returns the data to which the specified id is mapped,
      Specified by:
      get in class BlobStoreStorageHandler
      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,
    • replace

      public Object replace(Serializable id, Serializable data, Object position, BlobStoreObjectType objectType)
      Description copied from class: BlobStoreStorageHandler
      Replace the data to which the specified id is mapped with new data,
      Specified by:
      replace in class BlobStoreStorageHandler
      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
    • remove

      public Serializable remove(Serializable id, Object position, BlobStoreObjectType objectType)
      Description copied from class: BlobStoreStorageHandler
      Removes the id (and its corresponding data) from this FDF.
      Specified by:
      remove in class BlobStoreStorageHandler
      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,
    • executeBulk

      public List<BlobStoreBulkOperationResult> executeBulk(List<BlobStoreBulkOperationRequest> operations, BlobStoreObjectType objectType, boolean transactional)
      Description copied from class: BlobStoreStorageHandler
      . 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
      Overrides:
      executeBulk in class BlobStoreStorageHandler
      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
    • initialize

      public void initialize(BlobStoreConfig blobStoreConfig)
      Description copied from class: BlobStoreStorageHandler
      initialize a blob-store implementation.
      Overrides:
      initialize in class BlobStoreStorageHandler
      Parameters:
      blobStoreConfig - - Configuration for blobstore implementation.
    • getStatistics

      public BlobStoreStorageStatistics getStatistics()
      Overrides:
      getStatistics in class BlobStoreStorageHandler
    • getProperties

      public Properties getProperties()
      Description copied from class: BlobStoreStorageHandler
      . returns the properties passed (and also optionally set) by the blobstore handler.
      Overrides:
      getProperties in class BlobStoreStorageHandler
      Returns:
      properties.
    • getMemoryPool

      public AbstractMemoryPool getMemoryPool()
      The pool of the space being served. A stopped space leaves the previous pool closed, so the next one is built here: this is the only place a new space reaches the handler before it starts writing, since BlobStoreOperationsWrapper takes the pool in its constructor and the engine builds a fresh wrapper per space.
      Specified by:
      getMemoryPool in interface OffHeapStorageContainer
    • close

      public void close()
      Releases the arenas the pool committed. Freeing the entries one by one during shutdown hands the blocks back to the pool's free lists but leaves the slabs mapped, so without this a redeployed space strands them until the process exits.

      The handler itself stays usable: the engine calls this on every stop of the space, including the stop half of a restart. Only getMemoryPool() builds the replacement, so a write that arrives with no space behind it still fails on the closed pool instead of quietly committing new slabs.

      Overrides:
      close in class BlobStoreStorageHandler
    • getServicesDetails

      public ServiceDetails[] getServicesDetails()
      Description copied from interface: ServiceDetailsProvider
      Retruns one or more service details that the service exposes.
      Specified by:
      getServicesDetails in interface ServiceDetailsProvider