[ https://issues.apache.org/jira/browse/IGNITE-4523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15831859#comment-15831859 ]
Alexei Scherbakov commented on IGNITE-4523: ------------------------------------------- Added support for local queries. As was requested on dev list, I'm adding short description of API changes: Query class is extended with methods: {noformat} /** * Gets partitions for query, in ascending order. */ @Nullable public int[] getPartitions() { return parts; } /** * Sets partitions for a query. * The query will be executed only on nodes which are primary for specified partitions. * * @param parts Partitions. * @return {@code this} for chaining. */ public Query<R> setPartitions(@Nullable int... parts) { this.parts = parts; if (this.parts != null) { A.notEmpty(parts, "Partitions"); // Validate partitions. for (int i = 0; i < parts.length; i++) { if (i < parts.length - 1) A.ensure(parts[i] != parts[i + 1], "Partition duplicates are not allowed"); A.ensure(0 <= parts[i] && parts[i] < CacheConfiguration.MAX_PARTITIONS_COUNT, "Illegal partition"); } Arrays.sort(this.parts); } return this; } {noformat} ScanQuery class methods are marked for deprecation, because we already have get/setPartitions(int... parts): {noformat} /** * Sets partition number over which this query should iterate. If {@code null}, query will iterate over * all partitions in the cache. Must be in the range [0, N) where N is partition number in the cache. * * @param part Partition number over which this query should iterate. * @return {@code this} for chaining. * * @deprecated Use {@link #setPartitions(int... parts)} instead.} */ @Deprecated public ScanQuery<K, V> setPartition(@Nullable Integer part) { if (part == null) setPartitions(null); else setPartitions(part); return this; } /** * Gets partition number over which this query should iterate. Will return {@code null} if partition was not * set. In this case query will iterate over all partitions in the cache. * * @return Partition number or {@code null}. * * @deprecated Use {@link #getPartitions()} instead.} */ @Deprecated @Nullable public Integer getPartition() { return getPartitions() == null ? null : getPartitions()[0]; } {noformat} > Allow distributed SQL query execution over explicit set of partitions > --------------------------------------------------------------------- > > Key: IGNITE-4523 > URL: https://issues.apache.org/jira/browse/IGNITE-4523 > Project: Ignite > Issue Type: Improvement > Components: cache, SQL > Affects Versions: 1.8 > Reporter: Alexei Scherbakov > Assignee: Alexei Scherbakov > Fix For: 1.9 > > > 3Currently distributed SQL query is executed on all nodes containing primary > partitions for a cache, sending map query requests on all nodes in grid. > Sometimes we know in advance which partitions hold a data for query, on > example, in case of custom affinity function. > Therefore it's possible to reduce number of nodes receiving map query request > by providing explicit set of partitions, which will give significant > performance advantage and traffic reduction in case of very large clusters. > Internally we already have such functionality, so the only necessary thing is > to provide public API for what. -- This message was sent by Atlassian JIRA (v6.3.4#6332)