com.hazelcast.mapreduce.impl.task
Class JobProcessInformationImpl

java.lang.Object
  extended by com.hazelcast.mapreduce.impl.task.JobProcessInformationImpl
All Implemented Interfaces:
JobProcessInformation
Direct Known Subclasses:
MemberAssigningJobProcessInformationImpl

public class JobProcessInformationImpl
extends Object
implements JobProcessInformation

This class controls all partition states and is capable of atomically updating those states. It also collects information about the processed records.


Constructor Summary
JobProcessInformationImpl(int partitionCount, JobSupervisor supervisor)
           
 
Method Summary
 void addProcessedRecords(int records)
           
 void cancelPartitionState()
           
 JobPartitionState[] getPartitionStates()
          Returns an array of JobPartitionStates holding information about the processing state (JobPartitionState.State) and the processing owner of this partition.
The index of the JobPartitionState inside of the array is the number of the processed partition if the KeyValueSource is PartitionIdAware or a randomly assigned id for the different members of the cluster.
 int getProcessedRecords()
          Returns the number of processed records.
The number of processed records is not a real time value but updated on regular base (after 1000 processed elements per node).
 void resetPartitionState()
           
 String toString()
           
 boolean updatePartitionState(int partitionId, JobPartitionState oldPartitionState, JobPartitionState newPartitionState)
           
 boolean updatePartitionState(JobPartitionState[] oldPartitionStates, JobPartitionState[] newPartitionStates)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JobProcessInformationImpl

public JobProcessInformationImpl(int partitionCount,
                                 JobSupervisor supervisor)
Method Detail

getPartitionStates

public JobPartitionState[] getPartitionStates()
Description copied from interface: JobProcessInformation
Returns an array of JobPartitionStates holding information about the processing state (JobPartitionState.State) and the processing owner of this partition.
The index of the JobPartitionState inside of the array is the number of the processed partition if the KeyValueSource is PartitionIdAware or a randomly assigned id for the different members of the cluster.

Specified by:
getPartitionStates in interface JobProcessInformation
Returns:
partition state array with actual state information

getProcessedRecords

public int getProcessedRecords()
Description copied from interface: JobProcessInformation
Returns the number of processed records.
The number of processed records is not a real time value but updated on regular base (after 1000 processed elements per node).

Specified by:
getProcessedRecords in interface JobProcessInformation
Returns:
number of processed records

addProcessedRecords

public void addProcessedRecords(int records)

cancelPartitionState

public void cancelPartitionState()

resetPartitionState

public void resetPartitionState()

updatePartitionState

public boolean updatePartitionState(int partitionId,
                                    JobPartitionState oldPartitionState,
                                    JobPartitionState newPartitionState)

updatePartitionState

public boolean updatePartitionState(JobPartitionState[] oldPartitionStates,
                                    JobPartitionState[] newPartitionStates)

toString

public String toString()
Overrides:
toString in class Object


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