Class: Tem::Mr::Search::ClientQuery

Inherits:
MapReduceJob show all
Defined in:
lib/tem_mr_search/client_query.rb

Instance Attribute Summary

Attributes inherited from MapReduceJob

#attributes, #finalizer, #id_attribute, #mapper, #reducer

Instance Method Summary collapse

Methods inherited from MapReduceJob

#bind, #to_hash, #unpack_decrypted_output

Constructor Details

#initialize(attributes) ⇒ ClientQuery

Returns a new instance of ClientQuery.



5
6
7
8
# File 'lib/tem_mr_search/client_query.rb', line 5

def initialize(attributes)
  super
  @query_key = attributes[:key]
end

Instance Method Details

#unpack_output(output) ⇒ Object

Unpacks a reduce output into its components.

This is expected to be called with the encrypted output returned by the search provider.



14
15
16
17
# File 'lib/tem_mr_search/client_query.rb', line 14

def unpack_output(output)
  decrypted_output = @query_key.decrypt output
  unpack_decrypted_output decrypted_output
end