Class: MapRedus::RedisHasher

Inherits:
Outputter show all
Defined in:
lib/mapredus/default_classes.rb

Class Method Summary collapse

Methods inherited from Outputter

perform

Methods inherited from QueueProcess

perform, queue

Class Method Details

.decode(result_key, k) ⇒ Object



102
103
104
# File 'lib/mapredus/default_classes.rb', line 102

def self.decode(result_key, k)
  FileSystem.hget(result_key, k)
end

.encode(result_key, k, v) ⇒ Object



98
99
100
# File 'lib/mapredus/default_classes.rb', line 98

def self.encode(result_key, k, v)
  FileSystem.hset(result_key, k, v)
end

.keys(result_key) ⇒ Object



94
95
96
# File 'lib/mapredus/default_classes.rb', line 94

def self.keys(result_key)
  FileSystem.hkeys(result_key)
end

.to_hash(result_key) ⇒ Object



83
84
85
86
87
88
# File 'lib/mapredus/default_classes.rb', line 83

def self.to_hash(result_key)
  keys(result_key).inject({}) do |hash, key|
    hash[key] = decode(result_key, key)
    hash
  end
end

.values(result_key) ⇒ Object



90
91
92
# File 'lib/mapredus/default_classes.rb', line 90

def self.values(result_key)
  FileSystem.hvals(result_key)
end