|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface LocalRowKeyIndex
Defines a set of "local" APIs for a CollectionModel. The "local" APIs allow a client to query the model and determine if a set of rows are locally available. "Locally available" can mean the model has the given set of rows in a local cache and can honor a fetch request efficiently (for example, without performing a SQL query).
| Nested Class Summary | |
|---|---|
static class |
LocalRowKeyIndex.ConfidenceEnum used in the getEstimatedRowCountConfidence() API to determine if the row count is exact or an estimate |
static class |
LocalRowKeyIndex.LocalCachingStrategyEnum used to indicate the type of caching supported by the model |
| Method Summary | |
|---|---|
boolean |
areRowsLocallyAvailable(int rowCount)Check if a range of rows is locally available starting from the current row |
boolean |
areRowsLocallyAvailable(int startIndex, int rowCount)Check if a range of rows is locally available starting from a row index |
boolean |
areRowsLocallyAvailable(java.lang.Object startRowKey, int rowCount)Check if a range of rows is locally available starting from a row key |
void |
clearCachedRow(int index)Clear a row from the local cache by row index |
void |
clearCachedRow(java.lang.Object rowKey)Clear a row from the local cache by row key |
void |
clearCachedRows(int startingIndex, int rowsToClear)Clear the requested range of rows from the local cache |
void |
clearCachedRows(java.lang.Object startingRowKey, int rowsToClear)Clear the requested range of rows from the local cache |
void |
clearLocalCache()clear all rows from the local cache |
LocalRowKeyIndex.LocalCachingStrategy |
getCachingStrategy()Indicates the caching strategy supported by the model |
int |
getEstimatedRowCount()Convenient API to return a row count estimate. |
LocalRowKeyIndex.Confidence |
getEstimatedRowCountConfidence()Helper API to determine if the row count returned from getEstimatedRowCount() is EXACT, or an ESTIMATE |
boolean |
isRowLocallyAvailable(int rowIndex)Given a row index, check if a row is locally available |
boolean |
isRowLocallyAvailable(java.lang.Object rowKey)Given a row key, check if a row is locally available |
| Method Detail |
|---|
boolean isRowLocallyAvailable(int rowIndex)
rowIndex - index of row to checktrue if row is locally available flase otherwiseboolean isRowLocallyAvailable(java.lang.Object rowKey)
rowKey - row key for the row to checktrue if row is locally available flase otherwise
boolean areRowsLocallyAvailable(int startIndex,
int rowCount)
startIndex - staring index for the rangerowCount - number of rows in the rangetrue if range of rows is locally available flase otherwise
boolean areRowsLocallyAvailable(java.lang.Object startRowKey,
int rowCount)
startRowKey - staring row key for the rangerowCount - number of rows in the rangetrue if range of rows is locally available flase otherwiseboolean areRowsLocallyAvailable(int rowCount)
rowCount - number of rows in the rangetrue if range of rows is locally available flase otherwiseint getEstimatedRowCount()
This method can return -1 or a row count estimate if determining exact row count requires a data fetch. When dealing with estimated row counts, the caller needs to gracefully handle the case where isRowAvailable returns false for a row index or a row key.
LocalRowKeyIndex.Confidence getEstimatedRowCountConfidence()
getEstimatedRowCount() is EXACT, or an ESTIMATEvoid clearLocalCache()
void clearCachedRows(int startingIndex,
int rowsToClear)
startingIndex - starting row index for the range to clearrowsToClear - number of rows to clear from the cache
void clearCachedRows(java.lang.Object startingRowKey,
int rowsToClear)
startingRowKey - starting row key for the range to clearrowsToClear - number of rows to clear from the cachevoid clearCachedRow(int index)
index - row index for the row to clear from the cachevoid clearCachedRow(java.lang.Object rowKey)
rowKey - row key for the row to clear from the cacheLocalRowKeyIndex.LocalCachingStrategy getCachingStrategy()
LocalRowKeyIndex.LocalCachingStrategy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.