Class: Confluent::Kafka::Zookeeper

Inherits:
ServerBase show all
Defined in:
src/confluent-platform/lib/confluent-platform/model/zookeeper.rb

Overview

Base class for Zookeeper services of Confluent Kafka software. Provides methods for the configuring and managing Confluent Kafka Zookeeper.

Since:

  • 0.1.0

Properties (Read/Write)

  • #id ⇒ Integer
    'Zookeeper instance identifier, mandatory for multinode configuration'

    Property Attributes
    • requiredfalse
    
    
    44
    # File 'src/confluent-platform/lib/confluent-platform/model/zookeeper.rb', line 44
    
    property :id, type: Integer, required: false, description: 'Zookeeper instance identifier, mandatory for multinode configuration'
  • #config ⇒ Pathname (Default Value: ::File.join('/etc', 'kafka', 'zookeeper.properties'))
    The location path of the zookeeper configuration file

    Property Attributes
    • fromString
    • requiredtrue
    • default::File.join('/etc', 'kafka', 'zookeeper.properties')
    
    
    47
    48
    # File 'src/confluent-platform/lib/confluent-platform/model/zookeeper.rb', line 47
    
    property :config, type: Pathname, from: String, required: true, default: ::File.join('/etc', 'kafka',
    'zookeeper.properties')
  • #name ⇒ String (Default Value: self.class.to_s.gsub('::', ''))

    Property Attributes
    • defaultself.class.to_s.gsub('::', '')
    
    
    57
    # File 'src/confluent-platform/lib/confluent-platform/model/server_base.rb', line 57
    
    property :Name, type: String, default: self.class.to_s.gsub('::', '')
  • #installation ⇒ Confluent::Kafka::Installation
    The Kafka installation associated with this Server

    Property Attributes
    • requiredfalse
    
    
    60
    # File 'src/confluent-platform/lib/confluent-platform/model/server_base.rb', line 60
    
    property :installation, type: Confluent::Kafka::Installation, required: false
  • #host ⇒ MintPress::Infrastructure::Host (Default Value: Proc.new { self.get_property(:installation) ? self.installation.host : nil })
    If the user specifies transport, default to a new host with it, otherwise try java installation ... we'll raise exception if none of this stuff ends up resolving...

    Property Attributes
    • requiredtrue
    • no_backreftrue
    • paralleltrue
    • disposition:requires
    • defaultProc.new { self.get_property(:installation) ? self.installation.host : nil }
    
    
    64
    65
    # File 'src/confluent-platform/lib/confluent-platform/model/server_base.rb', line 64
    
    property :host, type: MintPress::Infrastructure::Host, required: true, no_backref: true, parallel: true,
    disposition: :requires, default: Proc.new { self.get_property(:installation) ? self.installation.host : nil }
  • #java_home ⇒ Pathname (Default Value: Proc.new { self.get_property(:installation) ? self.installation.java_home : nil })
    The JAVA_HOME location to use for this installation

    Property Attributes
    • fromString
    • requiredtrue
    • defaultProc.new { self.get_property(:installation) ? self.installation.java_home : nil }
    
    
    72
    73
    # File 'src/confluent-platform/lib/confluent-platform/model/server_base.rb', line 72
    
    property :java_home, type: Pathname, from: String, required: true,
    default: Proc.new { self.get_property(:installation) ? self.installation.java_home : nil }
  • #kafka_home ⇒ Pathname (Default Value: Proc.new { self.get_property(:installation) ? self.installation.kafka_home : nil })
    The KAFKA_HOME location where this software will be installed

    Property Attributes
    • fromString
    • requiredtrue
    • defaultProc.new { self.get_property(:installation) ? self.installation.kafka_home : nil }
    
    
    76
    77
    # File 'src/confluent-platform/lib/confluent-platform/model/server_base.rb', line 76
    
    property :kafka_home, type: Pathname, from: String, required: true,
    default: Proc.new { self.get_property(:installation) ? self.installation.kafka_home : nil }
  • #properties ⇒ Hash (Default Value: {})
    Additional properties which will be added to the server.properties file as key/value pairs

    Property Attributes
    • default{}
    
    
    80
    # File 'src/confluent-platform/lib/confluent-platform/model/server_base.rb', line 80
    
    property :properties, type: Hash, default: {}
  • #removed_properties ⇒ Hash (Default Value: {})
    list of properties that will be removed from the server.properties file as key/value pairs

    Property Attributes
    • default{}
    
    
    83
    # File 'src/confluent-platform/lib/confluent-platform/model/server_base.rb', line 83
    
    property :removed_properties, type: Hash, default: {}
  • #server_env_opts ⇒ Hash (Default Value: {})
    'Map containing environment variables'

    Property Attributes
    • default{}
    
    
    86
    # File 'src/confluent-platform/lib/confluent-platform/model/server_base.rb', line 86
    
    property :server_env_opts, type: Hash, default: {}, description: 'Map containing  environment variables'
  • #daemon_mode ⇒ [TrueClass, FalseClass] (Default Value: true)
    'Whether server runs in daemon mode'

    Property Attributes
    • defaulttrue
    
    
    88
    # File 'src/confluent-platform/lib/confluent-platform/model/server_base.rb', line 88
    
    property :daemon_mode, type: [TrueClass, FalseClass], default: true, description: 'Whether server runs in daemon mode'
  • #start_timeout_sec ⇒ Integer (Default Value: 300)
    'Start action timeout in seconds'

    Property Attributes
    • default300
    
    
    90
    # File 'src/confluent-platform/lib/confluent-platform/model/server_base.rb', line 90
    
    property :start_timeout_sec, type: Integer, default: 300, description: 'Start action timeout in seconds'
  • #stop_timeout_sec ⇒ Integer (Default Value: 300)
    'Stop action timeout in seconds'

    Property Attributes
    • default300
    
    
    92
    # File 'src/confluent-platform/lib/confluent-platform/model/server_base.rb', line 92
    
    property :stop_timeout_sec, type: Integer, default: 300, description: 'Stop action timeout in seconds'

