org.apache.mahout.common
Class DevURandomSeedGenerator
java.lang.Object
org.apache.mahout.common.DevURandomSeedGenerator
- All Implemented Interfaces:
- org.uncommons.maths.random.SeedGenerator
public final class DevURandomSeedGenerator
- extends java.lang.Object
- implements org.uncommons.maths.random.SeedGenerator
RNG seed strategy that gets data from /dev/urandom on systems that provide it (e.g.
Solaris/Linux). If /dev/random does not exist or is not accessible, a SeedException
is thrown. The point of pulling from /dev/urandom instead of from /dev/random
is that /dev/random will block if it doesn't think it has enough entropy. In most production
applications of Mahout, that really isn't necessary.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DevURandomSeedGenerator
public DevURandomSeedGenerator()
generateSeed
public byte[] generateSeed(int length)
throws org.uncommons.maths.random.SeedException
- Specified by:
generateSeed
in interface org.uncommons.maths.random.SeedGenerator
- Returns:
- The requested number of random bytes, read directly from /dev/urandom.
- Throws:
org.uncommons.maths.random.SeedException
- If /dev/urandom does not exist or is not accessible
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.