Tap.createResource not getting called

11 views
Skip to first unread message

JPatrick Davenport

unread,
Mar 2, 2015, 1:19:54 PM3/2/15
to cascadi...@googlegroups.com
Hello,
I'm working on creating a tap. I want to be able to support REPLACE by deleting a collection in ArangoDB and then creating it again. I figured the life cycle would be: resourceExits(..) ->yes->deleteResource->yes->createResource(..). This doesn't happen. If I change the sinkmode to keep, the collection is never checked for existence.

What's the best practices for this? The JDBC core doesn't really say much to the life cycle.

Thanks,
JPD

Chris K Wensel

unread,
Mar 2, 2015, 4:57:22 PM3/2/15
to cascadi...@googlegroups.com
Cascading never calls createResource() by design (its available to users who wish to use Taps directly). 

It is up to the computation fabric to create files/resources. Hadoop jobs, via OutputFormat/Committer, will fail if the output directory exists.

I’ll make a note to add more clarity in the user guide.

ckw

--
You received this message because you are subscribed to the Google Groups "cascading-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cascading-use...@googlegroups.com.
To post to this group, send email to cascadi...@googlegroups.com.
Visit this group at http://groups.google.com/group/cascading-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/cascading-user/781f29ea-f88d-4ac1-87a1-f11bcadef63c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris K Wensel




Andre Kelpe

unread,
Mar 3, 2015, 5:12:42 AM3/3/15
to cascadi...@googlegroups.com
As Chris already said, "createResource" is never called by cascading.
You will have to handle it in "openForWrite", which is what we
currently do in the non-file-based taps.

That being said, I think it makes sense to have a method on the Tap
interface that is guaranteed to be called once before the flow starts,
similar to flowConfInit, but which allows side-effects, like creating
database tables.

- André
> --
> You received this message because you are subscribed to the Google Groups
> "cascading-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cascading-use...@googlegroups.com.
> To post to this group, send email to cascadi...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cascading-user.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/cascading-user/781f29ea-f88d-4ac1-87a1-f11bcadef63c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
André Kelpe
an...@concurrentinc.com
http://concurrentinc.com

JPatrick Davenport

unread,
Mar 3, 2015, 12:52:39 PM3/3/15
to cascadi...@googlegroups.com
Thanks for the replies. I just wanted to make sure I follow best practices. I got it to work using the replace and delete. I re-create the resource in the delete.
Reply all
Reply to author
Forward
0 new messages