public abstract class ClusterInfoAwareSpaceDataSource extends SpaceDataSource implements ClusterInfoAware
Modifier and Type | Field and Description |
---|---|
protected boolean |
augmentInitialLoadEntries |
protected ClusterInfo |
clusterInfo |
protected Map<String,List<String>> |
initialLoadChunksRoutingQueries |
protected Map<String,String> |
initialLoadQueries |
protected String[] |
initialLoadQueryScanningBasePackages |
Constructor and Description |
---|
ClusterInfoAwareSpaceDataSource() |
Modifier and Type | Method and Description |
---|---|
protected String |
createInitialLoadQuery(SpaceTypeDescriptor typeDescriptor,
String templateQuery) |
Map<String,String> |
getInitialLoadQueries() |
DataIterator<SpaceTypeDescriptor> |
initialMetadataLoad()
This method is invoked on space initialization (before
SpaceDataSource.initialDataLoad() is invoked)
and is used for introducing data types kept in the data source to the space. |
protected void |
obtainInitialLoadQueries()
This method scans the classpath using Spring's
ClassPathScanningCandidateComponentProvider . |
void |
setClusterInfo(ClusterInfo clusterInfo)
Sets the cluster information.
|
void |
setInitialLoadQueryScanningBasePackages(String[] initialLoadQueryScanningBasePackages) |
getById, getDataIterator, getDataIteratorByIds, getPartitionRoutingInfo, initialDataLoad, setPartitionRoutingInfo, supportsInheritance
protected String[] initialLoadQueryScanningBasePackages
protected ClusterInfo clusterInfo
protected boolean augmentInitialLoadEntries
public void setInitialLoadQueryScanningBasePackages(String[] initialLoadQueryScanningBasePackages)
public DataIterator<SpaceTypeDescriptor> initialMetadataLoad()
SpaceDataSource
SpaceDataSource.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 SpaceTypeDescriptor
using SpaceTypeDescriptorBuilder
.
initialMetadataLoad
in class SpaceDataSource
DataIterator
instance which contains all SpaceTypeDescriptor
instances to be introduced to the Space upon its initialization - null is treated as an empty
iterator.public void setClusterInfo(ClusterInfo clusterInfo)
ClusterInfoAware
Note, the cluster information is obtained externally from the application context which
means that this feature need to be supported by specific containers (and is not supported by
plain Spring application context). This means that beans that implement ClusterInfoAware
should take into account the fact that the cluster info provided might be
null.
setClusterInfo
in interface ClusterInfoAware
clusterInfo
- The cluster information to be injectedprotected void obtainInitialLoadQueries()
ClassPathScanningCandidateComponentProvider
.
This scanner uses the logic in the #isClassMatch method to retrieve names of classes that
contain a method annotated with SpaceInitialLoadQuery
.
This collection of class names is then handled in such a way that each annotated method is
validated, examined and eventually invoked to obtain the specific type's initial load query.
protected String createInitialLoadQuery(SpaceTypeDescriptor typeDescriptor, String templateQuery)
Copyright © GigaSpaces.