Skip to content
This repository was archived by the owner on Nov 30, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions lib/stargate/operation/scanner_operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def open_scanner(table_name, options = {})
start_time = options.delete(:start_time)
end_time = options.delete(:end_time)

filters = options.delete(:filters)

begin
request = Request::ScannerRequest.new(table_name)

Expand All @@ -33,14 +35,23 @@ def open_scanner(table_name, options = {})
warn "[open_scanner] Received invalid option key :#{key}"
end
end
if columns
if filters
# close the header
xml_data << ">"
filters.each do |filter|
filter_string = "<filter>#{Oj.dump(filter)}</filter>"
xml_data << filter_string
end
xml_data << "</Scanner>" unless columns
end
if columns
xml_data << ">" unless filters
[columns].flatten.each do |col|
xml_data << "<column>#{Base64.encode64(col)}</column>"
end
xml_data << "</Scanner>"
else
xml_data << "/>"
xml_data << "/>" unless filters
end

scanner = Response::ScannerResponse.new(rest_post_response(request.open, xml_data), :open_scanner).parse
Expand Down