require 'simple_map_reduce'
c = SimpleMapReduce::Driver::Config.new
job = SimpleMapReduce::Driver::Job.new(config: c)
job.map_task = map_task_object
job.reduce_task = map_task_object
job.input_s3_file_path = 's3://....'
job.job_tracker_url = 'http://hoge.tarou/'
job.start!
Last active
November 18, 2017 00:51
-
-
Save serihiro/7fbb47ada027afb4c2f0e2f4edabce5a to your computer and use it in GitHub Desktop.
Simple MapReduce Design
SimpleMapReduce.s3_config = {
access_key_id: 'MINIO_ACCESS_KEY',
secret_access_key: 'MINIO_SECRET_KEY',
endpoint: 'http://127.0.0.1:9000',
region: 'us-east-1',
force_path_style: true
}- Hadoop uses
Partitionerin order to decide which node should process a okey-value pair generated by map task - The default implement of
Partitioneris HashPartitioner - Of course, hash partioning may not result best optimized division. Because hash partitioning divides the list of hash into equal sized lists roughly by the key of hash, sometimes the amount of reduce input size is skewded among the datanodes.
- By using
module_eval, defining class inside the specified module.
module UserDefinitionClass
end
UserDefinitionClass.module_eval("
class WordCount
def map
end
def reduce
end
end
"
)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment