org.apache.mahout.df.mapreduce.partial
Class InterResults

java.lang.Object
  extended by org.apache.mahout.df.mapreduce.partial.InterResults

public final class InterResults
extends java.lang.Object

Stores/Loads the intermediate results of step1 needed by step2.
This class should not be needed outside of the partial package, so all its methods are protected.


Method Summary
static int load(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path forestPath, int numMaps, int numTrees, int partition, TreeID[] keys, Node[] trees)
          Load the trees and the keys returned from the first step
static void store(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path forestPath, TreeID[] keys, Node[] trees, int[] sizes)
          Write the forest trees into a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

load

public static int load(org.apache.hadoop.fs.FileSystem fs,
                       org.apache.hadoop.fs.Path forestPath,
                       int numMaps,
                       int numTrees,
                       int partition,
                       TreeID[] keys,
                       Node[] trees)
                throws java.io.IOException
Load the trees and the keys returned from the first step

Parameters:
fs - forest path file system
forestPath - file path to the (key,tree) file
numMaps - number of map tasks
numTrees - total number of trees in the forest
partition - current partition
keys - array of size numTrees, will contain the loaded keys
trees - array of size numTrees, will contain the loaded trees
Returns:
number of instances in the current partition
Throws:
java.io.IOException

store

public static void store(org.apache.hadoop.fs.FileSystem fs,
                         org.apache.hadoop.fs.Path forestPath,
                         TreeID[] keys,
                         Node[] trees,
                         int[] sizes)
                  throws java.io.IOException
Write the forest trees into a file

Parameters:
fs - File System
keys - keys returned by the first step
trees - trees returned by the first step
sizes - partitions' sizes in hadoop order
Throws:
java.io.IOException


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.