Class: Jubatus::Clustering::Client::Clustering

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

Instance Method Summary collapse

Methods included from Jubatus::Common

check_type, check_types

Methods inherited from Jubatus::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) ⇒ Clustering

Returns a new instance of Clustering.


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

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

Instance Method Details

#clearObject


58
59
60
# File 'lib/jubatus/clustering/client.rb', line 58

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

#get_core_membersObject


29
30
31
32
# File 'lib/jubatus/clustering/client.rb', line 29

def get_core_members
  @jubatus_client.call("get_core_members", [], TList.new(TList.new(
      TUserDef.new(WeightedDatum))), [])
end

#get_core_members_lightObject


34
35
36
37
# File 'lib/jubatus/clustering/client.rb', line 34

def get_core_members_light
  @jubatus_client.call("get_core_members_light", [], TList.new(TList.new(
      TUserDef.new(WeightedIndex))), [])
end

#get_k_centerObject


39
40
41
# File 'lib/jubatus/clustering/client.rb', line 39

def get_k_center
  @jubatus_client.call("get_k_center", [], TList.new(TDatum.new), [])
end

#get_nearest_center(point) ⇒ Object


43
44
45
46
# File 'lib/jubatus/clustering/client.rb', line 43

def get_nearest_center(point)
  @jubatus_client.call("get_nearest_center", [point], TDatum.new,
      [TDatum.new])
end

#get_nearest_members(point) ⇒ Object


48
49
50
51
# File 'lib/jubatus/clustering/client.rb', line 48

def get_nearest_members(point)
  @jubatus_client.call("get_nearest_members", [point], TList.new(TUserDef.new(
      WeightedDatum)), [TDatum.new])
end

#get_nearest_members_light(point) ⇒ Object


53
54
55
56
# File 'lib/jubatus/clustering/client.rb', line 53

def get_nearest_members_light(point)
  @jubatus_client.call("get_nearest_members_light", [point], TList.new(
      TUserDef.new(WeightedIndex)), [TDatum.new])
end

#get_revisionObject


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

def get_revision
  @jubatus_client.call("get_revision", [], TInt.new(false, 4), [])
end

#push(points) ⇒ Object


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

def push(points)
  @jubatus_client.call("push", [points], TBool.new, [TList.new(TUserDef.new(
      IndexedPoint))])
end