Class: Jubatus::Burst::Client::Burst

Inherits:
Common::ClientBase show all
Includes:
Common
Defined in:
lib/jubatus/burst/client.rb

Instance Method Summary collapse

Methods included from Common

check_type, check_types

Methods inherited from Common::ClientBase

connect, #do_mix, #get_client, #get_config, #get_name, #get_proxy_status, #get_status, #load, #save, #set_name

Constructor Details

#initialize(host, port, name, timeout_sec = 10) ⇒ Burst

Returns a new instance of Burst.


16
17
18
# File 'lib/jubatus/burst/client.rb', line 16

def initialize(host, port, name, timeout_sec=10)
  super
end

Instance Method Details

#add_documents(data) ⇒ Object


20
21
22
23
# File 'lib/jubatus/burst/client.rb', line 20

def add_documents(data)
  @jubatus_client.call("add_documents", [data], TInt.new(true, 4), [TList.new(
      TUserDef.new(Document))])
end

#add_keyword(keyword) ⇒ Object


50
51
52
53
# File 'lib/jubatus/burst/client.rb', line 50

def add_keyword(keyword)
  @jubatus_client.call("add_keyword", [keyword], TBool.new, [TUserDef.new(
      KeywordWithParams)])
end

#clearObject


63
64
65
# File 'lib/jubatus/burst/client.rb', line 63

def clear
  @jubatus_client.call("clear", [], TBool.new, [])
end

#get_all_bursted_resultsObject


35
36
37
38
# File 'lib/jubatus/burst/client.rb', line 35

def get_all_bursted_results
  @jubatus_client.call("get_all_bursted_results", [], TMap.new(TString.new,
      TUserDef.new(Window)), [])
end

#get_all_bursted_results_at(pos) ⇒ Object


40
41
42
43
# File 'lib/jubatus/burst/client.rb', line 40

def get_all_bursted_results_at(pos)
  @jubatus_client.call("get_all_bursted_results_at", [pos], TMap.new(
      TString.new, TUserDef.new(Window)), [TFloat.new])
end

#get_all_keywordsObject


45
46
47
48
# File 'lib/jubatus/burst/client.rb', line 45

def get_all_keywords
  @jubatus_client.call("get_all_keywords", [], TList.new(TUserDef.new(
      KeywordWithParams)), [])
end

#get_result(keyword) ⇒ Object


25
26
27
28
# File 'lib/jubatus/burst/client.rb', line 25

def get_result(keyword)
  @jubatus_client.call("get_result", [keyword], TUserDef.new(Window),
      [TString.new])
end

#get_result_at(keyword, pos) ⇒ Object


30
31
32
33
# File 'lib/jubatus/burst/client.rb', line 30

def get_result_at(keyword, pos)
  @jubatus_client.call("get_result_at", [keyword, pos], TUserDef.new(Window),
      [TString.new, TFloat.new])
end

#remove_all_keywordsObject


59
60
61
# File 'lib/jubatus/burst/client.rb', line 59

def remove_all_keywords
  @jubatus_client.call("remove_all_keywords", [], TBool.new, [])
end

#remove_keyword(keyword) ⇒ Object


55
56
57
# File 'lib/jubatus/burst/client.rb', line 55

def remove_keyword(keyword)
  @jubatus_client.call("remove_keyword", [keyword], TBool.new, [TString.new])
end