org.apache.hadoop.examples.dancing
Class DistributedPentomino.PentMap

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.WritableComparable<?>,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
      extended by org.apache.hadoop.examples.dancing.DistributedPentomino.PentMap
Enclosing class:
DistributedPentomino

public static class DistributedPentomino.PentMap
extends org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.WritableComparable<?>,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>

Each map takes a line, which represents a prefix move and finds all of the solutions that start with that prefix. The output is the prefix as the key and the solution as the value.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper
org.apache.hadoop.mapreduce.Mapper.Context
 
Constructor Summary
DistributedPentomino.PentMap()
           
 
Method Summary
 void map(org.apache.hadoop.io.WritableComparable<?> key, org.apache.hadoop.io.Text value, org.apache.hadoop.mapreduce.Mapper.Context context)
          Break the prefix string into moves (a sequence of integer row ids that will be selected for each column in order).
 void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
           
 
Methods inherited from class org.apache.hadoop.mapreduce.Mapper
cleanup, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistributedPentomino.PentMap

public DistributedPentomino.PentMap()
Method Detail

map

public void map(org.apache.hadoop.io.WritableComparable<?> key,
                org.apache.hadoop.io.Text value,
                org.apache.hadoop.mapreduce.Mapper.Context context)
         throws IOException
Break the prefix string into moves (a sequence of integer row ids that will be selected for each column in order). Find all solutions with that prefix.

Overrides:
map in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.WritableComparable<?>,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
Throws:
IOException

setup

public void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
Overrides:
setup in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.WritableComparable<?>,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>


Copyright © 2013 Apache Software Foundation. All Rights Reserved.