Class: HBase::Request::RowRequest

Inherits:
BasicRequest show all
Defined in:
lib/hbase/request/row_request.rb

Instance Attribute Summary collapse

Attributes inherited from BasicRequest

#path

Instance Method Summary collapse

Constructor Details

#initialize(table_name, name, timestamp = nil) ⇒ RowRequest

Returns a new instance of RowRequest.


8
9
10
11
12
13
# File 'lib/hbase/request/row_request.rb', line 8

def initialize(table_name, name, timestamp=nil)
  @table_name, @name, @timestamp = CGI.escape(table_name), CGI.escape(name), timestamp
  path = "/#{@table_name}/row/#{@name}"
  path << "/#{@timestamp}" if timestamp
  super(path)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


5
6
7
# File 'lib/hbase/request/row_request.rb', line 5

def name
  @name
end

#table_nameObject (readonly)

Returns the value of attribute table_name


4
5
6
# File 'lib/hbase/request/row_request.rb', line 4

def table_name
  @table_name
end

#timestampObject (readonly)

Returns the value of attribute timestamp


6
7
8
# File 'lib/hbase/request/row_request.rb', line 6

def timestamp
  @timestamp
end

Instance Method Details

#createObject


25
26
27
# File 'lib/hbase/request/row_request.rb', line 25

def create
  @path
end

#delete(columns = nil) ⇒ Object


29
30
31
32
# File 'lib/hbase/request/row_request.rb', line 29

def delete(columns = nil)
  @path << "?#{pack_params(columns)}" if columns
  @path
end

#show(columns = nil, options = { }) ⇒ Object


15
16
17
18
19
20
21
22
23
# File 'lib/hbase/request/row_request.rb', line 15

def show(columns = nil, options = { })
  if columns
    @path << "?#{pack_params(columns)}"
    @path << "&version=#{options[:version]}" if options[:version]
    @path << "&offset=#{options[:offset]}" if options[:offset]
    @path << "&limit=#{options[:limit]}" if options[:limit]
  end
  @path
end