public class ScanSearchProvider extends Object implements SearchProvider, FilterDimensionRows
Constructor and Description |
---|
ScanSearchProvider()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clearDimension()
Clears the dimension cache, and resets the indices, effectively resetting the SearchProvider to a clean state.
|
TreeSet<DimensionRow> |
containsFilterOperation(TreeSet<DimensionRow> dimensionRows,
ApiFilter filter)
Contains filter operation.
|
Pagination<DimensionRow> |
findAllDimensionRowsPaged(PaginationParameters paginationParameters)
Return the desired page of dimension rows.
|
TreeSet<DimensionRow> |
findAllOrderedDimensionRows()
Getter for dimension rows in tree set for consistent order.
|
DimensionRow |
findDimensionRowByKeyValue(String value)
Get a dimension row given an id.
|
Pagination<DimensionRow> |
findFilteredDimensionRowsPaged(Set<ApiFilter> filters,
PaginationParameters paginationParameters)
Return the desired page of dimension rows that match the specified filters.
|
int |
getDimensionCardinality()
Gets the number of distinct dimension rows (assuming the key field is unique) in the index.
|
TreeSet<DimensionRow> |
inFilterOperation(TreeSet<DimensionRow> dimensionRows,
ApiFilter filter)
In-filter operation.
|
boolean |
isHealthy()
Method to check if search provider is healthy.
|
TreeSet<DimensionRow> |
notinFilterOperation(TreeSet<DimensionRow> dimensionRows,
ApiFilter filter)
Notin-filter operation.
|
void |
refreshIndex(Map<String,HashDataCache.Pair<DimensionRow,DimensionRow>> changedRows)
Method to add / update indexes.
|
void |
refreshIndex(String rowId,
DimensionRow dimensionRow,
DimensionRow dimensionRowOld)
Method to add / update indexes.
|
void |
setDimension(Dimension dimension)
Setter for dimension.
|
void |
setKeyValueStore(KeyValueStore keyValueStore)
Setter for store.
|
TreeSet<DimensionRow> |
startswithFilterOperation(TreeSet<DimensionRow> dimensionRows,
ApiFilter filter)
Startswith-filter operation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findAllDimensionRows, findFilteredDimensionRows, hasAnyRows, replaceIndex
public void setDimension(Dimension dimension)
SearchProvider
setDimension
in interface SearchProvider
dimension
- Dimension the SearchProvider is searchingpublic void setKeyValueStore(KeyValueStore keyValueStore)
SearchProvider
setKeyValueStore
in interface SearchProvider
keyValueStore
- KeyValueStore that holds the data rows indexed by the Search Providerpublic int getDimensionCardinality()
SearchProvider
getDimensionCardinality
in interface SearchProvider
public DimensionRow findDimensionRowByKeyValue(String value)
value
- dimension id to look uppublic TreeSet<DimensionRow> findAllOrderedDimensionRows()
SearchProvider
findAllOrderedDimensionRows
in interface SearchProvider
public boolean isHealthy()
SearchProvider
isHealthy
in interface SearchProvider
public void clearDimension()
SearchProvider
clearDimension
in interface SearchProvider
public void refreshIndex(String rowId, DimensionRow dimensionRow, DimensionRow dimensionRowOld)
SearchProvider
refreshIndex
in interface SearchProvider
rowId
- Unique ID for the dimension rowdimensionRow
- New, updated dimension rowdimensionRowOld
- Old dimension row if we're updating one, or null if there is no row for the rowIdpublic void refreshIndex(Map<String,HashDataCache.Pair<DimensionRow,DimensionRow>> changedRows)
SearchProvider
refreshIndex
in interface SearchProvider
changedRows
- Collection of newRow / oldRow pairs keyed by rowId to update the index with. Each row is a
pair of dimension rows (newRow is the key, oldRow is the value), with the rowId (ie. unique key in the dimension)
as the top-level Map key.public TreeSet<DimensionRow> inFilterOperation(TreeSet<DimensionRow> dimensionRows, ApiFilter filter)
FilterDimensionRows
inFilterOperation
in interface FilterDimensionRows
dimensionRows
- The unfiltered set of dimension rowsfilter
- The api filter to be applied to the dimension rowspublic TreeSet<DimensionRow> notinFilterOperation(TreeSet<DimensionRow> dimensionRows, ApiFilter filter)
FilterDimensionRows
notinFilterOperation
in interface FilterDimensionRows
dimensionRows
- The unfiltered set of dimension rowsfilter
- The api filter to be applied to the dimension rowspublic TreeSet<DimensionRow> startswithFilterOperation(TreeSet<DimensionRow> dimensionRows, ApiFilter filter)
FilterDimensionRows
startswithFilterOperation
in interface FilterDimensionRows
dimensionRows
- The unfiltered set of dimension rowsfilter
- The api filter to be applied to the dimension rowspublic TreeSet<DimensionRow> containsFilterOperation(TreeSet<DimensionRow> dimensionRows, ApiFilter filter)
containsFilterOperation
in interface FilterDimensionRows
dimensionRows
- The unfiltered set of dimension rowsfilter
- The api filterpublic Pagination<DimensionRow> findAllDimensionRowsPaged(PaginationParameters paginationParameters)
SearchProvider
findAllDimensionRowsPaged
in interface SearchProvider
paginationParameters
- The parameters that define a page (i.e. the number of rows per page,
and the page of results desired)public Pagination<DimensionRow> findFilteredDimensionRowsPaged(Set<ApiFilter> filters, PaginationParameters paginationParameters)
SearchProvider
findFilteredDimensionRowsPaged
in interface SearchProvider
filters
- ApiFilters to use for finding matching dimension rowspaginationParameters
- The parameters that define a page (i.e. the number of rows per page,
and the page of results desired)
Throws TimeoutException If the search times out.Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.