Package org.apache.sysds.runtime.controlprogram.federated

## Class FederatedReadCache

- java.lang.Object
- - org.apache.sysds.runtime.controlprogram.federated.FederatedReadCache

    public class FederatedReadCache
    extends Object

### Nested Class Summary

Nested Classes
`static class` `FederatedReadCache.ReadCacheEntry` Class representing an entry of the federated read cache.

### Constructor Summary

Constructors
`FederatedReadCache()`

### Method Summary

All Methods Instance Methods Concrete Methods
`CacheableData<?>` `get​(String fname, boolean putPlaceholder)` Get the data from the ReadCacheEntry corresponding to the specified filename, if the data from this filename has already been read.
`void` `setData​(String fname, CacheableData<?> data)` Set the data for the ReadCacheEntry with specified filename.
`void` `setInvalid​(String fname)` Set the ReadCacheEntry of a given filename to invalid.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### FederatedReadCache

    public FederatedReadCache()

### Method Detail

#### get

    public CacheableData<?> get​(String fname,
                                boolean putPlaceholder)

Get the data from the ReadCacheEntry corresponding to the specified filename, if the data from this filename has already been read. Otherwise, create a new ReadCacheEntry for the filename and return null to indicate that the data is not cached yet.

Parameters:
  `fname` - the filename of the read data
  `putPlaceholder` - whether to put a placeholder if there is no mapping for the filename
Returns:
  the CacheableData object if it is cached, otherwise null

#### setData

    public void setData​(String fname,
                        CacheableData<?> data)

Set the data for the ReadCacheEntry with specified filename.

Parameters:
  `fname` - the filename of the read data
  `data` - the CacheableData object for setting the ReadCacheEntry

#### setInvalid

    public void setInvalid​(String fname)

Set the ReadCacheEntry of a given filename to invalid. Usually done after a failing read attempt so that the threads waiting for the data can continue.

Parameters:
  `fname` - the filename of the read data