Spring for Apache Hadoop

org.springframework.yarn.config.annotation.builders
Interface YarnResourceLocalizerConfigurer

All Known Implementing Classes:
YarnResourceLocalizerBuilder

public interface YarnResourceLocalizerConfigurer

Interface for YarnResourceLocalizerBuilder used from a SpringYarnConfigurerAdapter.

Typically configuration is used as shown below.

 @Configuration
 @EnableYarn
 static class Config extends SpringYarnConfigurerAdapter {

   @Override
   public void configure(YarnResourceLocalizerConfigure localizer) throws Exception {
     localizer
       .withCopy()
         .copy("foo.jar", "/tmp", true)
         .and()
       .withHdfs()
         .hdfs("/tmp/foo.jar");
   }

 }
 

Author:
Janne Valkealahti

Method Summary
 YarnResourceLocalizerConfigurer stagingDirectory(java.lang.String stagingDirectory)
           
 LocalResourcesCopyConfigurer withCopy()
          Specify configuration options as properties with a DefaultLocalResourcesCopyConfigurer.
 LocalResourcesHdfsConfigurer withHdfs()
          Specify configuration options as properties with a DefaultLocalResourcesCopyConfigurer.
 

Method Detail

withCopy

LocalResourcesCopyConfigurer withCopy()
                                      throws java.lang.Exception
Specify configuration options as properties with a DefaultLocalResourcesCopyConfigurer.

JavaConfig:

 public void configure(YarnResourceLocalizerConfigure localizer) throws Exception {
   localizer
     .withCopy()
       .copy("foo.jar", "/tmp", true);
 }
 

XML:

 <yarn:localresources>
   <:hdfs path="/tmp/foo.jar" staging="false"/>
 </yarn:localresources>
 

Returns:
LocalResourcesCopyConfigurer for chaining
Throws:
java.lang.Exception - if error occurred

withHdfs

LocalResourcesHdfsConfigurer withHdfs()
                                      throws java.lang.Exception
Specify configuration options as properties with a DefaultLocalResourcesCopyConfigurer.

JavaConfig:

 public void configure(YarnResourceLocalizerConfigure localizer) throws Exception {
   localizer
     .withHdfs()
       .hdfs("/tmp/foo.jar");
 }
 

XML:

 <yarn:localresources>
   <:hdfs path="/tmp/foo.jar" staging="false"/>
 </yarn:localresources>
 

Returns:
LocalResourcesCopyConfigurer for chaining
Throws:
java.lang.Exception - if error occurred

stagingDirectory

YarnResourceLocalizerConfigurer stagingDirectory(java.lang.String stagingDirectory)
                                                 throws java.lang.Exception
Throws:
java.lang.Exception

Spring for Apache Hadoop