com.hazelcast.mapreduce
Enum TopologyChangedStrategy

java.lang.Object
  extended by java.lang.Enum<TopologyChangedStrategy>
      extended by com.hazelcast.mapreduce.TopologyChangedStrategy
All Implemented Interfaces:
Serializable, Comparable<TopologyChangedStrategy>

@Beta
public enum TopologyChangedStrategy
extends Enum<TopologyChangedStrategy>

This enum class is used to define how a map reduce job behaves if the job owner recognizes a topology changed event.
When members are leaving the cluster it might happen to loose processed data chunks that were already send to the reducers on the leaving node.
In addition to that on any topology change there is a redistribution of the member assigned partitions which means that a map job might have a problem to finish it's currently processed partition.
The default behavior is immediately cancelling the running task and throwing an TopologyChangedException but it is possible to submit the same job configuration again if JobTracker.getTrackableJob(String) returns null for the requested job id.

Since:
3.2

Enum Constant Summary
CANCEL_RUNNING_OPERATION
          Default behavior, the currently running job is cancelled immediately on recognizing the topology changed.
DISCARD_AND_RESTART
          Attention: This strategy is currently not available but reserved for later usage!
Some or all processed data and intermediate results are discarded and the job is automatically restarted.
Depending on the implementation the job might start from an earlier reached safepoint and is not restarted at the beginning.
MIGRATE_AND_CONTINUE
          Attention: This strategy is currently not available but reserved for later usage!
Currently running processes define a safepoint, migrate gracefully and continue their work on new partition owners.
If a member lefts the cluster intermediately reduced data are lost!
 
Method Summary
static TopologyChangedStrategy valueOf(String name)
          Returns the enum constant of this type with the specified name.
static TopologyChangedStrategy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CANCEL_RUNNING_OPERATION

public static final TopologyChangedStrategy CANCEL_RUNNING_OPERATION
Default behavior, the currently running job is cancelled immediately on recognizing the topology changed. An TopologyChangedException is thrown on the job owning node.


DISCARD_AND_RESTART

public static final TopologyChangedStrategy DISCARD_AND_RESTART
Attention: This strategy is currently not available but reserved for later usage!
Some or all processed data and intermediate results are discarded and the job is automatically restarted.
Depending on the implementation the job might start from an earlier reached safepoint and is not restarted at the beginning.


MIGRATE_AND_CONTINUE

public static final TopologyChangedStrategy MIGRATE_AND_CONTINUE
Attention: This strategy is currently not available but reserved for later usage!
Currently running processes define a safepoint, migrate gracefully and continue their work on new partition owners.
If a member lefts the cluster intermediately reduced data are lost!

Method Detail

values

public static TopologyChangedStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (TopologyChangedStrategy c : TopologyChangedStrategy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static TopologyChangedStrategy valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.