Class: Sqlfire::LocatorInstances

Inherits:
Shared::MutableCollection show all
Defined in:
lib/vas/sqlfire/locator_instances.rb

Overview

Used to enumerate, create, and delete locator instances.

Instance Attribute Summary

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Methods inherited from Shared::MutableCollection

#create_image

Methods inherited from Shared::Collection

#each, #reload

Constructor Details

#initialize(location, client) ⇒ LocatorInstances

Returns a new instance of LocatorInstances.



37
38
39
# File 'lib/vas/sqlfire/locator_instances.rb', line 37

def initialize(location, client)
  super(location, client, 'locator-group-instances', LocatorInstance)
end

Instance Method Details

#create(installation, name, options = {}) ⇒ LocatorInstance

Creates a new locator instance

Parameters:

  • installation (Installation)

    the installation that the instance will use

  • name (String)

    the name of the instance

  • options (Hash) (defaults to: {})

    optional configuration for the instance

Options Hash (options):

  • The ('bind-address'String)

    property in a node’s metadata to use to determine the address that the locator binds to for peer-to-peer communication. If omitted, or if the property does not exist, the locator will use the value derived from peer-discovery-address

  • The ('client-bind-address'String)

    property in a node’s metadata to use to determine the address that the locator binds to for client communication. If omitted, or if the property does not exist, the locator will use the node’s hostname. Only takes effect if run-netserver is true

  • The ('client-port'Integer)

    port that the locator listens on for client connections. Only take effect if run-netserver is true

  • The ('initial-heap'String)

    intial heap size to be used by the locator’s JVM. If not specified, the JVM’s default is used

  • The ('jvm-options'String[])

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

  • The ('max-heap'String)

    maximum heap size to be used by the locator’s JVM. If not specified, the JVM’s default is used

  • The ('peer-discovery-address'String)

    property in a node’s metadata to use to determine the address that the locator binds to for peer-discovery communication. If omitted, or if the property does not exist, the locator will use 0.0.0.0

  • The ('peer-discovery-port'Integer)

    port that the locator listens on for peer-discovery connections. If omitted, the locator will listen on the default port (10334)

  • Whether ('run-netserver'Boolean)

    the locator should run a netserver that can service thin clients. Default is true.

Returns:



69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/vas/sqlfire/locator_instances.rb', line 69

def create(installation, name, options = {})

  payload = {:installation => installation.location,
             :name => name}

  options.each { |key, value|
    if (CREATE_PAYLOAD_KEYS.include?(key))
      payload[key] = value
    end
  }

  super(payload, 'locator-group-instance')
end