org.springframework.data.hadoop.fs
Class DistributedCacheFactoryBean

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

public class DistributedCacheFactoryBean
extends Object
implements InitializingBean, FactoryBean<DistributedCache>

Factory for easy declarative configuration of a DistributedCache.

Author:
Costin Leau

Nested Class Summary
static class DistributedCacheFactoryBean.CacheEntry
          Class describing an entry of the distributed cache.
 
Constructor Summary
DistributedCacheFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 DistributedCache getObject()
           
 Class<?> getObjectType()
           
 boolean isSingleton()
           
 void setConfiguration(Configuration conf)
          Sets the Hadoop configuration for the cache.
 void setCreateSymlink(boolean createSymlink)
          Indicates whether to create symlinks or not.
 void setEntries(Collection<DistributedCacheFactoryBean.CacheEntry> entries)
          Sets the entries to be added to the distributed cache.
 void setFileSystem(FileSystem fs)
          Sets the Hadoop file system for this 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 DistributedCache getObject()
                           throws Exception
Specified by:
getObject in interface FactoryBean<DistributedCache>
Throws:
Exception

getObjectType

public Class<?> getObjectType()
Specified by:
getObjectType in interface FactoryBean<DistributedCache>

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface FactoryBean<DistributedCache>

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

setEntries

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

Parameters:
entries - The entries to set.

setConfiguration

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

Parameters:
conf - The conf to set.

setFileSystem

public void setFileSystem(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.