storage_service: Stub get_load

Needed by API.
This commit is contained in:
Asias He
2015-08-28 13:16:55 +08:00
parent d7736062ef
commit 21874eb8eb
2 changed files with 19 additions and 14 deletions

View File

@@ -1468,4 +1468,19 @@ future<> storage_service::drain() {
return make_ready_future<>();
}
double storage_service::get_load() {
double bytes = 0;
#if 0
for (String keyspaceName : Schema.instance.getKeyspaces())
{
Keyspace keyspace = Schema.instance.getKeyspaceInstance(keyspaceName);
if (keyspace == null)
continue;
for (ColumnFamilyStore cfs : keyspace.getColumnFamilyStores())
bytes += cfs.getLiveDiskSpaceUsed();
}
#endif
return bytes;
}
} // namespace service

View File

@@ -963,22 +963,12 @@ private:
return changedRanges;
}
#endif
public:
/** raw load value */
public double getLoad()
{
double bytes = 0;
for (String keyspaceName : Schema.instance.getKeyspaces())
{
Keyspace keyspace = Schema.instance.getKeyspaceInstance(keyspaceName);
if (keyspace == null)
continue;
for (ColumnFamilyStore cfs : keyspace.getColumnFamilyStores())
bytes += cfs.getLiveDiskSpaceUsed();
}
return bytes;
}
double get_load();
#if 0
public String getLoadString()
{
return FileUtils.stringifyFileSize(getLoad());