Search in sources :

Example 1 with HelixManagerProperties

use of org.apache.helix.HelixManagerProperties in project helix by apache.

the class CompatibilityCheckStage method process.

@Override
public void process(ClusterEvent event) throws Exception {
    HelixManager manager = event.getAttribute(AttributeName.helixmanager.name());
    ClusterDataCache cache = event.getAttribute(AttributeName.ClusterDataCache.name());
    if (manager == null || cache == null) {
        throw new StageException("Missing attributes in event:" + event + ". Requires HelixManager | DataCache");
    }
    HelixManagerProperties properties = manager.getProperties();
    Map<String, LiveInstance> liveInstanceMap = cache.getLiveInstances();
    for (LiveInstance liveInstance : liveInstanceMap.values()) {
        String participantVersion = liveInstance.getHelixVersion();
        if (!properties.isParticipantCompatible(participantVersion)) {
            String errorMsg = "incompatible participant. pipeline will not continue. " + "controller: " + manager.getInstanceName() + ", controllerVersion: " + properties.getVersion() + ", minimumSupportedParticipantVersion: " + properties.getProperty("miminum_supported_version.participant") + ", participant: " + liveInstance.getInstanceName() + ", participantVersion: " + participantVersion;
            LOG.error(errorMsg);
            throw new StageException(errorMsg);
        }
    }
}
Also used : HelixManagerProperties(org.apache.helix.HelixManagerProperties) HelixManager(org.apache.helix.HelixManager) LiveInstance(org.apache.helix.model.LiveInstance) StageException(org.apache.helix.controller.pipeline.StageException)

Aggregations

HelixManager (org.apache.helix.HelixManager)1 HelixManagerProperties (org.apache.helix.HelixManagerProperties)1 StageException (org.apache.helix.controller.pipeline.StageException)1 LiveInstance (org.apache.helix.model.LiveInstance)1