Module: PartitionGardener::Strategy

Defined in:
lib/partition_gardener/strategy.rb,
lib/partition_gardener/strategy/date_range.rb,
lib/partition_gardener/strategy/list_split.rb,
lib/partition_gardener/strategy/hash_branches.rb,
lib/partition_gardener/strategy/integer_range.rb,
lib/partition_gardener/strategy/cursor_columns.rb,
lib/partition_gardener/strategy/requires_default_partition.rb

Defined Under Namespace

Modules: CursorColumns, RequiresDefaultPartition Classes: DateRange, HashBranches, IntegerRange, ListSplit

Class Method Summary collapse

Class Method Details

.build(config) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/partition_gardener/strategy.rb', line 8

def build(config)
  case config.fetch(:layout, :sliding_window)
  when :integer_window
    IntegerRange.new(config)
  when :hash_branches
    HashBranches.new(config)
  when :list_split
    ListSplit.new(config)
  when :calendar_year
    DateRange.new(config.merge(bucket: :year))
  when :premake_monthly, :rolling_current
    DateRange.new(config)
  else
    DateRange.new(config)
  end
end

.for(config) ⇒ Object



4
5
6
# File 'lib/partition_gardener/strategy.rb', line 4

def for(config)
  build(config)
end