Hi,

I am thinking to get partitionId using affinity function and then set it
in SqlFieldsQuery  object.

By doing this will I be able to execute the query only a node which is
primary for this partition?

As per the ignite doc it should work. But I just want to confirm there are
no caveats in it.

Can this create any issue if the primary node goes down during query
execution?

public class SqlFieldsQuery extends Query<List<?>> {
    /**
     * Sets partitions for a query.
     * The query will be executed only on nodes which are primary for
specified partitions.
     * <p>
     * Note what passed array'll be sorted in place for performance
reasons, if it wasn't sorted yet.
     *
     * @param parts Partitions.
     * @return {@code this} for chaining.
     */
    public SqlFieldsQuery setPartitions(@Nullable int... parts) {
        this.parts = prepare(parts);
        return this;
    }

Thanks,
Prasad

Reply via email to