org.apache.mahout.clustering.spectral.common
Class VectorCache

java.lang.Object
  extended by org.apache.mahout.clustering.spectral.common.VectorCache

public final class VectorCache
extends java.lang.Object

This class handles reading and writing vectors to the Hadoop distributed cache. Created as a result of Eigencuts' liberal use of such functionality, but available to any algorithm requiring it.


Method Summary
static Vector load(org.apache.hadoop.io.Writable key, org.apache.hadoop.conf.Configuration conf)
          Loads the vector with the specified key from the cache.
static Vector load(org.apache.hadoop.io.Writable key, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path input)
          Loads a Vector from the specified path
static void save(org.apache.hadoop.io.Writable key, Vector vector, org.apache.hadoop.fs.Path output, org.apache.hadoop.conf.Configuration conf)
          Calls the save() method, setting the cache to overwrite any previous Path and to delete the path after exiting
static void save(org.apache.hadoop.io.Writable key, Vector vector, org.apache.hadoop.fs.Path output, org.apache.hadoop.conf.Configuration conf, boolean overwritePath, boolean deleteOnExit)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

save

public static void save(org.apache.hadoop.io.Writable key,
                        Vector vector,
                        org.apache.hadoop.fs.Path output,
                        org.apache.hadoop.conf.Configuration conf,
                        boolean overwritePath,
                        boolean deleteOnExit)
                 throws java.io.IOException
Parameters:
key - SequenceFile key
vector - Vector to save, to be wrapped as VectorWritable
Throws:
java.io.IOException

save

public static void save(org.apache.hadoop.io.Writable key,
                        Vector vector,
                        org.apache.hadoop.fs.Path output,
                        org.apache.hadoop.conf.Configuration conf)
                 throws java.io.IOException
Calls the save() method, setting the cache to overwrite any previous Path and to delete the path after exiting

Throws:
java.io.IOException

load

public static Vector load(org.apache.hadoop.io.Writable key,
                          org.apache.hadoop.conf.Configuration conf)
                   throws java.io.IOException
Loads the vector with the specified key from the cache. Returns null if nothing is found (up to the caller to handle this accordingly)

Throws:
java.io.IOException

load

public static Vector load(org.apache.hadoop.io.Writable key,
                          org.apache.hadoop.conf.Configuration conf,
                          org.apache.hadoop.fs.Path input)
                   throws java.io.IOException
Loads a Vector from the specified path

Throws:
java.io.IOException


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