|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.data.hadoop.hive.HiveClientFactoryBean
public class HiveClientFactoryBean
FactoryBean for easy declaration and creation of a 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 Summary | |
---|---|
HiveClientFactoryBean()
|
Method Summary | |
---|---|
protected org.apache.hadoop.hive.service.HiveClient |
createHiveClient()
|
java.lang.String |
getHost()
Returns the host. |
HiveClientFactory |
getObject()
|
java.lang.Class<?> |
getObjectType()
|
int |
getPhase()
|
int |
getPort()
Returns the port. |
int |
getTimeout()
Returns the timeout. |
boolean |
isSingleton()
|
void |
setHost(java.lang.String host)
Sets the server host. |
void |
setPort(int port)
Sets the server port. |
void |
setScripts(java.util.Collection<HiveScript> scripts)
Sets the scripts to execute once the client connects. |
void |
setTimeout(int timeout)
Sets the connection timeout. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HiveClientFactoryBean()
Method Detail |
---|
public HiveClientFactory getObject()
getObject
in interface org.springframework.beans.factory.FactoryBean<HiveClientFactory>
public java.lang.Class<?> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<HiveClientFactory>
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean<HiveClientFactory>
protected org.apache.hadoop.hive.service.HiveClient createHiveClient()
public int getPhase()
public java.lang.String getHost()
public void setHost(java.lang.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(java.util.Collection<HiveScript> scripts)
scripts
- The scripts to set.
|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |