summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2014-10-11 16:03:34 +0200
committerChristian Pointner <equinox@spreadspace.org>2014-10-11 16:03:34 +0200
commit81aefd3248bc9464b47af2c5d85d694cbda4d60f (patch)
tree48fd3603a7bbc5a3809694cb4528b0822d37a394 /src
parentalso create porter for local duplicates (diff)
added support for local duplicates for http-streamer
Diffstat (limited to 'src')
-rwxr-xr-xsrc/flufigut.py49
1 files changed, 39 insertions, 10 deletions
diff --git a/src/flufigut.py b/src/flufigut.py
index 031987e..fdbed7e 100755
--- a/src/flufigut.py
+++ b/src/flufigut.py
@@ -302,29 +302,28 @@ if output_format == 'flumotion':
}
if localdup:
- port = localdup['port']
if 'porter' in machines[machine]:
- if port in machines[machine]['porter']:
- raise SystemExit("ERROR: porter cannot be created because machine '%s' already uses port %i" % (machine, port))
+ if localdup['port'] in machines[machine]['porter']:
+ raise SystemExit("ERROR: porter cannot be created because machine '%s' already uses port %i" % (machine, localdup['port']))
else:
machines[machine]['porter'] = {}
- machines[machine]['porter'][port] = {
+ machines[machine]['porter'][localdup['port']] = {
'socket-path': "porter-%s"%(rand_string()),
'username': rand_string(size=12),
'password': rand_string(size=12),
}
- atmosphere['porter-%s-%i'%(machine, port)] = {
+ atmosphere['porter-%s-%i'%(machine, localdup['port'])] = {
'type': "porter",
- 'desc': "Porter (local-only) for %s on port %i"%(machine, port),
+ 'desc': "Porter (local-only) for %s on port %i"%(machine, localdup['port']),
'worker': stream_worker,
'properties': {
- 'port': port,
+ 'port': localdup['port'],
'interface': "localhost",
- 'socket-path': machines[machine]['porter'][port]['socket-path'],
- 'username': machines[machine]['porter'][port]['username'],
- 'password': machines[machine]['porter'][port]['password'],
+ 'socket-path': machines[machine]['porter'][localdup['port']]['socket-path'],
+ 'username': machines[machine]['porter'][localdup['port']]['username'],
+ 'password': machines[machine]['porter'][localdup['port']]['password'],
},
}
@@ -348,6 +347,36 @@ if output_format == 'flumotion':
else:
feeder = muxer_feed
+ if localdup and format in localdup['formats']:
+ repeater_name = 'localdup-%s%i-%s-%s-%s' % (cluster, idx+1, mux_name, format, profile)
+ flow['repeater'][repeater_name] = {
+ 'type': "repeater",
+ 'desc': "local duplicate on %s%i for %s %s-%s" % (cluster, idx+1, mux_name, format, profile),
+ 'worker': stream_worker,
+ 'feeder': feeder }
+ feeder = repeater_name
+
+ name = '%s-local-%s%i-%s-%s-%s' % (stream[cluster]['type'], cluster, idx+1, mux_name, format, profile)
+ mount_point = '/%s-%s-%s.%s' % (mux_name, format, profile, globals['formats'][format]['muxer'])
+ flow['streamer'][name] = {
+ 'type': "%s-stream" % stream[cluster]['type'],
+ 'desc': "%s streamer for %s %s-%s (part %i of %s cluster, local duplicate)" % (stream[cluster]['type'], mux_name, format, profile, idx+1, cluster),
+ 'worker': stream_worker,
+ 'feeder': feeder,
+ 'properties': {
+ 'description': globals['description'],
+ 'type': 'slave',
+ 'porter-socket-path': machines[machine]['porter'][localdup['port']]['socket-path'],
+ 'porter-username': machines[machine]['porter'][localdup['port']]['username'],
+ 'porter-password': machines[machine]['porter'][localdup['port']]['password'],
+ 'mount-point': mount_point,
+ }
+ }
+ if 'burst-on-connect' in stream[cluster]['localdup'].keys():
+ flow['streamer'][name]['properties']['burst-on-connect'] = 'true'
+ flow['streamer'][name]['properties']['burst-time'] = stream[cluster]['localdup']['burst-on-connect']
+
+
name = '%s-%s%i-%s-%s-%s' % (stream[cluster]['type'], cluster, idx+1, mux_name, format, profile)
mount_point = '/%s-%s-%s.%s' % (mux_name, format, profile, globals['formats'][format]['muxer'])
if streamer_cnt > 1: