public class HiveClientFactoryBean extends Object implements FactoryBean<HiveClientFactory>, InitializingBean, DisposableBean
HiveClient using a JdbcTemplate.
The HiveClient class is not thread-safe. We use a SingleConnectionDataSource to hold on to a connection for
the duration of the client. This means that all operations while happen in the same session. This is important when
setting properties on the session.
Note that the caller needs to handle the object clean-up, specifically calling HiveClient.shutdown().
In general, to avoid leaks it is recommended to use the HiveTemplate.| Constructor and Description |
|---|
HiveClientFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected HiveClient |
createHiveClient() |
void |
destroy() |
HiveClientFactory |
getObject() |
Class<?> |
getObjectType() |
int |
getPhase() |
boolean |
isSingleton() |
void |
setHiveDataSource(DataSource dataSource)
Sets the DataSource.
|
void |
setScripts(Collection<HiveScript> scripts)
Sets the scripts to execute once the client connects.
|
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic void destroy()
throws Exception
destroy in interface DisposableBeanExceptionpublic HiveClientFactory getObject()
getObject in interface FactoryBean<HiveClientFactory>public Class<?> getObjectType()
getObjectType in interface FactoryBean<HiveClientFactory>public boolean isSingleton()
isSingleton in interface FactoryBean<HiveClientFactory>protected HiveClient createHiveClient()
public int getPhase()
public void setHiveDataSource(DataSource dataSource)
dataSource - The DataSource.public void setScripts(Collection<HiveScript> scripts)
scripts - The scripts to set.