Exemple #1
0
    def __init__(self, args, cluster):
        super(ActionBalance, self).__init__(args, cluster)

        self.balance_types = dict((cls.name, cls) for cls in get_modules(kafka.tools.assigner.actions.balancemodules, ActionBalanceModule))

        # Initialize all the modules to use
        self.modules = []
        for bmodule in args.types:
            self.modules.append(self.balance_types[bmodule](args, cluster))
Exemple #2
0
    def __init__(self, args, cluster):
        super(ActionBalance, self).__init__(args, cluster)

        self.balance_types = dict((cls.name, cls) for cls in get_modules(kafka.tools.assigner.actions.balancemodules, ActionBalanceModule))

        # Initialize all the modules to use
        self.modules = []
        for bmodule in args.types:
            self.modules.append(self.balance_types[bmodule](args, cluster))
Exemple #3
0
 def _add_args(cls, parser):
     # We'll need to build this list here as well as in the constructor
     balance_actions = get_modules(
         kafka.tools.assigner.actions.balancemodules, ActionBalanceModule)
     parser.add_argument(
         '-t',
         '--types',
         help=
         "Balance types to perform. Multiple may be specified and they will be run in order",
         required=True,
         choices=[klass.name for klass in balance_actions],
         nargs='*')
Exemple #4
0
 def create_action_map(self):
     self.action_map = dict(
         (cls.name, cls)
         for cls in get_modules(kafka.tools.assigner.actions,
                                kafka.tools.assigner.actions.ActionModule))
Exemple #5
0
def get_plugins_list():
    return get_modules(kafka.tools.assigner.plugins,
                       kafka.tools.assigner.plugins.PluginModule)
Exemple #6
0
def get_module_map(base_module_name, base_module_class):
    return dict((cls.name, cls)
                for cls in get_modules(base_module_name, base_module_class))
 def create_action_map(self):
     self.action_map = dict((cls.name, cls) for cls in get_modules(kafka.tools.assigner.actions, kafka.tools.assigner.actions.ActionModule))
Exemple #8
0
 def test_get_modules(self):
     module_list = get_modules(tests.tools.assigner.fixturemodules, tests.tools.assigner.fixturemodules.ModuleTesterBaseClass)
     assert module_list == [ModuleInheritedFromBase]
Exemple #9
0
def get_plugins_list():
    return get_modules(kafka.tools.assigner.plugins, kafka.tools.assigner.plugins.PluginModule)
Exemple #10
0
def get_module_map(base_module_name, base_module_class):
    return dict((cls.name, cls) for cls in get_modules(base_module_name, base_module_class))
Exemple #11
0
def get_sizer_map():
    return dict((cls.name, cls) for cls in get_modules(kafka.tools.assigner.sizers, kafka.tools.assigner.sizers.SizerModule))
Exemple #12
0
def get_action_map():
    return dict((cls.name, cls) for cls in get_modules(kafka.tools.assigner.actions, kafka.tools.assigner.actions.ActionModule))
Exemple #13
0
 def _add_args(cls, parser):
     # We'll need to build this list here as well as in the constructor
     balance_actions = get_modules(kafka.tools.assigner.actions.balancemodules, ActionBalanceModule)
     parser.add_argument('-t', '--types', help="Balance types to perform. Multiple may be specified and they will be run in order", required=True,
                         choices=[klass.name for klass in balance_actions], nargs='*')