Example usage for org.apache.hadoop.mapreduce.server.tasktracker TTConfig TT_MAP_SLOTS

List of usage examples for org.apache.hadoop.mapreduce.server.tasktracker TTConfig TT_MAP_SLOTS

Introduction

In this page you can find the example usage for org.apache.hadoop.mapreduce.server.tasktracker TTConfig TT_MAP_SLOTS.

Prototype

String TT_MAP_SLOTS

To view the source code for org.apache.hadoop.mapreduce.server.tasktracker TTConfig TT_MAP_SLOTS.

Click Source Link

Usage

From source file:bsc.spark.examples.terasort.ehiggs.TeraScheduler.java

License:Apache License

public TeraScheduler(FileSplit[] realSplits, Configuration conf) throws IOException {
    this.realSplits = realSplits;
    this.slotsPerHost = conf.getInt(TTConfig.TT_MAP_SLOTS, 4);
    Map<String, Host> hostTable = new HashMap<String, Host>();
    splits = new Split[realSplits.length];
    for (FileSplit realSplit : realSplits) {
        Split split = new Split(realSplit.getPath().toString());
        splits[remainingSplits++] = split;
        for (String hostname : realSplit.getLocations()) {
            Host host = hostTable.get(hostname);
            if (host == null) {
                host = new Host(hostname);
                hostTable.put(hostname, host);
                hosts.add(host);/*from   w w w  .  j  av a 2 s  .  c  o m*/
            }
            host.splits.add(split);
            split.locations.add(host);
        }
    }
}

From source file:info.halo9pan.word2vec.hadoop.mr.SortSpliter.java

License:Apache License

public SortSpliter(FileSplit[] realSplits, Configuration conf) throws IOException {
    this.realSplits = realSplits;
    this.slotsPerHost = conf.getInt(TTConfig.TT_MAP_SLOTS, 4);
    Map<String, Host> hostTable = new HashMap<String, Host>();
    splits = new Split[realSplits.length];
    for (FileSplit realSplit : realSplits) {
        Split split = new Split(realSplit.getPath().toString());
        splits[remainingSplits++] = split;
        for (String hostname : realSplit.getLocations()) {
            Host host = hostTable.get(hostname);
            if (host == null) {
                host = new Host(hostname);
                hostTable.put(hostname, host);
                hosts.add(host);/* w w w .ja  v  a  2s  . com*/
            }
            host.splits.add(split);
            split.locations.add(host);
        }
    }
}