Spring for Apache Hadoop

org.springframework.data.hadoop.fs
Class DistributedCacheFactoryBean

java.lang.Object
  extended by org.springframework.data.hadoop.fs.DistributedCacheFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean<org.apache.hadoop.filecache.DistributedCache>, org.springframework.beans.factory.InitializingBean

public class DistributedCacheFactoryBean
extends java.lang.Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.FactoryBean<org.apache.hadoop.filecache.DistributedCache>

Factory for easy declarative configuration of a DistributedCache.

Author:
Costin Leau, Thomas Risberg

Nested Class Summary
static class DistributedCacheFactoryBean.CacheEntry
          Class describing an entry of the distributed cache.
 
Constructor Summary
DistributedCacheFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 org.apache.hadoop.filecache.DistributedCache getObject()
           
 java.lang.Class<?> getObjectType()
           
 boolean isSingleton()
           
 void setCacheEntries(java.util.Collection<org.springframework.core.io.Resource> resources)
          Sets the cache entries to be added to the distributed cache.
 void setClassPathEntries(java.util.Collection<org.springframework.core.io.Resource> resources)
          Sets the class-path entries to be added to the distributed cache.
 void setConfiguration(org.apache.hadoop.conf.Configuration conf)
          Sets the Hadoop configuration for the cache.
 void setCreateSymlink(boolean createSymlink)
          Indicates whether to create symlinks or not.
 void setEntries(java.util.Collection<DistributedCacheFactoryBean.CacheEntry> entries)
          Sets the entries to be added to the distributed cache.
 void setFileSystem(org.apache.hadoop.fs.FileSystem fs)
          Sets the Hadoop file system for this cache.
 void setLocalEntries(java.util.Collection<org.springframework.core.io.Resource> resources)
          Sets the local entries to be added to the distributed cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistributedCacheFactoryBean

public DistributedCacheFactoryBean()
Method Detail

getObject

public org.apache.hadoop.filecache.DistributedCache getObject()
                                                       throws java.lang.Exception
Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean<org.apache.hadoop.filecache.DistributedCache>
Throws:
java.lang.Exception

getObjectType

public java.lang.Class<?> getObjectType()
Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean<org.apache.hadoop.filecache.DistributedCache>

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean<org.apache.hadoop.filecache.DistributedCache>

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

setEntries

public void setEntries(java.util.Collection<DistributedCacheFactoryBean.CacheEntry> entries)
Sets the entries to be added to the distributed cache.

Parameters:
entries - The entries to set.

setLocalEntries

public void setLocalEntries(java.util.Collection<org.springframework.core.io.Resource> resources)
Sets the local entries to be added to the distributed cache.

Parameters:
resources - The entries to set.

setCacheEntries

public void setCacheEntries(java.util.Collection<org.springframework.core.io.Resource> resources)
Sets the cache entries to be added to the distributed cache.

Parameters:
resources - The entries to set.

setClassPathEntries

public void setClassPathEntries(java.util.Collection<org.springframework.core.io.Resource> resources)
Sets the class-path entries to be added to the distributed cache.

Parameters:
resources - The entries to set.

setConfiguration

public void setConfiguration(org.apache.hadoop.conf.Configuration conf)
Sets the Hadoop configuration for the cache.

Parameters:
conf - The conf to set.

setFileSystem

public void setFileSystem(org.apache.hadoop.fs.FileSystem fs)
Sets the Hadoop file system for this cache.

Parameters:
fs - File system to set.

setCreateSymlink

public void setCreateSymlink(boolean createSymlink)
Indicates whether to create symlinks or not.

Parameters:
createSymlink - whether to create symlinks or not.

Spring for Apache Hadoop