lib/contained_mr/job_logic.rb
# Reads in JSON options and sets defaults.
Reads in JSON options and sets defaults.
Reads in JSON options and sets defaults .
def parse_options(json_options)
    mapper = json_options['mapper'] || {}
    mapper_ulimits = mapper['ulimits'] || {}
    @mapper_options = {
      wait_time: mapper['wait_time'] || 60,
      vcpus: mapper['vcpus'] || 1,  
      ram: mapper['ram'] || 512,    
      swap: mapper['swap'] || 0,    
      logs: mapper['logs'] || 64,   
      ulimits: {
        cpu: mapper_ulimits['cpu'] || 60,  
      }
    }
    reducer = json_options['reducer'] || {}
    reducer_ulimits = reducer['ulimits'] || {}
    @reducer_options = {
      wait_time: reducer['wait_time'] || 60,
      vcpus: reducer['vcpus'] || 1,  
      ram: reducer['ram'] || 512,    
      swap: reducer['swap'] || 0,    
      logs: reducer['logs'] || 64,   
      ulimits: {
        cpu: reducer_ulimits['cpu'] || 60,
      }
    }
  end
def parse_options ( json_options ) mapper = json_options [ 'mapper' ] || { } mapper_ulimits = mapper [ 'ulimits' ] || { } @mapper_options = { wait_time : mapper [ 'wait_time' ] || 60 , vcpus : mapper [ 'vcpus' ] || 1 , ram : mapper [ 'ram' ] || 512 , swap : mapper [ 'swap' ] || 0 , logs : mapper [ 'logs' ] || 64 , ulimits : { cpu : mapper_ulimits [ 'cpu' ] || 60 , } } reducer = json_options [ 'reducer' ] || { } reducer_ulimits = reducer [ 'ulimits' ] || { } @reducer_options = { wait_time : reducer [ 'wait_time' ] || 60 , vcpus : reducer [ 'vcpus' ] || 1 , ram : reducer [ 'ram' ] || 512 , swap : reducer [ 'swap' ] || 0 , logs : reducer [ 'logs' ] || 64 , ulimits : { cpu : reducer_ulimits [ 'cpu' ] || 60 , } } end
Reads in JSON options and sets defaults.
Reads in JSON options and sets defaults .
# logical processors # megabytes # megabytes # megabytes # seconds # logical processors # megabytes # megabytes # megabytes
json_options
<not_specific>