public class DefaultHibernateSpaceDataSourceConfigurer extends Object
DefaultHibernateSpaceDataSource
Modifier and Type | Field and Description |
---|---|
protected boolean |
augmentInitialLoadEntries |
protected ClusterInfo |
clusterInfo |
protected int |
fetchSize |
protected int |
initialLoadChunkSize |
protected String[] |
initialLoadEntries |
protected String[] |
initialLoadQueryScanningBasePackages |
protected int |
initialLoadThreadPoolSize |
protected org.apache.commons.logging.Log |
logger |
protected Set<String> |
managedEntries |
protected boolean |
performOrderById |
protected org.hibernate.SessionFactory |
sessionFactory |
protected boolean |
useScrollableResultSet |
Constructor and Description |
---|
DefaultHibernateSpaceDataSourceConfigurer() |
Modifier and Type | Method and Description |
---|---|
DefaultHibernateSpaceDataSourceConfigurer |
augmentInitialLoadEntries(boolean augmentInitialLoadEntries)
Feature switch for initial load entries augmentation (creation of partition-specific query
for entries) Defaults to
true . |
DefaultHibernateSpaceDataSourceConfigurer |
clusterInfo(ClusterInfo clusterInfo)
Injects the
ClusterInfo to be used with the SpaceDataSource |
DefaultHibernateSpaceDataSource |
create()
Creates a
DefaultHibernateSpaceDataSource with the setup configuration. |
DefaultHibernateSpaceDataSourceConfigurer |
fetchSize(int fetchSize)
Sets the fetch size that will be used when working with scrollable results.
|
DefaultHibernateSpaceDataSourceConfigurer |
initialLoadChunkSize(int initalLoadChunkSize)
By default, the initial load process will chunk large tables and will iterate over the table
(entity) per chunk (concurrently).
|
DefaultHibernateSpaceDataSourceConfigurer |
initialLoadEntries(String... initialLoadEntries)
Sets a list of entries that will be used to perform the
#initialLoad() operation. |
DefaultHibernateSpaceDataSourceConfigurer |
initialLoadQueryScanningBasePackages(String[] initialLoadQueryScanningBasePackages)
optional.
|
DefaultHibernateSpaceDataSourceConfigurer |
initialLoadThreadPoolSize(int initialLoadThreadPoolSize)
The initial load operation uses the
ConcurrentMultiDataIterator . |
DefaultHibernateSpaceDataSourceConfigurer |
managedEntries(String... entries)
Sets all the entries this Hibernate data source will work with.
|
DefaultHibernateSpaceDataSourceConfigurer |
performOrderById(boolean performOrderById)
When performing initial load, this flag indicates if the generated query will order to
results by the id.
|
DefaultHibernateSpaceDataSourceConfigurer |
sessionFactory(org.hibernate.SessionFactory sessionFactory)
Injects the Hibernate SessionFactory to be used with this data source.
|
DefaultHibernateSpaceDataSourceConfigurer |
useScrollableResultSet(boolean useScrollableResultSet)
Controls if scrollable result sets will be used with initial load operation.
|
protected final org.apache.commons.logging.Log logger
protected org.hibernate.SessionFactory sessionFactory
protected String[] initialLoadEntries
protected int fetchSize
protected int initialLoadThreadPoolSize
protected int initialLoadChunkSize
protected boolean performOrderById
protected boolean useScrollableResultSet
protected boolean augmentInitialLoadEntries
protected String[] initialLoadQueryScanningBasePackages
protected ClusterInfo clusterInfo
public DefaultHibernateSpaceDataSourceConfigurer()
public DefaultHibernateSpaceDataSourceConfigurer sessionFactory(org.hibernate.SessionFactory sessionFactory)
public DefaultHibernateSpaceDataSourceConfigurer managedEntries(String... entries)
This list is used to filter out entities when performing all data source operations
exception for the #initialLoad()
operation.
Usually, there is no need to explicitly set this.
public DefaultHibernateSpaceDataSourceConfigurer fetchSize(int fetchSize)
100
.Criteria.setFetchSize(int)
public DefaultHibernateSpaceDataSourceConfigurer performOrderById(boolean performOrderById)
true
as it most times results in better
initial load performance.public DefaultHibernateSpaceDataSourceConfigurer initialLoadEntries(String... initialLoadEntries)
#initialLoad()
operation. By
default, will try and build a sensible list based on Hibernate meta data.
Note, sometimes an explicit list should be provided. For example, if we have a class A and class B, and A has a relationship to B which is not component. If in the space, we only wish to have A, and have B just as a field in A (and not as an Entry), then we need to explicitly set the list just to A. By default, if we won't set it, it will result in two entries existing in the Space, A and B, with A having a field of B as well.
public DefaultHibernateSpaceDataSourceConfigurer initialLoadThreadPoolSize(int initialLoadThreadPoolSize)
ConcurrentMultiDataIterator
.
This property allows to control the thread pool size of the concurrent multi data iterator.
Defaults to 10
.
Note, this usually will map one to one to the number of open connections / cursors against the database.
public DefaultHibernateSpaceDataSourceConfigurer initialLoadChunkSize(int initalLoadChunkSize)
100,000
. Batching can be disabled by setting
-1
.public DefaultHibernateSpaceDataSourceConfigurer useScrollableResultSet(boolean useScrollableResultSet)
true
.public DefaultHibernateSpaceDataSourceConfigurer initialLoadQueryScanningBasePackages(String[] initialLoadQueryScanningBasePackages)
initialLoadQueryScanningBasePackages
- array of base packages to scan for custom initial
load query methods marked with the SpaceInitialLoadQuery
annotation (default: null, scans nothing).this
instance.public DefaultHibernateSpaceDataSourceConfigurer clusterInfo(ClusterInfo clusterInfo)
ClusterInfo
to be used with the SpaceDataSourcepublic DefaultHibernateSpaceDataSourceConfigurer augmentInitialLoadEntries(boolean augmentInitialLoadEntries)
true
.public DefaultHibernateSpaceDataSource create()
DefaultHibernateSpaceDataSource
with the setup configuration.Copyright © GigaSpaces.