AbstractHibernateSpaceDataSource
or AbstractHibernateSpaceSynchronizationEndpoint
instead.@Deprecated public abstract class AbstractHibernateExternalDataSource extends Object implements ManagedDataSource, ManagedDataSourceEntriesProvider
See the different setters for more information and the init(java.util.Properties)
.
Modifier and Type | Field and Description |
---|---|
static String |
HIBERNATE_CFG_PROPERTY
Deprecated.
|
protected org.apache.commons.logging.Log |
logger
Deprecated.
|
NUMBER_OF_PARTITIONS, STATIC_PARTITION_NUMBER
Constructor and Description |
---|
AbstractHibernateExternalDataSource()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected DataIterator |
createInitialLoadIterator(DataIterator[] iterators)
Deprecated.
A helper method that creates the initial load iterator using the
ConcurrentMultiDataIterator with the provided setInitialLoadThreadPoolSize(int) thread pool size. |
protected Map<String,Object> |
filterItemValue(String entityName,
Map<String,Object> itemValues)
Deprecated.
Filter from the input map the unmapped field of this entity
|
protected int |
getFetchSize()
Deprecated.
Returns the fetch size that will be used when working with scrollable results.
|
protected int |
getInitialLoadChunkSize()
Deprecated.
By default, the initial load process will chunk large tables and will iterate over the table
(entity) per chunk (concurrently).
|
String[] |
getInitialLoadEntries()
Deprecated.
Returns a list of entries that will be used to perform the
ManagedDataSource.initialLoad() operation. |
String[] |
getManagedEntries()
Deprecated.
Returns all the entries this Hibernate data source will work with.
|
protected String |
getPartialUpdateHQL(BulkItem updateBulkItem,
Map<String,Object> updatedValues)
Deprecated.
|
org.hibernate.SessionFactory |
getSessionFactory()
Deprecated.
Returns the Hibernate session factory.
|
void |
init(Properties properties)
Deprecated.
Initializes the hibernate data source.
|
protected boolean |
isManaged(BulkItem bulkItem)
Deprecated.
|
protected boolean |
isManagedEntry(String entityName)
Deprecated.
Returns if the given entity name is part of the
getManagedEntries() list. |
protected boolean |
isPerformOrderById()
Deprecated.
When performing initial load, this flag indicates if the generated query will order to
results by the id.
|
protected boolean |
isUseScrollableResultSet()
Deprecated.
Controls if scrollable resultsets will be used with initial load operation.
|
void |
setFetchSize(int fetchSize)
Deprecated.
Sets the fetch size that will be used when working with scrollable results.
|
void |
setInitialLoadChunkSize(int initalLoadChunkSize)
Deprecated.
By default, the initial load process will chunk large tables and will iterate over the table
(entity) per chunk (concurrently).
|
void |
setInitialLoadEntries(String... initialLoadEntries)
Deprecated.
Sets a list of entries that will be used to perform the
ManagedDataSource.initialLoad() operation. |
void |
setInitialLoadThreadPoolSize(int initialLoadThreadPoolSize)
Deprecated.
The initial load operation uses the
ConcurrentMultiDataIterator . |
void |
setManagedEntries(String... entries)
Deprecated.
Sets all the entries this Hibernate data source will work with.
|
void |
setPerformOrderById(boolean performOrderById)
Deprecated.
When performing initial load, this flag indicates if the generated query will order to
results by the id.
|
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Deprecated.
Injects the Hibernate SessionFactory to be used with this external data source.
|
void |
setUseScrollableResultSet(boolean useScrollableResultSet)
Deprecated.
Controls if scrollable resultsets will be used with initial load operation.
|
void |
shutdown()
Deprecated.
Shuts down the data source.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initialLoad
protected final org.apache.commons.logging.Log logger
public static final String HIBERNATE_CFG_PROPERTY
public AbstractHibernateExternalDataSource()
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
public org.hibernate.SessionFactory getSessionFactory()
public void setManagedEntries(String... entries)
This list is used to filter out entities when performing all data source operations
exception for the ManagedDataSource.initialLoad()
operation.
Usually, there is no need to explicitly set this.
public String[] getManagedEntries()
This list is used to filter out entities when performing all data source operations
exception for the ManagedDataSource.initialLoad()
operation.
getManagedEntries
in interface ManagedDataSourceEntriesProvider
protected boolean isManagedEntry(String entityName)
getManagedEntries()
list.protected Map<String,Object> filterItemValue(String entityName, Map<String,Object> itemValues)
itemValues
- map of properties to filterpublic void setFetchSize(int fetchSize)
100
.Criteria.setFetchSize(int)
protected int getFetchSize()
100
.Criteria.setFetchSize(int)
public void setPerformOrderById(boolean performOrderById)
true
as it most times results in better
initial load performance.protected boolean isPerformOrderById()
true
as it most times results in better
initial load performance.public void setInitialLoadEntries(String... initialLoadEntries)
ManagedDataSource.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 String[] getInitialLoadEntries()
ManagedDataSource.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 void setInitialLoadThreadPoolSize(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 void setInitialLoadChunkSize(int initalLoadChunkSize)
100,000
. Batching can be disabled by setting
-1
.protected int getInitialLoadChunkSize()
100,000
. Batching can be disabled by setting
-1
.protected boolean isUseScrollableResultSet()
true
.public void setUseScrollableResultSet(boolean useScrollableResultSet)
true
.public void init(Properties properties) throws DataSourceException
If the session factory was not injected using setSessionFactory(org.hibernate.SessionFactory)
,
will try can create it from the Properties file expecting to find a property called
hibernate-config-file
with the location of the Hibernate config file.
Initializes the setManagedEntries(String...)
if they were not set explicitly by
iterating over all the mapped classes in Hibernate and adding them.
Also initializes the setInitialLoadEntries(String...)
if not set explicitly.
init
in interface ManagedDataSource
properties
- - contains user defined param and Partition dataDataSourceException
public void shutdown() throws DataSourceException
shutdown
in interface ManagedDataSource
DataSourceException
protected DataIterator createInitialLoadIterator(DataIterator[] iterators)
ConcurrentMultiDataIterator
with the provided setInitialLoadThreadPoolSize(int)
thread pool size.protected boolean isManaged(BulkItem bulkItem)
Copyright © GigaSpaces.