Package org.infinispan.client.hotrod
Interface StreamingRemoteCache<K>
- All Known Implementing Classes:
StreamingRemoteCacheImpl
public interface StreamingRemoteCache<K>
StreamingRemoteCache implements streaming versions of most
RemoteCache
methods- Since:
- 9.0
- Author:
- Tristan Tarrant
-
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 ofput(Object)
, which takes in lifespan parameters.An overloaded form ofput(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 lifespanUnit) An overloaded form ofputIfAbsent(Object)
which takes in lifespan parameters.putIfAbsent
(K key, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit) An overloaded form ofputIfAbsent(Object)
which takes in lifespan and maxIdle parameters.replaceWithVersion
(K key, long version) A form ofput(Object)
, which takes in a version.replaceWithVersion
(K key, long version, long lifespan, TimeUnit lifespanUnit) An overloaded form ofreplaceWithVersion(Object, long)
which takes in lifespan parameters.replaceWithVersion
(K key, long version, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit) An overloaded form ofreplaceWithVersion(Object, long)
which takes in lifespan and maxIdle parameters.
-
Method Details
-
get
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.- Parameters:
key
- key to use
-
put
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.- Parameters:
key
- key to use
-
put
An overloaded form ofput(Object)
, which takes in lifespan parameters. The returned output stream is not thread-safe.- Parameters:
key
- key to uselifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- unit of measurement for the lifespan
-
put
An overloaded form ofput(Object)
, which takes in lifespan and maxIdle parameters. The returned output stream is not thread-safe. -
putIfAbsent
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.- Parameters:
key
- key to use
-
putIfAbsent
An overloaded form ofputIfAbsent(Object)
which takes in lifespan parameters. The returned output stream is not thread-safe.- Parameters:
key
- key to uselifespan
- lifespan of the entrylifespanUnit
-TimeUnit
for lifespan
-
putIfAbsent
OutputStream putIfAbsent(K key, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit) An overloaded form ofputIfAbsent(Object)
which takes in lifespan and maxIdle parameters. The returned output stream is not thread-safe. -
replaceWithVersion
A form ofput(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.- Parameters:
key
- key to useversion
- the version to check for
-
replaceWithVersion
An overloaded form ofreplaceWithVersion(Object, long)
which takes in lifespan parameters. The returned output stream is not thread-safe.- Parameters:
key
- key to useversion
- the version to check forlifespan
- lifespan of the entrylifespanUnit
-TimeUnit
for lifespan
-
replaceWithVersion
OutputStream replaceWithVersion(K key, long version, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit) An overloaded form ofreplaceWithVersion(Object, long)
which takes in lifespan and maxIdle parameters. The returned output stream is not thread-safe.
-