Exemple #1
0
static void
writeQuorumGraph(Config const& cfg, std::string const& outputFile)
{
    InferredQuorum iq;
    {
        VirtualClock clock;
        Application::pointer app = Application::create(clock, cfg);
        iq = app->getHistoryManager().inferQuorum();
    }
    std::string filename = outputFile.empty() ? "-" : outputFile;
    if (filename == "-")
    {
        std::stringstream out;
        iq.writeQuorumGraph(cfg, out);
        LOG(INFO) << "*";
        LOG(INFO) << "* Quorum graph: " << out.str();
        LOG(INFO) << "*";
    }
    else
    {
        std::ofstream out(filename);
        iq.writeQuorumGraph(cfg, out);
        LOG(INFO) << "*";
        LOG(INFO) << "* Wrote quorum graph to " << filename;
        LOG(INFO) << "*";
    }
}
Exemple #2
0
static void
checkQuorumIntersection(Config const& cfg)
{
    VirtualClock clock;
    Application::pointer app = Application::create(clock, cfg);
    InferredQuorum iq = app->getHistoryManager().inferQuorum();
    iq.checkQuorumIntersection(cfg);
}
Exemple #3
0
static void
inferQuorumAndWrite(Config const& cfg)
{
    InferredQuorum iq;
    {
        VirtualClock clock;
        Application::pointer app = Application::create(clock, cfg);
        iq = app->getHistoryManager().inferQuorum();
    }
    LOG(INFO) << "Inferred quorum";
    std::cout << iq.toString(cfg) << std::endl;
}