mahout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Owen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MAHOUT-650) java.io.Serializable should be implemented by org.apache.mahout.cf.taste.impl.common.LongPrimitiveArrayIterator
Date Mon, 04 Apr 2011 17:04:05 GMT

    [ https://issues.apache.org/jira/browse/MAHOUT-650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13015497#comment-13015497
] 

Sean Owen commented on MAHOUT-650:
----------------------------------

Yes, EJB remote interfaces have always needed to deal with Serializable objects. That's why
most of the value classes in the older CF code are Serializable. While Mahout doesn't make
use of Serializable directly, there's some non-zero audience for needing them marked as Serializable.
I buy all that.

DataModel itself is not intended to be wrapped and exposed as a remote service. You could
try to wrap it up as a session bean. In that case, I'd advise you to not tie the API of your
bean directly to the DataModel API. That is, just because getUserIDs() returns an iterator,
doesn't mean your remote bean needs exactly this method.

And in fact, getUserIDs() returns an iterator instead of an array to allow for implementations
that return an iterator backed not by an array, but by, for example, a JDBC ResultSet. That's
not Serializable, so this will fail anyway if the DataModel isn't returning an array-backed
implementation.

I'd say that the service should expose a method returning long[], which reads longs from the
underlying DataModel's LongPrimitiveIterator. This, to me, is the most conceptually correct
approach on all counts and will work.


> java.io.Serializable should be implemented by org.apache.mahout.cf.taste.impl.common.LongPrimitiveArrayIterator
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: MAHOUT-650
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-650
>             Project: Mahout
>          Issue Type: Improvement
>          Components: Collaborative Filtering
>    Affects Versions: 0.4
>         Environment: Mac OS X 10.6, Java EE 6, EJB 3.1, Glassfish 3.0.1
>            Reporter: Manuel Blechschmidt
>            Assignee: Sean Owen
>            Priority: Minor
>              Labels: datamodel, ejb, taste
>         Attachments: PatchLongPrimitiveArrayIteratorSerializable.patch, RecommenderServices.png,
SemRecSysDataModelBean.java, SemRecSysDataModelTest.java, SemanticRecommenderDataModel.pdf
>
>
> I am using Mahout in a Java EE 6 application. I implemented a DataModel as an EJB 3.1
Singelton Service Bean. I wanted to write some test cases but unfortunately some of the classes
of Taste are not serializable.
> At the moment LongPrimitiveArrayIterator stops my test cases from working.
> See attached patch, files and images for details

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message