Class EDSAdapterSpaceDataSource
- Since:
- 9.1.1
- Author:
- idan
-
Constructor Summary
ConstructorsConstructorDescriptionEDSAdapterSpaceDataSource(DataStorage<Object> dataStorage, boolean supportsInheritance) -
Method Summary
Modifier and TypeMethodDescriptiongetDataIterator(DataSourceQuery query) This method is invoked whenever the space needs to read data which matches the providedDataSourceQueryfrom the space data source.This method is invoked afterSpaceDataSource.initialMetadataLoad()and is used for pre fetching data from the data source on space initialization.voidinitialize(Properties dataProperties) This method is invoked on space initialization (beforeSpaceDataSource.initialDataLoad()is invoked) and is used for introducing data types kept in the data source to the space.booleanDetermines whether this implementation supports types inheritance.Methods inherited from class com.gigaspaces.datasource.SpaceDataSource
getById, getDataIteratorByIds, getPartitionRoutingInfo, setPartitionRoutingInfo
-
Constructor Details
-
EDSAdapterSpaceDataSource
-
-
Method Details
-
initialDataLoad
Description copied from class:SpaceDataSourceThis method is invoked afterSpaceDataSource.initialMetadataLoad()and is used for pre fetching data from the data source on space initialization.The returned
DataIteratorinstance should contain POJOs orSpaceDocuments which their type was previously introduced to the space onSpaceDataSource.initialMetadataLoad()invocation.- Overrides:
initialDataLoadin classSpaceDataSource- Returns:
- A
DataIteratorinstance which contains all data to be written to Space upon its initialization - null is treated as an empty iterator.
-
initialMetadataLoad
Description copied from class:SpaceDataSourceThis method is invoked on space initialization (beforeSpaceDataSource.initialDataLoad()is invoked) and is used for introducing data types kept in the data source to the space.Please note that derived types should be returned after their super types from the iterator.
It is possible to create a
SpaceTypeDescriptorusingSpaceTypeDescriptorBuilder.- Overrides:
initialMetadataLoadin classSpaceDataSource- Returns:
- A
DataIteratorinstance which contains allSpaceTypeDescriptorinstances to be introduced to the Space upon its initialization - null is treated as an empty iterator.
-
getDataIterator
Description copied from class:SpaceDataSourceThis method is invoked whenever the space needs to read data which matches the providedDataSourceQueryfrom the space data source.If this implementation doesn't supports types inheritance this method will be invoked for each type in the inheritance tree of the queried type.
The implementation's type inheritance support can be determined by overriding the
SpaceDataSource.supportsInheritance()method.- Overrides:
getDataIteratorin classSpaceDataSource- Parameters:
query- TheDataSourceQueryto get results for.- Returns:
- A
DataIteratorinstance contains results for the providedDataSourceQuery.
-
supportsInheritance
public boolean supportsInheritance()Description copied from class:SpaceDataSourceDetermines whether this implementation supports types inheritance.If types inheritance is not supported -
SpaceDataSource.getDataIterator(DataSourceQuery)will be invoked for each derived type of the query's data type. Otherwise a singleSpaceDataSource.getDataIterator(DataSourceQuery)invocation will be made for the query.- Overrides:
supportsInheritancein classSpaceDataSource- Returns:
- true if this
SpaceDataSourceimplementation supports types inheritance, otherwise false.
-
initialize
- Throws:
DataSourceException
-
getDataStorage
-