<commit_before>// Copyright (c) 2015, Galaxy Authors. All Rights Reserved
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Author: <EMAIL>

#include "master_impl.h"

#include <cmath>
#include <vector>
#include <queue>
#include <boost/lexical_cast.hpp>
#include "proto/agent.pb.h"
#include "rpc/rpc_client.h"
#include "common/timer.h"
#include <gflags/gflags.h>

DECLARE_int32(task_deploy_timeout);
DECLARE_int32(agent_keepalive_timeout);
DECLARE_string(master_checkpoint_path);
DECLARE_int32(master_max_len_sched_task_list);
DECLARE_int32(master_safe_mode_last);

namespace galaxy {
//agent load id index
typedef boost::multi_index::nth_index<AgentLoadIndex,0>::type agent_id_index;
//agent load cpu left index
typedef boost::multi_index::nth_index<AgentLoadIndex,1>::type cpu_left_index;

std::string TAG_KEY_PREFIX = "TAG::";
struct KillPriorityCell {
    int64_t priority;
    int64_t task_id;
    std::string agent_addr;
};

class KillPriorityComp {
public:   
    bool operator() (const KillPriorityCell& left, 
            const KillPriorityCell& right) {
        return left.priority < right.priority; 
    }
};
std::string TAG_KEY_PREFIX = "TAG::";

MasterImpl::MasterImpl()
    : next_agent_id_(1),
      next_job_id_(1),
      next_task_id_(1),
      rpc_client_(NULL),
      is_safe_mode_(false),
      start_time_(0),
      persistence_handler_(NULL) {
    rpc_client_ = new RpcClient();
    thread_pool_.AddTask(boost::bind(&MasterImpl::Schedule, this));
    thread_pool_.AddTask(boost::bind(&MasterImpl::DeadCheck, this));
}

bool MasterImpl::Recover() {<commit_msg>fix compile error<commit_after>// Copyright (c) 2015, Galaxy Authors. All Rights Reserved
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Author: <EMAIL>

#include "master_impl.h"

#include <cmath>
#include <vector>
#include <queue>
#include <boost/lexical_cast.hpp>
#include "proto/agent.pb.h"
#include "rpc/rpc_client.h"
#include "common/timer.h"
#include <gflags/gflags.h>

DECLARE_int32(task_deploy_timeout);
DECLARE_int32(agent_keepalive_timeout);
DECLARE_string(master_checkpoint_path);
DECLARE_int32(master_max_len_sched_task_list);
DECLARE_int32(master_safe_mode_last);

namespace galaxy {
//agent load id index
typedef boost::multi_index::nth_index<AgentLoadIndex,0>::type agent_id_index;
//agent load cpu left index
typedef boost::multi_index::nth_index<AgentLoadIndex,1>::type cpu_left_index;

std::string TAG_KEY_PREFIX = "TAG::";
struct KillPriorityCell {
    int64_t priority;
    int64_t task_id;
    std::string agent_addr;
};

class KillPriorityComp {
public:   
    bool operator() (const KillPriorityCell& left, 
            const KillPriorityCell& right) {
        return left.priority < right.priority; 
    }
};

MasterImpl::MasterImpl()
    : next_agent_id_(1),
      next_job_id_(1),
      next_task_id_(1),
      rpc_client_(NULL),
      is_safe_mode_(false),
      start_time_(0),
      persistence_handler_(NULL) {
    rpc_client_ = new RpcClient();
    thread_pool_.AddTask(boost::bind(&MasterImpl::Schedule, this));
    thread_pool_.AddTask(boost::bind(&MasterImpl::DeadCheck, this));
}

bool MasterImpl::Recover() {
{'fraction_non_alphanumeric': 0.12192118226600986, 'fraction_numerical': 0.013546798029556651, 'mean_word_length': 5.00554528650647, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5364003', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1072, 'n_words': 229}