|
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.scripting.HdfsScriptRunner
public class HdfsScriptRunner
Hadoop-customized runner that exposes Hadoop specific variables to scripting languages. The instances exposes are reused from the enclosing context (using naming conventions or autowiring strategies) or created on demand (in case of lightweight objects).
These are :Name | Type | Description |
cfg | org.apache.hadoop.conf.Configuration | Hadoop Configuration (relies on 'hadoop-configuration' bean or singleton type match) |
cl | java.lang.ClassLoader | ClassLoader used for executing this script |
ctx | org.springframework.context.ApplicationContext | Enclosing application context |
ctxRL | org.springframework.io.support.ResourcePatternResolver | Enclosing application context ResourceLoader (same as ctx) |
distcp | org.springframework.data.hadoop.fs.DistributedCopyUtil | programmatic access to DistCp |
fs | org.apache.hadoop.fs.FileSystem | Hadoop File System (relies on 'hadoop-fs' bean or singleton type match, falls back to creating one based on 'cfg') |
fsh | org.springframework.data.hadoop.fs.FsShell | File System shell, exposing hadoop 'fs' commands as an API |
hdfsRL | org.springframework.data.hadoop.io.HdfsResourceLoader | HdfsResourceLoader (relies on 'hadoop-resource-loader' or singleton type match, falls back to creating one automatically based on 'cfg') |
setRunAtStartup(boolean)
.
HdfsResourceLoader
,
FsShell
,
ApplicationContext
Constructor Summary | |
---|---|
HdfsScriptRunner()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
java.lang.Object |
call()
|
boolean |
isRunAtStartup()
Indicates whether the script gets executed once the factory bean initializes. |
protected void |
postProcess(java.util.Map<java.lang.String,java.lang.Object> args)
Method for post-processing arguments. |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
|
void |
setArguments(java.util.Map<java.lang.String,java.lang.Object> arguments)
Sets the arguments for evaluating this script. |
void |
setBeanClassLoader(java.lang.ClassLoader classLoader)
|
void |
setConfiguration(org.apache.hadoop.conf.Configuration configuration)
Sets the Hadoop configuration to use. |
void |
setEvaluate(EvaluationPolicy evaluation)
Sets the way the script is evaluated. |
void |
setExtension(java.lang.String extension)
Sets the script extension. |
void |
setLanguage(java.lang.String language)
Sets the script language. |
void |
setPostAction(java.util.Collection<java.util.concurrent.Callable<?>> actions)
Actions to be invoked after running the action. |
void |
setPreAction(java.util.Collection<java.util.concurrent.Callable<?>> actions)
Actions to be invoked before running the action. |
void |
setRunAtStartup(boolean runAtStartup)
Indicates whether to evaluate the script at startup (default) or not. |
void |
setScriptSource(org.springframework.scripting.ScriptSource script)
Sets the script source to evaluate. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HdfsScriptRunner()
Method Detail |
---|
protected void postProcess(java.util.Map<java.lang.String,java.lang.Object> args)
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void setConfiguration(org.apache.hadoop.conf.Configuration configuration)
configuration
- The configuration to set.public java.lang.Object call() throws java.lang.Exception
call
in interface java.util.concurrent.Callable<java.lang.Object>
java.lang.Exception
public void setBeanClassLoader(java.lang.ClassLoader classLoader)
setBeanClassLoader
in interface org.springframework.beans.factory.BeanClassLoaderAware
public void setScriptSource(org.springframework.scripting.ScriptSource script)
script
- The script to evaluate.public void setLanguage(java.lang.String language)
language
- The script language.public void setExtension(java.lang.String extension)
extension
- The extension to set.public void setEvaluate(EvaluationPolicy evaluation)
evaluation
- public void setArguments(java.util.Map<java.lang.String,java.lang.Object> arguments)
arguments
- The arguments to set.public boolean isRunAtStartup()
public void setRunAtStartup(boolean runAtStartup)
runAtStartup
- The runStartUp to set.public void setPreAction(java.util.Collection<java.util.concurrent.Callable<?>> actions)
actions
- public void setPostAction(java.util.Collection<java.util.concurrent.Callable<?>> actions)
actions
-
|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |