ConfigurableClientList::getStatus() const {
vector<DataSourceStatus> result;
BOOST_FOREACH(const DataSourceInfo& info, data_sources_) {
- MemorySegmentState segment_state = SEGMENT_UNUSED;
- if (info.cache_) {
- if (info.ztable_segment_ && info.ztable_segment_->isUsable()) {
- segment_state = SEGMENT_INUSE;
- } else {
- segment_state = SEGMENT_WAITING;
- }
- }
-
- std::string segment_type;
if (info.ztable_segment_) {
- segment_type = info.ztable_segment_->getImplType();
+ result.push_back(DataSourceStatus(
+ info.name_,
+ (info.ztable_segment_->isUsable() ?
+ SEGMENT_INUSE : SEGMENT_WAITING),
+ info.ztable_segment_->getImplType()));
+ } else {
+ result.push_back(DataSourceStatus(info.name_, SEGMENT_UNUSED));
}
-
- result.push_back(DataSourceStatus(info.name_, segment_state,
- segment_type));
}
return (result);
}
/// Sets initial values. It doesn't matter what is provided for the type
/// if state is SEGMENT_UNUSED, the value is effectively ignored.
DataSourceStatus(const std::string& name, MemorySegmentState state,
- const std::string& type) :
+ const std::string& type = std::string()) :
name_(name),
type_(type),
state_(state)