Package org.apache.spark.ml.image
Class SamplePathFilter
Object
org.apache.hadoop.conf.Configured
org.apache.spark.ml.image.SamplePathFilter
- All Implemented Interfaces:
 org.apache.hadoop.conf.Configurable,org.apache.hadoop.fs.PathFilter
public class SamplePathFilter
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.fs.PathFilter
Filter that allows loading a fraction of HDFS files.
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(org.apache.hadoop.fs.Path path) static booleanisFile(org.apache.hadoop.fs.Path path) scala.util.Randomrandom()static Stringdoublestatic StringvoidsetConf(org.apache.hadoop.conf.Configuration conf) static <T> TwithPathFilter(double sampleRatio, SparkSession spark, long seed, scala.Function0<T> f) Sets the HDFS PathFilter flag and then restores it.Methods inherited from class org.apache.hadoop.conf.Configured
getConf 
- 
Constructor Details
- 
SamplePathFilter
public SamplePathFilter() 
 - 
 - 
Method Details
- 
ratioParam
 - 
seedParam
 - 
isFile
public static boolean isFile(org.apache.hadoop.fs.Path path)  - 
withPathFilter
public static <T> T withPathFilter(double sampleRatio, SparkSession spark, long seed, scala.Function0<T> f) Sets the HDFS PathFilter flag and then restores it. Only applies the filter if sampleRatio is less than 1.- Parameters:
 sampleRatio- Fraction of the files that the filter picksspark- Existing Spark sessionseed- Random number seedf- The function to evaluate after setting the flag- Returns:
 - Returns the evaluation result T of the function
 
 - 
random
public scala.util.Random random() - 
sampleRatio
public double sampleRatio() - 
setConf
public void setConf(org.apache.hadoop.conf.Configuration conf) - Specified by:
 setConfin interfaceorg.apache.hadoop.conf.Configurable- Overrides:
 setConfin classorg.apache.hadoop.conf.Configured
 - 
accept
public boolean accept(org.apache.hadoop.fs.Path path) - Specified by:
 acceptin interfaceorg.apache.hadoop.fs.PathFilter
 
 -