@Override
public void dropStat(String clusterName, final String statName)
{
if (!ZKUtil.isClusterSetup(clusterName, _zkClient))
{
throw new HelixException("cluster " + clusterName + " is not setup yet");
}
String persistentStatsPath =
PropertyPathConfig.getPath(PropertyType.PERSISTENTSTATS, clusterName);
ZkBaseDataAccessor<ZNRecord> baseAccessor =
new ZkBaseDataAccessor<ZNRecord>(_zkClient);
baseAccessor.update(persistentStatsPath, new DataUpdater<ZNRecord>()
{
@Override
public ZNRecord update(ZNRecord statsRec)
{
if (statsRec == null)
{
throw new HelixException("No stats record in ZK, nothing to drop");
}
Map<String, Map<String, String>> currStatMap = statsRec.getMapFields();
Map<String, Map<String, String>> newStatMap = StatsHolder.parseStat(statName);