Class StreamingRemoteCacheImpl<K>
java.lang.Object
org.infinispan.client.hotrod.impl.StreamingRemoteCacheImpl<K>
- All Implemented Interfaces:
StreamingRemoteCache<K>
Implementation of
StreamingRemoteCache- Since:
- 9.0
- Author:
- Tristan Tarrant
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends InputStream & VersionedMetadata>
TRetrieves the value of the specified key as anInputStream.Initiates a streaming put operation.An overloaded form ofStreamingRemoteCache.put(Object), which takes in lifespan parameters.An overloaded form ofStreamingRemoteCache.put(Object), which takes in lifespan and maxIdle parameters.putIfAbsent(K key) A conditional form of put which inserts an entry into the cache only if no mapping for the key is already present.putIfAbsent(K key, long lifespan, TimeUnit unit) An overloaded form ofStreamingRemoteCache.putIfAbsent(Object)which takes in lifespan parameters.putIfAbsent(K key, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit) An overloaded form ofStreamingRemoteCache.putIfAbsent(Object)which takes in lifespan and maxIdle parameters.replaceWithVersion(K key, long version) A form ofStreamingRemoteCache.put(Object), which takes in a version.replaceWithVersion(K key, long version, long lifespan, TimeUnit unit) An overloaded form ofStreamingRemoteCache.replaceWithVersion(Object, long)which takes in lifespan parameters.replaceWithVersion(K key, long version, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit) An overloaded form ofStreamingRemoteCache.replaceWithVersion(Object, long)which takes in lifespan and maxIdle parameters.
-
Constructor Details
-
StreamingRemoteCacheImpl
-
-
Method Details
-
get
Description copied from interface:StreamingRemoteCacheRetrieves the value of the specified key as anInputStream. It is up to the application to ensure that the stream is consumed and closed. The marshaller is ignored, i.e. all data will be read in its raw binary form. The returned input stream implements theVersionedMetadatainterface. The returned input stream is not thread-safe.- Specified by:
getin interfaceStreamingRemoteCache<K>- Parameters:
key- key to use
-
put
Description copied from interface:StreamingRemoteCacheInitiates a streaming put operation. It is up to the application to write to the returnedOutputStreamand close it when there is no more data to write. The marshaller is ignored, i.e. all data will be written in its raw binary form. The returned output stream is not thread-safe.- Specified by:
putin interfaceStreamingRemoteCache<K>- Parameters:
key- key to use
-
put
Description copied from interface:StreamingRemoteCacheAn overloaded form ofStreamingRemoteCache.put(Object), which takes in lifespan parameters. The returned output stream is not thread-safe.- Specified by:
putin interfaceStreamingRemoteCache<K>- Parameters:
key- key to uselifespan- lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit- unit of measurement for the lifespan
-
put
public OutputStream put(K key, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit) Description copied from interface:StreamingRemoteCacheAn overloaded form ofStreamingRemoteCache.put(Object), which takes in lifespan and maxIdle parameters. The returned output stream is not thread-safe.- Specified by:
putin interfaceStreamingRemoteCache<K>- Parameters:
key- key to uselifespan- lifespan of the entrylifespanUnit-TimeUnitfor lifespanmaxIdle- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleUnit-TimeUnitfor maxIdle
-
putIfAbsent
Description copied from interface:StreamingRemoteCacheA conditional form of put which inserts an entry into the cache only if no mapping for the key is already present. The operation is atomic. The server only performs the operation once the stream has been closed. The returned output stream is not thread-safe.- Specified by:
putIfAbsentin interfaceStreamingRemoteCache<K>- Parameters:
key- key to use
-
putIfAbsent
Description copied from interface:StreamingRemoteCacheAn overloaded form ofStreamingRemoteCache.putIfAbsent(Object)which takes in lifespan parameters. The returned output stream is not thread-safe.- Specified by:
putIfAbsentin interfaceStreamingRemoteCache<K>- Parameters:
key- key to uselifespan- lifespan of the entryunit-TimeUnitfor lifespan
-
putIfAbsent
public OutputStream putIfAbsent(K key, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit) Description copied from interface:StreamingRemoteCacheAn overloaded form ofStreamingRemoteCache.putIfAbsent(Object)which takes in lifespan and maxIdle parameters. The returned output stream is not thread-safe.- Specified by:
putIfAbsentin interfaceStreamingRemoteCache<K>- Parameters:
key- key to uselifespan- lifespan of the entrylifespanUnit-TimeUnitfor lifespanmaxIdle- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleUnit-TimeUnitfor maxIdle
-
replaceWithVersion
Description copied from interface:StreamingRemoteCacheA form ofStreamingRemoteCache.put(Object), which takes in a version. The value will be replaced on the server only if the existing entry's version matches. The returned output stream is not thread-safe.- Specified by:
replaceWithVersionin interfaceStreamingRemoteCache<K>- Parameters:
key- key to useversion- the version to check for
-
replaceWithVersion
Description copied from interface:StreamingRemoteCacheAn overloaded form ofStreamingRemoteCache.replaceWithVersion(Object, long)which takes in lifespan parameters. The returned output stream is not thread-safe.- Specified by:
replaceWithVersionin interfaceStreamingRemoteCache<K>- Parameters:
key- key to useversion- the version to check forlifespan- lifespan of the entryunit-TimeUnitfor lifespan
-
replaceWithVersion
public OutputStream replaceWithVersion(K key, long version, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit) Description copied from interface:StreamingRemoteCacheAn overloaded form ofStreamingRemoteCache.replaceWithVersion(Object, long)which takes in lifespan and maxIdle parameters. The returned output stream is not thread-safe.- Specified by:
replaceWithVersionin interfaceStreamingRemoteCache<K>- Parameters:
key- key to useversion- the version to check forlifespan- lifespan of the entrylifespanUnit-TimeUnitfor lifespanmaxIdle- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleUnit-TimeUnitfor maxIdle
-