Module: Bramble::Storage::RedisStorage

Defined in:
lib/bramble/storage/redis_storage.rb

Class Method Summary collapse

Class Method Details

.delete(key) ⇒ Object



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

def delete(key)
  redis_conn.del(key)
end

.get(key) ⇒ Object



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

def get(key)
  redis_conn.get(key)
end

.increment(key) ⇒ Object



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

def increment(key)
  redis_conn.incr(key)
end

.map_keys_get(key) ⇒ Object



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

def map_keys_get(key)
  redis_conn.smembers(key)
end

.map_keys_push(key, value) ⇒ Object



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

def map_keys_push(key, value)
  redis_conn.sadd(key, value)
end

.map_result_get(key) ⇒ Object



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

def map_result_get(key)
  redis_conn.lrange(key, 0, -1)
end

.map_result_push(key, value) ⇒ Object



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

def map_result_push(key, value)
  redis_conn.rpush(key, value)
end

.reduce_result_get(storage_key) ⇒ Object



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

def reduce_result_get(storage_key)
  redis_conn.hgetall(storage_key)
end

.reduce_result_set(storage_key, reduce_key, value) ⇒ Object



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

def reduce_result_set(storage_key, reduce_key, value)
  redis_conn.hset(storage_key, reduce_key, value)
end

.set(key, value) ⇒ Object



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

def set(key, value)
  redis_conn.set(key, value)
end