Package org.openspaces.persistency
Class ClusterInfoAwareSpaceDataSource
java.lang.Object
com.gigaspaces.datasource.SpaceDataSource
org.openspaces.persistency.ClusterInfoAwareSpaceDataSource
- All Implemented Interfaces:
ClusterInfoAware
- Direct Known Subclasses:
CassandraSpaceDataSource,ManagedEntriesSpaceDataSource
public abstract class ClusterInfoAwareSpaceDataSource
extends SpaceDataSource
implements ClusterInfoAware
Created by yuvalm on 23/04/2014.
- Since:
- 10.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcreateInitialLoadQuery(SpaceTypeDescriptor typeDescriptor, String templateQuery) 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.protected voidThis method scans the classpath using Spring'sClassPathScanningCandidateComponentProvider.voidsetClusterInfo(ClusterInfo clusterInfo) Sets the cluster information.voidsetInitialLoadQueryScanningBasePackages(String[] initialLoadQueryScanningBasePackages) Methods inherited from class com.gigaspaces.datasource.SpaceDataSource
getById, getDataIterator, getDataIteratorByIds, getPartitionRoutingInfo, initialDataLoad, setPartitionRoutingInfo, supportsInheritance
-
Field Details
-
initialLoadQueryScanningBasePackages
-
clusterInfo
-
initialLoadQueries
-
initialLoadChunksRoutingQueries
-
augmentInitialLoadEntries
protected boolean augmentInitialLoadEntries
-
-
Constructor Details
-
ClusterInfoAwareSpaceDataSource
public ClusterInfoAwareSpaceDataSource()
-
-
Method Details
-
setInitialLoadQueryScanningBasePackages
-
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.
-
setClusterInfo
Description copied from interface:ClusterInfoAwareSets the cluster information.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
ClusterInfoAwareshould take into account the fact that the cluster info provided might be null.- Specified by:
setClusterInfoin interfaceClusterInfoAware- Parameters:
clusterInfo- The cluster information to be injected
-
getInitialLoadQueries
-
obtainInitialLoadQueries
protected void obtainInitialLoadQueries()This method scans the classpath using Spring'sClassPathScanningCandidateComponentProvider. This scanner uses the logic in the #isClassMatch method to retrieve names of classes that contain a method annotated withSpaceInitialLoadQuery. 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. -
createInitialLoadQuery
-