+1 to eliminating the statics, they are indeed evil. The type to read should be stored in the thing doing/facilitating the reading not the vector itself and definitely not in a static field. Pretty sure vector shouldn't be facilitating the reading of itself. No need for synchronization then. The static methods should go away.
+1 to different sparse/dense on disk representations. I don't want to write a mostly empty 12000 element array if I have a cardinality of 12000 but only 30 values in each of my vectors. Likewise, I don't want to write indexes for 5000 values if my cardinality is 5200. +1 to eliminating class names in serializations (this is especially bad when an efficiently managed enum can do the job) On Thu, Feb 11, 2010 at 3:16 PM, Jake Mannix <jake.man...@gmail.com> wrote: > On Thu, Feb 11, 2010 at 11:51 AM, Sean Owen <sro...@gmail.com> wrote: > >> On Thu, Feb 11, 2010 at 6:37 PM, Jake Mannix <jake.man...@gmail.com> >> wrote: >> > Where do we actually use the VectorWritable.readVector() static >> > method? >> >> Looks like it's used in about 16 places across the code. >> > > We should remove them, I think. I'm pretty sure there's no reason for it. > There > is some inefficiency we need do deal with, which Robin brought up before: we > keep > a big String of the class name, and it should just be a little one-byte > enum-like > value. > > >> Yah this would be the same thing, if the static fields went away. >> Ergo, I think this method should just delegate to the constructor. Or >> go away entirely. Thoughts? >> > > +1 to go away entirely. Statics are evil, as Ted says. If they're not > needed, > they shouldn't be used. They're only here because when I ripped Writable > out of Vector, I made "the minimal possible change that would work", and > left > some cruft behind. > > -jake >