Class: Sqlfire::ServerNodeInstance

Inherits:
Shared::NodeInstance show all
Defined in:
lib/vas/sqlfire/server_node_instances.rb

Overview

A server node instance

Instance Attribute Summary collapse

Attributes inherited from Shared::NodeInstance

#name

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Methods inherited from Shared::NodeInstance

#group_instance, #live_configurations, #logs, #node

Methods inherited from Shared::StateResource

#state, #stop

Constructor Details

#initialize(location, client) ⇒ ServerNodeInstance

Returns a new instance of ServerNodeInstance.



61
62
63
# File 'lib/vas/sqlfire/server_node_instances.rb', line 61

def initialize(location, client)
  super(location, client, Node, ServerLogs, ServerInstance, 'server-group-instance', ServerNodeLiveConfigurations)
end

Instance Attribute Details

#bind_addressString (readonly)

Returns the property in a node’s metadata used to determine the address that the server binds to for peer-to-peer communication. If nil, the server uses the node’s hostname.

Returns:

  • (String)

    the property in a node’s metadata used to determine the address that the server binds to for peer-to-peer communication. If nil, the server uses the node’s hostname



34
35
36
# File 'lib/vas/sqlfire/server_node_instances.rb', line 34

def bind_address
  @bind_address
end

#client_bind_addressString (readonly)

Returns the property in a node’s metadata used to determine the address that the server binds to for client communication. If nil, the server uses localhost. Only takes effect if run_netserver is true.

Returns:

  • (String)

    the property in a node’s metadata used to determine the address that the server binds to for client communication. If nil, the server uses localhost. Only takes effect if run_netserver is true



38
39
40
# File 'lib/vas/sqlfire/server_node_instances.rb', line 38

def client_bind_address
  @client_bind_address
end

#client_portInteger (readonly)

Returns the port that the server listens on for client connections. Only takes effect if run_netserver is true.

Returns:

  • (Integer)

    the port that the server listens on for client connections. Only takes effect if run_netserver is true



42
43
44
# File 'lib/vas/sqlfire/server_node_instances.rb', line 42

def client_port
  @client_port
end

#critical_heap_percentageInteger (readonly)

Returns critical heap percentage as a percentage of the old generation heap. nil if the server uses the default.

Returns:

  • (Integer)

    critical heap percentage as a percentage of the old generation heap. nil if the server uses the default



46
47
48
# File 'lib/vas/sqlfire/server_node_instances.rb', line 46

def critical_heap_percentage
  @critical_heap_percentage
end

#initial_heapString (readonly)

Returns The initial heap size of the server’s JVM. nil if the default is used.

Returns:

  • (String)

    The initial heap size of the server’s JVM. nil if the default is used



49
50
51
# File 'lib/vas/sqlfire/server_node_instances.rb', line 49

def initial_heap
  @initial_heap
end

#jvm_optionsString[] (readonly)

Returns The JVM options that are passed to the server’s JVM when it is started.

Returns:

  • (String[])

    The JVM options that are passed to the server’s JVM when it is started



52
53
54
# File 'lib/vas/sqlfire/server_node_instances.rb', line 52

def jvm_options
  @jvm_options
end

#max_heapString (readonly)

Returns The max heap size of the server’s JVM. nil if the default is used.

Returns:

  • (String)

    The max heap size of the server’s JVM. nil if the default is used



55
56
57
# File 'lib/vas/sqlfire/server_node_instances.rb', line 55

def max_heap
  @max_heap
end

#run_netserverBoolean (readonly)

Returns true if the server runs a netserver that can service thin clients, otherwise false.

Returns:

  • (Boolean)

    true if the server runs a netserver that can service thin clients, otherwise false



58
59
60
# File 'lib/vas/sqlfire/server_node_instances.rb', line 58

def run_netserver
  @run_netserver
end

Instance Method Details

#reloadvoid

This method returns an undefined value.

Reloads the instance’s details from the server



67
68
69
70
71
72
73
74
75
76
77
# File 'lib/vas/sqlfire/server_node_instances.rb', line 67

def reload
  super
  @bind_address = details['bind-address']
  @client_bind_address = details['client-bind-address']
  @client_port = details['client-port']
  @critical_heap_percentage = details['critical-heap-percentage']
  @initial_heap = details['initial-heap']
  @jvm_options = details['jvm-options']
  @max_heap = details['max-heap']
  @run_netserver = details['run-netserver']
end

#start(rebalance = false) ⇒ void

This method returns an undefined value.

Starts the server node instance, optionally triggering a rebalance

Parameters:

  • rebalance (Boolean) (defaults to: false)

    true if the start should trigger a rebalance, false if it should not



85
86
87
# File 'lib/vas/sqlfire/server_node_instances.rb', line 85

def start(rebalance = false)
  client.post(@state_location, { :status => 'STARTED', :rebalance => rebalance })
end

#to_sString

Returns a string representation of the instance.

Returns:

  • (String)

    a string representation of the instance



90
91
92
# File 'lib/vas/sqlfire/server_node_instances.rb', line 90

def to_s
  "#<#{self.class} name='#{name}' bind_address='#@bind_address' client_bind_address='#@client_bind_address' client_port='#@client_port' critical_heap_percentage='#@critical_heap_percentage' initial_heap='#@initial_heap' jvm_options='#@jvm_options' max_heap='#@max_heap' run_netserver='#@run_netserver'>"
end