public class IgniteHadoopWeightedMapReducePlanner extends HadoopAbstractMapReducePlanner
Plan creation consists of two steps: assigning mappers and assigning reducers.
Mappers are assigned based on input split data location. For each input split we search for nodes where its data is stored. Planner tries to assign mappers to their affinity nodes first. This process is governed by two properties:
localMapperWeight
- weight of a map task when it is executed on an affinity node;remoteMapperWeight
- weight of a map task when it is executed on a non-affinity node.
Reducers are assigned differently. First we try to distribute reducers across nodes with mappers. This approach
could minimize expensive data transfer over network. Reducer assigned to a node with mapper is considered
local
. Otherwise it is considered remote
. This process continue until certain weight
threshold is reached what means that current node is already too busy and it should not have higher priority over
other nodes any more. Threshold can be configured using preferLocalReducerThresholdWeight
property.
When local reducer threshold is reached on all nodes, we distribute remaining reducers based on their local and remote weights in the same way as it is done for mappers. This process is governed by two properties:
localReducerWeight
- weight of a reduce task when it is executed on a node with mappers;remoteReducerWeight
- weight of a map task when it is executed on a node without mappers.Modifier and Type | Field and Description |
---|---|
static int |
DFLT_LOC_MAPPER_WEIGHT
Default local mapper weight.
|
static int |
DFLT_LOC_REDUCER_WEIGHT
Default local reducer weight.
|
static int |
DFLT_PREFER_LOCAL_REDUCER_THRESHOLD_WEIGHT
Default reducer migration threshold weight.
|
static int |
DFLT_RMT_MAPPER_WEIGHT
Default remote mapper weight.
|
static int |
DFLT_RMT_REDUCER_WEIGHT
Default remote reducer weight.
|
ignite, log
Constructor and Description |
---|
IgniteHadoopWeightedMapReducePlanner() |
Modifier and Type | Method and Description |
---|---|
int |
getLocalMapperWeight()
Get local mapper weight.
|
int |
getLocalReducerWeight()
Get local reducer weight.
|
int |
getPreferLocalReducerThresholdWeight()
Get reducer migration threshold weight.
|
int |
getRemoteMapperWeight()
Get remote mapper weight.
|
int |
getRemoteReducerWeight()
Get remote reducer weight.
|
HadoopMapReducePlan |
preparePlan(HadoopJob job,
Collection<ClusterNode> nodes,
@Nullable HadoopMapReducePlan oldPlan)
Prepares map-reduce execution plan for the given job and topology.
|
IgniteHadoopWeightedMapReducePlanner |
setLocalMapperWeight(int locMapperWeight)
Set local mapper weight.
|
IgniteHadoopWeightedMapReducePlanner |
setLocalReducerWeight(int locReducerWeight)
Set local reducer weight.
|
IgniteHadoopWeightedMapReducePlanner |
setPreferLocalReducerThresholdWeight(int reducerMigrationThresholdWeight)
Set reducer migration threshold weight.
|
IgniteHadoopWeightedMapReducePlanner |
setRemoteMapperWeight(int rmtMapperWeight)
Set remote mapper weight.
|
IgniteHadoopWeightedMapReducePlanner |
setRemoteReducerWeight(int rmtReducerWeight)
Set remote reducer weight.
|
String |
toString() |
groupByHost, topology
public static final int DFLT_LOC_MAPPER_WEIGHT
public static final int DFLT_RMT_MAPPER_WEIGHT
public static final int DFLT_LOC_REDUCER_WEIGHT
public static final int DFLT_RMT_REDUCER_WEIGHT
public static final int DFLT_PREFER_LOCAL_REDUCER_THRESHOLD_WEIGHT
public IgniteHadoopWeightedMapReducePlanner()
public HadoopMapReducePlan preparePlan(HadoopJob job, Collection<ClusterNode> nodes, @Nullable @Nullable HadoopMapReducePlan oldPlan) throws IgniteCheckedException
job
- Job.nodes
- Topology.oldPlan
- Old plan in case of partial failure.IgniteCheckedException
- If an error occurs.public int getLocalMapperWeight()
Defaults to DFLT_LOC_MAPPER_WEIGHT
.
public IgniteHadoopWeightedMapReducePlanner setLocalMapperWeight(int locMapperWeight)
getLocalMapperWeight()
for more information.locMapperWeight
- Local mapper weight.this
for chaining.public int getRemoteMapperWeight()
Defaults to DFLT_RMT_MAPPER_WEIGHT
.
public IgniteHadoopWeightedMapReducePlanner setRemoteMapperWeight(int rmtMapperWeight)
getRemoteMapperWeight()
for more information.rmtMapperWeight
- Remote mapper weight.this
for chaining.public int getLocalReducerWeight()
Defaults to DFLT_LOC_REDUCER_WEIGHT
.
public IgniteHadoopWeightedMapReducePlanner setLocalReducerWeight(int locReducerWeight)
getLocalReducerWeight()
for more information.locReducerWeight
- Local reducer weight.this
for chaining.public int getRemoteReducerWeight()
Defaults to DFLT_RMT_REDUCER_WEIGHT
.
public IgniteHadoopWeightedMapReducePlanner setRemoteReducerWeight(int rmtReducerWeight)
getRemoteReducerWeight()
for more information.rmtReducerWeight
- Remote reducer weight.this
for chaining.public int getPreferLocalReducerThresholdWeight()
Defaults to DFLT_PREFER_LOCAL_REDUCER_THRESHOLD_WEIGHT
.
public IgniteHadoopWeightedMapReducePlanner setPreferLocalReducerThresholdWeight(int reducerMigrationThresholdWeight)
getPreferLocalReducerThresholdWeight()
for more
information.reducerMigrationThresholdWeight
- Reducer migration threshold weight.this
for chaining.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019