nathanmarz/dfs-datastores-cascading — pull request #6 by jameswarren (2013-01-16 08:12:27+00:00)
Title: updating PailTap to be used as a sink

Hey Nathan -

When trying out PailTaps for both work and the book, I encountered the same issue as was reported on the Manning forums: namely PailTaps couldn't be used as sinks due to a timing issue.

http://www.manning-sandbox.com/thread.jspa?threadID=53531&tstart=15

"The PailTap inherits the default value of SinkMode provided by Hfs. This value does not work. PailTap creates a meta file when a Pail is first created. This file will have a creation date newer than all data. Hence, the default SinkMode will skip any flow that writes to that Pail."

I don't know if this is due to using Cascading 2+ instead of Cascading 1.2, but this is a simple patch that uses the UPDATE sink mode when calling the Hfs constructor. A pail can't actually be updated due to the Pail API, but will the misnomer is hidden from the end user.

I haven't tested it with Cascading 1, but from the project file it looks like you are using Cascading 2 as a dependency.

Hope this helps!
-James