Class: Sqlfire::ServerInstance
- Inherits:
-
Shared::Instance
- Object
- Shared::Resource
- Shared::StateResource
- Shared::Instance
- Sqlfire::ServerInstance
- Defined in:
- lib/vas/sqlfire/server_instances.rb
Overview
A server 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::Instance
Attributes included from Shared::Deletable
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#initialize(location, client) ⇒ ServerInstance
constructor
A new instance of ServerInstance.
-
#reload ⇒ void
Reloads the instance’s details from the server.
-
#to_s ⇒ String
A string representation of the instance.
-
#update(options = {}) ⇒ void
Updates the instance using the supplied
options
.
Methods inherited from Shared::Instance
#group, #installation, #live_configurations, #node_instances, #pending_configurations, #start, #stop
Methods included from Shared::Deletable
Methods inherited from Shared::StateResource
Constructor Details
#initialize(location, client) ⇒ ServerInstance
Returns a new instance of ServerInstance.
124 125 126 |
# File 'lib/vas/sqlfire/server_instances.rb', line 124 def initialize(location, client) super(location, client, Group, Installation, ServerLiveConfigurations, ServerPendingConfigurations, ServerNodeInstance, 'server-node-instance') 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.
97 98 99 |
# File 'lib/vas/sqlfire/server_instances.rb', line 97 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
.
101 102 103 |
# File 'lib/vas/sqlfire/server_instances.rb', line 101 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
.
105 106 107 |
# File 'lib/vas/sqlfire/server_instances.rb', line 105 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.
109 110 111 |
# File 'lib/vas/sqlfire/server_instances.rb', line 109 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.
112 113 114 |
# File 'lib/vas/sqlfire/server_instances.rb', line 112 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.
115 116 117 |
# File 'lib/vas/sqlfire/server_instances.rb', line 115 def @jvm_options end |
#max_heap ⇒ String (readonly)
Returns The max heap size of the server’s JVM. nil
if the default is used.
118 119 120 |
# File 'lib/vas/sqlfire/server_instances.rb', line 118 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
.
121 122 123 |
# File 'lib/vas/sqlfire/server_instances.rb', line 121 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
173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/vas/sqlfire/server_instances.rb', line 173 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 |
#to_s ⇒ String
Returns a string representation of the instance.
186 187 188 |
# File 'lib/vas/sqlfire/server_instances.rb', line 186 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 |
#update(options = {}) ⇒ void
This method returns an undefined value.
Updates the instance using the supplied options
.
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/vas/sqlfire/server_instances.rb', line 154 def update( = {}) payload = {} .each { |key, value| if (UPDATE_PAYLOAD_KEYS.include?(key)) payload[key] = value end } if (.has_key? :installation) payload[:installation] = [:installation].location end client.post(location, payload) reload end |