class SimpleMapReduce::DataStoreFactory

Constants

TYPES

Public Class Methods

create(data_store_type, options = {}) click to toggle source
# File lib/simple_map_reduce/data_store_factory.rb, line 8
def create(data_store_type, options = {})
  unless TYPES.include?(data_store_type)
    raise ArgumentError, "Unsupported data_store_type: `#{data_store_type}`"
  end

  case data_store_type
  when 'default'
    SimpleMapReduce::DataStores::DefaultDataStore.new(options)
  when 'remote'
    SimpleMapReduce::DataStores::RemoteDataStore.new(options)
  end
end