@Override public boolean isValid() { if (getSessionId() == null) { _logger.error("liveInstance does not have session id. id:" + _record.getId()); return false; } if (getHelixVersion() == null) { _logger.error("liveInstance does not have CLM verion. id:" + _record.getId()); return false; } return true; } }
@Override public boolean isValid() { if (getSessionId() == null) { _logger.error("liveInstance does not have session id. id:" + _record.getId()); return false; } if (getHelixVersion() == null) { _logger.error("liveInstance does not have CLM verion. id:" + _record.getId()); return false; } return true; } }
String participantVersion = null; if (liveInstance != null) { participantVersion = liveInstance.getHelixVersion();
String participantVersion = null; if (liveInstance != null) { participantVersion = liveInstance.getHelixVersion();
@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; LogUtil.logError(LOG, event.getEventId(), errorMsg); throw new StageException(errorMsg); } } } }
@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; LogUtil.logError(LOG, event.getEventId(), errorMsg); throw new StageException(errorMsg); } } } }