Class: HBase::Response::RowResponse
- Inherits:
-
BasicResponse
- Object
- BasicResponse
- HBase::Response::RowResponse
- Defined in:
- lib/hbase/response/row_response.rb
Instance Method Summary collapse
Methods inherited from BasicResponse
Constructor Details
This class inherits a constructor from HBase::Response::BasicResponse
Instance Method Details
#parse_content(raw_data) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/hbase/response/row_response.rb', line 4 def parse_content(raw_data) doc = REXML::Document.new(raw_data) row = doc.elements["row"] rname = row.elements["name"].text.strip.unpack("m").first columns = [] # Need fix in the server side count = row.elements["count"].text.strip.to_i rescue 0 row.elements["columns"].elements.each("column") do |col| name = col.elements["name"].text.strip.unpack("m").first value = col.elements["value"].text.strip.unpack("m").first rescue nil = col.elements["timestamp"].text.strip.to_i columns << Model::Column.new(:name => name, :value => value, :timestamp => ) end Model::Row.new(:name => rname, :total_count => count, :columns => columns) end |