org.apache.mahout.df
Class DFUtils

java.lang.Object
  extended by org.apache.mahout.df.DFUtils

public class DFUtils
extends java.lang.Object

Utility class that contains various helper methods


Method Summary
static java.lang.String elapsedTime(long milli)
          Formats a time interval in milliseconds to a String in the form "hours:minutes:seconds:millis"
static org.apache.hadoop.fs.Path[] listOutputFiles(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path outputPath)
          Return a list of all files in the output directory
static double[] readDoubleArray(java.io.DataInput in)
          Reads a double[] from a DataInput
static int[] readIntArray(java.io.DataInput in)
          Reads an int[] from a DataInput
static Node[] readNodeArray(java.io.DataInput in)
          Reads a Node[] from a DataInput
static void writeArray(java.io.DataOutput out, double[] array)
          Writes a double[] into a DataOutput
static void writeArray(java.io.DataOutput out, int[] array)
          Writes an int[] into a DataOutput
static void writeArray(java.io.DataOutput out, Node[] array)
          Writes an Node[] into a DataOutput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

writeArray

public static void writeArray(java.io.DataOutput out,
                              Node[] array)
                       throws java.io.IOException
Writes an Node[] into a DataOutput

Parameters:
out -
array -
Throws:
java.io.IOException

readNodeArray

public static Node[] readNodeArray(java.io.DataInput in)
                            throws java.io.IOException
Reads a Node[] from a DataInput

Parameters:
in -
Returns:
Throws:
java.io.IOException

writeArray

public static void writeArray(java.io.DataOutput out,
                              double[] array)
                       throws java.io.IOException
Writes a double[] into a DataOutput

Parameters:
out -
array -
Throws:
java.io.IOException

readDoubleArray

public static double[] readDoubleArray(java.io.DataInput in)
                                throws java.io.IOException
Reads a double[] from a DataInput

Parameters:
in -
Returns:
Throws:
java.io.IOException

writeArray

public static void writeArray(java.io.DataOutput out,
                              int[] array)
                       throws java.io.IOException
Writes an int[] into a DataOutput

Parameters:
out -
array -
Throws:
java.io.IOException

readIntArray

public static int[] readIntArray(java.io.DataInput in)
                          throws java.io.IOException
Reads an int[] from a DataInput

Parameters:
in -
Returns:
Throws:
java.io.IOException

listOutputFiles

public static org.apache.hadoop.fs.Path[] listOutputFiles(org.apache.hadoop.fs.FileSystem fs,
                                                          org.apache.hadoop.fs.Path outputPath)
                                                   throws java.io.IOException
Return a list of all files in the output directory

Parameters:
fs -
outputPath -
Returns:
Throws:
java.io.IOException
java.lang.RuntimeException - if no file is found

elapsedTime

public static java.lang.String elapsedTime(long milli)
Formats a time interval in milliseconds to a String in the form "hours:minutes:seconds:millis"

Parameters:
milli -
Returns:


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