ColumnFamilyStore: getSSTableCountPerLevel should return null not empty array

When getSSTableCountPerLevel is called and the system is not using level
compaction the expected return is null and not an empty array.

This fix (scylla-jmx)
Fixes #11

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
This commit is contained in:
Amnon Heiman 2015-12-03 12:15:15 +02:00 committed by Pekka Enberg
parent e194ca85a4
commit 3a69e3d9da

View File

@ -670,8 +670,14 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
*/
public int[] getSSTableCountPerLevel() {
log(" getSSTableCountPerLevel()");
return c.getIntArrValue(
int[] res = c.getIntArrValue(
"column_family/sstables/per_level/" + getCFName());
if (res.length == 0) {
// no sstable count
// should return null
return null;
}
return res;
}
/**