org.springframework.data.hadoop.hive
Class HiveClientFactoryBean

java.lang.Object
  extended by org.springframework.data.hadoop.hive.HiveClientFactoryBean
All Implemented Interfaces:
DisposableBean, FactoryBean<HiveClient>, InitializingBean, Lifecycle, Phased, SmartLifecycle

public class HiveClientFactoryBean
extends Object
implements SmartLifecycle, FactoryBean<HiveClient>, InitializingBean, DisposableBean

FactoryBean for easy declaration and creation of a HiveClient using ThriftHive.

Author:
Costin Leau

Constructor Summary
HiveClientFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 void destroy()
           
 String getHost()
          Returns the host.
 HiveClient getObject()
           
 Class<?> getObjectType()
           
 int getPhase()
           
 int getPort()
          Returns the port.
 int getTimeout()
          Returns the timeout.
 boolean isAutoStartup()
           
 boolean isRunning()
           
 boolean isSingleton()
           
 void setAutoStartup(boolean autoStart)
          Indicates whether the Hive client should start automatically (default) or not.
 void setHost(String host)
          Sets the server host.
 void setPort(int port)
          Sets the server port.
 void setScripts(Collection<Resource> scripts)
          Sets the scripts to execute once the client connects.
 void setTimeout(int timeout)
          Sets the connection timeout.
 void start()
           
 void stop()
           
 void stop(Runnable callback)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HiveClientFactoryBean

public HiveClientFactoryBean()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface InitializingBean

destroy

public void destroy()
Specified by:
destroy in interface DisposableBean

getObject

public HiveClient getObject()
Specified by:
getObject in interface FactoryBean<HiveClient>

getObjectType

public Class<?> getObjectType()
Specified by:
getObjectType in interface FactoryBean<HiveClient>

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface FactoryBean<HiveClient>

isAutoStartup

public boolean isAutoStartup()
Specified by:
isAutoStartup in interface SmartLifecycle

stop

public void stop(Runnable callback)
Specified by:
stop in interface SmartLifecycle

isRunning

public boolean isRunning()
Specified by:
isRunning in interface Lifecycle

start

public void start()
Specified by:
start in interface Lifecycle

stop

public void stop()
Specified by:
stop in interface Lifecycle

getPhase

public int getPhase()
Specified by:
getPhase in interface Phased

setAutoStartup

public void setAutoStartup(boolean autoStart)
Indicates whether the Hive client should start automatically (default) or not.

Parameters:
autoStart - whether to automatically start or not

getHost

public String getHost()
Returns the host.

Returns:
Returns the host

setHost

public void setHost(String host)
Sets the server host.

Parameters:
host - The host to set.

getPort

public int getPort()
Returns the port.

Returns:
Returns the port

setPort

public void setPort(int port)
Sets the server port.

Parameters:
port - The port to set.

getTimeout

public int getTimeout()
Returns the timeout.

Returns:
Returns the timeout

setTimeout

public void setTimeout(int timeout)
Sets the connection timeout.

Parameters:
timeout - The timeout to set.

setScripts

public void setScripts(Collection<Resource> scripts)
Sets the scripts to execute once the client connects.

Parameters:
scripts - The scripts to set.