Module: Bramble::Keys

Included in:
Map, Reduce, State
Defined in:
lib/bramble/keys.rb

Overview

A collection of helpers for getting string keys in the storage adapter.

Class Method Summary collapse

Class Method Details

.data_key(handle, key) ⇒ Object



10
11
12
# File 'lib/bramble/keys.rb', line 10

def data_key(handle, key)
  "#{namespace(handle)}:data:#{key}"
end

.finished_at_key(handle) ⇒ Object



46
47
48
# File 'lib/bramble/keys.rb', line 46

def finished_at_key(handle)
  "#{namespace(handle)}:finished_at"
end

.job_id_key(handle) ⇒ Object



38
39
40
# File 'lib/bramble/keys.rb', line 38

def job_id_key(handle)
  "#{namespace(handle)}:job_id"
end

.keys_key(handle) ⇒ Object



14
15
16
# File 'lib/bramble/keys.rb', line 14

def keys_key(handle)
  "#{namespace(handle)}:keys"
end

.map_finished_count_key(handle) ⇒ Object



22
23
24
# File 'lib/bramble/keys.rb', line 22

def map_finished_count_key(handle)
  "#{namespace(handle)}:map_finished_count"
end

.map_total_count_key(handle) ⇒ Object



18
19
20
# File 'lib/bramble/keys.rb', line 18

def map_total_count_key(handle)
  "#{namespace(handle)}:map_total_count"
end

.namespace(handle) ⇒ Object



6
7
8
# File 'lib/bramble/keys.rb', line 6

def namespace(handle)
  "#{Bramble.config.namespace}:#{handle}"
end

.reduce_finished_count_key(handle) ⇒ Object



30
31
32
# File 'lib/bramble/keys.rb', line 30

def reduce_finished_count_key(handle)
  "#{namespace(handle)}:reduce_finished_count"
end

.reduce_total_count_key(handle) ⇒ Object



26
27
28
# File 'lib/bramble/keys.rb', line 26

def reduce_total_count_key(handle)
  "#{namespace(handle)}:reduce_total_count"
end

.result_key(handle) ⇒ Object



34
35
36
# File 'lib/bramble/keys.rb', line 34

def result_key(handle)
  "#{namespace(handle)}:result"
end

.status_key(handle) ⇒ Object



42
43
44
# File 'lib/bramble/keys.rb', line 42

def status_key(handle)
  "#{namespace(handle)}:status"
end