org.apache.ignite.internal.sql.optimizer.affinity

## Class PartitionResult

- java.lang.Object
- - org.apache.ignite.internal.sql.optimizer.affinity.PartitionResult

    public class PartitionResult
    extends Object

Partition extraction result.

### Constructor Summary

Constructors
Constructor and Description
`PartitionResult(PartitionNode tree, AffinityTopologyVersion topVer, String cacheName, int partsCnt)` Constructor.
`PartitionResult(PartitionNode tree, PartitionTableAffinityDescriptor aff, AffinityTopologyVersion topVer)` Constructor.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`PartitionTableAffinityDescriptor` `affinity()`
`String` `cacheName()`
`static int[]` `calculatePartitions(int[] explicitParts, PartitionResult derivedParts, Object[] args)` Calculate partitions for the query.
`boolean` `isClientPartitionAwarenessApplicable()`
`int` `partitionsCount()`
`AffinityTopologyVersion` `topologyVersion()`
`String` `toString()`
`PartitionNode` `tree()` Tree.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### PartitionResult

    public PartitionResult(PartitionNode tree,
                           PartitionTableAffinityDescriptor aff,
                           AffinityTopologyVersion topVer)

Constructor.

Parameters:
  `tree` - Tree.
  `aff` - Affinity function.

#### PartitionResult

    public PartitionResult(PartitionNode tree,
                           AffinityTopologyVersion topVer,
                           String cacheName,
                           int partsCnt)

Constructor.

Parameters:
  `tree` - Tree.
  `topVer` - Affinity topology version.
  `cacheName` - Cache name.
  `partsCnt` - Partitions count.

### Method Detail

#### tree

    public PartitionNode tree()

Tree.

#### affinity

    public PartitionTableAffinityDescriptor affinity()

Returns:
  Affinity function.

#### calculatePartitions

    public static int[] calculatePartitions(int[] explicitParts,
                                            PartitionResult derivedParts,
                                            Object[] args)

Calculate partitions for the query.

Parameters:
  `explicitParts` - Explicit partitions provided in SqlFieldsQuery.partitions property.
  `derivedParts` - Derived partitions found during partition pruning.
  `args` - Arguments.
Returns:
  Calculated partitions or `null` if failed to calculate and there should be a broadcast.

#### topologyVersion

    public AffinityTopologyVersion topologyVersion()

Returns:
  Affinity topology version. This method is intended to be used within the Jdbc thin client.

#### cacheName

    public String cacheName()

Returns:
  Cache name. This method is intended to be used within the Jdbc thin client.

#### partitionsCount

    public int partitionsCount()

Returns:
  Partitions count. This method is intended to be used within the Jdbc thin client.

#### isClientPartitionAwarenessApplicable

    public boolean isClientPartitionAwarenessApplicable()

Returns:
  True if applicable to jdbc thin client side partition awareness: 1. Rendezvous affinity function without map filters was used; 2. Partition result tree neither PartitoinAllNode nor PartitionNoneNode;

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021