com.hazelcast.mapreduce

## Interface LifecycleMapper<KeyIn,ValueIn,KeyOut,ValueOut>

- Type Parameters:
    `KeyIn` - type of key used in the `KeyValueSource`
    `ValueIn` - type of value used in the `KeyValueSource`
    `KeyOut` - key type for mapped results
    `ValueOut` - value type for mapped results
  All Superinterfaces:
    Mapper<KeyIn,ValueIn,KeyOut,ValueOut>, Serializable
  All Known Implementing Classes:
    LifecycleMapperAdapter

  Deprecated.
  MapReduce is deprecated and will be removed in 4.0. For map aggregations, you can use `Aggregator` on IMap. For general data processing, it is superseded by Hazelcast Jet.

      @Deprecated
      public interface LifecycleMapper<KeyIn,ValueIn,KeyOut,ValueOut>
      extends Mapper<KeyIn,ValueIn,KeyOut,ValueOut>

  The LifecycleMapper interface is a more sophisticated version of `Mapper` normally used for more complex algorithms with a need for initialization and finalization.

  The behavior is the same as for `Mapper`, but `initialize(Context)` is called before calling `Mapper.map(Object, Object, Context)` for the first time to prepare the mapper instance and maybe already emit some values. After all mapping calls are finished, `finalized(Context)` is called and here is another possibility to emit additional key-value pairs.

  Since:
    3.2

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `finalized(Context<KeyOut,ValueOut> context)` Deprecated. This method is called after the `Mapper.map(Object, Object, Context)` method is executed for every value and can be used to finalize the internal state of the mapper or to emit a special value.
    `void` | `initialize(Context<KeyOut,ValueOut> context)` Deprecated. This method is called before the `Mapper.map(Object, Object, Context)` method is executed for every value and can be used to initialize the internal state of the mapper or to emit a special value.

    - ### Methods inherited from interface com.hazelcast.mapreduce.Mapper

      `map`

- - ### Method Detail

    - #### initialize

          void initialize(Context<KeyOut,ValueOut> context)

      Deprecated.
      This method is called before the `Mapper.map(Object, Object, Context)` method is executed for every value and can be used to initialize the internal state of the mapper or to emit a special value.
      Parameters:
        `context` - Context to be used for emitting values

    - #### finalized

          void finalized(Context<KeyOut,ValueOut> context)

      Deprecated.
      This method is called after the `Mapper.map(Object, Object, Context)` method is executed for every value and can be used to finalize the internal state of the mapper or to emit a special value.
      Parameters:
        `context` - Context to be used for emitting values

Copyright © 2018. All rights reserved.