On 14 Oct 2011, at 21:36, Olaf Bergner wrote:

Hi Ales,

yes, that sounds reasonable.
+1. Guess that would be an overloaded version of the existing method?
In fact, I have been worrying about the user relinquishing control over how Infinispan handles streaming large objects. One quick question, though: I envisaged

OutputStream writeToKey(K key)

to be the "standard" way of streaming large objects into Infinispan. Doesn't it fit your bill?

- Olaf
 
Am 14.10.11 22:29, schrieb Ales Justin:
@Olaf:

Looking at the API you proposed
 public interface StreamingHandler<K>  {
     void writeToKey(K key, InputStream largeObject);
     OutputStream writeToKey(K key);
     InputStream readFromKey(K key);
     boolean removeKey(K key);
     StreamingHandler<K> withFlags(Flag... flags);
 }

and what I actually need:
http://code.google.com/p/googleappengine/source/browse/trunk/java/src/main/com/google/appengine/api/files/FileService.java
--> see openRecordWriteChannel and openRecordReadChannel

Where the read has a way of jumping back&forth in the channel,
and write can seal the written bytes with closeFinally.
* http://code.google.com/p/googleappengine/source/browse/trunk/java/src/main/com/google/appengine/api/files/FileReadChannel.java
http://code.google.com/p/googleappengine/source/browse/trunk/java/src/main/com/google/appengine/api/files/FileWriteChannel.java

Hence I guess we could change it to

Closeable writeToKey(K key, InputStream largeObject); -- returning a handle to seal off (making it immutable from then on)

InputStream readFromKey (K key, long position); -- also taking position into consideration

Wdyt?

(unfortunately I also don't have the time to help with impl, 
but I'm definitely willing to test it (since I need it anyway, right :-)))

-Ales



_______________________________________________
infinispan-dev mailing list
infinispan-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev

_______________________________________________
infinispan-dev mailing list
infinispan-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev