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

    java.lang.Object
      org.apache.mahout.clustering.spectral.VectorCache

    public final class VectorCache

extends 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.conf.Configuration conf)` Loads the vector from `DistributedCache`.
`static Vector` `load(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 IOException

  Parameters:
    `key` - SequenceFile key
    `vector` - Vector to save, to be wrapped as VectorWritable
  Throws:
    `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 IOException

  Calls the save() method, setting the cache to overwrite any previous Path and to delete the path after exiting

  Throws:
    `IOException`

### load

    public static Vector load(org.apache.hadoop.conf.Configuration conf)
                       throws IOException

  Loads the vector from `DistributedCache`. Returns null if no vector exists.

  Throws:
    `IOException`

### load

    public static Vector load(org.apache.hadoop.conf.Configuration conf,
                              org.apache.hadoop.fs.Path input)
                       throws IOException

  Loads a Vector from the specified path. Returns null if no vector exists.

  Throws:
    `IOException`

Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.