lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera" <ser...@gmail.com>
Subject Re: IndexOutput writeVInt and others
Date Sat, 15 Dec 2007 06:51:06 GMT
Why not add IndexInput/Output methods to read/write to/from
Input/OutputStream, ByteBuffer and/or byte[]?
Isn't their logic general enough to make them utility classes?

On Dec 14, 2007 9:55 AM, Doron Cohen <cdoronc@gmail.com> wrote:

> On Dec 13, 2007 6:55 PM, Grant Ingersoll <gsingers@apache.org> wrote:
>
> > Yes.
> >
> > On Dec 13, 2007, at 10:43 AM, Doron Cohen wrote:
> >
> > > Did you mean refactoring IndexInput.readVint() and
> > > IndeOutput.writeVint()
> > > so that they can be used for e.g. payloads?
>
>
> Huh, sorry for the stupid question, it was in the subject all along.
>
>
> > >
> > > On Dec 13, 2007 4:50 PM, Grant Ingersoll < gsingers@apache.org> wrote:
> > >
> > >> I have been fiddling w/ some payload token filter helpers, such as
> > >> the
> > >> NumericPayloadTokenFilter.  I was in the process of adding a
> > >> TokenOffsetPayloadTokenFilter (what a mouthful) that adds the start
> > >> and end offset as payloads to the token.  Now, the easiest way to do
> > >> this is to encode the first 4 bytes with the startOffset and
> > >> another 4
> > >> bytes as the endOffset.  Then it occurs to me that it might make
> > >> sense
> > >> to encode them as vInts to save some bits.  Naturally, there is no
> > >> point in duplicating code, so I wonder if it makes sense to make
> > >> these
> > >> available for people wanting to encode payloads.  Any thoughts on
> > >> this?
>
>
> Seems good to me, as long as IndexIn/Output efficiency and
> readability is not hurt. Do you already have an API in mind?
>
>
> > >>
> > >> -Grant
> >
>



-- 
Regards,

Shai Erera

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message