GigaSpaces XAP 9.7.2 API

org.openspaces.persistency.patterns
Class SpaceDataSourceSplitter

java.lang.Object
  extended by com.gigaspaces.datasource.SpaceDataSource
      extended by org.openspaces.persistency.patterns.SpaceDataSourceSplitter

public class SpaceDataSourceSplitter
extends SpaceDataSource

A space data source that redirects the query operations to the given data source that can handle the given type.

Since:
9.5
Author:
eitany

Constructor Summary
SpaceDataSourceSplitter(ManagedEntriesSpaceDataSource[] dataSources)
           
 
Method Summary
 Object getById(DataSourceIdQuery idQuery)
          Delegates the query to the corresponding data source
 DataIterator<Object> getDataIterator(DataSourceQuery query)
          Delegates the query to the corresponding data source
 DataIterator<Object> getDataIteratorByIds(com.gigaspaces.datasource.DataSourceIdsQuery idsQuery)
          Delegates the query to the corresponding data source
protected  SpaceDataSource getDataSource(String entry)
           
 DataIterator<Object> initialDataLoad()
          Iterates through all the given data sources and assembles their respective DataIterators from SpaceDataSource.initialDataLoad().
 DataIterator<SpaceTypeDescriptor> initialMetadataLoad()
          Iterates through all the given data sources and assembles their respective DataIterators from SpaceDataSource.initialMetadataLoad().
 void setInitalLoadThreadPoolSize(int initalLoadThreadPoolSize)
           
 
Methods inherited from class com.gigaspaces.datasource.SpaceDataSource
supportsInheritance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpaceDataSourceSplitter

public SpaceDataSourceSplitter(ManagedEntriesSpaceDataSource[] dataSources)
Method Detail

setInitalLoadThreadPoolSize

public void setInitalLoadThreadPoolSize(int initalLoadThreadPoolSize)

getDataSource

protected SpaceDataSource getDataSource(String entry)

initialDataLoad

public DataIterator<Object> initialDataLoad()
Iterates through all the given data sources and assembles their respective DataIterators from SpaceDataSource.initialDataLoad(). Constructs a ConcurrentMultiDataIterator on top of them.

Overrides:
initialDataLoad in class SpaceDataSource
Returns:
A DataIterator instance which contains all data to be written to Space upon its initialization - null is treated as an empty iterator.

initialMetadataLoad

public DataIterator<SpaceTypeDescriptor> initialMetadataLoad()
Iterates through all the given data sources and assembles their respective DataIterators from SpaceDataSource.initialMetadataLoad(). Constructs a SerialMultiDataIterator on top of them.

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.

getDataIterator

public DataIterator<Object> getDataIterator(DataSourceQuery query)
Delegates the query to the corresponding data source

Overrides:
getDataIterator in class SpaceDataSource
Parameters:
query - The DataSourceQuery to get results for.
Returns:
A DataIterator instance contains results for the provided DataSourceQuery.

getById

public Object getById(DataSourceIdQuery idQuery)
Delegates the query to the corresponding data source

Overrides:
getById in class SpaceDataSource
Parameters:
idQuery - The DataSourceIdQuery to get a result for.
Returns:
A result from the SpaceDataSource which matches the provided DataSourceIdQuery.

getDataIteratorByIds

public DataIterator<Object> getDataIteratorByIds(com.gigaspaces.datasource.DataSourceIdsQuery idsQuery)
Delegates the query to the corresponding data source

Overrides:
getDataIteratorByIds in class SpaceDataSource
Parameters:
idsQuery - The DataSourceIdsQuery to get a result for.
Returns:
A DataIterator instance contains results for the provided DataSourceIdsQuery.

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.