コード例 #1
0
ファイル: plugin.py プロジェクト: savi-dev/sahara
 def _start_slave_datanode_processes(self, dn_instances):
     with context.ThreadGroup() as tg:
         for i in dn_instances:
             tg.spawn('spark-start-dn-%s' % i.instance_name,
                      self._start_datanode, i)
コード例 #2
0
 def start_cloudera_agents(self, instances):
     with context.ThreadGroup() as tg:
         for i in instances:
             tg.spawn('cdh-agent-start-%s' % i.instance_name,
                      self.start_cloudera_agent, i)
コード例 #3
0
 def configure_os(self, instances):
     with context.ThreadGroup() as tg:
         for inst in instances:
             tg.spawn('cdh-repo-conf-%s' % inst.instance_name,
                      self._configure_repo_from_inst, inst)
コード例 #4
0
def _configure_swift(instances):
    with context.ThreadGroup() as tg:
        for i in instances:
            tg.spawn('cdh-swift-conf-%s' % i.instance_name,
                     _configure_swift_to_inst, i)
コード例 #5
0
 def install_packages(self, instances, packages):
     with context.ThreadGroup() as tg:
         for i in instances:
             tg.spawn('cdh-inst-pkgs-%s' % i.instance_name,
                      self._install_pkgs, i, packages)
コード例 #6
0
ファイル: plugin.py プロジェクト: poornimakshirsagar/sahara
 def _start_slave_processes(self, sl_instances):
     with context.ThreadGroup() as tg:
         for i in sl_instances:
             tg.spawn('storm-start-sl-%s' % i.instance_name,
                      self._start_slaves, i)
コード例 #7
0
ファイル: plugin.py プロジェクト: poornimakshirsagar/sahara
 def _start_zookeeper_processes(self, zk_instances):
     with context.ThreadGroup() as tg:
         for i in zk_instances:
             tg.spawn('storm-start-zk-%s' % i.instance_name,
                      self._start_zookeeper, i)
コード例 #8
0
ファイル: test_context.py プロジェクト: savi-dev/sahara
 def test_thread_group_handles_spawning_exception(self):
     with self.assertRaises(TestException):
         with context.ThreadGroup():
             raise TestException()
コード例 #9
0
ファイル: test_context.py プロジェクト: savi-dev/sahara
 def test_thread_group_prefers_spawning_exception(self):
     with self.assertRaises(RuntimeError):
         with context.ThreadGroup() as tg:
             tg.spawn('raiser1', self._raise_test_exc, 'exc1')
             raise RuntimeError()
コード例 #10
0
ファイル: plugin.py プロジェクト: xinw1012/sahara
 def start_cluster(self, cluster):
     with context.ThreadGroup() as tg:
         for instance in plugin_utils.get_instances(cluster):
             tg.spawn('fake-check-%s' % instance.id, self._check_ops,
                      instance)
コード例 #11
0
ファイル: plugin.py プロジェクト: xinw1012/sahara
 def scale_cluster(self, cluster, instances):
     with context.ThreadGroup() as tg:
         for instance in instances:
             tg.spawn('fake-scaling-%s' % instance.id, self._all_check_ops,
                      instance)
コード例 #12
0
ファイル: plugin.py プロジェクト: xinw1012/sahara
 def configure_cluster(self, cluster):
     with context.ThreadGroup() as tg:
         for instance in plugin_utils.get_instances(cluster):
             tg.spawn('fake-write-%s' % instance.id, self._write_ops,
                      instance)
コード例 #13
0
ファイル: test_context.py プロジェクト: lhcxx/sahara
 def test_thread_group_prefers_spawning_exception(self):
     with testtools.ExpectedException(RuntimeError):
         with context.ThreadGroup() as tg:
             tg.spawn('raiser1', self._raise_test_exc, 'exc1')
             raise RuntimeError()
コード例 #14
0
ファイル: test_context.py プロジェクト: lhcxx/sahara
 def test_thread_group_handles_spawning_exception(self):
     with testtools.ExpectedException(TestException):
         with context.ThreadGroup():
             raise TestException()
コード例 #15
0
 def install(self, cluster_context, instances):
     with context.ThreadGroup() as tg:
         for instance in instances:
             tg.spawn('install-packages-%s' % instance.id,
                      self._install_packages_on_instance, cluster_context,
                      instance)
コード例 #16
0
 def _stop_nodes(self, instances, sys_service):
     with context.ThreadGroup() as tg:
         for instance in instances:
             tg.spawn('stop-%s-%s' % (sys_service, instance.id),
                      self._stop_service, instance, sys_service)