Doug Cutting wrote:

A reason not to commit something like this now would be if it complicates the effort to make the format extensible. Each index feature we add now will require back-compatibility in the future, and we should be hesitant to add features that might be difficult to support in the future.
Yes, I agree.

I had the idea of defining Payload as an interface:

public interface Payload {
   void serialize(IndexOutput out) throws IOException;
   int serializedLength();
   void deserialize(IndexInput in, int length) throws IOException;
}

and to have a default implementation ByteArrayPayload that works like my current patch. Then people could write their own implementation of Payload and define how to serialize the content.

For example, this modifies the Token API. If, long-term, we think that Token should be extensible, then perhaps we should make it extensible now, and add this through a subclass of Token (perhaps a mixin interface that Tokens can implement).

Yes I could introduce a new class called e.g. PayloadToken that extends Token (good that it is not final anymore). Not sure if I understand your mixin interface idea... could you elaborate, please?

I like the Payload feature, and think it should probably be added. I just want to make sure that we've first thought a bit about its future-compatibility.

Doug

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to