org.springframework.data.hadoop.hive
Class HiveServerFactoryBean

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

public class HiveServerFactoryBean
extends Object
implements FactoryBean<TServer>, InitializingBean, DisposableBean, SmartLifecycle

FactoryBean for easy declaration and creation of an embeddable Hive server. Similar in functionality to HiveServer but not tied to the command line.

Author:
Costin Leau

Constructor Summary
HiveServerFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 void destroy()
           
 TServer getObject()
           
 Class<?> getObjectType()
           
 int getPhase()
           
 boolean isAutoStartup()
           
 boolean isRunning()
           
 boolean isSingleton()
           
 void setAutoStartup(boolean autoStartup)
          Indicates whether the Hive client should start automatically (default) or not.
 void setConfiguration(Configuration configuration)
          Sets the Hadoop configuration to use.
 void setExecutor(Executor executor)
          Sets the executor for starting the server (which is a blocking operation).
 void setMaxThreads(int maxThreads)
          Sets the maximum number of threads serving this server.
 void setMinThreads(int minThreads)
          Sets the minimum number of threads serving this server.
 void setPort(int port)
          Sets the server port.
 void setProperties(Properties properties)
          Sets the configuration properties.
 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

HiveServerFactoryBean

public HiveServerFactoryBean()
Method Detail

destroy

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

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

getObject

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

getObjectType

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

isSingleton

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

start

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

stop

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

isRunning

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

getPhase

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

isAutoStartup

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

stop

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

setAutoStartup

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

Parameters:
autoStartup - whether to automatically start or not

setPort

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

Parameters:
port - The port to set.

setMinThreads

public void setMinThreads(int minThreads)
Sets the minimum number of threads serving this server.

Parameters:
minThreads - The minThreads to set.

setMaxThreads

public void setMaxThreads(int maxThreads)
Sets the maximum number of threads serving this server.

Parameters:
maxThreads - The maxThreads to set.

setConfiguration

public void setConfiguration(Configuration configuration)
Sets the Hadoop configuration to use.

Parameters:
configuration - The configuration to set.

setProperties

public void setProperties(Properties properties)
Sets the configuration properties.

Parameters:
properties - The properties to set.

setExecutor

public void setExecutor(Executor executor)
Sets the executor for starting the server (which is a blocking operation). By default, an internal SimpleAsyncTaskExecutor instance is used.

Parameters:
executor - The executor to set.