Exemplo n.º 1
0
 def run_with_creds(self, client_configuration, rest_key: str, name: str, password: str = None, clean=False,
                    free=True):
     """
     Run user modifying command
     """
     app = IgniteApplicationService(
         self.test_context,
         client_configuration,
         java_class_name="org.apache.ignite.internal.ducktest.tests.authentication.UserModifyingApplication",
         params={"rest_key": rest_key,
                 "username": name,
                 "password": password}
     )
     app.start(clean=clean)
     app.stop()
     if free:
         app.free()
Exemplo n.º 2
0
    def node_join_historical_test(self, ignite_version, backups, cache_count,
                                  entry_count, entry_size, preloaders,
                                  thread_pool_size, batch_size,
                                  batches_prefetch_count, throttle):
        """
        Test historycal rebalance.
        """

        preload_entries = 10_000

        reb_params = RebalanceParams(
            trigger_event=TriggerEvent.NODE_JOIN,
            backups=backups,
            cache_count=cache_count,
            entry_count=entry_count,
            entry_size=entry_size,
            preloaders=preloaders,
            thread_pool_size=thread_pool_size,
            batch_size=batch_size,
            batches_prefetch_count=batches_prefetch_count,
            throttle=throttle,
            persistent=True,
            jvm_opts=[
                '-DIGNITE_PDS_WAL_REBALANCE_THRESHOLD=0',
                '-DIGNITE_PREFER_WAL_REBALANCE=true'
            ])

        ignites = start_ignite(self.test_context, ignite_version, reb_params)

        control_utility = ControlUtility(ignites)
        control_utility.activate()

        preloader_config = ignites.config._replace(
            client_mode=True, discovery_spi=from_ignite_cluster(ignites))

        preloader = IgniteApplicationService(
            self.test_context,
            preloader_config,
            java_class_name=
            "org.apache.ignite.internal.ducktest.tests.rebalance.DataGenerationApplication",
            params={
                "backups": 1,
                "cacheCount": 1,
                "entrySize": 1,
                "from": 0,
                "to": preload_entries
            })

        preloader.run()
        preloader.free()

        control_utility.deactivate()
        control_utility.activate()

        node = ignites.nodes[-1]

        ignites.stop_node(node)
        assert ignites.wait_node(node)

        preload_time = preload_data(
            self.test_context,
            ignites.config._replace(
                client_mode=True, discovery_spi=from_ignite_cluster(ignites)),
            rebalance_params=reb_params)

        control_utility.deactivate()
        control_utility.activate()

        self.logger.debug(
            f'DB size before rebalance: {get_database_size_mb(ignites.nodes, ignites.database_dir)}'
        )

        ignites.start_node(node)
        ignites.await_started()

        rebalance_nodes = [node]

        await_and_check_rebalance(ignites, rebalance_nodes, False)

        result = get_result(rebalance_nodes, preload_time, cache_count,
                            entry_count, entry_size)

        control_utility.deactivate()

        self.logger.debug(
            f'DB size after rebalance: {get_database_size_mb(ignites.nodes, ignites.database_dir)}'
        )

        return result