Package org.apache.helix.model

Examples of org.apache.helix.model.PersistentStats


    return stats;
  }

  public void updateCache(HealthDataCache cache) {
    _cache = cache;
    PersistentStats persistentStatRecord = _cache.getPersistentStats();
    if (persistentStatRecord != null) {
      _statMap = persistentStatRecord.getMapFields();
    } else {
      _statMap = new HashMap<String, Map<String, String>>();
    }
  }
View Full Code Here


    // read the state model definitions
    Map<StateModelDefId, StateModelDefinition> stateModelMap = readStateModelDefinitions();

    // read the stats
    PersistentStats stats = _accessor.getProperty(_keyBuilder.persistantStat());

    // read the alerts
    Alerts alerts = _accessor.getProperty(_keyBuilder.alerts());

    // create the cluster snapshot object
View Full Code Here

      _removedConstraints = Maps.newHashMap();
      for (ConstraintType type : ConstraintType.values()) {
        Set<ConstraintId> constraints = Sets.newHashSet();
        _removedConstraints.put(type, constraints);
      }
      _removedStats = new PersistentStats(PersistentStats.nodeName);
      _removedAlerts = new Alerts(Alerts.nodeName);
      _builder = new Builder(clusterId);
    }
View Full Code Here

      // get the result
      ClusterConfig result = builder.build();

      // remove stats
      PersistentStats stats = result.getStats();
      for (String removedStat : _removedStats.getMapFields().keySet()) {
        if (stats.getMapFields().containsKey(removedStat)) {
          stats.getMapFields().remove(removedStat);
        }
      }

      // remove alerts
      Alerts alerts = result.getAlerts();
View Full Code Here

      _constraintMap = new HashMap<ConstraintType, ClusterConstraints>();
      _stateModelMap = new HashMap<StateModelDefId, StateModelDefinition>();
      _isPaused = false;
      _autoJoin = false;
      _userConfig = new UserConfig(Scope.cluster(id));
      _stats = new PersistentStats(PersistentStats.nodeName);
      _alerts = new Alerts(Alerts.nodeName);
    }
View Full Code Here

    // DataAccessor accessor = manager.getDataAccessor();
    HelixDataAccessor accessor = manager.getHelixDataAccessor();
    // boolean retVal = accessor.setProperty(PropertyType.PERSISTENTSTATS, record);
    Builder keyBuilder = accessor.keyBuilder();
    boolean retVal = accessor.setProperty(keyBuilder.persistantStat(), new PersistentStats(record));
    if (retVal == false) {
      logger.error("attempt to persist derived stats failed");
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.helix.model.PersistentStats

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.