org.apache.ignite.streamer.index

## Interface StreamerIndexProvider<E,K,V>

All Superinterfaces:
  StreamerIndexProviderMBean

All Known Implementing Classes:
  StreamerHashIndexProvider, StreamerIndexProviderAdapter, StreamerTreeIndexProvider

    public interface StreamerIndexProvider<E,K,V>
    extends StreamerIndexProviderMBean

Represents an actual instance of an index. Used by a `StreamerWindow` to perform event indexing.

To configure index for a streamer window, use `StreamerWindowAdapter.setIndexes(StreamerIndexProvider[])`.

### Method Summary

Methods
`void` `add(StreamerIndexUpdateSync sync, E evt)` Adds an event to index.
`void` `dispose()` Disposes the index.
`void` `endUpdate(StreamerIndexUpdateSync sync, E evt, boolean rollback, boolean rmv)` Finalizes an update operation.
`String` `getName()` Gets index name.
`StreamerIndexPolicy` `getPolicy()` Gets event indexing policy, which defines how events are tracked within an index.
`StreamerIndex<E,K,V>` `index()` Gets user view for this index.
`void` `initialize()` Initializes the index.
`boolean` `isUnique()` Checks whether this index is unique or not.
`void` `remove(StreamerIndexUpdateSync sync, E evt)` Removes an event from index.
`void` `reset()` Resets the index to an initial empty state.

### Methods inherited from interface org.apache.ignite.streamer.index.StreamerIndexProviderMBean

`name, policy, size, sorted, unique, updaterClass`

### Method Detail

#### getName

    String getName()

Gets index name.

Returns:
  Name of the index.

#### index

    StreamerIndex<E,K,V> index()

Gets user view for this index. This view is a snapshot of a current index state. Once returned, it does not change over time.

Returns:
  User view for this index.

#### initialize

    void initialize()

Initializes the index.

#### reset

    void reset()

Resets the index to an initial empty state.

#### dispose

    void dispose()

Disposes the index.

#### add

    void add(StreamerIndexUpdateSync sync,
           E evt)
             throws IgniteException

Adds an event to index.

Parameters:
  `sync` - Index update synchronizer.
  `evt` - Event to add to an index.
Throws:
  `IgniteException` - If failed to add event to an index.

#### remove

    void remove(StreamerIndexUpdateSync sync,
              E evt)
                throws IgniteException

Removes an event from index.

Parameters:
  `sync` - Index update synchronizer.
  `evt` - Event to remove from index.
Throws:
  `IgniteException` - If failed to add event to an index.

#### getPolicy

    StreamerIndexPolicy getPolicy()

Gets event indexing policy, which defines how events are tracked within an index.

Returns:
  index policy.

#### isUnique

    boolean isUnique()

Checks whether this index is unique or not. If it is, equal events are not allowed, which means that if a newly-added event is found to be equal to one of the already present events (`Object.equals(Object)` returns `true`), an exception is thrown.

Returns:
  `True` for unique index.

#### endUpdate

    void endUpdate(StreamerIndexUpdateSync sync,
                 E evt,
                 boolean rollback,
                 boolean rmv)

Finalizes an update operation.

Parameters:
  `sync` - Index update synchronizer.
  `evt` - Updated event.
  `rollback` - Rollback flag. If `true`, a rollback was made.
  `rmv` - Remove flag. If `true`, the event was removed from index.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015