lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless" <luc...@mikemccandless.com>
Subject Re: Payload API
Date Sun, 18 Nov 2007 18:19:37 GMT
"Michael Busch" <buschmic@gmail.com> wrote:
> Michael McCandless wrote:
> 
> >>
> >> class Token {
> >>     byte[] payload;
> >>     int payloadLength;
> >>     void setPayload(byte[], int length)
> >>     byte[] getPayload()
> >>     int getPayloadLength()
> >> ...
> >> }
> > 
> > +1
> > 
> > Mike
> > 
> 
> Mike,
> 
> just to clarify: I had suggested this at the ApacheCon because I believe
> now that we have the DocumentsWriter we don't need such a "container
> object" anymore, because we can write the payload bytes directly into
> the proxStream, right? Before, in DocumentWriter, we needed it while
> sorting the postings.
> Would it be sufficient to change DocumentsWriter#addPosition(Token) to
> use the new methods in Token instead of using the Payloads object?

Exactly: DocumentsWriter writes the bytes immediately into the
proxStream.  You should only need to change addPosition: I think it
can access these new [package protected] fields directly from the
Token, instead of using the separate Payload object.

> Oh and Yonik, I think in addition we'd also need a payloadOffset member?

Oh yes, we need offset too.

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message