Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

Commit

Permalink
(#448) Remove the Ruby Federation Broker
Browse files Browse the repository at this point in the history
  • Loading branch information
ripienaar committed Mar 21, 2018
1 parent d1a8420 commit ca7937c
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 1,408 deletions.
42 changes: 0 additions & 42 deletions lib/mcollective/application/federation.rb
Expand Up @@ -9,27 +9,11 @@ class Federation < Application
The ACTION can be one of the following:
trace - trace the path to a client
broker - start a Federation Broker instance
USAGE

exclude_argument_sections "common", "filter", "rpc"

option :cluster,
:arguments => ["--cluster CLUSTER"],
:description => "Cluster name to serve",
:type => String

option :instance,
:arguments => ["--instance INSTANCE"],
:description => "Instance name to serve",
:type => String

option :stats_port,
:arguments => ["--stats-port PORT", "--stats"],
:description => "HTTP port to listen to for stats",
:type => Integer

# Publish a specially crafted 'ping' with seen-by headers
# embedded, this signals to the entire collective to record
# their route
Expand Down Expand Up @@ -200,32 +184,6 @@ def trace_command
end
end

def broker_command
configuration[:cluster] = Config.instance.pluginconf["choria.federation.cluster"] unless configuration[:cluster]
configuration[:instance] = Config.instance.pluginconf["choria.federation.instance"] unless configuration[:instance]

abort("A cluster name is required, use --cluster or plugin.choria.federation.cluster") unless configuration[:cluster]

Log.warn("Using a UUID based instance name, use --instance of plugin.choria.federation.instance") unless configuration[:instance]

# app framework would set this to just 'federation' which is not helping
$0 = "choria %s_%s federation broker [%s]" % [configuration[:cluster], configuration[:instance], Config.instance.configfile]

broker = choria.federation_broker(
configuration[:cluster],
configuration[:instance],
configuration[:stats_port]
)

broker.start

sleep 10 while broker.ok?

Log.error("Some broker threads died, exiting: %s" % broker.thread_status.pretty_inspect)

exit(1)
end

# Creates and cache a Choria helper class
#
# @return [Util::Choria]
Expand Down
15 changes: 0 additions & 15 deletions lib/mcollective/util/choria.rb
Expand Up @@ -54,21 +54,6 @@ def tasks_spool_dir
end
end

# Factory for Federation Brokers
#
# We do it here to avoid always requiring all the federation broker code
# when its not needed
#
# @param cluster_name [String] the name of the federation broker cluster
# @param instance_name [String, nil] the name of this specific instance in the cluster
# @param stats_port [Integer, nil] the port to listen to for stats, uses choria.stats_port when nil
# @return [FederationBroker]
def federation_broker(cluster_name, instance_name=nil, stats_port=nil)
require_relative "federation_broker"

FederationBroker.new(cluster_name, instance_name, stats_port)
end

# Which port to provide stats over HTTP on
#
# @return [Integer,nil]
Expand Down
105 changes: 0 additions & 105 deletions lib/mcollective/util/federation_broker.rb

This file was deleted.

0 comments on commit ca7937c

Please sign in to comment.