Class: Sqlfire::ServerNodeInstance
- Inherits:
-
Shared::NodeInstance
- Object
- Shared::Resource
- Shared::StateResource
- Shared::NodeInstance
- Sqlfire::ServerNodeInstance
- Defined in:
- lib/vas/sqlfire/server_node_instances.rb
Overview
A server node instance
Instance Attribute Summary collapse
-
#bind_address ⇒ String
readonly
The property in a node’s metadata used to determine the address that the server binds to for peer-to-peer communication.
-
#client_bind_address ⇒ String
readonly
The property in a node’s metadata used to determine the address that the server binds to for client communication.
-
#client_port ⇒ Integer
readonly
The port that the server listens on for client connections.
-
#critical_heap_percentage ⇒ Integer
readonly
Critical heap percentage as a percentage of the old generation heap.
-
#initial_heap ⇒ String
readonly
The initial heap size of the server’s JVM.
-
#jvm_options ⇒ String[]
readonly
The JVM options that are passed to the server’s JVM when it is started.
-
#max_heap ⇒ String
readonly
The max heap size of the server’s JVM.
-
#run_netserver ⇒ Boolean
readonly
true
if the server runs a netserver that can service thin clients, otherwisefalse
.
Attributes inherited from Shared::NodeInstance
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#initialize(location, client) ⇒ ServerNodeInstance
constructor
A new instance of ServerNodeInstance.
-
#reload ⇒ void
Reloads the instance’s details from the server.
-
#start(rebalance = false) ⇒ void
Starts the server node instance, optionally triggering a rebalance.
-
#to_s ⇒ String
A string representation of the instance.
Methods inherited from Shared::NodeInstance
#group_instance, #live_configurations, #logs, #node
Methods inherited from Shared::StateResource
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_address ⇒ String (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.
34 35 36 |
# File 'lib/vas/sqlfire/server_node_instances.rb', line 34 def bind_address @bind_address end |
#client_bind_address ⇒ String (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
.
38 39 40 |
# File 'lib/vas/sqlfire/server_node_instances.rb', line 38 def client_bind_address @client_bind_address end |
#client_port ⇒ Integer (readonly)
Returns 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_percentage ⇒ Integer (readonly)
Returns 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_heap ⇒ String (readonly)
Returns 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_options ⇒ String[] (readonly)
Returns 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 end |
#max_heap ⇒ String (readonly)
Returns 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_netserver ⇒ Boolean (readonly)
Returns 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
#reload ⇒ void
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
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_s ⇒ String
Returns 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 |