The purpose of that method is to allow the API consumer to create Blob instances which are immediately streamed down to the BlobStore in the Microkernel. This way the API consumer can control at what point streaming takes place when setting values of Type.BINARY on a Tree: blob instances created through ContentSession.createBlob() are immediately streamed down while all other Blob instances are only streamed down on commit. There is also room for further optimisation here by making ContentSession.createBlob() stream in the background and a subsequent commit that relies on such a binary wait for the streaming to complete.

Note that createBlobd() is very much the same as the getCoreValueFactory() method, which it replaced. Through the latter you could also create binary values which had been immediately streamed down to the Microkernel.

Michael


On 19.10.12 8:54, Angela Schreiber wrote:
hi all

recent the ContentSession interface got a new method

  Blob createBlob(InputStream inputStream) throws IOException;

this there is no TODO comment associated with it i assume
that is intended to stay... however, it feels a bit odd to
me having that method on the content session interface and
i don't see how and why a regular API consumer of the
ContentSession would need/use this.

currently the only usage of the method is in a private
method on ValueFactoryImpl, which for that very purpose
needs to have the content session passed to the constructor
but doesn't otherwise need access to the content session
at all...

imo that should be reviewed again.

kind regards
angela



Reply via email to