Spring for Apache Hadoop

org.springframework.yarn.config.annotation.builders
Class YarnResourceLocalizerBuilder

java.lang.Object
  extended by org.springframework.data.hadoop.config.common.annotation.AbstractAnnotationBuilder<O>
      extended by org.springframework.data.hadoop.config.common.annotation.AbstractConfiguredAnnotationBuilder<ResourceLocalizer,YarnResourceLocalizerConfigurer,YarnResourceLocalizerBuilder>
          extended by org.springframework.yarn.config.annotation.builders.YarnResourceLocalizerBuilder
All Implemented Interfaces:
AnnotationBuilder<ResourceLocalizer>, YarnResourceLocalizerConfigurer

public final class YarnResourceLocalizerBuilder
extends AbstractConfiguredAnnotationBuilder<ResourceLocalizer,YarnResourceLocalizerConfigurer,YarnResourceLocalizerBuilder>
implements YarnResourceLocalizerConfigurer

AnnotationBuilder for ResourceLocalizer.

Author:
Janne Valkealahti

Constructor Summary
YarnResourceLocalizerBuilder()
          Instantiates a new yarn resource localizer builder.
 
Method Summary
 void configuration(org.apache.hadoop.conf.Configuration configuration)
           
 YarnResourceLocalizerConfigurer defaultLocalResourceType(org.apache.hadoop.yarn.api.records.LocalResourceType type)
           
 YarnResourceLocalizerConfigurer defaultLocalResourceVisibility(org.apache.hadoop.yarn.api.records.LocalResourceVisibility visibility)
           
protected  ResourceLocalizer performBuild()
          Subclasses must implement this method to build the object that is being returned.
 void setCopyEntries(java.util.Collection<LocalResourcesFactoryBean.CopyEntry> copyEntries)
           
 void setHdfsEntries(java.util.Collection<LocalResourcesFactoryBean.TransferEntry> transferEntries)
           
 void setRawCopyEntries(java.util.Collection<LocalResourcesFactoryBean.RawCopyEntry> rawEntries)
           
 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.
 
Methods inherited from class org.springframework.data.hadoop.config.common.annotation.AbstractConfiguredAnnotationBuilder
apply, apply, beforeConfigureMains, beforeConfigurePosts, beforeInit, doBuild, getConfigurer, getConfigurers, getOrApply, getOrBuild, getSharedObject, getSharedObjects, objectPostProcessor, postProcess, removeConfigurer, removeConfigurers, setSharedObject
 
Methods inherited from class org.springframework.data.hadoop.config.common.annotation.AbstractAnnotationBuilder
build, getObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YarnResourceLocalizerBuilder

public YarnResourceLocalizerBuilder()
Instantiates a new yarn resource localizer builder.

Method Detail

performBuild

protected ResourceLocalizer performBuild()
                                  throws java.lang.Exception
Description copied from class: AbstractConfiguredAnnotationBuilder
Subclasses must implement this method to build the object that is being returned.

Specified by:
performBuild in class AbstractConfiguredAnnotationBuilder<ResourceLocalizer,YarnResourceLocalizerConfigurer,YarnResourceLocalizerBuilder>
Returns:
Object build by this builder
Throws:
java.lang.Exception

withCopy

public LocalResourcesCopyConfigurer withCopy()
                                      throws java.lang.Exception
Description copied from interface: YarnResourceLocalizerConfigurer
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>
 

Specified by:
withCopy in interface YarnResourceLocalizerConfigurer
Returns:
LocalResourcesCopyConfigurer for chaining
Throws:
java.lang.Exception - if error occurred

withHdfs

public LocalResourcesHdfsConfigurer withHdfs()
                                      throws java.lang.Exception
Description copied from interface: YarnResourceLocalizerConfigurer
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>
 

Specified by:
withHdfs in interface YarnResourceLocalizerConfigurer
Returns:
LocalResourcesCopyConfigurer for chaining
Throws:
java.lang.Exception - if error occurred

stagingDirectory

public YarnResourceLocalizerConfigurer stagingDirectory(java.lang.String stagingDirectory)
Specified by:
stagingDirectory in interface YarnResourceLocalizerConfigurer

configuration

public void configuration(org.apache.hadoop.conf.Configuration configuration)

defaultLocalResourceType

public YarnResourceLocalizerConfigurer defaultLocalResourceType(org.apache.hadoop.yarn.api.records.LocalResourceType type)

defaultLocalResourceVisibility

public YarnResourceLocalizerConfigurer defaultLocalResourceVisibility(org.apache.hadoop.yarn.api.records.LocalResourceVisibility visibility)

setCopyEntries

public void setCopyEntries(java.util.Collection<LocalResourcesFactoryBean.CopyEntry> copyEntries)

setHdfsEntries

public void setHdfsEntries(java.util.Collection<LocalResourcesFactoryBean.TransferEntry> transferEntries)

setRawCopyEntries

public void setRawCopyEntries(java.util.Collection<LocalResourcesFactoryBean.RawCopyEntry> rawEntries)

Spring for Apache Hadoop