On Sun, 26 Jun 2011 17:34:34 -0700, Mark <static.void....@gmail.com> wrote: > Hello all, > > We have a recommendation system that reads in similarity data via a > Spring context.xml as follows: > > <bean id="similarity" > class="org.apache.mahout.cf.taste.impl.similarity.file.FileItemSimilarity"> > <constructor-arg value="/var/data/similarity.data"/> > </bean> > > Is it possible to use Hadoop/HDFS with Spring? We would love to be able > to use something like: > > <constructor-arg value="hdfs://user/mark/similarity.data"> > > Can this (easily) be accomplished?
I didn't have to do quite the same thing, but I was trying to load an ApplicationContext using SpringBean files kept in HDFS. It was pretty straightforward to throw together an HDFSXMLApplicationContext class (and some necessary supporting classes), so I'd be surprised if it would be hard to tweak other Spring classes similarly. In this case, though, it looks like your problem isn't actually with Spring so much as it is with the FileItemSimilarity class; it doesn't have a constructor which takes a Path argument. You might be able to extend that class and add the kind of constructor you want to use, though.