org.apache.hadoop.examples.dancing
Class DistributedPentomino
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.examples.dancing.DistributedPentomino
- All Implemented Interfaces:
- org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Tool
public class DistributedPentomino
- extends org.apache.hadoop.conf.Configured
- implements org.apache.hadoop.util.Tool
Launch a distributed pentomino solver.
It generates a complete list of prefixes of length N with each unique prefix
as a separate line. A prefix is a sequence of N integers that denote the
index of the row that is choosen for each column in order. Note that the
next column is heuristically choosen by the solver, so it is dependant on
the previous choice. That file is given as the input to
map/reduce. The output key/value are the move prefix/solution as Text/Text.
Nested Class Summary |
static class |
DistributedPentomino.PentMap
Each map takes a line, which represents a prefix move and finds all of
the solutions that start with that prefix. |
Method Summary |
static void |
main(String[] args)
Launch the solver on 9x10 board and the one sided pentominos. |
int |
run(String[] args)
|
Methods inherited from class org.apache.hadoop.conf.Configured |
getConf, setConf |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.hadoop.conf.Configurable |
getConf, setConf |
DistributedPentomino
public DistributedPentomino()
main
public static void main(String[] args)
throws Exception
- Launch the solver on 9x10 board and the one sided pentominos.
This takes about 2.5 hours on 20 nodes with 2 cpus/node.
Splits the job into 2000 maps and 1 reduce.
- Throws:
Exception
run
public int run(String[] args)
throws Exception
- Specified by:
run
in interface org.apache.hadoop.util.Tool
- Throws:
Exception
Copyright © 2009 The Apache Software Foundation