On Dec 28, 2004, at 3:15 PM, Scott Deboy wrote:


The problem is that the object.equals isn't sufficient when events are deserialized from a persistent store.

Being able to add events in a collection and know .contains will work - regardless of where the event came from - is definitely worth the hassle of maintaining the equals contract.

Thanks. I hadn't had the chance to analyze the code base to see from where the current LoggingEvent.equals was called.



Ceki wrote:

Anyway, a non-trivial amount of thinking went into the implementation of the equals() method. In the absence of a malevolent adversary, it is also correct although only probabilistically so. Its only downside is the addition of the static sequenceCount field and the sequenceNumber field in LoggingEvent.


Besides helping in the efficient implementation of the equals() method (needed by Chainsaw), the sequenceNumber field in LoggingEvent also greatly simplifies the implementation of receivers needing to repeatedly query a data store, e.g. DBReceiver.

So imho sequenceCount provides real added value.



Didn't doubt the amount of mental activity. However, I didn't want to guess at the motivation behind it and could find no discussion in the archives. From our recent discussion, the motivation wasn't to provide a sequencing that could be used to detect dropped messages in transmission. Something like that had been requested requested on the log4cxx lists in the recent past though I didn't follow through to see what their requirements were.

Is it a requirement that these identifiers be monotonically increasing? For example, could getSequenceNumber and setSequenceNumber be renamed to getEventID and setEventID (where they change in name would lose the semantics that the number should be higher for later events) and still fulfill the objective?


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



Reply via email to