Class: PartitionGardener::Plan::Segment

Inherits:
Data
  • Object
show all
Defined in:
lib/partition_gardener/plan.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



3
4
5
# File 'lib/partition_gardener/plan.rb', line 3

def kind
  @kind
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



3
4
5
# File 'lib/partition_gardener/plan.rb', line 3

def name
  @name
end

#range_endObject (readonly)

Returns the value of attribute range_end

Returns:

  • (Object)

    the current value of range_end



3
4
5
# File 'lib/partition_gardener/plan.rb', line 3

def range_end
  @range_end
end

#range_startObject (readonly)

Returns the value of attribute range_start

Returns:

  • (Object)

    the current value of range_start



3
4
5
# File 'lib/partition_gardener/plan.rb', line 3

def range_start
  @range_start
end

Instance Method Details

#archive?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/partition_gardener/plan.rb', line 20

def archive?
  kind == :archive
end

#filler?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/partition_gardener/plan.rb', line 12

def filler?
  kind == :filler
end

#for_values_clause(strategy) ⇒ Object



28
29
30
# File 'lib/partition_gardener/plan.rb', line 28

def for_values_clause(strategy)
  strategy.segment_for_values_clause(self)
end

#future?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/partition_gardener/plan.rb', line 16

def future?
  kind == :future
end

#hash_partition?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/partition_gardener/plan.rb', line 24

def hash_partition?
  range_start.is_a?(Hash) && range_start.key?(:modulus)
end

#hot_bucket?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/partition_gardener/plan.rb', line 8

def hot_bucket?
  kind == :hot_bucket
end

#monthly?Boolean

Returns:

  • (Boolean)


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

def monthly?
  kind == :hot_bucket && !hash_partition?
end

#signatureObject



32
33
34
# File 'lib/partition_gardener/plan.rb', line 32

def signature
  [name, range_start, range_end, kind]
end