CompactionManager: Switch to the update compaction history API

This changes the CompactionManager getCompactionHistory to use the new
get_compaction_history API.

It uses the CompactionHistoryTabularData to parse and report the
results.

After this patch nodetool compactionhistory would work.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
This commit is contained in:
Amnon Heiman 2015-12-16 14:52:21 +02:00
parent 8e7c432374
commit 107664dbf1
1 changed files with 6 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import java.util.*;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.management.openmbean.OpenDataException;
import javax.management.openmbean.TabularData;
import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;
@ -84,7 +85,11 @@ public class CompactionManager implements CompactionManagerMBean {
/** compaction history **/
public TabularData getCompactionHistory() {
log(" getCompactionHistory()");
return c.getCQLResult("SELECT * from system.compaction_history");
try {
return CompactionHistoryTabularData.from(c.getJsonArray("/compaction_manager/compaction_history"));
} catch (OpenDataException e) {
return null;
}
}
/**