Properties (Read Only)

Constant Summary collapse

DEFAULT_HOSTNAME =

Since:

  • 0.1.0
'0.0.0.0'.freeze
DEFAULT_PORT =

Since:

  • 0.1.0
2181
ENV_VARIABLE_NAMES =
List of environment variable names used by the Broker

Since:

  • 0.1.0
%w( EXTRA_ARGS INCLUDE_TEST_JARS JAVA_DEBUG_OPTS JAVA_DEBUG_PORT JMX_PORT KAFKA_DEBUG
KAFKA_GC_LOG_OPTS KAFKA_HEAP_OPTS KAFKA_JMX_OPTS KAFKA_JVM_PERFORMANCE_OPTS KAFKA_LOG4J_OPTS KAFKA_OPTS LOG_DIR
SCALA_BINARY_VERSION SCALA_VERSION UPGRADE_KAFKA_STREAMS_TEST_VERSION).freeze

Constants included from MintLogger

MintLogger::DEBUG, MintLogger::ERROR, MintLogger::FATAL, MintLogger::INFO, MintLogger::UNKNOWN, MintLogger::VERBOSE, MintLogger::WARN

Instance Attribute Summary collapse

Attributes included from MintPress::Mixins::Properties

#autopush_set_cache, #dynamic_create, #harvest_on_access, #harvest_undefined_only, #harvested, #tree_root

Instance Method Summary collapse

Methods inherited from ServerBase

#check_configuration, compare_properies, #configure_server, #find_process_id, #get_instance_variables, #harvest_server_props, #kill, #method_missing, #process_exists?, #running?, #to_hash, #up_to_date?, #wait, #wait_for_ready

Methods included from MintPress::Mixins::Properties

#[], #[]=, #add_validate_report_result, #armour_set_property, #array_contains?, #array_is_a?, #check_autopush, #check_stack_overflow, #clone_property_object, #cloner_handle_single_property, #coerce_single, #contains_as_string?, #display_validate_report_result, #double_initialize?, #dump_to_hash, #find_parent, #find_parent_by_identity, #generate_accessor_functions, #get_canonical_renamed, #get_from_opts, #get_my_name, #get_property, #get_property_item, #has?, included, #initialize_validate_report, #inspect, #is_cloned_object?, #is_mintpress_object?, #is_probably_canonical?, #is_set?, #local_debug, #local_info, #local_verbose, #mintpress_property_definitions, #place_object_by_identity, #process_properties, #prop_set?, #property, #property_definitions, #property_details, #property_is_simple_object?, #push_root!, #require_property, #require_update, #retrieve_docstring, #sanitize, #set_map_dirty, #set_property, #set_property_item, #show_short_array, #strip_defaults!, #synchronize, #uncloned_property_definitions, #update_map, #validate, #validate_generic, #validate_properties, #validate_property, #validate_required, #version_allowed?, #weakref

Methods included from MintLogger::Utils::Common

#boolean_val, #has_value?, #no_value?, #nvl, #path_as_symbol, #ruby_level_to_send

Constructor Details

#initialize(opts) ⇒ Zookeeper

