I have now modified the datastore so that it takes size into account by creating a new insert() method in CyclicArray, and modifying the put() method in StandardDataStore.
This piece of javadoc describes the new functionality of put(): """ Inserts a DataStoreItem into the datastore. The new item will be placed in the DataStore such that the total length of all items "above" it (where new items are added at the "top") is smaller than the length of this DSI, but if it were one item lower, then the total size of the items above would be greater than the length of this item. If an item with no document is encountered then the item is inserted immedately. """ This is a significant change and while I have tested it, people should keep an eye out for weird behaviour in data insertion. Obviously, if anyone sees any flaws in the algorithm I describe above say so now! Ian. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20000806/e46941ec/attachment.pgp>