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()
           
 
Method Summary
 void configuration(org.apache.hadoop.conf.Configuration configuration)
           
 YarnResourceLocalizerBuilder defaultLocalResourceType(org.apache.hadoop.yarn.api.records.LocalResourceType type)
           
 YarnResourceLocalizerBuilder 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)
           
 DefaultLocalResourcesCopyConfigurer withCopy()
          Specify configuration options as properties with a DefaultLocalResourcesCopyConfigurer.
 DefaultLocalResourcesHdfsConfigurer 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()
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

configuration

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

defaultLocalResourceType

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

defaultLocalResourceVisibility

public YarnResourceLocalizerBuilder 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)

withCopy

public DefaultLocalResourcesCopyConfigurer 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 DefaultLocalResourcesHdfsConfigurer 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

Spring for Apache Hadoop