public class HiveClientFactoryBean extends Object implements FactoryBean<HiveClientFactory>
HiveClient using ThriftHive.
Since Thrift clients are not thread-safe, neither is HiveClient. And since the Hive API does not provide
some type of factory, the factory bean returns an instance of ObjectFactory (that handles the creation
of HiveClient instances) instead of the raw HiveClient instance.
Note that the caller needs to handle the object clean-up, specifically calling FacebookService.Client.shutdown().
In general, to avoid leaks it is recommended to use the HiveTemplate.| Constructor and Description |
|---|
HiveClientFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
protected HiveClient |
createHiveClient() |
String |
getHost()
Returns the host.
|
HiveClientFactory |
getObject() |
Class<?> |
getObjectType() |
int |
getPhase() |
int |
getPort()
Returns the port.
|
int |
getTimeout()
Returns the timeout.
|
boolean |
isSingleton() |
void |
setHost(String host)
Sets the server host.
|
void |
setPort(int port)
Sets the server port.
|
void |
setScripts(Collection<HiveScript> scripts)
Sets the scripts to execute once the client connects.
|
void |
setTimeout(int timeout)
Sets the connection timeout.
|
public 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 String getHost()
public void setHost(String host)
host - The host to set.public int getPort()
public void setPort(int port)
port - The port to set.public int getTimeout()
public void setTimeout(int timeout)
timeout - The timeout to set.public void setScripts(Collection<HiveScript> scripts)
scripts - The scripts to set.