[
https://issues.apache.org/jira/browse/MAHOUT-728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13281011#comment-13281011
]
Karthik Suryanarayanan commented on MAHOUT-728:
-----------------------------------------------
I hope every one is aware of the warnings posted in fastutil:
Warnings
All classes are not synchronized. If multiple threads access one of these
classes concurrently, and at least one of the threads modifies it, it must be
synchronized externally. Iterators will behave unpredictably in the presence of
concurrent modifications. Reads, however, can be carried out concurrently.
Reference-based classes violate the Map contract. They intentionally compare
objects by reference, and do not use the equals() method. They should be used
only when reference-based equality is desired (for instance, if all objects
involved are canonized, as it happens with interned strings).
Linked classes do not implement wholly the SortedMap interface. They provide
methods to get the first and last element in iteration order, and to start a
bidirectional iterator from any element, but any submap or subset method will
cause an UnsupportedOperationException (this may change in future versions).
Substructures in sorted classes allow the creation of arbitrary substructures.
In java.util, instead, you can only create contained sub-substructures (BTW,
why?). For instance, (new TreeSet()).tailSet(1).tailSet(0) will throw an
exception, but (new IntRBTreeSet()).tailSet(1).tailSet(0) won't.
Immutability is syntactically based (as opposed to semantically based). All
methods that are known not to be causing modifications to the structure at
compile time will not throw exceptions (e.g., EMPTY_SET.clear()). All other
methods will cause an UnsupportedOperationException. Note that (as of Java 5)
the situation in java.util is definitely different, and inconsistent: for
instance, in singletons add() always throws an exception, whereas remove() does
it only if the singleton would be modified. This behaviour agrees with the
interface documentation, but it is nonetheless confusing.
> Migrate from collections to fastutil?
> -------------------------------------
>
> Key: MAHOUT-728
> URL: https://issues.apache.org/jira/browse/MAHOUT-728
> Project: Mahout
> Issue Type: Task
> Components: collections
> Affects Versions: 0.5
> Reporter: Sean Owen
> Assignee: Benson Margulies
>
> Filing this placeholder on behalf of Benson, who suggested we might use
> fastutil instead of continuing to maintain mahout-collecitons.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira