org.apache.ignite.internal.processors.platform.cache.affinity

## Class PlatformAffinity

- java.lang.Object
- - org.apache.ignite.internal.processors.platform.PlatformAbstractTarget
  - - org.apache.ignite.internal.processors.platform.cache.affinity.PlatformAffinity

All Implemented Interfaces:
  PlatformTarget

    public class PlatformAffinity
    extends PlatformAbstractTarget

Native cache wrapper implementation.

### Field Summary

Fields
`static int` `OP_AFFINITY_KEY`
`static int` `OP_ALL_PARTITIONS`
`static int` `OP_BACKUP_PARTITIONS`
`static int` `OP_IS_BACKUP`
`static int` `OP_IS_PRIMARY`
`static int` `OP_IS_PRIMARY_OR_BACKUP`
`static int` `OP_MAP_KEY_TO_NODE`
`static int` `OP_MAP_KEY_TO_PRIMARY_AND_BACKUPS`
`static int` `OP_MAP_KEYS_TO_NODES`
`static int` `OP_MAP_PARTITION_TO_NODE`
`static int` `OP_MAP_PARTITION_TO_PRIMARY_AND_BACKUPS`
`static int` `OP_MAP_PARTITIONS_TO_NODES`
`static int` `OP_PARTITION`
`static int` `OP_PRIMARY_PARTITIONS`

### Fields inherited from class org.apache.ignite.internal.processors.platform.PlatformAbstractTarget

`FALSE, log, platformCtx, TRUE`

### Constructor Summary

Constructors
Constructor and Description
`PlatformAffinity(PlatformContext platformCtx, GridKernalContext igniteCtx, String name)` Constructor.

### Method Summary

Methods
`int` `partitions()`
`protected long` `processInStreamOutLong(int type, BinaryRawReaderEx reader)` Process IN operation.
`protected void` `processInStreamOutStream(int type, BinaryRawReaderEx reader, BinaryRawWriterEx writer)` Process IN-OUT operation.

### Methods inherited from class org.apache.ignite.internal.processors.platform.PlatformAbstractTarget

`convertException, currentFuture, futureWriter, inObjectStreamOutStream, inStreamOutLong, inStreamOutObject, inStreamOutStream, listenFuture, listenFutureAndGet, listenFutureForOperation, listenFutureForOperationAndGet, outLong, outObject, outStream, platformContext, processInObjectStreamOutStream, processInStreamOutObject, processOutLong, processOutObject, processOutStream, throwUnsupported`

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

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

### Field Detail

#### OP_AFFINITY_KEY

    public static final int OP_AFFINITY_KEY

See Also:
  Constant Field Values

#### OP_ALL_PARTITIONS

    public static final int OP_ALL_PARTITIONS

See Also:
  Constant Field Values

#### OP_BACKUP_PARTITIONS

    public static final int OP_BACKUP_PARTITIONS

See Also:
  Constant Field Values

#### OP_IS_BACKUP

    public static final int OP_IS_BACKUP

See Also:
  Constant Field Values

#### OP_IS_PRIMARY

    public static final int OP_IS_PRIMARY

See Also:
  Constant Field Values

#### OP_IS_PRIMARY_OR_BACKUP

    public static final int OP_IS_PRIMARY_OR_BACKUP

See Also:
  Constant Field Values

#### OP_MAP_KEY_TO_NODE

    public static final int OP_MAP_KEY_TO_NODE

See Also:
  Constant Field Values

#### OP_MAP_KEY_TO_PRIMARY_AND_BACKUPS

    public static final int OP_MAP_KEY_TO_PRIMARY_AND_BACKUPS

See Also:
  Constant Field Values

#### OP_MAP_KEYS_TO_NODES

    public static final int OP_MAP_KEYS_TO_NODES

See Also:
  Constant Field Values

#### OP_MAP_PARTITION_TO_NODE

    public static final int OP_MAP_PARTITION_TO_NODE

See Also:
  Constant Field Values

#### OP_MAP_PARTITION_TO_PRIMARY_AND_BACKUPS

    public static final int OP_MAP_PARTITION_TO_PRIMARY_AND_BACKUPS

See Also:
  Constant Field Values

#### OP_MAP_PARTITIONS_TO_NODES

    public static final int OP_MAP_PARTITIONS_TO_NODES

See Also:
  Constant Field Values

#### OP_PARTITION

    public static final int OP_PARTITION

See Also:
  Constant Field Values

#### OP_PRIMARY_PARTITIONS

    public static final int OP_PRIMARY_PARTITIONS

See Also:
  Constant Field Values

### Constructor Detail

#### PlatformAffinity

    public PlatformAffinity(PlatformContext platformCtx,
                    GridKernalContext igniteCtx,
                    @Nullable
                    String name)
                     throws IgniteCheckedException

Constructor.

Parameters:
  `platformCtx` - Context.
  `igniteCtx` - Ignite context.
  `name` - Cache name.
Throws:
  `IgniteCheckedException`

### Method Detail

#### processInStreamOutLong

    protected long processInStreamOutLong(int type,
                              BinaryRawReaderEx reader)
                                   throws IgniteCheckedException

Process IN operation.

Overrides:
  `processInStreamOutLong` in class `PlatformAbstractTarget`
Parameters:
  `type` - Type.
  `reader` - Binary reader.
Returns:
  Result.
Throws:
  `IgniteCheckedException` - In case of exception.

#### processInStreamOutStream

    protected void processInStreamOutStream(int type,
                                BinaryRawReaderEx reader,
                                BinaryRawWriterEx writer)
                                     throws IgniteCheckedException

Process IN-OUT operation.

Overrides:
  `processInStreamOutStream` in class `PlatformAbstractTarget`
Parameters:
  `type` - Type.
  `reader` - Binary reader.
  `writer` - Binary writer.
Throws:
  `IgniteCheckedException` - In case of exception.

#### partitions

    public int partitions()

Returns:
  Gets number of partitions in cache.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.6.0
Release Date | : May 18 2016