R - Record to store by this interface.StateStoreCacheDisabledNameserviceStore, MembershipStore, MountTableStore, RouterStorepublic abstract class CachedRecordStore<R extends BaseRecord> extends RecordStore<R> implements StateStoreCache
| Modifier | Constructor | Description |
|---|---|---|
protected |
CachedRecordStore(java.lang.Class<R> clazz,
StateStoreDriver driver) |
Create a new cached record store.
|
protected |
CachedRecordStore(java.lang.Class<R> clazz,
StateStoreDriver driver,
boolean over) |
Create a new cached record store.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.util.List<R> |
getCachedRecords() |
Get all the cached records.
|
protected QueryResult<R> |
getCachedRecordsAndTimeStamp() |
Get all the cached records and the time stamp of the cache.
|
boolean |
loadCache(boolean force) |
Load the cache from the State Store.
|
void |
overrideExpiredRecord(R record) |
Updates the state store with any record overrides we detected, such as an
expired state.
|
void |
overrideExpiredRecords(QueryResult<R> query) |
Updates the state store with any record overrides we detected, such as an
expired state.
|
getDriver, getRecordClass, newInstanceprotected CachedRecordStore(java.lang.Class<R> clazz, StateStoreDriver driver)
clazz - Class of the record to store.driver - State Store driver.protected CachedRecordStore(java.lang.Class<R> clazz, StateStoreDriver driver, boolean over)
clazz - Class of the record to store.driver - State Store driver.over - If the entries should be overridden if they expirepublic boolean loadCache(boolean force)
throws java.io.IOException
StateStoreCacheloadCache in interface StateStoreCacheforce - If we force the load.java.io.IOException - If there was an error loading the cache.public void overrideExpiredRecords(QueryResult<R> query) throws java.io.IOException
query - RecordQueryResult containing the data to be inspected.java.io.IOException - If the values cannot be updated.public void overrideExpiredRecord(R record) throws java.io.IOException
record - record to be updated.java.io.IOException - If the values cannot be updated.public java.util.List<R> getCachedRecords() throws StateStoreUnavailableException
StateStoreUnavailableException - If the State store is not available.protected QueryResult<R> getCachedRecordsAndTimeStamp() throws StateStoreUnavailableException
StateStoreUnavailableException - If the State store is not available.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.