wxyu c26513a035 MS-488 Improve code format in scheduler
Former-commit-id: e6051b03b5fa09ff5e1e20af65724efb86520edf
2019-09-05 19:58:54 +08:00

54 lines
1.1 KiB
C++

/*******************************************************************************
* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited.
* Proprietary and confidential.
******************************************************************************/
#pragma once
#include <string>
#include <sstream>
namespace zilliz {
namespace milvus {
namespace engine {
class Connection {
public:
// TODO: update construct function, speed: double->uint64_t
Connection(std::string name, double speed)
: name_(std::move(name)), speed_(speed) {}
const std::string &
name() const {
return name_;
}
uint64_t
speed() const {
return speed_;
}
uint64_t
transport_cost() {
return 1024 / speed_;
}
public:
std::string
Dump() const {
std::stringstream ss;
ss << "<name: " << name_ << ", speed: " << speed_ << ">";
return ss.str();
}
private:
std::string name_;
uint64_t speed_;
};
}
}
}