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 Details

    • initialLoadQueryScanningBasePackages

      protected String[] initialLoadQueryScanningBasePackages
    • clusterInfo

      protected ClusterInfo clusterInfo
    • initialLoadQueries

      protected Map<String,String> initialLoadQueries
    • initialLoadChunksRoutingQueries

      protected Map<String,List<String>> initialLoadChunksRoutingQueries
    • augmentInitialLoadEntries

      protected boolean augmentInitialLoadEntries
  • Constructor Details

    • ClusterInfoAwareSpaceDataSource

      public ClusterInfoAwareSpaceDataSource()
  • Method Details

    • setInitialLoadQueryScanningBasePackages

      public void setInitialLoadQueryScanningBasePackages(String[] initialLoadQueryScanningBasePackages)
    • initialMetadataLoad

      public DataIterator<SpaceTypeDescriptor> initialMetadataLoad()
      Description copied from class: SpaceDataSource
      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.

      Please note that derived types should be returned after their super types from the iterator.

      It is possible to create a SpaceTypeDescriptor using SpaceTypeDescriptorBuilder.

      Overrides:
      initialMetadataLoad in class SpaceDataSource
      Returns:
      A DataIterator instance which contains all SpaceTypeDescriptor instances to be introduced to the Space upon its initialization - null is treated as an empty iterator.
    • setClusterInfo

      public void setClusterInfo(ClusterInfo clusterInfo)
      Description copied from interface: ClusterInfoAware
      Sets 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 ClusterInfoAware should take into account the fact that the cluster info provided might be null.

      Specified by:
      setClusterInfo in interface ClusterInfoAware
      Parameters:
      clusterInfo - The cluster information to be injected
    • getInitialLoadQueries

      public Map<String,String> getInitialLoadQueries()
    • obtainInitialLoadQueries

      protected void obtainInitialLoadQueries()
      This method scans the classpath using Spring's 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.

    • createInitialLoadQuery

      protected String createInitialLoadQuery(SpaceTypeDescriptor typeDescriptor, String templateQuery)