Ejemplo n.º 1
0
static void start_application(session &sess, const std::string &app_name)
{
    key key_id = app_name;
    key_id.transform(sess);
    dnet_id id = key_id.id();

    ELLIPTICS_REQUIRE(result, sess.exec(&id, app_name + "@start-task", data_pointer()));
}
Ejemplo n.º 2
0
static void init_application_impl(session &sess, const std::string &app_name, nodes_data &data)
{
    node_info info = node_info::create(data, sess.get_groups());

    ELLIPTICS_REQUIRE(exec_result, sess.exec(NULL, app_name + "@init", info.pack()));

    sync_exec_result result = exec_result;
    BOOST_REQUIRE_EQUAL(result.size(), data.nodes.size());
    for (auto it = result.begin(); it != result.end(); ++it)
        BOOST_REQUIRE_EQUAL(it->context().data().to_string(), "inited");
}
Ejemplo n.º 3
0
static void send_echo(session &sess, const std::string &app_name, const std::string &data)
{
    key key_id = app_name;
    key_id.transform(sess);
    dnet_id id = key_id.id();

    ELLIPTICS_REQUIRE(exec_result, sess.exec(&id, app_name + "@echo", data));

    sync_exec_result result = exec_result;
    BOOST_REQUIRE_EQUAL(result.size(), 1);
    BOOST_REQUIRE_EQUAL(result[0].context().data().to_string(), data);
}
Ejemplo n.º 4
0
void init_application_impl(session &sess, const std::string &app_name, const nodes_data *setup)
{
	sess.set_timeout(600);
	auto log = sess.get_logger();
	DNET_LOG_INFO(log, "Sending @init");

	node_info info = node_info_create(setup, sess.get_groups());

	ELLIPTICS_REQUIRE(exec_result, sess.exec(NULL, app_name + "@init", info.pack()));

	sync_exec_result result = exec_result;
	BOOST_REQUIRE_EQUAL(result.size(), setup->nodes.size());
	for (auto it = result.begin(); it != result.end(); ++it)
		BOOST_REQUIRE_EQUAL(it->context().data().to_string(), "inited");
}
Ejemplo n.º 5
0
static void init_application(session &sess, const std::string &app_name)
{
    key key_id = app_name;
    key_id.transform(sess);
    dnet_id id = key_id.id();

    node_info info;
    info.groups = { 1 };
    info.path = global_data->directory.path();

    for (auto it = global_data->nodes.begin(); it != global_data->nodes.end(); ++it)
        info.remotes.push_back(it->remote());

    ELLIPTICS_REQUIRE(exec_result, sess.exec(&id, app_name + "@init", info.pack()));

    sync_exec_result result = exec_result;
    BOOST_REQUIRE_EQUAL(result.size(), 1);
    BOOST_REQUIRE_EQUAL(result[0].context().data().to_string(), "inited");
}
Ejemplo n.º 6
0
static void start_application(session &sess, const std::string &app_name)
{
    ELLIPTICS_REQUIRE(result, sess.exec(NULL, app_name + "@start-task", data_pointer()));
}