I can't seem to figure out why java can't find the clojure class in
the following example,
where f is a clojure function....

(defn cascading-function [f]
  (proxy [BaseOperation Function] [(Integer. 1) (Fields. (into-array
Comparable ["line"]))]
    (operate [flowProcess functionCall]
      (let [clojureData (. (Tuple. (. (. functionCall getArguments)
getTuple)) getString 1)
            result (hadoop-function f clojureData)
            resultTuple (Tuple.)]
        (. resultTuple add result)
        (. (. functionCall getOutputCollector) add resultTuple)))))


cascading function returns a java object that implements Function
(from the cascading framework) and extends BaseOperation, and it
implements the operate method.
The error that I am seeing is a ClassNotFoundException for whatever I
pass in as f.

For some more context, I am trying to wrap the cascading framework in
clojure, (www.cascading.org)
The internal "driver"/framework code is in Java, and I am using
clojure to wrap the user hooks for defining operations and making
jobs. This wrapping mainly involves tedious creation of objects, one
of the objects is this Function object, and I am trying to proxy
Function and make it close over (closure) clojure functions so that I
can define the actual logic in a nice (clojure) way.


(If i implement the Function interface as an object in Java,
everything seems to run fine)
Java (framework code) -> Clojure (wrapper over making jobs) -> Java
(an operation, implements Function interface)

(defn cascading-function []
  (FunctionSample.))
what I want is
Java (framework code) -> Clojure (wrapper over making jobs) -> Clojure
(operation)

but the final part is not working so well.

cascading-function is called by clojure code which wraps/builds up
objects for use by Java/cascading framework.

Does anyone know what I might be doing wrong?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to