Returns a new instance of Zookeeper.

Since:

  • 0.1.0

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Confluent::Kafka::ServerBase

Instance Attribute Details

#installationConfluent::Kafka::Installation

Returns the Confluent Platform installation.

Returns:

Instance Method Details

#==(other) ⇒ True/False

Compare Broker objects

Returns:

  • (True/False)
    If two Broker objects are equal

Since:

  • 0.1.0

#clobbervoid

This method returns an undefined value.

Clobber the Kafka Zookeeper configuration

Since:

  • 0.1.0

#confString

Print details about serving configuration. Send command to Zookeeper process

Returns:

Since:

  • 0.1.0

#configurevoid

This method returns an undefined value.

Configure the Kafka Zookeeper

Since:

  • 0.1.0

#consString

List full connection/session details for all clients connected to this server. Includes information on numbers of packets received/sent, session id, operation latencies, last operation performed, etc... Send command to Zookeeper process

Returns:

Since:

  • 0.1.0

#crstString

Reset connection/session statistics for all connections. Send command to Zookeeper process

Returns:

Since:

  • 0.1.0

#dumpString

Lists the outstanding sessions and ephemeral nodes. This only works on the leader. Send command to Zookeeper process

Returns:

Since:

  • 0.1.0

#enviString

Print details about serving environment Send command to Zookeeper process

Returns:

Since:

  • 0.1.0

#get_connect_host_portString, Integer

Function to return connection host and port details for the server

Returns:

  • (String)
    Hostname of the server
  • (Integer)
    Connection port

Since:

  • 0.1.0

#harvestvoid

This method returns an undefined value.

Harvest the server configuration from the target

Since:

  • 0.1.0

#is_leader?TrueClass|FalseClass

Determine whether Zookeeper instance is the leader

Returns:

  • (TrueClass|FalseClass)

Since:

  • 0.1.0

#isroString

Tests if server is running in read-only mode. The server will respond with "ro" if in read-only mode or "rw" if not in read-only mode. Send command to Zookeeper process

Returns:

Since:

  • 0.1.0

#logsString

Retrive Zookeeeper log

Returns:

Since:

  • 0.1.0

#mntrString

Outputs a list of variables that could be used for monitoring the health of the cluster. Send command to Zookeeper process

Returns:

Since:

  • 0.1.0

#process_idString

Determine Kafka Broker process id running on the node

Returns:

  • (String)
    Process ID of the Broker

Since:

  • 0.1.0

#reqsString

List outstanding requests Send command to Zookeeper process

Returns:

Since:

  • 0.1.0

#ruokString

Tests if server is running in a non-error state. The server will respond with imok if it is running. Otherwise it will not respond at all. Send command to Zookeeper process

Returns:

Since:

  • 0.1.0

#srstString

Reset server statistics. Send command to Zookeeper process

Returns:

Since:

  • 0.1.0

#srvrString

Lists full details for the server. Send command to Zookeeper process

Returns:

Since:

  • 0.1.0

#start_asyncvoid

This method returns an undefined value.

Non-blocking start the Kafka Zookeeper process

Since:

  • 0.1.0

#start_syncvoid Also known as: start

This method returns an undefined value.

Start the Kafka Zookeeper process and block until server is up

Since:

  • 0.1.0

#statString

Lists statistics about performance and connected clients. Send command to Zookeeper process

Returns:

Since:

  • 0.1.0

#stop_asyncvoid

This method returns an undefined value.

Non-blocking stop the Kafka Zookeeper process

Since:

  • 0.1.0

#stop_internal(wait_for_completion = true) ⇒ void

This method returns an undefined value.

Stop the Kafka Broker process

Since:

  • 0.1.0

#stop_syncvoid Also known as: stop

This method returns an undefined value.

Stop the Kafka Zookeeper process and block until server is shutdown

Since:

  • 0.1.0

#usageObject

DIsplay usage information for the

Since:

  • 0.1.0

#wchcString

Lists detailed information on watches for the server, by session. This outputs a list of sessions(connections) with associated watches (paths). Note, depending on the number of watches this operation may be expensive (ie impact server performance), use it carefully. Send command to Zookeeper process

Returns:

Since:

  • 0.1.0

#wchpString

Lists detailed information on watches for the server, by path. This outputs a list of paths (znodes) with associated sessions. Note, depending on the number of watches this operation may be expensive (ie impact server performance), use it carefully. Send command to Zookeeper process

Returns:

Since:

  • 0.1.0

#wchsString

Lists brief information on watches for the server. Send command to Zookeeper process

Returns:

Since:

  • 0.1.0