org.springframework.data.hadoop.hive
Class HiveTasklet

java.lang.Object
  extended by org.springframework.data.hadoop.hive.HiveTasklet
All Implemented Interfaces:
Tasklet, InitializingBean

public class HiveTasklet
extends Object
implements Tasklet

Hive tasklet running Hive scripts on demand, against a HiveClient.

Author:
Costin Leau

Constructor Summary
HiveTasklet()
           
 
Method Summary
 void afterPropertiesSet()
           
 RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext)
           
protected  List<String> executeHiveScripts()
           
 void setHiveClientFactory(HiveClientFactory hiveClientFactory)
          Sets the hive client for this tasklet.
 void setHiveTemplate(HiveOperations hiveTemplate)
          Sets the hive template.
 void setScripts(Collection<HiveScript> scripts)
          Sets the scripts to be executed by this tasklet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HiveTasklet

public HiveTasklet()
Method Detail

execute

public RepeatStatus execute(StepContribution contribution,
                            ChunkContext chunkContext)
                     throws Exception
Specified by:
execute in interface Tasklet
Throws:
Exception

afterPropertiesSet

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

executeHiveScripts

protected List<String> executeHiveScripts()

setScripts

public void setScripts(Collection<HiveScript> scripts)
Sets the scripts to be executed by this tasklet.

Parameters:
scripts - The scripts to set.

setHiveClientFactory

public void setHiveClientFactory(HiveClientFactory hiveClientFactory)
Sets the hive client for this tasklet.

Parameters:
hiveClientFactory - hiveFactory to set

setHiveTemplate

public void setHiveTemplate(HiveOperations hiveTemplate)
Sets the hive template.

Parameters:
hiveTemplate - the new hive template