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
-
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:StreamingRemoteCache
Retrieves 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 theVersionedMetadata
interface. The returned input stream is not thread-safe.- Specified by:
get
in interfaceStreamingRemoteCache<K>
- Parameters:
key
- key to use
-
put
Description copied from interface:StreamingRemoteCache
Initiates a streaming put operation. It is up to the application to write to the returnedOutputStream
and 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:
put
in interfaceStreamingRemoteCache<K>
- Parameters:
key
- key to use
-
put
Description copied from interface:StreamingRemoteCache
An overloaded form ofStreamingRemoteCache.put(Object)
, which takes in lifespan parameters. The returned output stream is not thread-safe.- Specified by:
put
in 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:StreamingRemoteCache
An overloaded form ofStreamingRemoteCache.put(Object)
, which takes in lifespan and maxIdle parameters. The returned output stream is not thread-safe.- Specified by:
put
in interfaceStreamingRemoteCache<K>
- Parameters:
key
- key to uselifespan
- lifespan of the entrylifespanUnit
-TimeUnit
for lifespanmaxIdle
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleUnit
-TimeUnit
for maxIdle
-
putIfAbsent
Description copied from interface:StreamingRemoteCache
A 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:
putIfAbsent
in interfaceStreamingRemoteCache<K>
- Parameters:
key
- key to use
-
putIfAbsent
Description copied from interface:StreamingRemoteCache
An overloaded form ofStreamingRemoteCache.putIfAbsent(Object)
which takes in lifespan parameters. The returned output stream is not thread-safe.- Specified by:
putIfAbsent
in interfaceStreamingRemoteCache<K>
- Parameters:
key
- key to uselifespan
- lifespan of the entryunit
-TimeUnit
for lifespan
-
putIfAbsent
public OutputStream putIfAbsent(K key, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit) Description copied from interface:StreamingRemoteCache
An overloaded form ofStreamingRemoteCache.putIfAbsent(Object)
which takes in lifespan and maxIdle parameters. The returned output stream is not thread-safe.- Specified by:
putIfAbsent
in interfaceStreamingRemoteCache<K>
- Parameters:
key
- key to uselifespan
- lifespan of the entrylifespanUnit
-TimeUnit
for lifespanmaxIdle
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleUnit
-TimeUnit
for maxIdle
-
replaceWithVersion
Description copied from interface:StreamingRemoteCache
A 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:
replaceWithVersion
in interfaceStreamingRemoteCache<K>
- Parameters:
key
- key to useversion
- the version to check for
-
replaceWithVersion
Description copied from interface:StreamingRemoteCache
An overloaded form ofStreamingRemoteCache.replaceWithVersion(Object, long)
which takes in lifespan parameters. The returned output stream is not thread-safe.- Specified by:
replaceWithVersion
in interfaceStreamingRemoteCache<K>
- Parameters:
key
- key to useversion
- the version to check forlifespan
- lifespan of the entryunit
-TimeUnit
for lifespan
-
replaceWithVersion
public OutputStream replaceWithVersion(K key, long version, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit) Description copied from interface:StreamingRemoteCache
An overloaded form ofStreamingRemoteCache.replaceWithVersion(Object, long)
which takes in lifespan and maxIdle parameters. The returned output stream is not thread-safe.- Specified by:
replaceWithVersion
in interfaceStreamingRemoteCache<K>
- Parameters:
key
- key to useversion
- the version to check forlifespan
- lifespan of the entrylifespanUnit
-TimeUnit
for lifespanmaxIdle
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleUnit
-TimeUnit
for maxIdle
-