Community
Participate
Working Groups
I'm going to change the interface of Record and Blackboard concerning the attachment methods. The plan is to introduce an interface "org.eclipse.smila.datamodel.Attachment" for attachments instead of using plain byte[]. The purpose of this is to be able later to support attachments larger than 2 GB or to be able to introduce streaming of attachments without using the blackboard (e.g. in job workers). Though we will not implement any new features now, we want to introduce the new interface now so that we have a chance of implementing this after SMILA 1.0 without breaking the interface (hopefully :-). If you have created own pipelets or other stuff using attachments, you may have to change get/setAttachment calls to new names afterwards, but apart from this there should be no bigger problems.
I've committed a first version. Please review and feel free to discuss (though I will not be able to do changes before Jan 5th 2012 ;-) To adapt your code, it should be sufficient to replace invocations of record.getAttachment() and blackboard.getAttachment() by calls to record.getAttachmentsAsBytes(...) or blackboard.getAttachmentAsBytes(...) respectively. Additionally, you cannot call setAttachment(name, (byte[]) null)) anymore, it will throw an AttachmentException (a RuntimeException). Use setAttachment(new StoredAttachment(name(, size)?)) to denote that an attachment is stored in a persistence service instead of in-memory. Also, blackboard.getRecord(id).getAttachmentAsBytes() will throw an AttachmentException now if the attachment content is in BinaryStorage (instead of returning as before). Use blackboard.getAttachmentAsBytes(id, name). We can implement a subclass of StoredAttachment later, that will be able to retrieve the content from BinaryStorage on-demand (so that attachments in BinStorage or other persistence services can be supported without having to use the blackboard).
No objections so far, so I'll close this thing for now.