Spring for Apache Hadoop

org.springframework.data.hadoop.hive
Class HiveServerFactoryBean

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

public class HiveServerFactoryBean
extends java.lang.Object
implements org.springframework.beans.factory.FactoryBean<org.apache.thrift.server.TServer>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.context.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()
           
 org.apache.thrift.server.TServer getObject()
           
 java.lang.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(org.apache.hadoop.conf.Configuration configuration)
          Sets the Hadoop configuration to use.
 void setExecutor(java.util.concurrent.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(java.util.Properties properties)
          Sets the configuration properties.
 void start()
           
 void stop()
           
 void stop(java.lang.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 org.springframework.beans.factory.DisposableBean

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

getObject

public org.apache.thrift.server.TServer getObject()
Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean<org.apache.thrift.server.TServer>

getObjectType

public java.lang.Class<?> getObjectType()
Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean<org.apache.thrift.server.TServer>

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean<org.apache.thrift.server.TServer>

start

public void start()
Specified by:
start in interface org.springframework.context.Lifecycle

stop

public void stop()
Specified by:
stop in interface org.springframework.context.Lifecycle

isRunning

public boolean isRunning()
Specified by:
isRunning in interface org.springframework.context.Lifecycle

getPhase

public int getPhase()
Specified by:
getPhase in interface org.springframework.context.Phased

isAutoStartup

public boolean isAutoStartup()
Specified by:
isAutoStartup in interface org.springframework.context.SmartLifecycle

stop

public void stop(java.lang.Runnable callback)
Specified by:
stop in interface org.springframework.context.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(org.apache.hadoop.conf.Configuration configuration)
Sets the Hadoop configuration to use.

Parameters:
configuration - The configuration to set.

setProperties

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

Parameters:
properties - The properties to set.

setExecutor

public void setExecutor(java.util.concurrent.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.

Spring for Apache Hadoop