Class SampleDataForSplitPoints
- java.lang.Object
-
- uk.gov.gchq.gaffer.hdfs.operation.SampleDataForSplitPoints
-
- All Implemented Interfaces:
Closeable,AutoCloseable,MapReduce,Operation
public class SampleDataForSplitPoints extends Object implements Operation, MapReduce
TheSampleDataForSplitPointsoperation is for creating a splits file, either for use in aSplitStoreFromFileoperation or anAddElementsFromHdfsoperation. This operation requires an input and output path as well as a path to a file to use as the resultingSplitsFile. For each input file you must also provide aMapperGeneratorclass name as part of a pair (input, mapperGeneratorClassName). In order to be generic and deal with any type of input file you also need to provide aJobInitialiser.JobInitialiser. NOTE - currently this job has to be run as a hadoop job.- See Also:
SampleDataForSplitPoints.Builder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSampleDataForSplitPoints.Builder-
Nested classes/interfaces inherited from interface uk.gov.gchq.gaffer.operation.Operation
Operation.BaseBuilder<OP extends Operation,B extends Operation.BaseBuilder<OP,?>>
-
-
Constructor Summary
Constructors Constructor Description SampleDataForSplitPoints()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]getCommandLineArgs()Class<? extends org.apache.hadoop.io.compress.CompressionCodec>getCompressionCodec()Map<String,String>getInputMapperPairs()JobInitialisergetJobInitialiser()A job initialiser allows additional job initialisation to be carried out in addition to that done by the store.IntegergetMaxMapTasks()IntegergetMaxReduceTasks()IntegergetMinMapTasks()IntegergetMinReduceTasks()IntegergetNumMapTasks()IntegergetNumSplits()Map<String,String>getOptions()StringgetOutputPath()Class<? extends org.apache.hadoop.mapreduce.Partitioner>getPartitioner()floatgetProportionToSample()StringgetSplitsFilePath()booleanisUseProvidedSplits()booleanisValidate()voidsetCommandLineArgs(String[] commandLineArgs)voidsetCompressionCodec(Class<? extends org.apache.hadoop.io.compress.CompressionCodec> compressionCodec)voidsetInputMapperPairs(Map<String,String> inputMapperPairs)voidsetJobInitialiser(JobInitialiser jobInitialiser)voidsetMaxMapTasks(Integer maxMapTasks)voidsetMaxReduceTasks(Integer maxReduceTasks)voidsetMinMapTasks(Integer minMapTasks)voidsetMinReduceTasks(Integer minReduceTasks)voidsetNumMapTasks(Integer numMapTasks)voidsetNumSplits(Integer numSplits)voidsetOptions(Map<String,String> options)voidsetOutputPath(String outputPath)voidsetPartitioner(Class<? extends org.apache.hadoop.mapreduce.Partitioner> partitioner)voidsetProportionToSample(float proportionToSample)voidsetSplitsFilePath(String splitsFilePath)voidsetUseProvidedSplits(boolean useProvidedSplits)voidsetValidate(boolean validate)SampleDataForSplitPointsshallowClone()Operation implementations should ensure a ShallowClone method is implemented.uk.gov.gchq.koryphe.ValidationResultvalidate()Validates an operation.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface uk.gov.gchq.gaffer.hdfs.operation.MapReduce
addInputMapperPair, addInputMapperPairs
-
Methods inherited from interface uk.gov.gchq.gaffer.operation.Operation
_getNullOrOptions, addOption, close, containsOption, getOption, getOption, validateRequiredFieldPresent
-
-
-
-
Method Detail
-
validate
public uk.gov.gchq.koryphe.ValidationResult validate()
Description copied from interface:OperationValidates an operation. This should be used to validate that fields have been be configured correctly. By default no validation is applied. Override this method to implement validation.
-
isValidate
public boolean isValidate()
-
setValidate
public void setValidate(boolean validate)
-
getSplitsFilePath
public String getSplitsFilePath()
- Specified by:
getSplitsFilePathin interfaceMapReduce
-
setSplitsFilePath
public void setSplitsFilePath(String splitsFilePath)
- Specified by:
setSplitsFilePathin interfaceMapReduce
-
getNumSplits
public Integer getNumSplits()
-
setNumSplits
public void setNumSplits(Integer numSplits)
-
getProportionToSample
public float getProportionToSample()
-
setProportionToSample
public void setProportionToSample(float proportionToSample)
-
getInputMapperPairs
public Map<String,String> getInputMapperPairs()
- Specified by:
getInputMapperPairsin interfaceMapReduce
-
setInputMapperPairs
public void setInputMapperPairs(Map<String,String> inputMapperPairs)
- Specified by:
setInputMapperPairsin interfaceMapReduce
-
getOutputPath
public String getOutputPath()
- Specified by:
getOutputPathin interfaceMapReduce
-
setOutputPath
public void setOutputPath(String outputPath)
- Specified by:
setOutputPathin interfaceMapReduce
-
getJobInitialiser
public JobInitialiser getJobInitialiser()
Description copied from interface:MapReduceA job initialiser allows additional job initialisation to be carried out in addition to that done by the store. Most stores will probably require the Job Input to be configured in this initialiser as this is specific to the type of data store in Hdfs. For Avro data seeAvroJobInitialiser. For Text data seeTextJobInitialiser.- Specified by:
getJobInitialiserin interfaceMapReduce- Returns:
- the job initialiser
-
setJobInitialiser
public void setJobInitialiser(JobInitialiser jobInitialiser)
- Specified by:
setJobInitialiserin interfaceMapReduce
-
getNumMapTasks
public Integer getNumMapTasks()
- Specified by:
getNumMapTasksin interfaceMapReduce
-
setNumMapTasks
public void setNumMapTasks(Integer numMapTasks)
- Specified by:
setNumMapTasksin interfaceMapReduce
-
getMinMapTasks
public Integer getMinMapTasks()
- Specified by:
getMinMapTasksin interfaceMapReduce
-
setMinMapTasks
public void setMinMapTasks(Integer minMapTasks)
- Specified by:
setMinMapTasksin interfaceMapReduce
-
getMaxMapTasks
public Integer getMaxMapTasks()
- Specified by:
getMaxMapTasksin interfaceMapReduce
-
setMaxMapTasks
public void setMaxMapTasks(Integer maxMapTasks)
- Specified by:
setMaxMapTasksin interfaceMapReduce
-
getMinReduceTasks
public Integer getMinReduceTasks()
- Specified by:
getMinReduceTasksin interfaceMapReduce
-
setMinReduceTasks
public void setMinReduceTasks(Integer minReduceTasks)
- Specified by:
setMinReduceTasksin interfaceMapReduce
-
getMaxReduceTasks
public Integer getMaxReduceTasks()
- Specified by:
getMaxReduceTasksin interfaceMapReduce
-
setMaxReduceTasks
public void setMaxReduceTasks(Integer maxReduceTasks)
- Specified by:
setMaxReduceTasksin interfaceMapReduce
-
isUseProvidedSplits
public boolean isUseProvidedSplits()
- Specified by:
isUseProvidedSplitsin interfaceMapReduce
-
setUseProvidedSplits
public void setUseProvidedSplits(boolean useProvidedSplits)
- Specified by:
setUseProvidedSplitsin interfaceMapReduce
-
getPartitioner
public Class<? extends org.apache.hadoop.mapreduce.Partitioner> getPartitioner()
- Specified by:
getPartitionerin interfaceMapReduce
-
setPartitioner
public void setPartitioner(Class<? extends org.apache.hadoop.mapreduce.Partitioner> partitioner)
- Specified by:
setPartitionerin interfaceMapReduce
-
getCommandLineArgs
public String[] getCommandLineArgs()
- Specified by:
getCommandLineArgsin interfaceMapReduce
-
setCommandLineArgs
public void setCommandLineArgs(String[] commandLineArgs)
- Specified by:
setCommandLineArgsin interfaceMapReduce
-
getCompressionCodec
public Class<? extends org.apache.hadoop.io.compress.CompressionCodec> getCompressionCodec()
-
setCompressionCodec
public void setCompressionCodec(Class<? extends org.apache.hadoop.io.compress.CompressionCodec> compressionCodec)
-
getOptions
public Map<String,String> getOptions()
- Specified by:
getOptionsin interfaceOperation- Returns:
- the operation options. This may contain store specific options such as authorisation strings or and other properties required for the operation to be executed. Note these options will probably not be interpreted in the same way by every store implementation.
-
setOptions
public void setOptions(Map<String,String> options)
- Specified by:
setOptionsin interfaceOperation- Parameters:
options- the operation options. This may contain store specific options such as authorisation strings or and other properties required for the operation to be executed. Note these options will probably not be interpreted in the same way by every store implementation.
-
shallowClone
public SampleDataForSplitPoints shallowClone()
Description copied from interface:OperationOperation implementations should ensure a ShallowClone method is implemented. Performs a shallow clone. Creates a new instance and copies the fields across. It does not clone the fields. If the operation contains nested operations, these must also be cloned.- Specified by:
shallowClonein interfaceOperation- Returns:
- shallow clone
-
-