incubator-cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: what are utils.Fast* for?
Date Sat, 05 Dec 2009 14:23:20 GMT
Dead code.  Deleted.

BTW, if you're looking through the codebase you should probably start
here: http://wiki.apache.org/cassandra/ArchitectureInternals

On Sat, Dec 5, 2009 at 5:14 AM, gabriele renzi <rff.rff@gmail.com> wrote:
> Hi everyone,
>
> while trying to get a grasp of the codebase in cassandra, I run
> FindBugs on it and got a complaint about this code in
> org.apache.cassandra.utils.FastHashMap.containsValue(Object)
>
> """
>        // special case null values so that we don't have to
>        // perform null checks before every call to equals()
>        if (null == val)
>        {
>            for (int i = vals.length; i-- > 0;)
>            {
>                if ((set[i] != FREE && set[i] != REMOVED) && val
== vals[i])
>                {
>                    return true;
>                }
>            }
>        }
> """
>
> as Findbugs would prefer the last condition to be spelled as
>  null == vals[i]
>
> I wanted to look around to check this was not a bug, but then I
> wondered what is this class for. Apparently all of FastHashMap,
> FastObjechHash, FastLinkedHashMap, and FastHash are never used
> anywhere in the code:
>
> $ ack 'Fast(Linked|Hash|Object)'  -l
> src/java/org/apache/cassandra/utils/FastHash.java
> src/java/org/apache/cassandra/utils/FastHashMap.java
> src/java/org/apache/cassandra/utils/FastLinkedHashMap.java
> src/java/org/apache/cassandra/utils/FastObjectHash.java
> $
>
>
> Does anyone have an explanation for this  (e.g. they are loaded by
> reflection by concatenating strings) or are they just remnants of old
> code?
>

Mime
View raw message