All Packages This Package Class Hierarchy Class Search Index
Class grendel.storage.MessageID
java.lang.Object | +----grendel.storage.MessageID
This class represents a Message-ID. It does not contain the ID itself: there is no way to reconstruct the original string from this object; however, it contains a hash of that string which should be sufficiently unique so that the odds of a collision are 1 in 2^32 (since it is a 64-bit hash.)
We store the hash instead of the original string because it takes up significantly less memory, and in order to do threading, we tend to need a huge number of Message-IDs in memory at once.
See Also: MessageIDTable
class MessageID extends java.lang.Object { // Fields 1 long hash; // Constructors 4 MessageID(); MessageID(byte[], int, int); MessageID(String); MessageID(long); // Methods 4 public boolean equals(Object); protected long hashBytes(byte[], int, int); public int hashCode(); public String toString(); }
Fields
hash
long hash
Constructors
MessageID
MessageID()
Constructs a MessageID object with a null hash.
MessageID
MessageID(long hash)
Constructs a MessageID object with the given hash.
MessageID
MessageID(byte[] bytes, int start, int length)
Constructs a MessageID object for the given sub-sequence of bytes. A pointer to the bytes is not retained.
MessageID
MessageID(String chars)
Methods
toString
public String toString()
hashCode
public int hashCode()
equals
public boolean equals(Object x)
hashBytes
protected long hashBytes(byte[] bytes, int start, int length)
Computes a 64-bit hash of the given subsequence of bytes.
Note: this hash value is written out to mail summary files by the MailSummaryFileGrendel class. If the hash algorithm is changed, it will invalidate all existing mail summary files, and necessitate a change of the file format version number.
See Also: MailSummaryFileGrendel
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.4