Package org.apache.ignite.cache.query
Class ScanQuery<K,V>
- java.lang.Object
-
- org.apache.ignite.cache.query.Query<javax.cache.Cache.Entry<K,V>>
-
- org.apache.ignite.cache.query.ScanQuery<K,V>
-
- All Implemented Interfaces:
Serializable
public final class ScanQuery<K,V> extends Query<javax.cache.Cache.Entry<K,V>>
Scan query over cache entries. Will accept all the entries if no predicate was set.- See Also:
IgniteCache.query(Query), Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.ignite.cache.query.Query
DFLT_PAGE_SIZE
-
-
Constructor Summary
Constructors Constructor Description ScanQuery()Create scan query returning all entries.ScanQuery(int part)Creates partition scan query returning all entries for given partition.ScanQuery(@Nullable Integer part, @Nullable IgniteBiPredicate<K,V> filter)Create scan query with filter.ScanQuery(@Nullable IgniteBiPredicate<K,V> filter)Create scan query with filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IgniteBiPredicate<K,V>getFilter()Gets filter.@Nullable IntegergetPartition()Gets partition number over which this query should iterate.ScanQuery<K,V>setFilter(@Nullable IgniteBiPredicate<K,V> filter)Sets filter.ScanQuery<K,V>setLocal(boolean loc)Sets whether this query should be executed on local node only.ScanQuery<K,V>setPageSize(int pageSize)Sets optional page size, if0, then default is used.ScanQuery<K,V>setPartition(@Nullable Integer part)Sets partition number over which this query should iterate.StringtoString()-
Methods inherited from class org.apache.ignite.cache.query.Query
getPageSize, isLocal, prepare
-
-
-
-
Constructor Detail
-
ScanQuery
public ScanQuery()
Create scan query returning all entries.
-
ScanQuery
public ScanQuery(int part)
Creates partition scan query returning all entries for given partition.- Parameters:
part- Partition.
-
ScanQuery
public ScanQuery(@Nullable @Nullable IgniteBiPredicate<K,V> filter)Create scan query with filter.- Parameters:
filter- Filter. Ifnullthen all entries will be returned.
-
ScanQuery
public ScanQuery(@Nullable @Nullable Integer part, @Nullable @Nullable IgniteBiPredicate<K,V> filter)Create scan query with filter.- Parameters:
part- Partition.filter- Filter. Ifnullthen all entries will be returned.
-
-
Method Detail
-
getFilter
public IgniteBiPredicate<K,V> getFilter()
Gets filter.- Returns:
- Filter.
-
setFilter
public ScanQuery<K,V> setFilter(@Nullable @Nullable IgniteBiPredicate<K,V> filter)
Sets filter.- Parameters:
filter- Filter. Ifnullthen all entries will be returned.- Returns:
thisfor chaining.
-
setPartition
public ScanQuery<K,V> setPartition(@Nullable @Nullable Integer part)
Sets partition number over which this query should iterate. Ifnull, query will iterate over all partitions in the cache. Must be in the range [0, N) where N is partition number in the cache.- Parameters:
part- Partition number over which this query should iterate.- Returns:
thisfor chaining.
-
getPartition
@Nullable public @Nullable Integer getPartition()
Gets partition number over which this query should iterate. Will returnnullif partition was not set. In this case query will iterate over all partitions in the cache.- Returns:
- Partition number or
null.
-
setPageSize
public ScanQuery<K,V> setPageSize(int pageSize)
Sets optional page size, if0, then default is used.- Overrides:
setPageSizein classQuery<javax.cache.Cache.Entry<K,V>>- Parameters:
pageSize- Optional page size.- Returns:
thisfor chaining.
-
setLocal
public ScanQuery<K,V> setLocal(boolean loc)
Sets whether this query should be executed on local node only.
-
-