Class: SimpleMapReduce::Server::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_map_reduce/server/confg.rb

Constant Summary collapse

DEFAULT_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
}.freeze
DEFAULT_S3_INPUT_BUCKET_NAME =
'input'
DEFAULT_S3_INTERMEDIATE_BUCKET_NAME =
'intermediate'
DEFAULT_S3_OUTPUT_BUCKET_NAME =
'output'
DEFAULT_SERVER_PORT =
4567

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Config

Returns a new instance of Config.



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/simple_map_reduce/server/confg.rb', line 21

def initialize(options)
  setup_s3_config(options)

  @s3_input_bucket_name = options[:s3_input_bucket_name] || DEFAULT_S3_INPUT_BUCKET_NAME
  @s3_intermediate_bucket_name = options[:s3_intermediate_bucket_name] || DEFAULT_S3_INTERMEDIATE_BUCKET_NAME
  @s3_output_bucket_name = options[:s3_output_bucket_name] || DEFAULT_S3_OUTPUT_BUCKET_NAME

  @server_port = options[:server_port] || 4567
  @job_tracker_url = options[:job_tracker_url]
  @job_worker_url = options[:job_worker_url]
  @logger = options[:logger] || Logger.new($stdout)
end

Instance Attribute Details

#job_tracker_urlObject (readonly)

Returns the value of attribute job_tracker_url.



6
7
8
# File 'lib/simple_map_reduce/server/confg.rb', line 6

def job_tracker_url
  @job_tracker_url
end

#job_worker_urlObject (readonly)

Returns the value of attribute job_worker_url.



6
7
8
# File 'lib/simple_map_reduce/server/confg.rb', line 6

def job_worker_url
  @job_worker_url
end

#loggerObject (readonly)

Returns the value of attribute logger.



6
7
8
# File 'lib/simple_map_reduce/server/confg.rb', line 6

def logger
  @logger
end

#s3_configObject (readonly)

Returns the value of attribute s3_config.



6
7
8
# File 'lib/simple_map_reduce/server/confg.rb', line 6

def s3_config
  @s3_config
end

#s3_input_bucket_nameObject (readonly)

Returns the value of attribute s3_input_bucket_name.



6
7
8
# File 'lib/simple_map_reduce/server/confg.rb', line 6

def s3_input_bucket_name
  @s3_input_bucket_name
end

#s3_intermediate_bucket_nameObject (readonly)

Returns the value of attribute s3_intermediate_bucket_name.



6
7
8
# File 'lib/simple_map_reduce/server/confg.rb', line 6

def s3_intermediate_bucket_name
  @s3_intermediate_bucket_name
end

#s3_output_bucket_nameObject (readonly)

Returns the value of attribute s3_output_bucket_name.



6
7
8
# File 'lib/simple_map_reduce/server/confg.rb', line 6

def s3_output_bucket_name
  @s3_output_bucket_name
end

#server_portObject (readonly)

Returns the value of attribute server_port.



6
7
8
# File 'lib/simple_map_reduce/server/confg.rb', line 6

def server_port
  @server_port
end